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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (604) hide show
  1. package/AggregateGraphic.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{9f31ab2247c9defb882c.js → 01ac91fc0bc6b4d4e3c6.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{d26108352874af0b6762.js → 053564e659222e8f0efb.js} +1 -1
  5. package/assets/esri/core/workers/chunks/1c65fd714f637ac1ee8c.js +1 -0
  6. package/assets/esri/core/workers/chunks/{8588cbecb8e808f451fe.js → 249e32af1f2d433fae4c.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{5b16b30ac3166f33e81e.js → 26690f4ec1f3cb8099c2.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{be93b0cef85665446944.js → 274b4cdf6c8d77e8a2e6.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{52dcfd6b8b1dfa864e44.js → 2cae0ec5f60ab42a49aa.js} +1 -1
  10. package/assets/esri/core/workers/chunks/43e4560d65e5ddeeef6f.js +1 -0
  11. package/assets/esri/core/workers/chunks/{f436c86f86236ea7ea04.js → 4641e10e0e8e9d257521.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{7a45333de9ded92619c2.js → 466008f793c2e11e854c.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{c9d655675552dcf6cef7.js → 4a699b41072ee88f0956.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{14ea96e398f4842abe4e.js → 4fdd18f5cdaa0d82ebc1.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{9662da3e1e37f3445186.js → 562b9619b8ee13734813.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{5c1a5615c865c10209c2.js → 5880fa48bad79a7c93ab.js} +1 -1
  17. package/assets/esri/core/workers/chunks/58824250492b89ec24ea.js +1 -0
  18. package/assets/esri/core/workers/chunks/64a6b837f1d5d7ad7619.js +1 -0
  19. package/assets/esri/core/workers/chunks/{421241543afbc9a619ea.js → 64de93865088bbe0398f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{99d56a707039d645622c.js → 6a20d8740ec2a5b2c579.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{8bab21bc6164a593278f.js → 771b92e524802de840ba.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{dbb1bf97c85848bb8ce1.js → 7ce250cc6fbe68aef50d.js} +32 -32
  23. package/assets/esri/core/workers/chunks/{2c4938512dd726a177dd.js → 7fab18074b130b71a648.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{f67357b3c6c591c9da5e.js → 872f1cb3596fb80e387f.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{3ee81834b3217720cb48.js → 8874e69378a27d155f9d.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{31de71018575457155e5.js → 8ee3da8677255b8c8709.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{2e44aee22e70857b893c.js → 93631b10452b0e0189b3.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{cb2dc84d972469445da6.js → 95cd9edca50ea163d50f.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{d31bbb13af45ce8e45dc.js → acf9f753741b677afb44.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{1455944edeba1560eb07.js → afdafa77f5ca1b9e3acc.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{cf3e1ac63580bc495ea6.js → b4da35f1093f3731f9ac.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{09f4296dcb80e3ae4b3d.js → b8eba8c9d5424a7ae5f2.js} +1 -1
  33. package/assets/esri/core/workers/chunks/bb0d86937faf0cd7d16d.js +1 -0
  34. package/assets/esri/core/workers/chunks/bf3e80023e156d5906c7.js +1 -0
  35. package/assets/esri/core/workers/chunks/{8ba83fee56dd4f306d87.js → c2a6ac7046134f725cf3.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{5d3fabe66e1bce1b30fb.js → cc7569489b572b8b3b53.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{fddd4ea487788e003fb1.js → d09f06eb4157a7c2c8ab.js} +1 -1
  38. package/assets/esri/core/workers/chunks/d1be3ab7846e3a555b6c.js +1 -0
  39. package/assets/esri/core/workers/chunks/e064035f959d68e9603f.js +1 -0
  40. package/assets/esri/core/workers/chunks/{d92975e56a1290255252.js → e09df62cf35d636b0975.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{674fa5b93704ef08c9e8.js → e0c763e05feb1c2093ba.js} +1 -1
  42. package/assets/esri/core/workers/chunks/e20e99f8f76f5002437e.js +1 -0
  43. package/assets/esri/core/workers/chunks/{51289d2f5277af4023e9.js → ed33e019bc7775db2e50.js} +1 -1
  44. package/assets/esri/core/workers/chunks/ef95d6ab7b1c032ab4ad.js +1 -0
  45. package/assets/esri/core/workers/chunks/{48aa432e1bf60c68de14.js → f0c4b408a0b88adf6576.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{169f4354a375db5de121.js → ffcbcb928b6cb8c596ad.js} +1 -1
  47. package/assets/esri/t9n/common_ar.json +1 -1
  48. package/assets/esri/t9n/common_bg.json +1 -1
  49. package/assets/esri/t9n/common_bs.json +1 -1
  50. package/assets/esri/t9n/common_ca.json +1 -1
  51. package/assets/esri/t9n/common_cs.json +1 -1
  52. package/assets/esri/t9n/common_da.json +1 -1
  53. package/assets/esri/t9n/common_de.json +1 -1
  54. package/assets/esri/t9n/common_el.json +1 -1
  55. package/assets/esri/t9n/common_es.json +1 -1
  56. package/assets/esri/t9n/common_et.json +1 -1
  57. package/assets/esri/t9n/common_fi.json +1 -1
  58. package/assets/esri/t9n/common_fr.json +1 -1
  59. package/assets/esri/t9n/common_he.json +1 -1
  60. package/assets/esri/t9n/common_hr.json +1 -1
  61. package/assets/esri/t9n/common_hu.json +1 -1
  62. package/assets/esri/t9n/common_id.json +1 -1
  63. package/assets/esri/t9n/common_it.json +1 -1
  64. package/assets/esri/t9n/common_ja.json +1 -1
  65. package/assets/esri/t9n/common_ko.json +1 -1
  66. package/assets/esri/t9n/common_lt.json +1 -1
  67. package/assets/esri/t9n/common_lv.json +1 -1
  68. package/assets/esri/t9n/common_nb.json +1 -1
  69. package/assets/esri/t9n/common_nl.json +1 -1
  70. package/assets/esri/t9n/common_pl.json +1 -1
  71. package/assets/esri/t9n/common_pt-BR.json +1 -1
  72. package/assets/esri/t9n/common_pt-PT.json +1 -1
  73. package/assets/esri/t9n/common_ro.json +1 -1
  74. package/assets/esri/t9n/common_ru.json +1 -1
  75. package/assets/esri/t9n/common_sk.json +1 -1
  76. package/assets/esri/t9n/common_sl.json +1 -1
  77. package/assets/esri/t9n/common_sr.json +1 -1
  78. package/assets/esri/t9n/common_sv.json +1 -1
  79. package/assets/esri/t9n/common_th.json +1 -1
  80. package/assets/esri/t9n/common_tr.json +1 -1
  81. package/assets/esri/t9n/common_uk.json +1 -1
  82. package/assets/esri/t9n/common_vi.json +1 -1
  83. package/assets/esri/t9n/common_zh-CN.json +1 -1
  84. package/assets/esri/t9n/common_zh-HK.json +1 -1
  85. package/assets/esri/t9n/common_zh-TW.json +1 -1
  86. package/assets/esri/themes/base/widgets/_Daylight.scss +1 -0
  87. package/assets/esri/themes/base/widgets/_Directions.scss +1 -2
  88. package/assets/esri/themes/dark/main.css +1 -1
  89. package/assets/esri/themes/light/main.css +1 -1
  90. package/assets/esri/themes/light/view.css +1 -1
  91. package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
  92. package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
  93. package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
  94. package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
  95. package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
  96. package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
  97. package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
  98. package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
  99. package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
  100. package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
  101. package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
  102. package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
  103. package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
  104. package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
  105. package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
  106. package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
  107. package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
  108. package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
  109. package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
  110. package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
  111. package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
  112. package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
  113. package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
  114. package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
  115. package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
  116. package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
  117. package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
  118. package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
  119. package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
  120. package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
  121. package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
  122. package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
  123. package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
  124. package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
  125. package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
  126. package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
  127. package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
  128. package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
  129. package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
  130. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  131. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  132. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  133. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  134. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  135. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  136. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  137. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  138. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  139. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  140. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  141. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  142. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  143. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  144. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  145. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  146. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  147. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  148. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  149. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  150. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  151. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nb.json +1 -1
  152. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  153. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  154. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  155. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  156. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  157. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  158. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  159. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  160. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  161. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  162. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  163. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  164. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  165. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  166. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  167. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  168. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  169. package/assets/esri/widgets/Popup/t9n/Popup_ar.json +1 -1
  170. package/assets/esri/widgets/Popup/t9n/Popup_bg.json +1 -1
  171. package/assets/esri/widgets/Popup/t9n/Popup_bs.json +1 -1
  172. package/assets/esri/widgets/Popup/t9n/Popup_ca.json +1 -1
  173. package/assets/esri/widgets/Popup/t9n/Popup_cs.json +1 -1
  174. package/assets/esri/widgets/Popup/t9n/Popup_da.json +1 -1
  175. package/assets/esri/widgets/Popup/t9n/Popup_de.json +1 -1
  176. package/assets/esri/widgets/Popup/t9n/Popup_el.json +1 -1
  177. package/assets/esri/widgets/Popup/t9n/Popup_es.json +1 -1
  178. package/assets/esri/widgets/Popup/t9n/Popup_et.json +1 -1
  179. package/assets/esri/widgets/Popup/t9n/Popup_fi.json +1 -1
  180. package/assets/esri/widgets/Popup/t9n/Popup_fr.json +1 -1
  181. package/assets/esri/widgets/Popup/t9n/Popup_he.json +1 -1
  182. package/assets/esri/widgets/Popup/t9n/Popup_hr.json +1 -1
  183. package/assets/esri/widgets/Popup/t9n/Popup_hu.json +1 -1
  184. package/assets/esri/widgets/Popup/t9n/Popup_id.json +1 -1
  185. package/assets/esri/widgets/Popup/t9n/Popup_it.json +1 -1
  186. package/assets/esri/widgets/Popup/t9n/Popup_ja.json +1 -1
  187. package/assets/esri/widgets/Popup/t9n/Popup_ko.json +1 -1
  188. package/assets/esri/widgets/Popup/t9n/Popup_lt.json +1 -1
  189. package/assets/esri/widgets/Popup/t9n/Popup_lv.json +1 -1
  190. package/assets/esri/widgets/Popup/t9n/Popup_nb.json +1 -1
  191. package/assets/esri/widgets/Popup/t9n/Popup_nl.json +1 -1
  192. package/assets/esri/widgets/Popup/t9n/Popup_pl.json +1 -1
  193. package/assets/esri/widgets/Popup/t9n/Popup_pt-BR.json +1 -1
  194. package/assets/esri/widgets/Popup/t9n/Popup_pt-PT.json +1 -1
  195. package/assets/esri/widgets/Popup/t9n/Popup_ro.json +1 -1
  196. package/assets/esri/widgets/Popup/t9n/Popup_ru.json +1 -1
  197. package/assets/esri/widgets/Popup/t9n/Popup_sk.json +1 -1
  198. package/assets/esri/widgets/Popup/t9n/Popup_sl.json +1 -1
  199. package/assets/esri/widgets/Popup/t9n/Popup_sr.json +1 -1
  200. package/assets/esri/widgets/Popup/t9n/Popup_sv.json +1 -1
  201. package/assets/esri/widgets/Popup/t9n/Popup_th.json +1 -1
  202. package/assets/esri/widgets/Popup/t9n/Popup_tr.json +1 -1
  203. package/assets/esri/widgets/Popup/t9n/Popup_uk.json +1 -1
  204. package/assets/esri/widgets/Popup/t9n/Popup_vi.json +1 -1
  205. package/assets/esri/widgets/Popup/t9n/Popup_zh-CN.json +1 -1
  206. package/assets/esri/widgets/Popup/t9n/Popup_zh-HK.json +1 -1
  207. package/assets/esri/widgets/Popup/t9n/Popup_zh-TW.json +1 -1
  208. package/assets/esri/widgets/support/t9n/DatePicker_ar.json +1 -1
  209. package/assets/esri/widgets/support/t9n/DatePicker_bg.json +1 -1
  210. package/assets/esri/widgets/support/t9n/DatePicker_bs.json +1 -1
  211. package/assets/esri/widgets/support/t9n/DatePicker_ca.json +1 -1
  212. package/assets/esri/widgets/support/t9n/DatePicker_cs.json +1 -1
  213. package/assets/esri/widgets/support/t9n/DatePicker_da.json +1 -1
  214. package/assets/esri/widgets/support/t9n/DatePicker_de.json +1 -1
  215. package/assets/esri/widgets/support/t9n/DatePicker_el.json +1 -1
  216. package/assets/esri/widgets/support/t9n/DatePicker_es.json +1 -1
  217. package/assets/esri/widgets/support/t9n/DatePicker_et.json +1 -1
  218. package/assets/esri/widgets/support/t9n/DatePicker_fi.json +1 -1
  219. package/assets/esri/widgets/support/t9n/DatePicker_fr.json +1 -1
  220. package/assets/esri/widgets/support/t9n/DatePicker_he.json +1 -1
  221. package/assets/esri/widgets/support/t9n/DatePicker_hr.json +1 -1
  222. package/assets/esri/widgets/support/t9n/DatePicker_hu.json +1 -1
  223. package/assets/esri/widgets/support/t9n/DatePicker_id.json +1 -1
  224. package/assets/esri/widgets/support/t9n/DatePicker_it.json +1 -1
  225. package/assets/esri/widgets/support/t9n/DatePicker_ja.json +1 -1
  226. package/assets/esri/widgets/support/t9n/DatePicker_ko.json +1 -1
  227. package/assets/esri/widgets/support/t9n/DatePicker_lt.json +1 -1
  228. package/assets/esri/widgets/support/t9n/DatePicker_lv.json +1 -1
  229. package/assets/esri/widgets/support/t9n/DatePicker_nb.json +1 -1
  230. package/assets/esri/widgets/support/t9n/DatePicker_nl.json +1 -1
  231. package/assets/esri/widgets/support/t9n/DatePicker_pl.json +1 -1
  232. package/assets/esri/widgets/support/t9n/DatePicker_pt-BR.json +1 -1
  233. package/assets/esri/widgets/support/t9n/DatePicker_pt-PT.json +1 -1
  234. package/assets/esri/widgets/support/t9n/DatePicker_ro.json +1 -1
  235. package/assets/esri/widgets/support/t9n/DatePicker_ru.json +1 -1
  236. package/assets/esri/widgets/support/t9n/DatePicker_sk.json +1 -1
  237. package/assets/esri/widgets/support/t9n/DatePicker_sl.json +1 -1
  238. package/assets/esri/widgets/support/t9n/DatePicker_sr.json +1 -1
  239. package/assets/esri/widgets/support/t9n/DatePicker_sv.json +1 -1
  240. package/assets/esri/widgets/support/t9n/DatePicker_th.json +1 -1
  241. package/assets/esri/widgets/support/t9n/DatePicker_tr.json +1 -1
  242. package/assets/esri/widgets/support/t9n/DatePicker_uk.json +1 -1
  243. package/assets/esri/widgets/support/t9n/DatePicker_vi.json +1 -1
  244. package/assets/esri/widgets/support/t9n/DatePicker_zh-CN.json +1 -1
  245. package/assets/esri/widgets/support/t9n/DatePicker_zh-HK.json +1 -1
  246. package/assets/esri/widgets/support/t9n/DatePicker_zh-TW.json +1 -1
  247. package/assets/esri/widgets/support/t9n/TimePicker_ar.json +1 -1
  248. package/assets/esri/widgets/support/t9n/TimePicker_bg.json +1 -1
  249. package/assets/esri/widgets/support/t9n/TimePicker_bs.json +1 -1
  250. package/assets/esri/widgets/support/t9n/TimePicker_ca.json +1 -1
  251. package/assets/esri/widgets/support/t9n/TimePicker_cs.json +1 -1
  252. package/assets/esri/widgets/support/t9n/TimePicker_da.json +1 -1
  253. package/assets/esri/widgets/support/t9n/TimePicker_de.json +1 -1
  254. package/assets/esri/widgets/support/t9n/TimePicker_el.json +1 -1
  255. package/assets/esri/widgets/support/t9n/TimePicker_es.json +1 -1
  256. package/assets/esri/widgets/support/t9n/TimePicker_et.json +1 -1
  257. package/assets/esri/widgets/support/t9n/TimePicker_fi.json +1 -1
  258. package/assets/esri/widgets/support/t9n/TimePicker_fr.json +1 -1
  259. package/assets/esri/widgets/support/t9n/TimePicker_he.json +1 -1
  260. package/assets/esri/widgets/support/t9n/TimePicker_hr.json +1 -1
  261. package/assets/esri/widgets/support/t9n/TimePicker_hu.json +1 -1
  262. package/assets/esri/widgets/support/t9n/TimePicker_id.json +1 -1
  263. package/assets/esri/widgets/support/t9n/TimePicker_it.json +1 -1
  264. package/assets/esri/widgets/support/t9n/TimePicker_ja.json +1 -1
  265. package/assets/esri/widgets/support/t9n/TimePicker_ko.json +1 -1
  266. package/assets/esri/widgets/support/t9n/TimePicker_lt.json +1 -1
  267. package/assets/esri/widgets/support/t9n/TimePicker_lv.json +1 -1
  268. package/assets/esri/widgets/support/t9n/TimePicker_nb.json +1 -1
  269. package/assets/esri/widgets/support/t9n/TimePicker_nl.json +1 -1
  270. package/assets/esri/widgets/support/t9n/TimePicker_pl.json +1 -1
  271. package/assets/esri/widgets/support/t9n/TimePicker_pt-BR.json +1 -1
  272. package/assets/esri/widgets/support/t9n/TimePicker_pt-PT.json +1 -1
  273. package/assets/esri/widgets/support/t9n/TimePicker_ro.json +1 -1
  274. package/assets/esri/widgets/support/t9n/TimePicker_ru.json +1 -1
  275. package/assets/esri/widgets/support/t9n/TimePicker_sk.json +1 -1
  276. package/assets/esri/widgets/support/t9n/TimePicker_sl.json +1 -1
  277. package/assets/esri/widgets/support/t9n/TimePicker_sr.json +1 -1
  278. package/assets/esri/widgets/support/t9n/TimePicker_sv.json +1 -1
  279. package/assets/esri/widgets/support/t9n/TimePicker_th.json +1 -1
  280. package/assets/esri/widgets/support/t9n/TimePicker_tr.json +1 -1
  281. package/assets/esri/widgets/support/t9n/TimePicker_uk.json +1 -1
  282. package/assets/esri/widgets/support/t9n/TimePicker_vi.json +1 -1
  283. package/assets/esri/widgets/support/t9n/TimePicker_zh-CN.json +1 -1
  284. package/assets/esri/widgets/support/t9n/TimePicker_zh-HK.json +1 -1
  285. package/assets/esri/widgets/support/t9n/TimePicker_zh-TW.json +1 -1
  286. package/chunks/CheckerBoard.glsl.js +3 -3
  287. package/chunks/ColorMaterial.glsl.js +5 -5
  288. package/chunks/ComponentShader.glsl.js +1 -1
  289. package/chunks/Compositing.glsl.js +4 -19
  290. package/chunks/DefaultMaterial.glsl.js +2 -2
  291. package/chunks/HUDCompositing.glsl.js +7 -0
  292. package/chunks/HeatmapDensity.glsl.js +4 -4
  293. package/chunks/ImageMaterial.glsl.js +1 -1
  294. package/chunks/Laserlines.glsl.js +5 -5
  295. package/chunks/LineMarker.glsl.js +1 -1
  296. package/chunks/MeasurementArrow.glsl.js +3 -3
  297. package/chunks/NativeLine.glsl.js +1 -1
  298. package/chunks/OITCompositing.glsl.js +13 -0
  299. package/chunks/OverlayCompositing.glsl.js +8 -0
  300. package/chunks/Path.glsl.js +3 -3
  301. package/chunks/Pattern.glsl.js +1 -1
  302. package/chunks/Precipitation.glsl.js +3 -3
  303. package/chunks/RealisticTree.glsl.js +2 -2
  304. package/chunks/RibbonLine.glsl.js +25 -25
  305. package/chunks/ShadedColorMaterial.glsl.js +1 -1
  306. package/chunks/ShadowHighlight.glsl.js +1 -1
  307. package/chunks/SlicePlaneMaterial.glsl.js +2 -2
  308. package/chunks/Terrain.glsl.js +4 -4
  309. package/chunks/WaterSurface.glsl.js +1 -1
  310. package/chunks/ar.js +1 -1
  311. package/chunks/bg_BG.js +1 -1
  312. package/chunks/boundedPlane.js +1 -1
  313. package/chunks/bs_BA.js +1 -1
  314. package/chunks/ca_ES.js +1 -1
  315. package/chunks/cameraUtilsPlanar.js +1 -1
  316. package/chunks/cameraUtilsSpherical.js +1 -1
  317. package/chunks/cs_CZ.js +1 -1
  318. package/chunks/da_DK.js +1 -1
  319. package/chunks/de_CH.js +1 -1
  320. package/chunks/de_DE.js +1 -1
  321. package/chunks/el_GR.js +1 -1
  322. package/chunks/en_CA.js +1 -1
  323. package/chunks/en_US.js +1 -1
  324. package/chunks/es_ES.js +1 -1
  325. package/chunks/et_EE.js +1 -1
  326. package/chunks/fi_FI.js +1 -1
  327. package/chunks/fr_FR.js +1 -1
  328. package/chunks/he_IL.js +1 -1
  329. package/chunks/hr_HR.js +1 -1
  330. package/chunks/hu_HU.js +1 -1
  331. package/chunks/id_ID.js +1 -1
  332. package/chunks/index.js +1 -1
  333. package/chunks/it_IT.js +1 -1
  334. package/chunks/ja_JP.js +1 -1
  335. package/chunks/ko_KR.js +1 -1
  336. package/chunks/lt_LT.js +1 -1
  337. package/chunks/lv_LV.js +1 -1
  338. package/chunks/mat3.js +1 -1
  339. package/chunks/nb_NO.js +1 -1
  340. package/chunks/nl_NL.js +1 -1
  341. package/chunks/pl_PL.js +1 -1
  342. package/chunks/pt_BR.js +1 -1
  343. package/chunks/pt_PT.js +1 -1
  344. package/chunks/quat.js +1 -1
  345. package/chunks/quat2.js +1 -1
  346. package/chunks/quatf64.js +1 -1
  347. package/chunks/ro_RO.js +1 -1
  348. package/chunks/ru_RU.js +1 -1
  349. package/chunks/sk_SK.js +1 -1
  350. package/chunks/sl_SL.js +1 -1
  351. package/chunks/sphere.js +1 -1
  352. package/chunks/sr_RS.js +1 -1
  353. package/chunks/sv_SE.js +1 -1
  354. package/chunks/th_TH.js +1 -1
  355. package/chunks/tr_TR.js +1 -1
  356. package/chunks/uk_UA.js +1 -1
  357. package/chunks/vec3.js +1 -1
  358. package/chunks/vec3f32.js +1 -1
  359. package/chunks/vec4f64.js +1 -1
  360. package/chunks/vi_VN.js +1 -1
  361. package/chunks/zh_Hans.js +1 -1
  362. package/chunks/zh_Hant.js +1 -1
  363. package/core/VectorStack.js +1 -1
  364. package/core/libs/gl-matrix-2/factories/quatf64.js +1 -1
  365. package/core/libs/gl-matrix-2/factories/vec3f32.js +1 -1
  366. package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
  367. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  368. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  369. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  370. package/core/perspectiveUtils.js +1 -1
  371. package/core/workers/workerFactory.js +1 -1
  372. package/geohash/GeohashTree.js +1 -1
  373. package/geometry/support/MeshTransform.js +1 -1
  374. package/geometry/support/axisAngle.js +1 -1
  375. package/geometry/support/axisAngleDegrees.js +1 -1
  376. package/geometry/support/lineSegment.js +1 -1
  377. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  378. package/geometry/support/meshUtils/exporters/gltf/node.js +1 -1
  379. package/geometry/support/meshUtils/georeference.js +1 -1
  380. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  381. package/geometry/support/meshUtils/projection.js +1 -1
  382. package/geometry/support/meshUtils/rotate.js +1 -1
  383. package/geometry/support/plane.js +1 -1
  384. package/interfaces.d.ts +70 -0
  385. package/layers/VoxelWasmPerSceneView.js +1 -1
  386. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  387. package/layers/graphics/featureConversionUtils.js +1 -1
  388. package/layers/mixins/EditBusLayer.js +1 -1
  389. package/layers/mixins/OperationalLayer.js +1 -1
  390. package/layers/support/AggregateField.js +1 -1
  391. package/layers/support/ControlPointsGeoreference.js +1 -1
  392. package/layers/support/ExportImageServiceParameters.js +1 -1
  393. package/layers/support/OutStatistic.js +1 -1
  394. package/layers/support/VoxelVolume.js +1 -1
  395. package/layers/support/voxelPlaneUtils.js +1 -1
  396. package/package.json +1 -1
  397. package/rest/support/AggregateFeatureSet.js +5 -0
  398. package/support/revision.js +1 -1
  399. package/views/2d/ViewState.js +1 -1
  400. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  401. package/views/2d/engine/imagery/RasterVFTile.js +1 -1
  402. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  403. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  404. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  405. package/views/2d/engine/webgl/WGLTile.js +1 -1
  406. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  407. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  408. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  409. package/views/2d/layers/LayerView2D.js +1 -1
  410. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  411. package/views/2d/layers/features/schemaUtils.js +1 -1
  412. package/views/2d/layers/features/support/BinStore.js +1 -1
  413. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  414. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  415. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  416. package/views/2d/layers/support/DebugOverlay.js +1 -1
  417. package/views/2d/layers/support/ExportStrategy.js +1 -1
  418. package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
  419. package/views/2d/layers/support/clusterUtils.js +1 -1
  420. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  421. package/views/3d/analysis/Dimensioning/DimensioningTool.js +1 -1
  422. package/views/3d/analysis/Dimensioning/LengthDimensionComputation.js +1 -1
  423. package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
  424. package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
  425. package/views/3d/analysis/Dimensioning/lengthDimensionUtils.js +1 -1
  426. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  427. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  428. package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
  429. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  430. package/views/3d/camera/constraintUtils/distance.js +1 -1
  431. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  432. package/views/3d/environment/CloudsComposition.js +1 -1
  433. package/views/3d/environment/CloudsCompositionParameters.js +1 -1
  434. package/views/3d/environment/CloudsGenerator.js +1 -1
  435. package/views/3d/environment/CloudsPresets.js +1 -1
  436. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  437. package/views/3d/environment/Fog.js +1 -1
  438. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  439. package/views/3d/environment/Precipitation.js +1 -1
  440. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  441. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  442. package/views/3d/environment/weatherUtils.js +1 -1
  443. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  444. package/views/3d/externalRenderers/RenderContext.js +1 -1
  445. package/views/3d/glTF/internal/Resource.js +1 -1
  446. package/views/3d/interactive/Manipulator3D.js +1 -1
  447. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  448. package/views/3d/interactive/editingTools/settings.js +1 -1
  449. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  450. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  451. package/views/3d/interactive/manipulatorUtils.js +1 -1
  452. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  453. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  454. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  455. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  456. package/views/3d/layers/I3SMeshView3D.js +1 -1
  457. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  458. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  459. package/views/3d/layers/PointCloudWorker.js +1 -1
  460. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  461. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  462. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  463. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  464. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  465. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  466. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  467. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  468. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  469. package/views/3d/layers/graphics/elevationAlignPointsInFeatures.js +1 -1
  470. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  471. package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
  472. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  473. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  474. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  475. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  476. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  477. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  478. package/views/3d/layers/support/edgeUtils.js +1 -1
  479. package/views/3d/layers/support/uvUtils.js +1 -1
  480. package/views/3d/state/Frustum.js +1 -1
  481. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  482. package/views/3d/state/controllers/RotateController.js +1 -1
  483. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  484. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  485. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  486. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  487. package/views/3d/state/utils/navigationUtils.js +1 -1
  488. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  489. package/views/3d/support/orientedBoundingBox.js +1 -1
  490. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  491. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  492. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  493. package/views/3d/support/sunUtils.js +1 -1
  494. package/views/3d/terrain/OverlayManager.js +1 -1
  495. package/views/3d/terrain/OverlayRenderer.js +1 -1
  496. package/views/3d/terrain/PatchRenderData.js +1 -1
  497. package/views/3d/terrain/TerrainRenderer.js +1 -1
  498. package/views/3d/terrain/TerrainSurface.js +1 -1
  499. package/views/3d/terrain/Tile.js +1 -1
  500. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  501. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  502. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  503. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  504. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  505. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  506. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  507. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +6 -6
  508. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +2 -2
  509. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +13 -13
  510. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +1 -1
  511. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +9 -9
  512. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  513. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  514. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  515. package/views/3d/webgl-engine/lib/AnimationTimer.js +1 -1
  516. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  517. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  518. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  519. package/views/3d/webgl-engine/lib/GeometryRecord.js +1 -1
  520. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  521. package/views/3d/webgl-engine/lib/Highlight.js +1 -1
  522. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  523. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  524. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  525. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  526. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  527. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  528. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  529. package/views/3d/webgl-engine/lib/Update.js +5 -0
  530. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  531. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  532. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  533. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  534. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  535. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  536. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  537. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  538. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  539. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  540. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  541. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  542. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  543. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  544. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  545. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  546. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  547. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  548. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  549. package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
  550. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  551. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  552. package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +5 -0
  553. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +5 -0
  554. package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +5 -0
  555. package/views/3d/webgl-engine/shaders/OITCompositingTechnique.js +5 -0
  556. package/views/3d/webgl-engine/shaders/OverlayCompositing.glsl.js +5 -0
  557. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +5 -0
  558. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  559. package/views/SceneView.js +1 -1
  560. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  561. package/views/interactive/coordinateHelper.js +1 -1
  562. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  563. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  564. package/views/interactive/snapping/LineSnapper.js +1 -1
  565. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  566. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  567. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  568. package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
  569. package/views/interactive/snapping/SnappingManager.js +1 -1
  570. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  571. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  572. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  573. package/views/interactive/snapping/featureSources/SnappingCandidateElevationAligner.js +1 -1
  574. package/views/interactive/snapping/featureSources/SnappingResultElevationFilter.js +1 -1
  575. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  576. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  577. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  578. package/views/interactive/snapping/featureSources/snappingResultElevationUtils.js +5 -0
  579. package/views/interactive/snapping/snappingUtils.js +1 -1
  580. package/views/layers/FeatureLayerView.js +1 -1
  581. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  582. package/views/support/Scheduler.js +1 -1
  583. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  584. package/views/support/geometry3dUtils.js +1 -1
  585. package/widgets/Directions/support/resources.js +1 -1
  586. package/widgets/Directions.js +1 -1
  587. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  588. package/widgets/ElevationProfile/support/constants.js +1 -1
  589. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  590. package/widgets/Feature/FeatureRelationship.js +1 -1
  591. package/widgets/Legend/LegendViewModel.js +1 -1
  592. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  593. package/widgets/Weather/LabeledSlider.js +1 -1
  594. package/widgets/Weather.js +1 -1
  595. package/assets/esri/core/workers/chunks/0059699bf824f851d51c.js +0 -1
  596. package/assets/esri/core/workers/chunks/01a6005569d0820992a0.js +0 -1
  597. package/assets/esri/core/workers/chunks/2eb547a0be305f2c816c.js +0 -1
  598. package/assets/esri/core/workers/chunks/36dd5654df5c7f00406d.js +0 -1
  599. package/assets/esri/core/workers/chunks/36e0a0d5f86b2b4b88f9.js +0 -1
  600. package/assets/esri/core/workers/chunks/8b8a813f5e6d6551a816.js +0 -1
  601. package/assets/esri/core/workers/chunks/bf84189bd9bf3de81df9.js +0 -1
  602. package/assets/esri/core/workers/chunks/cd7f5c3d328166f28f59.js +0 -1
  603. package/assets/esri/core/workers/chunks/de128d8a643b4297940b.js +0 -1
  604. package/assets/esri/core/workers/chunks/e208d9c34f5db4481441.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{deprecatedProperty as t}from"../core/deprecate.js";import{on as s,pausable as i}from"../core/events.js";import r from"../core/Handles.js";import o from"../core/Logger.js";import{isNone as n,isSome as a,unwrap as l,unwrapOrValue as c}from"../core/maybe.js";import{watch as d,initial as u,when as h,on as p}from"../core/reactiveUtils.js";import{property as v}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as m}from"../core/accessorSupport/decorators/cast.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as g}from"../properties/defaultUnit.js";import y from"../rest/support/Stop.js";import S from"../symbols/SimpleMarkerSymbol.js";import w from"./Search.js";import M from"./Widget.js";import b from"./Directions/DirectionsViewModel.js";import{SaveLayer as f}from"./Directions/components/SaveLayer.js";import{formatDistance as C,formatDuration as T}from"./Directions/support/directionsUtils.js";import{DepartureTime as k,CSS as I,getIconPath as D}from"./Directions/support/resources.js";import{isArcGISWorldGeocoder as L,meteredArcGISLocatorUrl as P}from"./Search/support/locatorUtils.js";import R from"./support/DatePicker.js";import{Heading as B,incrementHeadingLevel as j}from"./support/Heading.js";import A from"./support/TimePicker.js";import{accessibleHandler as x}from"./support/decorators/accessibleHandler.js";import{messageBundle as E}from"./support/decorators/messageBundle.js";import{tsx as H}from"./support/jsxFactory.js";import"./support/widgetUtils.js";import U from"sortablejs";import{substitute as O}from"../intl/substitute.js";import{formatDate as z,convertDateFormatToIntlOptions as $}from"../intl/date.js";import{formatNumber as F}from"../intl/number.js";const N={departureTime:!0,layerDetails:!0,printButton:!1,saveAsButton:!0,saveButton:!0,stops:!0,traveMode:!0};function V(e){const t=e.getTimezoneOffset(),s=t>0?"-":"+",i=60,r=Math.abs(Math.floor(t/i)),o=Math.abs(Math.floor(t)%i),n={minimumIntegerDigits:2};return`GMT${s}${F(r,n)}${F(o,n)}`}function K(e){return!!e.composedPath?.().find((e=>e.classList?.contains("esri-search__suggestions-list")))}const W={awaitingViewClickStop:"awaiting-view-click-stop"},q=100,Y=500,G="esri.widgets.Directions",J=o.getLogger(G);let Q=class extends M{constructor(e,t){super(e,t),this._autoStopRemovalDelay=q,this._departureTime=k.NOW,this._datePicker=new R,this._handles=new r,this._newPlaceholderStop=null,this._pointerPressedSearchSuggestionStop=null,this._renderSavePopoverFunction=null,this._saveAsButtonNode=null,this._saveLayer=new f,this._sections=null,this._stopsToSearches=new Map,this._timePicker=new A,this.headingLevel=2,this.iconClass=I.widgetIcon,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.searchProperties=null,this.viewModel=new b,this.visibleElements={...N},this._setUpDragAndDropStops=e=>{this._sortable=U.create(e,{draggable:`.${I.validStopRow}`,ghostClass:I.stopRowGhost,handle:`.${I.stopHandle}`,onEnd:this._handleStopInputDragEnd})},this._handleDragHandlePointerDown=()=>this.viewModel.layer.stops.forEach((e=>this._acquireSearch(e).activeMenu="none")),this._handleStopInputDragEnd=({oldIndex:e,newIndex:t,target:s})=>{if(e===t)return;const{children:i}=s,r=i[t],o=i[e],n=t-e<0;s.insertBefore(r,n?o.nextElementSibling:o);const a=this.viewModel.layer.stops;a.reorder(a.getItemAt(e),t);for(const l of a)l.sequence=null;this._getDirections()}}initialize(){this.addHandles([d((()=>this.viewModel.layer.routeInfo),(()=>{this._activeManeuver=null,this._focusedManeuver=null,this._sections=this._getSections(),this.scheduleRender()}),u),h((()=>this.view),((e,t)=>{if(t&&(this._viewClickHandle=null,this._handles.remove(t)),e){const t=this._prepPointerDownUpClick(),i=this._prepViewClick();t.pause(),i.pause(),this._handles.add([s(e.surface,"mousedown",(()=>this._autoStopRemovalDelay=Y)),s(e.surface,"mouseup",(()=>this._autoStopRemovalDelay=q)),t,i],this.view.surface),this._pointerDownUpHandle=t,this._viewClickHandle=i}}),u),h((()=>n(this.viewModel.serviceDescription)),(()=>{try{this.viewModel.load()}catch{}}),u),d((()=>this._saveLayer.state),(()=>{this.scheduleRender()}))]),this.when((()=>{this.destroyed||(this._renderSavePopoverFunction=this._renderSavePopover.bind(this),this._projector.append(document.body,this._renderSavePopoverFunction))}))}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-button.js"),import("@esri/calcite-components/dist/components/calcite-link.js"),import("@esri/calcite-components/dist/components/calcite-popover.js")])}destroy(){this._datePicker.destroy(),this._timePicker.destroy();for(const e of this._stopsToSearches.values())e.destroy();this._sortable&&this._sortable.destroy(),a(this._renderSavePopoverFunction)&&this._projector.detach(this._renderSavePopoverFunction)}get apiKey(){return this.viewModel.apiKey}set apiKey(e){this.viewModel.apiKey=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get lastRoute(){return this.viewModel.lastRoute}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get maxStops(){return this.viewModel.maxStops}set maxStops(e){this.viewModel.maxStops=e}set routeServiceUrl(e){t(J,"routeServiceUrl",{replacement:"viewModel.layer.url",version:"4.24",warnOnce:!0}),this.viewModel.legacyLayer.url=e}get routeServiceUrl(){return t(J,"routeServiceUrl",{replacement:"viewModel.layer.url",version:"4.24",warnOnce:!0}),this.viewModel.legacyLayer.url}set routeSymbol(e){t(J,"routeSymbol",{replacement:"viewModel.layer.defaultSymbols.directionLines",version:"4.24",warnOnce:!0}),this.viewModel.legacyLayer.defaultSymbols.directionLines=e}get routeSymbol(){return t(J,"routeSymbol",{replacement:"viewModel.layer.defaultSymbols.directionLines",version:"4.24",warnOnce:!0}),this.viewModel.legacyLayer.defaultSymbols.directionLines}set stopSymbols(e){t(J,"stopSymbols",{replacement:"viewModel.layer.defaultSymbols.stops",version:"4.24",warnOnce:!0}),this.viewModel.legacyLayer.defaultSymbols.stops=e}get stopSymbols(){return t(J,"stopSymbols",{replacement:"viewModel.layer.defaultSymbols.stops",version:"4.24",warnOnce:!0}),this.viewModel.legacyLayer.defaultSymbols.stops}get unit(){return this.defaultUnit}set unit(e){this._overrideIfSome("unit",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...N,...e}}getDirections(){return this.viewModel.getDirections()}render(){return H("div",{class:this.classes(I.base,I.scroller)},this._renderPanelContent())}save(){return this.viewModel.layer.save()}saveAs(e,t={}){return this.viewModel.layer.saveAs(e,t)}zoomToRoute(){return this.viewModel.zoomToRoute()}_renderPanelContent(){const{viewModel:{serviceDescription:e,state:t}}=this,s="initializing"===t,i="error"===t&&!e,r="unauthenticated"===t,o={[I.panelContentLoading]:s,[I.panelContentError]:i,[I.panelContentSignIn]:r},n=s?"presentation":"group",a=r?this._renderSignIn():i?this._renderMessage(this._getErrorMessage()):s?this._renderLoader():this._renderReadyContent();return H("div",{class:this.classes(I.panelContent,o),role:n},a)}_renderReadyContent(){return[this._renderStopsContainer(),this._renderTravelModeOptions(),this._renderDepartureTimeControls(),this._renderSaveContainer(),this._renderSectionSplitter(),this._renderDirectionsContainer()]}_renderSignIn(){return H("div",{key:"sign-in",class:I.signInContent},H(B,{class:I.contentTitle,level:this.headingLevel},this.messages.widgetLabel),this._renderPlaceholder(),H(B,{level:j(this.headingLevel)},this.messages.signInRequired),H("button",{class:this.classes(I.button,I.buttonSecondary,I.signInButton),tabIndex:0,onclick:this._handleSignInClick,bind:this,type:"button"},this.messagesCommon.auth.signIn))}_handleSignInClick(){this.viewModel.load().catch((()=>{}))}_renderTravelModeOptions(){if(!this.visibleElements.traveMode)return null;const{selectedTravelMode:e,travelModes:t}=this.viewModel;if(0===t.length)return null;const s=a(e)?e.name:this.messages.travelMode;return H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(I.travelMode,this._saveLayer.opened&&I.buttonDisabled),key:"esri-directions__travel-mode-controls",role:"group"},H("select",{"aria-label":s,bind:this,class:this.classes(I.travelModeSelect,I.select),key:"esri-directions__travel-mode-options",onchange:this._handleTravelModeChange,title:s},t.map((t=>{const s=a(e)&&t.id===e.id;return H("option",{key:`esri-directions__travel-mode-${t.id}`,"data-mode":t,selected:s,value:t.id},t.name)}))))}_handleTravelModeChange(e){const t=e.currentTarget,s=t.item(t.selectedIndex);this.viewModel.selectedTravelMode=s["data-mode"],this._getDirections()}_renderStopsContainer(){return this.visibleElements.stops?H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(I.section,this._saveLayer.opened&&I.buttonDisabled),key:"esri-directions__stops-container",role:"group"},this._renderStops()):null}_renderDepartureTimeControls(){if(!this.visibleElements.departureTime)return null;const e=this._departureTime,{messages:t}=this,s=t.departureTime;return H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(I.departureTime,this._saveLayer.opened&&I.buttonDisabled),key:"esri-directions__departure-time-controls",role:"group"},H("select",{"aria-label":s,bind:this,class:this.classes(I.departureTimeSelect,I.select),onchange:this._handleDepartureOptionChange,title:s},H("option",{value:k.NOW,selected:e===k.NOW},t.leaveNow),H("option",{value:k.DEPART_BY,selected:e===k.DEPART_BY},t.departBy),H("option",{value:k.UNSPECIFIED,selected:e===k.UNSPECIFIED},t.timeUnspecified)),e===k.DEPART_BY?this._renderTimeControls():null)}_renderStops(){const e=this.viewModel.layer.stops;let t=0;for(const r of this._stopsToSearches.keys())e.includes(r)||this._disposeSearch(r);for(const r of e){const e=this._acquireSearch(r);"none"!==e.activeMenu&&(t+=1),a(r.name)&&(e.searchTerm=r.name)}const s=e.toArray().map(((s,i)=>{const r=e.length,o=i>1&&n(s.geometry),l={[I.stopsIcon]:i>=0&&i<r-1,[I.lastStopIcon]:i===r-1},c={[I.lastStopIconContainer]:i===r-1},d={[I.validStopRow]:!o},u=e.getItemAt(i+1),h=u&&a(u.geometry),p=i===r-1,v=i===r-2,m=2===r&&0===i||r>2&&!p&&!v||r>2&&v&&h||r>2&&p&&n(s.geometry),_=r<3,g=this._acquireSearch(s),{messages:y}=this,{removeStop:S,reverseStops:w,unlocated:M}=y,b=O(y.stopLabelTemplate,{number:i+1,label:a(s.geometry)?s.name:M}),f=`${this.id}__stop--${i}`,C=!!g.searchTerm&&!!g.selectedResult&&a(s.geometry)&&g.selectedResult.name===s.name,T={zIndex:"none"!==g.activeMenu?""+t--:""};return H("li",{"aria-label":b,afterCreate:this._handleStopFieldCreation,bind:this,class:this.classes(I.stopRow,d),id:f,key:i,"data-stop-index":i,styles:T},H("div",{class:I.stopHandle},H("span",{"aria-hidden":"true",class:this.classes(I.stopIcon,I.handleIcon,I.stopHandleIcon,I.interactiveStopIcon),onpointerdown:this._handleDragHandlePointerDown}),H("div",{bind:this,"aria-labelledby":f,class:this.classes(I.stopIconContainer,c),"data-stop-index":i,onclick:this._handleStopIconClick,onkeydown:this._handleStopIconClick,role:"button"},H("span",{class:this.classes(I.stopIcon,l),tabindex:C?"0":null}))),H("div",{class:I.stopInput},g.render()),H("div",{class:I.stopOptions,role:"group"},H("div",{"aria-label":S,class:I.removeStopButton,bind:this,"data-stop-index":i,hidden:_,onkeydown:this._handleRemoveStop,onclick:this._handleRemoveStop,role:"button",tabIndex:0,title:S},H("span",{"aria-hidden":"true",class:this.classes(I.stopIcon,I.removeStop,I.removeStopIcon,I.interactiveStopIcon)}),H("span",{class:I.screenReaderText},"removeStopTitle")),H("div",{"aria-label":w,class:I.reverseStops,bind:this,hidden:m,onkeydown:this._handleReverseStops,onclick:this._handleReverseStops,role:"button",tabIndex:0,title:w},H("span",{"aria-hidden":"true",class:this.classes(I.stopIcon,I.reverseStopIcon,I.interactiveStopIcon)}),H("span",{class:I.screenReaderText},"removeStopTitle"))))})),i=this._renderAddStop();return H("div",null,H("ol",{class:I.stops,role:"group",afterCreate:this._setUpDragAndDropStops},s),i)}_renderAddStop(){const{stops:e}=this.viewModel.layer,t=e.filter((({geometry:e})=>a(e))),s=e.at(-1);return t.length>1&&t.length<this.maxStops&&a(s)&&a(s.geometry)?H("div",{class:I.toolbarSection},H("div",{class:I.toolbarButtons},H("calcite-button",{appearance:"outline",class:I.addStopButton,color:"neutral","icon-start":"plus",key:I.addStopButton,onclick:()=>{this._addNewPlaceholder()},text:this.messages.addStop,width:"half"},this.messages.addStop))):null}_handleStopIconClick(e){const t=e.currentTarget["data-stop-index"],s=this.viewModel.layer.stops.getItemAt(t);s&&a(s.geometry)&&this._centerAtStop(s)}_handleClearRouteClick(){this.viewModel.reset()}_centerAtStop(e){this.viewModel.centerAt(e)}_handleStopFieldCreation(e){const t=this._newPlaceholderStop;if(!t)return;const s=e["data-stop-index"],i=this.viewModel.layer.stops.getItemAt(s);if(t===i){const e=this._acquireSearch(i);e.when((()=>{this.renderNow(),e.focus()}))}this._newPlaceholderStop=null}_handleStopInputBlur(e,t){if(this._saveLayer.opened)return;this._handles.remove(W.awaitingViewClickStop),this.view.cursor=this._previousCursor;if(!!e.selectedResult&&a(t.geometry)&&a(e.selectedResult?.feature.geometry)&&t.geometry===e.selectedResult?.feature.geometry)return void this._pointerDownUpHandle.pause();const s=n(t.geometry)&&n(e.selectedResult?.feature.geometry),i=a(t.geometry)&&a(e.selectedResult?.feature.geometry)&&t.geometry!==e.selectedResult.feature.geometry;if((s||i)&&"none"===e.activeMenu&&e.searchTerm)return e.search(),void this._pointerDownUpHandle.pause();e.searchTerm||(this._viewClickHandle.resume(),clearTimeout(this._autoStopRemovalTimeoutId),this._autoStopRemovalTimeoutId=setTimeout((()=>{this.destroyed||(this._viewClickHandle.pause(),"searching"!==e.viewModel.state?this._pointerPressedSearchSuggestionStop||(a(t.geometry)&&(t.geometry=null,this._getDirections()),this.scheduleRender()):this._pointerDownUpHandle.pause())}),this._autoStopRemovalDelay))}_handleStopInputFocus(e,t){if(this._pointerDownUpHandle.resume(),this._handles.has(W.awaitingViewClickStop))return;const{view:s,view:{cursor:i}}=this;this._previousCursor=i,this._handles.add(d((()=>e.searchTerm),(t=>{e.destroyed||(s.cursor=0===t.length?"copy":i)}),u),W.awaitingViewClickStop),this._activeStop=t}_prepViewClick(){const{view:e}=this.viewModel,t=i(e,"click",this._handleViewClick.bind(this)),s=i(e.surface,"click",(()=>{clearTimeout(this._autoStopRemovalTimeoutId),s.pause()}));return{remove(){s.remove(),t.remove()},pause(){s.pause(),t.pause()},resume(){s.resume(),t.resume()}}}_prepPointerDownUpClick(){const e=i(document,"pointerdown",(e=>{this._pointerPressedSearchSuggestionStop=K(e)?this._activeStop:null})),t=i(document,"pointerup",(e=>{this._pointerDownUpHandle.pause();const t=K(e),s=this._activeStop;t||s!==this._pointerPressedSearchSuggestionStop||this._removeStop(s),this.scheduleRender(),this._pointerPressedSearchSuggestionStop=t?s:null}));return{remove(){t.remove(),e.remove()},pause(){t.pause(),e.pause()},resume(){e.resume()}}}_handleViewClick(e){const t=this._stopsToSearches.get(this._activeStop);t&&!t.searchTerm&&(t.search(e.mapPoint).then((e=>{const s=e.results[0].results[0],{feature:i,name:r}=s;this._activeStop.geometry=i.geometry,this._activeStop.name=r,t.searchTerm=r})),this.scheduleRender()),this._viewClickHandle.pause(),clearTimeout(this._autoStopRemovalTimeoutId)}_addNewPlaceholder(){if(this._pointerDownUpHandle.pause(),this._newPlaceholderStop)return;const e=new y({symbol:new S});this.viewModel.layer.stops.add(e),this._newPlaceholderStop=e}_handleReverseStops(){this._reverseStops()}_reverseStops(){this.viewModel.layer.stops.reverse();for(const e of this.viewModel.layer.stops)e.sequence=null;this._getDirections()}_handleRemoveStop(e){const t=e.currentTarget["data-stop-index"],s=this.viewModel.layer.stops.getItemAt(t);this._removeStop(s),(a(s.geometry)||n(this.viewModel.layer.routeInfo))&&this._getDirections()}_removeStop(e){this.viewModel.layer.stops.length<=2||(this._disposeSearch(e),this.viewModel.layer.stops.remove(e))}_handleDepartureOptionChange(e){const t=e.currentTarget,s=t.item(t.selectedIndex);s.value===k.NOW?(this._departureTime=k.NOW,this.viewModel.departureTime=k.NOW,this._handles.remove("departure-time-controls"),this._getDirections()):s.value===k.DEPART_BY?(this._departureTime=k.DEPART_BY,this._handles.add(d((()=>[this._datePicker.value,this._timePicker.value]),(()=>{this._updateDepartureTime(),this._getDirections()}),u),"departure-time-controls")):(this._departureTime=k.UNSPECIFIED,this.viewModel.departureTime=null,this._getDirections())}_updateDepartureTime(){const e=this._datePicker.value,t=this._timePicker.value;e&&t&&(this.viewModel.departureTime=new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes()))}_renderTimeControls(){return H("div",{class:I.departureTimeControls,key:"esri-directions__time-controls",role:"group"},this._datePicker.render(),this._timePicker.render())}_renderSectionSplitter(){return H("div",{class:I.sectionSplitter})}_renderSaveContainer(){const{saveButton:e,saveAsButton:t,printButton:s,layerDetails:i}=this.visibleElements;return e||t||s||i?H("div",{class:I.saveSection,key:I.saveSection},this._renderSaveButtons(),this._renderRouteLayerDetailsLink()):null}_renderSaveButtons(){const{saveButton:e,saveAsButton:t,printButton:s}=this.visibleElements;return e||t||s?H("div",{class:I.saveButtons,key:I.saveButtons},this._renderSaveButton(),this._renderSaveAsButton(),this._renderPrintButton()):null}_renderSaveButton(){if(!this.visibleElements.saveButton)return null;const e=this.viewModel.layer.portalItem?.itemControl,t=a(this.viewModel.layer.routeInfo)&&("admin"===e||"update"===e);return H("calcite-button",{appearance:"outline",class:I.saveButton,color:"neutral",disabled:!t,"icon-start":"save",key:I.saveButton,onclick:()=>{this._handleSaveButtonClick()},text:this.messagesCommon.save,width:"full"},this.messagesCommon.save)}_renderSaveAsButton(){if(!this.visibleElements.saveAsButton)return null;const e=n(this.viewModel.layer.routeInfo);return H("div",{class:I.saveAsButtonPopover,key:I.saveAsButtonPopover},H("calcite-button",{afterCreate:e=>{this._saveAsButtonNode=e},appearance:"outline",class:I.saveAsButton,color:"neutral",disabled:e,"icon-start":"duplicate",key:I.saveAsButton,onclick:()=>this._handleSaveAsButtonClick(),text:this.messagesCommon.saveAs,width:"full"},this.messagesCommon.saveAs))}_renderSavePopover(){return H("calcite-popover",{label:this._saveLayer.label,open:this._saveLayer.opened,"overlay-positioning":"fixed",referenceElement:l(this._saveAsButtonNode)},this._saveLayer.render())}_handleSaveAsButtonClick(){this._saveLayer.opened?this._saveLayer.close():this._saveLayer.open(this.viewModel.layer)}_renderPrintButton(){return this.visibleElements.printButton?H("calcite-button",{appearance:"outline",class:I.printButton,color:"neutral","icon-start":"print",key:I.printButton,text:this.messagesCommon.print}):null}_renderRouteLayerDetailsLink(){if(!this.visibleElements.layerDetails)return null;const{portalItem:e}=this.viewModel.layer;if(!e)return null;const{id:t,portal:{url:s}}=e,i=`${s}/home/item.html?id=${t}`;return H("calcite-link",{class:I.layerDetailsLink,href:i,key:I.layerDetailsLink,target:"_blank"},this.messages.viewLayerDetails)}_handleSaveButtonClick(){this.viewModel.layer.save()}_renderDirectionsContainer(){return H("div",{class:this.classes(I.directionsSection,I.section),key:"esri-directions__container"},this._renderDirectionsContainerContent())}_renderLoader(){return H("div",{class:I.loader,key:"loader"})}_renderWarningCard(){return H("div",{class:I.warningCard,role:"alert"},H("div",{class:I.warningHeader},H("span",{class:I.warningIcon,"aria-hidden":"true"}),H(B,{class:I.warningHeading,level:this.headingLevel},this.messagesCommon.warning)),H("div",{class:I.warningMessage},this._getErrorMessage()))}_renderDirectionsContainerContent(){const{viewModel:{layer:e,state:t}}=this,s="routing"===t;return"error"===t?this._renderWarningCard():s?this._renderLoader():a(e.directionLines)?H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(I.summary,this._saveLayer.opened&&I.buttonDisabled),key:"esri-directions__summary",role:"group"},this._renderCosts(),this._renderRouteActions(),this._renderManeuverSections()):H("div",{key:"esri-directions__placeholder",class:I.emptyContent},this._renderPlaceholder(),H(B,{class:I.message,level:this.headingLevel},this.messages.directionsPlaceholder))}_renderPlaceholder(){return H("svg",{class:I.emptyIllustration,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256"},H("path",{fill:"currentcolor",d:"M192 36c-15.477 0-24 6.034-24 16.99v45.822l24 24 24-24v-45.82C216 42.033 207.477 36 192 36zm20 61.155l-20 20-20-20V52.99c0-8.62 6.73-12.99 20-12.99s20 4.37 20 12.99zM192 52a12 12 0 1 0 12 12 12.013 12.013 0 0 0-12-12zm0 20a8 8 0 1 1 8-8 8.008 8.008 0 0 1-8 8zM92 140.99C92 130.035 83.477 124 68 124s-24 6.034-24 16.99v45.822l24 24 24-24zm-4 44.165l-20 20-20-20V140.99c0-8.62 6.73-12.99 20-12.99s20 4.37 20 12.99zM68 140a12 12 0 1 0 12 12 12.013 12.013 0 0 0-12-12zm0 20a8 8 0 1 1 8-8 8.008 8.008 0 0 1-8 8zm84-44h16v4h-16zm-24 80h4v12h-12v-4h8zm0-28h4v16h-4zm0-52h12v4h-8v8h-4zm0 24h4v16h-4zm-36 64h16v4H92z"}))}_renderMessage(e){return H(B,{level:this.headingLevel},e)}_renderRouteActions(){return H("div",{class:I.routeActions},H("button",{"aria-label":this.messages.clearRoute,class:this.classes(I.clearRouteButton,I.button,I.buttonTertiary),tabIndex:0,onclick:this._handleClearRouteClick,bind:this,type:"button"},this.messages.clearRoute))}_getSections(){const{directionPoints:e,directionLines:t,stops:s}=this.viewModel.layer;if(n(e)||n(t))return null;const i=[];let r=null;for(const o of e){const{objectId:e,stopId:l}=o;if(a(l)){const e=s.find((e=>e.objectId===l)),t=0===i.length;(n(r)||r.stop!==e)&&(r={stop:e,directions:[],open:t},i.push(r));continue}if(n(r))continue;const c=t.find((t=>t.directionPointId===e));n(c)||r.directions.push({directionPoint:o,directionLine:c})}return i}_renderManeuverSections(){return n(this._sections)?null:H("div",{class:I.maneuvers,role:"group"},this._sections.map(((e,t)=>{const{open:s}=e;let i;e.directions.length>0&&s&&(i=H("ol",{class:I.maneuverList},e.directions.map((e=>this._renderManeuver(e)))));const r=l(this._sections).length>2,o=t===l(this._sections).length-1,n={[I.collapsibleSection]:r},a={[I.openIcon]:!s,[I.closeIcon]:s};let c;if(r&&!o){const t=s?this.messagesCommon.close:this.messagesCommon.open;c=H("header",{class:this.classes(I.maneuverSectionHeader,I.maneuverSectionToggle),key:I.maneuverSectionHeader},H("div",{"aria-expanded":s.toString(),"aria-label":t,bind:this,class:I.maneuverSectionHeaderButton,"data-maneuver-section":e,onkeydown:this._handleSectionToggle,onclick:this._handleSectionToggle,role:"button",tabIndex:0,title:t},H(B,{class:I.maneuverSectionTitle,level:this.headingLevel},e.stop.name),H("span",{"aria-hidden":"true",class:this.classes(a)})))}else c=H("header",{class:I.maneuverSectionHeader,key:I.maneuverSectionHeader},H(B,{class:I.maneuverSectionTitle,level:this.headingLevel},e.stop.name));return H("section",{class:this.classes(I.maneuverSection,n),key:t},c,i)})))}_handleSectionToggle(e){const t=e.currentTarget["data-maneuver-section"];t.open=!t.open}_renderCosts(){const e=this._getCostSummary(),{directionPoints:t}=this.viewModel.layer;if(n(t)||n(e))return null;const s=t.getItemAt(t.length-1).arrivalTime,{distance:i,duration:r}=e,{eta:o,etaTemplate:l,primaryCosts:c,secondaryCosts:d,zoomToRoute:u}=this.messages,h=$("short-time"),p=a(s)?`<strong>${z(s,h)}</strong>`:null,v=a(s)?`${V(s)}`:null,m=O(l,{time:p,gmt:v});return H("div",{"aria-label":u,bind:this,class:I.directionCosts,onkeydown:this._handleSummaryInteraction,onclick:this._handleSummaryInteraction,role:"button",tabIndex:0,title:u},H("div",{class:I.costsDetails,role:"group"},H("div",{class:I.primaryCosts,title:c},r),H("div",{class:I.verticalSplitter}),H("div",{class:I.secondaryCosts,title:d},i)),H("div",{innerHTML:m,title:o}))}_handleSummaryInteraction(){this._activeManeuver=null,this._focusedManeuver=null,this.viewModel.clearHighlights(),this.zoomToRoute()}_getErrorMessage(){const{messages:e,viewModel:{lastError:t}}=this;if(a(t))switch(t.name){case"directions-view-model:unable-to-route":return e.errors.unableToRoute;case"directions-view-model:service-metadata-unavailable":return e.errors.unableToLoadServiceMetadata}return e.errors.unknownError}_normalizeSearchSources(e){this._overrideDefaultSources(e),this._applyLocatorSourceOverrides(e)}_overrideDefaultSources(e){e.viewModel.defaultSources.forEach((e=>{e.autoNavigate=!1}))}_applyLocatorSourceOverrides({allSources:e}){for(const t of e)"url"in t&&t.url&&(t.locationType??(t.locationType="street"),L(t.url)&&this.apiKey&&null==t.apiKey&&(t.apiKey=this.apiKey,t.url=P))}_acquireSearch(e){const{view:t}=this.viewModel;if(this._stopsToSearches.has(e)){const s=this._stopsToSearches.get(e);return s.view=t,this._overrideDefaultSources(s),s}const s=new w({view:t,resultGraphicEnabled:!1,popupEnabled:!1,...this.searchProperties});return this._normalizeSearchSources(s),this._handles.add([p((()=>s.allSources),"change",(()=>this._normalizeSearchSources(s))),s.on("select-result",(()=>{e.geometry=s.selectedResult.feature.geometry,e.name=s.selectedResult.name,this._getDirections()})),s.on("search-focus",(()=>this._handleStopInputFocus(s,e))),s.on("search-blur",(()=>this._handleStopInputBlur(s,e))),s.on("search-clear",(()=>{e.geometry=null,e.name=null,this._activeStop=e,this.viewModel.layer.removeResult()})),d((()=>s.searchTerm),(t=>{e.name=t}))],s),this._stopsToSearches.set(e,s),s}_disposeSearch(e){this._stopsToSearches.has(e)&&(this._stopsToSearches.get(e).destroy(),this._stopsToSearches.delete(e))}_renderManeuver(e){const t="",{directionPoint:s,directionLine:i}=e,{distance:r,duration:o}=i,{messages:n,messagesUnits:l,unit:d}=this,u=C(l,c(r,0),d),h=T(c(o,0)),p=u&&h?`${u}&nbsp;&middot;&nbsp;${h}`:`${u}${h}`,v=this._getFormattedManeuverText(s),{objectId:m,directionPointType:_}=s,g=D(_),y=`esri-directions__maneuver-${m}`,S=`esri-directions__cumulative-costs-${m}`,w=`esri-directions__intermediate-costs-${m}`,M={[I.maneuverActive]:this._activeManeuver===i};return H("li",{"aria-labelledby":`${y} ${S} ${w}`,bind:this,class:this.classes(I.maneuver,M),"data-maneuver":i,key:i,onclick:this._handleManeuverClick,onkeydown:this._handleManeuverClick,onfocus:this._handleManeuverFocus,onmouseover:this._handleManeuverMouseOver,onmouseout:this._handleManeuverMouseOut,onblur:this._handleManeuverBlur,tabIndex:0},a(g)&&H("img",{alt:"",class:I.maneuverIcon,src:g}),H("div",{class:I.maneuverCostsContainer},H("span",{id:y,innerHTML:c(v,"")}),H("div",{class:I.maneuverCosts},H("div",{class:I.horizontalSplitter}),H("div",{id:S,class:I.cumulativeCost,innerHTML:t,title:n.cumulativeCosts}),H("div",{id:w,class:I.intermediateCost,innerHTML:p,title:n.intermediateCosts}))))}_handleManeuverClick(e){const t=e.currentTarget["data-maneuver"];if(this._activeManeuver===t)return this._activeManeuver=null,void this.zoomToRoute();this._activeManeuver=t;const{geometry:s}=t;this.viewModel.centerAt(s),this.viewModel.highlight(t)}_handleManeuverMouseOver(e){if(this._activeManeuver||this._focusedManeuver)return;const t=e.currentTarget["data-maneuver"];this.viewModel.highlight(t)}_handleManeuverMouseOut(){this._activeManeuver||this._focusedManeuver||this.viewModel.clearHighlights()}_handleManeuverBlur(){this._activeManeuver||(this._focusedManeuver=null,this.viewModel.clearHighlights())}_handleManeuverFocus(e){if(this._activeManeuver)return;const t=e.currentTarget["data-maneuver"];this._focusedManeuver=t,this.viewModel.highlight(t)}_getFormattedManeuverText(e){const{displayText:t,name:s,intersectingName:i}=e;if(n(t))return"";let r=t;return a(s)&&r.includes(s)&&(r=r.replace(s,`<strong>${s}</strong>`)),a(i)&&r.includes(i)&&(r=r.replace(i,`<strong>${i}</strong>`)),r}_getCostSummary(){const{messagesUnits:e,unit:t,viewModel:s}=this,{routeInfo:i}=s.layer;if(n(i))return null;const r=c(i.totalDistance,0),o=c(i.totalDuration,0);return{distance:C(e,r,t),duration:T(o)}}async _getDirections(){if(!(this.viewModel.layer.stops.filter((e=>a(e.geometry))).length<2))try{await this.viewModel.getDirections()}catch{}}};e([v()],Q.prototype,"apiKey",null),e([v(g)],Q.prototype,"defaultUnit",void 0),e([v()],Q.prototype,"goToOverride",null),e([v()],Q.prototype,"headingLevel",void 0),e([v()],Q.prototype,"iconClass",void 0),e([v()],Q.prototype,"label",null),e([v({readOnly:!0})],Q.prototype,"lastRoute",null),e([v()],Q.prototype,"layer",null),e([v()],Q.prototype,"maxStops",null),e([v(),E("esri/widgets/Directions/t9n/Directions")],Q.prototype,"messages",void 0),e([v(),E("esri/t9n/common")],Q.prototype,"messagesCommon",void 0),e([v(),E("esri/core/t9n/Units")],Q.prototype,"messagesUnits",void 0),e([v()],Q.prototype,"routeServiceUrl",null),e([v()],Q.prototype,"routeSymbol",null),e([v()],Q.prototype,"searchProperties",void 0),e([v()],Q.prototype,"stopSymbols",null),e([v()],Q.prototype,"unit",null),e([v()],Q.prototype,"view",null),e([v({type:b})],Q.prototype,"viewModel",void 0),e([v()],Q.prototype,"visibleElements",void 0),e([m("visibleElements")],Q.prototype,"castVisibleElements",null),e([x()],Q.prototype,"_handleStopIconClick",null),e([x()],Q.prototype,"_handleClearRouteClick",null),e([x()],Q.prototype,"_handleReverseStops",null),e([x()],Q.prototype,"_handleRemoveStop",null),e([x()],Q.prototype,"_handleSectionToggle",null),e([x()],Q.prototype,"_handleSummaryInteraction",null),e([x()],Q.prototype,"_handleManeuverClick",null),Q=e([_(G)],Q);const X=Q;export{X as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{deprecatedProperty as t}from"../core/deprecate.js";import{on as s,pausable as i}from"../core/events.js";import r from"../core/Handles.js";import o from"../core/Logger.js";import{isNone as n,isSome as a,unwrap as l,unwrapOrValue as c}from"../core/maybe.js";import{watch as d,initial as h,when as u,on as p}from"../core/reactiveUtils.js";import{property as v}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as m}from"../core/accessorSupport/decorators/cast.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as g}from"../properties/defaultUnit.js";import y from"../rest/support/Stop.js";import S from"../symbols/SimpleMarkerSymbol.js";import w from"./Search.js";import M from"./Widget.js";import b from"./Directions/DirectionsViewModel.js";import{SaveLayer as f}from"./Directions/components/SaveLayer.js";import{formatDistance as C,formatDuration as T}from"./Directions/support/directionsUtils.js";import{DepartureTime as k,CSS as I,getIconPath as D}from"./Directions/support/resources.js";import{isArcGISWorldGeocoder as L,meteredArcGISLocatorUrl as P}from"./Search/support/locatorUtils.js";import R from"./support/DatePicker.js";import{Heading as B,incrementHeadingLevel as j}from"./support/Heading.js";import A from"./support/TimePicker.js";import{accessibleHandler as x}from"./support/decorators/accessibleHandler.js";import{messageBundle as E}from"./support/decorators/messageBundle.js";import{tsx as H}from"./support/jsxFactory.js";import"./support/widgetUtils.js";import U from"sortablejs";import{substitute as O}from"../intl/substitute.js";import{formatDate as z,convertDateFormatToIntlOptions as $}from"../intl/date.js";import{formatNumber as F}from"../intl/number.js";const N={departureTime:!0,layerDetails:!0,printButton:!1,saveAsButton:!0,saveButton:!0,stops:!0,traveMode:!0};function V(e){const t=e.getTimezoneOffset(),s=t>0?"-":"+",i=60,r=Math.abs(Math.floor(t/i)),o=Math.abs(Math.floor(t)%i),n={minimumIntegerDigits:2};return`GMT${s}${F(r,n)}${F(o,n)}`}function K(e){return!!e.composedPath?.().find((e=>e.classList?.contains("esri-search__suggestions-list")))}const W={awaitingViewClickStop:"awaiting-view-click-stop"},q=100,Y=500,G="esri.widgets.Directions",J=o.getLogger(G);let Q=class extends M{constructor(e,t){super(e,t),this._autoStopRemovalDelay=q,this._departureTime=k.NOW,this._datePicker=new R,this._handles=new r,this._newPlaceholderStop=null,this._pointerPressedSearchSuggestionStop=null,this._renderSavePopoverFunction=null,this._saveAsButtonNode=null,this._saveLayer=new f,this._sections=null,this._stopsToSearches=new Map,this._timePicker=new A,this.headingLevel=2,this.iconClass=I.widgetIcon,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.searchProperties=null,this.viewModel=new b,this.visibleElements={...N},this._setUpDragAndDropStops=e=>{this._sortable=U.create(e,{draggable:`.${I.validStopRow}`,ghostClass:I.stopRowGhost,handle:`.${I.stopHandle}`,onEnd:this._handleStopInputDragEnd})},this._handleDragHandlePointerDown=()=>this.viewModel.layer.stops.forEach((e=>this._acquireSearch(e).activeMenu="none")),this._handleStopInputDragEnd=({oldIndex:e,newIndex:t,target:s})=>{if(e===t)return;const{children:i}=s,r=i[t],o=i[e],n=t-e<0;s.insertBefore(r,n?o.nextElementSibling:o);const a=this.viewModel.layer.stops;a.reorder(a.getItemAt(e),t);for(const l of a)l.sequence=null;this._getDirections()}}initialize(){this.addHandles([d((()=>this.viewModel.layer.routeInfo),(()=>{this._activeManeuver=null,this._focusedManeuver=null,this._sections=this._getSections(),this.scheduleRender()}),h),u((()=>this.view),((e,t)=>{if(t&&(this._viewClickHandle=null,this._handles.remove(t)),e){const t=this._prepPointerDownUpClick(),i=this._prepViewClick();t.pause(),i.pause(),this._handles.add([s(e.surface,"mousedown",(()=>this._autoStopRemovalDelay=Y)),s(e.surface,"mouseup",(()=>this._autoStopRemovalDelay=q)),t,i],this.view.surface),this._pointerDownUpHandle=t,this._viewClickHandle=i}}),h),u((()=>n(this.viewModel.serviceDescription)),(()=>{try{this.viewModel.load()}catch{}}),h),d((()=>this._saveLayer.state),(()=>{this.scheduleRender()}))]),this.when((()=>{this.destroyed||(this._renderSavePopoverFunction=this._renderSavePopover.bind(this),this._projector.append(document.body,this._renderSavePopoverFunction))}))}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-button.js"),import("@esri/calcite-components/dist/components/calcite-link.js"),import("@esri/calcite-components/dist/components/calcite-popover.js")])}destroy(){this._datePicker.destroy(),this._timePicker.destroy();for(const e of this._stopsToSearches.values())e.destroy();this._sortable&&this._sortable.destroy(),a(this._renderSavePopoverFunction)&&this._projector.detach(this._renderSavePopoverFunction)}get apiKey(){return this.viewModel.apiKey}set apiKey(e){this.viewModel.apiKey=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get lastRoute(){return this.viewModel.lastRoute}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get maxStops(){return this.viewModel.maxStops}set maxStops(e){this.viewModel.maxStops=e}set routeServiceUrl(e){t(J,"routeServiceUrl",{replacement:"viewModel.layer.url",version:"4.24",warnOnce:!0}),this.viewModel.legacyLayer.url=e}get routeServiceUrl(){return t(J,"routeServiceUrl",{replacement:"viewModel.layer.url",version:"4.24",warnOnce:!0}),this.viewModel.legacyLayer.url}set routeSymbol(e){t(J,"routeSymbol",{replacement:"viewModel.layer.defaultSymbols.directionLines",version:"4.24",warnOnce:!0}),this.viewModel.legacyLayer.defaultSymbols.directionLines=e}get routeSymbol(){return t(J,"routeSymbol",{replacement:"viewModel.layer.defaultSymbols.directionLines",version:"4.24",warnOnce:!0}),this.viewModel.legacyLayer.defaultSymbols.directionLines}set stopSymbols(e){t(J,"stopSymbols",{replacement:"viewModel.layer.defaultSymbols.stops",version:"4.24",warnOnce:!0}),this.viewModel.legacyLayer.defaultSymbols.stops=e}get stopSymbols(){return t(J,"stopSymbols",{replacement:"viewModel.layer.defaultSymbols.stops",version:"4.24",warnOnce:!0}),this.viewModel.legacyLayer.defaultSymbols.stops}get unit(){return this.defaultUnit}set unit(e){this._overrideIfSome("unit",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...N,...e}}getDirections(){return this.viewModel.getDirections()}render(){return H("div",{class:this.classes(I.base,I.scroller)},this._renderPanelContent())}save(){return this.viewModel.layer.save()}saveAs(e,t={}){return this.viewModel.layer.saveAs(e,t)}zoomToRoute(){return this.viewModel.zoomToRoute()}_renderPanelContent(){const{viewModel:{serviceDescription:e,state:t}}=this,s="initializing"===t,i="error"===t&&!e,r="unauthenticated"===t,o={[I.panelContentLoading]:s,[I.panelContentError]:i,[I.panelContentSignIn]:r},n=s?"presentation":"group",a=r?this._renderSignIn():i?this._renderMessage(this._getErrorMessage()):s?this._renderLoader():this._renderReadyContent();return H("div",{class:this.classes(I.panelContent,o),role:n},a)}_renderReadyContent(){return[this._renderStopsContainer(),this._renderTravelModeOptions(),this._renderDepartureTimeControls(),this._renderSaveContainer(),this._renderSectionSplitter(),this._renderDirectionsContainer()]}_renderSignIn(){return H("div",{key:"sign-in",class:I.signInContent},H(B,{class:I.contentTitle,level:this.headingLevel},this.messages.widgetLabel),this._renderPlaceholder(),H(B,{level:j(this.headingLevel)},this.messages.signInRequired),H("button",{class:this.classes(I.button,I.buttonSecondary,I.signInButton),tabIndex:0,onclick:this._handleSignInClick,bind:this,type:"button"},this.messagesCommon.auth.signIn))}_handleSignInClick(){this.viewModel.load().catch((()=>{}))}_renderTravelModeOptions(){if(!this.visibleElements.traveMode)return null;const{selectedTravelMode:e,travelModes:t}=this.viewModel;if(0===t.length)return null;const s=a(e)?e.name:this.messages.travelMode;return H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(I.travelMode,this._saveLayer.opened&&I.buttonDisabled),key:"esri-directions__travel-mode-controls",role:"group"},H("select",{"aria-label":s,bind:this,class:this.classes(I.travelModeSelect,I.select),key:"esri-directions__travel-mode-options",onchange:this._handleTravelModeChange,title:s},t.map((t=>{const s=a(e)&&t.id===e.id;return H("option",{key:`esri-directions__travel-mode-${t.id}`,"data-mode":t,selected:s,value:t.id},t.name)}))))}_handleTravelModeChange(e){const t=e.currentTarget,s=t.item(t.selectedIndex);this.viewModel.selectedTravelMode=s["data-mode"],this._getDirections()}_renderStopsContainer(){return this.visibleElements.stops?H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(I.section,this._saveLayer.opened&&I.buttonDisabled),key:"esri-directions__stops-container",role:"group"},this._renderStops()):null}_renderDepartureTimeControls(){if(!this.visibleElements.departureTime)return null;const e=this._departureTime,{messages:t}=this,s=t.departureTime;return H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(I.departureTime,this._saveLayer.opened&&I.buttonDisabled),key:"esri-directions__departure-time-controls",role:"group"},H("select",{"aria-label":s,bind:this,class:this.classes(I.departureTimeSelect,I.select),onchange:this._handleDepartureOptionChange,title:s},H("option",{value:k.NOW,selected:e===k.NOW},t.leaveNow),H("option",{value:k.DEPART_BY,selected:e===k.DEPART_BY},t.departBy),H("option",{value:k.UNSPECIFIED,selected:e===k.UNSPECIFIED},t.timeUnspecified)),e===k.DEPART_BY?this._renderTimeControls():null)}_renderStops(){const e=this.viewModel.layer.stops;let t=0;for(const r of this._stopsToSearches.keys())e.includes(r)||this._disposeSearch(r);for(const r of e){const e=this._acquireSearch(r);"none"!==e.activeMenu&&(t+=1),a(r.name)&&(e.searchTerm=r.name)}const s=e.toArray().map(((s,i)=>{const r=e.length,o=i>1&&n(s.geometry),l={[I.stopsIcon]:i>=0&&i<r-1,[I.lastStopIcon]:i===r-1},c={[I.lastStopIconContainer]:i===r-1},d={[I.validStopRow]:!o},h=e.getItemAt(i+1),u=h&&a(h.geometry),p=i===r-1,v=i===r-2,m=2===r&&0===i||r>2&&!p&&!v||r>2&&v&&u||r>2&&p&&n(s.geometry),_=r<3,g=this._acquireSearch(s),{messages:y}=this,{removeStop:S,reverseStops:w,unlocated:M}=y,b=O(y.stopLabelTemplate,{number:i+1,label:a(s.geometry)?s.name:M}),f=`${this.id}__stop--${i}`,C=!!g.searchTerm&&!!g.selectedResult&&a(s.geometry)&&g.selectedResult.name===s.name,T={zIndex:"none"!==g.activeMenu?""+t--:""};return H("li",{"aria-label":b,afterCreate:this._handleStopFieldCreation,bind:this,class:this.classes(I.stopRow,d),id:f,key:i,"data-stop-index":i,styles:T},H("div",{class:I.stopHandle},H("span",{"aria-hidden":"true",class:this.classes(I.stopIcon,I.handleIcon,I.stopHandleIcon,I.interactiveStopIcon),onpointerdown:this._handleDragHandlePointerDown}),H("div",{bind:this,"aria-labelledby":f,class:this.classes(I.stopIconContainer,c),"data-stop-index":i,onclick:this._handleStopIconClick,onkeydown:this._handleStopIconClick,role:"button"},H("span",{class:this.classes(I.stopIcon,l),tabindex:C?"0":null}))),H("div",{class:I.stopInput},g.render()),H("div",{class:I.stopOptions,role:"group"},H("div",{"aria-label":S,class:I.removeStopButton,bind:this,"data-stop-index":i,hidden:_,onkeydown:this._handleRemoveStop,onclick:this._handleRemoveStop,role:"button",tabIndex:0,title:S},H("span",{"aria-hidden":"true",class:this.classes(I.stopIcon,I.removeStop,I.removeStopIcon,I.interactiveStopIcon)}),H("span",{class:I.screenReaderText},"removeStopTitle")),H("div",{"aria-label":w,class:I.reverseStops,bind:this,hidden:m,onkeydown:this._handleReverseStops,onclick:this._handleReverseStops,role:"button",tabIndex:0,title:w},H("span",{"aria-hidden":"true",class:this.classes(I.stopIcon,I.reverseStopIcon,I.interactiveStopIcon)}),H("span",{class:I.screenReaderText},"removeStopTitle"))))})),i=this._renderAddStop();return H("div",null,H("ol",{class:I.stops,role:"group",afterCreate:this._setUpDragAndDropStops},s),i)}_renderAddStop(){const{stops:e}=this.viewModel.layer,t=e.filter((({geometry:e})=>a(e))),s=e.at(-1);return t.length>1&&t.length<this.maxStops&&a(s)&&a(s.geometry)?H("div",{class:I.toolbarSection},H("div",{class:I.toolbarButtons},H("calcite-button",{appearance:"outline",class:I.addStopButton,color:"neutral","icon-start":"plus",key:I.addStopButton,onclick:()=>{this._addNewPlaceholder()},text:this.messages.addStop,width:"half"},this.messages.addStop))):null}_handleStopIconClick(e){const t=e.currentTarget["data-stop-index"],s=this.viewModel.layer.stops.getItemAt(t);s&&a(s.geometry)&&this._centerAtStop(s)}_handleClearRouteClick(){this.viewModel.reset()}_centerAtStop(e){this.viewModel.centerAt(e)}_handleStopFieldCreation(e){const t=this._newPlaceholderStop;if(!t)return;const s=e["data-stop-index"],i=this.viewModel.layer.stops.getItemAt(s);if(t===i){const e=this._acquireSearch(i);e.when((()=>{this.renderNow(),e.focus()}))}this._newPlaceholderStop=null}_handleStopInputBlur(e,t){if(this._saveLayer.opened)return;this._handles.remove(W.awaitingViewClickStop),this.view.cursor=this._previousCursor;if(!!e.selectedResult&&a(t.geometry)&&a(e.selectedResult?.feature.geometry)&&t.geometry===e.selectedResult?.feature.geometry)return void this._pointerDownUpHandle.pause();const s=n(t.geometry)&&n(e.selectedResult?.feature.geometry),i=a(t.geometry)&&a(e.selectedResult?.feature.geometry)&&t.geometry!==e.selectedResult.feature.geometry;if((s||i)&&"none"===e.activeMenu&&e.searchTerm)return e.search(),void this._pointerDownUpHandle.pause();e.searchTerm||(this._viewClickHandle.resume(),clearTimeout(this._autoStopRemovalTimeoutId),this._autoStopRemovalTimeoutId=setTimeout((()=>{this.destroyed||(this._viewClickHandle.pause(),"searching"!==e.viewModel.state?this._pointerPressedSearchSuggestionStop||(a(t.geometry)&&(t.geometry=null,this._getDirections()),this.scheduleRender()):this._pointerDownUpHandle.pause())}),this._autoStopRemovalDelay))}_handleStopInputFocus(e,t){if(this._pointerDownUpHandle.resume(),this._handles.has(W.awaitingViewClickStop))return;const{view:s,view:{cursor:i}}=this;this._previousCursor=i,this._handles.add(d((()=>e.searchTerm),(t=>{e.destroyed||(s.cursor=0===t.length?"copy":i)}),h),W.awaitingViewClickStop),this._activeStop=t}_prepViewClick(){const{view:e}=this.viewModel,t=i(e,"click",this._handleViewClick.bind(this)),s=i(e.surface,"click",(()=>{clearTimeout(this._autoStopRemovalTimeoutId),s.pause()}));return{remove(){s.remove(),t.remove()},pause(){s.pause(),t.pause()},resume(){s.resume(),t.resume()}}}_prepPointerDownUpClick(){const e=i(document,"pointerdown",(e=>{this._pointerPressedSearchSuggestionStop=K(e)?this._activeStop:null})),t=i(document,"pointerup",(e=>{this._pointerDownUpHandle.pause();const t=K(e),s=this._activeStop;t||s!==this._pointerPressedSearchSuggestionStop||this._removeStop(s),this.scheduleRender(),this._pointerPressedSearchSuggestionStop=t?s:null}));return{remove(){t.remove(),e.remove()},pause(){t.pause(),e.pause()},resume(){e.resume()}}}_handleViewClick(e){const t=this._stopsToSearches.get(this._activeStop);t&&!t.searchTerm&&(t.search(e.mapPoint).then((e=>{const s=e.results[0].results[0],{feature:i,name:r}=s;this._activeStop.geometry=i.geometry,this._activeStop.name=r,t.searchTerm=r})),this.scheduleRender()),this._viewClickHandle.pause(),clearTimeout(this._autoStopRemovalTimeoutId)}_addNewPlaceholder(){if(this._pointerDownUpHandle.pause(),this._newPlaceholderStop)return;const e=new y({symbol:new S});this.viewModel.layer.stops.add(e),this._newPlaceholderStop=e}_handleReverseStops(){this._reverseStops()}_reverseStops(){this.viewModel.layer.stops.reverse();for(const e of this.viewModel.layer.stops)e.sequence=null;this._getDirections()}_handleRemoveStop(e){const t=e.currentTarget["data-stop-index"],s=this.viewModel.layer.stops.getItemAt(t);this._removeStop(s),(a(s.geometry)||n(this.viewModel.layer.routeInfo))&&this._getDirections()}_removeStop(e){this.viewModel.layer.stops.length<=2||(this._disposeSearch(e),this.viewModel.layer.stops.remove(e))}_handleDepartureOptionChange(e){const t=e.currentTarget,s=t.item(t.selectedIndex);s.value===k.NOW?(this._departureTime=k.NOW,this.viewModel.departureTime=k.NOW,this._handles.remove("departure-time-controls"),this._getDirections()):s.value===k.DEPART_BY?(this._departureTime=k.DEPART_BY,this._handles.add(d((()=>[this._datePicker.value,this._timePicker.value]),(()=>{this._updateDepartureTime(),this._getDirections()}),h),"departure-time-controls")):(this._departureTime=k.UNSPECIFIED,this.viewModel.departureTime=null,this._getDirections())}_updateDepartureTime(){const e=this._datePicker.value,t=this._timePicker.value;e&&t&&(this.viewModel.departureTime=new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes()))}_renderTimeControls(){return H("div",{class:I.departureTimeControls,key:"esri-directions__time-controls",role:"group"},this._datePicker.render(),this._timePicker.render())}_renderSectionSplitter(){return H("div",{class:I.sectionSplitter})}_renderSaveContainer(){const{saveButton:e,saveAsButton:t,printButton:s,layerDetails:i}=this.visibleElements;return e||t||s||i?H("div",{class:I.saveSection,key:I.saveSection},this._renderSaveButtons(),this._renderRouteLayerDetailsLink()):null}_renderSaveButtons(){const{saveButton:e,saveAsButton:t,printButton:s}=this.visibleElements;return e||t||s?H("div",{class:I.saveButtons,key:I.saveButtons},this._renderSaveButton(),this._renderSaveAsButton(),this._renderPrintButton()):null}_renderSaveButton(){if(!this.visibleElements.saveButton)return null;const e=this.viewModel.layer.portalItem?.itemControl,t=a(this.viewModel.layer.routeInfo)&&("admin"===e||"update"===e);return H("calcite-button",{appearance:"outline",class:I.saveButton,color:"neutral",disabled:!t,"icon-start":"save",key:I.saveButton,onclick:()=>{this._handleSaveButtonClick()},text:this.messagesCommon.save,width:"full"},this.messagesCommon.save)}_renderSaveAsButton(){if(!this.visibleElements.saveAsButton)return null;const e=n(this.viewModel.layer.routeInfo);return H("div",{class:I.saveAsButtonPopover,key:I.saveAsButtonPopover},H("calcite-button",{afterCreate:e=>{this._saveAsButtonNode=e},appearance:"outline",class:I.saveAsButton,color:"neutral",disabled:e,"icon-start":"duplicate",key:I.saveAsButton,onclick:()=>this._handleSaveAsButtonClick(),text:this.messagesCommon.saveAs,width:"full"},this.messagesCommon.saveAs))}_renderSavePopover(){return H("calcite-popover",{label:this._saveLayer.label,open:this._saveLayer.opened,"overlay-positioning":"fixed",referenceElement:l(this._saveAsButtonNode)},this._saveLayer.render())}_handleSaveAsButtonClick(){this._saveLayer.opened?this._saveLayer.close():this._saveLayer.open(this.viewModel.layer)}_renderPrintButton(){return this.visibleElements.printButton?H("calcite-button",{appearance:"outline",class:I.printButton,color:"neutral","icon-start":"print",key:I.printButton,text:this.messagesCommon.print}):null}_renderRouteLayerDetailsLink(){if(!this.visibleElements.layerDetails)return null;const{portalItem:e}=this.viewModel.layer;if(!e)return null;const{id:t,portal:{url:s}}=e,i=`${s}/home/item.html?id=${t}`;return H("calcite-link",{class:I.layerDetailsLink,href:i,key:I.layerDetailsLink,target:"_blank"},this.messages.viewLayerDetails)}_handleSaveButtonClick(){this.viewModel.layer.save()}_renderDirectionsContainer(){return H("div",{class:this.classes(I.directionsSection,I.section),key:"esri-directions__container"},this._renderDirectionsContainerContent())}_renderLoader(){return H("div",{class:I.loader,key:"loader"})}_renderWarningCard(){return H("div",{class:I.warningCard,role:"alert"},H("div",{class:I.warningHeader},H("span",{class:I.warningIcon,"aria-hidden":"true"}),H(B,{class:I.warningHeading,level:this.headingLevel},this.messagesCommon.warning)),H("div",{class:I.warningMessage},this._getErrorMessage()))}_renderDirectionsContainerContent(){const{viewModel:{layer:e,state:t}}=this,s="routing"===t;return"error"===t?this._renderWarningCard():s?this._renderLoader():a(e.directionLines)?H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(I.summary,this._saveLayer.opened&&I.buttonDisabled),key:"esri-directions__summary",role:"group"},this._renderCosts(),this._renderRouteActions(),this._renderManeuverSections()):H("div",{key:"esri-directions__placeholder",class:I.emptyContent},this._renderPlaceholder(),H(B,{class:I.message,level:this.headingLevel},this.messages.directionsPlaceholder))}_renderPlaceholder(){return H("svg",{class:I.emptyIllustration,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256"},H("path",{fill:"currentcolor",d:"M192 36c-15.477 0-24 6.034-24 16.99v45.822l24 24 24-24v-45.82C216 42.033 207.477 36 192 36zm20 61.155l-20 20-20-20V52.99c0-8.62 6.73-12.99 20-12.99s20 4.37 20 12.99zM192 52a12 12 0 1 0 12 12 12.013 12.013 0 0 0-12-12zm0 20a8 8 0 1 1 8-8 8.008 8.008 0 0 1-8 8zM92 140.99C92 130.035 83.477 124 68 124s-24 6.034-24 16.99v45.822l24 24 24-24zm-4 44.165l-20 20-20-20V140.99c0-8.62 6.73-12.99 20-12.99s20 4.37 20 12.99zM68 140a12 12 0 1 0 12 12 12.013 12.013 0 0 0-12-12zm0 20a8 8 0 1 1 8-8 8.008 8.008 0 0 1-8 8zm84-44h16v4h-16zm-24 80h4v12h-12v-4h8zm0-28h4v16h-4zm0-52h12v4h-8v8h-4zm0 24h4v16h-4zm-36 64h16v4H92z"}))}_renderMessage(e){return H(B,{level:this.headingLevel},e)}_renderRouteActions(){return H("div",{class:I.routeActions},H("button",{"aria-label":this.messages.clearRoute,class:this.classes(I.clearRouteButton,I.button,I.buttonTertiary),tabIndex:0,onclick:this._handleClearRouteClick,bind:this,type:"button"},this.messages.clearRoute))}_getSections(){const{directionPoints:e,directionLines:t,stops:s}=this.viewModel.layer;if(n(e)||n(t))return null;const i=[];let r=null;for(const o of e){const{objectId:e,stopId:l}=o;if(a(l)){const e=s.find((e=>e.objectId===l)),t=0===i.length;(n(r)||r.stop!==e)&&(r={stop:e,directions:[],open:t},i.push(r));continue}if(n(r))continue;const c=t.find((t=>t.directionPointId===e));n(c)||r.directions.push({directionPoint:o,directionLine:c})}return i}_renderManeuverSections(){return n(this._sections)?null:H("div",{class:I.maneuvers,role:"group"},this._sections.map(((e,t)=>{const{open:s}=e;let i;e.directions.length>0&&s&&(i=H("ol",{class:I.maneuverList},e.directions.map((e=>this._renderManeuver(e)))));const r=l(this._sections).length>2,o=t===l(this._sections).length-1,n={[I.collapsibleSection]:r},a={[I.openIcon]:!s,[I.closeIcon]:s};let c;if(r&&!o){const t=s?this.messagesCommon.close:this.messagesCommon.open;c=H("header",{class:this.classes(I.maneuverSectionHeader,I.maneuverSectionToggle),key:I.maneuverSectionHeader},H("div",{"aria-expanded":s.toString(),"aria-label":t,bind:this,class:I.maneuverSectionHeaderButton,"data-maneuver-section":e,onkeydown:this._handleSectionToggle,onclick:this._handleSectionToggle,role:"button",tabIndex:0,title:t},H(B,{class:I.maneuverSectionTitle,level:this.headingLevel},e.stop.name),H("span",{"aria-hidden":"true",class:this.classes(a)})))}else c=H("header",{class:I.maneuverSectionHeader,key:I.maneuverSectionHeader},H(B,{class:I.maneuverSectionTitle,level:this.headingLevel},e.stop.name));return H("section",{class:this.classes(I.maneuverSection,n),key:t},c,i)})))}_handleSectionToggle(e){const t=e.currentTarget["data-maneuver-section"];t.open=!t.open}_renderCosts(){const e=this._getCostSummary(),{directionPoints:t}=this.viewModel.layer;if(n(t)||n(e))return null;const s=t.getItemAt(t.length-1).arrivalTime,{distance:i,duration:r}=e,{eta:o,etaTemplate:l,primaryCosts:c,secondaryCosts:d,zoomToRoute:h}=this.messages,u=$("short-time"),p=a(s)?`<strong>${z(s,u)}</strong>`:null,v=a(s)?`${V(s)}`:null,m=O(l,{time:p,gmt:v});return H("div",{"aria-label":h,bind:this,class:I.directionCosts,onkeydown:this._handleSummaryInteraction,onclick:this._handleSummaryInteraction,role:"button",tabIndex:0,title:h},H("div",{class:I.costsDetails,role:"group"},H("div",{class:I.primaryCosts,title:c},r),H("div",{class:I.verticalSplitter}),H("div",{class:I.secondaryCosts,title:d},i)),H("div",{innerHTML:m,title:o}))}_handleSummaryInteraction(){this._activeManeuver=null,this._focusedManeuver=null,this.viewModel.clearHighlights(),this.zoomToRoute()}_getErrorMessage(){const{messages:e,viewModel:{lastError:t}}=this;if(a(t))switch(t.name){case"directions-view-model:unable-to-route":return e.errors.unableToRoute;case"directions-view-model:service-metadata-unavailable":return e.errors.unableToLoadServiceMetadata}return e.errors.unknownError}_normalizeSearchSources(e){this._overrideDefaultSources(e),this._applyLocatorSourceOverrides(e)}_overrideDefaultSources(e){e.viewModel.defaultSources.forEach((e=>{e.autoNavigate=!1}))}_applyLocatorSourceOverrides({allSources:e}){for(const t of e)"url"in t&&t.url&&(t.locationType??(t.locationType="street"),L(t.url)&&this.apiKey&&null==t.apiKey&&(t.apiKey=this.apiKey,t.url=P))}_acquireSearch(e){const{view:t}=this.viewModel;if(this._stopsToSearches.has(e)){const s=this._stopsToSearches.get(e);return s.view=t,this._overrideDefaultSources(s),s}const s=new w({view:t,resultGraphicEnabled:!1,popupEnabled:!1,...this.searchProperties});return this._normalizeSearchSources(s),this._handles.add([p((()=>s.allSources),"change",(()=>this._normalizeSearchSources(s))),s.on("select-result",(()=>{e.geometry=s.selectedResult.feature.geometry,e.name=s.selectedResult.name,this._getDirections()})),s.on("search-focus",(()=>this._handleStopInputFocus(s,e))),s.on("search-blur",(()=>this._handleStopInputBlur(s,e))),s.on("search-clear",(()=>{e.geometry=null,e.name=null,this._activeStop=e,this.viewModel.layer.removeResult()})),d((()=>s.searchTerm),(t=>{e.name=t}))],s),this._stopsToSearches.set(e,s),s}_disposeSearch(e){this._stopsToSearches.has(e)&&(this._stopsToSearches.get(e).destroy(),this._stopsToSearches.delete(e))}_renderManeuver(e){const{directionPoint:t,directionLine:s}=e,{distance:i,duration:r}=s,{messages:o,messagesUnits:n,unit:l}=this,d=C(n,c(i,0),l),h=T(c(r,0)),u=d&&h?`${d}&nbsp;&middot;&nbsp;${h}`:`${d}${h}`,p=this._getFormattedManeuverText(t),{objectId:v,directionPointType:m}=t,_=D(m),g=`esri-directions__maneuver-${v}`,y=`esri-directions__intermediate-costs-${v}`,S={[I.maneuverActive]:this._activeManeuver===s};return H("li",{"aria-labelledby":`${g} ${y}`,bind:this,class:this.classes(I.maneuver,S),"data-maneuver":s,key:s,onclick:this._handleManeuverClick,onkeydown:this._handleManeuverClick,onfocus:this._handleManeuverFocus,onmouseover:this._handleManeuverMouseOver,onmouseout:this._handleManeuverMouseOut,onblur:this._handleManeuverBlur,tabIndex:0},a(_)&&H("img",{alt:"",class:I.maneuverIcon,src:_}),H("div",{class:I.maneuverCostsContainer},H("span",{id:g,innerHTML:c(p,"")}),H("div",{class:I.maneuverCosts},H("div",{class:I.horizontalSplitter}),H("div",{"aria-hidden":"true",id:y,class:I.intermediateCost,innerHTML:u,title:o.intermediateCosts}))))}_handleManeuverClick(e){const t=e.currentTarget["data-maneuver"];if(this._activeManeuver===t)return this._activeManeuver=null,void this.zoomToRoute();this._activeManeuver=t;const{geometry:s}=t;this.viewModel.centerAt(s),this.viewModel.highlight(t)}_handleManeuverMouseOver(e){if(this._activeManeuver||this._focusedManeuver)return;const t=e.currentTarget["data-maneuver"];this.viewModel.highlight(t)}_handleManeuverMouseOut(){this._activeManeuver||this._focusedManeuver||this.viewModel.clearHighlights()}_handleManeuverBlur(){this._activeManeuver||(this._focusedManeuver=null,this.viewModel.clearHighlights())}_handleManeuverFocus(e){if(this._activeManeuver)return;const t=e.currentTarget["data-maneuver"];this._focusedManeuver=t,this.viewModel.highlight(t)}_getFormattedManeuverText(e){const{displayText:t,name:s,intersectingName:i}=e;if(n(t))return"";let r=t;return a(s)&&r.includes(s)&&(r=r.replace(s,`<strong>${s}</strong>`)),a(i)&&r.includes(i)&&(r=r.replace(i,`<strong>${i}</strong>`)),r}_getCostSummary(){const{messagesUnits:e,unit:t,viewModel:s}=this,{routeInfo:i}=s.layer;if(n(i))return null;const r=c(i.totalDistance,0),o=c(i.totalDuration,0);return{distance:C(e,r,t),duration:T(o)}}async _getDirections(){if(!(this.viewModel.layer.stops.filter((e=>a(e.geometry))).length<2))try{await this.viewModel.getDirections()}catch{}}};e([v()],Q.prototype,"apiKey",null),e([v(g)],Q.prototype,"defaultUnit",void 0),e([v()],Q.prototype,"goToOverride",null),e([v()],Q.prototype,"headingLevel",void 0),e([v()],Q.prototype,"iconClass",void 0),e([v()],Q.prototype,"label",null),e([v({readOnly:!0})],Q.prototype,"lastRoute",null),e([v()],Q.prototype,"layer",null),e([v()],Q.prototype,"maxStops",null),e([v(),E("esri/widgets/Directions/t9n/Directions")],Q.prototype,"messages",void 0),e([v(),E("esri/t9n/common")],Q.prototype,"messagesCommon",void 0),e([v(),E("esri/core/t9n/Units")],Q.prototype,"messagesUnits",void 0),e([v()],Q.prototype,"routeServiceUrl",null),e([v()],Q.prototype,"routeSymbol",null),e([v()],Q.prototype,"searchProperties",void 0),e([v()],Q.prototype,"stopSymbols",null),e([v()],Q.prototype,"unit",null),e([v()],Q.prototype,"view",null),e([v({type:b})],Q.prototype,"viewModel",void 0),e([v()],Q.prototype,"visibleElements",void 0),e([m("visibleElements")],Q.prototype,"castVisibleElements",null),e([x()],Q.prototype,"_handleStopIconClick",null),e([x()],Q.prototype,"_handleClearRouteClick",null),e([x()],Q.prototype,"_handleReverseStops",null),e([x()],Q.prototype,"_handleRemoveStop",null),e([x()],Q.prototype,"_handleSectionToggle",null),e([x()],Q.prototype,"_handleSummaryInteraction",null),e([x()],Q.prototype,"_handleManeuverClick",null),Q=e([_(G)],Q);const X=Q;export{X 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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import s from"../../../core/Accessor.js";import o from"../../../core/Handles.js";import{isNone as r,unwrapOr as i,isSome as a}from"../../../core/maybe.js";import{watch as l,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{throttle as c}from"../../../core/throttle.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{b as m}from"../../../chunks/vec4f64.js";import f from"../../../geometry/Polyline.js";import{OutlineVisualElement as d}from"../../../views/3d/interactive/visualElements/OutlineVisualElement.js";import{getConfig as u}from"./constants.js";const v=100;let y=class extends s{constructor(e){super(e),this._chartData=null,this._visualElements=[],this._handles=new o}initialize(){const e=c((e=>{this._update(e)}),v);this._handles.add([l((()=>({spatialReference:this.view.spatialReference,chartData:this._chartData})),e,n),e])}destroy(){this._handles.destroy(),this._destroyVisualElements()}remove(){this._destroyVisualElements()}update(e){this._chartData=e}_update(e){const{chartData:s}=e;if(r(s))return this.remove();if(!s.refined)return;const o=this._visualElements,i=s.lines.filter((e=>e.viewVisualizationEnabled)),a=i.length;for(;o.length>a;)o.pop().destroy();const l=u().profileLinesStyle3D;for(;o.length<a;){const e=new d({view:this.view,elevationInfo:{mode:"absolute-height",offset:0},innerWidth:l.width-l.outlineSize,width:l.width,falloff:l.falloff,color:l.outlineColor,renderOccluded:l.renderOccluded});o.push(e)}const n=e.spatialReference;for(let r=0;r<a;++r){const e=o[r],s=i[a-1-r];e.geometry=this._createLineGeometry(s,n),e.innerColor=m(t.toUnitRGBA(s.color))}}_createLineGeometry(e,t){const s=i(e.samples,[]),o=s.length-1,l=[];let n=[];for(let i=0;i<=o;i++){const{x:e,y:t,z:c}=s[i];a(c)&&n.push([e,t,c]),(i===o||r(c))&&n.length&&(l.push(n),n=[])}return new f({paths:l,hasZ:!0,spatialReference:t})}_destroyVisualElements(){this._visualElements.forEach((e=>e.destroy())),this._visualElements.length=0}};e([h()],y.prototype,"view",void 0),e([h()],y.prototype,"_chartData",void 0),y=e([p("esri.widgets.ElevationProfile.support.ProfileLines3D")],y);export{y as ProfileLines3D};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import s from"../../../core/Accessor.js";import o from"../../../core/Handles.js";import{isNone as r,unwrapOr as i,isSome as a}from"../../../core/maybe.js";import{watch as l,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{throttle as c}from"../../../core/throttle.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{a as m}from"../../../chunks/vec4f64.js";import f from"../../../geometry/Polyline.js";import{OutlineVisualElement as d}from"../../../views/3d/interactive/visualElements/OutlineVisualElement.js";import{getConfig as u}from"./constants.js";const v=100;let y=class extends s{constructor(e){super(e),this._chartData=null,this._visualElements=[],this._handles=new o}initialize(){const e=c((e=>{this._update(e)}),v);this._handles.add([l((()=>({spatialReference:this.view.spatialReference,chartData:this._chartData})),e,n),e])}destroy(){this._handles.destroy(),this._destroyVisualElements()}remove(){this._destroyVisualElements()}update(e){this._chartData=e}_update(e){const{chartData:s}=e;if(r(s))return this.remove();if(!s.refined)return;const o=this._visualElements,i=s.lines.filter((e=>e.viewVisualizationEnabled)),a=i.length;for(;o.length>a;)o.pop().destroy();const l=u().profileLinesStyle3D;for(;o.length<a;){const e=new d({view:this.view,elevationInfo:{mode:"absolute-height",offset:0},innerWidth:l.width-l.outlineSize,width:l.width,falloff:l.falloff,color:l.outlineColor,renderOccluded:l.renderOccluded});o.push(e)}const n=e.spatialReference;for(let r=0;r<a;++r){const e=o[r],s=i[a-1-r];e.geometry=this._createLineGeometry(s,n),e.innerColor=m(t.toUnitRGBA(s.color))}}_createLineGeometry(e,t){const s=i(e.samples,[]),o=s.length-1,l=[];let n=[];for(let i=0;i<=o;i++){const{x:e,y:t,z:c}=s[i];a(c)&&n.push([e,t,c]),(i===o||r(c))&&n.length&&(l.push(n),n=[])}return new f({paths:l,hasZ:!0,spatialReference:t})}_destroyVisualElements(){this._visualElements.forEach((e=>e.destroy())),this._visualElements.length=0}};e([h()],y.prototype,"view",void 0),e([h()],y.prototype,"_chartData",void 0),y=e([p("esri.widgets.ElevationProfile.support.ProfileLines3D")],y);export{y as ProfileLines3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{convertUnit as e}from"../../../core/unitUtils.js";import{b as i}from"../../../chunks/vec4f64.js";import{RenderOccludedFlag as o}from"../../../views/3d/webgl-engine/lib/Material.js";var t,a;!function(e){e.Disabled="disabled",e.Ready="ready",e.Creating="creating",e.Created="created",e.Selecting="selecting",e.Selected="selected"}(t||(t={})),function(e){e.NoValidInput="no-valid-input",e.NoVisibleProfiles="no-visible-profiles",e.InvalidGeometry="invalid-geometry",e.TooComplex="too-complex",e.InvalidElevationInfo="invalid-elevation-info",e.UnknownError="unknown-error",e.RefinedButNoChartData="refined-but-no-chart-data",e.None="none"}(a||(a={}));let l={noDataValue:-5e5,defaultQueryOptions:()=>({noDataValue:l.noDataValue,demResolution:"auto",maximumAutoTileRequests:150,ignoreInvisibleLayers:!0}),updateThrottleMillis:100,delayAfterPreviewMillis:500,defaultDemResolution:e(10,"centimeters","meters"),densificationMaxSamples:3e3,largeChartSamples:1e4,maxTotalSamples:1e5,maxChartRatio:300,minSlopeSampleDistance:10,formatPrecision:1,portraitModePixelBreakpoint:400,profileLinesStyle3D:{width:3,outlineSize:0,falloff:0,outlineColor:i([1,1,1,0]),renderOccluded:o.Opaque},hoveredPointsStyle:{size:14,borderStyle:"solid",borderWidth:3,borderColor:"#ffffff",boxShadow:"0px 0px 0px 5px rgba(255,255,255,0.2)"}};function n(){return l}function r(e){l=e}const s=" ― ",d={progress:1,hasZ:!1,samples:[],statistics:null,spatialReference:null};export{d as ERROR_RESULT,a as ElevationProfileErrorState,t as ElevationProfileState,s as NOT_AVAILABLE,n as getConfig,r as setConfig};
5
+ import{convertUnit as e}from"../../../core/unitUtils.js";import{a as i}from"../../../chunks/vec4f64.js";import{RenderOccludedFlag as o}from"../../../views/3d/webgl-engine/lib/Material.js";var t,a;!function(e){e.Disabled="disabled",e.Ready="ready",e.Creating="creating",e.Created="created",e.Selecting="selecting",e.Selected="selected"}(t||(t={})),function(e){e.NoValidInput="no-valid-input",e.NoVisibleProfiles="no-visible-profiles",e.InvalidGeometry="invalid-geometry",e.TooComplex="too-complex",e.InvalidElevationInfo="invalid-elevation-info",e.UnknownError="unknown-error",e.RefinedButNoChartData="refined-but-no-chart-data",e.None="none"}(a||(a={}));let l={noDataValue:-5e5,defaultQueryOptions:()=>({noDataValue:l.noDataValue,demResolution:"auto",maximumAutoTileRequests:150,ignoreInvisibleLayers:!0}),updateThrottleMillis:100,delayAfterPreviewMillis:500,defaultDemResolution:e(10,"centimeters","meters"),densificationMaxSamples:3e3,largeChartSamples:1e4,maxTotalSamples:1e5,maxChartRatio:300,minSlopeSampleDistance:10,formatPrecision:1,portraitModePixelBreakpoint:400,profileLinesStyle3D:{width:3,outlineSize:0,falloff:0,outlineColor:i([1,1,1,0]),renderOccluded:o.Opaque},hoveredPointsStyle:{size:14,borderStyle:"solid",borderWidth:3,borderColor:"#ffffff",boxShadow:"0px 0px 0px 5px rgba(255,255,255,0.2)"}};function n(){return l}function r(e){l=e}const s=" ― ",d={progress:1,hasZ:!1,samples:[],statistics:null,spatialReference:null};export{d as ERROR_RESULT,a as ElevationProfileErrorState,t as ElevationProfileState,s as NOT_AVAILABLE,n as getConfig,r as setConfig};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{ClonableMixin as o}from"../../../core/Clonable.js";import l from"../../../core/Collection.js";import{HandleOwnerMixin as s}from"../../../core/HandleOwner.js";import{IdentifiableMixin as a}from"../../../core/Identifiable.js";import{ignoreAbortErrors as i}from"../../../core/promiseUtils.js";import{watch as u,initial as n}from"../../../core/reactiveUtils.js";import{throttle as h}from"../../../core/throttle.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../rest/support/RelationshipQuery.js";import{findRelatedLayer as c}from"../support/featureUtils.js";const C=1;let _=class extends(o(a(s(r)))){constructor(e){super(e),this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await i(this._query()),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._cancelQueryFeatureCount();const e=new AbortController;this._queryFeatureCountAbortController=e,await i(this._queryFeatureCount()),this._queryFeatureCountAbortController===e&&(this._queryFeatureCountAbortController=null)},this._queryPageController=async()=>{const e=new AbortController;this._queryPageAbortController=e,await i(this._queryPage()),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryThrottled=h(this._queryController,C,this),this._queryFeatureCountThrottled=h(this._queryFeatureCountController,C,this),this._queryPageThrottled=h(this._queryPageController,C,this),this._query=async()=>{const{_queryAbortController:e,relatedFeatures:t}=this;this._destroyRelatedFeatureViewModels(),this.featurePage=1,t.removeAll(),t.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:e?.signal})))},this.handles.add([u((()=>[this.displayCount,this.graphic,this.layer,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled]),(()=>this._queryThrottled()),n),u((()=>[this.featurePage,this.showAllEnabled]),(()=>this._queryPageThrottled())),u((()=>[this.layer,this.relationshipId,this.objectId]),(()=>this._queryFeatureCountThrottled()))])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.removeAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:r}=this,o=1,l=Math.ceil(r/t)||1;this._set("featurePage",Math.min(Math.max(e,o),l))}get featurePage(){return this._get("featurePage")}set displayCount(e){const t=0,r=10;this._set("displayCount",Math.min(Math.max(e,t),r))}get displayCount(){return this._get("displayCount")}get objectId(){return this.graphic?.attributes?.[this.objectIdField]??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new l}get relationship(){return this.layer?.relationships?.find((({id:e})=>e===this.relationshipId))??null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new l}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,graphic:o,layer:l,relationshipId:s,map:a}=this;return t?"loading":e||r?"querying":o&&l&&"number"==typeof s&&a?"ready":"disabled"}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.forEach((e=>!e.destroyed&&e.destroy())),this.relatedFeatureViewModels.removeAll()}async _queryFeatureCount(){const{layer:e,relationshipId:t,objectId:r,_queryFeatureCountAbortController:o}=this;if(await(e?.load()),"number"!=typeof r||!e?.capabilities?.queryRelated?.supportsCount)return void this._set("featureCount",0);const l=e.capabilities?.queryRelated?.supportsCacheHint??!1,s=new p({cacheHint:l,relationshipId:t,returnGeometry:!1,objectIds:[r]}),a=await e.queryRelatedFeaturesCount(s,{signal:o?.signal});this._set("featureCount",a[r]||0)}_sliceFeatures(e){const{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:o}=this;!r||t<2||e.addMany(await this._queryRelatedFeatures({signal:o?.signal}))}async _queryRelatedFeatures(e){const{orderByFields:t,showAllEnabled:r,featuresPerPage:o,displayCount:l,layer:s,relationshipId:a,featurePage:i,featureCount:u,map:n,objectIdField:h}=this;await(s?.load());const{relationship:d,objectId:y}=this;if(!d||"number"!=typeof y||!s?.capabilities?.queryRelated?.supportsPagination)return[];const C=r?((i-1)*o+u)%u:0,_=r?o:l,b=[...t?.map((e=>e.field)),h],g=t?.map((e=>`${e.field} ${e.order}`)),q=s.capabilities?.queryRelated?.supportsCacheHint||!1,F=new p({orderByFields:g,start:C,num:_,outFields:b,cacheHint:q,relationshipId:a,returnGeometry:!1,objectIds:[y]}),m=(await s.queryRelatedFeatures(F,{signal:e?.signal}))[y]?.features||[],f=c(n,s,d);return f&&m.forEach((e=>e.sourceLayer=f)),m}};e([d()],_.prototype,"_queryAbortController",void 0),e([d()],_.prototype,"_queryPageAbortController",void 0),e([d()],_.prototype,"_queryFeatureCountAbortController",void 0),e([d({value:1})],_.prototype,"featurePage",null),e([d()],_.prototype,"featuresPerPage",void 0),e([d()],_.prototype,"description",void 0),e([d({value:3})],_.prototype,"displayCount",null),e([d({type:t})],_.prototype,"graphic",void 0),e([d()],_.prototype,"layer",void 0),e([d()],_.prototype,"map",void 0),e([d({readOnly:!0})],_.prototype,"objectId",null),e([d({readOnly:!0})],_.prototype,"objectIdField",null),e([d()],_.prototype,"orderByFields",void 0),e([d({readOnly:!0})],_.prototype,"relatedFeatures",null),e([d({readOnly:!0})],_.prototype,"relationship",null),e([d({readOnly:!0})],_.prototype,"featureCount",void 0),e([d({readOnly:!0})],_.prototype,"relatedFeatureViewModels",null),e([d()],_.prototype,"relationshipId",void 0),e([d()],_.prototype,"showAllEnabled",void 0),e([d({readOnly:!0})],_.prototype,"state",null),e([d()],_.prototype,"title",void 0),_=e([y("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],_);const b=_;export{b as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{ClonableMixin as o}from"../../../core/Clonable.js";import l from"../../../core/Collection.js";import{HandleOwnerMixin as s}from"../../../core/HandleOwner.js";import{IdentifiableMixin as a}from"../../../core/Identifiable.js";import{ignoreAbortErrors as i}from"../../../core/promiseUtils.js";import{watch as n,initial as u}from"../../../core/reactiveUtils.js";import{throttle as d}from"../../../core/throttle.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../rest/support/RelationshipQuery.js";import{getFixedFieldName as c,findRelatedLayer as C}from"../support/featureUtils.js";const _=100;let g=class extends(o(a(s(r)))){constructor(e){super(e),this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await i(this._query()),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._cancelQueryFeatureCount();const e=new AbortController;this._queryFeatureCountAbortController=e,await i(this._queryFeatureCount()),this._queryFeatureCountAbortController===e&&(this._queryFeatureCountAbortController=null)},this._queryPageController=async()=>{const e=new AbortController;this._queryPageAbortController=e,await i(this._queryPage()),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryThrottled=d(this._queryController,_,this),this._queryFeatureCountThrottled=d(this._queryFeatureCountController,_,this),this._queryPageThrottled=d(this._queryPageController,_,this),this._query=async()=>{const{_queryAbortController:e,relatedFeatures:t}=this;this._destroyRelatedFeatureViewModels(),this.featurePage=1,t.removeAll(),t.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:e?.signal})))},this.handles.add([n((()=>[this.displayCount,this.graphic,this.layer,this.map,this.orderByFieldsFixedCasing,this.relationshipId,this.featuresPerPage,this.showAllEnabled]),(()=>this._queryThrottled()),u),n((()=>[this.featurePage,this.showAllEnabled]),(()=>this._queryPageThrottled())),n((()=>[this.layer,this.relationshipId,this.objectId]),(()=>this._queryFeatureCountThrottled()))])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.removeAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:r}=this,o=1,l=Math.ceil(r/t)||1;this._set("featurePage",Math.min(Math.max(e,o),l))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map((e=>{const r=e.clone(),o=c(e.field,t);return r.field=o,r})):e}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing?.[0]?.field||null}set displayCount(e){const t=0,r=10;this._set("displayCount",Math.min(Math.max(e,t),r))}get displayCount(){return this._get("displayCount")}get objectId(){return this.graphic?.attributes?.[this.objectIdField]??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new l}get relatedLayer(){const{layer:e,map:t,relationship:r}=this;return e?.loaded?C(t,e,r):null}get relationship(){return this.layer?.relationships?.find((({id:e})=>e===this.relationshipId))??null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new l}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,graphic:o,layer:l,relationshipId:s,map:a}=this;return t?"loading":e||r?"querying":o&&l&&"number"==typeof s&&a?"ready":"disabled"}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.forEach((e=>!e.destroyed&&e.destroy())),this.relatedFeatureViewModels.removeAll()}async _queryFeatureCount(){const{layer:e,relationshipId:t,objectId:r,_queryFeatureCountAbortController:o}=this;if(await(e?.load()),"number"!=typeof r||!e?.capabilities?.queryRelated?.supportsCount)return void this._set("featureCount",0);const l=e.capabilities?.queryRelated?.supportsCacheHint??!1,s=new p({cacheHint:l,relationshipId:t,returnGeometry:!1,objectIds:[r]}),a=await e.queryRelatedFeaturesCount(s,{signal:o?.signal});this._set("featureCount",a[r]||0)}_sliceFeatures(e){const{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:o}=this;!r||t<2||e.addMany(await this._queryRelatedFeatures({signal:o?.signal}))}async _queryRelatedFeatures(e){const{orderByFieldsFixedCasing:t,showAllEnabled:r,featuresPerPage:o,displayCount:l,layer:s,relationshipId:a,featurePage:i,featureCount:n,relatedLayer:u,objectIdField:d}=this;await(s?.load());const{relationship:y,objectId:h}=this;if(!y||"number"!=typeof h||!s?.capabilities?.queryRelated?.supportsPagination)return[];const c=r?((i-1)*o+n)%n:0,C=r?o:l;if(!u)return[];await u.load();const _=[...t?.map((e=>e.field)),d],g=t?.map((e=>`${e.field} ${e.order}`)),b=s.capabilities?.queryRelated?.supportsCacheHint||!1,F=new p({orderByFields:g,start:c,num:C,outFields:_,cacheHint:b,relationshipId:a,returnGeometry:!1,objectIds:[h]}),m=(await s.queryRelatedFeatures(F,{signal:e?.signal}))[h]?.features||[];return m.forEach((e=>e.sourceLayer=u)),m}};e([y()],g.prototype,"_queryAbortController",void 0),e([y()],g.prototype,"_queryPageAbortController",void 0),e([y()],g.prototype,"_queryFeatureCountAbortController",void 0),e([y({value:1})],g.prototype,"featurePage",null),e([y()],g.prototype,"featuresPerPage",void 0),e([y({readOnly:!0})],g.prototype,"orderByFieldsFixedCasing",null),e([y()],g.prototype,"description",void 0),e([y({readOnly:!0})],g.prototype,"itemDescriptionFieldName",null),e([y({value:3})],g.prototype,"displayCount",null),e([y({type:t})],g.prototype,"graphic",void 0),e([y()],g.prototype,"layer",void 0),e([y()],g.prototype,"map",void 0),e([y({readOnly:!0})],g.prototype,"objectId",null),e([y({readOnly:!0})],g.prototype,"objectIdField",null),e([y()],g.prototype,"orderByFields",void 0),e([y({readOnly:!0})],g.prototype,"relatedFeatures",null),e([y({readOnly:!0})],g.prototype,"relatedLayer",null),e([y({readOnly:!0})],g.prototype,"relationship",null),e([y({readOnly:!0})],g.prototype,"featureCount",void 0),e([y({readOnly:!0})],g.prototype,"relatedFeatureViewModels",null),e([y()],g.prototype,"relationshipId",void 0),e([y()],g.prototype,"showAllEnabled",void 0),e([y({readOnly:!0})],g.prototype,"state",null),e([y()],g.prototype,"title",void 0),g=e([h("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],g);const b=g;export{b 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.25/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 r}from"../../core/promiseUtils.js";import{watch as s,initial as i,on as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{cast as a}from"../../core/accessorSupport/decorators/cast.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{isRTL as h}from"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as m}from"../support/jsxFactory.js";import{substitute as v}from"../../intl/substitute.js";const f={base:"esri-feature-relationship",esriWidget:"esri-widget",noRelatedFeatures:"esri-feature__no-related-features-message",listContainer:"esri-feature-relationship__list",featureObserver:"esri-feature__feature-observer",stickySpinnerContainer:"esri-feature__sticky-loading-container",loadingSpinnerContainer:"esri-feature__loading-container",spinner:"esri-feature__loading-spinner",iconLoading:"esri-icon-loading-indicator esri-rotating"},g={title:!0,description:!0};let b=class extends d{constructor(e,t){super(e,t),this._featureElementInfo=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={...g},this._increaseFeaturePage=()=>{const{state:e,showAllEnabled:t,relatedFeatures:r,featuresPerPage:s,featurePage:i}=this.viewModel;"ready"===e&&t&&r.length>=s*i&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new u,this.addHandles([s((()=>[this.viewModel.description,this.viewModel.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),i),s((()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode]),(()=>this._handleRelatedFeatureObserverChange())),o((()=>this.viewModel.relatedFeatureViewModels),"change",(()=>this._setupRelatedFeatureViewModels()))])}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-list.js"),import("@esri/calcite-components/dist/components/calcite-list-item.js"),import("@esri/calcite-components/dist/components/calcite-icon.js")])}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=t(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return v(1===t?e?.numberRecord:e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...g,...e}}renderStickyLoading(){return m("div",{key:"sticky-loader",class:f.stickySpinnerContainer},this.renderLoadingIcon())}renderLoadingIcon(){return m("span",{class:this.classes(f.iconLoading,f.spinner)})}renderLoading(){return m("div",{key:"loading-container",class:f.loadingSpinnerContainer},this.renderLoadingIcon())}renderShowAllIconNode(){return m("calcite-icon",{scale:"s",icon:"list",slot:"content-end"})}renderChevronIconNode(){const e=h(this.container)?"chevron-left":"chevron-right";return m("calcite-icon",{scale:"s",icon:e,slot:"content-end"})}renderRelatedFeature(e){const{orderByFields:t}=this.viewModel,r=t?.[0].field,s=e.title,i=r&&e.formattedAttributes?.global[r];e.description=i;const o="loading"===e.state;return m("calcite-list-item",{key:e.uid,label:o?`${this.messagesCommon?.loading}…`:s,description:o?"…":i,onclick:()=>this.emit("select-record",{featureViewModel:e})},this.renderChevronIconNode())}renderRelatedFeatures(){const{messages:e,featureCountDescription:t}=this,{featureCount:r,showAllEnabled:s,relatedFeatureViewModels:i,state:o,displayCount:n}=this.viewModel;if(!r)return m("div",{key:"no-related-features-message",class:f.noRelatedFeatures},e?.noRelatedFeatures);const a=!s&&(r>n||0===n)?m("calcite-list-item",{key:"show-all-item",label:e.showAll,description:t,onclick:()=>this.emit("show-all-records")},this.renderShowAllIconNode()):null;return m("div",{key:"list-container",class:f.listContainer},m("calcite-list",null,i.toArray().map((e=>this.renderRelatedFeature(e))),a),"querying"===o?this.renderStickyLoading():null,m("div",{key:"feature-observer",class:f.featureObserver,bind:this,afterCreate:this._relatedFeatureIntersectionObserverCreated}))}render(){const{state:e}=this.viewModel;return m("div",{class:this.classes(f.base,f.esriWidget)},this._featureElementInfo?.render(),"loading"===e?this.renderLoading():"disabled"===e?null:this.renderRelatedFeatures())}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach((e=>{this.addHandles(s((()=>[e.title,e.state]),(()=>this.scheduleRender()),i),t)})),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,r=t.description&&this.description,s=t.title&&this.title;this._featureElementInfo.set({description:r,title:s,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await r(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()],b.prototype,"_relatedFeatureIntersectionObserverNode",void 0),e([n()],b.prototype,"description",null),e([n({readOnly:!0})],b.prototype,"featureCountDescription",null),e([n()],b.prototype,"headingLevel",void 0),e([n()],b.prototype,"title",null),e([n({type:c})],b.prototype,"viewModel",void 0),e([n(),p("esri/widgets/Feature/t9n/Feature")],b.prototype,"messages",void 0),e([n(),p("esri/t9n/common")],b.prototype,"messagesCommon",void 0),e([n()],b.prototype,"visibleElements",void 0),e([a("visibleElements")],b.prototype,"castVisibleElements",null),b=e([l("esri.widgets.Feature.FeatureRelationship")],b);const w=b;export{w 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 r}from"../../core/promiseUtils.js";import{watch as s,initial as i,on as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{cast as a}from"../../core/accessorSupport/decorators/cast.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{isRTL as h}from"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as m}from"../support/jsxFactory.js";import{substitute as v}from"../../intl/substitute.js";const g={base:"esri-feature-relationship",esriWidget:"esri-widget",noRelatedFeatures:"esri-feature__no-related-features-message",listContainer:"esri-feature-relationship__list",listContainerQuerying:"esri-feature-relationship__list--querying",featureObserver:"esri-feature__feature-observer",stickySpinnerContainer:"esri-feature__sticky-loading-container",loadingSpinnerContainer:"esri-feature__loading-container",spinner:"esri-feature__loading-spinner",iconLoading:"esri-icon-loading-indicator esri-rotating"},f={title:!0,description:!0};let b=class extends d{constructor(e,t){super(e,t),this._featureElementInfo=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={...f},this._increaseFeaturePage=()=>{const{state:e,showAllEnabled:t,relatedFeatures:r,featuresPerPage:s,featurePage:i}=this.viewModel;"ready"===e&&t&&r.length>=s*i&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new u,this.addHandles([s((()=>[this.viewModel.description,this.viewModel.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),i),s((()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode]),(()=>this._handleRelatedFeatureObserverChange())),o((()=>this.viewModel.relatedFeatureViewModels),"change",(()=>this._setupRelatedFeatureViewModels()))])}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-list.js"),import("@esri/calcite-components/dist/components/calcite-list-item.js"),import("@esri/calcite-components/dist/components/calcite-icon.js")])}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=t(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return v(1===t?e?.numberRecord:e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...f,...e}}renderStickyLoading(){return"querying"===this.viewModel.state?m("div",{key:"sticky-loader",class:g.stickySpinnerContainer},this.renderLoadingIcon()):null}renderLoadingIcon(){return m("span",{class:this.classes(g.iconLoading,g.spinner)})}renderLoading(){return m("div",{key:"loading-container",class:g.loadingSpinnerContainer},this.renderLoadingIcon())}renderShowAllIconNode(){return m("calcite-icon",{scale:"s",icon:"list",slot:"content-end"})}renderChevronIconNode(){const e=h(this.container)?"chevron-left":"chevron-right";return m("calcite-icon",{scale:"s",icon:e,slot:"content-end"})}renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,r=e.title;e.description=t&&e.formattedAttributes?.global[t];const s="loading"===e.state;return m("calcite-list-item",{key:e.uid,label:s?`${this.messagesCommon?.loading}…`:r,description:s?"…":e.description,onclick:()=>this.emit("select-record",{featureViewModel:e})},this.renderChevronIconNode())}renderRelatedFeatures(){const{messages:e,featureCountDescription:t,viewModel:r}=this,{featureCount:s,showAllEnabled:i,relatedFeatureViewModels:o,state:n,displayCount:a}=r,l=s>a||0===a,d=l||o.length,c=!i&&l?m("calcite-list-item",{key:"show-all-item",label:e.showAll,description:t,onclick:()=>this.emit("show-all-records")},this.renderShowAllIconNode()):null,u=d?m("calcite-list",null,o.toArray().map((e=>this.renderRelatedFeature(e))),c):"ready"===n?m("div",{key:"no-related-features-message",class:g.noRelatedFeatures},e?.noRelatedFeatures):null,h=m("div",{key:"feature-observer",class:g.featureObserver,bind:this,afterCreate:this._relatedFeatureIntersectionObserverCreated});return m("div",{key:"list-container",class:this.classes(g.listContainer,{[g.listContainerQuerying]:"querying"===n})},u,this.renderStickyLoading(),h)}render(){const{state:e}=this.viewModel;return m("div",{class:this.classes(g.base,g.esriWidget)},this._featureElementInfo?.render(),"loading"===e?this.renderLoading():"disabled"===e?null:this.renderRelatedFeatures())}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach((e=>{this.addHandles(s((()=>[e.title,e.state]),(()=>this.scheduleRender()),i),t)})),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,r=t.description&&this.description,s=t.title&&this.title;this._featureElementInfo.set({description:r,title:s,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await r(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()],b.prototype,"_relatedFeatureIntersectionObserverNode",void 0),e([n()],b.prototype,"description",null),e([n({readOnly:!0})],b.prototype,"featureCountDescription",null),e([n()],b.prototype,"headingLevel",void 0),e([n()],b.prototype,"title",null),e([n({type:c})],b.prototype,"viewModel",void 0),e([n(),p("esri/widgets/Feature/t9n/Feature")],b.prototype,"messages",void 0),e([n(),p("esri/t9n/common")],b.prototype,"messagesCommon",void 0),e([n()],b.prototype,"visibleElements",void 0),e([a("visibleElements")],b.prototype,"castVisibleElements",null),b=e([l("esri.widgets.Feature.FeatureRelationship")],b);const w=b;export{w 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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import i from"../../core/Accessor.js";import r from"../../core/Collection.js";import t from"../../core/Handles.js";import{watch as s,initial as a,when as n}from"../../core/reactiveUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import y from"./support/ActiveLayerInfo.js";import{onLocaleChange as d}from"../../intl/locale.js";const h={state:"state",view:"view",allLayerViews:"all-layer-views",legendProperties:"legend-properties"},c=r.ofType(y),L=["esri.layers.BuildingSceneLayer","esri.layers.CSVLayer","esri.layers.FeatureLayer","esri.layers.GeoJSONLayer","esri.layers.GeoRSSLayer","esri.layers.GroupLayer","esri.layers.HeatmapLayer","esri.layers.ImageryLayer","esri.layers.ImageryTileLayer","esri.layers.MapImageLayer","esri.layers.OGCFeatureLayer","esri.layers.PointCloudLayer","esri.layers.StreamLayer","esri.layers.SceneLayer","esri.layers.TileLayer","esri.layers.VoxelLayer","esri.layers.WFSLayer","esri.layers.WMSLayer","esri.layers.WMTSLayer","esri.layers.WCSLayer"],_="view.basemapView.baseLayerViews",f="view.groundView.layerViews",u="view.basemapView.referenceLayerViews",p=[_,f,"view.layerViews",u];let v=class extends i{constructor(e){super(e),this._handles=new t,this._layerViewByLayerId={},this._layerInfosByLayerViewId={},this._activeLayerInfosByLayerViewId={},this._activeLayerInfosWithNoParent=new r,this.activeLayerInfos=new c,this.basemapLegendVisible=!1,this.groundLegendVisible=!1,this.hideLayersNotInCurrentView=!1,this.keepCacheOnDestroy=!1,this.respectLayerVisibility=!0,this.layerInfos=[],this.view=null}initialize(){this._handles.add(s((()=>this.view),(()=>this._viewHandles()),a),h.view),this._handles.add(d((()=>this._refresh())))}destroy(){this._destroyViewActiveLayerInfos(),this._handles.destroy(),this._handles=null,this.view=null}get state(){return this.get("view.ready")?"ready":"disabled"}_viewHandles(){this._handles.remove(h.state),this.view&&this._handles.add(s((()=>this.state),(()=>this._stateHandles()),a),h.state)}_stateHandles(){this._resetAll(),"ready"===this.state&&this._watchPropertiesAndAllLayerViews()}_resetAll(){this._handles.remove([h.allLayerViews,h.legendProperties]),this._destroyViewActiveLayerInfos(),this.activeLayerInfos.removeAll()}_destroyViewActiveLayerInfos(){Object.keys(this._activeLayerInfosByLayerViewId).forEach(this._destroyViewActiveLayerInfo,this)}_destroyViewActiveLayerInfo(e){this._handles.remove(e);const i=this._activeLayerInfosByLayerViewId[e];delete this._activeLayerInfosByLayerViewId[e],i&&i.parent&&i.parent.children.remove(i)}_watchPropertiesAndAllLayerViews(){const{allLayerViews:e}=this.view;e.length&&this._refresh(),this._handles.add(e.on("change",(e=>this._allLayerViewsChangeHandle(e))),h.allLayerViews),this._handles.add(s((()=>[this.layerInfos,this.basemapLegendVisible,this.groundLegendVisible]),(()=>this._propertiesChangeHandle())),h.legendProperties)}_allLayerViewsChangeHandle(e){e.removed.forEach((e=>this._destroyViewActiveLayerInfo(e.uid))),this._refresh()}_propertiesChangeHandle(){this._destroyViewActiveLayerInfos(),this._refresh()}_refresh(){this._layerInfosByLayerViewId={},this.activeLayerInfos.removeAll(),this._generateLayerViews().filter(this._filterLayerViewsByLayerInfos,this).filter(this._isLayerViewSupported,this).forEach(this._generateActiveLayerInfo,this),this._sortActiveLayerInfos(this.activeLayerInfos)}_sortActiveLayerInfos(e){if(e.length<2)return;const i=[];e.forEach((r=>{if(!r.parent){const t=r.layer.parent,s=t&&"uid"in t&&this._layerViewByLayerId[t.uid],a=s&&this._activeLayerInfosByLayerViewId[s.uid];a&&e.includes(a)&&(i.push(r),r.parent=a,a.children.add(r),this._sortActiveLayerInfos(a.children))}})),e.removeMany(i);const r={};this.view.allLayerViews.forEach(((e,i)=>r[e.layer.uid]=i)),e.sort(((e,i)=>{const t=r[e.layer.uid]||0;return(r[i.layer.uid]||0)-t}))}_generateLayerViews(){const e=[];return p.filter(this._filterLayerViews,this).map(this.get,this).filter((e=>null!=e)).forEach(this._collectLayerViews("layerViews",e)),e}_filterLayerViews(e){const i=!this.basemapLegendVisible&&(e===_||e===u),r=!this.groundLegendVisible&&e===f;return!i&&!r}_collectLayerViews(e,i){const r=t=>(t&&t.forEach((t=>{i.push(t),r(t[e])})),i);return r}_filterLayerViewsByLayerInfos(e){const i=this.layerInfos;return!i||!i.length||i.some((i=>this._hasLayerInfo(i,e)))}_hasLayerInfo(e,i){const r=this._isLayerUIDMatching(e.layer,i.layer.uid);return r&&(this._layerInfosByLayerViewId[i.uid]=e),r}_isLayerUIDMatching(e,i){return e&&(e.uid===i||this._hasLayerUID(e.layers,i))}_hasLayerUID(e,i){return e&&e.some((e=>this._isLayerUIDMatching(e,i)))}_isLayerViewSupported(e){return!!L.includes(e.layer.declaredClass)&&(this._layerViewByLayerId[e.layer.uid]=e,!0)}_generateActiveLayerInfo(e){this._isLayerActive(e)?this._buildActiveLayerInfo(e):(this._handles.remove(e.uid),this._handles.add(s((()=>[e.legendEnabled,e.layer?.legendEnabled]),(()=>this._layerActiveHandle(e))),e.uid))}_layerActiveHandle(e){this._isLayerActive(e)&&(this._handles.remove(e.uid),this._buildActiveLayerInfo(e))}_isLayerActive(e){return!this.respectLayerVisibility||e.legendEnabled&&e.get("layer.legendEnabled")}_buildActiveLayerInfo(e){const i=e.layer,r=e.uid,t=this._layerInfosByLayerViewId[r];let o=this._activeLayerInfosByLayerViewId[r];if(!o){const s=t&&void 0!==t.title&&t.layer.uid===i.uid;o=new y({layer:i,layerView:e,title:s?t.title:i.title,view:this.view,respectLayerVisibility:this.respectLayerVisibility,hideLayersNotInCurrentView:this.hideLayersNotInCurrentView,keepCacheOnDestroy:this.keepCacheOnDestroy,sublayerIds:t&&t.sublayerIds||[]}),this._activeLayerInfosByLayerViewId[r]=o}const l=i.parent&&"uid"in i.parent&&this._layerViewByLayerId[i.parent?.uid];if(o.parent=this._activeLayerInfosByLayerViewId[l?.uid],!this._handles.has(r)){const t=[s((()=>i.title),(e=>this._titleHandle(e,o))),s((()=>[i.opacity,"renderer"in i&&i.renderer,"pointSymbol"in i&&i.pointSymbol,"lineSymbol"in i&&i.lineSymbol,"polygonSymbol"in i&&i.polygonSymbol]),(()=>this._constructLegendElements(o))),n((()=>!0===this.view?.stationary),(()=>this._scaleHandle(o)),a),s((()=>e._effectiveRenderer),(()=>this._constructLegendElements(o))),s((()=>"effect"in i&&i.effect),(()=>this._constructLegendElements(o)))];if(this.respectLayerVisibility){const r=s((()=>e.legendEnabled),(e=>this._legendEnabledHandle(e,o))),a=s((()=>i.legendEnabled),(e=>this._legendEnabledHandle(e,o)));t.push(r,a)}this._handles.add(t,r)}o.isScaleDriven||this._constructLegendElements(o),this._addActiveLayerInfo(o)}_titleHandle(e,i){i.title=e,this._constructLegendElements(i)}_legendEnabledHandle(e,i){e?this._addActiveLayerInfo(i):this._removeActiveLayerInfo(i)}_scaleHandle(e){(e.isScaleDriven||e.hideLayersNotInCurrentView)&&this._constructLegendElements(e)}_addActiveLayerInfo(e){const{layerView:i,layer:r}=e;if(this._isLayerActive(i)&&!this.activeLayerInfos.includes(e)){const i=e.parent;if(i)i.children.includes(e)||i.children.push(e),this._sortActiveLayerInfos(i.children);else{const i=this.layerInfos?.some((e=>e.layer.uid===r.uid));r.parent&&"uid"in r.parent&&!i?this._activeLayerInfosWithNoParent.add(e):(this.activeLayerInfos.add(e),this._sortActiveLayerInfos(this.activeLayerInfos))}if(this._activeLayerInfosWithNoParent.length){const e=[];this._activeLayerInfosWithNoParent.forEach((i=>{const r=i.layer.parent,t=r&&"uid"in r&&this._layerViewByLayerId[r?.uid],s=this._activeLayerInfosByLayerViewId[t?.uid];s&&(e.push(i),i.parent=s)})),e.length&&(this._activeLayerInfosWithNoParent.removeMany(e),e.forEach((e=>this._addActiveLayerInfo(e))))}}}_removeActiveLayerInfo(e){const i=e.parent;i?i.children.remove(e):this.activeLayerInfos.remove(e)}_constructLegendElements(e){const i=e.layer;"featureCollections"in i&&i.featureCollections?e.buildLegendElementsForFeatureCollections(i.featureCollections):"featureReduction"in i&&"binning"===i.featureReduction?.type&&"renderer"in i.featureReduction?e.buildLegendElementsForRenderer(i.featureReduction.renderer):"renderer"in i&&i.renderer?e.buildLegendElementsForRenderer(i.renderer):"url"in i&&i.url?e.buildLegendElementsForTools():e.children.forEach((e=>this._constructLegendElements(e)))}};e([o({type:c})],v.prototype,"activeLayerInfos",void 0),e([o()],v.prototype,"basemapLegendVisible",void 0),e([o()],v.prototype,"groundLegendVisible",void 0),e([o()],v.prototype,"hideLayersNotInCurrentView",void 0),e([o()],v.prototype,"keepCacheOnDestroy",void 0),e([o()],v.prototype,"respectLayerVisibility",void 0),e([o()],v.prototype,"layerInfos",void 0),e([o({readOnly:!0})],v.prototype,"state",null),e([o()],v.prototype,"view",void 0),v=e([l("esri.widgets.Legend.LegendViewModel")],v);const I=v;export{I as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import i from"../../core/Accessor.js";import r from"../../core/Collection.js";import t from"../../core/Handles.js";import{watch as s,initial as a,when as n}from"../../core/reactiveUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import y from"./support/ActiveLayerInfo.js";import{onLocaleChange as d}from"../../intl/locale.js";const h={state:"state",view:"view",allLayerViews:"all-layer-views",legendProperties:"legend-properties"},c=r.ofType(y),L=["esri.layers.BuildingSceneLayer","esri.layers.CSVLayer","esri.layers.FeatureLayer","esri.layers.GeoJSONLayer","esri.layers.GeoRSSLayer","esri.layers.GroupLayer","esri.layers.HeatmapLayer","esri.layers.ImageryLayer","esri.layers.ImageryTileLayer","esri.layers.MapImageLayer","esri.layers.OGCFeatureLayer","esri.layers.PointCloudLayer","esri.layers.StreamLayer","esri.layers.SceneLayer","esri.layers.SubtypeGroupLayer","esri.layers.TileLayer","esri.layers.VoxelLayer","esri.layers.WFSLayer","esri.layers.WMSLayer","esri.layers.WMTSLayer","esri.layers.WCSLayer"],_="view.basemapView.baseLayerViews",f="view.groundView.layerViews",u="view.basemapView.referenceLayerViews",p=[_,f,"view.layerViews",u];let v=class extends i{constructor(e){super(e),this._handles=new t,this._layerViewByLayerId={},this._layerInfosByLayerViewId={},this._activeLayerInfosByLayerViewId={},this._activeLayerInfosWithNoParent=new r,this.activeLayerInfos=new c,this.basemapLegendVisible=!1,this.groundLegendVisible=!1,this.hideLayersNotInCurrentView=!1,this.keepCacheOnDestroy=!1,this.respectLayerVisibility=!0,this.layerInfos=[],this.view=null}initialize(){this._handles.add(s((()=>this.view),(()=>this._viewHandles()),a),h.view),this._handles.add(d((()=>this._refresh())))}destroy(){this._destroyViewActiveLayerInfos(),this._handles.destroy(),this._handles=null,this.view=null}get state(){return this.get("view.ready")?"ready":"disabled"}_viewHandles(){this._handles.remove(h.state),this.view&&this._handles.add(s((()=>this.state),(()=>this._stateHandles()),a),h.state)}_stateHandles(){this._resetAll(),"ready"===this.state&&this._watchPropertiesAndAllLayerViews()}_resetAll(){this._handles.remove([h.allLayerViews,h.legendProperties]),this._destroyViewActiveLayerInfos(),this.activeLayerInfos.removeAll()}_destroyViewActiveLayerInfos(){Object.keys(this._activeLayerInfosByLayerViewId).forEach(this._destroyViewActiveLayerInfo,this)}_destroyViewActiveLayerInfo(e){this._handles.remove(e);const i=this._activeLayerInfosByLayerViewId[e];delete this._activeLayerInfosByLayerViewId[e],i&&i.parent&&i.parent.children.remove(i)}_watchPropertiesAndAllLayerViews(){const{allLayerViews:e}=this.view;e.length&&this._refresh(),this._handles.add(e.on("change",(e=>this._allLayerViewsChangeHandle(e))),h.allLayerViews),this._handles.add(s((()=>[this.layerInfos,this.basemapLegendVisible,this.groundLegendVisible]),(()=>this._propertiesChangeHandle())),h.legendProperties)}_allLayerViewsChangeHandle(e){e.removed.forEach((e=>this._destroyViewActiveLayerInfo(e.uid))),this._refresh()}_propertiesChangeHandle(){this._destroyViewActiveLayerInfos(),this._refresh()}_refresh(){this._layerInfosByLayerViewId={},this.activeLayerInfos.removeAll(),this._generateLayerViews().filter(this._filterLayerViewsByLayerInfos,this).filter(this._isLayerViewSupported,this).forEach(this._generateActiveLayerInfo,this),this._sortActiveLayerInfos(this.activeLayerInfos)}_sortActiveLayerInfos(e){if(e.length<2)return;const i=[];e.forEach((r=>{if(!r.parent){const t=r.layer.parent,s=t&&"uid"in t&&this._layerViewByLayerId[t.uid],a=s&&this._activeLayerInfosByLayerViewId[s.uid];a&&e.includes(a)&&(i.push(r),r.parent=a,a.children.add(r),this._sortActiveLayerInfos(a.children))}})),e.removeMany(i);const r={};this.view.allLayerViews.forEach(((e,i)=>r[e.layer.uid]=i)),e.sort(((e,i)=>{const t=r[e.layer.uid]||0;return(r[i.layer.uid]||0)-t}))}_generateLayerViews(){const e=[];return p.filter(this._filterLayerViews,this).map(this.get,this).filter((e=>null!=e)).forEach(this._collectLayerViews("layerViews",e)),e}_filterLayerViews(e){const i=!this.basemapLegendVisible&&(e===_||e===u),r=!this.groundLegendVisible&&e===f;return!i&&!r}_collectLayerViews(e,i){const r=t=>(t&&t.forEach((t=>{i.push(t),r(t[e])})),i);return r}_filterLayerViewsByLayerInfos(e){const i=this.layerInfos;return!i||!i.length||i.some((i=>this._hasLayerInfo(i,e)))}_hasLayerInfo(e,i){const r=this._isLayerUIDMatching(e.layer,i.layer.uid);return r&&(this._layerInfosByLayerViewId[i.uid]=e),r}_isLayerUIDMatching(e,i){return e&&(e.uid===i||this._hasLayerUID(e.layers,i))}_hasLayerUID(e,i){return e&&e.some((e=>this._isLayerUIDMatching(e,i)))}_isLayerViewSupported(e){return!!L.includes(e.layer.declaredClass)&&(this._layerViewByLayerId[e.layer.uid]=e,!0)}_generateActiveLayerInfo(e){this._isLayerActive(e)?this._buildActiveLayerInfo(e):(this._handles.remove(e.uid),this._handles.add(s((()=>[e.legendEnabled,e.layer?.legendEnabled]),(()=>this._layerActiveHandle(e))),e.uid))}_layerActiveHandle(e){this._isLayerActive(e)&&(this._handles.remove(e.uid),this._buildActiveLayerInfo(e))}_isLayerActive(e){return!this.respectLayerVisibility||e.legendEnabled&&e.get("layer.legendEnabled")}_buildActiveLayerInfo(e){const i=e.layer,r=e.uid,t=this._layerInfosByLayerViewId[r];let o=this._activeLayerInfosByLayerViewId[r];if(!o){const s=t&&void 0!==t.title&&t.layer.uid===i.uid;o=new y({layer:i,layerView:e,title:s?t.title:i.title,view:this.view,respectLayerVisibility:this.respectLayerVisibility,hideLayersNotInCurrentView:this.hideLayersNotInCurrentView,keepCacheOnDestroy:this.keepCacheOnDestroy,sublayerIds:t&&t.sublayerIds||[]}),this._activeLayerInfosByLayerViewId[r]=o}const l=i.parent&&"uid"in i.parent&&this._layerViewByLayerId[i.parent?.uid];if(o.parent=this._activeLayerInfosByLayerViewId[l?.uid],!this._handles.has(r)){const t=[s((()=>i.title),(e=>this._titleHandle(e,o))),s((()=>[i.opacity,"renderer"in i&&i.renderer,"pointSymbol"in i&&i.pointSymbol,"lineSymbol"in i&&i.lineSymbol,"polygonSymbol"in i&&i.polygonSymbol]),(()=>this._constructLegendElements(o))),n((()=>!0===this.view?.stationary),(()=>this._scaleHandle(o)),a),s((()=>e._effectiveRenderer),(()=>this._constructLegendElements(o))),s((()=>"effect"in i&&i.effect),(()=>this._constructLegendElements(o)))];if(this.respectLayerVisibility){const r=s((()=>e.legendEnabled),(e=>this._legendEnabledHandle(e,o))),a=s((()=>i.legendEnabled),(e=>this._legendEnabledHandle(e,o)));t.push(r,a)}this._handles.add(t,r)}o.isScaleDriven||this._constructLegendElements(o),this._addActiveLayerInfo(o)}_titleHandle(e,i){i.title=e,this._constructLegendElements(i)}_legendEnabledHandle(e,i){e?this._addActiveLayerInfo(i):this._removeActiveLayerInfo(i)}_scaleHandle(e){(e.isScaleDriven||e.hideLayersNotInCurrentView)&&this._constructLegendElements(e)}_addActiveLayerInfo(e){const{layerView:i,layer:r}=e;if(this._isLayerActive(i)&&!this.activeLayerInfos.includes(e)){const i=e.parent;if(i)i.children.includes(e)||i.children.push(e),this._sortActiveLayerInfos(i.children);else{const i=this.layerInfos?.some((e=>e.layer.uid===r.uid));r.parent&&"uid"in r.parent&&!i?this._activeLayerInfosWithNoParent.add(e):(this.activeLayerInfos.add(e),this._sortActiveLayerInfos(this.activeLayerInfos))}if(this._activeLayerInfosWithNoParent.length){const e=[];this._activeLayerInfosWithNoParent.forEach((i=>{const r=i.layer.parent,t=r&&"uid"in r&&this._layerViewByLayerId[r?.uid],s=this._activeLayerInfosByLayerViewId[t?.uid];s&&(e.push(i),i.parent=s)})),e.length&&(this._activeLayerInfosWithNoParent.removeMany(e),e.forEach((e=>this._addActiveLayerInfo(e))))}}}_removeActiveLayerInfo(e){const i=e.parent;i?i.children.remove(e):this.activeLayerInfos.remove(e)}_constructLegendElements(e){const i=e.layer;"featureCollections"in i&&i.featureCollections?e.buildLegendElementsForFeatureCollections(i.featureCollections):"featureReduction"in i&&"binning"===i.featureReduction?.type&&"renderer"in i.featureReduction?e.buildLegendElementsForRenderer(i.featureReduction.renderer):"renderer"in i&&i.renderer&&!("sublayers"in i)?e.buildLegendElementsForRenderer(i.renderer):"url"in i&&i.url?e.buildLegendElementsForTools():e.children.forEach((e=>this._constructLegendElements(e)))}};e([o({type:c})],v.prototype,"activeLayerInfos",void 0),e([o()],v.prototype,"basemapLegendVisible",void 0),e([o()],v.prototype,"groundLegendVisible",void 0),e([o()],v.prototype,"hideLayersNotInCurrentView",void 0),e([o()],v.prototype,"keepCacheOnDestroy",void 0),e([o()],v.prototype,"respectLayerVisibility",void 0),e([o()],v.prototype,"layerInfos",void 0),e([o({readOnly:!0})],v.prototype,"state",null),e([o()],v.prototype,"view",void 0),v=e([l("esri.widgets.Legend.LegendViewModel")],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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import{addTokenParameter as s}from"../../../kernel.js";import l from"../../../request.js";import"../../../symbols.js";import r from"../../../core/Accessor.js";import i from"../../../core/Collection.js";import n from"../../../core/Handles.js";import{JSONMap as a}from"../../../core/jsonMap.js";import o from"../../../core/Logger.js";import{unwrap as u,isSome as c}from"../../../core/maybe.js";import{eachAlways as d,debounce as y}from"../../../core/promiseUtils.js";import{on as h,watch as m,whenOnce as f,initial as p}from"../../../core/reactiveUtils.js";import{px2pt as g}from"../../../core/screenUtils.js";import{addQueryParameters as b}from"../../../core/urlUtils.js";import{property as S}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{OriginId as v}from"../../../core/accessorSupport/PropertyOrigin.js";import{EffectView as L}from"../../../layers/effects/EffectView.js";import{effectFunctionsFromJSON as w}from"../../../layers/effects/jsonUtils.js";import{ExportImageParameters as E}from"../../../layers/support/ExportImageParameters.js";import{isDateField as C}from"../../../layers/support/fieldUtils.js";import{fromJSON as I}from"../../../renderers/support/jsonUtils.js";import{isSupportedRenderer3D as R}from"../../../renderers/support/rendererConversion.js";import V from"../../../renderers/visualVariables/support/SizeVariableLegendOptions.js";import{applyCIMSymbolColor as F}from"../../../symbols/support/cimSymbolUtils.js";import{SymbolSizeDefaults as T}from"../../../symbols/support/previewUtils.js";import{renderSymbol as z}from"../../../symbols/support/renderUtils.js";import{renderColorRampPreviewHTML as x,renderDotDensityPreviewHTML as j,renderPieChartPreviewHTML as D,renderPreviewHTML as O}from"../../../symbols/support/symbolUtils.js";import{isVolumetricSymbol as P}from"../../../symbols/support/utils.js";import{getClusterSizeVariable as M}from"./clusterUtils.js";import{getColorFromPointCloudStops as A,getRampStopsForPointCloud as B,getStrectchRampStops as U,getRampStops as k}from"./colorRampUtils.js";import{getHeatmapRampStops as N}from"./heatmapRampUtils.js";import{getRotationAngleForFocus as q,getRelationshipRampElement as $}from"./relationshipRampUtils.js";import{getRampStops as W,REAL_WORLD_MAX_SIZE as G,REAL_WORLD_MIN_SIZE as J}from"./sizeRampUtils.js";import{SPECIAL_CHARS_LESS_THAN as Q,SPECIAL_CHARS_GREATER_THAN as H,getSymbolForFlowRenderer as X,getMedianColor as K,RGB_IMG_SOURCE as Y}from"./utils.js";import{formatNumberLabel as Z}from"../../smartMapping/support/utils.js";import ee from"../../../symbols/SimpleMarkerSymbol.js";import te from"../../../symbols/SimpleFillSymbol.js";const se="https://utility.arcgis.com/sharing/tools/legend",le="esri.layers.ImageryLayer",re="esri.layers.ImageryTileLayer",ie="esri.layers.WCSLayer",ne=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i,ae=new a({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"}),oe={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34e38,34e38],f64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ue=new ee({size:6,outline:{color:[128,128,128,.5],width:.5}}),ce=new te({style:"solid"});function de(e){return"flow"===e.type}function ye(e){return"vector-field"===e.type}function he(e){return"raster-colormap"===e.type}function me(e){return"raster-stretch"===e.type}function fe(e){return"raster-shaded-relief"===e.type}function pe(e){return"esri.renderers.SimpleRenderer"===e.declaredClass}function ge(e){return"esri.renderers.ClassBreaksRenderer"===e.declaredClass}function be(e){return"esri.renderers.UniqueValueRenderer"===e.declaredClass}function Se(e){return"esri.renderers.HeatmapRenderer"===e.declaredClass}function _e(e){return Le(e)||we(e)||Ee(e)||ve(e)}function ve(e){return"esri.renderers.PointCloudRGBRenderer"===e.declaredClass}function Le(e){return"esri.renderers.PointCloudClassBreaksRenderer"===e.declaredClass}function we(e){return"esri.renderers.PointCloudStretchRenderer"===e.declaredClass}function Ee(e){return"esri.renderers.PointCloudUniqueValueRenderer"===e.declaredClass}function Ce(e){return"esri.renderers.DotDensityRenderer"===e.declaredClass}function Ie(e){return"esri.renderers.PieChartRenderer"===e.declaredClass}function Re(e,t){return pe(e)||ge(e)||be(e)||Se(e)||Ce(e)||Ie(e)?"2d"===t.type||R(e):me(e)||he(e)||fe(e)||Le(e)||we(e)||Ee(e)||ye(e)||de(e)}function Ve(e){return"esri.layers.BuildingSceneLayer"===e.declaredClass}function Fe(e){return"esri.layers.VoxelLayer"===e.declaredClass}function Te(e){return"esri.layers.WMSLayer"===e.declaredClass}function ze(e){return"esri.layers.WMTSLayer"===e.declaredClass}function xe(e){return"esri.layers.MapImageLayer"===e.declaredClass}function je(e){return"esri.layers.TileLayer"===e.declaredClass}function De(e){return"esri.layers.FeatureLayer"===e.declaredClass}function Oe(e){return e.declaredClass===le}function Pe(e){return e.declaredClass===re}function Me(e){return e.declaredClass===ie}function Ae(e){return"stretch-ramp"===e.type}function Be(e){return"univariate-color-size"===("authoringInfo"in e&&e?.authoringInfo)?.type}function Ue(e){const t="authoringInfo"in e&&e?.authoringInfo;return"univariate-color-size"===t?.type&&"above-and-below"===t?.univariateTheme}const ke=new ee({style:"path",path:"M10,5 L5,0 0,5 M5,0 L5,15",size:15,outline:{width:1,color:[85,85,85,1]}});let Ne={},qe=class extends r{constructor(e){super(e),this._handles=new n,this._hasColorRamp=!1,this._hasOpacityRamp=!1,this._hasSizeRamp=!1,this._webStyleSymbolCache=new Map,this._dotDensityUrlCache=new Map,this._scaleDrivenSizeVariable=null,this._hasClusterSizeVariable=!1,this.children=new i,this.layerView=null,this.layer=null,this.legendElements=[],this.parent=null,this.hideLayersNotInCurrentView=!1,this.keepCacheOnDestroy=!1,this.respectLayerVisibility=!0,this.sublayerIds=[],this.title=null,this.view=null}initialize(){const e=()=>this.notifyChange("ready");this._handles.add([h((()=>this.children),"change",(t=>{const{added:s,removed:l}=t,r=this._handles;s.forEach((t=>{const s=`activeLayerInfo-ready-watcher-${t.layer.uid}`;r.add(m((()=>t.ready),e,p),s)})),l.forEach((e=>r.remove(e.layer.uid))),e()}))]),this.keepCacheOnDestroy||(Ne={})}destroy(){this._handles.destroy(),this._handles=null,this._webStyleSymbolCache=null,this._dotDensityUrlCache=null,this._scaleDrivenSizeVariable=null,this.keepCacheOnDestroy||(Ne=null)}get effectList(){const e=this.layer;let t=null;return"effect"in e&&e.effect&&(t=new L,t.effect=e.effect,t.end(),t.scale=this.scale),t}get opacity(){const e=this.layer.opacity,t=this.parent?.opacity,s=this.layer.parent,l=s&&"uid"in s?this._getParentLayerOpacity(s):null;return null!=t?t*e:null!=l?l*e:e}get ready(){return null===this.layer||(this.children.length>0?this._isGroupActive():this.legendElements.length>0)}get scale(){return this.view&&this.view.scale}get isScaleDriven(){const e=this.layer;if(null===e)return!1;if("effect"in e&&e.effect&&Array.isArray(e.effect))return!0;if("featureReduction"in e&&e.featureReduction){if("cluster"===e.featureReduction.type)return!0;if("binning"===e.featureReduction.type&&"renderer"in e.featureReduction&&e.featureReduction.renderer)return this._isRendererScaleDriven(e.featureReduction.renderer)}return"renderer"in e&&e.renderer?this._isRendererScaleDriven(e.renderer):this._isLayerScaleDriven(this.layer)}get version(){return this._get("version")+1}async buildLegendElementsForFeatureCollections(e){if(!(!this.hideLayersNotInCurrentView||await this._isLayerInCurrentView()))return this.legendElements=[],void this.notifyChange("ready");const t=Array.from(e,(e=>{if(De(e))return this._getRendererLegendElements(e.renderer,{title:e.title});if(e.featureSet&&e.featureSet.features.length){const t=e.layerDefinition,s=t&&t.drawingInfo,l=s&&I(s.renderer),r=ae.read(t.geometryType);return l?this._getRendererLegendElements(l,{title:e.name,geometryType:r}):(o.getLogger(this.declaredClass).warn("drawingInfo not available!"),null)}return null}));try{const e=[];await d(t).then((t=>{t.forEach((({value:t})=>t&&e.push(...t)))})),this.legendElements=e,this.notifyChange("ready")}catch(s){o.getLogger(this.declaredClass).warn("error while building legend for layer!",s)}}async buildLegendElementsForRenderer(e){try{const t=!this.hideLayersNotInCurrentView||await this._isLayerInCurrentView();this.legendElements=t?await this._getRendererLegendElements(e):[],this.notifyChange("ready")}catch(t){o.getLogger(this.declaredClass).warn("error while building legend for layer!",t)}}async buildLegendElementsForTools(){const e=this.layer;if(Fe(e))this._constructLegendElementsForVoxellayer();else if(ze(e))this._constructLegendElementsForWMTSlayer();else if(Te(e))await this._constructLegendElementsForWMSSublayers();else if(Ve(e))await this._constructLegendElementsForBuildingSceneLayer();else if(xe(e)||je(e)||Ve(e))await this._constructLegendElementsForSublayers();else{this._handles.remove("imageryLayers-watcher");let t="default";if(Oe(e)){t=(e?.renderingRule?.functionName||"default")+"_"+(e.bandIds?.length?e.bandIds.join(""):"###")}await this._getLegendLayers(`${e.uid}-${t}`).then((async t=>{this.legendElements=[],this.notifyChange("ready");const s=t.map((async t=>{if(Oe(e)||Pe(e)){const t=m((()=>["renderingRule"in e&&e.renderingRule,e.bandIds]),(()=>y((async()=>{Ne.default=null,e.renderer?await this.buildLegendElementsForRenderer(e.renderer):await this.buildLegendElementsForTools()}))()));this._handles.add(t,"imageryLayers-watcher")}const s=this._generateSymbolTableElementForLegendLayer(t);s&&s.infos.length&&(Oe(e)&&(s.title=e.title),this.legendElements.push(s)),this.notifyChange("ready")}));await d(s)})).catch((e=>{o.getLogger(this.declaredClass).warn("Request to server for legend has failed!",e)}))}}async _isLayerInCurrentView(){const e=this.layer,t=this.layerView,s=t&&"createQuery"in t&&"queryFeatureCount"in t;if(!s&&!(t&&"createQuery"in e&&"queryFeatureCount"in e))return!0;await f((()=>!t.updating));const l=s?"createQuery"in t&&t.createQuery():"createQuery"in e&&e.createQuery();l.geometry=this.view.extent;return 0!==(s?"queryFeatureCount"in t&&await t.queryFeatureCount(l):"queryFeatureCount"in e&&await e.queryFeatureCount(l))}_getParentLayerOpacity(e){let t=1;const s=e.parent;return s&&"uid"in s&&(t=this._getParentLayerOpacity(s)),e.opacity*t}_isGroupActive(){const e=this.children;return!!e.length&&e.some((e=>e.ready))}_isRendererScaleDriven(e){if("dot-density"===e.type)return!0;const t="valueExpression"in e&&e.valueExpression;if(ne.test(t))return!0;const s="visualVariables"in e&&e.visualVariables;return!!s&&s.some((e=>this._isScaleDrivenSizeVariable(e)))}_isScaleDrivenSizeVariable(e){if(e&&"size"!==e.type)return!1;const t=e,s=t.minSize,l=t.maxSize;return"object"==typeof s&&s?this._isScaleDrivenSizeVariable(s):"object"==typeof l&&l?this._isScaleDrivenSizeVariable(l):!!t.expression||ne.test(t.valueExpression)}_isLayerScaleDriven(e){if("minScale"in e&&e.minScale>0||"maxScale"in e&&e.maxScale>0)return!0;if("sublayers"in e&&e.sublayers)return e.sublayers.some((e=>this._isLayerScaleDriven(e)));const t=e.parent;if(!1===e.loaded&&t&&xe(t)&&"source"in e&&e.source&&"map-layer"===e.source.type)for(const s of t.sourceJSON.layers)if(s.id===e.source.mapLayerId&&(s.minScale>0||s.maxScale>0))return!0;return!1}async _constructLegendElementsForVoxellayer(){this.legendElements=[],this._handles.remove("voxel-style-watcher"),this._handles.remove("voxel-current-variable");const e=this.layer;this._handles.add(m((()=>e.currentVariableId),(()=>this._constructLegendElementsForVoxellayer())),"voxel-current-variable"),this._handles.add(m((()=>e.getVariableStyles()),(()=>this._constructLegendElementsForVoxellayer())),"voxel-style-watcher");const t=u(e.getVariableStyle(null)),s=[];if(t)if(t.uniqueValues?.length){const e=[];t.uniqueValues.forEach((t=>{t.enabled&&e.push({label:t.label||`${t.value}`,value:t.value,symbol:new te({color:t.color,outline:null})})})),e.length&&s.push({type:"symbol-table",title:t.label,infos:e})}else if(t.transferFunction){const{colorStops:e,stretchRange:l}=t.transferFunction,r=e.toArray().reverse(),i=l.map(((e,t)=>`${0===t?Q:H} ${Z(e)}`)).reverse(),n=r.map((e=>({color:e.color,value:null,label:null})));n[0].label=i[0],n[n.length-1].label=i[1],s.push({type:"color-ramp",title:t.label,infos:n,preview:x(r.map((e=>e.color)))})}const l=e.opacity,r=s.reduce(((e,t)=>e.concat(this._getAllInfos(t))),[]).filter((e=>!!e?.symbol)).map((e=>this._getSymbolPreview(e,l)));await d(r),this.legendElements=s,this.notifyChange("ready")}_constructLegendElementsForWMTSlayer(){this.legendElements=[],this._handles.remove("wmts-activeLayer-watcher");const e=this.layer.activeLayer;if(this._handles.add(m((()=>{const{layer:e}=this;return e&&"activeLayer"in e&&e.activeLayer}),(()=>this._constructLegendElementsForWMTSlayer())),"wmts-activeLayer-watcher"),e.styleId&&e.styles){let t=null;e.styles.some((s=>e.styleId===s.id&&(t=s.legendUrl,!0))),t&&(this.legendElements=[{type:"symbol-table",title:e.title,infos:[{src:t,opacity:this.opacity}]}])}this.notifyChange("ready")}async _constructLegendElementsForWMSSublayers(){this.legendElements=[],this._handles.remove("wms-sublayers-watcher");const e=this.layer;let t=null;(e.customParameters||e.customLayerParameters)&&(t={...e.customParameters,...e.customLayerParameters}),this._handles.add(m((()=>{const{layer:e}=this;return e&&"sublayers"in e&&e.sublayers}),(()=>this._constructLegendElementsForWMSSublayers())),"wms-sublayers-watcher"),this.legendElements=await this._generateLegendElementsForWMSSublayers(e.sublayers,t),this.notifyChange("ready")}async _generateLegendElementsForWMSSublayers(e,t){const s=[];this._handles.add(e.on("change",(()=>this._constructLegendElementsForWMSSublayers())),"wms-sublayers-watcher");const l=e.toArray();for(const r of l){const e=m((()=>[r.title,r.visible,r.legendEnabled]),(()=>this._constructLegendElementsForWMSSublayers()));if(this._handles.add(e,"wms-sublayers-watcher"),!this.respectLayerVisibility||r.visible&&r.legendEnabled){const e=await this._generateSymbolTableElementForWMSSublayer(r,t);e&&e.infos.length&&s.unshift(e)}}return s}async _generateSymbolTableElementForWMSSublayer(e,t){if(!e.legendUrl&&e.sublayers){const s=(await this._generateLegendElementsForWMSSublayers(e.sublayers,t)).filter((e=>e));return{type:"symbol-table",title:e.title,infos:s}}return this._generateSymbolTableElementForLegendUrl(e,t)}async _generateSymbolTableElementForLegendUrl(e,t){let s=e.legendUrl;if(!s)return;const r={type:"symbol-table",title:e.title||e.name||e.id&&e.id+"",infos:[]};t&&(s=b(s,t));let i=null;const n=e.layer?.opacity;try{i=(await l(s,{responseType:"image"})).data,i&&(i.style.opacity=n)}catch{}return r.infos.push({src:s,preview:i,opacity:n}),r}_getLegendLayers(e,t){const s=Ne&&Ne[e];return s?Promise.resolve(s):this._legendRequest(t).then((t=>{const s=t.layers;return Ne[e]=s,s}))}_legendRequest(e){const t=this.layer;let s={f:"json",dynamicLayers:e};if(Oe(t)){const e=t.exportImageServiceParameters.renderingRule;if(e&&(s.renderingRule=JSON.stringify(e.rasterFunctionDefinition||e.toJSON())),t.bandIds&&(s.bandIds=t.bandIds.join()),t.raster||t.viewId||t.customParameters){const{raster:e,viewId:l,customParameters:r}=t;s={raster:e,viewId:l,...s,...r}}}let r=t.url.replace(/(\/)+$/,"");if("version"in t&&t.version>=10.01){const e=r.indexOf("?");e>-1?r=r.substring(0,e)+"/legend"+r.substring(e):r+="/legend"}else{const e=r.toLowerCase().indexOf("/rest/"),t=r.substring(0,e)+r.substring(e+5,r.length);r=se+"?soapUrl="+encodeURI(t)+"&returnbytes=true"}return l(r,{query:s}).then((e=>e.data))}async _constructLegendElementsForBuildingSceneLayer(){this.legendElements=[],this._handles.remove("sublayers-watcher");const e=this.layer;this._handles.add(m((()=>e.sublayers),(()=>this._constructLegendElementsForBuildingSceneLayer())),"sublayers-watcher");try{this.legendElements=await this._generateLegendElementsForBuildingSublayers(e.sublayers,this.opacity),this.notifyChange("ready")}catch(t){o.getLogger(this.declaredClass).warn("Request to server for legend has failed!",t)}}async _generateLegendElementsForBuildingSublayers(e,t){let s=[];this._handles.add(e.on("change",(()=>this._constructLegendElementsForBuildingSceneLayer())),"sublayers-watcher");const l=e.toArray();for(const r of l){const e=m((()=>["renderer"in r&&r.renderer,r.opacity,r.title,r.visible]),(()=>this._constructLegendElementsForBuildingSceneLayer()));if(this._handles.add(e,"sublayers-watcher"),!this.respectLayerVisibility||r.visible){const e=r&&null!=r.opacity?r.opacity:null,l=null!=e?e*t:t;if("building-group"===r.type){const e={type:"symbol-table",title:r.title,infos:[]},t=await this._generateLegendElementsForBuildingSublayers(r.sublayers,l);e.infos.push(...t),s=[e,...s]}else if(r.renderer){s=[...await this._getRendererLegendElements(r.renderer,{title:r.title,opacity:l,sublayer:r}),...s]}}}return s.filter((e=>!!e&&(!("infos"in e)||e.infos.length>0)))}async _constructLegendElementsForSublayers(){this.legendElements=[],this._handles.remove("sublayers-watcher");const e=this.layer;this._handles.add(m((()=>e.sublayers),(()=>this._constructLegendElementsForSublayers)),"sublayers-watcher");try{this.legendElements=await this._generateLegendElementsForSublayers(e.sublayers,this.opacity),this.notifyChange("ready")}catch(t){o.getLogger(this.declaredClass).warn("Request to server for legend has failed!",t)}}async _generateLegendElementsForSublayers(e,t,s){const l=this.layer;let r=[];this._handles.add(e.on("change",(()=>this._constructLegendElementsForSublayers())),"sublayers-watcher");let i=e.toArray();!s&&this.sublayerIds&&this.sublayerIds.length&&(i=this.sublayerIds.map((e=>l.findSublayerById(e))).filter(Boolean));for(const n of i){const e=m((()=>[n.renderer,n.opacity,n.title,n.visible,n.legendEnabled]),(()=>this._constructLegendElementsForSublayers()));if(this._handles.add(e,"sublayers-watcher"),!this.respectLayerVisibility||n.visible&&n.legendEnabled&&this._isSublayerInScale(n)){const e=n&&null!=n.opacity?n.opacity:null,l=null!=e?e*t:t;if(n.renderer&&!n.sublayers&&n.originIdOf("renderer")>v.SERVICE){await n.load();r=[...await this._getRendererLegendElements(n.renderer,{title:n.title,opacity:l,sublayer:n}),...r]}else{const e=await this._generateSymbolTableElementForSublayer(n,l,s);e&&r.unshift(e)}}}return r.filter((e=>!!e&&(!("infos"in e)||e.infos.length>0)))}async _generateSymbolTableElementForSublayer(e,t,s){if(!s){s=new Map;const t=this.layer,l=e.source;let r=null;if(!(!l||"map-layer"===l.type&&l.mapLayerId===e.id&&(!l.gdbVersion||l.gdbVersion===("gdbVersion"in t&&t.gdbVersion)))||e.originIdOf("renderer")>v.SERVICE||e.originIdOf("labelingInfo")>v.SERVICE||e.originIdOf("labelsVisible")>v.SERVICE){const e=new E({layer:this.layer});r=e.hasDynamicLayers?e.dynamicLayers:null,e.destroy()}const i=r||`${t.uid}-default`;(await this._getLegendLayers(i,r)).forEach((e=>s.set(e.layerId,e)))}const l=s.get(e.id);if((!l||l?.subLayerIds&&l.defaultVisibility)&&e.sublayers){const l=await this._generateLegendElementsForSublayers(e.sublayers,t,s);return{type:"symbol-table",title:e.title,infos:l}}return this._generateSymbolTableElementForLegendLayer(l,e,t)}_generateSymbolTableElementForLegendLayer(e,t,s){if(!e||!e.legend||this.respectLayerVisibility&&!this._isLegendLayerInScale(e,t))return null;const l=t?.renderer;let r=t?.title||e.layerName;if(l&&(!t||t?.originIdOf("renderer")>v.SERVICE)){const e=t?.title||this._getRendererTitle(l,t);e&&(r&&"string"!=typeof e&&"title"in e&&(e.title=r),r=e)}const i={type:"symbol-table",title:r,legendType:e.legendType?e.legendType:null,infos:[]},n=t?this._sanitizeLegendForSublayer(e.legend.slice(),t):e.legend;return e.legendGroups?.length>0?e.legendGroups.forEach((t=>{const l={type:"symbol-table",title:t.heading,legendType:e.legendType?e.legendType:null,infos:this._generateSymbolTableElementInfosForLegendLayer(n.filter((e=>e.groupId===t.id)),e.layerId,s)};l.infos?.length>0&&i.infos.push(l)})):i.infos=this._generateSymbolTableElementInfosForLegendLayer(n,e.layerId,s),i.infos.length>0?i:null}_generateSymbolTableElementInfosForLegendLayer(e,t,l){return e.map((e=>{let r=e.url;if(e.imageData&&e.imageData.length>0)r=`data:image/png;base64,${e.imageData}`;else{if(0===r.indexOf("http"))return null;r=s(`${this.layer.url}/${t}/images/${r}`)}return{label:e.label,src:r,opacity:l??this.opacity,width:e.width,height:e.height}})).filter((e=>!!e))}_isSublayerInScale(e){const t=e.minScale||0,s=e.maxScale||0;return!(t>0&&t<this.scale||s>this.scale)}_isLegendLayerInScale(e,t){const s=t||this.layer;let l=null,r=null,i=!0;return!s.minScale&&0!==s.minScale||!s.maxScale&&0!==s.maxScale?(0===e.minScale&&s.tileInfo&&(l=s.tileInfo.lods[0].scale),0===e.maxScale&&s.tileInfo&&(r=s.tileInfo.lods[s.tileInfo.lods.length-1].scale)):(l=Math.min(s.minScale,e.minScale)||s.minScale||e.minScale,r=Math.max(s.maxScale,e.maxScale)),(l>0&&l<this.scale||r>this.scale)&&(i=!1),i}_sanitizeLegendForSublayer(e,t){if("version"in this.layer&&this.layer.version<10.1||0===e.length)return e;const s=t.renderer,l=e.some((e=>e.values));let r=null,i=null;return l&&e.some(((e,t)=>(e.values||(r=t,i=e,i.label||(i.label="others")),null!=i))),s?"unique-value"===s.type?i&&(e.splice(r,1),e.push(i)):"class-breaks"===s.type&&(i&&e.splice(r,1),e.reverse(),i&&e.push(i)):i&&(e.splice(r,1),e.push(i)),e}async _getRendererLegendElements(e,t={}){return Re(e,this.view)?_e(e)?this._constructPointCloudRendererLegendElements(e,t):Ce(e)?this._constructDotDensityRendererLegendElements(e):Ie(e)?this._constructPieChartRendererLegendElements(e):this._constructRendererLegendElements(e,t):(o.getLogger(this.declaredClass).warn(`Renderer of type '${e.type}' not supported!`),[])}_getPointCloudRendererTitle(e){return e.legendOptions&&e.legendOptions.title||e.field}_constructPointCloudRendererLegendElements(e,t={}){const s=t.title,l=[];let r=null,i=null;if(Le(e))r={type:"symbol-table",title:s||this._getPointCloudRendererTitle(e),infos:[]},e.colorClassBreakInfos.forEach((e=>{r.infos.unshift({label:e.label||e.minValue+" - "+e.maxValue,value:[e.minValue,e.maxValue],symbol:this._getAppliedCloneSymbol(ue,e.color)})}));else if(we(e)){const t=e.stops;let l=null;if(t.length&&(1===t.length&&(l=t[0].color),!l)){const e=t[0].value,s=t[t.length-1].value;if(null!=e&&null!=s){l=A(e+(s-e)/2,t)}}r={type:"symbol-table",title:null,infos:[{label:null,value:null,symbol:this._getAppliedCloneSymbol(ue,l||ue.color)}]};const n=B(e.stops);i={type:"color-ramp",title:s||this._getPointCloudRendererTitle(e),infos:n,preview:x(n.map((e=>e.color)))}}else Ee(e)&&(r={type:"symbol-table",title:s||this._getPointCloudRendererTitle(e),infos:[]},e.colorUniqueValueInfos.forEach((e=>{r.infos.push({label:e.label||e.values.join(", "),value:e.values.join(", "),symbol:this._getAppliedCloneSymbol(ue,e.color)})})));r&&r.infos.length&&l.push(r),i&&i.infos.length&&l.push(i);const n=l.reduce(((e,t)=>e.concat(t.infos)),[]).filter((e=>!!e.symbol)).map((t=>this._getSymbolPreview(t,this.opacity,{symbolConfig:{applyColorModulation:!!e.colorModulation}})));return d(n).then((()=>l))}_getElementInfoForDotDensity(e,t){const{backgroundColor:s,outline:l,dotSize:r}=e,i=this.effectList?.effects.map((e=>e.toJSON())),n=w(i),a=r+"-"+t+"-"+s+"-"+(l&&JSON.stringify(l.toJSON()))+"-"+n,o=this._dotDensityUrlCache,u=o.has(a)?o.get(a):j(e,t);o.set(a,u);const c={shape:{type:"image",x:0,y:0,width:u.width,height:u.height,src:u.src},fill:null,stroke:null,offset:[0,0]},d=z([[c]],[u.width,u.height],{effectView:this.effectList});return{opacity:1,src:u.src,preview:d,width:u.width,height:u.height}}_constructDotDensityRendererLegendElements(e){const t=e.calculateDotValue(this.view.scale),s=e.legendOptions&&e.legendOptions.unit,l={type:"symbol-table",title:{value:t&&Math.round(t),unit:s||""},infos:[]};return e.attributes.forEach((t=>{const s=this._getElementInfoForDotDensity(e,t.color);s.label=t.label||t.valueExpressionTitle||t.field,l.infos.push(s)})),Promise.resolve([l])}async _constructPieChartRendererLegendElements(e){const t=this.layer.opacity,s=[],l="Others",r=e.outline;e.attributes.forEach((e=>{const t=new ee({color:e.color,outline:r}),l=e.label||e.valueExpressionTitle||e.field;s.push({label:l,symbol:t})}));const i=s.length?[...s]:[];if(e.othersCategory?.color&&0!==e.othersCategory?.threshold){const t=new ee({color:e.othersCategory.color,outline:r});s.push({label:e.othersCategory.label||l,symbol:t})}if(e.defaultColor?.a){const t=new ee({color:e.defaultColor,outline:r});s.push({label:e.defaultLabel,symbol:t})}const n=await this._getVisualVariableLegendElements(e,this.layer)||[];if(s.length){n.unshift({type:"symbol-table",title:null,infos:s});const t=i.filter((e=>e.label!==l)).map((e=>e.symbol.color)).filter(Boolean),a=D(t,{holePercentage:e.holePercentage,backgroundColor:e.backgroundFillSymbol?.color,effectList:this.effectList,outline:r});n.unshift({type:"pie-chart-ramp",title:this._getRendererTitle(e,this.layer),infos:s,preview:a})}const a=n.reduce(((e,t)=>e.concat(this._getAllInfos(t))),[]).filter((e=>!!e?.symbol&&!e?.preview)).map((e=>this._getSymbolPreview(e,t,{effectList:this.effectList})));return await d(a),n}async _constructRendererLegendElements(e,t={}){const{title:s,sublayer:l}=t,r=l||this.layer;let i=await this._loadRenderer(e);this._hasColorRamp=!1,this._hasOpacityRamp=!1,this._hasSizeRamp=!1,this._scaleDrivenSizeVariable=null;const n=await this._getVisualVariableLegendElements(i,r)||[],a={type:"symbol-table",title:s||this._getRendererTitle(i,r),infos:[]};let o=null,c=!1;const y=new Set;if(de(i)&&!this._hasSizeRamp){const e=await X(i);a.infos.push({label:null,symbol:e})}else if(Be(i)){let e=s;const t=Ue(i)?"univariate-above-and-below-ramp":"univariate-color-size-ramp",l=n.findIndex((e=>"color-ramp"===e.type)),r=-1!==l?n.splice(l,1)[0]:null,a=n.findIndex((e=>"size-ramp"===e.type)),o=-1!==a?n.splice(a,1)[0]:null,u=[];r&&(e=r.title,u.push(r)),o&&(e=o.title,u.push(o)),u.length>0&&n.push({type:t,title:e,infos:u})}else if(Se(i)){const e=N(i);n.push({type:"heatmap-ramp",title:s||i.legendOptions?.title,infos:e,preview:x(e.map((e=>e.color)),{effectList:this.effectList})})}else if(be(i)){const e=i&&i.authoringInfo;if(e&&"relationship"===e.type){const{focus:t,numClasses:s,field1:l,field2:o}=e;if(s&&l&&o){const e=[l,o];let u=q(t)||0;for(const t of e){const{field:e,normalizationField:s,label:l}=t,i=l||{field:this._getFieldAlias(e,r),normField:s&&this._getFieldAlias(s,r)},n=ke.clone();n.angle=u,a.infos.push({label:i,symbol:n}),y.add(n),u+=90}const c=$({focus:t,numClasses:s,infos:i.uniqueValueInfos});n.unshift(c)}}else if(Oe(this.layer)||Pe(this.layer))i.uniqueValueInfos.forEach((e=>{e.symbol&&a.infos.push({label:e.label||e.value,value:e.value,symbol:e.symbol})}));else{const{field:e,field2:t,field3:s,fieldDelimiter:l,valueExpression:n}=i,o=!(!e&&!n||!t&&!s),u=[];if(i.uniqueValueGroups.forEach((i=>{const a={type:"symbol-table",title:i.heading,infos:[]};i.classes.forEach((i=>{const{symbol:u,values:c}=i;if(u){const d=[],y=[];for(const i of c){const{value:a,value2:u,value3:c}=i,h=[],m=[];(e||n)&&(h.push(a),m.push(this._getDomainName(e,a,r))),t&&(h.push(u),m.push(this._getDomainName(t,u,r))),s&&(h.push(c),m.push(this._getDomainName(s,c,r))),d.push(o?h.join(l||""):h[0]),y.push(m.join(" - "))}const h=d.join(", ");let m=i.label;if(!m){const e=y.filter(Boolean);m=e.length?e.join(", "):h}a.infos.push({label:m,value:h,symbol:u})}})),a.infos.length&&u.push(a)})),u.length){const e=u[0];1===u.length&&"title"in e&&!e.title?a.infos.push(...e.infos):a.infos.push(...u)}}i.defaultSymbol&&(a.infos.push({label:i.defaultLabel||"others",symbol:i.defaultSymbol}),c=!0)}else if(ge(i)){o=this._isUnclassedRenderer(i);(!o||!this._hasSizeRamp)&&(i.classBreakInfos.forEach((e=>{e.symbol&&a.infos.unshift({label:e.label||(o?null:e.minValue+" - "+e.maxValue),value:[e.minValue,e.maxValue],symbol:e.symbol})})),o&&(a.title=null),this._updateInfosforClassedSizeRenderer(i,a.infos)),i.defaultSymbol&&!o&&(a.infos.push({label:i.defaultLabel||"others",symbol:i.defaultSymbol}),c=!0)}else if(me(i))if(Pe(this.layer)||Me(this.layer)){const e=this._constructTileImageryStretchRendererElements(i);Ae(e)?n.push(e):a.infos=e}else{const e=this.layer;let t,s;i.statistics&&i.statistics.length&&(t=null!=i.statistics[0].min?i.statistics[0].min:i.statistics[0][0],s=null!=i.statistics[0].max?i.statistics[0].max:i.statistics[0][1]);let l=[];const r=u(e.renderingRule?await e.generateRasterInfo(e.renderingRule):e.serviceRasterInfo),o=r.keyProperties.BandProperties,c=oe[e.rasterInfo.pixelType.toLowerCase()];1===r.bandCount||e.bandIds&&1===e.bandIds.length?(t=null!=t?t:r.statistics?r.statistics[e.bandIds[0]].min:c[0],s=null!=s?s:r.statistics?r.statistics[e.bandIds[0]].max:c[1],t||s?n.push(this._getStretchLegendElements(i,{min:t,max:s})):this._getServerSideLegend()):r.bandCount>=3?o&&o.length>=r.bandCount?e.bandIds&&3===e.bandIds.length?(l=e.bandIds.map((e=>o[e].BandName)),a.infos=this._createSymbolTableElementMultiBand(l)):"lerc"===e.format?(l=[0,1,2].map((e=>o[e].BandName)),a.infos=this._createSymbolTableElementMultiBand(l)):this._getServerSideLegend():"lerc"===e.format?(l=["band1","band2","band3"],a.infos=this._createSymbolTableElementMultiBand(l)):this._getServerSideLegend():this._getServerSideLegend()}else if(he(i))i.colormapInfos.forEach((e=>{a.infos.push({label:e.label,value:e.value,symbol:this._getAppliedCloneSymbol(ce,e.color)})}));else if(pe(i)){let e=i.symbol;switch(t.geometryType){case"point":e="pointSymbol"in r&&r.pointSymbol;break;case"polyline":e="lineSymbol"in r&&r.lineSymbol;break;case"polygon":e="polygonSymbol"in r&&r.polygonSymbol}i.symbol&&!this._hasSizeRamp&&a.infos.push({label:i.label,symbol:e})}else if(ye(i)){i.outputUnit&&(this.title="("+i.toJSON().outputUnit+")"),a.title=i.attributeField;const e=i.getClassBreakInfos();e?.length?e.forEach((e=>{a.infos.push({label:e.minValue+" - "+e.maxValue,symbol:e.symbol})})):a.infos.push({label:i.attributeField,symbol:i.getDefaultSymbol()})}else fe(i)&&n.push(this._getStretchLegendElements(i,{min:0,max:255}));const h=i.defaultSymbol;!h||c||pe(i)||o&&!this._hasColorRamp&&!this._hasSizeRamp&&!this._hasOpacityRamp||n.push({type:"symbol-table",infos:[{label:i.defaultLabel||"others",symbol:h}]}),a.infos.length&&n.unshift(a);const m=null==t.opacity?this.opacity:t.opacity,f=this._isTallSymbol("visualVariables"in i&&i.visualVariables),p=Oe(this.layer)||Pe(this.layer),g=n.reduce(((e,t)=>e.concat(this._getAllInfos(t))),[]).filter((e=>!!e?.symbol)).map((e=>this._getSymbolPreview(e,m,{isDefault:e.symbol===h,applyScaleDrivenSize:!y.has(e.symbol),symbolConfig:{isTall:f,isSquareFill:p},effectList:y.has(e.symbol)?null:this.effectList})));return i=null,await d(g),n}_getServerSideLegend(){setTimeout((()=>this.buildLegendElementsForTools()),0)}_getAllInfos(e){const t=e?.infos;return t?t.reduce(((e,t)=>e.concat(this._getAllInfos(t))),[]):[e]}_constructTileImageryStretchRendererElements(e){const t=this.layer,s=t.rasterInfo,l=s.bandCount||e.statistics.length;let r,i,n=[];const a=s.keyProperties&&s.keyProperties.BandProperties,o=e?.statistics?.length?e.statistics:s?.statistics;if(o)r=void 0!==o[0].min?o[0].min:o[0][0],i=o[0].max||o[0][1];else{const e=oe[t.rasterInfo.pixelType.toLowerCase()];r=e[0],i=e[1]}if(t.hasStandardTime()&&(r=t.getStandardTimeValue(r),i=t.getStandardTimeValue(i)),1===s.bandCount||1===t.bandIds?.length)return this._getStretchLegendElements(e,{min:r,max:i});function u(e){const l=(t?.bandIds?.length?t.bandIds:Array.from(Array(Math.min(s.bandCount,3)).keys())).map((t=>e&&e[t]&&e[t].BandName||"band"+(t+1)));return l.length<3?l.push(l[1]):l.length>3&&l.splice(3),l}return n=a&&a.length>=l?u(a):u(),this._createSymbolTableElementMultiBand(n)}_getStretchLegendElements(e,t){const s=e.colorRamp,l=U(s,t);return{type:"stretch-ramp",title:"",infos:l,preview:x(l.map((e=>e.color)))}}async _getSizeLegendElement(e,t,s,l){return{type:"size-ramp",title:this._hasClusterSizeVariable?this._getClusterTitle(t):e,infos:await W(s,t,await K(s),this.scale,this.view.type,l)}}_createSymbolTableElementMultiBand(e){const t=[],s=["red","green","blue"];return e.forEach(((e,l)=>{t.push({label:{colorName:s[l],bandName:e},src:Y[l],opacity:this.opacity??1})})),t}_updateInfosforClassedSizeRenderer(e,t){const s=e.authoringInfo&&"class-breaks-size"===e.authoringInfo.type,l=e.classBreakInfos.some((e=>P(e.symbol)));if(s&&l){const s=G,l=J,r=e.classBreakInfos.length,i=(s-l)/(r>1?r-1:r);t.forEach(((e,t)=>{e.size=s-i*t}))}}_isTallSymbol(e){let t=!1,s=!1;if(e)for(let l=0;l<e.length&&(!t||!s);l++){const r=e[l];"size"===r.type&&("height"===r.axis&&(t=!0),"width-and-depth"===r.axis&&(s=!0))}return t&&s}async _getSymbolPreview(e,t,s){let l=!s?.isDefault&&null==e.size&&this._hasSizeRamp?g(T.size):e.size;if(this._scaleDrivenSizeVariable&&s?.applyScaleDrivenSize){const{getSize:t}=await import("../../../renderers/visualVariables/support/visualVariableUtils.js");l=t(this._scaleDrivenSizeVariable,null,{view:this.view.type,scale:this.scale,shape:"simple-marker"===e.symbol.type?e.symbol.style:null})}return O(e.symbol,{size:l,opacity:t,scale:!1,symbolConfig:s?.symbolConfig,effectView:s?.effectList}).then((t=>(e.preview=t,e))).catch((()=>(e.preview=null,e)))}async _loadRenderer(e){const t=[],s=this.layer;e=e.clone(),this._hasClusterSizeVariable=!1;const l="visualVariables"in e&&e.visualVariables?.some((e=>"size"===e.type&&"outline"!==e.target&&!ne.test(e.valueExpression)));if(e&&"visualVariables"in e&&!l&&"featureReduction"in s&&"cluster"===s.featureReduction?.type){const t=this.layerView._effectiveRenderer,l=u(M(t,this.view));if(l){const t=s.featureReduction;if("clusterMinSize"in t&&"clusterMaxSize"in t){const{clusterMinSize:e,clusterMaxSize:s}=t;l.legendOptions=new V({showLegend:e!==s})}const r=e.visualVariables||[];e.visualVariables=r.concat([l]),this._hasClusterSizeVariable=!0}}const r=await K(e);if(ge(e)||be(e)){const s=(e.classBreakInfos||e.uniqueValueInfos).map((e=>this._fetchSymbol(e.symbol,r).then((t=>{e.symbol=t})).catch((()=>{e.symbol=null}))));Array.prototype.push.apply(t,s)}return t.push(this._fetchSymbol(e.symbol||e.defaultSymbol,e.defaultSymbol?null:r).then((t=>{this._applySymbolToRenderer(e,t,pe(e))})).catch((()=>{this._applySymbolToRenderer(e,null,pe(e))}))),d(t).then((()=>e))}_applySymbolToRenderer(e,t,s){s?e.symbol=t:e.defaultSymbol=t}async _fetchSymbol(e,t){if(!e)throw new Error;if("web-style"===e.type){const s=this._webStyleSymbolCache;try{const l=await("2d"===this.view.type?e.fetchCIMSymbol({cache:s}):e.fetchSymbol({cache:s}));return this._getAppliedCloneSymbol(l,t)}catch{throw o.getLogger(this.declaredClass).warn("Fetching web-style failed!"),new Error}}return this._getAppliedCloneSymbol(e,t)}_getAppliedCloneSymbol(e,s){if(!e||!s)return e;const l=e.clone(),r=s&&s.toRgba();return l.type.includes("3d")?this._applyColorTo3dSymbol(l,r):"cim"===l.type?F(l,s):l.color&&(l.color=new t(r||l.color)),l}_applyColorTo3dSymbol(e,s){s&&e.symbolLayers.forEach((e=>{e&&(e.material||(e.material={}),e.material.color=new t(s))}))}async _getVisualVariableLegendElements(e,t){if(!("visualVariables"in e)||!e.visualVariables||"vector-field"===e.type)return null;const s=e.visualVariables,l=[],r=[],i=[];for(const c of s)"color"===c.type?l.push(c):"size"===c.type?r.push(c):"opacity"===c.type&&i.push(c);const n=[...l,...r,...i];let a,o;if(0===l.length&&ge(e)&&e.classBreakInfos&&1===e.classBreakInfos.length){const t=e.classBreakInfos[0];a=t&&t.symbol}if(0===l.length&&pe(e)&&(a=e.symbol),a)if(a.type.includes("3d")){const e=a.symbolLayers.getItemAt(0);"water"===e.type?c(e.color)&&(o=e.color):c(e.material)&&c(e.material.color)&&(o=e.material.color)}else a.url||(o=a.color);const u=this.effectList;return(await Promise.all(n.map((async s=>{if(!s.legendOptions||!1!==s.legendOptions.showLegend){const l=de(e)?s.field:this._getRampTitle(s,t);let r=null;const i="getField"in t&&t.getField&&t.getField(s.field),n=i&&C(i);if("color"===s.type){const e=await k(s,null,n);r={type:"color-ramp",title:l,infos:e,preview:x(e.map((e=>e.color)),{effectList:u})},this._hasColorRamp||(this._hasColorRamp=!(null==r.infos||!r.infos.length))}else if("size"===s.type&&"outline"!==s.target)ne.test(s.valueExpression)?this._hasClusterSizeVariable||(this._scaleDrivenSizeVariable=s):(r=await this._getSizeLegendElement(l,s,e,n),this._hasSizeRamp||(this._hasSizeRamp=!(null==r.infos||!r.infos.length)));else if("opacity"===s.type){const e=await k(s,o,n);r={type:"opacity-ramp",title:l,infos:e,preview:x(e.map((e=>e.color)),{effectList:u})},this._hasOpacityRamp||(this._hasOpacityRamp=!(null==r.infos||!r.infos.length))}return r&&r.infos?r:null}})))).filter((e=>!!e))}_getDomainName(e,t,s){if(e&&"function"!=typeof e){const l="getField"in s&&s.getField&&s.getField(e),r=l&&"getFieldDomain"in s&&s.getFieldDomain?s.getFieldDomain(l.name):null;return r&&"coded-value"===r.type?r.getName(t):null}return null}_getClusterTitle(e){const t=this.layer,s=e.field;if("featureReduction"in t&&t.featureReduction&&"cluster"===t.featureReduction.type){const e=t.featureReduction,l="popupTemplate"in e&&e.popupTemplate,r=l&&l.fieldInfos;if(r)for(const t of r)if(t.fieldName===s)return"cluster_count"===s?t.label||{showCount:!0}:t.label}return{showCount:!0}}_getRampTitle(e,t){let s=e.field,l=e.normalizationField,r=!1,i=!1,n=!1,a=null;s="function"==typeof s?null:s,l="function"==typeof l?null:l;const o=e.legendOptions&&e.legendOptions.title;if(null!=o)a=o;else if(e.valueExpressionTitle)a=e.valueExpressionTitle;else{if("renderer"in t&&t.renderer&&"authoringInfo"in t.renderer&&t.renderer.authoringInfo&&t.renderer.authoringInfo.visualVariables){const e=t.renderer.authoringInfo.visualVariables;for(let t=0;t<e.length;t++){const s=e[t];if("color"===s.type){if("ratio"===s.style){r=!0;break}if("percent"===s.style){i=!0;break}if("percent-of-total"===s.style){n=!0;break}}}}a={field:s&&this._getFieldAlias(s,t),normField:l&&this._getFieldAlias(l,t),ratio:r,ratioPercent:i,ratioPercentTotal:n}}return a}_getRendererTitle(e,t){const s=e;if(s.legendOptions&&s.legendOptions.title)return s.legendOptions.title;if(s.valueExpressionTitle)return s.valueExpressionTitle;let l=s.field,r=null,i=null;if(ge(s)&&(r=s.normalizationField,i="percent-of-total"===s.normalizationType),l="function"==typeof l?null:l,r="function"==typeof r?null:r,be(s)){const{field2:e,field3:r,fieldDelimiter:i}=s;let n=l&&this._getFieldAlias(l,t);return e&&(n=`<${n}>${i}<${this._getFieldAlias(e,t)}>`,r&&(n=`${n}${i}<${this._getFieldAlias(r,t)}>`)),n}let n=null;return(l||r)&&(n={field:l&&this._getFieldAlias(l,t),normField:r&&this._getFieldAlias(r,t),normByPct:i}),n}_getFieldAlias(e,t){const s="popupTemplate"in t&&t.popupTemplate,l=s&&s.fieldInfos;let r=null;l&&l.some((t=>e===t.fieldName&&(r=t,!0)));let i=null;"getField"in t&&t.getField?i=t.getField(e):"fieldsIndex"in t&&t.fieldsIndex&&(i=t.fieldsIndex.get(e));const n=r||i;let a=null;return n&&(a=r&&r.label||i&&i.alias||"name"in n&&n.name||"fieldName"in n&&n.fieldName),a}_isUnclassedRenderer(e){const t=e.visualVariables;let s=!1;return ge(e)&&e.classBreakInfos&&1===e.classBreakInfos.length&&t&&(s=e.field?t.some((t=>!(!t||e.field!==t.field||(e.normalizationField||t.normalizationField)&&e.normalizationField!==t.normalizationField))):!!t.length),s}};e([S()],qe.prototype,"children",void 0),e([S({readOnly:!0})],qe.prototype,"effectList",null),e([S()],qe.prototype,"layerView",void 0),e([S()],qe.prototype,"layer",void 0),e([S()],qe.prototype,"legendElements",void 0),e([S({readOnly:!0})],qe.prototype,"opacity",null),e([S()],qe.prototype,"parent",void 0),e([S({readOnly:!0,dependsOn:[]})],qe.prototype,"ready",null),e([S()],qe.prototype,"hideLayersNotInCurrentView",void 0),e([S()],qe.prototype,"keepCacheOnDestroy",void 0),e([S()],qe.prototype,"respectLayerVisibility",void 0),e([S({readOnly:!0})],qe.prototype,"scale",null),e([S()],qe.prototype,"sublayerIds",void 0),e([S({readOnly:!0})],qe.prototype,"isScaleDriven",null),e([S()],qe.prototype,"title",void 0),e([S({readOnly:!0,dependsOn:["ready"],value:0})],qe.prototype,"version",null),e([S()],qe.prototype,"view",void 0),qe=e([_("esri.widgets.Legend.support.ActiveLayerInfo")],qe);const $e=qe;export{$e as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import{addTokenParameter as s}from"../../../kernel.js";import l from"../../../request.js";import"../../../symbols.js";import r from"../../../core/Accessor.js";import i from"../../../core/Collection.js";import n from"../../../core/Handles.js";import{JSONMap as a}from"../../../core/jsonMap.js";import o from"../../../core/Logger.js";import{unwrap as u,isSome as c}from"../../../core/maybe.js";import{eachAlways as d,debounce as y}from"../../../core/promiseUtils.js";import{on as h,watch as m,whenOnce as f,initial as p}from"../../../core/reactiveUtils.js";import{px2pt as g}from"../../../core/screenUtils.js";import{addQueryParameters as b}from"../../../core/urlUtils.js";import{property as S}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{OriginId as v}from"../../../core/accessorSupport/PropertyOrigin.js";import{EffectView as L}from"../../../layers/effects/EffectView.js";import{effectFunctionsFromJSON as w}from"../../../layers/effects/jsonUtils.js";import{ExportImageParameters as E}from"../../../layers/support/ExportImageParameters.js";import{isDateField as C}from"../../../layers/support/fieldUtils.js";import{fromJSON as I}from"../../../renderers/support/jsonUtils.js";import{isSupportedRenderer3D as R}from"../../../renderers/support/rendererConversion.js";import V from"../../../renderers/visualVariables/support/SizeVariableLegendOptions.js";import{applyCIMSymbolColor as F}from"../../../symbols/support/cimSymbolUtils.js";import{SymbolSizeDefaults as T}from"../../../symbols/support/previewUtils.js";import{renderSymbol as z}from"../../../symbols/support/renderUtils.js";import{renderColorRampPreviewHTML as x,renderDotDensityPreviewHTML as j,renderPieChartPreviewHTML as D,renderPreviewHTML as O}from"../../../symbols/support/symbolUtils.js";import{isVolumetricSymbol as P}from"../../../symbols/support/utils.js";import{getClusterSizeVariable as M}from"./clusterUtils.js";import{getColorFromPointCloudStops as A,getRampStopsForPointCloud as B,getStrectchRampStops as U,getRampStops as k}from"./colorRampUtils.js";import{getHeatmapRampStops as N}from"./heatmapRampUtils.js";import{getRotationAngleForFocus as q,getRelationshipRampElement as $}from"./relationshipRampUtils.js";import{getRampStops as W,REAL_WORLD_MAX_SIZE as G,REAL_WORLD_MIN_SIZE as J}from"./sizeRampUtils.js";import{SPECIAL_CHARS_LESS_THAN as Q,SPECIAL_CHARS_GREATER_THAN as H,getSymbolForFlowRenderer as X,getMedianColor as K,RGB_IMG_SOURCE as Y}from"./utils.js";import{formatNumberLabel as Z}from"../../smartMapping/support/utils.js";import ee from"../../../symbols/SimpleMarkerSymbol.js";import te from"../../../symbols/SimpleFillSymbol.js";const se="https://utility.arcgis.com/sharing/tools/legend",le="esri.layers.ImageryLayer",re="esri.layers.ImageryTileLayer",ie="esri.layers.WCSLayer",ne=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i,ae=new a({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"}),oe={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34e38,34e38],f64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ue=new ee({size:6,outline:{color:[128,128,128,.5],width:.5}}),ce=new te({style:"solid"});function de(e){return"flow"===e.type}function ye(e){return"vector-field"===e.type}function he(e){return"raster-colormap"===e.type}function me(e){return"raster-stretch"===e.type}function fe(e){return"raster-shaded-relief"===e.type}function pe(e){return"esri.renderers.SimpleRenderer"===e.declaredClass}function ge(e){return"esri.renderers.ClassBreaksRenderer"===e.declaredClass}function be(e){return"esri.renderers.UniqueValueRenderer"===e.declaredClass}function Se(e){return"esri.renderers.HeatmapRenderer"===e.declaredClass}function _e(e){return Le(e)||we(e)||Ee(e)||ve(e)}function ve(e){return"esri.renderers.PointCloudRGBRenderer"===e.declaredClass}function Le(e){return"esri.renderers.PointCloudClassBreaksRenderer"===e.declaredClass}function we(e){return"esri.renderers.PointCloudStretchRenderer"===e.declaredClass}function Ee(e){return"esri.renderers.PointCloudUniqueValueRenderer"===e.declaredClass}function Ce(e){return"esri.renderers.DotDensityRenderer"===e.declaredClass}function Ie(e){return"esri.renderers.PieChartRenderer"===e.declaredClass}function Re(e,t){return pe(e)||ge(e)||be(e)||Se(e)||Ce(e)||Ie(e)?"2d"===t.type||R(e):me(e)||he(e)||fe(e)||Le(e)||we(e)||Ee(e)||ye(e)||de(e)}function Ve(e){return"esri.layers.BuildingSceneLayer"===e.declaredClass}function Fe(e){return"esri.layers.SubtypeGroupLayer"===e.declaredClass}function Te(e){return"esri.layers.VoxelLayer"===e.declaredClass}function ze(e){return"esri.layers.WMSLayer"===e.declaredClass}function xe(e){return"esri.layers.WMTSLayer"===e.declaredClass}function je(e){return"esri.layers.MapImageLayer"===e.declaredClass}function De(e){return"esri.layers.TileLayer"===e.declaredClass}function Oe(e){return"esri.layers.FeatureLayer"===e.declaredClass}function Pe(e){return e.declaredClass===le}function Me(e){return e.declaredClass===re}function Ae(e){return e.declaredClass===ie}function Be(e){return"stretch-ramp"===e.type}function Ue(e){return"univariate-color-size"===("authoringInfo"in e&&e?.authoringInfo)?.type}function ke(e){const t="authoringInfo"in e&&e?.authoringInfo;return"univariate-color-size"===t?.type&&"above-and-below"===t?.univariateTheme}const Ne=new ee({style:"path",path:"M10,5 L5,0 0,5 M5,0 L5,15",size:15,outline:{width:1,color:[85,85,85,1]}});let qe={},$e=class extends r{constructor(e){super(e),this._handles=new n,this._hasColorRamp=!1,this._hasOpacityRamp=!1,this._hasSizeRamp=!1,this._webStyleSymbolCache=new Map,this._dotDensityUrlCache=new Map,this._scaleDrivenSizeVariable=null,this._hasClusterSizeVariable=!1,this.children=new i,this.layerView=null,this.layer=null,this.legendElements=[],this.parent=null,this.hideLayersNotInCurrentView=!1,this.keepCacheOnDestroy=!1,this.respectLayerVisibility=!0,this.sublayerIds=[],this.title=null,this.view=null}initialize(){const e=()=>this.notifyChange("ready");this._handles.add([h((()=>this.children),"change",(t=>{const{added:s,removed:l}=t,r=this._handles;s.forEach((t=>{const s=`activeLayerInfo-ready-watcher-${t.layer.uid}`;r.add(m((()=>t.ready),e,p),s)})),l.forEach((e=>r.remove(e.layer.uid))),e()}))]),this.keepCacheOnDestroy||(qe={})}destroy(){this._handles.destroy(),this._handles=null,this._webStyleSymbolCache=null,this._dotDensityUrlCache=null,this._scaleDrivenSizeVariable=null,this.keepCacheOnDestroy||(qe=null)}get effectList(){const e=this.layer;let t=null;return"effect"in e&&e.effect&&(t=new L,t.effect=e.effect,t.end(),t.scale=this.scale),t}get opacity(){const e=this.layer.opacity,t=this.parent?.opacity,s=this.layer.parent,l=s&&"uid"in s?this._getParentLayerOpacity(s):null;return null!=t?t*e:null!=l?l*e:e}get ready(){return null===this.layer||(this.children.length>0?this._isGroupActive():this.legendElements.length>0)}get scale(){return this.view&&this.view.scale}get isScaleDriven(){const e=this.layer;if(null===e)return!1;if("effect"in e&&e.effect&&Array.isArray(e.effect))return!0;if("featureReduction"in e&&e.featureReduction){if("cluster"===e.featureReduction.type)return!0;if("binning"===e.featureReduction.type&&"renderer"in e.featureReduction&&e.featureReduction.renderer)return this._isRendererScaleDriven(e.featureReduction.renderer)}return"renderer"in e&&e.renderer?this._isRendererScaleDriven(e.renderer):this._isLayerScaleDriven(this.layer)}get version(){return this._get("version")+1}async buildLegendElementsForFeatureCollections(e){if(!(!this.hideLayersNotInCurrentView||await this._isLayerInCurrentView()))return this.legendElements=[],void this.notifyChange("ready");const t=Array.from(e,(e=>{if(Oe(e))return this._getRendererLegendElements(e.renderer,{title:e.title});if(e.featureSet&&e.featureSet.features.length){const t=e.layerDefinition,s=t&&t.drawingInfo,l=s&&I(s.renderer),r=ae.read(t.geometryType);return l?this._getRendererLegendElements(l,{title:e.name,geometryType:r}):(o.getLogger(this.declaredClass).warn("drawingInfo not available!"),null)}return null}));try{const e=[];await d(t).then((t=>{t.forEach((({value:t})=>t&&e.push(...t)))})),this.legendElements=e,this.notifyChange("ready")}catch(s){o.getLogger(this.declaredClass).warn("error while building legend for layer!",s)}}async buildLegendElementsForRenderer(e){try{const t=!this.hideLayersNotInCurrentView||await this._isLayerInCurrentView();this.legendElements=t?await this._getRendererLegendElements(e):[],this.notifyChange("ready")}catch(t){o.getLogger(this.declaredClass).warn("error while building legend for layer!",t)}}async buildLegendElementsForTools(){const e=this.layer;if(Te(e))this._constructLegendElementsForVoxellayer();else if(xe(e))this._constructLegendElementsForWMTSlayer();else if(ze(e))await this._constructLegendElementsForWMSSublayers();else if(Ve(e))await this._constructLegendElementsForBuildingSceneLayer();else if(je(e)||De(e)||Fe(e))await this._constructLegendElementsForSublayers();else{this._handles.remove("imageryLayers-watcher");let t="default";if(Pe(e)){t=(e?.renderingRule?.functionName||"default")+"_"+(e.bandIds?.length?e.bandIds.join(""):"###")}await this._getLegendLayers(`${e.uid}-${t}`).then((async t=>{this.legendElements=[],this.notifyChange("ready");const s=t.map((async t=>{if(Pe(e)||Me(e)){const t=m((()=>["renderingRule"in e&&e.renderingRule,e.bandIds]),(()=>y((async()=>{qe.default=null,e.renderer?await this.buildLegendElementsForRenderer(e.renderer):await this.buildLegendElementsForTools()}))()));this._handles.add(t,"imageryLayers-watcher")}const s=this._generateSymbolTableElementForLegendLayer(t);s&&s.infos.length&&(Pe(e)&&(s.title=e.title),this.legendElements.push(s)),this.notifyChange("ready")}));await d(s)})).catch((e=>{o.getLogger(this.declaredClass).warn("Request to server for legend has failed!",e)}))}}async _isLayerInCurrentView(){const e=this.layer,t=this.layerView,s=t&&"createQuery"in t&&"queryFeatureCount"in t;if(!s&&!(t&&"createQuery"in e&&"queryFeatureCount"in e))return!0;await f((()=>!t.updating));const l=s?"createQuery"in t&&t.createQuery():"createQuery"in e&&e.createQuery();l.geometry=this.view.extent;return 0!==(s?"queryFeatureCount"in t&&await t.queryFeatureCount(l):"queryFeatureCount"in e&&await e.queryFeatureCount(l))}_getParentLayerOpacity(e){let t=1;const s=e.parent;return s&&"uid"in s&&(t=this._getParentLayerOpacity(s)),e.opacity*t}_isGroupActive(){const e=this.children;return!!e.length&&e.some((e=>e.ready))}_isRendererScaleDriven(e){if("dot-density"===e.type)return!0;const t="valueExpression"in e&&e.valueExpression;if(ne.test(t))return!0;const s="visualVariables"in e&&e.visualVariables;return!!s&&s.some((e=>this._isScaleDrivenSizeVariable(e)))}_isScaleDrivenSizeVariable(e){if(e&&"size"!==e.type)return!1;const t=e,s=t.minSize,l=t.maxSize;return"object"==typeof s&&s?this._isScaleDrivenSizeVariable(s):"object"==typeof l&&l?this._isScaleDrivenSizeVariable(l):!!t.expression||ne.test(t.valueExpression)}_isLayerScaleDriven(e){if("minScale"in e&&e.minScale>0||"maxScale"in e&&e.maxScale>0)return!0;if("sublayers"in e&&e.sublayers)return e.sublayers.some((e=>this._isLayerScaleDriven(e)));const t=e.parent;if(!1===e.loaded&&t&&je(t)&&"source"in e&&e.source&&"map-layer"===e.source.type)for(const s of t.sourceJSON.layers)if(s.id===e.source.mapLayerId&&(s.minScale>0||s.maxScale>0))return!0;return!1}async _constructLegendElementsForVoxellayer(){this.legendElements=[],this._handles.remove("voxel-style-watcher"),this._handles.remove("voxel-current-variable");const e=this.layer;this._handles.add(m((()=>e.currentVariableId),(()=>this._constructLegendElementsForVoxellayer())),"voxel-current-variable"),this._handles.add(m((()=>e.getVariableStyles()),(()=>this._constructLegendElementsForVoxellayer())),"voxel-style-watcher");const t=u(e.getVariableStyle(null)),s=[];if(t)if(t.uniqueValues?.length){const e=[];t.uniqueValues.forEach((t=>{t.enabled&&e.push({label:t.label||`${t.value}`,value:t.value,symbol:new te({color:t.color,outline:null})})})),e.length&&s.push({type:"symbol-table",title:t.label,infos:e})}else if(t.transferFunction){const{colorStops:e,stretchRange:l}=t.transferFunction,r=e.toArray().reverse(),i=l.map(((e,t)=>`${0===t?Q:H} ${Z(e)}`)).reverse(),n=r.map((e=>({color:e.color,value:null,label:null})));n[0].label=i[0],n[n.length-1].label=i[1],s.push({type:"color-ramp",title:t.label,infos:n,preview:x(r.map((e=>e.color)))})}const l=e.opacity,r=s.reduce(((e,t)=>e.concat(this._getAllInfos(t))),[]).filter((e=>!!e?.symbol)).map((e=>this._getSymbolPreview(e,l)));await d(r),this.legendElements=s,this.notifyChange("ready")}_constructLegendElementsForWMTSlayer(){this.legendElements=[],this._handles.remove("wmts-activeLayer-watcher");const e=this.layer.activeLayer;if(this._handles.add(m((()=>{const{layer:e}=this;return e&&"activeLayer"in e&&e.activeLayer}),(()=>this._constructLegendElementsForWMTSlayer())),"wmts-activeLayer-watcher"),e.styleId&&e.styles){let t=null;e.styles.some((s=>e.styleId===s.id&&(t=s.legendUrl,!0))),t&&(this.legendElements=[{type:"symbol-table",title:e.title,infos:[{src:t,opacity:this.opacity}]}])}this.notifyChange("ready")}async _constructLegendElementsForWMSSublayers(){this.legendElements=[],this._handles.remove("wms-sublayers-watcher");const e=this.layer;let t=null;(e.customParameters||e.customLayerParameters)&&(t={...e.customParameters,...e.customLayerParameters}),this._handles.add(m((()=>{const{layer:e}=this;return e&&"sublayers"in e&&e.sublayers}),(()=>this._constructLegendElementsForWMSSublayers())),"wms-sublayers-watcher"),this.legendElements=await this._generateLegendElementsForWMSSublayers(e.sublayers,t),this.notifyChange("ready")}async _generateLegendElementsForWMSSublayers(e,t){const s=[];this._handles.add(e.on("change",(()=>this._constructLegendElementsForWMSSublayers())),"wms-sublayers-watcher");const l=e.toArray();for(const r of l){const e=m((()=>[r.title,r.visible,r.legendEnabled]),(()=>this._constructLegendElementsForWMSSublayers()));if(this._handles.add(e,"wms-sublayers-watcher"),!this.respectLayerVisibility||r.visible&&r.legendEnabled){const e=await this._generateSymbolTableElementForWMSSublayer(r,t);e&&e.infos.length&&s.unshift(e)}}return s}async _generateSymbolTableElementForWMSSublayer(e,t){if(!e.legendUrl&&e.sublayers){const s=(await this._generateLegendElementsForWMSSublayers(e.sublayers,t)).filter((e=>e));return{type:"symbol-table",title:e.title,infos:s}}return this._generateSymbolTableElementForLegendUrl(e,t)}async _generateSymbolTableElementForLegendUrl(e,t){let s=e.legendUrl;if(!s)return;const r={type:"symbol-table",title:e.title||e.name||e.id&&e.id+"",infos:[]};t&&(s=b(s,t));let i=null;const n=e.layer?.opacity;try{i=(await l(s,{responseType:"image"})).data,i&&(i.style.opacity=n)}catch{}return r.infos.push({src:s,preview:i,opacity:n}),r}_getLegendLayers(e,t){const s=qe&&qe[e];return s?Promise.resolve(s):this._legendRequest(t).then((t=>{const s=t.layers;return qe[e]=s,s}))}_legendRequest(e){const t=this.layer;let s={f:"json",dynamicLayers:e};if(Pe(t)){const e=t.exportImageServiceParameters.renderingRule;if(e&&(s.renderingRule=JSON.stringify(e.rasterFunctionDefinition||e.toJSON())),t.bandIds&&(s.bandIds=t.bandIds.join()),t.raster||t.viewId||t.customParameters){const{raster:e,viewId:l,customParameters:r}=t;s={raster:e,viewId:l,...s,...r}}}let r=t.url.replace(/(\/)+$/,"");if("version"in t&&t.version>=10.01){const e=r.indexOf("?");e>-1?r=r.substring(0,e)+"/legend"+r.substring(e):r+="/legend"}else{const e=r.toLowerCase().indexOf("/rest/"),t=r.substring(0,e)+r.substring(e+5,r.length);r=se+"?soapUrl="+encodeURI(t)+"&returnbytes=true"}return l(r,{query:s}).then((e=>e.data))}async _constructLegendElementsForBuildingSceneLayer(){this.legendElements=[],this._handles.remove("sublayers-watcher");const e=this.layer;this._handles.add(m((()=>e.sublayers),(()=>this._constructLegendElementsForBuildingSceneLayer())),"sublayers-watcher");try{this.legendElements=await this._generateLegendElementsForBuildingSublayers(e.sublayers,this.opacity),this.notifyChange("ready")}catch(t){o.getLogger(this.declaredClass).warn("Request to server for legend has failed!",t)}}async _generateLegendElementsForBuildingSublayers(e,t){let s=[];this._handles.add(e.on("change",(()=>this._constructLegendElementsForBuildingSceneLayer())),"sublayers-watcher");const l=e.toArray();for(const r of l){const e=m((()=>["renderer"in r&&r.renderer,r.opacity,r.title,r.visible]),(()=>this._constructLegendElementsForBuildingSceneLayer()));if(this._handles.add(e,"sublayers-watcher"),!this.respectLayerVisibility||r.visible){const e=r&&null!=r.opacity?r.opacity:null,l=null!=e?e*t:t;if("building-group"===r.type){const e={type:"symbol-table",title:r.title,infos:[]},t=await this._generateLegendElementsForBuildingSublayers(r.sublayers,l);e.infos.push(...t),s=[e,...s]}else if(r.renderer){s=[...await this._getRendererLegendElements(r.renderer,{title:r.title,opacity:l,sublayer:r}),...s]}}}return s.filter((e=>!!e&&(!("infos"in e)||e.infos.length>0)))}async _constructLegendElementsForSublayers(){this.legendElements=[],this._handles.remove("sublayers-watcher");const e=this.layer;this._handles.add(m((()=>e.sublayers),(()=>this._constructLegendElementsForSublayers)),"sublayers-watcher");try{this.legendElements=await this._generateLegendElementsForSublayers(e.sublayers,this.opacity),this.notifyChange("ready")}catch(t){o.getLogger(this.declaredClass).warn("Request to server for legend has failed!",t)}}async _generateLegendElementsForSublayers(e,t,s){const l=this.layer;let r=[];this._handles.add(e.on("change",(()=>this._constructLegendElementsForSublayers())),"sublayers-watcher");let i=e.toArray();!s&&this.sublayerIds&&this.sublayerIds.length&&(i=this.sublayerIds.map((e=>l.findSublayerById(e))).filter(Boolean));for(const n of i){const e=m((()=>[n.renderer,n.opacity,n.title,n.visible,n.legendEnabled]),(()=>this._constructLegendElementsForSublayers()));if(this._handles.add(e,"sublayers-watcher"),!this.respectLayerVisibility||n.visible&&n.legendEnabled&&this._isSublayerInScale(n)){const e=n&&null!=n.opacity?n.opacity:null,l=null!=e?e*t:t;if(n.renderer&&!n.sublayers&&n.originIdOf("renderer")>v.SERVICE){await n.load();r=[...await this._getRendererLegendElements(n.renderer,{title:n.title,opacity:l,sublayer:n}),...r]}else{const e=await this._generateSymbolTableElementForSublayer(n,l,s);e&&r.unshift(e)}}}return r.filter((e=>!!e&&(!("infos"in e)||e.infos.length>0)))}async _generateSymbolTableElementForSublayer(e,t,s){if(!s){s=new Map;const t=this.layer,l=e.source;let r=null;if(!(!l||"map-layer"===l.type&&l.mapLayerId===e.id&&(!l.gdbVersion||l.gdbVersion===("gdbVersion"in t&&t.gdbVersion)))||e.originIdOf("renderer")>v.SERVICE||e.originIdOf("labelingInfo")>v.SERVICE||e.originIdOf("labelsVisible")>v.SERVICE){const e=new E({layer:this.layer});r=e.hasDynamicLayers?e.dynamicLayers:null,e.destroy()}const i=r||`${t.uid}-default`;(await this._getLegendLayers(i,r)).forEach((e=>s.set(e.layerId,e)))}const l=s.get(e.id);if((!l||l?.subLayerIds&&l.defaultVisibility)&&e.sublayers){const l=await this._generateLegendElementsForSublayers(e.sublayers,t,s);return{type:"symbol-table",title:e.title,infos:l}}return this._generateSymbolTableElementForLegendLayer(l,e,t)}_generateSymbolTableElementForLegendLayer(e,t,s){if(!e||!e.legend||this.respectLayerVisibility&&!this._isLegendLayerInScale(e,t))return null;const l=t?.renderer;let r=t?.title||e.layerName;if(l&&(!t||t?.originIdOf("renderer")>v.SERVICE)){const e=t?.title||this._getRendererTitle(l,t);e&&(r&&"string"!=typeof e&&"title"in e&&(e.title=r),r=e)}const i={type:"symbol-table",title:r,legendType:e.legendType?e.legendType:null,infos:[]},n=t?this._sanitizeLegendForSublayer(e.legend.slice(),t):e.legend;return e.legendGroups?.length>0?e.legendGroups.forEach((t=>{const l={type:"symbol-table",title:t.heading,legendType:e.legendType?e.legendType:null,infos:this._generateSymbolTableElementInfosForLegendLayer(n.filter((e=>e.groupId===t.id)),e.layerId,s)};l.infos?.length>0&&i.infos.push(l)})):i.infos=this._generateSymbolTableElementInfosForLegendLayer(n,e.layerId,s),i.infos.length>0?i:null}_generateSymbolTableElementInfosForLegendLayer(e,t,l){return e.map((e=>{let r=e.url;if(e.imageData&&e.imageData.length>0)r=`data:image/png;base64,${e.imageData}`;else{if(0===r.indexOf("http"))return null;r=s(`${this.layer.url}/${t}/images/${r}`)}return{label:e.label,src:r,opacity:l??this.opacity,width:e.width,height:e.height}})).filter((e=>!!e))}_isSublayerInScale(e){const t=e.minScale||0,s=e.maxScale||0;return!(t>0&&t<this.scale||s>this.scale)}_isLegendLayerInScale(e,t){const s=t||this.layer;let l=null,r=null,i=!0;return!s.minScale&&0!==s.minScale||!s.maxScale&&0!==s.maxScale?(0===e.minScale&&s.tileInfo&&(l=s.tileInfo.lods[0].scale),0===e.maxScale&&s.tileInfo&&(r=s.tileInfo.lods[s.tileInfo.lods.length-1].scale)):(l=Math.min(s.minScale,e.minScale)||s.minScale||e.minScale,r=Math.max(s.maxScale,e.maxScale)),(l>0&&l<this.scale||r>this.scale)&&(i=!1),i}_sanitizeLegendForSublayer(e,t){if("version"in this.layer&&this.layer.version<10.1||0===e.length)return e;const s=t.renderer,l=e.some((e=>e.values));let r=null,i=null;return l&&e.some(((e,t)=>(e.values||(r=t,i=e,i.label||(i.label="others")),null!=i))),s?"unique-value"===s.type?i&&(e.splice(r,1),e.push(i)):"class-breaks"===s.type&&(i&&e.splice(r,1),e.reverse(),i&&e.push(i)):i&&(e.splice(r,1),e.push(i)),e}async _getRendererLegendElements(e,t={}){return Re(e,this.view)?_e(e)?this._constructPointCloudRendererLegendElements(e,t):Ce(e)?this._constructDotDensityRendererLegendElements(e):Ie(e)?this._constructPieChartRendererLegendElements(e):this._constructRendererLegendElements(e,t):(o.getLogger(this.declaredClass).warn(`Renderer of type '${e.type}' not supported!`),[])}_getPointCloudRendererTitle(e){return e.legendOptions&&e.legendOptions.title||e.field}_constructPointCloudRendererLegendElements(e,t={}){const s=t.title,l=[];let r=null,i=null;if(Le(e))r={type:"symbol-table",title:s||this._getPointCloudRendererTitle(e),infos:[]},e.colorClassBreakInfos.forEach((e=>{r.infos.unshift({label:e.label||e.minValue+" - "+e.maxValue,value:[e.minValue,e.maxValue],symbol:this._getAppliedCloneSymbol(ue,e.color)})}));else if(we(e)){const t=e.stops;let l=null;if(t.length&&(1===t.length&&(l=t[0].color),!l)){const e=t[0].value,s=t[t.length-1].value;if(null!=e&&null!=s){l=A(e+(s-e)/2,t)}}r={type:"symbol-table",title:null,infos:[{label:null,value:null,symbol:this._getAppliedCloneSymbol(ue,l||ue.color)}]};const n=B(e.stops);i={type:"color-ramp",title:s||this._getPointCloudRendererTitle(e),infos:n,preview:x(n.map((e=>e.color)))}}else Ee(e)&&(r={type:"symbol-table",title:s||this._getPointCloudRendererTitle(e),infos:[]},e.colorUniqueValueInfos.forEach((e=>{r.infos.push({label:e.label||e.values.join(", "),value:e.values.join(", "),symbol:this._getAppliedCloneSymbol(ue,e.color)})})));r&&r.infos.length&&l.push(r),i&&i.infos.length&&l.push(i);const n=l.reduce(((e,t)=>e.concat(t.infos)),[]).filter((e=>!!e.symbol)).map((t=>this._getSymbolPreview(t,this.opacity,{symbolConfig:{applyColorModulation:!!e.colorModulation}})));return d(n).then((()=>l))}_getElementInfoForDotDensity(e,t){const{backgroundColor:s,outline:l,dotSize:r}=e,i=this.effectList?.effects.map((e=>e.toJSON())),n=w(i),a=r+"-"+t+"-"+s+"-"+(l&&JSON.stringify(l.toJSON()))+"-"+n,o=this._dotDensityUrlCache,u=o.has(a)?o.get(a):j(e,t);o.set(a,u);const c={shape:{type:"image",x:0,y:0,width:u.width,height:u.height,src:u.src},fill:null,stroke:null,offset:[0,0]},d=z([[c]],[u.width,u.height],{effectView:this.effectList});return{opacity:1,src:u.src,preview:d,width:u.width,height:u.height}}_constructDotDensityRendererLegendElements(e){const t=e.calculateDotValue(this.view.scale),s=e.legendOptions&&e.legendOptions.unit,l={type:"symbol-table",title:{value:t&&Math.round(t),unit:s||""},infos:[]};return e.attributes.forEach((t=>{const s=this._getElementInfoForDotDensity(e,t.color);s.label=t.label||t.valueExpressionTitle||t.field,l.infos.push(s)})),Promise.resolve([l])}async _constructPieChartRendererLegendElements(e){const t=this.layer.opacity,s=[],l="Others",r=e.outline;e.attributes.forEach((e=>{const t=new ee({color:e.color,outline:r}),l=e.label||e.valueExpressionTitle||e.field;s.push({label:l,symbol:t})}));const i=s.length?[...s]:[];if(e.othersCategory?.color&&0!==e.othersCategory?.threshold){const t=new ee({color:e.othersCategory.color,outline:r});s.push({label:e.othersCategory.label||l,symbol:t})}if(e.defaultColor?.a){const t=new ee({color:e.defaultColor,outline:r});s.push({label:e.defaultLabel,symbol:t})}const n=await this._getVisualVariableLegendElements(e,this.layer)||[];if(s.length){n.unshift({type:"symbol-table",title:null,infos:s});const t=i.filter((e=>e.label!==l)).map((e=>e.symbol.color)).filter(Boolean),a=D(t,{holePercentage:e.holePercentage,backgroundColor:e.backgroundFillSymbol?.color,effectList:this.effectList,outline:r});n.unshift({type:"pie-chart-ramp",title:this._getRendererTitle(e,this.layer),infos:s,preview:a})}const a=n.reduce(((e,t)=>e.concat(this._getAllInfos(t))),[]).filter((e=>!!e?.symbol&&!e?.preview)).map((e=>this._getSymbolPreview(e,t,{effectList:this.effectList})));return await d(a),n}async _constructRendererLegendElements(e,t={}){const{title:s,sublayer:l}=t,r=l||this.layer;let i=await this._loadRenderer(e);this._hasColorRamp=!1,this._hasOpacityRamp=!1,this._hasSizeRamp=!1,this._scaleDrivenSizeVariable=null;const n=await this._getVisualVariableLegendElements(i,r)||[],a={type:"symbol-table",title:s||this._getRendererTitle(i,r),infos:[]};let o=null,c=!1;const y=new Set;if(de(i)&&!this._hasSizeRamp){const e=await X(i);a.infos.push({label:null,symbol:e})}else if(Ue(i)){let e=s;const t=ke(i)?"univariate-above-and-below-ramp":"univariate-color-size-ramp",l=n.findIndex((e=>"color-ramp"===e.type)),r=-1!==l?n.splice(l,1)[0]:null,a=n.findIndex((e=>"size-ramp"===e.type)),o=-1!==a?n.splice(a,1)[0]:null,u=[];r&&(e=r.title,u.push(r)),o&&(e=o.title,u.push(o)),u.length>0&&n.push({type:t,title:e,infos:u})}else if(Se(i)){const e=N(i);n.push({type:"heatmap-ramp",title:s||i.legendOptions?.title,infos:e,preview:x(e.map((e=>e.color)),{effectList:this.effectList})})}else if(be(i)){const e=i&&i.authoringInfo;if(e&&"relationship"===e.type){const{focus:t,numClasses:s,field1:l,field2:o}=e;if(s&&l&&o){const e=[l,o];let u=q(t)||0;for(const t of e){const{field:e,normalizationField:s,label:l}=t,i=l||{field:this._getFieldAlias(e,r),normField:s&&this._getFieldAlias(s,r)},n=Ne.clone();n.angle=u,a.infos.push({label:i,symbol:n}),y.add(n),u+=90}const c=$({focus:t,numClasses:s,infos:i.uniqueValueInfos});n.unshift(c)}}else if(Pe(this.layer)||Me(this.layer))i.uniqueValueInfos.forEach((e=>{e.symbol&&a.infos.push({label:e.label||e.value,value:e.value,symbol:e.symbol})}));else{const{field:e,field2:t,field3:s,fieldDelimiter:l,valueExpression:n}=i,o=!(!e&&!n||!t&&!s),u=[];if(i.uniqueValueGroups.forEach((i=>{const a={type:"symbol-table",title:i.heading,infos:[]};i.classes.forEach((i=>{const{symbol:u,values:c}=i;if(u){const d=[],y=[];for(const i of c){const{value:a,value2:u,value3:c}=i,h=[],m=[];(e||n)&&(h.push(a),m.push(this._getDomainName(e,a,r))),t&&(h.push(u),m.push(this._getDomainName(t,u,r))),s&&(h.push(c),m.push(this._getDomainName(s,c,r))),d.push(o?h.join(l||""):h[0]),y.push(m.join(" - "))}const h=d.join(", ");let m=i.label;if(!m){const e=y.filter(Boolean);m=e.length?e.join(", "):h}a.infos.push({label:m,value:h,symbol:u})}})),a.infos.length&&u.push(a)})),u.length){const e=u[0];1===u.length&&"title"in e&&!e.title?a.infos.push(...e.infos):a.infos.push(...u)}}i.defaultSymbol&&(a.infos.push({label:i.defaultLabel||"others",symbol:i.defaultSymbol}),c=!0)}else if(ge(i)){o=this._isUnclassedRenderer(i);(!o||!this._hasSizeRamp)&&(i.classBreakInfos.forEach((e=>{e.symbol&&a.infos.unshift({label:e.label||(o?null:e.minValue+" - "+e.maxValue),value:[e.minValue,e.maxValue],symbol:e.symbol})})),o&&(a.title=null),this._updateInfosforClassedSizeRenderer(i,a.infos)),i.defaultSymbol&&!o&&(a.infos.push({label:i.defaultLabel||"others",symbol:i.defaultSymbol}),c=!0)}else if(me(i))if(Me(this.layer)||Ae(this.layer)){const e=this._constructTileImageryStretchRendererElements(i);Be(e)?n.push(e):a.infos=e}else{const e=this.layer;let t,s;i.statistics&&i.statistics.length&&(t=null!=i.statistics[0].min?i.statistics[0].min:i.statistics[0][0],s=null!=i.statistics[0].max?i.statistics[0].max:i.statistics[0][1]);let l=[];const r=u(e.renderingRule?await e.generateRasterInfo(e.renderingRule):e.serviceRasterInfo),o=r.keyProperties.BandProperties,c=oe[e.rasterInfo.pixelType.toLowerCase()];1===r.bandCount||e.bandIds&&1===e.bandIds.length?(t=null!=t?t:r.statistics?r.statistics[e.bandIds[0]].min:c[0],s=null!=s?s:r.statistics?r.statistics[e.bandIds[0]].max:c[1],t||s?n.push(this._getStretchLegendElements(i,{min:t,max:s})):this._getServerSideLegend()):r.bandCount>=3?o&&o.length>=r.bandCount?e.bandIds&&3===e.bandIds.length?(l=e.bandIds.map((e=>o[e].BandName)),a.infos=this._createSymbolTableElementMultiBand(l)):"lerc"===e.format?(l=[0,1,2].map((e=>o[e].BandName)),a.infos=this._createSymbolTableElementMultiBand(l)):this._getServerSideLegend():"lerc"===e.format?(l=["band1","band2","band3"],a.infos=this._createSymbolTableElementMultiBand(l)):this._getServerSideLegend():this._getServerSideLegend()}else if(he(i))i.colormapInfos.forEach((e=>{a.infos.push({label:e.label,value:e.value,symbol:this._getAppliedCloneSymbol(ce,e.color)})}));else if(pe(i)){let e=i.symbol;switch(t.geometryType){case"point":e="pointSymbol"in r&&r.pointSymbol;break;case"polyline":e="lineSymbol"in r&&r.lineSymbol;break;case"polygon":e="polygonSymbol"in r&&r.polygonSymbol}i.symbol&&!this._hasSizeRamp&&a.infos.push({label:i.label,symbol:e})}else if(ye(i)){i.outputUnit&&(this.title="("+i.toJSON().outputUnit+")"),a.title=i.attributeField;const e=i.getClassBreakInfos();e?.length?e.forEach((e=>{a.infos.push({label:e.minValue+" - "+e.maxValue,symbol:e.symbol})})):a.infos.push({label:i.attributeField,symbol:i.getDefaultSymbol()})}else fe(i)&&n.push(this._getStretchLegendElements(i,{min:0,max:255}));const h=i.defaultSymbol;!h||c||pe(i)||o&&!this._hasColorRamp&&!this._hasSizeRamp&&!this._hasOpacityRamp||n.push({type:"symbol-table",infos:[{label:i.defaultLabel||"others",symbol:h}]}),a.infos.length&&n.unshift(a);const m=null==t.opacity?this.opacity:t.opacity,f=this._isTallSymbol("visualVariables"in i&&i.visualVariables),p=Pe(this.layer)||Me(this.layer),g=n.reduce(((e,t)=>e.concat(this._getAllInfos(t))),[]).filter((e=>!!e?.symbol)).map((e=>this._getSymbolPreview(e,m,{isDefault:e.symbol===h,applyScaleDrivenSize:!y.has(e.symbol),symbolConfig:{isTall:f,isSquareFill:p},effectList:y.has(e.symbol)?null:this.effectList})));return i=null,await d(g),n}_getServerSideLegend(){setTimeout((()=>this.buildLegendElementsForTools()),0)}_getAllInfos(e){const t=e?.infos;return t?t.reduce(((e,t)=>e.concat(this._getAllInfos(t))),[]):[e]}_constructTileImageryStretchRendererElements(e){const t=this.layer,s=t.rasterInfo,l=s.bandCount||e.statistics.length;let r,i,n=[];const a=s.keyProperties&&s.keyProperties.BandProperties,o=e?.statistics?.length?e.statistics:s?.statistics;if(o)r=void 0!==o[0].min?o[0].min:o[0][0],i=o[0].max||o[0][1];else{const e=oe[t.rasterInfo.pixelType.toLowerCase()];r=e[0],i=e[1]}if(t.hasStandardTime()&&(r=t.getStandardTimeValue(r),i=t.getStandardTimeValue(i)),1===s.bandCount||1===t.bandIds?.length)return this._getStretchLegendElements(e,{min:r,max:i});function u(e){const l=(t?.bandIds?.length?t.bandIds:Array.from(Array(Math.min(s.bandCount,3)).keys())).map((t=>e&&e[t]&&e[t].BandName||"band"+(t+1)));return l.length<3?l.push(l[1]):l.length>3&&l.splice(3),l}return n=a&&a.length>=l?u(a):u(),this._createSymbolTableElementMultiBand(n)}_getStretchLegendElements(e,t){const s=e.colorRamp,l=U(s,t);return{type:"stretch-ramp",title:"",infos:l,preview:x(l.map((e=>e.color)))}}async _getSizeLegendElement(e,t,s,l){return{type:"size-ramp",title:this._hasClusterSizeVariable?this._getClusterTitle(t):e,infos:await W(s,t,await K(s),this.scale,this.view.type,l)}}_createSymbolTableElementMultiBand(e){const t=[],s=["red","green","blue"];return e.forEach(((e,l)=>{t.push({label:{colorName:s[l],bandName:e},src:Y[l],opacity:this.opacity??1})})),t}_updateInfosforClassedSizeRenderer(e,t){const s=e.authoringInfo&&"class-breaks-size"===e.authoringInfo.type,l=e.classBreakInfos.some((e=>P(e.symbol)));if(s&&l){const s=G,l=J,r=e.classBreakInfos.length,i=(s-l)/(r>1?r-1:r);t.forEach(((e,t)=>{e.size=s-i*t}))}}_isTallSymbol(e){let t=!1,s=!1;if(e)for(let l=0;l<e.length&&(!t||!s);l++){const r=e[l];"size"===r.type&&("height"===r.axis&&(t=!0),"width-and-depth"===r.axis&&(s=!0))}return t&&s}async _getSymbolPreview(e,t,s){let l=!s?.isDefault&&null==e.size&&this._hasSizeRamp?g(T.size):e.size;if(this._scaleDrivenSizeVariable&&s?.applyScaleDrivenSize){const{getSize:t}=await import("../../../renderers/visualVariables/support/visualVariableUtils.js");l=t(this._scaleDrivenSizeVariable,null,{view:this.view.type,scale:this.scale,shape:"simple-marker"===e.symbol.type?e.symbol.style:null})}return O(e.symbol,{size:l,opacity:t,scale:!1,symbolConfig:s?.symbolConfig,effectView:s?.effectList}).then((t=>(e.preview=t,e))).catch((()=>(e.preview=null,e)))}async _loadRenderer(e){const t=[],s=this.layer;e=e.clone(),this._hasClusterSizeVariable=!1;const l="visualVariables"in e&&e.visualVariables?.some((e=>"size"===e.type&&"outline"!==e.target&&!ne.test(e.valueExpression)));if(e&&"visualVariables"in e&&!l&&"featureReduction"in s&&"cluster"===s.featureReduction?.type){const t=this.layerView._effectiveRenderer,l=u(M(t,this.view));if(l){const t=s.featureReduction;if("clusterMinSize"in t&&"clusterMaxSize"in t){const{clusterMinSize:e,clusterMaxSize:s}=t;l.legendOptions=new V({showLegend:e!==s})}const r=e.visualVariables||[];e.visualVariables=r.concat([l]),this._hasClusterSizeVariable=!0}}const r=await K(e);if(ge(e)||be(e)){const s=(e.classBreakInfos||e.uniqueValueInfos).map((e=>this._fetchSymbol(e.symbol,r).then((t=>{e.symbol=t})).catch((()=>{e.symbol=null}))));Array.prototype.push.apply(t,s)}return t.push(this._fetchSymbol(e.symbol||e.defaultSymbol,e.defaultSymbol?null:r).then((t=>{this._applySymbolToRenderer(e,t,pe(e))})).catch((()=>{this._applySymbolToRenderer(e,null,pe(e))}))),d(t).then((()=>e))}_applySymbolToRenderer(e,t,s){s?e.symbol=t:e.defaultSymbol=t}async _fetchSymbol(e,t){if(!e)throw new Error;if("web-style"===e.type){const s=this._webStyleSymbolCache;try{const l=await("2d"===this.view.type?e.fetchCIMSymbol({cache:s}):e.fetchSymbol({cache:s}));return this._getAppliedCloneSymbol(l,t)}catch{throw o.getLogger(this.declaredClass).warn("Fetching web-style failed!"),new Error}}return this._getAppliedCloneSymbol(e,t)}_getAppliedCloneSymbol(e,s){if(!e||!s)return e;const l=e.clone(),r=s&&s.toRgba();return l.type.includes("3d")?this._applyColorTo3dSymbol(l,r):"cim"===l.type?F(l,s):l.color&&(l.color=new t(r||l.color)),l}_applyColorTo3dSymbol(e,s){s&&e.symbolLayers.forEach((e=>{e&&(e.material||(e.material={}),e.material.color=new t(s))}))}async _getVisualVariableLegendElements(e,t){if(!("visualVariables"in e)||!e.visualVariables||"vector-field"===e.type)return null;const s=e.visualVariables,l=[],r=[],i=[];for(const c of s)"color"===c.type?l.push(c):"size"===c.type?r.push(c):"opacity"===c.type&&i.push(c);const n=[...l,...r,...i];let a,o;if(0===l.length&&ge(e)&&e.classBreakInfos&&1===e.classBreakInfos.length){const t=e.classBreakInfos[0];a=t&&t.symbol}if(0===l.length&&pe(e)&&(a=e.symbol),a)if(a.type.includes("3d")){const e=a.symbolLayers.getItemAt(0);"water"===e.type?c(e.color)&&(o=e.color):c(e.material)&&c(e.material.color)&&(o=e.material.color)}else a.url||(o=a.color);const u=this.effectList;return(await Promise.all(n.map((async s=>{if(!s.legendOptions||!1!==s.legendOptions.showLegend){const l=de(e)?s.field:this._getRampTitle(s,t);let r=null;const i="getField"in t&&t.getField&&t.getField(s.field),n=i&&C(i);if("color"===s.type){const e=await k(s,null,n);r={type:"color-ramp",title:l,infos:e,preview:x(e.map((e=>e.color)),{effectList:u})},this._hasColorRamp||(this._hasColorRamp=!(null==r.infos||!r.infos.length))}else if("size"===s.type&&"outline"!==s.target)ne.test(s.valueExpression)?this._hasClusterSizeVariable||(this._scaleDrivenSizeVariable=s):(r=await this._getSizeLegendElement(l,s,e,n),this._hasSizeRamp||(this._hasSizeRamp=!(null==r.infos||!r.infos.length)));else if("opacity"===s.type){const e=await k(s,o,n);r={type:"opacity-ramp",title:l,infos:e,preview:x(e.map((e=>e.color)),{effectList:u})},this._hasOpacityRamp||(this._hasOpacityRamp=!(null==r.infos||!r.infos.length))}return r&&r.infos?r:null}})))).filter((e=>!!e))}_getDomainName(e,t,s){if(e&&"function"!=typeof e){const l="getField"in s&&s.getField&&s.getField(e),r=l&&"getFieldDomain"in s&&s.getFieldDomain?s.getFieldDomain(l.name):null;return r&&"coded-value"===r.type?r.getName(t):null}return null}_getClusterTitle(e){const t=this.layer,s=e.field;if("featureReduction"in t&&t.featureReduction&&"cluster"===t.featureReduction.type){const e=t.featureReduction,l="popupTemplate"in e&&e.popupTemplate,r=l&&l.fieldInfos;if(r)for(const t of r)if(t.fieldName===s)return"cluster_count"===s?t.label||{showCount:!0}:t.label}return{showCount:!0}}_getRampTitle(e,t){let s=e.field,l=e.normalizationField,r=!1,i=!1,n=!1,a=null;s="function"==typeof s?null:s,l="function"==typeof l?null:l;const o=e.legendOptions&&e.legendOptions.title;if(null!=o)a=o;else if(e.valueExpressionTitle)a=e.valueExpressionTitle;else{if("renderer"in t&&t.renderer&&"authoringInfo"in t.renderer&&t.renderer.authoringInfo&&t.renderer.authoringInfo.visualVariables){const e=t.renderer.authoringInfo.visualVariables;for(let t=0;t<e.length;t++){const s=e[t];if("color"===s.type){if("ratio"===s.style){r=!0;break}if("percent"===s.style){i=!0;break}if("percent-of-total"===s.style){n=!0;break}}}}a={field:s&&this._getFieldAlias(s,t),normField:l&&this._getFieldAlias(l,t),ratio:r,ratioPercent:i,ratioPercentTotal:n}}return a}_getRendererTitle(e,t){const s=e;if(s.legendOptions&&s.legendOptions.title)return s.legendOptions.title;if(s.valueExpressionTitle)return s.valueExpressionTitle;let l=s.field,r=null,i=null;if(ge(s)&&(r=s.normalizationField,i="percent-of-total"===s.normalizationType),l="function"==typeof l?null:l,r="function"==typeof r?null:r,be(s)){const{field2:e,field3:r,fieldDelimiter:i}=s;let n=l&&this._getFieldAlias(l,t);return e&&(n=`<${n}>${i}<${this._getFieldAlias(e,t)}>`,r&&(n=`${n}${i}<${this._getFieldAlias(r,t)}>`)),n}let n=null;return(l||r)&&(n={field:l&&this._getFieldAlias(l,t),normField:r&&this._getFieldAlias(r,t),normByPct:i}),n}_getFieldAlias(e,t){const s="popupTemplate"in t&&t.popupTemplate,l=s&&s.fieldInfos;let r=null;l&&l.some((t=>e===t.fieldName&&(r=t,!0)));let i=null;"getField"in t&&t.getField?i=t.getField(e):"fieldsIndex"in t&&t.fieldsIndex&&(i=t.fieldsIndex.get(e));const n=r||i;let a=null;return n&&(a=r&&r.label||i&&i.alias||"name"in n&&n.name||"fieldName"in n&&n.fieldName),a}_isUnclassedRenderer(e){const t=e.visualVariables;let s=!1;return ge(e)&&e.classBreakInfos&&1===e.classBreakInfos.length&&t&&(s=e.field?t.some((t=>!(!t||e.field!==t.field||(e.normalizationField||t.normalizationField)&&e.normalizationField!==t.normalizationField))):!!t.length),s}};e([S()],$e.prototype,"children",void 0),e([S({readOnly:!0})],$e.prototype,"effectList",null),e([S()],$e.prototype,"layerView",void 0),e([S()],$e.prototype,"layer",void 0),e([S()],$e.prototype,"legendElements",void 0),e([S({readOnly:!0})],$e.prototype,"opacity",null),e([S()],$e.prototype,"parent",void 0),e([S({readOnly:!0,dependsOn:[]})],$e.prototype,"ready",null),e([S()],$e.prototype,"hideLayersNotInCurrentView",void 0),e([S()],$e.prototype,"keepCacheOnDestroy",void 0),e([S()],$e.prototype,"respectLayerVisibility",void 0),e([S({readOnly:!0})],$e.prototype,"scale",null),e([S()],$e.prototype,"sublayerIds",void 0),e([S({readOnly:!0})],$e.prototype,"isScaleDriven",null),e([S()],$e.prototype,"title",void 0),e([S({readOnly:!0,dependsOn:["ready"],value:0})],$e.prototype,"version",null),e([S()],$e.prototype,"view",void 0),$e=e([_("esri.widgets.Legend.support.ActiveLayerInfo")],$e);const We=$e;export{We 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.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{isSome as o}from"../../core/maybe.js";import{watch as t}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import r from"../Widget.js";import"../support/widgetUtils.js";import{tsx as a}from"../support/jsxFactory.js";import{LABELED_SLIDER_CSS as n}from"./css.js";let c=class extends r{constructor(e){super(e),this.debounceDelay=200,this._onChangeTimeout=null,this._onChangeDebounced=e=>{const o=e.target.value;this._cancelChange(),this._onChangeTimeout=setTimeout((()=>this.onChange(o)),this.debounceDelay)},this._cancelChange=()=>{o(this._onChangeTimeout)&&(clearTimeout(this._onChangeTimeout),this._onChangeTimeout=null)}}initialize(){this.addHandles(t((()=>this.onChange),(()=>{this._cancelChange()})))}render(){const{label:e,disabled:o}=this;return a("div",{class:n.base},a("calcite-label",{scale:"s",disabled:o},e,a("calcite-slider",{"aria-label":e,disabled:this.disabled,max:1,min:0,step:.01,value:this.value,onCalciteSliderInput:this._onChangeDebounced,onCalciteSliderChange:this._onChangeDebounced})))}destroy(){this._cancelChange()}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-label.js"),import("@esri/calcite-components/dist/components/calcite-slider.js")])}};e([s()],c.prototype,"value",void 0),e([s()],c.prototype,"onChange",void 0),e([s()],c.prototype,"disabled",void 0),e([s()],c.prototype,"debounceDelay",void 0),c=e([i("esri.widgets.Weather.LabeledSlider")],c);export{c as LabeledSlider};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import t from"../Widget.js";import"../support/widgetUtils.js";import{tsx as r}from"../support/jsxFactory.js";import{LABELED_SLIDER_CSS as i}from"./css.js";let a=class extends t{constructor(e){super(e),this._onChange=e=>{const s=e.target.value;this.onChange(s)}}render(){const{label:e,disabled:s}=this;return r("div",{class:i.base},r("calcite-label",{scale:"s",disabled:s},e,r("calcite-slider",{"aria-label":e,disabled:this.disabled,max:1,min:0,step:.01,value:this.value,onCalciteSliderInput:this._onChange,onCalciteSliderChange:this._onChange})))}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-label.js"),import("@esri/calcite-components/dist/components/calcite-slider.js")])}};e([s()],a.prototype,"value",void 0),e([s()],a.prototype,"onChange",void 0),e([s()],a.prototype,"disabled",void 0),a=e([o("esri.widgets.Weather.LabeledSlider")],a);export{a as LabeledSlider};