@arcgis/core 4.27.0-next.20230515 → 4.27.0-next.20230516

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 (379) hide show
  1. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  2. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  3. package/arcade/functions/string.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/0618fb0058f39ecd363f.js +1 -0
  6. package/assets/esri/core/workers/chunks/62d9d15f0d00a75da42c.js +1 -0
  7. package/assets/esri/core/workers/chunks/93ad67930aa7d4a4b0ac.js +1 -0
  8. package/assets/esri/core/workers/chunks/953407451813f406fdf1.js +1 -0
  9. package/assets/esri/core/workers/chunks/a507135977d83aea4421.js +1 -0
  10. package/assets/esri/core/workers/chunks/b91c155de9a89e4e6971.js +1 -0
  11. package/assets/esri/core/workers/chunks/cbe817e966b57599bafd.js +1 -0
  12. package/assets/esri/core/workers/chunks/d95ca50ca7af4c222036.js +1 -0
  13. package/assets/esri/core/workers/chunks/e1e0b3580e2c3098c9f4.js +1 -0
  14. package/assets/esri/core/workers/chunks/ef141014ed21a7fd1ff3.js.LICENSE.txt +1 -1
  15. package/assets/esri/t9n/common_ar.json +1 -1
  16. package/assets/esri/t9n/common_bg.json +1 -1
  17. package/assets/esri/t9n/common_bs.json +1 -1
  18. package/assets/esri/t9n/common_ca.json +1 -1
  19. package/assets/esri/t9n/common_cs.json +1 -1
  20. package/assets/esri/t9n/common_da.json +1 -1
  21. package/assets/esri/t9n/common_de.json +1 -1
  22. package/assets/esri/t9n/common_el.json +1 -1
  23. package/assets/esri/t9n/common_es.json +1 -1
  24. package/assets/esri/t9n/common_et.json +1 -1
  25. package/assets/esri/t9n/common_fi.json +1 -1
  26. package/assets/esri/t9n/common_fr.json +1 -1
  27. package/assets/esri/t9n/common_he.json +1 -1
  28. package/assets/esri/t9n/common_hr.json +1 -1
  29. package/assets/esri/t9n/common_hu.json +1 -1
  30. package/assets/esri/t9n/common_id.json +1 -1
  31. package/assets/esri/t9n/common_it.json +1 -1
  32. package/assets/esri/t9n/common_ja.json +1 -1
  33. package/assets/esri/t9n/common_ko.json +1 -1
  34. package/assets/esri/t9n/common_lt.json +1 -1
  35. package/assets/esri/t9n/common_lv.json +1 -1
  36. package/assets/esri/t9n/common_nb.json +1 -1
  37. package/assets/esri/t9n/common_nl.json +1 -1
  38. package/assets/esri/t9n/common_pl.json +1 -1
  39. package/assets/esri/t9n/common_pt-BR.json +1 -1
  40. package/assets/esri/t9n/common_pt-PT.json +1 -1
  41. package/assets/esri/t9n/common_ro.json +1 -1
  42. package/assets/esri/t9n/common_ru.json +1 -1
  43. package/assets/esri/t9n/common_sk.json +1 -1
  44. package/assets/esri/t9n/common_sl.json +1 -1
  45. package/assets/esri/t9n/common_sr.json +1 -1
  46. package/assets/esri/t9n/common_sv.json +1 -1
  47. package/assets/esri/t9n/common_th.json +1 -1
  48. package/assets/esri/t9n/common_tr.json +1 -1
  49. package/assets/esri/t9n/common_uk.json +1 -1
  50. package/assets/esri/t9n/common_vi.json +1 -1
  51. package/assets/esri/t9n/common_zh-CN.json +1 -1
  52. package/assets/esri/t9n/common_zh-HK.json +1 -1
  53. package/assets/esri/t9n/common_zh-TW.json +1 -1
  54. package/assets/esri/themes/base/_core.scss +2 -0
  55. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +198 -125
  56. package/assets/esri/themes/base/widgets/_Features.scss +57 -0
  57. package/assets/esri/themes/base/widgets/_Popup.scss +3 -0
  58. package/assets/esri/themes/dark/main.css +1 -1
  59. package/assets/esri/themes/light/main.css +1 -1
  60. package/assets/esri/themes/light/view.css +1 -1
  61. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery.json +1 -1
  62. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_en.json +1 -1
  63. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ar.json +1 -1
  64. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bg.json +1 -1
  65. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bs.json +1 -1
  66. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ca.json +1 -1
  67. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_cs.json +1 -1
  68. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_da.json +1 -1
  69. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_de.json +1 -1
  70. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_el.json +1 -1
  71. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_es.json +1 -1
  72. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_et.json +1 -1
  73. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fi.json +1 -1
  74. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fr.json +1 -1
  75. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_he.json +1 -1
  76. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hr.json +1 -1
  77. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hu.json +1 -1
  78. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_id.json +1 -1
  79. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_it.json +1 -1
  80. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ja.json +1 -1
  81. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ko.json +1 -1
  82. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lt.json +1 -1
  83. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lv.json +1 -1
  84. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nb.json +1 -1
  85. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nl.json +1 -1
  86. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pl.json +1 -1
  87. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-BR.json +1 -1
  88. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-PT.json +1 -1
  89. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ro.json +1 -1
  90. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ru.json +1 -1
  91. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sk.json +1 -1
  92. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sl.json +1 -1
  93. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sr.json +1 -1
  94. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sv.json +1 -1
  95. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_th.json +1 -1
  96. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_tr.json +1 -1
  97. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_uk.json +1 -1
  98. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_vi.json +1 -1
  99. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-CN.json +1 -1
  100. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-HK.json +1 -1
  101. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-TW.json +1 -1
  102. package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
  103. package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
  104. package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
  105. package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
  106. package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
  107. package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
  108. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  109. package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
  110. package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
  111. package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
  112. package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
  113. package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
  114. package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
  115. package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
  116. package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
  117. package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
  118. package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
  119. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  120. package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
  121. package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
  122. package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
  123. package/assets/esri/widgets/Directions/t9n/Directions_nb.json +1 -1
  124. package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
  125. package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
  126. package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
  127. package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
  128. package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
  129. package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
  130. package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
  131. package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
  132. package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
  133. package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
  134. package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
  135. package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
  136. package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
  137. package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
  138. package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
  139. package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
  140. package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
  141. package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
  142. package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
  143. package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
  144. package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
  145. package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
  146. package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
  147. package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
  148. package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
  149. package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
  150. package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
  151. package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
  152. package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
  153. package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
  154. package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
  155. package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
  156. package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
  157. package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
  158. package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
  159. package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
  160. package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
  161. package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
  162. package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
  163. package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
  164. package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
  165. package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
  166. package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
  167. package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
  168. package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
  169. package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
  170. package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
  171. package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
  172. package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
  173. package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
  174. package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
  175. package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
  176. package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
  177. package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
  178. package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
  179. package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
  180. package/assets/esri/widgets/LayerList/t9n/LayerList_ar.json +1 -1
  181. package/assets/esri/widgets/LayerList/t9n/LayerList_bg.json +1 -1
  182. package/assets/esri/widgets/LayerList/t9n/LayerList_bs.json +1 -1
  183. package/assets/esri/widgets/LayerList/t9n/LayerList_ca.json +1 -1
  184. package/assets/esri/widgets/LayerList/t9n/LayerList_cs.json +1 -1
  185. package/assets/esri/widgets/LayerList/t9n/LayerList_da.json +1 -1
  186. package/assets/esri/widgets/LayerList/t9n/LayerList_de.json +1 -1
  187. package/assets/esri/widgets/LayerList/t9n/LayerList_el.json +1 -1
  188. package/assets/esri/widgets/LayerList/t9n/LayerList_es.json +1 -1
  189. package/assets/esri/widgets/LayerList/t9n/LayerList_et.json +1 -1
  190. package/assets/esri/widgets/LayerList/t9n/LayerList_fi.json +1 -1
  191. package/assets/esri/widgets/LayerList/t9n/LayerList_fr.json +1 -1
  192. package/assets/esri/widgets/LayerList/t9n/LayerList_he.json +1 -1
  193. package/assets/esri/widgets/LayerList/t9n/LayerList_hr.json +1 -1
  194. package/assets/esri/widgets/LayerList/t9n/LayerList_hu.json +1 -1
  195. package/assets/esri/widgets/LayerList/t9n/LayerList_id.json +1 -1
  196. package/assets/esri/widgets/LayerList/t9n/LayerList_it.json +1 -1
  197. package/assets/esri/widgets/LayerList/t9n/LayerList_ja.json +1 -1
  198. package/assets/esri/widgets/LayerList/t9n/LayerList_ko.json +1 -1
  199. package/assets/esri/widgets/LayerList/t9n/LayerList_lt.json +1 -1
  200. package/assets/esri/widgets/LayerList/t9n/LayerList_lv.json +1 -1
  201. package/assets/esri/widgets/LayerList/t9n/LayerList_nb.json +1 -1
  202. package/assets/esri/widgets/LayerList/t9n/LayerList_nl.json +1 -1
  203. package/assets/esri/widgets/LayerList/t9n/LayerList_pl.json +1 -1
  204. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-BR.json +1 -1
  205. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-PT.json +1 -1
  206. package/assets/esri/widgets/LayerList/t9n/LayerList_ro.json +1 -1
  207. package/assets/esri/widgets/LayerList/t9n/LayerList_ru.json +1 -1
  208. package/assets/esri/widgets/LayerList/t9n/LayerList_sk.json +1 -1
  209. package/assets/esri/widgets/LayerList/t9n/LayerList_sl.json +1 -1
  210. package/assets/esri/widgets/LayerList/t9n/LayerList_sr.json +1 -1
  211. package/assets/esri/widgets/LayerList/t9n/LayerList_sv.json +1 -1
  212. package/assets/esri/widgets/LayerList/t9n/LayerList_th.json +1 -1
  213. package/assets/esri/widgets/LayerList/t9n/LayerList_tr.json +1 -1
  214. package/assets/esri/widgets/LayerList/t9n/LayerList_uk.json +1 -1
  215. package/assets/esri/widgets/LayerList/t9n/LayerList_vi.json +1 -1
  216. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-CN.json +1 -1
  217. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-HK.json +1 -1
  218. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-TW.json +1 -1
  219. package/assets/esri/widgets/Slice/t9n/Slice_ar.json +1 -1
  220. package/assets/esri/widgets/Slice/t9n/Slice_bg.json +1 -1
  221. package/assets/esri/widgets/Slice/t9n/Slice_bs.json +1 -1
  222. package/assets/esri/widgets/Slice/t9n/Slice_ca.json +1 -1
  223. package/assets/esri/widgets/Slice/t9n/Slice_cs.json +1 -1
  224. package/assets/esri/widgets/Slice/t9n/Slice_da.json +1 -1
  225. package/assets/esri/widgets/Slice/t9n/Slice_de.json +1 -1
  226. package/assets/esri/widgets/Slice/t9n/Slice_el.json +1 -1
  227. package/assets/esri/widgets/Slice/t9n/Slice_es.json +1 -1
  228. package/assets/esri/widgets/Slice/t9n/Slice_et.json +1 -1
  229. package/assets/esri/widgets/Slice/t9n/Slice_fi.json +1 -1
  230. package/assets/esri/widgets/Slice/t9n/Slice_fr.json +1 -1
  231. package/assets/esri/widgets/Slice/t9n/Slice_he.json +1 -1
  232. package/assets/esri/widgets/Slice/t9n/Slice_hr.json +1 -1
  233. package/assets/esri/widgets/Slice/t9n/Slice_hu.json +1 -1
  234. package/assets/esri/widgets/Slice/t9n/Slice_id.json +1 -1
  235. package/assets/esri/widgets/Slice/t9n/Slice_it.json +1 -1
  236. package/assets/esri/widgets/Slice/t9n/Slice_ja.json +1 -1
  237. package/assets/esri/widgets/Slice/t9n/Slice_ko.json +1 -1
  238. package/assets/esri/widgets/Slice/t9n/Slice_lt.json +1 -1
  239. package/assets/esri/widgets/Slice/t9n/Slice_lv.json +1 -1
  240. package/assets/esri/widgets/Slice/t9n/Slice_nb.json +1 -1
  241. package/assets/esri/widgets/Slice/t9n/Slice_nl.json +1 -1
  242. package/assets/esri/widgets/Slice/t9n/Slice_pl.json +1 -1
  243. package/assets/esri/widgets/Slice/t9n/Slice_pt-BR.json +1 -1
  244. package/assets/esri/widgets/Slice/t9n/Slice_pt-PT.json +1 -1
  245. package/assets/esri/widgets/Slice/t9n/Slice_ro.json +1 -1
  246. package/assets/esri/widgets/Slice/t9n/Slice_ru.json +1 -1
  247. package/assets/esri/widgets/Slice/t9n/Slice_sk.json +1 -1
  248. package/assets/esri/widgets/Slice/t9n/Slice_sl.json +1 -1
  249. package/assets/esri/widgets/Slice/t9n/Slice_sr.json +1 -1
  250. package/assets/esri/widgets/Slice/t9n/Slice_sv.json +1 -1
  251. package/assets/esri/widgets/Slice/t9n/Slice_th.json +1 -1
  252. package/assets/esri/widgets/Slice/t9n/Slice_tr.json +1 -1
  253. package/assets/esri/widgets/Slice/t9n/Slice_uk.json +1 -1
  254. package/assets/esri/widgets/Slice/t9n/Slice_vi.json +1 -1
  255. package/assets/esri/widgets/Slice/t9n/Slice_zh-CN.json +1 -1
  256. package/assets/esri/widgets/Slice/t9n/Slice_zh-HK.json +1 -1
  257. package/assets/esri/widgets/Slice/t9n/Slice_zh-TW.json +1 -1
  258. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ar.json +1 -1
  259. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bg.json +1 -1
  260. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_bs.json +1 -1
  261. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ca.json +1 -1
  262. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_cs.json +1 -1
  263. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_da.json +1 -1
  264. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_de.json +1 -1
  265. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_el.json +1 -1
  266. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_es.json +1 -1
  267. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_et.json +1 -1
  268. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fi.json +1 -1
  269. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_fr.json +1 -1
  270. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_he.json +1 -1
  271. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hr.json +1 -1
  272. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_hu.json +1 -1
  273. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_id.json +1 -1
  274. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_it.json +1 -1
  275. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ja.json +1 -1
  276. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ko.json +1 -1
  277. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lt.json +1 -1
  278. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_lv.json +1 -1
  279. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nb.json +1 -1
  280. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_nl.json +1 -1
  281. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pl.json +1 -1
  282. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-BR.json +1 -1
  283. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_pt-PT.json +1 -1
  284. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ro.json +1 -1
  285. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_ru.json +1 -1
  286. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sk.json +1 -1
  287. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sl.json +1 -1
  288. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sr.json +1 -1
  289. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_sv.json +1 -1
  290. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_th.json +1 -1
  291. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_tr.json +1 -1
  292. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_uk.json +1 -1
  293. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_vi.json +1 -1
  294. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-CN.json +1 -1
  295. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-HK.json +1 -1
  296. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_zh-TW.json +1 -1
  297. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ar.json +1 -1
  298. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_bg.json +1 -1
  299. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_bs.json +1 -1
  300. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ca.json +1 -1
  301. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_cs.json +1 -1
  302. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_da.json +1 -1
  303. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_de.json +1 -1
  304. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_el.json +1 -1
  305. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_es.json +1 -1
  306. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_et.json +1 -1
  307. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_fi.json +1 -1
  308. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_fr.json +1 -1
  309. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_he.json +1 -1
  310. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_hr.json +1 -1
  311. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_hu.json +1 -1
  312. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_id.json +1 -1
  313. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_it.json +1 -1
  314. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ja.json +1 -1
  315. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ko.json +1 -1
  316. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_lt.json +1 -1
  317. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_lv.json +1 -1
  318. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_nb.json +1 -1
  319. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_nl.json +1 -1
  320. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_pl.json +1 -1
  321. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_pt-BR.json +1 -1
  322. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_pt-PT.json +1 -1
  323. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ro.json +1 -1
  324. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_ru.json +1 -1
  325. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sk.json +1 -1
  326. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sl.json +1 -1
  327. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sr.json +1 -1
  328. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_sv.json +1 -1
  329. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_th.json +1 -1
  330. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_tr.json +1 -1
  331. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_uk.json +1 -1
  332. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_vi.json +1 -1
  333. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_zh-CN.json +1 -1
  334. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_zh-HK.json +1 -1
  335. package/assets/esri/widgets/support/SnappingControls/t9n/SnappingControls_zh-TW.json +1 -1
  336. package/chunks/languageUtils.js +1 -1
  337. package/core/ReactiveMap.js +5 -0
  338. package/core/ReactiveSet.js +5 -0
  339. package/geometry/support/meshUtils/External.js +1 -1
  340. package/interfaces.d.ts +86 -54
  341. package/layers/SceneLayer.js +1 -1
  342. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  343. package/layers/graphics/sources/support/uploadAssets.js +1 -1
  344. package/layers/video/VideoEngine.js +1 -1
  345. package/package.json +2 -2
  346. package/support/basemapUtils.js +1 -1
  347. package/support/revision.js +1 -1
  348. package/symbols/cim/cimAnalyzer.js +1 -1
  349. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  350. package/views/2d/engine/webgl/brushes/WGLGeometryBrushFill.js +1 -1
  351. package/views/2d/engine/webgl/definitions.js +1 -1
  352. package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
  353. package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
  354. package/views/2d/engine/webgl/painter/RenderPass.js +1 -1
  355. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  356. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  357. package/views/2d/layers/MediaLayerView2D.js +1 -1
  358. package/views/2d/layers/TileLayerView2D.js +1 -1
  359. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  360. package/views/3d/webgl-engine/lib/RenderTargetHelper.js +1 -1
  361. package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
  362. package/views/PopupView.js +1 -1
  363. package/widgets/BasemapGallery/css.js +1 -1
  364. package/widgets/BasemapGallery.js +1 -1
  365. package/widgets/Feature/FeatureRelationship.js +1 -1
  366. package/widgets/Features/FeaturesViewModel.js +5 -0
  367. package/widgets/Features.js +5 -0
  368. package/widgets/Popup/actionUtils.js +1 -1
  369. package/widgets/Popup/actions.js +1 -1
  370. package/widgets/Popup.js +1 -1
  371. package/assets/esri/core/workers/chunks/08e1453cc3689a0094a6.js +0 -1
  372. package/assets/esri/core/workers/chunks/47f721daa1652124c066.js +0 -1
  373. package/assets/esri/core/workers/chunks/544dce9710638d126763.js +0 -1
  374. package/assets/esri/core/workers/chunks/630b3fca46208caf4190.js +0 -1
  375. package/assets/esri/core/workers/chunks/7e9b173a71beeba8b263.js +0 -1
  376. package/assets/esri/core/workers/chunks/b636581516f2e7342d29.js +0 -1
  377. package/assets/esri/core/workers/chunks/e7e7f6046cf1286365ca.js +0 -1
  378. package/assets/esri/core/workers/chunks/f17a7024dd49abeaa4f3.js +0 -1
  379. package/assets/esri/core/workers/chunks/f32836ee63bc55ea4338.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import r from"../../../Graphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import a from"../../../core/Error.js";import has from"../../../core/has.js";import{clone as n}from"../../../core/lang.js";import o from"../../../core/Logger.js";import{applySome as l,destroyMaybe as u,removeMaybe as d}from"../../../core/maybe.js";import{debounce as h,isAbortError as p}from"../../../core/promiseUtils.js";import{watch as c,syncAndInitial as y,initial as g}from"../../../core/reactiveUtils.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import _ from"../../../layers/effects/FeatureEffectView.js";import v from"../../../layers/support/FeatureFilter.js";import{getEffectiveLayerCapabilities as b}from"../../../layers/support/layerUtils.js";import R from"../../../rest/support/AggregateFeatureSet.js";import S from"../../../rest/support/FeatureSet.js";import w from"../../../rest/support/Query.js";import{MAX_FILTERS as x}from"../engine/webgl/definitions.js";import{LayerView2DMixin as F}from"./LayerView2D.js";import{createSchema as U}from"./features/schemaUtils.js";import{createOrReuseTileRenderer as C}from"./features/tileRenderers.js";import{isRendererSupported as q}from"./features/support/rendererUtils.js";import{findSizeVV as I,createClusterCountSizeVariable as O,injectDynamicLevelDependentSizeVisualVariable as V,isClusterCompatibleRenderer as E,createClusterRenderer as T}from"./support/clusterUtils.js";import j from"./support/FeatureCommandQueue.js";import A from"./support/FeatureLayerProxy.js";import{toJSONGeometryType as L}from"./support/util.js";import{TileManager as N}from"../tiling/TileManager.js";import Q from"../../layers/FeatureLayerView.js";import k from"../../layers/LayerView.js";import H from"../../layers/RefreshableLayerView.js";import{getWebGLCapabilities as P}from"../../webgl/capabilities.js";import J from"../../../geometry/Extent.js";function z(e){return e&&"openPorts"in e}let D=class extends(Q(H(F(k)))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new j({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=h((async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys())))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new _,this._lastDefinitionExpression=null}destroy(){l(this._updateClusterSizeTask,(e=>e.remove())),this._proxy?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.addHandles([this.on("valueRangesChanged",(e=>{this._set("_aggregateValueRanges",e.valueRanges)})),c((()=>this.featureEffect),(e=>{this.featureEffectView.featureEffect=e}),y)],"constructor"),this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new a("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});if(("feature"===e.type||"subtype-group"===e.type)&&!b(e)?.operations.supportsQuery)throw new a("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._proxy&&this._proxy.destroy();const t=this._createClientOptions();return this._set("_proxy",new A({client:t})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get _effectiveFeatureReduction(){if(!("featureReduction"in this.layer))return null;const e=this.layer.featureReduction;return e&&(!("maxScale"in e)||!e.maxScale||e.maxScale<this.view.scale)?e:null}get orderByFields(){return"stream"!==this._serviceOptions?.type?this._serviceOptions?.orderByFields:void 0}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get queryMode(){return this._serviceOptions?.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,t=this.layer,r=this.view.floors,{definitionExpression:i}=t,s="subtype-group"!==this.layer.type&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="gdbVersion"in t?t.gdbVersion:void 0,o="historicMoment"in t?t.historicMoment?.getTime():void 0,{timeExtent:l}=this,u="customParameters"in t?JSON.stringify(t.customParameters):void 0,d="apiKey"in t?t.apiKey:void 0,h="stream"===t.type?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,p=JSON.stringify(this.clips),c=this._effectiveFeatureReduction?.toJSON(),y="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),g="sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),""),f="subtypeCode"in this.layer&&this.layer.subtypeCode;return JSON.stringify({orderBy:y,sublayerHash:g,subtypeCode:f,filterHash:null!=this.filter&&this.filter.toJSON(),effectHash:null!=this.featureEffect&&this.featureEffect.toJSON(),streamFilter:h,gdbVersion:n,definitionExpression:i,historicMoment:o,availableFields:e,renderer:a,labelingInfo:s,timeExtent:l,floors:r,clipsHash:p,featureReduction:c,customParameters:u,apiKey:d})}highlight(e){let t;e instanceof r?t=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?t=[e]:s.isCollection(e)&&e.length>0?t=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(t="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId())));const a=t?.filter(i);return a&&a.length?(this._addHighlight(a),{remove:()=>this._removeHighlight(a)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,i){if(!this.tileRenderer)return null;const s=await this.tileRenderer.hitTest(i);if(0===s.length)return null;const{features:a,aggregates:n}=await this._proxy.getFeatures(s);return[...n.map((r=>this._createGraphicHit(e,t.fromJSON(r)))),...a.map((t=>this._createGraphicHit(e,r.fromJSON(t))))]}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),i,r)}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateSummaryStatistics(this._cleanUpAggregateQuery(e),i,r)}async queryUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),i,r)}async queryAggregateUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateUniqueValues(this._cleanUpAggregateQuery(e),i,r)}async queryClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),i,r)}async queryAggregateClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateClassBreaks(this._cleanUpAggregateQuery(e),i,r)}async queryHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),i,r)}async queryAggregateHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateHistogram(this._cleanUpAggregateQuery(e),i,r)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=S.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then((e=>{const t=S.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryAggregates(e,t){const r=await this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t),i=R.fromJSON(r);return i.features.forEach((e=>this._setLayersForFeature(e))),i}queryAggregateIds(e,t){return this._proxy.queryAggregateIds(this._cleanUpAggregateQuery(e),t)}queryAggregateCount(e,t){return this._proxy.queryAggregateCount(this._cleanUpAggregateQuery(e),t)}queryAggregateJSON(e,t){return this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t)}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then((e=>({count:e.count,extent:J.fromJSON(e.extent)})))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:r,removed:i}=this._tileStrategy.update(e);(r.length||i.length)&&this._proxy.updateTiles({added:r,removed:i}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new N({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.addAttachHandles(c((()=>this.renderingConfigHash),(()=>this._update()),g)),"stream"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",(e=>this._edit(e))))}detach(){this._commandsQueue.clear(),this._proxy?.stop(),this.container.removeAllChildren(),this.tileRenderer?.uninstall(this.container),this.tileRenderer=null,this._tileStrategy=u(this._tileStrategy),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updating,r=null!=this._updatingRequiredFieldsPromise,i=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,a=null==this.tileRenderer||this.tileRenderer?.updating,n=e&&(t||r||i||s||a);return has("esri-2d-log-updating")&&console.log(`Updating FLV2D (${this.layer.id}): ${n}\n -> hasRenderer ${e}\n -> hasPendingCommand ${t}\n -> updatingRequiredFields ${r}\n -> updatingProxy ${i}\n -> updatingPipeline ${s}\n -> updatingTileRenderer ${a}\n`),n}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){const t="path"in e,{layer:r}=this,i="editingInfo"in r&&r.editingInfo?.lastEditDate,s="refreshInterval"in r&&!!r.refreshInterval,a=!i&&s,n=b(r);if(t&&("feature"===r.type||"subtype-group"===r.type)&&"point"===r.geometryType&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!a&&has("featurelayer-snapshot-enabled"))try{const e=await r.queryFeatureCount();if(e<=has("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:e};const t=has("featurelayer-snapshot-point-max-threshold"),i=has("featurelayer-snapshot-point-coverage"),s=this.view.extent,a=r.fullExtent,n=a?.clone().intersection(s),o=null!=n?n.width*n.height:0,l=a?.width*a?.height;if(e<=t&&(0===l?0:o/l)>=i)return{mode:"snapshot",featureCount:e}}catch(l){o.getLogger(this).warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:l})}return{mode:"on-demand"}}async _createServiceOptions(){const e=this.layer;if("stream"===e.type)return null;const t=b(e),{capabilities:r,objectIdField:i}=e,s=e.fields.map((e=>e.toJSON())),a=null!=e.fullExtent?e.fullExtent.toJSON():null,o=L(e.geometryType),l="timeInfo"in e&&e.timeInfo&&e.timeInfo.toJSON()||null,u=e.spatialReference?e.spatialReference.toJSON():null,d="feature"===e.type?e.globalIdField:null;let h;"ogc-feature"===e.type?h=e.source.getSource():z(e.source)?h=await e.source.openPorts():e.parsedUrl&&(h=n(e.parsedUrl),"dynamicDataSource"in e&&e.dynamicDataSource&&(h.query={layer:JSON.stringify({source:e.dynamicDataSource})}));const p="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,c=("subtypeField"in this.layer?this.layer.subtypeField:null)??null,{mode:y,featureCount:g}=await this._detectQueryMode(h);let f=this.layer.objectIdField;if("feature"===this.layer.type&&null!=this.layer.orderBy&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(f=e)}return{type:y,timeReferenceUnknownClient:p,subtypeField:c,featureCount:g,globalIdField:d,maxRecordCount:r.query.maxRecordCount,tileMaxRecordCount:r.query.tileMaxRecordCount,capabilities:r,effectiveCapabilities:t,fields:s,fullExtent:a,geometryType:o,objectIdField:i,source:h,timeInfo:l,spatialReference:u,orderByFields:f,datesInUnknownTimezone:p,dateFieldsTimeReference:("dateFieldsTimeReference"in this.layer?this.layer.dateFieldsTimeReference?.toJSON():null)||null,preferredTimeReference:("preferredTimeReference"in this.layer?this.layer.preferredTimeReference?.toJSON():null)||null,editFieldsInfo:"editFieldsInfo"in this.layer?this.layer.editFieldsInfo?.toJSON():null}}async _createMemoryServiceOptions(e){const t=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:t}}_cleanUpQuery(e){const t=w.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}_cleanUpAggregateQuery(e){const t=w.from(e)||this.createAggregateQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.suspended)return void this._clearTiles();return this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){if(this.attached&&this._tileStrategy.tileKeys().length)return this.suspended&&e?void this._clearTiles():this._commandsQueue.push({type:"refresh",dataChanged:e})}_clearTiles(){this._tileStrategy.tileKeys().length&&(this._proxy.updateTiles({added:[],removed:this._tileStrategy.tileKeys()}),this._tileStrategy.clear(),this.requestUpdate(),this._commandsQueue.clear(),this._update())}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,r=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),i=t&&this.availableFields.includes(t);return r&&!i?(o.getLogger(this).error(new a("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:t,filter:r}=this;if(await this._updateRequiredFields(),this.destroyed)return;const{renderer:i}=this._getEffectiveRenderer();this._set("_effectiveRenderer",i);const s=this._createSchemaConfig(),a=this._createConfiguration(s,r,t.filter),n=this._lastDefinitionExpression!==a.schema.source.definitionExpression;this._lastDefinitionExpression=a.schema.source.definitionExpression;const l=a.schema.tileRenderer,u=this._createTileRendererHash(l);if("snapshot"===this._serviceOptions.type&&(a.schema.source.initialFeatureCount=this._serviceOptions.featureCount),u!==this._tileRendererHash){this._initTileRenderer(l,i);const e=this.layer,t="stream"===e.type?await this._initServiceOptions():this._serviceOptions;this.tileRenderer.onConfigUpdate(i),"stream"!==e.type&&z(e.source)&&(t.source=await e.source.openPorts());const r={added:this._tileStrategy.tileKeys(),removed:[]};has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Proxy startup"),await this._proxy.startup(this.view.featuresTilingScheme,a,t,r),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished proxy startup"),this.hasHighlight()&&(has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Updating highlight"),await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished highlight update")),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: onConfigUpdate start"),this.tileRenderer.onConfigUpdate(i),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: onConfigUpdate end")}else{"snapshot"===this._serviceOptions.type&&n&&(a.schema.source.changedFeatureCount=await this.layer.queryFeatureCount()),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Updating proxy");const t=await this._proxy.update(a);has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished proxy update"),(t.mesh||t.targets?.aggregate)&&(has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Locking GPU Uploads"),this._lockGPUUploads());try{has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Applying update to proxy"),await this._proxy.applyUpdate(t),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished applying update to proxy")}catch(e){p(e)||o.getLogger(this).error(e)}(t.mesh||t.targets?.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(i),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=u,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch(e){}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(t){p(t),0}}async _doRefresh(e){this._lockGPUUploads();try{let t;e&&"snapshot"===this.queryMode&&"queryFeatureCount"in this.layer&&(t=await this.layer.queryFeatureCount()),await this._proxy.refresh({dataChanged:e,featureCount:t})}catch(t){p(t),0}this._unlockGPUUploads(),this._effectiveFeatureReduction&&this._updateClusterSizeVariable()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,t){return c((()=>this._aggregateValueRanges),(r=>{this._updateClusterEffectiveRendererSizeVariable(e,t,r),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()}))}async _updateClusterEffectiveRendererSizeVariable(e,t,r){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const i=I(e.visualVariables);if(null!=i&&"cluster_count"===i.field){const s=e.visualVariables.indexOf(i);e.visualVariables[s]=O(t,r);const a=e.clone();a.dynamicClusterSize=!0,this._set("_effectiveRenderer",a)}}}_getEffectiveRenderer(){const e=this.layer,t="renderer"in e?e.renderer:null,r=this._effectiveFeatureReduction;if(this._updateClusterSizeTask=d(this._updateClusterSizeTask),r&&"renderer"in r&&r.renderer&&!r.renderer.authoringInfo?.isAutoGenerated){const e=r.fields;if("cluster"===r.type){const{renderer:t,didInject:i}=V(r.renderer,r,this._aggregateValueRanges);return i&&(this._updateClusterSizeTask=this._createUpdateClusterSizeTask(t,r)),{renderer:t,aggregateFields:e,featureReduction:r}}return{renderer:r.renderer,aggregateFields:e,featureReduction:r}}if(r&&"cluster"===r.type&&t&&E(t)){const e=r,i=[],s=T(i,t,e,this._aggregateValueRanges,!0);return this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,e),{renderer:s,aggregateFields:i,featureReduction:r}}return{renderer:t,aggregateFields:[],featureReduction:null}}_acquireTile(e){const t=this.tileRenderer.acquireTile(e);return t.once("attach",(()=>{this.requestUpdate()})),t}_releaseTile(e){this.tileRenderer.releaseTile(e)}_initTileRenderer(e,t){const r=C(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer=u(this.tileRenderer)),this.destroyed?null:(this._proxy.tileRenderer=r,this._set("tileRenderer",r),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(t),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${e.type}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const t=null!=e?e.timeExtent:null,r=null!=this.timeExtent&&null!=t?this.timeExtent.intersection(t):this.timeExtent||t;let i=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const t=null!=e?e.where:null;i=this._addFloorFilterClause(t)}if(!this._visibilityOverrides.size&&!r&&!s)return null!=e?e.toJSON():null;(e=null!=e&&e.clone()||new v).timeExtent=r,i&&(e.where=i);const a=e.toJSON();return a.hiddenIds=Array.from(this._visibilityOverrides),a}_addFloorFilterClause(e){const t=this.layer;let r=e||"";if("floorInfo"in t&&t.floorInfo){let e=this.view.floors;if(!e||!e.length)return r;t.floorInfo.viewAllLevelIds?.length&&(e=t.floorInfo.viewAllLevelIds);const i=e.filter((e=>""!==e)).map((e=>"'"+e+"'"));i.push("''");const s=t.floorInfo.floorField;let a="("+s+" IN ({ids}) OR "+s+" IS NULL)";if(a=a.replace("{ids}",i.join(", ")),null!=r&&r.includes(s)){let e=new RegExp("AND \\("+s+".*NULL\\)","g");r=r.replace(e,""),e=new RegExp("\\("+s+".*NULL\\)","g"),r=r.replace(e,""),r=r.replaceAll(/\s+/g," ").trim()}r=""!==r?"("+r+") AND "+a:a}return""!==r?r:null}_createConfiguration(e,t,r){const i="feature"===this.layer.type&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s="feature"===this.layer.type?this.layer.gdbVersion??void 0:void 0,a=new Array(x),n=this._injectOverrides(t);a[0]=n,a[1]=null!=r?r.toJSON():null;const o=U(e);if(null==o)return null;const l=P("2d");return{availableFields:this.availableFields,gdbVersion:s,historicMoment:i,devicePixelRatio:window.devicePixelRatio||1,filters:a,schema:o,supportsTextureFloat:l.supportsTextureFloat,maxTextureSize:l.maxTextureSize}}_hasRequiredSupport(e){return!("renderer"in e)||q(e.renderer)}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e=this.layer;return{renderer:"renderer"in e?e.renderer:null,spatialReference:e.spatialReference,timeExtent:"timeExtent"in e?e.timeExtent:null,definitionExpression:e.definitionExpression,featureReduction:this._effectiveFeatureReduction,fields:e.fields,geometryType:e.geometryType,historicMoment:"historicMoment"in e?e.historicMoment:null,labelsVisible:"labelsVisible"in e&&e.labelsVisible,labelingInfo:"labelingInfo"in e?e.labelingInfo:null,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:"gdbVersion"in e?e.gdbVersion:null,pixelBuffer:0,orderBy:"orderBy"in e&&e.orderBy?e.orderBy:null,customParameters:{..."customParameters"in e?e.customParameters:void 0,token:"apiKey"in e?e.apiKey??void 0:void 0},subtypeCode:"subtypeCode"in e?e.subtypeCode:void 0,subtypeField:"subtypeField"in e?e.subtypeField:void 0}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{p(e)||o.getLogger(this).error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{p(e)||o.getLogger(this).error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};e([f()],D.prototype,"_serviceOptions",void 0),e([f()],D.prototype,"_proxy",void 0),e([f()],D.prototype,"_pipelineIsUpdating",void 0),e([f()],D.prototype,"_effectiveRenderer",void 0),e([f()],D.prototype,"_effectiveFeatureReduction",null),e([f()],D.prototype,"_aggregateValueRanges",void 0),e([f()],D.prototype,"_commandsQueue",void 0),e([f()],D.prototype,"featureEffectView",void 0),e([f()],D.prototype,"labelsVisible",null),e([f({readOnly:!0})],D.prototype,"queryMode",null),e([f()],D.prototype,"renderingConfigHash",null),e([f()],D.prototype,"tileRenderer",void 0),e([f()],D.prototype,"updating",void 0),D=e([m("esri.views.2d.layers.FeatureLayerView2D")],D);const M=D;export{M as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import"../../../geometry.js";import r from"../../../Graphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import a from"../../../core/Error.js";import has from"../../../core/has.js";import{clone as n}from"../../../core/lang.js";import o from"../../../core/Logger.js";import{applySome as l,destroyMaybe as u,removeMaybe as d}from"../../../core/maybe.js";import{debounce as h,isAbortError as p}from"../../../core/promiseUtils.js";import{watch as c,syncAndInitial as y,initial as g}from"../../../core/reactiveUtils.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import _ from"../../../layers/effects/FeatureEffectView.js";import v from"../../../layers/support/FeatureFilter.js";import{getEffectiveLayerCapabilities as b}from"../../../layers/support/layerUtils.js";import R from"../../../rest/support/AggregateFeatureSet.js";import w from"../../../rest/support/FeatureSet.js";import S from"../../../rest/support/Query.js";import{MAX_FILTERS as x}from"../engine/webgl/definitions.js";import{LayerView2DMixin as F}from"./LayerView2D.js";import{createSchema as U}from"./features/schemaUtils.js";import{createOrReuseTileRenderer as C}from"./features/tileRenderers.js";import{isRendererSupported as q}from"./features/support/rendererUtils.js";import{findSizeVV as I,createClusterCountSizeVariable as O,injectDynamicLevelDependentSizeVisualVariable as V,isClusterCompatibleRenderer as E,createClusterRenderer as T}from"./support/clusterUtils.js";import j from"./support/FeatureCommandQueue.js";import A from"./support/FeatureLayerProxy.js";import{toJSONGeometryType as L}from"./support/util.js";import{TileManager as N}from"../tiling/TileManager.js";import Q from"../../layers/FeatureLayerView.js";import k from"../../layers/LayerView.js";import H from"../../layers/RefreshableLayerView.js";import{getWebGLCapabilities as P}from"../../webgl/capabilities.js";import J from"../../../geometry/Extent.js";function z(e){return e&&"openPorts"in e}let D=class extends(Q(H(F(k)))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new j({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=h((async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys())))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new _,this._lastDefinitionExpression=null}destroy(){l(this._updateClusterSizeTask,(e=>e.remove())),this._proxy?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.addHandles([this.on("valueRangesChanged",(e=>{this._set("_aggregateValueRanges",e.valueRanges)})),c((()=>this.featureEffect),(e=>{this.featureEffectView.featureEffect=e}),y)],"constructor"),this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new a("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});if(("feature"===e.type||"subtype-group"===e.type)&&!b(e)?.operations.supportsQuery)throw new a("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._proxy&&this._proxy.destroy();const t=this._createClientOptions();return this._set("_proxy",new A({client:t})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get _effectiveFeatureReduction(){if(!("featureReduction"in this.layer))return null;const e=this.layer.featureReduction;return e&&(!("maxScale"in e)||!e.maxScale||e.maxScale<this.view.scale)?e:null}get orderByFields(){return"stream"!==this._serviceOptions?.type?this._serviceOptions?.orderByFields:void 0}get labelsVisible(){const e="subtype-group"===this.layer.type?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some((e=>e.labelingInfo&&e.labelsVisible))}get queryMode(){return this._serviceOptions?.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,t=this.layer,r=this.view.floors,{definitionExpression:i}=t,s="subtype-group"!==this.layer.type&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="gdbVersion"in t?t.gdbVersion:void 0,o="historicMoment"in t?t.historicMoment?.getTime():void 0,{timeExtent:l}=this,u="customParameters"in t?JSON.stringify(t.customParameters):void 0,d="apiKey"in t?t.apiKey:void 0,h="stream"===t.type?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,p=JSON.stringify(this.clips),c=this._effectiveFeatureReduction?.toJSON(),y="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),g="sublayers"in this.layer&&this.layer.sublayers.items.reduce(((e,t)=>e+`${t.visible?1:0}.${JSON.stringify(t.renderer)}.${t.labelsVisible}\n.${JSON.stringify(t.labelingInfo)}`),""),f="subtypeCode"in this.layer&&this.layer.subtypeCode;return JSON.stringify({orderBy:y,sublayerHash:g,subtypeCode:f,filterHash:null!=this.filter&&this.filter.toJSON(),effectHash:null!=this.featureEffect&&this.featureEffect.toJSON(),streamFilter:h,gdbVersion:n,definitionExpression:i,historicMoment:o,availableFields:e,renderer:a,labelingInfo:s,timeExtent:l,floors:r,clipsHash:p,featureReduction:c,customParameters:u,apiKey:d})}highlight(e){let t;e instanceof r?t=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?t=[e]:s.isCollection(e)&&e.length>0?t=e.map((e=>e?.getObjectId())).toArray():Array.isArray(e)&&e.length>0&&(t="number"==typeof e[0]||"string"==typeof e[0]?e:e.map((e=>e?.getObjectId())));const a=t?.filter(i);return a&&a.length?(this._addHighlight(a),{remove:()=>this._removeHighlight(a)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,i){if(!this.tileRenderer)return null;const s=await this.tileRenderer.hitTest(i);if(0===s.length)return null;has("featurelayer-force-marker-text-draw-order")&&s.sort(((e,t)=>e-t));const{features:a,aggregates:n}=await this._proxy.getFeatures(s);return[...n.map((r=>this._createGraphicHit(e,t.fromJSON(r)))),...a.map((t=>this._createGraphicHit(e,r.fromJSON(t))))]}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),i,r)}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateSummaryStatistics(this._cleanUpAggregateQuery(e),i,r)}async queryUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),i,r)}async queryAggregateUniqueValues(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateUniqueValues(this._cleanUpAggregateQuery(e),i,r)}async queryClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),i,r)}async queryAggregateClassBreaks(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateClassBreaks(this._cleanUpAggregateQuery(e),i,r)}async queryHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),i,r)}async queryAggregateHistogram(e,t,r){const i={...t,scale:this.view.scale};return this._proxy.queryAggregateHistogram(this._cleanUpAggregateQuery(e),i,r)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then((e=>{const t=w.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then((e=>{const t=w.fromJSON(e);return t.features.forEach((e=>this._setLayersForFeature(e))),t}))}async queryAggregates(e,t){const r=await this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t),i=R.fromJSON(r);return i.features.forEach((e=>this._setLayersForFeature(e))),i}queryAggregateIds(e,t){return this._proxy.queryAggregateIds(this._cleanUpAggregateQuery(e),t)}queryAggregateCount(e,t){return this._proxy.queryAggregateCount(this._cleanUpAggregateQuery(e),t)}queryAggregateJSON(e,t){return this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t)}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then((e=>({count:e.count,extent:J.fromJSON(e.extent)})))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:r,removed:i}=this._tileStrategy.update(e);(r.length||i.length)&&this._proxy.updateTiles({added:r,removed:i}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new N({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.addAttachHandles(c((()=>this.renderingConfigHash),(()=>this._update()),g)),"stream"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",(e=>this._edit(e))))}detach(){this._commandsQueue.clear(),this._proxy?.stop(),this.container.removeAllChildren(),this.tileRenderer?.uninstall(this.container),this.tileRenderer=null,this._tileStrategy=u(this._tileStrategy),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updating,r=null!=this._updatingRequiredFieldsPromise,i=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,a=null==this.tileRenderer||this.tileRenderer?.updating,n=e&&(t||r||i||s||a);return has("esri-2d-log-updating")&&console.log(`Updating FLV2D (${this.layer.id}): ${n}\n -> hasRenderer ${e}\n -> hasPendingCommand ${t}\n -> updatingRequiredFields ${r}\n -> updatingProxy ${i}\n -> updatingPipeline ${s}\n -> updatingTileRenderer ${a}\n`),n}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){const t="path"in e,{layer:r}=this,i="editingInfo"in r&&r.editingInfo?.lastEditDate,s="refreshInterval"in r&&!!r.refreshInterval,a=!i&&s,n=b(r);if(t&&("feature"===r.type||"subtype-group"===r.type)&&"point"===r.geometryType&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!a&&has("featurelayer-snapshot-enabled"))try{const e=await r.queryFeatureCount();if(e<=has("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:e};const t=has("featurelayer-snapshot-point-max-threshold"),i=has("featurelayer-snapshot-point-coverage"),s=this.view.extent,a=r.fullExtent,n=a?.clone().intersection(s),o=null!=n?n.width*n.height:0,l=a?.width*a?.height;if(e<=t&&(0===l?0:o/l)>=i)return{mode:"snapshot",featureCount:e}}catch(l){o.getLogger(this).warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:l})}return{mode:"on-demand"}}async _createServiceOptions(){const e=this.layer;if("stream"===e.type)return null;const t=b(e),{capabilities:r,objectIdField:i}=e,s=e.fields.map((e=>e.toJSON())),a=null!=e.fullExtent?e.fullExtent.toJSON():null,o=L(e.geometryType),l="timeInfo"in e&&e.timeInfo&&e.timeInfo.toJSON()||null,u=e.spatialReference?e.spatialReference.toJSON():null,d="feature"===e.type?e.globalIdField:null;let h;"ogc-feature"===e.type?h=e.source.getSource():z(e.source)?h=await e.source.openPorts():e.parsedUrl&&(h=n(e.parsedUrl),"dynamicDataSource"in e&&e.dynamicDataSource&&(h.query={layer:JSON.stringify({source:e.dynamicDataSource})}));const p="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,c=("subtypeField"in this.layer?this.layer.subtypeField:null)??null,{mode:y,featureCount:g}=await this._detectQueryMode(h);let f=this.layer.objectIdField;if("feature"===this.layer.type&&null!=this.layer.orderBy&&this.layer.orderBy.length){const e=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;e&&(f=e)}return{type:y,timeReferenceUnknownClient:p,subtypeField:c,featureCount:g,globalIdField:d,maxRecordCount:r.query.maxRecordCount,tileMaxRecordCount:r.query.tileMaxRecordCount,capabilities:r,effectiveCapabilities:t,fields:s,fullExtent:a,geometryType:o,objectIdField:i,source:h,timeInfo:l,spatialReference:u,orderByFields:f,datesInUnknownTimezone:p,dateFieldsTimeReference:("dateFieldsTimeReference"in this.layer?this.layer.dateFieldsTimeReference?.toJSON():null)||null,preferredTimeReference:("preferredTimeReference"in this.layer?this.layer.preferredTimeReference?.toJSON():null)||null,editFieldsInfo:"editFieldsInfo"in this.layer?this.layer.editFieldsInfo?.toJSON():null}}async _createMemoryServiceOptions(e){const t=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:t}}_cleanUpQuery(e){const t=S.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}_cleanUpAggregateQuery(e){const t=S.from(e)||this.createAggregateQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){if(this.suspended)return void this._clearTiles();return this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){if(this.attached&&this._tileStrategy.tileKeys().length)return this.suspended&&e?void this._clearTiles():this._commandsQueue.push({type:"refresh",dataChanged:e})}_clearTiles(){this._tileStrategy.tileKeys().length&&(this._proxy.updateTiles({added:[],removed:this._tileStrategy.tileKeys()}),this._tileStrategy.clear(),this.requestUpdate(),this._commandsQueue.clear(),this._update())}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,r=e.deletedFeatures.some((e=>-1===e.objectId||!e.objectId)),i=t&&this.availableFields.includes(t);return r&&!i?(o.getLogger(this).error(new a("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:t,filter:r}=this;if(await this._updateRequiredFields(),this.destroyed)return;const{renderer:i}=this._getEffectiveRenderer();this._set("_effectiveRenderer",i);const s=this._createSchemaConfig(),a=this._createConfiguration(s,r,t.filter),n=this._lastDefinitionExpression!==a.schema.source.definitionExpression;this._lastDefinitionExpression=a.schema.source.definitionExpression;const l=a.schema.tileRenderer,u=this._createTileRendererHash(l);if("snapshot"===this._serviceOptions.type&&(a.schema.source.initialFeatureCount=this._serviceOptions.featureCount),u!==this._tileRendererHash){this._initTileRenderer(l,i);const e=this.layer,t="stream"===e.type?await this._initServiceOptions():this._serviceOptions;this.tileRenderer.onConfigUpdate(i),"stream"!==e.type&&z(e.source)&&(t.source=await e.source.openPorts());const r={added:this._tileStrategy.tileKeys(),removed:[]};has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Proxy startup"),await this._proxy.startup(this.view.featuresTilingScheme,a,t,r),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished proxy startup"),this.hasHighlight()&&(has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Updating highlight"),await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished highlight update")),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: onConfigUpdate start"),this.tileRenderer.onConfigUpdate(i),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: onConfigUpdate end")}else{"snapshot"===this._serviceOptions.type&&n&&(a.schema.source.changedFeatureCount=await this.layer.queryFeatureCount()),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Updating proxy");const t=await this._proxy.update(a);has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished proxy update"),(t.mesh||t.targets?.aggregate)&&(has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Locking GPU Uploads"),this._lockGPUUploads());try{has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Applying update to proxy"),await this._proxy.applyUpdate(t),has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D: Finished applying update to proxy")}catch(e){p(e)||o.getLogger(this).error(e)}(t.mesh||t.targets?.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(i),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=u,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch(e){}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(t){p(t),0}}async _doRefresh(e){this._lockGPUUploads();try{let t;e&&"snapshot"===this.queryMode&&"queryFeatureCount"in this.layer&&(t=await this.layer.queryFeatureCount()),await this._proxy.refresh({dataChanged:e,featureCount:t})}catch(t){p(t),0}this._unlockGPUUploads(),this._effectiveFeatureReduction&&this._updateClusterSizeVariable()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,t){return c((()=>this._aggregateValueRanges),(r=>{this._updateClusterEffectiveRendererSizeVariable(e,t,r),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()}))}async _updateClusterEffectiveRendererSizeVariable(e,t,r){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const i=I(e.visualVariables);if(null!=i&&"cluster_count"===i.field){const s=e.visualVariables.indexOf(i);e.visualVariables[s]=O(t,r);const a=e.clone();a.dynamicClusterSize=!0,this._set("_effectiveRenderer",a)}}}_getEffectiveRenderer(){const e=this.layer,t="renderer"in e?e.renderer:null,r=this._effectiveFeatureReduction;if(this._updateClusterSizeTask=d(this._updateClusterSizeTask),r&&"renderer"in r&&r.renderer&&!r.renderer.authoringInfo?.isAutoGenerated){const e=r.fields;if("cluster"===r.type){const{renderer:t,didInject:i}=V(r.renderer,r,this._aggregateValueRanges);return i&&(this._updateClusterSizeTask=this._createUpdateClusterSizeTask(t,r)),{renderer:t,aggregateFields:e,featureReduction:r}}return{renderer:r.renderer,aggregateFields:e,featureReduction:r}}if(r&&"cluster"===r.type&&t&&E(t)){const e=r,i=[],s=T(i,t,e,this._aggregateValueRanges,!0);return this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,e),{renderer:s,aggregateFields:i,featureReduction:r}}return{renderer:t,aggregateFields:[],featureReduction:null}}_acquireTile(e){const t=this.tileRenderer.acquireTile(e);return t.once("attach",(()=>{this.requestUpdate()})),t}_releaseTile(e){this.tileRenderer.releaseTile(e)}_initTileRenderer(e,t){const r=C(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer=u(this.tileRenderer)),this.destroyed?null:(this._proxy.tileRenderer=r,this._set("tileRenderer",r),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(t),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${e.type}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const t=null!=e?e.timeExtent:null,r=null!=this.timeExtent&&null!=t?this.timeExtent.intersection(t):this.timeExtent||t;let i=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const t=null!=e?e.where:null;i=this._addFloorFilterClause(t)}if(!this._visibilityOverrides.size&&!r&&!s)return null!=e?e.toJSON():null;(e=null!=e&&e.clone()||new v).timeExtent=r,i&&(e.where=i);const a=e.toJSON();return a.hiddenIds=Array.from(this._visibilityOverrides),a}_addFloorFilterClause(e){const t=this.layer;let r=e||"";if("floorInfo"in t&&t.floorInfo){let e=this.view.floors;if(!e||!e.length)return r;t.floorInfo.viewAllLevelIds?.length&&(e=t.floorInfo.viewAllLevelIds);const i=e.filter((e=>""!==e)).map((e=>"'"+e+"'"));i.push("''");const s=t.floorInfo.floorField;let a="("+s+" IN ({ids}) OR "+s+" IS NULL)";if(a=a.replace("{ids}",i.join(", ")),null!=r&&r.includes(s)){let e=new RegExp("AND \\("+s+".*NULL\\)","g");r=r.replace(e,""),e=new RegExp("\\("+s+".*NULL\\)","g"),r=r.replace(e,""),r=r.replaceAll(/\s+/g," ").trim()}r=""!==r?"("+r+") AND "+a:a}return""!==r?r:null}_createConfiguration(e,t,r){const i="feature"===this.layer.type&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s="feature"===this.layer.type?this.layer.gdbVersion??void 0:void 0,a=new Array(x),n=this._injectOverrides(t);a[0]=n,a[1]=null!=r?r.toJSON():null;const o=U(e);if(null==o)return null;const l=P("2d");return{availableFields:this.availableFields,gdbVersion:s,historicMoment:i,devicePixelRatio:window.devicePixelRatio||1,filters:a,schema:o,supportsTextureFloat:l.supportsTextureFloat,maxTextureSize:l.maxTextureSize}}_hasRequiredSupport(e){return!("renderer"in e)||q(e.renderer)}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e=this.layer;return{renderer:"renderer"in e?e.renderer:null,spatialReference:e.spatialReference,timeExtent:"timeExtent"in e?e.timeExtent:null,definitionExpression:e.definitionExpression,featureReduction:this._effectiveFeatureReduction,fields:e.fields,geometryType:e.geometryType,historicMoment:"historicMoment"in e?e.historicMoment:null,labelsVisible:"labelsVisible"in e&&e.labelsVisible,labelingInfo:"labelingInfo"in e?e.labelingInfo:null,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:"gdbVersion"in e?e.gdbVersion:null,pixelBuffer:0,orderBy:"orderBy"in e&&e.orderBy?e.orderBy:null,customParameters:{..."customParameters"in e?e.customParameters:void 0,token:"apiKey"in e?e.apiKey??void 0:void 0},subtypeCode:"subtypeCode"in e?e.subtypeCode:void 0,subtypeField:"subtypeField"in e?e.subtypeField:void 0}}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight().catch((e=>{p(e)||o.getLogger(this).error(e)}))}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;0===e?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight().catch((e=>{p(e)||o.getLogger(this).error(e)}))}_setLayersForFeature(e){const t=this.layer;e.layer=t,e.sourceLayer=t}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};e([f()],D.prototype,"_serviceOptions",void 0),e([f()],D.prototype,"_proxy",void 0),e([f()],D.prototype,"_pipelineIsUpdating",void 0),e([f()],D.prototype,"_effectiveRenderer",void 0),e([f()],D.prototype,"_effectiveFeatureReduction",null),e([f()],D.prototype,"_aggregateValueRanges",void 0),e([f()],D.prototype,"_commandsQueue",void 0),e([f()],D.prototype,"featureEffectView",void 0),e([f()],D.prototype,"labelsVisible",null),e([f({readOnly:!0})],D.prototype,"queryMode",null),e([f()],D.prototype,"renderingConfigHash",null),e([f()],D.prototype,"tileRenderer",void 0),e([f()],D.prototype,"updating",void 0),D=e([m("esri.views.2d.layers.FeatureLayerView2D")],D);const M=D;export{M 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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import"../../../Graphic.js";import"../../../renderers/ClassBreaksRenderer.js";import"../../../renderers/DictionaryRenderer.js";import"../../../renderers/DotDensityRenderer.js";import"../../../renderers/HeatmapRenderer.js";import"../../../renderers/PieChartRenderer.js";import"../../../renderers/Renderer.js";import"../../../renderers/SimpleRenderer.js";import"../../../renderers/UniqueValueRenderer.js";import"../../../renderers/support/jsonUtils.js";import"../../../symbols.js";import t from"../../../core/Collection.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{getOrCreateMapValue as s}from"../../../core/MapUtils.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{on as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{create as a}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as m}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as p}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as c}from"../../../layers/support/MediaElementView.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../request.js";import"../../../chunks/index2.js";import"../../../core/urlUtils.js";import"../../../chunks/index3.js";import"../../../layers/effects/EffectView.js";import"../engine/DisplayObject.js";import"../engine/webgl/effects/highlight/HighlightGradient.js";import"../engine/webgl/BufferPool.js";import"../engine/webgl/enums.js";import"../engine/webgl/brushes/BrushBitmap.js";import"../../../chunks/vec4f32.js";import"../engine/webgl/Utils.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/enums.js";import"../../webgl/checkWebGLError.js";import"../../webgl/contextUtils.js";import"../../../chunks/builtins.js";import"../../../core/RandomLCG.js";import"../engine/webgl/materialKey/MaterialKey.js";import"../engine/webgl/techniques/Technique.js";import"../engine/webgl/techniques/dotDensity/TechniqueDotDensity.js";import"../engine/webgl/techniques/heatmap/TechniqueHeatmap.js";import"../engine/webgl/techniques/pieChart/TechniquePieChart.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/GLObjectType.js";import"../../webgl/Texture.js";import"../../webgl/VertexArrayObject.js";import"../engine/webgl/brushes/WGLBrushHeatmap.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../engine/webgl/brushes/WGLGeometryBrushMarker.js";import"../../../core/mathUtils.js";import"../engine/webgl/number.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../../../chunks/vec2f32.js";import"../engine/vectorTiles/enums.js";import"../engine/vectorTiles/shaders/sources/resolver.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../engine/webgl/shaders/sources/resolver.js";import"../engine/webgl/TextureManager.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/effects/BlendEffect.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../engine/webgl/Profiler.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/interfaces.js";import"../../../core/floatRGBA.js";import"../../3d/webgl-engine/lib/OrderIndependentTransparency.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../engine/webgl/AttributeStoreView.js";import"../../../chunks/earcut.js";import"../../../layers/graphics/featureConversionUtils.js";import"../../../core/unitUtils.js";import"../../../renderers/support/lengthUtils.js";import"../../../chunks/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../engine/webgl/shaders/MagnifierPrograms.js";import"../tiling/PagedTileQueue.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import h from"../tiling/TileQueue.js";import u from"../tiling/TileStrategy.js";import d from"../engine/webgl/Overlay.js";import g from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as f}from"./LayerView2D.js";import j from"../../layers/LayerView.js";import y from"../../../geometry/Extent.js";let w=class extends(f(j)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this.layer=null,this.elements=new t}attach(){this.addAttachHandles([n((()=>this.layer.effectiveSource),"refresh",(()=>{for(const e of this._tileStrategy.tiles)this._updateTile(e);this.requestUpdate()})),n((()=>this.layer.effectiveSource),"change",(({element:e})=>this._elementUpdateHandler(e)))]),this._overlayContainer=new g,this.container.addChild(this._overlayContainer),this._fetchQueue=new h({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t)}),this._tileStrategy=new u({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const r=[],s=e.normalize(),i=[s.x,s.y];for(const{projectedElement:{normalizedCoords:n,element:o}}of this._elementReferences.values())null!=n&&m(n.rings,i)&&r.push({type:"media",element:o,layer:this.layer,mapPoint:e});return r.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>this._updateTile(e)))}_acquireTile(e){const t=new T(e.clone());return this._updateTile(t),t}_updateTile(e){this.updatingHandles.addPromise(this._fetchQueue.push(e.key).then((t=>{const[r,s]=e.setElements(t);this._referenceElements(e,r),this._dereferenceElements(e,s),this.requestUpdate()}),(e=>{i(e)||r.getLogger(this).error(e)})))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const r=this.layer.effectiveSource;if(null==r)return[];this.view.featuresTilingScheme.getTileBounds(b,e,!0);const s=new y({xmin:b[0],ymin:b[1],xmax:b[2],ymax:b[3],spatialReference:this.view.spatialReference});return r.queryElements(s,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const r of t)this._referenceElement(e,r)}_referenceElement(e,t){s(this._elementReferences,t.uid,(()=>{const e=new c({element:t,spatialReference:this.view.spatialReference}),r=new d(e);this._overlayContainer.addChild(r),this.elements.add(t);let s=null;return{tiles:new Set,projectedElement:e,overlay:r,debugGraphic:s}})).tiles.add(e)}_dereferenceElements(e,t){for(const r of t)this._dereferenceElement(e,r)}_dereferenceElement(e,t){const r=this._elementReferences.get(t.uid);r.tiles.delete(e),r.tiles.size||(this._overlayContainer.removeChild(r.overlay),r.overlay.destroy(),r.projectedElement.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(r.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const r=t.projectedElement.normalizedCoords;if(null==r)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.projectedElement.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],i=[];for(const e of this._tileStrategy.tiles){const n=v(this.view.featuresTilingScheme,e,r);t.tiles.has(e)?n||i.push(e):n&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of i)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.projectedElement.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const r=new c({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=r)for(const s of this._tileStrategy.tiles){v(this.view.featuresTilingScheme,s,r)&&this._referenceElement(s,e)}}};e([o()],w.prototype,"_fetchQueue",void 0),e([o()],w.prototype,"layer",void 0),e([o({readOnly:!0})],w.prototype,"elements",void 0),w=e([l("esri.views.2d.layers.MediaLayerView2D")],w);const b=a(),_={xmin:0,ymin:0,xmax:0,ymax:0};function v(e,t,r){return e.getTileBounds(b,t.key,!0),_.xmin=b[0],_.ymin=b[1],_.xmax=b[2],_.ymax=b[3],p(_,r)}class T{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],r=new Set(this.elements);this.elements=e;for(const s of e)r.has(s)?r.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(r)]}destroy(){}}const R=w;export{R as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import"../../../Graphic.js";import"../../../renderers/ClassBreaksRenderer.js";import"../../../renderers/DictionaryRenderer.js";import"../../../renderers/DotDensityRenderer.js";import"../../../renderers/HeatmapRenderer.js";import"../../../renderers/PieChartRenderer.js";import"../../../renderers/Renderer.js";import"../../../renderers/SimpleRenderer.js";import"../../../renderers/UniqueValueRenderer.js";import"../../../renderers/support/jsonUtils.js";import"../../../symbols.js";import t from"../../../core/Collection.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{getOrCreateMapValue as i}from"../../../core/MapUtils.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import{on as n}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{create as a}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as m}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as p}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as c}from"../../../layers/support/MediaElementView.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../request.js";import"../../../chunks/index2.js";import"../../../core/urlUtils.js";import"../../../chunks/index3.js";import"../../../layers/effects/EffectView.js";import"../engine/DisplayObject.js";import"../engine/webgl/effects/highlight/HighlightGradient.js";import"../engine/webgl/BufferPool.js";import"../engine/webgl/enums.js";import"../engine/webgl/brushes/BrushBitmap.js";import"../../../chunks/vec4f32.js";import"../engine/webgl/Utils.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/enums.js";import"../../webgl/checkWebGLError.js";import"../../webgl/contextUtils.js";import"../../../chunks/builtins.js";import"../engine/webgl/definitions.js";import"../../../core/RandomLCG.js";import"../engine/webgl/materialKey/MaterialKey.js";import"../engine/webgl/techniques/Technique.js";import"../engine/webgl/techniques/dotDensity/TechniqueDotDensity.js";import"../engine/webgl/techniques/heatmap/TechniqueHeatmap.js";import"../engine/webgl/techniques/pieChart/TechniquePieChart.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/GLObjectType.js";import"../../webgl/Texture.js";import"../../webgl/VertexArrayObject.js";import"../engine/webgl/brushes/WGLBrushHeatmap.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../engine/webgl/brushes/WGLGeometryBrushMarker.js";import"../../../core/mathUtils.js";import"../engine/webgl/number.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../../../chunks/vec2f32.js";import"../engine/vectorTiles/enums.js";import"../engine/vectorTiles/shaders/sources/resolver.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../engine/webgl/shaders/sources/resolver.js";import"../engine/webgl/TextureManager.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/effects/BlendEffect.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../engine/webgl/Profiler.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/interfaces.js";import"../../../core/floatRGBA.js";import"../../3d/webgl-engine/lib/OrderIndependentTransparency.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../engine/webgl/AttributeStoreView.js";import"../../../chunks/earcut.js";import"../../../layers/graphics/featureConversionUtils.js";import"../../../core/unitUtils.js";import"../../../renderers/support/lengthUtils.js";import"../../../chunks/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../engine/webgl/shaders/MagnifierPrograms.js";import"../tiling/PagedTileQueue.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import h from"../tiling/TileQueue.js";import u from"../tiling/TileStrategy.js";import d from"../engine/webgl/Overlay.js";import g from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as f}from"./LayerView2D.js";import j from"../../layers/LayerView.js";import y from"../../../geometry/Extent.js";let w=class extends(f(j)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this.layer=null,this.elements=new t}attach(){this.addAttachHandles([n((()=>this.layer.effectiveSource),"refresh",(()=>{for(const e of this._tileStrategy.tiles)this._updateTile(e);this.requestUpdate()})),n((()=>this.layer.effectiveSource),"change",(({element:e})=>this._elementUpdateHandler(e)))]),this._overlayContainer=new g,this.container.addChild(this._overlayContainer),this._fetchQueue=new h({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t)}),this._tileStrategy=new u({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const r=[],i=e.normalize(),s=[i.x,i.y];for(const{projectedElement:{normalizedCoords:n,element:o}}of this._elementReferences.values())null!=n&&m(n.rings,s)&&r.push({type:"media",element:o,layer:this.layer,mapPoint:e});return r.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>this._updateTile(e)))}_acquireTile(e){const t=new T(e.clone());return this._updateTile(t),t}_updateTile(e){this.updatingHandles.addPromise(this._fetchQueue.push(e.key).then((t=>{const[r,i]=e.setElements(t);this._referenceElements(e,r),this._dereferenceElements(e,i),this.requestUpdate()}),(e=>{s(e)||r.getLogger(this).error(e)})))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const r=this.layer.effectiveSource;if(null==r)return[];this.view.featuresTilingScheme.getTileBounds(b,e,!0);const i=new y({xmin:b[0],ymin:b[1],xmax:b[2],ymax:b[3],spatialReference:this.view.spatialReference});return r.queryElements(i,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const r of t)this._referenceElement(e,r)}_referenceElement(e,t){i(this._elementReferences,t.uid,(()=>{const e=new c({element:t,spatialReference:this.view.spatialReference}),r=new d(e);this._overlayContainer.addChild(r),this.elements.add(t);let i=null;return{tiles:new Set,projectedElement:e,overlay:r,debugGraphic:i}})).tiles.add(e)}_dereferenceElements(e,t){for(const r of t)this._dereferenceElement(e,r)}_dereferenceElement(e,t){const r=this._elementReferences.get(t.uid);r.tiles.delete(e),r.tiles.size||(this._overlayContainer.removeChild(r.overlay),r.overlay.destroy(),r.projectedElement.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(r.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const r=t.projectedElement.normalizedCoords;if(null==r)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.projectedElement.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const i=[],s=[];for(const e of this._tileStrategy.tiles){const n=v(this.view.featuresTilingScheme,e,r);t.tiles.has(e)?n||s.push(e):n&&i.push(e)}for(const t of i)this._referenceElement(t,e);for(const t of s)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.projectedElement.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const r=new c({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=r)for(const i of this._tileStrategy.tiles){v(this.view.featuresTilingScheme,i,r)&&this._referenceElement(i,e)}}};e([o()],w.prototype,"_fetchQueue",void 0),e([o()],w.prototype,"layer",void 0),e([o({readOnly:!0})],w.prototype,"elements",void 0),w=e([l("esri.views.2d.layers.MediaLayerView2D")],w);const b=a(),_={xmin:0,ymin:0,xmax:0,ymax:0};function v(e,t,r){return e.getTileBounds(b,t.key,!0),_.xmin=b[0],_.ymin=b[1],_.xmax=b[2],_.ymax=b[3],p(_,r)}class T{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],r=new Set(this.elements);this.elements=e;for(const i of e)r.has(i)?r.delete(i):t.push(i);return this.isReady=!0,[t,Array.from(r)]}destroy(){}}const R=w;export{R 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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Logger.js";import{isAbortError as i}from"../../../core/promiseUtils.js";import{watch as r}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as h}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../request.js";import"../../../chunks/index2.js";import"../../../core/urlUtils.js";import"../../../chunks/index3.js";import"../../../layers/effects/EffectView.js";import"../engine/DisplayObject.js";import"../engine/webgl/effects/highlight/HighlightGradient.js";import"../engine/webgl/BufferPool.js";import"../engine/webgl/enums.js";import"../engine/webgl/brushes/BrushBitmap.js";import"../../../chunks/vec4f32.js";import"../engine/webgl/Utils.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/enums.js";import"../../webgl/checkWebGLError.js";import"../../webgl/contextUtils.js";import"../../../chunks/builtins.js";import"../../../core/RandomLCG.js";import"../engine/webgl/materialKey/MaterialKey.js";import"../engine/webgl/techniques/Technique.js";import"../engine/webgl/techniques/dotDensity/TechniqueDotDensity.js";import"../engine/webgl/techniques/heatmap/TechniqueHeatmap.js";import"../engine/webgl/techniques/pieChart/TechniquePieChart.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/GLObjectType.js";import"../../webgl/Texture.js";import"../../webgl/VertexArrayObject.js";import"../engine/webgl/brushes/WGLBrushHeatmap.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../engine/webgl/brushes/WGLGeometryBrushMarker.js";import"../../../core/mathUtils.js";import"../engine/webgl/number.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../../../chunks/vec2f32.js";import"../engine/vectorTiles/enums.js";import"../engine/vectorTiles/shaders/sources/resolver.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../engine/webgl/shaders/sources/resolver.js";import"../engine/webgl/TextureManager.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/effects/BlendEffect.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../engine/webgl/Profiler.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/interfaces.js";import"../../../core/floatRGBA.js";import"../../3d/webgl-engine/lib/OrderIndependentTransparency.js";import"../LabelManager.js";import a from"./graphics/GraphicsView2D.js";import"../engine/webgl/AttributeStoreView.js";import"../../../chunks/earcut.js";import"../../../layers/graphics/featureConversionUtils.js";import"../../../core/unitUtils.js";import"../../../renderers/support/lengthUtils.js";import"../../../chunks/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../engine/webgl/shaders/MagnifierPrograms.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import g from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as c,resampleImage as m}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import f from"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import j from"../tiling/TileStrategy.js";import d from"../../layers/LayerView.js";import y from"../../layers/RefreshableLayerView.js";import{isMapServiceLayerView as b,MapServiceLayerViewHelper as _}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as T}from"../../support/drapedUtils.js";const V=[0,0];let v=class extends(y(n(p(d)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new h,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,t=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,t?.effectiveMinLOD,t?.effectiveMaxLOD),this._fetchQueue=new w({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,t)=>this.fetchTile(e,t)}),this._tileStrategy=new j({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),b(this,this.layer)){const e=this._highlightView=new a({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new g(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new _({createFetchPopupFeaturesQueryGeometry:(e,t)=>T(e,t,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(t,i)=>{e.graphicUpdateHandler({graphic:t,property:i})},layerView:this,updatingHandles:this.updatingHandles})}this.requestUpdate(),this.addAttachHandles(r((()=>this.resampling),(()=>{this.doRefresh()}))),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeatures(e,t){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeatures(e,t):[]}highlight(e){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(e):{remove(){}}}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return o(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){!this.attached||this.updateRequested||this.suspended||(this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>this._enqueueTileFetch(e))))}isUpdating(){return this._fetchQueue?.updating??!1}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(V,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(t),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",(()=>e.destroy())),this.requestUpdate()}async fetchTile(e,t={}){const r=this.tilemapCache,{signal:s,resamplingLevel:l=0}=t;if(!r)try{return await this._fetchImage(e,s)}catch(a){if(!i(a)&&!this.resampling)return c(this._tileInfoView.tileInfo.size);if(l<3){const i=this._tileInfoView.getTileParentId(e.id);if(i){const r=new f(i),s=await this.fetchTile(r,{...t,resamplingLevel:l+1});return m(this._tileInfoView,s,r,e)}}throw a}const o=new f(0,0,0,0);let h;try{if(await r.fetchAvailabilityUpsample(e.level,e.row,e.col,o,{signal:s}),o.level!==e.level&&!this.resampling)return c(this._tileInfoView.tileInfo.size);h=await this._fetchImage(o,s)}catch(a){if(i(a))throw a;h=await this._fetchImage(e,s)}return this.resampling?m(this._tileInfoView,h,o,e):h}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",(()=>this.requestUpdate()))}catch(r){i(r)||t.getLogger(this).error(r)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}};e([s()],v.prototype,"_fetchQueue",void 0),e([s()],v.prototype,"resampling",null),e([s()],v.prototype,"tilemapCache",null),v=e([l("esri.views.2d.layers.TileLayerView2D")],v);const I=v;export{I as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import i from"../../../core/Logger.js";import{isAbortError as t}from"../../../core/promiseUtils.js";import{watch as r}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as l}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as h}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../request.js";import"../../../chunks/index2.js";import"../../../core/urlUtils.js";import"../../../chunks/index3.js";import"../../../layers/effects/EffectView.js";import"../engine/DisplayObject.js";import"../engine/webgl/effects/highlight/HighlightGradient.js";import"../engine/webgl/BufferPool.js";import"../engine/webgl/enums.js";import"../engine/webgl/brushes/BrushBitmap.js";import"../../../chunks/vec4f32.js";import"../engine/webgl/Utils.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/enums.js";import"../../webgl/checkWebGLError.js";import"../../webgl/contextUtils.js";import"../../../chunks/builtins.js";import"../engine/webgl/definitions.js";import"../../../core/RandomLCG.js";import"../engine/webgl/materialKey/MaterialKey.js";import"../engine/webgl/techniques/Technique.js";import"../engine/webgl/techniques/dotDensity/TechniqueDotDensity.js";import"../engine/webgl/techniques/heatmap/TechniqueHeatmap.js";import"../engine/webgl/techniques/pieChart/TechniquePieChart.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/GLObjectType.js";import"../../webgl/Texture.js";import"../../webgl/VertexArrayObject.js";import"../engine/webgl/brushes/WGLBrushHeatmap.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../engine/webgl/brushes/WGLGeometryBrushMarker.js";import"../../../core/mathUtils.js";import"../engine/webgl/number.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../../../chunks/vec2f32.js";import"../engine/vectorTiles/enums.js";import"../engine/vectorTiles/shaders/sources/resolver.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../engine/webgl/shaders/sources/resolver.js";import"../engine/webgl/TextureManager.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/effects/BlendEffect.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../engine/webgl/Profiler.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/interfaces.js";import"../../../core/floatRGBA.js";import"../../3d/webgl-engine/lib/OrderIndependentTransparency.js";import"../LabelManager.js";import a from"./graphics/GraphicsView2D.js";import"../engine/webgl/AttributeStoreView.js";import"../../../chunks/earcut.js";import"../../../layers/graphics/featureConversionUtils.js";import"../../../core/unitUtils.js";import"../../../renderers/support/lengthUtils.js";import"../../../chunks/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../engine/webgl/shaders/MagnifierPrograms.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import g from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as c,resampleImage as m}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import f from"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import j from"../tiling/TileStrategy.js";import d from"../../layers/LayerView.js";import y from"../../layers/RefreshableLayerView.js";import{isMapServiceLayerView as b,MapServiceLayerViewHelper as _}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as T}from"../../support/drapedUtils.js";const V=[0,0];let v=class extends(y(n(p(d)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new h,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new w({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i)}),this._tileStrategy=new j({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),b(this,this.layer)){const e=this._highlightView=new a({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new g(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new _({createFetchPopupFeaturesQueryGeometry:(e,i)=>T(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(i,t)=>{e.graphicUpdateHandler({graphic:i,property:t})},layerView:this,updatingHandles:this.updatingHandles})}this.requestUpdate(),this.addAttachHandles(r((()=>this.resampling),(()=>{this.doRefresh()}))),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeatures(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeatures(e,i):[]}highlight(e){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(e):{remove(){}}}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return l(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){!this.attached||this.updateRequested||this.suspended||(this._fetchQueue.reset(),this._tileStrategy.tiles.forEach((e=>this._enqueueTileFetch(e))))}isUpdating(){return this._fetchQueue?.updating??!1}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(V,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(i),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",(()=>e.destroy())),this.requestUpdate()}async fetchTile(e,i={}){const r=this.tilemapCache,{signal:s,resamplingLevel:o=0}=i;if(!r)try{return await this._fetchImage(e,s)}catch(a){if(!t(a)&&!this.resampling)return c(this._tileInfoView.tileInfo.size);if(o<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const r=new f(t),s=await this.fetchTile(r,{...i,resamplingLevel:o+1});return m(this._tileInfoView,s,r,e)}}throw a}const l=new f(0,0,0,0);let h;try{if(await r.fetchAvailabilityUpsample(e.level,e.row,e.col,l,{signal:s}),l.level!==e.level&&!this.resampling)return c(this._tileInfoView.tileInfo.size);h=await this._fetchImage(l,s)}catch(a){if(t(a))throw a;h=await this._fetchImage(e,s)}return this.resampling?m(this._tileInfoView,h,l,e):h}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",(()=>this.requestUpdate()))}catch(r){t(r)||i.getLogger(this).error(r)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};e([s()],v.prototype,"_fetchQueue",void 0),e([s()],v.prototype,"resampling",null),e([s()],v.prototype,"tilemapCache",null),v=e([o("esri.views.2d.layers.TileLayerView2D")],v);const I=v;export{I 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.27/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{RenderTargetHelper as e}from"./RenderTargetHelper.js";import{TransparencyPassType as t}from"./TransparencyPassType.js";import{AlphaMode as r}from"../shaders/CompositingTechniqueConfiguration.js";import{TextureSamplingMode as i,SizedPixelFormat as o,PixelType as s,ClearBufferBit as a}from"../../../webgl/enums.js";import{ensureAttachmentMaxSize as h}from"../../../webgl/FramebufferObject.js";class n{constructor(t,r){this._rctx=t,this._compositingHelper=r,this._mainColorTarget=0,this.width=4,this.height=4,this._background={type:"color",color:[0,0,0,1]},this._renderTargetHelper=new e(t);const a=this._renderTargetHelper;this._mainColorTargets=[a.registerColorTarget({name:"mainColorTarget0"}),a.registerColorTarget({name:"mainColorTarget1"})],this.frontFaceTarget=a.registerColorTarget({name:"frontFaceTarget"});const h=e=>a.registerColorTarget({name:e,dataType:s.FLOAT,internalFormat:o.RGBA32F,samplingMode:i.NEAREST});this.colorFloatTarget=h("colorFloatTarget"),this.alphaFloatTarget=h("alphaFloatTarget"),this.mainDepth=a.registerDepthTarget({name:"mainDepth"}),this.linearDepth=a.registerColorTarget({name:"linearDepth",samplingMode:i.NEAREST}),this.terrainLinearDepth=a.registerColorTarget({name:"terrainLinearDepth"}),this.geometryLinearDepth=a.registerColorTarget({name:"geometryLinearDepth"}),this.normal=a.registerColorTarget({name:"normal"}),this.highlight=a.registerColorTarget({name:"highlight",internalFormat:o.RGBA4,dataType:s.UNSIGNED_SHORT_4_4_4_4}),this.hudVisibility=a.registerColorTarget({name:"hudVisibility",internalFormat:o.RGBA4,dataType:s.UNSIGNED_SHORT_4_4_4_4}),this.tmpColor=a.registerColorTarget({name:"tmpColor"}),this.tmpDepth=a.registerDepthTarget({name:"tmpDepth"}),this.hudColor=a.registerColorTarget({name:"hudColor"})}dispose(){this._renderTargetHelper.dispose()}set background(e){this._background=e}get background(){return this._background}get currentColorTarget(){return this._mainColorTargets[this._mainColorTarget]}get previousColorTarget(){return this._mainColorTargets[1-this._mainColorTarget]}get framebuffer(){return this.getFramebuffer(this.currentColorTarget,this.mainDepth)}getFramebuffer(e,t){return this._renderTargetHelper.getFramebuffer(this.width,this.height,e,t)}get colorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.currentColorTarget)}get depthTexture(){return this._renderTargetHelper.getAllocatedDepthTexture(this.mainDepth)}get linearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.linearDepth)}get terrainLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.terrainLinearDepth)}get geometryLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.geometryLinearDepth)}get lastFrameColorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.previousColorTarget)}get normalTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.normal)}get highlightTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.highlight)}get hudVisibilityTexture(){return this._getColorTexture(this.hudVisibility)}get tmpColorTexture(){return this._getColorTexture(this.tmpColor)}get hudColorTexture(){return this._getColorTexture(this.hudColor)}get mainColorTexture(){return this._getColorTexture(this.currentColorTarget)}setupRenderTarget(e){e?this._mainColorTarget=this._mainColorTarget?0:1:(this._mainColorTarget=0,this.disposeTarget(this._mainColorTargets[1]))}initializeFrame(e){const t=this._rctx;this.width=e.fullWidth,this.height=e.fullHeight,h(this,t.parameters.maxTextureSize),this.bindTarget(this.currentColorTarget,this.mainDepth),t.setClearStencil(0);const r=this._background.color;t.setClearColor(r[0]*r[3],r[1]*r[3],r[2]*r[3],r[3]),t.clearSafe(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT|a.STENCIL_BUFFER_BIT)}composite(e){null!=this.colorTexture&&this._compositingHelper.composite(e,this.colorTexture,r.None)}renderTmpAndCompositeToMain(e,t,r,i=!1){this.renderToTargets(e,this.tmpColor,i?this.tmpDepth:this.mainDepth,l),this._compositingHelper.composite(t,this._getColorTexture(this.tmpColor),r)}compositeAtmosphereToMain(e,t,r,i){this.bindTarget(this.currentColorTarget),this._compositingHelper.compositeAtmosphere(e,this._renderTargetHelper.getColorTexture(this.tmpColor,this.width,this.height),r,i,t),this.bindTarget(this.currentColorTarget,this.mainDepth)}renderHUDVisibility(e,t=!1){this.renderToTargets(e,this.hudVisibility,t?this.tmpDepth:this.mainDepth,g)}compositeTransparentTerrainOntoHUDVisibility(e){this.renderToTargets((()=>this._compositingHelper.compositeHUD(e,this._getColorTexture(this.tmpColor))),this.hudVisibility,this.tmpDepth)}renderOITPass(e,r,i){let o,s;switch(r){case t.Color:o=this.colorFloatTarget,s=[0,0,0,0];break;case t.Alpha:o=this.alphaFloatTarget,s=[1,1,1,1];break;case t.FrontFace:o=this.frontFaceTarget,s=[0,0,0,0];break;case t.NONE:case t.COUNT:return}i?this.renderToTargets(e,o,this.tmpDepth,s,!0,!0):this.renderToTargets(e,o,this.mainDepth,s,!1)}compositeTransparentTerrainOntoMain(e){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),r.PremultipliedAlpha)}compositeOccludedOntoMain(e,t){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),r.PremultipliedAlpha,t)}compositeTransparentOntoOpaque(e,t){t?(this.bindTarget(this.hudColor,this.tmpDepth),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clearSafe(a.COLOR_BUFFER_BIT)):this.bindFramebuffer(),this._compositingHelper.compositeOIT(e,this._getColorTexture(this.colorFloatTarget),this._getColorTexture(this.alphaFloatTarget),this._getColorTexture(this.frontFaceTarget))}bindFramebuffer(){this._rctx.bindFramebuffer(this.framebuffer)}renderDepthDetached(e){this.bindTarget(this.currentColorTarget),e(),this.bindTarget(this.currentColorTarget,this.mainDepth)}disposeTarget(e){this._renderTargetHelper.disposeTargetResource(e)}renderToFBO(e,t,r=!1,i=!1){const o=this._rctx;let s=0;if(t){const e=1e-13,r=Math.max(e,t[3]);o.setClearColor(t[0],t[1],t[2],r),s|=a.COLOR_BUFFER_BIT}r&&(s|=a.DEPTH_BUFFER_BIT),!1===i?i=0:(!0===i&&(i=255),s|=a.STENCIL_BUFFER_BIT),s&&o.clearSafe(s,i),e(),o.gl.flush(),this.bindTarget(this.currentColorTarget,this.mainDepth)}renderToTargets(e,t,r,i,o=!1,s=!1){const a=this.bindTarget(t,r);return this.renderToFBO(e,i,o,s),a}bindTarget(e,t){const r=this._renderTargetHelper.getFramebuffer(this.width,this.height,e,t);return this._rctx.bindFramebuffer(r),r}_getColorTexture(e){return this._renderTargetHelper.getColorTexture(e,this.width,this.height)}get gpuMemoryUsage(){let e=0;return this._renderTargetHelper&&(e+=this._renderTargetHelper.gpuMemoryUsage),e}}const l=[0,0,0,0],g=[0,1,0,1];export{n as OffscreenRendering};
5
+ import"../../../../core/has.js";import{RenderTargetHelper as e}from"./RenderTargetHelper.js";import{TransparencyPassType as t}from"./TransparencyPassType.js";import{AlphaMode as r}from"../shaders/CompositingTechniqueConfiguration.js";import{SizedPixelFormat as i,TextureSamplingMode as o,PixelType as s,ClearBufferBit as a}from"../../../webgl/enums.js";import{ensureAttachmentMaxSize as h}from"../../../webgl/FramebufferObject.js";class n{constructor(t,r){this._rctx=t,this._compositingHelper=r,this._mainColorTarget=0,this.width=4,this.height=4,this._background={type:"color",color:[0,0,0,1]},this._renderTargetHelper=new e(t);const a=this._renderTargetHelper;this._mainColorTargets=[a.registerColorTarget({name:"mainColorTarget0"}),a.registerColorTarget({name:"mainColorTarget1"})],this.frontFaceTarget=a.registerColorTarget({name:"frontFaceTarget"});const h=(e,t)=>a.registerColorTarget({name:e,dataType:s.FLOAT,internalFormat:t,samplingMode:o.NEAREST});this.colorFloatTarget=h("colorFloatTarget",i.RGBA32F),this.alphaFloatTarget=h("alphaFloatTarget",i.R32F),this.mainDepth=a.registerDepthTarget({name:"mainDepth"}),this.linearDepth=a.registerColorTarget({name:"linearDepth",samplingMode:o.NEAREST}),this.terrainLinearDepth=a.registerColorTarget({name:"terrainLinearDepth"}),this.geometryLinearDepth=a.registerColorTarget({name:"geometryLinearDepth"}),this.normal=a.registerColorTarget({name:"normal"}),this.highlight=a.registerColorTarget({name:"highlight",internalFormat:i.RGBA4,dataType:s.UNSIGNED_SHORT_4_4_4_4}),this.hudVisibility=a.registerColorTarget({name:"hudVisibility",internalFormat:i.RGBA4,dataType:s.UNSIGNED_SHORT_4_4_4_4}),this.tmpColor=a.registerColorTarget({name:"tmpColor"}),this.tmpDepth=a.registerDepthTarget({name:"tmpDepth"}),this.hudColor=a.registerColorTarget({name:"hudColor"})}dispose(){this._renderTargetHelper.dispose()}set background(e){this._background=e}get background(){return this._background}get currentColorTarget(){return this._mainColorTargets[this._mainColorTarget]}get previousColorTarget(){return this._mainColorTargets[1-this._mainColorTarget]}get framebuffer(){return this.getFramebuffer(this.currentColorTarget,this.mainDepth)}getFramebuffer(e,t){return this._renderTargetHelper.getFramebuffer(this.width,this.height,e,t)}get colorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.currentColorTarget)}get depthTexture(){return this._renderTargetHelper.getAllocatedDepthTexture(this.mainDepth)}get linearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.linearDepth)}get terrainLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.terrainLinearDepth)}get geometryLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.geometryLinearDepth)}get lastFrameColorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.previousColorTarget)}get normalTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.normal)}get highlightTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.highlight)}get hudVisibilityTexture(){return this._getColorTexture(this.hudVisibility)}get tmpColorTexture(){return this._getColorTexture(this.tmpColor)}get hudColorTexture(){return this._getColorTexture(this.hudColor)}get mainColorTexture(){return this._getColorTexture(this.currentColorTarget)}setupRenderTarget(e){e?this._mainColorTarget=this._mainColorTarget?0:1:(this._mainColorTarget=0,this.disposeTarget(this._mainColorTargets[1]))}initializeFrame(e){const t=this._rctx;this.width=e.fullWidth,this.height=e.fullHeight,h(this,t.parameters.maxTextureSize),this.bindTarget(this.currentColorTarget,this.mainDepth),t.setClearStencil(0);const r=this._background.color;t.setClearColor(r[0]*r[3],r[1]*r[3],r[2]*r[3],r[3]),t.clearSafe(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT|a.STENCIL_BUFFER_BIT)}composite(e){null!=this.colorTexture&&this._compositingHelper.composite(e,this.colorTexture,r.None)}renderTmpAndCompositeToMain(e,t,r,i=!1){this.renderToTargets(e,this.tmpColor,i?this.tmpDepth:this.mainDepth,l),this._compositingHelper.composite(t,this._getColorTexture(this.tmpColor),r)}compositeAtmosphereToMain(e,t,r,i){this.bindTarget(this.currentColorTarget),this._compositingHelper.compositeAtmosphere(e,this._renderTargetHelper.getColorTexture(this.tmpColor,this.width,this.height),r,i,t),this.bindTarget(this.currentColorTarget,this.mainDepth)}renderHUDVisibility(e,t=!1){this.renderToTargets(e,this.hudVisibility,t?this.tmpDepth:this.mainDepth,g)}compositeTransparentTerrainOntoHUDVisibility(e){this.renderToTargets((()=>this._compositingHelper.compositeHUD(e,this._getColorTexture(this.tmpColor))),this.hudVisibility,this.tmpDepth)}renderOITPass(e,r,i){let o,s;switch(r){case t.Color:o=this.colorFloatTarget,s=[0,0,0,0];break;case t.Alpha:o=this.alphaFloatTarget,s=[1,1,1,1];break;case t.FrontFace:o=this.frontFaceTarget,s=[0,0,0,0];break;case t.NONE:case t.COUNT:return}i?this.renderToTargets(e,o,this.tmpDepth,s,!0,!0):this.renderToTargets(e,o,this.mainDepth,s,!1)}compositeTransparentTerrainOntoMain(e){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),r.PremultipliedAlpha)}compositeOccludedOntoMain(e,t){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),r.PremultipliedAlpha,t)}compositeTransparentOntoOpaque(e,t){t?(this.bindTarget(this.hudColor,this.tmpDepth),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clearSafe(a.COLOR_BUFFER_BIT)):this.bindFramebuffer(),this._compositingHelper.compositeOIT(e,this._getColorTexture(this.colorFloatTarget),this._getColorTexture(this.alphaFloatTarget),this._getColorTexture(this.frontFaceTarget))}bindFramebuffer(){this._rctx.bindFramebuffer(this.framebuffer)}renderDepthDetached(e){this.bindTarget(this.currentColorTarget),e(),this.bindTarget(this.currentColorTarget,this.mainDepth)}disposeTarget(e){this._renderTargetHelper.disposeTargetResource(e)}renderToFBO(e,t,r=!1,i=!1){const o=this._rctx;let s=0;if(t){const e=1e-13,r=Math.max(e,t[3]);o.setClearColor(t[0],t[1],t[2],r),s|=a.COLOR_BUFFER_BIT}r&&(s|=a.DEPTH_BUFFER_BIT),!1===i?i=0:(!0===i&&(i=255),s|=a.STENCIL_BUFFER_BIT),s&&o.clearSafe(s,i),e(),o.gl.flush(),this.bindTarget(this.currentColorTarget,this.mainDepth)}renderToTargets(e,t,r,i,o=!1,s=!1){const a=this.bindTarget(t,r);return this.renderToFBO(e,i,o,s),a}bindTarget(e,t){const r=this._renderTargetHelper.getFramebuffer(this.width,this.height,e,t);return this._rctx.bindFramebuffer(r),r}_getColorTexture(e){return this._renderTargetHelper.getColorTexture(e,this.width,this.height)}get gpuMemoryUsage(){let e=0;return this._renderTargetHelper&&(e+=this._renderTargetHelper.gpuMemoryUsage),e}}const l=[0,0,0,0],g=[0,1,0,1];export{n as OffscreenRendering};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{nullifyNonNullableForDispose as e}from"../../../../core/maybe.js";import{generateUID as t}from"../../../../core/uid.js";import{PixelType as r,PixelFormat as s,TextureSamplingMode as i,TextureWrapMode as o}from"../../../webgl/enums.js";import{FramebufferObject as h}from"../../../webgl/FramebufferObject.js";import{Texture as a}from"../../../webgl/Texture.js";import{TextureDescriptor as d}from"../../../webgl/TextureDescriptor.js";const c={dataType:r.UNSIGNED_BYTE,internalFormat:s.RGBA},p={};class u{constructor(e){this._rctx=e,this._activeTargets=new Set,this._colorTextures=new Map,this._depthTextures=new Map,this._fbos=new Map}dispose(){this._depthTextures.forEach((e=>e.dispose())),this._depthTextures.clear(),this._colorTextures.forEach((e=>e.dispose())),this._colorTextures.clear(),this._fbos.forEach((e=>e.dispose())),this._fbos.clear(),this._activeTargets.clear()}disposeTargetResource(e){const t=e.id;this._activeTargets.has(t)&&(this._activeTargets.delete(t),this._disposeWithFramebuffers(this._depthTextures,t),this._disposeWithFramebuffers(this._colorTextures,t))}_disposeWithFramebuffers(e,t){const r=e.get(t);r&&(this._fbos.forEach(((e,t)=>{e.colorTexture!==r&&e.depthStencilAttachment!==r||(e.detachColorTexture(),e.detachDepthStencilTexture(),e.dispose(),this._fbos.delete(t))})),r.dispose(),e.delete(t))}_getDepthTexture(e,t,h){let c=this._depthTextures.get(e.id);if(!c||c.descriptor.width===t&&c.descriptor.height===h||(c.dispose(),c=null),!c){const p=new d(t,h);p.pixelFormat=s.DEPTH_STENCIL,p.dataType=r.UNSIGNED_INT_24_8,p.samplingMode=i.NEAREST,p.wrapMode=o.CLAMP_TO_EDGE,c=new a(this._rctx,p),this._depthTextures.set(e.id,c),this._activeTargets.add(e.id)}return c}getAllocatedDepthTexture(e){return this._depthTextures.get(e.id)}getColorTexture(t,r,s){let h=this._colorTextures.get(t.id);if(h&&(h.descriptor.width===r&&h.descriptor.height===s||(h.dispose(),h=e())),!h){const e=new d(r,s);e.internalFormat=t.internalFormat,e.dataType=t.dataType,e.samplingMode=null!=t.samplingMode?t.samplingMode:i.LINEAR,e.wrapMode=o.CLAMP_TO_EDGE,h=new a(this._rctx,e),this._colorTextures.set(t.id,h),this._activeTargets.add(t.id)}return h}getAllocatedColorTexture(e){return this._colorTextures.get(e.id)}registerDepthTarget(e={}){return{id:t(),...p,...e}}registerColorTarget(e={}){return{id:t(),...c,...e}}getFramebuffer(e,t,r,s){const i=this._getKey(r,s);let o=this._fbos.get(i);const a=this.getColorTexture(r,e,t),d=s?this._getDepthTexture(s,e,t):void 0;if(!o)return o=new h(this._rctx,a,d),this._fbos.set(i,o),o;return(o.width!==e||o.height!==t||o.colorTexture!==a||o.depthStencilAttachment!==d)&&(o.detachColorTexture(),o.detachDepthStencilTexture(),o.resize(e,t),o.attachColorTexture(a),o.attachDepthStencil(d)),o}_getKey(e,t){return`${e.id}_${t?t.id:"X"}_${e.name}${t?"_"+t.name:""}`}get gpuMemoryUsage(){let e=0;const t=new Set,r=r=>{t.has(r)||(t.add(r),e+=r.gpuMemoryUsage)};return this._colorTextures.forEach(r),this._depthTextures.forEach(r),e}}export{u as RenderTargetHelper};
5
+ import{nullifyNonNullableForDispose as e}from"../../../../core/maybe.js";import{generateUID as t}from"../../../../core/uid.js";import{PixelType as r,PixelFormat as s,TextureSamplingMode as i,TextureWrapMode as o,SizedPixelFormat as h}from"../../../webgl/enums.js";import{FramebufferObject as a}from"../../../webgl/FramebufferObject.js";import{Texture as d}from"../../../webgl/Texture.js";import{TextureDescriptor as c}from"../../../webgl/TextureDescriptor.js";const p={dataType:r.UNSIGNED_BYTE,internalFormat:s.RGBA},l={};class u{constructor(e){this._rctx=e,this._activeTargets=new Set,this._colorTextures=new Map,this._depthTextures=new Map,this._fbos=new Map}dispose(){this._depthTextures.forEach((e=>e.dispose())),this._depthTextures.clear(),this._colorTextures.forEach((e=>e.dispose())),this._colorTextures.clear(),this._fbos.forEach((e=>e.dispose())),this._fbos.clear(),this._activeTargets.clear()}disposeTargetResource(e){const t=e.id;this._activeTargets.has(t)&&(this._activeTargets.delete(t),this._disposeWithFramebuffers(this._depthTextures,t),this._disposeWithFramebuffers(this._colorTextures,t))}_disposeWithFramebuffers(e,t){const r=e.get(t);r&&(this._fbos.forEach(((e,t)=>{e.colorTexture!==r&&e.depthStencilAttachment!==r||(e.detachColorTexture(),e.detachDepthStencilTexture(),e.dispose(),this._fbos.delete(t))})),r.dispose(),e.delete(t))}_getDepthTexture(e,t,h){let a=this._depthTextures.get(e.id);if(!a||a.descriptor.width===t&&a.descriptor.height===h||(a.dispose(),a=null),!a){const p=new c(t,h);p.pixelFormat=s.DEPTH_STENCIL,p.dataType=r.UNSIGNED_INT_24_8,p.samplingMode=i.NEAREST,p.wrapMode=o.CLAMP_TO_EDGE,a=new d(this._rctx,p),this._depthTextures.set(e.id,a),this._activeTargets.add(e.id)}return a}getAllocatedDepthTexture(e){return this._depthTextures.get(e.id)}getColorTexture(t,r,a){let p=this._colorTextures.get(t.id);if(p&&(p.descriptor.width===r&&p.descriptor.height===a||(p.dispose(),p=e())),!p){const e=new c(r,a);e.internalFormat=t.internalFormat,e.dataType=t.dataType,e.samplingMode=null!=t.samplingMode?t.samplingMode:i.LINEAR,e.wrapMode=o.CLAMP_TO_EDGE,e.internalFormat===h.R32F&&(e.pixelFormat=s.RED),p=new d(this._rctx,e),this._colorTextures.set(t.id,p),this._activeTargets.add(t.id)}return p}getAllocatedColorTexture(e){return this._colorTextures.get(e.id)}registerDepthTarget(e={}){return{id:t(),...l,...e}}registerColorTarget(e={}){return{id:t(),...p,...e}}getFramebuffer(e,t,r,s){const i=this._getKey(r,s);let o=this._fbos.get(i);const h=this.getColorTexture(r,e,t),d=s?this._getDepthTexture(s,e,t):void 0;if(!o)return o=new a(this._rctx,h,d),this._fbos.set(i,o),o;return(o.width!==e||o.height!==t||o.colorTexture!==h||o.depthStencilAttachment!==d)&&(o.detachColorTexture(),o.detachDepthStencilTexture(),o.resize(e,t),o.attachColorTexture(h),o.attachDepthStencil(d)),o}_getKey(e,t){return`${e.id}_${t?t.id:"X"}_${e.name}${t?"_"+t.name:""}`}get gpuMemoryUsage(){let e=0;const t=new Set,r=r=>{t.has(r)||(t.add(r),e+=r.gpuMemoryUsage)};return this._colorTextures.forEach(r),this._depthTextures.forEach(r),e}}export{u as RenderTargetHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{abortMaybe as s,disposeMaybe as t}from"../../../../core/maybe.js";import{throwIfAborted as i,isAborted as a}from"../../../../core/promiseUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{requestImage as h}from"../../../../support/requestImageUtils.js";import{ShaderTechniqueConfiguration as l}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{BlendWeightsTechnique as u}from"./BlendWeightsTechnique.js";import{BlurTechnique as c}from"./BlurTechnique.js";import{EdgeDetectTechnique as d}from"./EdgeDetectTechnique.js";import{createScreenSizeTriangleVAO as m}from"./glUtil3D.js";import{SMAAPassParameters as _}from"../shaders/SMAAPassParameters.js";import{TextureSamplingMode as p,PixelFormat as b,TextureWrapMode as T,ClearBufferBit as f,PrimitiveType as g}from"../../../webgl/enums.js";import{FramebufferObject as x}from"../../../webgl/FramebufferObject.js";import{Texture as q}from"../../../webgl/Texture.js";import{TextureDescriptor as P}from"../../../webgl/TextureDescriptor.js";let A=class extends r{constructor(e,r){super({}),this._rctx=e,this._techniqueRep=r,this._passParameters=new _,this._isEnabled=!1}normalizeCtorArgs(){return{}}dispose(){this._abortController=s(this._abortController),this.disable()}_loadResources(e){if(null!=this._abortController)return!1;if(null!=this._passParameters.searchTexture)return!0;this._abortController=new AbortController;const r=this._abortController.signal;return import("./SmaaRenderPassData.js").then((e=>this._loadTextures(e,r))).then((()=>e())).finally((()=>this._abortController=null)),!1}_loadTextures(e,r){return i(r),Promise.all([this._loadTextureFromBase64(e.areaTexture,p.LINEAR,b.RGB),this._loadTextureFromBase64(e.searchTexure,p.NEAREST,b.LUMINANCE)]).then((([e,s])=>{a(r)?(e.dispose(),s.dispose(),i(r)):(this._passParameters.areaTexture=e,this._passParameters.searchTexture=s)}))}get updating(){return null!=this._abortController}enable(e){if(this._isEnabled)return!0;if(!this._edgeDetectTechnique||!this._blendWeightsTechnique||!this._blurTechnique){const e=new l;this._edgeDetectTechnique=this._techniqueRep.releaseAndAcquire(d,e,this._edgeDetectTechnique),this._blendWeightsTechnique=this._techniqueRep.releaseAndAcquire(u,e,this._blendWeightsTechnique),this._blurTechnique=this._techniqueRep.releaseAndAcquire(c,e,this._blurTechnique)}if(!this._loadResources(e))return!1;this._vao=m(this._rctx);const r=new P(4,4);return r.pixelFormat=b.RGB,r.wrapMode=T.CLAMP_TO_EDGE,this._passParameters.edges=new x(this._rctx,r),r.pixelFormat=b.RGBA,this._passParameters.blend=new x(this._rctx,r),this._isEnabled=!0,!0}disable(){this._isEnabled&&(this._vao=t(this._vao),this._passParameters.areaTexture=t(this._passParameters.areaTexture),this._passParameters.searchTexture=t(this._passParameters.searchTexture),this._passParameters.blend=t(this._passParameters.blend),this._passParameters.edges=t(this._passParameters.edges),this._isEnabled=!1)}get _validPassParameters(){return this._isEnabled?this._passParameters:null}render(e){const r=this._validPassParameters;if(null==r)return;r.colorTexture=e;const s=this._rctx,t=s.getBoundFramebufferObject(),i=e.descriptor.width,a=e.descriptor.height;s.bindVAO(this._vao),s.setViewport(0,0,i,a),r.edges.resize(i,a),s.bindFramebuffer(r.edges),s.setClearColor(0,0,0,1),s.clear(f.COLOR_BUFFER_BIT),s.bindTechnique(this._edgeDetectTechnique,r,null),s.drawArrays(g.TRIANGLES,0,3),r.blend.resize(i,a),s.bindFramebuffer(r.blend),s.setClearColor(0,0,1,1),s.clear(f.COLOR_BUFFER_BIT),s.bindTechnique(this._blendWeightsTechnique,r,null),s.drawArrays(g.TRIANGLES,0,3),s.bindFramebuffer(t),s.setClearColor(0,1,0,1),s.clear(f.COLOR_BUFFER_BIT),s.bindTechnique(this._blurTechnique,r,null),s.drawArrays(g.TRIANGLES,0,3)}_loadTextureFromBase64(e,r,s){return h(e).then((e=>{const t=new P;return t.pixelFormat=s,t.wrapMode=T.CLAMP_TO_EDGE,t.width=e.width,t.height=e.height,t.samplingMode=r,new q(this._rctx,t,e)}))}};e([o()],A.prototype,"_abortController",void 0),e([o({readOnly:!0})],A.prototype,"updating",null),A=e([n("esri.views.3d.webgl-engine.lib.SmaaRenderPass")],A);export{A as SmaaRenderPass};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{abortMaybe as s,disposeMaybe as t}from"../../../../core/maybe.js";import{throwIfAborted as i,isAborted as a}from"../../../../core/promiseUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{requestImage as h}from"../../../../support/requestImageUtils.js";import{ShaderTechniqueConfiguration as l}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{BlendWeightsTechnique as u}from"./BlendWeightsTechnique.js";import{BlurTechnique as c}from"./BlurTechnique.js";import{EdgeDetectTechnique as d}from"./EdgeDetectTechnique.js";import{createScreenSizeTriangleVAO as m}from"./glUtil3D.js";import{SMAAPassParameters as _}from"../shaders/SMAAPassParameters.js";import{TextureSamplingMode as p,PixelFormat as b,SizedPixelFormat as T,TextureWrapMode as f,ClearBufferBit as g,PrimitiveType as x}from"../../../webgl/enums.js";import{FramebufferObject as q}from"../../../webgl/FramebufferObject.js";import{Texture as P}from"../../../webgl/Texture.js";import{TextureDescriptor as w}from"../../../webgl/TextureDescriptor.js";let A=class extends r{constructor(e,r){super({}),this._rctx=e,this._techniqueRep=r,this._passParameters=new _,this._isEnabled=!1}normalizeCtorArgs(){return{}}dispose(){this._abortController=s(this._abortController),this.disable()}_loadResources(e){if(null!=this._abortController)return!1;if(null!=this._passParameters.searchTexture)return!0;this._abortController=new AbortController;const r=this._abortController.signal;return import("./SmaaRenderPassData.js").then((e=>this._loadTextures(e,r))).then((()=>e())).finally((()=>this._abortController=null)),!1}_loadTextures(e,r){return i(r),Promise.all([this._loadTextureFromBase64(e.areaTexture,p.LINEAR,b.RGB),this._loadTextureFromBase64(e.searchTexure,p.NEAREST,b.LUMINANCE)]).then((([e,s])=>{a(r)?(e.dispose(),s.dispose(),i(r)):(this._passParameters.areaTexture=e,this._passParameters.searchTexture=s)}))}get updating(){return null!=this._abortController}enable(e){if(this._isEnabled)return!0;if(!this._edgeDetectTechnique||!this._blendWeightsTechnique||!this._blurTechnique){const e=new l;this._edgeDetectTechnique=this._techniqueRep.releaseAndAcquire(d,e,this._edgeDetectTechnique),this._blendWeightsTechnique=this._techniqueRep.releaseAndAcquire(u,e,this._blendWeightsTechnique),this._blurTechnique=this._techniqueRep.releaseAndAcquire(c,e,this._blurTechnique)}if(!this._loadResources(e))return!1;this._vao=m(this._rctx);const r=new w(4,4);r.pixelFormat=b.RG,r.internalFormat=T.RG8,r.wrapMode=f.CLAMP_TO_EDGE,this._passParameters.edges=new q(this._rctx,r);const s=new w(4,4);return s.pixelFormat=b.RGBA,s.wrapMode=f.CLAMP_TO_EDGE,this._passParameters.blend=new q(this._rctx,s),this._isEnabled=!0,!0}disable(){this._isEnabled&&(this._vao=t(this._vao),this._passParameters.areaTexture=t(this._passParameters.areaTexture),this._passParameters.searchTexture=t(this._passParameters.searchTexture),this._passParameters.blend=t(this._passParameters.blend),this._passParameters.edges=t(this._passParameters.edges),this._isEnabled=!1)}get _validPassParameters(){return this._isEnabled?this._passParameters:null}render(e){const r=this._validPassParameters;if(null==r)return;r.colorTexture=e;const s=this._rctx,t=s.getBoundFramebufferObject(),i=e.descriptor.width,a=e.descriptor.height;s.bindVAO(this._vao),s.setViewport(0,0,i,a),r.edges.resize(i,a),s.bindFramebuffer(r.edges),s.setClearColor(0,0,0,1),s.clear(g.COLOR_BUFFER_BIT),s.bindTechnique(this._edgeDetectTechnique,r,null),s.drawArrays(x.TRIANGLES,0,3),r.blend.resize(i,a),s.bindFramebuffer(r.blend),s.setClearColor(0,0,1,1),s.clear(g.COLOR_BUFFER_BIT),s.bindTechnique(this._blendWeightsTechnique,r,null),s.drawArrays(x.TRIANGLES,0,3),s.bindFramebuffer(t),s.setClearColor(0,1,0,1),s.clear(g.COLOR_BUFFER_BIT),s.bindTechnique(this._blurTechnique,r,null),s.drawArrays(x.TRIANGLES,0,3)}_loadTextureFromBase64(e,r,s){return h(e).then((e=>{const t=new w;return t.pixelFormat=s,t.wrapMode=f.CLAMP_TO_EDGE,t.width=e.width,t.height=e.height,t.samplingMode=r,new P(this._rctx,t,e)}))}};e([o()],A.prototype,"_abortController",void 0),e([o({readOnly:!0})],A.prototype,"updating",null),A=e([n("esri.views.3d.webgl-engine.lib.SmaaRenderPass")],A);export{A as SmaaRenderPass};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{createTask as p}from"../core/asyncUtils.js";import{deprecated as t}from"../core/deprecate.js";import s from"../core/Error.js";import i from"../core/Logger.js";import{eachAlwaysValues as o,throwIfAborted as r}from"../core/promiseUtils.js";import{watch as a,initial as u,whenOnce as n}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{ViewEventPriorities as h}from"./input/InputManager.js";function d(e){return null!=e&&"open"in e&&"declaredClass"in e}const y=y=>{let w=class extends y{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([a((()=>[this.ui,this.popup]),(([e,p],t)=>{const s="popup",i="manual";if(t){const[e,p]=t;e&&d(p)&&(p.view=null,e.remove(p,s))}e&&d(p)&&(p.view=this,e.add(p,{key:s,position:i}))}),u),this.on("click",(e=>{this.popup&&this.popupEnabled&&("mouse"!==e.pointerType||0===e.button)&&(d(this.popup)||!1!==this.popup?.autoOpenEnabled)&&(d(this.popup)?this.popup.viewModel.handleViewClick(e):e.async((async()=>{await this.setupPopup(),d(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(e)})))}),h.WIDGET)]),n((()=>this.ready&&this.popupEnabled&&!this.updating)).then((()=>{import("../widgets/Popup.js")}))}destroy(){this.destroyed||this.closePopup()}async openPopup(e){d(this.popup)&&this.popup.open(e);try{if(await this.setupPopup(),!this.popup)return void i.getLogger(this).error(new s("view:null-popup","Popup is null and can't be opened"));this.popup.open(e)}catch{}}closePopup(){this._popupSetupTask?.abort(),d(this.popup)&&this.popup.close()}async fetchPopupFeatures(e,p){await this.when();const{location:t,queryArea:s,layerViewsAndGraphics:i,clientOnlyGraphics:r}=await this._prepareFetchPopupFeatures(e,p),a=Promise.resolve(r),u=this._queryLayerPopupFeatures(s,i,p),n=u.map((e=>e.promise));return{location:t,clientOnlyGraphics:r,allGraphicsPromise:o([a,...n]).then((e=>Array.from(new Set(e.flat())))),promisesPerLayerView:u}}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!d(this.popup))return this._popupSetupTask=p((async e=>{const{default:p}=await import("../widgets/Popup.js");if(r(e),!this.popup||d(this.popup))return;const t=this.popup;delete t.open,delete t.close,this.popup=new p(t)})),this._popupSetupTask.promise}_queryLayerPopupFeatures(e,p,t){return p.map((({layerView:p,graphics:s})=>{const i={clientGraphics:s,event:null!=t?t.event:void 0,signal:null!=t?t.signal:void 0,defaultPopupTemplateEnabled:null!=t&&!!t.defaultPopupTemplateEnabled},o=p.fetchPopupFeatures(e,i);return{layerView:p,promise:o}}))}_isValidPopupGraphic(e,p){return e&&!!e.getEffectivePopupTemplate(null!=p&&p.defaultPopupTemplateEnabled)}async _prepareFetchPopupFeatures(e,p){const{clientGraphics:t,queryArea:s,location:i}=await this._popupHitTestGraphics(e,p),o=this._getFetchPopupLayerViews(),{layerViewsAndGraphics:r,clientOnlyGraphics:a}=this._graphicsPerFetchPopupLayerView(t,o);return{clientOnlyGraphics:a,layerViewsAndGraphics:r,queryArea:s,location:i}}async _popupHitTestGraphics(e,p){const t=await this.popupHitTest(e),s=t.results,i=t.mapPoint,o=s.filter((e=>"graphic"===e.type&&this._isValidPopupGraphic(e.graphic,p))),r=o.length?o[0].mapPoint:null;return{clientGraphics:o.map((e=>e.graphic)),queryArea:i,location:i||r}}_getFetchPopupLayerViews(){const e=[];return this.allLayerViews.forEach((p=>{this._isValidPopupLayerView(p)&&e.push(p)})),null!=this.graphicsView&&this._isValidPopupLayerView(this.graphicsView)&&e.push(this.graphicsView),e.reverse()}_isValidPopupLayerView(e){return null!=e&&(!("layer"in e)||!e.suspended)&&"fetchPopupFeatures"in e}_graphicsPerFetchPopupLayerView(e,p){const t=[],s=new Map,i=p.map((e=>{const p=[];return"layer"in e?s.set(e.layer,p):s.set(e.graphics,p),{layerView:e,graphics:p}}));for(const o of e){const e=s.get(o.layer)||s.get(o.sourceLayer)||null;e?e.push(o):t.push(o)}return{layerViewsAndGraphics:i,clientOnlyGraphics:t}}};return e([l({cast(e){return!e||d(e)||"object"==typeof e&&(e.open=e=>(t(i.getLogger(this),"view.popup is no longer created by default. view.popup.open() will stop working when the popup isn't created",{replacement:"Use view.openPopup() instead.",version:"4.27"}),this.openPopup(e)),e.close=()=>(t(i.getLogger(this),"view.popup is no longer created by default. view.popup.close() will stop working when the popup isn't created",{replacement:"Use view.closePopup() instead.",version:"4.27"}),this.closePopup())),e}})],w.prototype,"popup",void 0),e([l()],w.prototype,"popupEnabled",void 0),w=e([c("esri.views.PopupView")],w),w};export{y as PopupView};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{createTask as p}from"../core/asyncUtils.js";import{deprecated as t}from"../core/deprecate.js";import i from"../core/Error.js";import s from"../core/Logger.js";import{eachAlwaysValues as o,throwIfAborted as r}from"../core/promiseUtils.js";import{watch as a,initial as n,whenOnce as u}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{ViewEventPriorities as h}from"./input/InputManager.js";function d(e){return null!=e&&"open"in e&&"declaredClass"in e}function y(e){return null!=e&&"declaredClass"in e&&"dockOptions"in e}const w=w=>{let m=class extends w{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([a((()=>[this.ui,this.popup]),(([e,p],t)=>{const i="popup",s="manual";if(t){const[e,p]=t;e&&d(p)&&(p.view=null,y(p)&&e.remove(p,i))}e&&d(p)&&(p.view=this,y(p)&&e.add(p,{key:i,position:s}))}),n),this.on("click",(e=>{if(!this.popup||!this.popupEnabled||"mouse"===e.pointerType&&0!==e.button)return;const p="autoOpenEnabled"in this.popup&&!1===this.popup.autoOpenEnabled;!d(this.popup)&&p||(d(this.popup)?this.popup.viewModel.handleViewClick(e):e.async((async()=>{await this.setupPopup(),d(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(e)})))}),h.WIDGET)]),u((()=>this.ready&&this.popupEnabled&&!this.updating)).then((()=>{import("../widgets/Popup.js")}))}destroy(){this.destroyed||this.closePopup()}async openPopup(e){d(this.popup)&&this.popup.open(e);try{if(await this.setupPopup(),!this.popup)return void s.getLogger(this).error(new i("view:null-popup","Popup is null and can't be opened"));this.popup.open(e)}catch{}}closePopup(){this._popupSetupTask?.abort(),d(this.popup)&&this.popup.close()}async fetchPopupFeatures(e,p){await this.when();const{location:t,queryArea:i,layerViewsAndGraphics:s,clientOnlyGraphics:r}=await this._prepareFetchPopupFeatures(e,p),a=Promise.resolve(r),n=this._queryLayerPopupFeatures(i,s,p),u=n.map((e=>e.promise));return{location:t,clientOnlyGraphics:r,allGraphicsPromise:o([a,...u]).then((e=>Array.from(new Set(e.flat())))),promisesPerLayerView:n}}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!d(this.popup))return this._popupSetupTask=p((async e=>{const{default:p}=await import("../widgets/Popup.js");if(r(e),!this.popup||d(this.popup))return;const t=this.popup;delete t.open,delete t.close,this.popup=new p(t)})),this._popupSetupTask.promise}_queryLayerPopupFeatures(e,p,t){return p.map((({layerView:p,graphics:i})=>{const s={clientGraphics:i,event:null!=t?t.event:void 0,signal:null!=t?t.signal:void 0,defaultPopupTemplateEnabled:null!=t&&!!t.defaultPopupTemplateEnabled},o=p.fetchPopupFeatures(e,s);return{layerView:p,promise:o}}))}_isValidPopupGraphic(e,p){return e&&!!e.getEffectivePopupTemplate(null!=p&&p.defaultPopupTemplateEnabled)}async _prepareFetchPopupFeatures(e,p){const{clientGraphics:t,queryArea:i,location:s}=await this._popupHitTestGraphics(e,p),o=this._getFetchPopupLayerViews(),{layerViewsAndGraphics:r,clientOnlyGraphics:a}=this._graphicsPerFetchPopupLayerView(t,o);return{clientOnlyGraphics:a,layerViewsAndGraphics:r,queryArea:i,location:s}}async _popupHitTestGraphics(e,p){const t=await this.popupHitTest(e),i=t.results,s=t.mapPoint,o=i.filter((e=>"graphic"===e.type&&this._isValidPopupGraphic(e.graphic,p))),r=o.length?o[0].mapPoint:null;return{clientGraphics:o.map((e=>e.graphic)),queryArea:s,location:s||r}}_getFetchPopupLayerViews(){const e=[];return this.allLayerViews.forEach((p=>{this._isValidPopupLayerView(p)&&e.push(p)})),null!=this.graphicsView&&this._isValidPopupLayerView(this.graphicsView)&&e.push(this.graphicsView),e.reverse()}_isValidPopupLayerView(e){return null!=e&&(!("layer"in e)||!e.suspended)&&"fetchPopupFeatures"in e}_graphicsPerFetchPopupLayerView(e,p){const t=[],i=new Map,s=p.map((e=>{const p=[];return"layer"in e?i.set(e.layer,p):i.set(e.graphics,p),{layerView:e,graphics:p}}));for(const o of e){const e=i.get(o.layer)||i.get(o.sourceLayer)||null;e?e.push(o):t.push(o)}return{layerViewsAndGraphics:s,clientOnlyGraphics:t}}};return e([l({cast(e){return!e||d(e)||"object"==typeof e&&(e.open=e=>(t(s.getLogger(this),"view.popup is no longer created by default. view.popup.open() will stop working when the popup isn't created",{replacement:"Use view.openPopup() instead.",version:"4.27"}),this.openPopup(e)),e.close=()=>(t(s.getLogger(this),"view.popup is no longer created by default. view.popup.close() will stop working when the popup isn't created",{replacement:"Use view.closePopup() instead.",version:"4.27"}),this.closePopup())),e}})],m.prototype,"popup",void 0),e([l()],m.prototype,"popupEnabled",void 0),m=e([c("esri.views.PopupView")],m),m};export{w as PopupView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- const e="esri-basemap-gallery",i={base:`${e} esri-widget esri-widget--panel-height-only`,sourceLoading:`${e}--source-loading`,loader:`${e}__loader`,item:`${e}__item`,itemContainer:`${e}__item-container`,itemTitle:`${e}__item-title`,itemThumbnail:`${e}__item-thumbnail`,selectedItem:`${e}__item--selected`,itemError:`${e}__item--error`,emptyMessage:"esri-widget__content--empty",widgetIcon:"esri-icon-basemap",disabled:"esri-disabled",loaderAnimation:"esri-widget__loader-animation"};export{i as CSS};
5
+ const e="esri-basemap-gallery",i={base:`${e} esri-widget esri-widget--panel-height-only`,sourceLoading:`${e}--source-loading`,loader:`${e}__loader`,item:`${e}__item`,itemContainer:`${e}__item-container`,itemContent:`${e}__item-content`,itemTitle:`${e}__item-title`,itemTagsContainer:`${e}__item-tags-container`,itemThumbnail:`${e}__item-thumbnail`,selectedItem:`${e}__item--selected`,itemError:`${e}__item--error`,emptyMessage:"esri-widget__content--empty",widgetIcon:"esri-icon-basemap",disabled:"esri-disabled",loaderAnimation:"esri-widget__loader-animation"};export{i as CSS};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as s}from"../assets.js";import t from"../core/Handles.js";import{on as a,when as i,watch as o}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import n from"./BasemapGallery/BasemapGalleryViewModel.js";import{CSS as m}from"./BasemapGallery/css.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{Heading as c}from"./support/Heading.js";import{accessibleHandler as h}from"./support/decorators/accessibleHandler.js";import{messageBundle as u}from"./support/decorators/messageBundle.js";import{tsx as g}from"./support/jsxFactory.js";import"./support/widgetUtils.js";let v=class extends d{constructor(e,s){super(e,s),this._handles=new t,this._focusBasemapItemEnabled=!1,this.disabled=!1,this.headingLevel=2,this.iconClass=m.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new n}initialize(){const e=this._handles;this.addHandles([a((()=>this.viewModel.items),"change",(s=>{const t="basemap-gallery-item-changes",{added:a,moved:i}=s;e.remove(t),e.add([...a,...i].map((e=>o((()=>e.state),(()=>this.scheduleRender())))),t),this.scheduleRender()})),i((()=>this.source),(()=>this.viewModel.load()),{initial:!0,once:!0})])}destroy(){this._handles.destroy()}loadDependencies(){return p({scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim.js")})}get activeBasemap(){return this.viewModel.activeBasemap}set activeBasemap(e){this.viewModel.activeBasemap=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get source(){return this.viewModel.source}set source(e){this.viewModel.source=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e="loading"===this.source.state,s=this.disabled||"disabled"===this.viewModel.state,t=this.viewModel.items.map(((e,s)=>this._renderBasemapGalleryItem(e,s))).toArray(),a={[m.sourceLoading]:e,[m.disabled]:s},i=e?g("div",{class:m.loader,key:"esri-basemap-gallery__loader"}):null,o=e?null:t.length>0?g("ul",{bind:this,"aria-disabled":this.disabled,"aria-label":this.label,class:m.itemContainer,key:"esri-basemap-gallery__item-container",onkeydown:this._handleKeyDown,role:"radiogroup"},t):g("div",{class:m.emptyMessage,key:"esri-basemap-gallery__empty-message"},g(c,{level:this.headingLevel},this.messages.noBasemaps));return g("div",{class:this.classes(m.base,a)},i,o)}_getRoundRobinIndex(e,s){return(e+s)%s}_handleKeyDown(e){const{key:s}=e;if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(s))return;e.preventDefault();const{items:t,activeBasemapIndex:a}=this.viewModel,i="ArrowUp"===s||"ArrowLeft"===s?this._getRoundRobinIndex(Math.max(a-1,-1),t.length):this._getRoundRobinIndex(a+1,t.length),o=t.getItemAt(i);"ready"===o?.state&&(this.viewModel.activeBasemap=o.basemap),this._focusBasemapItemEnabled=!0}_focusBasemapItem(e){this._focusBasemapItemEnabled&&0===e.tabIndex&&(e.focus(),this._focusBasemapItemEnabled=!1)}_handleClick(e){const s=e.currentTarget["data-item"];"ready"===s.state&&(this.viewModel.activeBasemap=s.basemap)}_renderBasemapGalleryItem(e,t){const a=e.basemap.thumbnailUrl||s("esri/themes/base/images/basemap-toggle-64.svg"),i=e.basemap.title,o=e.basemap.portalItem?.snippet,r=e.error?.message||o||i,{viewModel:{state:l,activeBasemapIndex:d}}=this,n=this.disabled||"disabled"===l,p=d===t,c=p||-1===d&&0===t?0:-1,h="loading"===l,u={[m.selectedItem]:p,[m.itemError]:"error"===e.state},v=`basemapgallery-item-${e.uid}`;return g("li",{"aria-checked":p.toString(),"aria-disabled":n.toString(),"aria-labelledby":v,bind:this,class:this.classes(m.item,u),"data-item":e,onkeydown:this._handleClick,onclick:this._handleClick,role:"radio",tabIndex:c,afterUpdate:this._focusBasemapItem,title:r},g("img",{alt:"",class:m.itemThumbnail,src:a}),g("div",{id:v,class:m.itemTitle},i),"loading"===e.state||p&&h?g("calcite-scrim",null,g("span",{"aria-hidden":"true",role:"presentation",class:m.loaderAnimation})):null)}};e([r()],v.prototype,"activeBasemap",null),e([r()],v.prototype,"disabled",void 0),e([r()],v.prototype,"headingLevel",void 0),e([r()],v.prototype,"iconClass",void 0),e([r()],v.prototype,"icon",void 0),e([r()],v.prototype,"label",null),e([r(),u("esri/widgets/BasemapGallery/t9n/BasemapGallery")],v.prototype,"messages",void 0),e([r()],v.prototype,"source",null),e([r()],v.prototype,"view",null),e([r()],v.prototype,"viewModel",void 0),e([h()],v.prototype,"_handleClick",null),v=e([l("esri.widgets.BasemapGallery")],v);const b=v;export{b as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{getAssetUrl as s}from"../assets.js";import t from"../core/Handles.js";import{on as a,when as i,watch as r}from"../core/reactiveUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{isBasemap3D as n}from"../support/basemapUtils.js";import d from"./Widget.js";import p from"./BasemapGallery/BasemapGalleryViewModel.js";import{CSS as m}from"./BasemapGallery/css.js";import{loadCalciteComponents as c}from"./support/componentsUtils.js";import{Heading as h}from"./support/Heading.js";import{accessibleHandler as u}from"./support/decorators/accessibleHandler.js";import{messageBundle as g}from"./support/decorators/messageBundle.js";import{tsx as v}from"./support/jsxFactory.js";import"./support/widgetUtils.js";let b=class extends d{constructor(e,s){super(e,s),this._handles=new t,this._focusBasemapItemEnabled=!1,this.disabled=!1,this.headingLevel=2,this.iconClass=m.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new p}initialize(){const e=this._handles;this.addHandles([a((()=>this.viewModel.items),"change",(s=>{const t="basemap-gallery-item-changes",{added:a,moved:i}=s;e.remove(t),e.add([...a,...i].map((e=>r((()=>e.state),(()=>this.scheduleRender())))),t),this.scheduleRender()})),i((()=>this.source),(()=>this.viewModel.load()),{initial:!0,once:!0})])}destroy(){this._handles.destroy()}loadDependencies(){return c({scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim.js"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip.js")})}get activeBasemap(){return this.viewModel.activeBasemap}set activeBasemap(e){this.viewModel.activeBasemap=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get source(){return this.viewModel.source}set source(e){this.viewModel.source=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e="loading"===this.source.state,s=this.disabled||"disabled"===this.viewModel.state,t=this.viewModel.items.map(((e,s)=>this._renderBasemapGalleryItem(e,s))).toArray(),a={[m.sourceLoading]:e,[m.disabled]:s},i=e?v("div",{class:m.loader,key:"esri-basemap-gallery__loader"}):null,r=e?null:t.length>0?v("ul",{bind:this,"aria-disabled":this.disabled,"aria-label":this.label,class:m.itemContainer,key:"esri-basemap-gallery__item-container",onkeydown:this._handleKeyDown,role:"radiogroup"},t):v("div",{class:m.emptyMessage,key:"esri-basemap-gallery__empty-message"},v(h,{level:this.headingLevel},this.messages.noBasemaps));return v("div",{class:this.classes(m.base,a)},i,r)}_getRoundRobinIndex(e,s){return(e+s)%s}_handleKeyDown(e){const{key:s}=e;if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(s))return;e.preventDefault();const{items:t,activeBasemapIndex:a}=this.viewModel,i="ArrowUp"===s||"ArrowLeft"===s?this._getRoundRobinIndex(Math.max(a-1,-1),t.length):this._getRoundRobinIndex(a+1,t.length),r=t.getItemAt(i);"ready"===r?.state&&(this.viewModel.activeBasemap=r.basemap),this._focusBasemapItemEnabled=!0}_focusBasemapItem(e){this._focusBasemapItemEnabled&&0===e.tabIndex&&(e.focus(),this._focusBasemapItemEnabled=!1)}_handleClick(e){const s=e.currentTarget["data-item"];"ready"===s.state&&(this.viewModel.activeBasemap=s.basemap)}_renderBasemapGalleryItem(e,t){const a=e.basemap.thumbnailUrl||s("esri/themes/base/images/basemap-toggle-64.svg"),i=e.basemap.title,r=e.basemap.portalItem?.snippet,o=e.error?.message||r||i,{viewModel:{state:l,activeBasemapIndex:d}}=this,p=this.disabled||"disabled"===l,c=d===t,h=c||-1===d&&0===t?0:-1,u="loading"===l,g={[m.selectedItem]:c,[m.itemError]:"error"===e.state},b=`basemapgallery-item-${e.uid}`;return v("li",{"aria-checked":c.toString(),"aria-disabled":p.toString(),"aria-labelledby":b,bind:this,class:this.classes(m.item,g),"data-item":e,onkeydown:this._handleClick,onclick:this._handleClick,role:"radio",tabIndex:h,afterUpdate:this._focusBasemapItem,title:o},v("img",{alt:"",class:m.itemThumbnail,src:a}),v("div",{class:m.itemContent},v("div",{class:m.itemTitle},v("span",{id:b},i)),n(e.basemap)?this._render3DTags():null),"loading"===e.state||c&&u?v("calcite-scrim",null,v("span",{"aria-hidden":"true",role:"presentation",class:m.loaderAnimation})):null)}_render3DTags(){const{messages:e}=this;return v("div",{class:m.itemTagsContainer},v("calcite-chip",{value:e.tag3D,scale:"s"},this.messages.tag3D),v("calcite-chip",{value:e.tagBeta,scale:"s",appearance:"outline-fill"},this.messages.tagBeta))}};e([o()],b.prototype,"activeBasemap",null),e([o()],b.prototype,"disabled",void 0),e([o()],b.prototype,"headingLevel",void 0),e([o()],b.prototype,"iconClass",void 0),e([o()],b.prototype,"icon",void 0),e([o()],b.prototype,"label",null),e([o(),g("esri/widgets/BasemapGallery/t9n/BasemapGallery")],b.prototype,"messages",void 0),e([o()],b.prototype,"source",null),e([o()],b.prototype,"view",null),e([o()],b.prototype,"viewModel",void 0),e([u()],b.prototype,"_handleClick",null),b=e([l("esri.widgets.BasemapGallery")],b);const y=b;export{y 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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{destroyMaybe as t}from"../../core/maybe.js";import{after as s}from"../../core/promiseUtils.js";import{watch as r,initial as i,on as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{cast as a}from"../../core/accessorSupport/decorators/cast.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import d from"../Widget.js";import c from"./FeatureRelationship/FeatureRelationshipViewModel.js";import u from"./support/FeatureElementInfo.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{isRTL as p}from"../support/widgetUtils.js";import{messageBundle as m}from"../support/decorators/messageBundle.js";import{tsx as v}from"../support/jsxFactory.js";import{substitute as g}from"../../intl/substitute.js";const w="esri-feature",b=`${w}-relationship`,f={base:b,esriWidget:"esri-widget",listContainer:`${b}__list`,listContainerQuerying:`${b}__list--querying`,featureObserver:`${w}__feature-observer`,stickySpinnerContainer:`${w}__sticky-loading-container`,loadingSpinnerContainer:`${w}__loading-container`,spinner:`${w}__loading-spinner`,iconLoading:"esri-icon-loading-indicator esri-rotating"},y={title:!0,description:!0};let F=class extends d{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this.headingLevel=2,this.viewModel=new c,this.messages=null,this.messagesCommon=null,this.visibleElements={...y},this._increaseFeaturePage=()=>{const{state:e,showAllEnabled:t,relatedFeatures:s,featuresPerPage:r,featurePage:i}=this.viewModel;"ready"===e&&t&&s.length>=r*i&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new u,this.addHandles([r((()=>[this.viewModel.description,this.viewModel.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),i),r((()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode]),(()=>this._handleRelatedFeatureObserverChange())),o((()=>this.viewModel.relatedFeatureViewModels),"change",(()=>this._setupRelatedFeatureViewModels()))])}loadDependencies(){return h({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js")})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=t(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:s,relatedFeatureViewModels:r}=this.viewModel;return!e&&!!t&&!!r.length&&(t>s||0===s)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return g(e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...y,...e}}renderStickyLoading(){return"querying"===this.viewModel.state?v("div",{key:"sticky-loader",class:f.stickySpinnerContainer},this.renderLoadingIcon()):null}renderLoadingIcon(){return v("span",{class:this.classes(f.iconLoading,f.spinner)})}renderLoading(){return v("div",{key:"loading-container",class:f.loadingSpinnerContainer},this.renderLoadingIcon())}renderShowAllIconNode(){return v("calcite-icon",{scale:"s",icon:"list",slot:"content-end"})}renderChevronIconNode(){const e=p(this.container)?"chevron-left":"chevron-right";return v("calcite-icon",{scale:"s",icon:e,slot:"content-end"})}renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,s=e.title;e.description=t&&e.formattedAttributes?.global[t];const r="loading"===e.state;return v("calcite-list-item",{key:e.uid,label:r?`${this.messagesCommon?.loading}…`:s,description:r?"…":e.description??"",onCalciteListItemSelect:()=>this.emit("select-record",{featureViewModel:e})},this.renderChevronIconNode())}renderShowAllListItem(){return this.displayShowAllButton?v("calcite-list-item",{key:"show-all-item",label:this.messages?.showAll,description:this.featureCountDescription,onCalciteListItemSelect:()=>this.emit("show-all-records")},this.renderShowAllIconNode()):null}renderNoRelatedFeaturesMessage(){return v("calcite-notice",{key:"no-related-features-message",icon:"information",open:!0,kind:"brand",scale:"s",width:"full"},v("div",{slot:"message"},this.messages?.noRelatedFeatures))}renderFeatureObserver(){return v("div",{key:"feature-observer",class:f.featureObserver,bind:this,afterCreate:this._relatedFeatureIntersectionObserverCreated})}renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return v("calcite-list",null,e.toArray().map((e=>this.renderRelatedFeature(e))),this.renderShowAllListItem())}renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return v("div",{key:"list-container",class:this.classes(f.listContainer,{[f.listContainerQuerying]:"querying"===t})},e?this.renderList():"ready"===t?this.renderNoRelatedFeaturesMessage():null,this.renderStickyLoading(),this.renderFeatureObserver())}renderRelationshipNotFound(){return v("calcite-notice",{key:"relationship-not-found",icon:"exclamation-mark-triangle",open:!0,kind:"danger",scale:"s",width:"full"},v("div",{slot:"message"},this.messages?.relationshipNotFound))}render(){const{state:e}=this.viewModel;return v("div",{class:this.classes(f.base,f.esriWidget)},this._featureElementInfo?.render(),"loading"===e?this.renderLoading():"disabled"===e?this.renderRelationshipNotFound():this.renderRelatedFeatures())}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach((e=>{this.addHandles(r((()=>[e.title,e.state]),(()=>this.scheduleRender()),i),t)})),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,s=t.description&&this.description,r=t.title&&this.title;this._featureElementInfo?.set({description:s,title:r,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await s(0),this._relatedFeatureIntersectionObserverNode&&"ready"===e&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};e([n()],F.prototype,"_relatedFeatureIntersectionObserverNode",void 0),e([n({readOnly:!0})],F.prototype,"displayShowAllButton",null),e([n({readOnly:!0})],F.prototype,"displayListItems",null),e([n()],F.prototype,"description",null),e([n({readOnly:!0})],F.prototype,"featureCountDescription",null),e([n()],F.prototype,"headingLevel",void 0),e([n()],F.prototype,"title",null),e([n({type:c})],F.prototype,"viewModel",void 0),e([n(),m("esri/widgets/Feature/t9n/Feature")],F.prototype,"messages",void 0),e([n(),m("esri/t9n/common")],F.prototype,"messagesCommon",void 0),e([n()],F.prototype,"visibleElements",void 0),e([a("visibleElements")],F.prototype,"castVisibleElements",null),F=e([l("esri.widgets.Feature.FeatureRelationship")],F);const _=F;export{_ as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{destroyMaybe as t}from"../../core/maybe.js";import{after as s}from"../../core/promiseUtils.js";import{watch as r,initial as i,on as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{cast as a}from"../../core/accessorSupport/decorators/cast.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import d from"../Widget.js";import c from"./FeatureRelationship/FeatureRelationshipViewModel.js";import u from"./support/FeatureElementInfo.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{isRTL as p}from"../support/widgetUtils.js";import{messageBundle as m}from"../support/decorators/messageBundle.js";import{tsx as v}from"../support/jsxFactory.js";import{substitute as g}from"../../intl/substitute.js";const w="esri-feature",b=`${w}-relationship`,f={base:b,esriWidget:"esri-widget",listContainer:`${b}__list`,listContainerQuerying:`${b}__list--querying`,featureObserver:`${w}__feature-observer`,stickySpinnerContainer:`${w}__sticky-loading-container`,loadingSpinnerContainer:`${w}__loading-container`,spinner:`${w}__loading-spinner`,iconLoading:"esri-icon-loading-indicator esri-rotating"},y={title:!0,description:!0};let F=class extends d{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver((([e])=>{e?.isIntersecting&&this._increaseFeaturePage()}),{root:window.document}),this.headingLevel=2,this.viewModel=new c,this.messages=null,this.messagesCommon=null,this.visibleElements={...y},this._increaseFeaturePage=()=>{const{state:e,showAllEnabled:t,relatedFeatures:s,featuresPerPage:r,featurePage:i}=this.viewModel;"ready"===e&&t&&s.length>=r*i&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new u,this.addHandles([r((()=>[this.viewModel.description,this.viewModel.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),i),r((()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode]),(()=>this._handleRelatedFeatureObserverChange())),o((()=>this.viewModel.relatedFeatureViewModels),"change",(()=>this._setupRelatedFeatureViewModels()))])}loadDependencies(){return h({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js")})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=t(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:s,state:r}=this.viewModel;return!e&&!!t&&"ready"===r&&(t>s||0===s)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return g(e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...y,...e}}renderStickyLoading(){return"querying"===this.viewModel.state?v("div",{key:"sticky-loader",class:f.stickySpinnerContainer},this.renderLoadingIcon()):null}renderLoadingIcon(){return v("span",{class:this.classes(f.iconLoading,f.spinner)})}renderLoading(){return v("div",{key:"loading-container",class:f.loadingSpinnerContainer},this.renderLoadingIcon())}renderShowAllIconNode(){return v("calcite-icon",{scale:"s",icon:"list",slot:"content-end"})}renderChevronIconNode(){const e=p(this.container)?"chevron-left":"chevron-right";return v("calcite-icon",{scale:"s",icon:e,slot:"content-end"})}renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,s=e.title;e.description=t&&e.formattedAttributes?.global[t];const r="loading"===e.state;return v("calcite-list-item",{key:e.uid,label:r?`${this.messagesCommon?.loading}…`:s,description:r?"…":e.description??"",onCalciteListItemSelect:()=>this.emit("select-record",{featureViewModel:e})},this.renderChevronIconNode())}renderShowAllListItem(){return this.displayShowAllButton?v("calcite-list-item",{key:"show-all-item",label:this.messages?.showAll,description:this.featureCountDescription,onCalciteListItemSelect:()=>this.emit("show-all-records")},this.renderShowAllIconNode()):null}renderNoRelatedFeaturesMessage(){return v("calcite-notice",{key:"no-related-features-message",icon:"information",open:!0,kind:"brand",scale:"s",width:"full"},v("div",{slot:"message"},this.messages?.noRelatedFeatures))}renderFeatureObserver(){return v("div",{key:"feature-observer",class:f.featureObserver,bind:this,afterCreate:this._relatedFeatureIntersectionObserverCreated})}renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return v("calcite-list",null,e.toArray().map((e=>this.renderRelatedFeature(e))),this.renderShowAllListItem())}renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return v("div",{key:"list-container",class:this.classes(f.listContainer,{[f.listContainerQuerying]:"querying"===t})},e?this.renderList():"ready"===t?this.renderNoRelatedFeaturesMessage():null,this.renderStickyLoading(),this.renderFeatureObserver())}renderRelationshipNotFound(){return v("calcite-notice",{key:"relationship-not-found",icon:"exclamation-mark-triangle",open:!0,kind:"danger",scale:"s",width:"full"},v("div",{slot:"message"},this.messages?.relationshipNotFound))}render(){const{state:e}=this.viewModel;return v("div",{class:this.classes(f.base,f.esriWidget)},this._featureElementInfo?.render(),"loading"===e?this.renderLoading():"disabled"===e?this.renderRelationshipNotFound():this.renderRelatedFeatures())}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach((e=>{this.addHandles(r((()=>[e.title,e.state]),(()=>this.scheduleRender()),i),t)})),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,s=t.description&&this.description,r=t.title&&this.title;this._featureElementInfo?.set({description:s,title:r,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await s(0),this._relatedFeatureIntersectionObserverNode&&"ready"===e&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};e([n()],F.prototype,"_relatedFeatureIntersectionObserverNode",void 0),e([n({readOnly:!0})],F.prototype,"displayShowAllButton",null),e([n({readOnly:!0})],F.prototype,"displayListItems",null),e([n()],F.prototype,"description",null),e([n({readOnly:!0})],F.prototype,"featureCountDescription",null),e([n()],F.prototype,"headingLevel",void 0),e([n()],F.prototype,"title",null),e([n({type:c})],F.prototype,"viewModel",void 0),e([n(),m("esri/widgets/Feature/t9n/Feature")],F.prototype,"messages",void 0),e([n(),m("esri/t9n/common")],F.prototype,"messagesCommon",void 0),e([n()],F.prototype,"visibleElements",void 0),e([a("visibleElements")],F.prototype,"castVisibleElements",null),F=e([l("esri.widgets.Feature.FeatureRelationship")],F);const _=F;export{_ as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
+ */
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/Error.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Popup/PopupViewModel.js";let e=class extends o{};e=r([s("esri.widgets.Features.FeaturesViewModel")],e);const t=e;export{t as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
+ */
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Accessor.js";import i from"../core/Collection.js";import{eventKey as o}from"../core/events.js";import s from"../core/Logger.js";import{watch as r}from"../core/reactiveUtils.js";import{throttle as n}from"../core/throttle.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import c from"./Feature.js";import d from"./Spinner.js";import u from"./Widget.js";import{CSS as h}from"./Feature/resources.js";import{FeatureContentMixin as p}from"./Feature/support/FeatureContentMixin.js";import m from"./Features/FeaturesViewModel.js";import{getPointFromGeometry as v}from"./Popup/actionUtils.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{vmEvent as g}from"./support/decorators/vmEvent.js";import{tsx as f}from"./support/jsxFactory.js";import{substitute as F}from"../intl/substitute.js";class M extends t{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.featureNavigation=!0,this.heading=!0,this.spinner=!0}}e([l()],M.prototype,"actionBar",void 0),e([l()],M.prototype,"closeButton",void 0),e([l()],M.prototype,"featureNavigation",void 0),e([l()],M.prototype,"heading",void 0),e([l()],M.prototype,"spinner",void 0);const b="esri-features",y={calciteModeLight:"calcite-mode-light",calciteModeDark:"calcite-mode-dark",esriWidget:"esri-widget",esriWidgetPanel:"esri-widget--panel",base:`${b}`,container:`${b}__container`,actionBar:`${b}__action-bar`,footerActions:`${b}__footer-actions`,featureMenuObserver:`${b}__feature-menu-observer`,actionExit:`${b}__action--exit`},I="selected-index",R=0,x="features-spinner";let C=class extends(p(u)){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&null!=this.viewModel.featurePage&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._focusFeatureMenuFlowItem=!1,this._spinner=null,this._feature=null,this._relatedRecordsFlowItems=new i,this._focusRootFlowItem=!1,this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._exitRelatedRecordsActions=new WeakMap,this._featureSelectionActions=new WeakMap,this.icon=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.viewModel=new m,this.visibleElements=new M,this._renderAction=(e,t)=>{const i=this._getActionTitle(e);return f("calcite-action",{appearance:"solid",bind:this,icon:this._getActionIcon(e),onclick:this._triggerAction,"data-action-uid":e.uid,disabled:e.disabled,indicator:e.indicator,loading:e.active,active:"toggle"===e.type&&e.value,key:`action-${t}`,text:i},f("calcite-tooltip",{placement:"bottom",overlayPositioning:"fixed",label:i,slot:"tooltip"},i))},this._openFeatureMenu=()=>{this.featureMenuOpen=!0},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this._focusRootFlowItem=!0,this.featureMenuOpen=!1,this.viewModel.browseClusterEnabled=!1},this._handleOpenRelatedFeature=e=>{this._openRelatedFeature(e)},this._displaySpinnerThrottled=n((()=>this._displaySpinner()),R),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,r((()=>this.viewModel?.active),(()=>this._toggleScreenLocationEnabled())),r((()=>this.visibleElements?.spinner),(e=>this._spinnerEnabledChange(e))),r((()=>this.viewModel?.view),((e,t)=>this._viewChange(e,t))),r((()=>this.viewModel?.view?.ready),((e,t)=>this._viewReadyChange(e??!1,t??!1))),r((()=>[this.viewModel?.waitingForResult,this.viewModel?.location]),(()=>{this._hideSpinner(),this._displaySpinnerThrottled()})),r((()=>this.selectedFeatureWidget),(()=>this._destroyRelatedRecordsFlowItemWidgets())),r((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.title,e?.state]}),(()=>this._setTitleFromFeatureWidget())),r((()=>{const e=this.selectedFeatureWidget?.viewModel;return[e?.content,e?.state]}),(()=>this._setContentFromFeatureWidget())),r((()=>this.viewModel?.featureViewModels),(()=>this._featureMenuViewportScrollTop()))])}loadDependencies(){return w({action:()=>import("@esri/calcite-components/dist/components/calcite-action.js"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar.js"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group.js"),button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow.js"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip.js")})}destroy(){this._destroyRelatedRecordsFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect()}get _hasContent(){const{selectedFeatureWidget:e,viewModel:t}=this;if(!e)return!!t?.content;const i=e.viewModel;if(i?.waitingForContent||"error"===i?.state)return!0;const o=i?.content;return Array.isArray(o)?!!o.length:!!o}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _activeFlowItemWidget(){return this._relatedRecordsFlowItems.at(-1)??null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_relatedRecordsFlowItems:i}=this,{selectedFeatureViewModel:o}=this.viewModel,s={title:!1};return o?(e?(e.viewModel=o,e.visibleElements=s):this._feature=new c({flowItems:i,headingLevel:t+1,viewModel:o,visibleElements:s}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e||s.getLogger(this.declaredClass).warn("Features can only be blurred when currently active."),this._rootFlowItemNode?.blur()}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{container:e}=this,{active:t}=this.viewModel;if(t||s.getLogger(this.declaredClass).warn("Features can only be blurred when currently active."),!e)return;const i=e.querySelectorAll("calcite-flow-item"),o=i[i?.length-1];this.scheduleRender(),requestAnimationFrame((()=>o?.setFocus()))}next(){return this.viewModel.next()}open(e){this.removeHandles(I),this.viewModel.open(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return f("div",{class:this.classes(y.base,y.esriWidget,y.esriWidgetPanel)},this._renderContentContainer())}_renderFooter(){return this._featureNavigationVisible?f("div",{slot:"footer",class:y.footerActions,key:"footer-actions"},this._renderPagination(),this._renderFeatureMenuButton()):null}_renderFeatureMenuButton(){const{messages:e,messagesCommon:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:s}=this.viewModel;return f("calcite-action-group",{layout:"horizontal"},s>0?f("calcite-action",{appearance:"solid",key:"feature-menu-loading-action",loading:!0,scale:"s",text:t.loading||"",label:t.loading||""}):f("calcite-action",{appearance:"solid",key:"feature-menu-button",bind:this,scale:"s",textEnabled:!0,label:e.selectFeature||"",text:F(e.pageText||"",{total:i,index:(o+1).toLocaleString(void 0,{minimumIntegerDigits:i.toString().length,useGrouping:!1})}),onclick:this._openFeatureMenu,icon:"list"},f("calcite-tooltip",{overlayPositioning:"fixed",label:e.selectFeature,placement:"bottom",slot:"tooltip"},e.selectFeature)))}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return f("calcite-action-group",{layout:"horizontal"},f("calcite-action",{appearance:"solid",label:e,text:e,iconFlipRtl:!0,icon:"chevron-left",scale:"s",onclick:this._previousFeature},f("calcite-tooltip",{placement:"bottom",overlayPositioning:"fixed",label:e,slot:"tooltip"},e)),f("calcite-action",{appearance:"solid",label:t,text:t,iconFlipRtl:!0,icon:"chevron-right",scale:"s",onclick:this._nextFeature},f("calcite-tooltip",{placement:"bottom",overlayPositioning:"fixed",label:t,slot:"tooltip"},t)))}_renderFeatureMenuItem(e,t){const{selectedFeatureViewModel:i}=this.viewModel,o=e===i;return f("calcite-list-item",{bind:this,key:`feature-menu-item-${e.uid}`,selected:o,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature,"data-feature-index":t,onCalciteListItemSelect:this._selectFeature,label:e.title||this.messagesCommon.untitled})}_renderFeatureMenu(){const{featureViewModels:e}=this.viewModel;return e.length>1?f("calcite-list",{selectionMode:"single",selectionAppearance:"icon"},e.filter((e=>!!e.graphic)).map(((e,t)=>this._renderFeatureMenuItem(e,t)))):null}_renderContentFeature(){const{headingLevel:e,visibleElements:t}=this,{title:i,active:o}=this.viewModel,s=t.heading&&i?i:"";return f("calcite-flow-item",{bind:this,closed:!o,closable:t.closeButton,heading:s,headingLevel:e,afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,key:"root-flow-item",onkeydown:this._onMainKeydown},this._renderActionBar(),f("div",{class:y.container},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,messages:i,messagesCommon:o}=this,{active:s,featureViewModels:r}=e;return t?f("calcite-flow-item",{bind:this,closed:!s,afterCreate:this._focusFeatureMenuFlowItemNode,afterUpdate:this._focusFeatureMenuFlowItemNode,loading:e.isLoadingFeature,heading:i.selectFeature,description:F(i.total,{total:r.length}),key:"feature-menu",onCalciteFlowItemBack:this._handleFeatureMenuBack},f("div",{class:y.container},this._renderFeatureMenu()),f("div",{class:y.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),f("calcite-button",{onclick:this._handleFeatureMenuBack,slot:"footer-actions",appearance:"transparent",width:"full"},o.back)):null}_renderContentContainer(){const{_hasContent:e,_relatedRecordsFlowItems:t}=this,{content:i}=this.viewModel,o=t.toArray();return e?f("calcite-flow",{key:i??"content"},this._renderContentFeature(),this._renderFeatureMenuContainer(),o.map((e=>this._renderRelatedRecordsFlowItem(e))),f("div",{key:"content-tooltips"},o.map((e=>this._renderRelatedRecordsFlowItemTooltips(e))))):null}_renderActionBar(){return this.visibleElements.actionBar&&this.viewModel.allActions?.length?f("calcite-action-bar",{key:"header-action-bar",class:y.actionBar,layout:"horizontal",expandDisabled:!0},f("calcite-action-group",{layout:"horizontal"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?"string"==typeof e?f("div",{class:h.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}_renderRelatedRecordsFlowItem(e){const{messages:t}=this,{visibleElements:i}=this,{active:o}=this.viewModel,s="graphic"in e&&!e.isTable;return f("calcite-flow-item",{bind:this,closed:!o,closable:i.closeButton,heading:e.title??"",description:this._getRelatedRecordsFlowItemDescription(e),onCalciteFlowItemBack:this._handleRelatedRecordsBackClick,key:`flow-item-${e.viewModel.uid}`},f("calcite-action",{appearance:"transparent",class:y.actionExit,icon:"move-up",label:t.exitRelatedRecords,text:t.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:t=>this._storeExitRelatedRecordsAction(e,t),onclick:this._destroyRelatedRecordsFlowItemWidgets}),s?f("calcite-action",{appearance:"transparent",icon:"zoom-to-object",label:t.selectFeature,text:t.selectFeature,slot:"header-actions-end",bind:this,afterCreate:t=>this._storeFeatureSelectionAction(e,t),onclick:()=>this._handleOpenRelatedFeature(e)}):null,f("div",{class:y.container},e.render()))}_renderRelatedRecordsFlowItemTooltips(e){const{messages:t,_exitRelatedRecordsActions:i,_featureSelectionActions:o}=this,s=o.get(e);return[f("calcite-tooltip",{key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:t.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:i.get(e),placement:"top"},t.exitRelatedRecords),s?f("calcite-tooltip",{key:`select-related-record-tooltip-${e.viewModel.uid}`,label:t.selectFeature,overlayPositioning:"fixed",referenceElement:s,placement:"top"},t.selectFeature):null]}_focusRootFlowItemNode(e){this._rootFlowItemNode=e,this._focusRootFlowItem&&(this._focusRootFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_focusFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e,this._focusFeatureMenuFlowItem&&(this._focusFeatureMenuFlowItem=!1,requestAnimationFrame((()=>e?.setFocus())))}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuFlowItem=!0}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon||"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:s}=e,r=i?.attributes,n=e.title??"",l="zoom-to-feature"===s?F(n,{messages:t}):"remove-selected-feature"===s?F(n,{messages:o}):"zoom-to-clustered-features"===s||"browse-clustered-features"===s?F(n,{messages:t}):e.title;return l&&r?F(l,r):l??""}_onMainKeydown(e){const t=o(e);"ArrowLeft"===t&&(e.stopPropagation(),this.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.next())}_storeFeatureSelectionAction(e,t){this._featureSelectionActions.set(e,t),this.scheduleRender()}_storeExitRelatedRecordsAction(e,t){this._exitRelatedRecordsActions.set(e,t),this.scheduleRender()}_getRelatedRecordsFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}_handleRelatedRecordsBackClick(){const e=this._relatedRecordsFlowItems.pop();e&&(this._exitRelatedRecordsActions.delete(e),this._featureSelectionActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(null==i||null==t)return;this._destroyRelatedRecordsFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=v(i);this.open({features:[t],location:null!=o?o:void 0})}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title="error"===i?.state?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=r((()=>this.viewModel?.selectedFeatureIndex),((e,t)=>this._selectedFeatureIndexUpdated(e,t)));this.addHandles(e,I)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&-1!==e&&(this._destroyRelatedRecordsFlowItemWidgets(),this.featureMenuOpen=!1,this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,s=o.findIndex((e=>e.uid===i)),r=o.getItemAt(s);r&&"toggle"===r.type&&(r.value=!r.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new d({view:e}),e.ui.add(this._spinner,{key:x,position:"manual"}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_destroyRelatedRecordsFlowItemWidgets(){this._relatedRecordsFlowItems.removeAll().forEach((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}))}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,x),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};e([l()],C.prototype,"_focusFeatureMenuFlowItem",void 0),e([l()],C.prototype,"_relatedRecordsFlowItems",void 0),e([l()],C.prototype,"_focusRootFlowItem",void 0),e([l()],C.prototype,"_hasContent",null),e([l()],C.prototype,"_featureNavigationVisible",null),e([l()],C.prototype,"_activeFlowItemWidget",null),e([l()],C.prototype,"icon",void 0),e([l()],C.prototype,"featureMenuOpen",null),e([l()],C.prototype,"features",null),e([l()],C.prototype,"headingLevel",void 0),e([l()],C.prototype,"location",null),e([l()],C.prototype,"label",null),e([l(),_("esri/widgets/Features/t9n/Features")],C.prototype,"messages",void 0),e([l(),_("esri/t9n/common")],C.prototype,"messagesCommon",void 0),e([l()],C.prototype,"promises",null),e([l({readOnly:!0})],C.prototype,"selectedFeature",null),e([l()],C.prototype,"selectedFeatureIndex",null),e([l({readOnly:!0})],C.prototype,"selectedFeatureWidget",null),e([l()],C.prototype,"title",null),e([l()],C.prototype,"updateLocationEnabled",null),e([l()],C.prototype,"view",null),e([l({type:m}),g(["triggerAction","trigger-action"])],C.prototype,"viewModel",void 0),e([l({type:M})],C.prototype,"visibleElements",void 0),e([l()],C.prototype,"visible",null),C=e([a("esri.widgets.Features")],C);const A=C;export{A as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import t from"../../core/Logger.js";import{throwIfNotAbortError as r}from"../../core/promiseUtils.js";import{zoomToFeature as n,zoomToClusteredFeatures as o,browseClusteredFeatures as i,removeSelectedFeature as a}from"./actions.js";const c="esri.widgets.Popup.PopupViewModel",s=t.getLogger(c),u=t=>{const{event:c,view:s,viewModel:u}=t,{action:l}=c;if(!l)return Promise.reject(new e("trigger-action:missing-arguments","Event has no action"));const{disabled:d,id:g}=l;if(!g)return Promise.reject(new e("trigger-action:invalid-action","action.id is missing"));if(d)return Promise.reject(new e("trigger-action:invalid-action","Action is disabled"));if(g===n.id)return w(u).catch(r);if(g===o.id)return f(u);if(g===i.id)return u.featureMenuOpen=!u.featureMenuOpen,u.browseClusterEnabled=!u.browseClusterEnabled,Promise.resolve();if(u.browseClusterEnabled=!1,g===a.id){u.visible=!1;const{selectedFeature:t}=u;if(!t)return Promise.reject(new e(`trigger-action:${a.id}`,"selectedFeature is required",{selectedFeature:t}));const{sourceLayer:r}=t;return r?r.remove(t):s?.graphics.remove(t),Promise.resolve()}return Promise.resolve()};function l(e){const{selectedFeature:t,location:r,view:n}=e;if(!n)return null;if("3d"===n.type)return t??r??null;return e.get("selectedFeature.geometry")||r}function d(e){return!!e&&e.isAggregate&&"cluster"===e.sourceLayer?.featureReduction?.type}async function g(e,t){if("3d"!==t?.type||!e||"esri.Graphic"!==e.declaredClass)return!0;const r=t.getViewForGraphic(e);if(r&&"whenGraphicBounds"in r){let t;try{t=await r.whenGraphicBounds(e,{useViewElevation:!0})}catch(n){}return!t||!t.boundingBox||t.boundingBox[0]===t.boundingBox[3]&&t.boundingBox[1]===t.boundingBox[4]&&t.boundingBox[2]===t.boundingBox[5]}return!0}async function w(t){const{location:r,selectedFeature:o,view:i,zoomFactor:a}=t,c=l(t);if(!i||!c){const t=new e("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:c,view:i});throw s.error(t),t}const u=i.scale/a,d=t.selectedFeature?.geometry,w=d??r,f=null!=w&&"point"===w.type&&await g(o,i);n.active=!0,n.disabled=!0;try{await t.zoomTo({target:{target:c,scale:f?u:void 0}})}catch(m){const t=new e("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:o});s.error(t)}finally{n.active=!1,n.disabled=!1,t.zoomToLocation=null,f&&(t.location=w)}}async function f(t){const{selectedFeature:r,view:n}=t;if("2d"!==n?.type){const t=new e("zoomToCluster:invalid-view","View must be 2d MapView.",{view:n});throw s.error(t),t}if(!r||!d(r)){const t=new e("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:r});throw s.error(t),t}const[i,a]=await v(n,r);o.active=!0,o.disabled=!0;const{extent:c}=await i.queryExtent(a);await t.zoomTo({target:c}),o.active=!1,o.disabled=!1}async function m(e){const{view:t,selectedFeature:r}=e;if(!t||!r)return;const[n,o]=await v(t,r),{extent:i}=await n.queryExtent(o);e.selectedClusterBoundaryFeature.geometry=i,t.graphics.add(e.selectedClusterBoundaryFeature)}async function p(e){const{selectedFeature:t,view:r}=e;if(!r||!t)return;const[n,o]=await v(r,t);i.active=!0,i.disabled=!0;const{features:a}=await n.queryFeatures(o);i.active=!1,i.disabled=!1,e?.open({features:[t].concat(a),featureMenuOpen:!0})}async function v(e,t){const r=await e.whenLayerView(t.sourceLayer),n=r.createQuery(),o=t.getObjectId();return n.aggregateIds=null!=o?[o]:[],[r,n]}function y(e){const t=e.features.filter((e=>d(e)));t.length&&(e.features=t)}function h(e){if(null==e)return null;switch(e.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"multipoint":case"polyline":return e.extent?.center;default:return null}}export{p as browseAggregateFeatures,m as displayClusterExtent,h as getPointFromGeometry,l as getSelectedTarget,d as isClusterFeature,y as removeClusteredFeaturesForBrowsing,u as triggerAction,f as zoomToClusterExtent,w as zoomToLocation};
5
+ import e from"../../core/Error.js";import t from"../../core/Logger.js";import{throwIfNotAbortError as r}from"../../core/promiseUtils.js";import{zoomToFeature as n,zoomToClusteredFeatures as o,browseClusteredFeatures as i,removeSelectedFeature as a}from"./actions.js";const c="esri.widgets.Popup.PopupViewModel",s=t.getLogger(c),u=t=>{const{event:c,view:s,viewModel:u}=t,{action:l}=c;if(!l)return Promise.reject(new e("trigger-action:missing-arguments","Event has no action"));const{disabled:d,id:g}=l;if(!g)return Promise.reject(new e("trigger-action:invalid-action","action.id is missing"));if(d)return Promise.reject(new e("trigger-action:invalid-action","Action is disabled"));if(g===n.id)return w(u).catch(r);if(g===o.id)return f(u);if(g===i.id)return u.browseClusterEnabled=!u.browseClusterEnabled,u.featureMenuOpen=u.browseClusterEnabled,Promise.resolve();if(g===a.id){u.visible=!1;const{selectedFeature:t}=u;if(!t)return Promise.reject(new e(`trigger-action:${a.id}`,"selectedFeature is required",{selectedFeature:t}));const{sourceLayer:r}=t;return r?r.remove(t):s?.graphics.remove(t),Promise.resolve()}return Promise.resolve()};function l(e){const{selectedFeature:t,location:r,view:n}=e;if(!n)return null;if("3d"===n.type)return t??r??null;return e.get("selectedFeature.geometry")||r}function d(e){return!!e&&e.isAggregate&&"cluster"===e.sourceLayer?.featureReduction?.type}async function g(e,t){if("3d"!==t?.type||!e||"esri.Graphic"!==e.declaredClass)return!0;const r=t.getViewForGraphic(e);if(r&&"whenGraphicBounds"in r){let t;try{t=await r.whenGraphicBounds(e,{useViewElevation:!0})}catch(n){}return!t||!t.boundingBox||t.boundingBox[0]===t.boundingBox[3]&&t.boundingBox[1]===t.boundingBox[4]&&t.boundingBox[2]===t.boundingBox[5]}return!0}async function w(t){const{location:r,selectedFeature:o,view:i,zoomFactor:a}=t,c=l(t);if(!i||!c){const t=new e("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:c,view:i});throw s.error(t),t}const u=i.scale/a,d=t.selectedFeature?.geometry,w=d??r,f=null!=w&&"point"===w.type&&await g(o,i);n.active=!0,n.disabled=!0;try{await t.zoomTo({target:{target:c,scale:f?u:void 0}})}catch(m){const t=new e("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:o});s.error(t)}finally{n.active=!1,n.disabled=!1,t.zoomToLocation=null,f&&(t.location=w)}}async function f(t){const{selectedFeature:r,view:n}=t;if("2d"!==n?.type){const t=new e("zoomToCluster:invalid-view","View must be 2d MapView.",{view:n});throw s.error(t),t}if(!r||!d(r)){const t=new e("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:r});throw s.error(t),t}const[i,a]=await v(n,r);o.active=!0,o.disabled=!0;const{extent:c}=await i.queryExtent(a);await t.zoomTo({target:c}),o.active=!1,o.disabled=!1}async function m(e){const{view:t,selectedFeature:r}=e;if(!t||!r)return;const[n,o]=await v(t,r),{extent:i}=await n.queryExtent(o);e.selectedClusterBoundaryFeature.geometry=i,t.graphics.add(e.selectedClusterBoundaryFeature)}async function p(e){const{selectedFeature:t,view:r}=e;if(!r||!t)return;const[n,o]=await v(r,t);i.active=!0,i.disabled=!0;const{features:a}=await n.queryFeatures(o);i.active=!1,i.disabled=!1,i.value=!0,e?.open({features:[t].concat(a),featureMenuOpen:!0})}async function v(e,t){const r=await e.whenLayerView(t.sourceLayer),n=r.createQuery(),o=t.getObjectId();return n.aggregateIds=null!=o?[o]:[],[r,n]}function y(e){i.value=!1;const t=e.features.filter((e=>d(e)));t.length&&(e.features=t)}function h(e){if(null==e)return null;switch(e.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"multipoint":case"polyline":return e.extent?.center;default:return null}}export{p as browseAggregateFeatures,m as displayClusterExtent,h as getPointFromGeometry,l as getSelectedTarget,d as isClusterFeature,y as removeClusteredFeaturesForBrowsing,u as triggerAction,f as zoomToClusterExtent,w as zoomToLocation};