@arcgis/map-components 5.1.0-next.104 → 5.1.0-next.105

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 (263) hide show
  1. package/dist/cdn/3AKJIFJP.js +2 -0
  2. package/dist/cdn/6IRKJ76J.js +2 -0
  3. package/dist/cdn/6QJQJ4I7.js +2 -0
  4. package/dist/cdn/FMT63SES.js +2 -0
  5. package/dist/cdn/IMSDXTQ5.js +2 -0
  6. package/dist/cdn/JFWOTBXI.js +2 -0
  7. package/dist/cdn/JIAEOA2S.js +2 -0
  8. package/dist/cdn/PKV6NA3M.js +2 -0
  9. package/dist/cdn/TKQLQE4E.js +2 -0
  10. package/dist/cdn/TZVSBVJN.js +2 -0
  11. package/dist/cdn/{KASY64TA.js → UQCQAL4T.js} +1 -1
  12. package/dist/cdn/{UCPJMQPU.js → VVIDVEKK.js} +1 -1
  13. package/dist/cdn/{AWQHNAWY.js → XB5I52AG.js} +1 -1
  14. package/dist/cdn/XIJGC7OK.js +2 -0
  15. package/dist/cdn/assets/feature-next/t9n/messages.ar.json +1 -0
  16. package/dist/cdn/assets/feature-next/t9n/messages.bg.json +1 -0
  17. package/dist/cdn/assets/feature-next/t9n/messages.bs.json +1 -0
  18. package/dist/cdn/assets/feature-next/t9n/messages.ca.json +1 -0
  19. package/dist/cdn/assets/feature-next/t9n/messages.cs.json +1 -0
  20. package/dist/cdn/assets/feature-next/t9n/messages.da.json +1 -0
  21. package/dist/cdn/assets/feature-next/t9n/messages.de.json +1 -0
  22. package/dist/cdn/assets/feature-next/t9n/messages.el.json +1 -0
  23. package/dist/cdn/assets/feature-next/t9n/messages.en.json +1 -0
  24. package/dist/cdn/assets/feature-next/t9n/messages.es.json +1 -0
  25. package/dist/cdn/assets/feature-next/t9n/messages.et.json +1 -0
  26. package/dist/cdn/assets/feature-next/t9n/messages.fi.json +1 -0
  27. package/dist/cdn/assets/feature-next/t9n/messages.fr.json +1 -0
  28. package/dist/cdn/assets/feature-next/t9n/messages.he.json +1 -0
  29. package/dist/cdn/assets/feature-next/t9n/messages.hr.json +1 -0
  30. package/dist/cdn/assets/feature-next/t9n/messages.hu.json +1 -0
  31. package/dist/cdn/assets/feature-next/t9n/messages.id.json +1 -0
  32. package/dist/cdn/assets/feature-next/t9n/messages.it.json +1 -0
  33. package/dist/cdn/assets/feature-next/t9n/messages.ja.json +1 -0
  34. package/dist/cdn/assets/feature-next/t9n/messages.ko.json +1 -0
  35. package/dist/cdn/assets/feature-next/t9n/messages.lt.json +1 -0
  36. package/dist/cdn/assets/feature-next/t9n/messages.lv.json +1 -0
  37. package/dist/cdn/assets/feature-next/t9n/messages.nl.json +1 -0
  38. package/dist/cdn/assets/feature-next/t9n/messages.no.json +1 -0
  39. package/dist/cdn/assets/feature-next/t9n/messages.pl.json +1 -0
  40. package/dist/cdn/assets/feature-next/t9n/messages.pt-BR.json +1 -0
  41. package/dist/cdn/assets/feature-next/t9n/messages.pt-PT.json +1 -0
  42. package/dist/cdn/assets/feature-next/t9n/messages.ro.json +1 -0
  43. package/dist/cdn/assets/feature-next/t9n/messages.ru.json +1 -0
  44. package/dist/cdn/assets/feature-next/t9n/messages.sk.json +1 -0
  45. package/dist/cdn/assets/feature-next/t9n/messages.sl.json +1 -0
  46. package/dist/cdn/assets/feature-next/t9n/messages.sr.json +1 -0
  47. package/dist/cdn/assets/feature-next/t9n/messages.sv.json +1 -0
  48. package/dist/cdn/assets/feature-next/t9n/messages.th.json +1 -0
  49. package/dist/cdn/assets/feature-next/t9n/messages.tr.json +1 -0
  50. package/dist/cdn/assets/feature-next/t9n/messages.uk.json +1 -0
  51. package/dist/cdn/assets/feature-next/t9n/messages.vi.json +1 -0
  52. package/dist/cdn/assets/feature-next/t9n/messages.zh-CN.json +1 -0
  53. package/dist/cdn/assets/feature-next/t9n/messages.zh-HK.json +1 -0
  54. package/dist/cdn/assets/feature-next/t9n/messages.zh-TW.json +1 -0
  55. package/dist/cdn/assets/features/t9n/messages.ar.json +1 -1
  56. package/dist/cdn/assets/features/t9n/messages.bg.json +1 -1
  57. package/dist/cdn/assets/features/t9n/messages.bs.json +1 -1
  58. package/dist/cdn/assets/features/t9n/messages.ca.json +1 -1
  59. package/dist/cdn/assets/features/t9n/messages.cs.json +1 -1
  60. package/dist/cdn/assets/features/t9n/messages.da.json +1 -1
  61. package/dist/cdn/assets/features/t9n/messages.de.json +1 -1
  62. package/dist/cdn/assets/features/t9n/messages.el.json +1 -1
  63. package/dist/cdn/assets/features/t9n/messages.en.json +1 -1
  64. package/dist/cdn/assets/features/t9n/messages.es.json +1 -1
  65. package/dist/cdn/assets/features/t9n/messages.et.json +1 -1
  66. package/dist/cdn/assets/features/t9n/messages.fi.json +1 -1
  67. package/dist/cdn/assets/features/t9n/messages.fr.json +1 -1
  68. package/dist/cdn/assets/features/t9n/messages.he.json +1 -1
  69. package/dist/cdn/assets/features/t9n/messages.hr.json +1 -1
  70. package/dist/cdn/assets/features/t9n/messages.hu.json +1 -1
  71. package/dist/cdn/assets/features/t9n/messages.id.json +1 -1
  72. package/dist/cdn/assets/features/t9n/messages.it.json +1 -1
  73. package/dist/cdn/assets/features/t9n/messages.ja.json +1 -1
  74. package/dist/cdn/assets/features/t9n/messages.ko.json +1 -1
  75. package/dist/cdn/assets/features/t9n/messages.lt.json +1 -1
  76. package/dist/cdn/assets/features/t9n/messages.lv.json +1 -1
  77. package/dist/cdn/assets/features/t9n/messages.nl.json +1 -1
  78. package/dist/cdn/assets/features/t9n/messages.no.json +1 -1
  79. package/dist/cdn/assets/features/t9n/messages.pl.json +1 -1
  80. package/dist/cdn/assets/features/t9n/messages.pt-BR.json +1 -1
  81. package/dist/cdn/assets/features/t9n/messages.pt-PT.json +1 -1
  82. package/dist/cdn/assets/features/t9n/messages.ro.json +1 -1
  83. package/dist/cdn/assets/features/t9n/messages.ru.json +1 -1
  84. package/dist/cdn/assets/features/t9n/messages.sk.json +1 -1
  85. package/dist/cdn/assets/features/t9n/messages.sl.json +1 -1
  86. package/dist/cdn/assets/features/t9n/messages.sr.json +1 -1
  87. package/dist/cdn/assets/features/t9n/messages.sv.json +1 -1
  88. package/dist/cdn/assets/features/t9n/messages.th.json +1 -1
  89. package/dist/cdn/assets/features/t9n/messages.tr.json +1 -1
  90. package/dist/cdn/assets/features/t9n/messages.uk.json +1 -1
  91. package/dist/cdn/assets/features/t9n/messages.vi.json +1 -1
  92. package/dist/cdn/assets/features/t9n/messages.zh-CN.json +1 -1
  93. package/dist/cdn/assets/features/t9n/messages.zh-HK.json +1 -1
  94. package/dist/cdn/assets/features/t9n/messages.zh-TW.json +1 -1
  95. package/dist/cdn/assets/features-next/t9n/messages.ar.json +1 -0
  96. package/dist/cdn/assets/features-next/t9n/messages.bg.json +1 -0
  97. package/dist/cdn/assets/features-next/t9n/messages.bs.json +1 -0
  98. package/dist/cdn/assets/features-next/t9n/messages.ca.json +1 -0
  99. package/dist/cdn/assets/features-next/t9n/messages.cs.json +1 -0
  100. package/dist/cdn/assets/features-next/t9n/messages.da.json +1 -0
  101. package/dist/cdn/assets/features-next/t9n/messages.de.json +1 -0
  102. package/dist/cdn/assets/features-next/t9n/messages.el.json +1 -0
  103. package/dist/cdn/assets/features-next/t9n/messages.en.json +1 -0
  104. package/dist/cdn/assets/features-next/t9n/messages.es.json +1 -0
  105. package/dist/cdn/assets/features-next/t9n/messages.et.json +1 -0
  106. package/dist/cdn/assets/features-next/t9n/messages.fi.json +1 -0
  107. package/dist/cdn/assets/features-next/t9n/messages.fr.json +1 -0
  108. package/dist/cdn/assets/features-next/t9n/messages.he.json +1 -0
  109. package/dist/cdn/assets/features-next/t9n/messages.hr.json +1 -0
  110. package/dist/cdn/assets/features-next/t9n/messages.hu.json +1 -0
  111. package/dist/cdn/assets/features-next/t9n/messages.id.json +1 -0
  112. package/dist/cdn/assets/features-next/t9n/messages.it.json +1 -0
  113. package/dist/cdn/assets/features-next/t9n/messages.ja.json +1 -0
  114. package/dist/cdn/assets/features-next/t9n/messages.ko.json +1 -0
  115. package/dist/cdn/assets/features-next/t9n/messages.lt.json +1 -0
  116. package/dist/cdn/assets/features-next/t9n/messages.lv.json +1 -0
  117. package/dist/cdn/assets/features-next/t9n/messages.nl.json +1 -0
  118. package/dist/cdn/assets/features-next/t9n/messages.no.json +1 -0
  119. package/dist/cdn/assets/features-next/t9n/messages.pl.json +1 -0
  120. package/dist/cdn/assets/features-next/t9n/messages.pt-BR.json +1 -0
  121. package/dist/cdn/assets/features-next/t9n/messages.pt-PT.json +1 -0
  122. package/dist/cdn/assets/features-next/t9n/messages.ro.json +1 -0
  123. package/dist/cdn/assets/features-next/t9n/messages.ru.json +1 -0
  124. package/dist/cdn/assets/features-next/t9n/messages.sk.json +1 -0
  125. package/dist/cdn/assets/features-next/t9n/messages.sl.json +1 -0
  126. package/dist/cdn/assets/features-next/t9n/messages.sr.json +1 -0
  127. package/dist/cdn/assets/features-next/t9n/messages.sv.json +1 -0
  128. package/dist/cdn/assets/features-next/t9n/messages.th.json +1 -0
  129. package/dist/cdn/assets/features-next/t9n/messages.tr.json +1 -0
  130. package/dist/cdn/assets/features-next/t9n/messages.uk.json +1 -0
  131. package/dist/cdn/assets/features-next/t9n/messages.vi.json +1 -0
  132. package/dist/cdn/assets/features-next/t9n/messages.zh-CN.json +1 -0
  133. package/dist/cdn/assets/features-next/t9n/messages.zh-HK.json +1 -0
  134. package/dist/cdn/assets/features-next/t9n/messages.zh-TW.json +1 -0
  135. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.ar.json +1 -1
  136. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.bg.json +1 -1
  137. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.bs.json +1 -1
  138. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.ca.json +1 -1
  139. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.cs.json +1 -1
  140. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.da.json +1 -1
  141. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.de.json +1 -1
  142. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.el.json +1 -1
  143. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.es.json +1 -1
  144. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.et.json +1 -1
  145. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.fi.json +1 -1
  146. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.fr.json +1 -1
  147. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.he.json +1 -1
  148. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.hr.json +1 -1
  149. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.hu.json +1 -1
  150. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.id.json +1 -1
  151. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.it.json +1 -1
  152. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.ja.json +1 -1
  153. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.ko.json +1 -1
  154. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.lt.json +1 -1
  155. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.lv.json +1 -1
  156. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.nl.json +1 -1
  157. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.no.json +1 -1
  158. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.pl.json +1 -1
  159. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.pt-BR.json +1 -1
  160. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.pt-PT.json +1 -1
  161. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.ro.json +1 -1
  162. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.ru.json +1 -1
  163. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.sk.json +1 -1
  164. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.sl.json +1 -1
  165. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.sr.json +1 -1
  166. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.sv.json +1 -1
  167. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.th.json +1 -1
  168. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.tr.json +1 -1
  169. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.uk.json +1 -1
  170. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.vi.json +1 -1
  171. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.zh-CN.json +1 -1
  172. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.zh-HK.json +1 -1
  173. package/dist/cdn/assets/utility-network-trace-analysis/t9n/messages.zh-TW.json +1 -1
  174. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.ar.json +1 -1
  175. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.bg.json +1 -1
  176. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.bs.json +1 -1
  177. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.ca.json +1 -1
  178. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.cs.json +1 -1
  179. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.da.json +1 -1
  180. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.de.json +1 -1
  181. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.el.json +1 -1
  182. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.es.json +1 -1
  183. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.et.json +1 -1
  184. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.fi.json +1 -1
  185. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.fr.json +1 -1
  186. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.he.json +1 -1
  187. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.hr.json +1 -1
  188. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.hu.json +1 -1
  189. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.id.json +1 -1
  190. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.it.json +1 -1
  191. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.ja.json +1 -1
  192. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.ko.json +1 -1
  193. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.lt.json +1 -1
  194. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.lv.json +1 -1
  195. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.nl.json +1 -1
  196. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.no.json +1 -1
  197. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.pl.json +1 -1
  198. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.pt-BR.json +1 -1
  199. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.pt-PT.json +1 -1
  200. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.ro.json +1 -1
  201. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.ru.json +1 -1
  202. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.sk.json +1 -1
  203. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.sl.json +1 -1
  204. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.sr.json +1 -1
  205. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.sv.json +1 -1
  206. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.th.json +1 -1
  207. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.tr.json +1 -1
  208. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.uk.json +1 -1
  209. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.vi.json +1 -1
  210. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.zh-CN.json +1 -1
  211. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.zh-HK.json +1 -1
  212. package/dist/cdn/assets/utility-network-trace-inputs/t9n/messages.zh-TW.json +1 -1
  213. package/dist/cdn/index.js +1 -1
  214. package/dist/cdn/main.css +1 -1
  215. package/dist/chunks/action-utils.js +37 -23
  216. package/dist/components/arcgis-aggregated-features/customElement.js +1 -1
  217. package/dist/components/arcgis-aggregated-features/index.js +1 -1
  218. package/dist/components/arcgis-bookmarks/customElement.d.ts +1 -1
  219. package/dist/components/arcgis-feature/customElement.d.ts +4 -4
  220. package/dist/components/arcgis-feature/customElement.js +69 -111
  221. package/dist/components/arcgis-feature-next/customElement.d.ts +444 -0
  222. package/dist/components/arcgis-feature-next/customElement.js +279 -0
  223. package/dist/components/arcgis-feature-next/index.d.ts +1 -0
  224. package/dist/components/arcgis-feature-next/index.js +13 -0
  225. package/dist/components/arcgis-feature-relationship/customElement.js +76 -73
  226. package/dist/components/arcgis-feature-relationship/index.js +1 -0
  227. package/dist/components/arcgis-feature-utility-network-association-list/customElement.js +18 -15
  228. package/dist/components/arcgis-feature-utility-network-association-list/index.js +1 -0
  229. package/dist/components/arcgis-feature-utility-network-associations/customElement.js +63 -53
  230. package/dist/components/arcgis-features/customElement.d.ts +28 -52
  231. package/dist/components/arcgis-features/customElement.js +181 -184
  232. package/dist/components/arcgis-features/index.js +0 -1
  233. package/dist/components/arcgis-features-next/customElement.d.ts +678 -0
  234. package/dist/components/arcgis-features-next/customElement.js +400 -0
  235. package/dist/components/arcgis-features-next/index.d.ts +1 -0
  236. package/dist/components/arcgis-features-next/index.js +15 -0
  237. package/dist/components/arcgis-popup/customElement.d.ts +2 -2
  238. package/dist/components/arcgis-popup/customElement.js +1 -1
  239. package/dist/components/arcgis-popup/index.js +1 -1
  240. package/dist/components/arcgis-search/customElement.d.ts +1 -1
  241. package/dist/components/arcgis-utility-network-trace-analysis/customElement.js +32 -33
  242. package/dist/components/arcgis-utility-network-trace-inputs/customElement.d.ts +5 -0
  243. package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +47 -47
  244. package/dist/docs/api.json +1 -1
  245. package/dist/docs/docs.json +1 -1
  246. package/dist/docs/vscode.html-custom-data.json +1 -1
  247. package/dist/docs/web-types.json +1 -1
  248. package/dist/index.d.ts +20 -0
  249. package/dist/loader.js +7 -5
  250. package/dist/types/lumina.d.ts +17 -1
  251. package/dist/types/preact.d.ts +19 -1
  252. package/dist/types/react.d.ts +21 -1
  253. package/dist/types/stencil.d.ts +17 -1
  254. package/package.json +4 -4
  255. package/dist/cdn/37PU5RQF.js +0 -2
  256. package/dist/cdn/6U7WM64M.js +0 -2
  257. package/dist/cdn/AHWGHYPQ.js +0 -2
  258. package/dist/cdn/FNHPWOUX.js +0 -2
  259. package/dist/cdn/HVKDLP74.js +0 -2
  260. package/dist/cdn/LTUURA6B.js +0 -2
  261. package/dist/cdn/SKRNQKVO.js +0 -2
  262. package/dist/cdn/W2QDJLIF.js +0 -2
  263. package/dist/cdn/XIN3BIAA.js +0 -2
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import g from"./VCOJNSMR.js";import f from"./R3NYK6BO.js";import e from"./ZOPB777S.js";import{a as D}from"./TNDRCMN3.js";import d from"./V2RXBLNO.js";import c from"./OCLLMQGL.js";import{h as _}from"./CIFVM6AU.js";import"./EPO62377.js";import a from"./FKLH5Y2K.js";import{d as C}from"./TGNR3DAP.js";import{N as y,O as I,P as M,R as b,U as x,a as $,b as o,x as w}from"./MTKZBIHD.js";import"./3TTFCHAA.js";export default $arcgis.t(([{substitute:k},{renderingSanitizer:N},B,{watch:H},{stripHTML:Z},P,,,,R,,{a:F,b:L,c:E,d:T,e:A,i:V,p:l}])=>{var z=$`:host{display:flex;flex:1 1 auto;background-color:var(--calcite-color-foreground-1);--calcite-color-background: var(--calcite-color-foreground-1)}.root{flex:1 1 auto}.root calcite-icon{box-sizing:content-box}.loading-container{display:flex;justify-content:center;padding:var(--calcite-spacing-md) 0;width:100%}.content-element{margin-bottom:var(--calcite-spacing-lg);padding:0 var(--calcite-spacing-sm);display:flex;flex-direction:column}.content-element:only-child,.content-element:last-child{margin-bottom:var(--calcite-spacing-xxs)}.last-edited-info{padding-top:var(--calcite-spacing-xs);font-size:var(--calcite-font-size-sm)}`,U=R(P),v=class extends I{constructor(){super(...arguments),this.messages=D(),this._rootFlowNode=null,this.internalFlowItems=new B,this.flowType="feature",this.viewModel=U(this),this.view=this.viewModel.view,this.icon="icon",this.isFeatureFromTable=this.viewModel.isFeatureFromTable,this.graphic=this.viewModel.graphic,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.headingLevel=2,this.spatialReference=this.viewModel.spatialReference,this.timeZone=this.viewModel.timeZone,this.heading=this.viewModel.heading,this.map=this.viewModel.map,this.chartAnimationDisabled=this.viewModel.abilities.chartAnimation,this.hideHeading=!1,this.hideContent=!1,this.hideAttachmentsContent=!1,this.hideCustomContent=!1,this.hideExpressionContent=!1,this.hideFieldsContent=!1,this.hideMediaContent=!1,this.showRelationshipContent=!1,this.hideTextContent=!1,this.showUtilityNetworkContent=!1,this.hideLastEditedInfo=!1,this.autoDestroyDisabled=!1,this.location=this.viewModel.location,this.state=this.viewModel.state,this.arcgisPropertyChange=_()("flowItems","state"),this.arcgisReady=w()}static{this.properties={popupTemplate:16,sourceLayer:16,fieldInfoMap:16,values:16,globalValues:16,internalFlowItems:16,flowType:1,viewModel:0,view:0,flowItems:0,referenceElement:1,icon:1,isFeatureFromTable:36,graphic:0,defaultPopupTemplateEnabled:5,headingLevel:9,spatialReference:0,timeZone:1,heading:0,map:0,chartAnimationDisabled:5,hideHeading:5,hideContent:5,hideAttachmentsContent:5,hideCustomContent:5,hideExpressionContent:5,hideFieldsContent:5,hideMediaContent:5,showRelationshipContent:5,hideTextContent:5,showUtilityNetworkContent:5,hideLastEditedInfo:5,autoDestroyDisabled:5,messageOverrides:0,label:1,location:0,state:32}}static{this.styles=z}get popupTemplate(){return E(this.graphic,this.defaultPopupTemplateEnabled)??void 0}get sourceLayer(){return T(this.graphic)}get fieldInfoMap(){return F(L(this.popupTemplate),this.sourceLayer)}get values(){return this.graphic?.attributes??{}}get globalValues(){return this.viewModel.formattedAttributes?.global??{}}async destroy(){this._removeFlowItems(),await this.manager.destroy()}nextMedia(e){this._pageContentElementMedia(e,1)}previousMedia(e){this._pageContentElementMedia(e,-1)}setActiveMedia(e,t){let i=this.viewModel.content;if(!Array.isArray(i))return;let s=i[e];if(s?.type!=="media")return;let a=s;this._setContentElementMedia(a,t)}async updateGeometry(){return await this.viewModel.updateGeometry()}loaded(){this.manager.onLifecycle(()=>[H(()=>[this.internalFlowItems?.length],()=>this._setFocus())])}_setContentElementMedia(e,t){let i=e.mediaInfos?.length??0,s=(t+i)%i;e.activeMediaInfoIndex=s}_pageContentElementMedia(e,t){let i=this.viewModel.content;if(!Array.isArray(i))return;let s=i[e];if(s?.type!=="media")return;let a=s,{activeMediaInfoIndex:n}=a,r=(n??0)+t;this._setContentElementMedia(a,r)}_removeFlowItems(){this.internalFlowItems?.destroyAll()}_storeRootFlowNode(e){this._rootFlowNode=e}_setFocus(){this._rootFlowNode?.setFocus()}_handleDrillInBackClick(){this.internalFlowItems?.pop()?.destroy()}render(){let{state:e}=this.viewModel,t=o`<div class="container">${e==="error"?this._renderError():e==="loading"?this._renderLoading():this._renderContentContainer()}</div>`;return o`<div class="root">${t}</div>`}_renderError(){let{messages:e,hideHeading:t}=this;return o`<calcite-notice icon=exclamation-mark-circle kind=danger open scale=s>${t?null:o`<div slot=title>${e.error}</div>`}<div slot=message>${e.loadingError}</div></calcite-notice>`}_renderLoading(){return o`<div class="loading-container"><calcite-loader inline label></calcite-loader></div>`}_renderAttachments(e){let{values:t,fieldInfoMap:i,sourceLayer:s,globalValues:a}=this,n=l({values:t,fieldInfoMap:i,globalValues:a,layer:s,text:e.title}),r=l({values:t,fieldInfoMap:i,globalValues:a,layer:s,text:e.description});return o`<arcgis-feature-attachments .headingLevel=${this.headingLevel} .heading=${n} class="content-element" .displayType=${e.displayType} .attachmentKeywords=${e.attachmentKeywords??void 0} .attachmentTypes=${e.attachmentTypes??void 0} .orderByFields=${e.orderByFields??void 0} .graphic=${this.graphic??void 0} .description=${r} .messages=${this.messages}></arcgis-feature-attachments>`}_renderCustom(e){return o`<arcgis-feature-content .creator=${e.creator} .destroyer=${e.destroyer??void 0} .graphic=${this.graphic??void 0} class="content-element"></arcgis-feature-content>`}_renderFields(e,t){let i=this.viewModel.formattedAttributes,{values:s,fieldInfoMap:a,sourceLayer:n,popupTemplate:r,globalValues:d,graphic:c}=this,u=!!e?.fieldInfos,h=(e.fieldInfos??r?.fieldInfos??[])?.filter(({fieldName:m})=>!!m&&(V(m)||A(m)||m in s)),p=r?.expressionInfos,f=l({values:s,fieldInfoMap:a,globalValues:d,layer:n,text:e.title}),g=l({values:s,fieldInfoMap:a,globalValues:d,layer:n,text:e.description});return o`<arcgis-feature-fields .headingLevel=${this.headingLevel} .heading=${f} class="content-element" .messages=${this.messages} .graphic=${c??void 0} .isContentFieldInfos=${u} .layer=${n} .description=${g} .values=${{...i?.global,...i?.content?.[t]}} .fieldInfos=${h} .expressionInfos=${p??void 0}></arcgis-feature-fields>`}_renderMedia(e,t){let{values:i,graphic:s,fieldInfoMap:a,sourceLayer:n,popupTemplate:r,globalValues:d}=this,{formattedAttributes:c,relatedInfos:u,expressionAttributes:h}=this.viewModel,p={...c?.global,...c?.content?.[t]},f=l({values:i,fieldInfoMap:a,globalValues:d,layer:n,text:e.title}),g=l({values:i,fieldInfoMap:a,globalValues:d,layer:n,text:e.description});return o`<arcgis-feature-media .activeMediaInfoIndex=${e.activeMediaInfoIndex??0} .chartAnimationDisabled=${this.chartAnimationDisabled} .headingLevel=${this.headingLevel} .heading=${f} class="content-element" .description=${g} .values=${i} .expressionValues=${h} .layer=${n} .graphic=${s??void 0} .messages=${this.messages} .fieldInfoMap=${a} .mediaInfos=${e.mediaInfos??[]} .popupTemplate=${r??void 0} .relatedInfos=${u} .formattedValues=${p}></arcgis-feature-media>`}_renderText(e){let{values:t,fieldInfoMap:i,sourceLayer:s,globalValues:a}=this;return o`<arcgis-feature-content .creator=${l({values:t,fieldInfoMap:i,globalValues:a,layer:s,text:e.text})} .graphic=${this.graphic??void 0} class="content-element"></arcgis-feature-content>`}_renderExpression(e,t){let i=this.viewModel.formattedAttributes,{fieldInfoMap:s}=this;return o`<arcgis-feature-expression .expressionInfo=${e.expressionInfo} .map=${this.map??void 0} .spatialReference=${this.spatialReference??void 0} .view=${this.viewModel.view??void 0} .graphic=${this.graphic??void 0} .location=${this.location??void 0} .headingLevel=${this.headingLevel} class="content-element" .interceptor=${this.viewModel.interceptor} .messages=${this.messages} .fieldInfoMap=${s} .values=${{...i?.global,...i?.content?.[t]}}></arcgis-feature-expression>`}_renderRelationship(e,t){let{values:i,graphic:s,fieldInfoMap:a,sourceLayer:n,globalValues:r}=this,{displayCount:d,orderByFields:c,relationshipId:u}=e,{formattedAttributes:h,view:p}=this.viewModel,f={...h?.global,...h?.content?.[t]},g=l({values:i,fieldInfoMap:a,globalValues:r,layer:n,text:e.title}),m=l({values:i,fieldInfoMap:a,globalValues:r,layer:n,text:e.description});return o`<arcgis-feature-relationship .autoDestroyDisabled=${this.autoDestroyDisabled} class="content-element" .flowItems=${this.flowItems??this.internalFlowItems} .description=${m} .layer=${n} .map=${this.map??void 0} .displayCount=${d} .graphic=${s??void 0} .heading=${g} .headingLevel=${this.headingLevel} .messages=${this.messages} .orderByFields=${c??void 0} .relationshipId=${u??void 0} .spatialReference=${this.spatialReference??void 0} .timeZone=${this.timeZone??void 0} use-feature-next-flow-item .values=${f} .view=${p??void 0}></arcgis-feature-relationship>`}_renderAssociation(e){let{fieldInfoMap:t,globalValues:i,graphic:s,messages:a,sourceLayer:n,values:r}=this,d=l({values:r,fieldInfoMap:t,globalValues:i,layer:n,text:e.title}),c=l({values:r,fieldInfoMap:t,globalValues:i,layer:n,text:e.description});return o`<arcgis-feature-utility-network-associations .autoDestroyDisabled=${this.autoDestroyDisabled} .associationTypes=${e.associationTypes} class="content-element" .description=${c} .flowItems=${this.flowItems??this.internalFlowItems} .graphic=${s??void 0} .heading=${d} .headingLevel=${this.headingLevel} .layer=${n} .map=${this.map??void 0} .messages=${a} .parentFeatureViewModel=${this.viewModel} .referenceElement=${this.referenceElement} .spatialReference=${this.spatialReference??void 0} .timeZone=${this.timeZone??void 0} use-feature-next-flow-item .view=${this.viewModel.view??void 0}></arcgis-feature-utility-network-associations>`}_renderContentElement(e,t){switch(e.type){case"attachments":return this.hideAttachmentsContent?null:this._renderAttachments(e);case"custom":return this.hideCustomContent?null:this._renderCustom(e);case"fields":return this.hideFieldsContent?null:this._renderFields(e,t);case"media":return this.hideMediaContent?null:this._renderMedia(e,t);case"text":return this.hideTextContent?null:this._renderText(e);case"expression":return this.hideExpressionContent?null:this._renderExpression(e,t);case"relationship":return this.showRelationshipContent?this._renderRelationship(e,t):null;case"utility-network-associations":return this.showUtilityNetworkContent?this._renderAssociation(e):null;default:return null}}_renderContent(){let{content:e,graphic:t}=this.viewModel;if(!e)return null;if(Array.isArray(e)&&e.length)return e.length?e.map(this._renderContentElement,this):null;if(typeof e=="string"){let{values:i,fieldInfoMap:s,sourceLayer:a,globalValues:n}=this;return o`<arcgis-feature-content .creator=${l({values:i,fieldInfoMap:s,globalValues:n,layer:a,text:e})} .graphic=${t??void 0} class="content-element"></arcgis-feature-content>`}return e instanceof HTMLElement?e:null}_renderContentContainer(){let{hideContent:e,internalFlowItems:t,headingLevel:i,state:s,messages:a,heading:n,hideHeading:r}=this;if(e)return null;let d=o`<div class="main">${[this._renderContent(),this._renderLastEditInfo()]}</div>`,c=a.returnToInitialFeature??"";return this.flowItems?d:o`<calcite-flow ${y(this._storeRootFlowNode)}><calcite-flow-item .loading=${s==="loading"} .headingLevel=${i} .heading=${this.hideHeading?void 0:Z(this.heading)} .selected=${!t.length}>${!r&&n?o`<div slot=heading><div .innerHTML=${N.sanitize(n??"")??""}></div></div>`:null}${d}</calcite-flow-item>${t.toArray().map((u,h)=>o`<calcite-flow-item @calciteFlowItemBack=${p=>{p.preventDefault(),this._handleDrillInBackClick()}} .loading=${s==="loading"} .headingLevel=${i} .selected=${h===t.length-1}><calcite-action icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${c} title=${c??b}></calcite-action>${u}</calcite-flow-item>`)}</calcite-flow>`}_renderLastEditInfo(){let{hideLastEditedInfo:e,messages:t}=this,{lastEditInfo:i}=this.viewModel;if(!i||e)return null;let{date:s,user:a}=i,n=i.type==="edit"?a?t.lastEditedByUser:t.lastEdited:a?t.lastCreatedByUser:t.lastCreated,r=k(n??"",{date:s,user:a});return o`<div class=${M(C("last-edited-info","content-element"))}>${r}</div>`}};x("arcgis-feature-next",v);return v},"intl","applications/Components/sanitizerUtils","core/Collection","core/reactiveUtils","applications/Components/stringUtils","popup/Feature",a,c,d,e,f,g)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{a as C}from"./MP6Z45SA.js";import a from"./R3NYK6BO.js";import{a as A}from"./HMWOHSHV.js";import{O as $,S as F,U as L,a as q,b as p}from"./MTKZBIHD.js";import"./3TTFCHAA.js";export default $arcgis.t(([{createReactiveMap:k,findUtilityNetwork:U,getOrCreateMapValue:x},{stripHTML:E},f,{ignoreAbortErrors:S},{watch:v},V,P,Q,B,G,{b:N,f:I}])=>{var R=q`.list-container{min-height:var(--calcite-spacing-xxxl)}.loading-container{display:flex;justify-content:center;padding:var(--calcite-spacing-md) 0;width:100%}.sticky-loading-container{display:flex;position:sticky;bottom:var(--calcite-spacing-sm);align-items:center;justify-content:center;z-index:2;margin:0;padding:0;height:var(--calcite-spacing-xxxl);pointer-events:none;height:500px}`,M=100,D={assetGroup:"assetgroup",assetType:"assettype"},j="{00000000-0000-0000-0000-000000000000}",T=class extends ${constructor(){super(...arguments),this._addFlowItem=t=>{t&&this.flowItems?.push(t)},this._attachmentAssociations=new f,this._attachmentFeatureCount=0,this._cancelQuery=()=>{let{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{let{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._connectivityAssociations=new f,this._connectivityFeatureCount=0,this._containerAssociations=new f,this._containerFeatureCount=0,this._contentAssociations=new f,this._contentFeatureCount=0,this._networkSourceIdsInUse=new Set,this._query=async t=>{if(!t)return;await this._loadUtiltyNetworks();let{_queryAbortController:e}=this;this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),this._featureCount&&await this._queryAssociatedFeatures(t,{signal:e?.signal})},this._queryController=async t=>{this._cancelQuery();let e=new AbortController;this._queryAbortController=e,await S(this._query(t)),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();let t=new AbortController;this._queryFeatureCountAbortController=t,await S(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=C(this._queryController,M),this._queryFeatureCountDebounced=C(this._queryFeatureCountController,M),this._structureAssociations=new f,this._structureFeatureCount=0,this._queryAssociationType=async()=>{this._activeAssociationType&&this._queryDebounced(this._activeAssociationType)},this._associationFeatures=k(),this._associationViewModels=k(),this._featureCount=0,this._loaded=!1,this._queryAbortController=null,this._queryFeatureCountAbortController=null,this._queryPageAbortController=null,this.associationTypes=null,this.autoDestroyDisabled=!1,this.useFeatureNextFlowItem=!1,this.flowType="feature-utility-network-associations",this.headingLevel=2,this.source="popup"}static{this.properties={_activeAssociationType:16,_associationFeatures:16,_associationViewModels:16,_canLoad:16,_canQuery:16,_featureCount:16,_loaded:16,_queryAbortController:16,_queryFeatureCountAbortController:16,_queryPageAbortController:16,_state:16,associationTypes:0,autoDestroyDisabled:5,description:1,flowItems:0,useFeatureNextFlowItem:5,flowType:1,graphic:0,heading:1,headingLevel:9,layer:0,map:0,messages:0,parentFeatureViewModel:0,referenceElement:1,source:1,spatialReference:0,timeZone:1,view:0}}static{this.styles=R}get _globalId(){return(this._globalIdField&&this.graphic?.attributes?.[this._globalIdField])??null}get _globalIdField(){return this.layer?.globalIdField}get _objectId(){return(this._objectIdField&&this.graphic?.attributes?.[this._objectIdField])??null}get _objectIdField(){return this.layer?.objectIdField}get _supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get _utilityNetwork(){let{layer:t,map:e}=this;if(!t?.loaded||!e)return null;let s=I(t)?t.parent:t;return U(e,s)}get _canLoad(){return!!this.map}get _canQuery(){return!!this.layer?.capabilities?.query?.supportsPagination}get _state(){let{_canLoad:t,_canQuery:e,_featureCount:s,_loaded:a,_queryAbortController:i,_queryFeatureCountAbortController:o,_queryPageAbortController:r,associationTypes:l}=this;return o||t&&!a?"loading":i||r?"querying":!this._globalId||!l||!e||!s?"disabled":"ready"}get heading(){return this._heading}set heading(t){this._heading=t}async destroy(){await this.manager.destroy()}loaded(){this.manager.onLifecycle(()=>[v(()=>[this.graphic,this.layer,this.map,this.associationTypes,this._canQuery,this._objectId,this._globalId],()=>{this._queryFeatureCountDebounced(),this._queryAssociationType()},{initial:!0}),v(()=>this._activeAssociationType,t=>{this._queryDebounced(t)}),v(()=>this._associationFeatures.values(),()=>{this._setUpUtilityNetworkAssociationsViewModels()})]),this.manager.onDestroy(()=>{this._cancelQuery(),this._cancelQueryFeatureCount()})}_addAssociationTypeFlowItem(t){let e=this.useFeatureNextFlowItem?F(p`<arcgis-feature-utility-network-association-list .autoDestroyDisabled=${this.autoDestroyDisabled} .associationViewModels=${this._associationViewModels} .description=${this._getParentFeatureDescription()} .flowItems=${this.flowItems} .flowType=${this.flowType} .heading=${this._getAssociationTypeTitle(t)} .messages=${this.messages} .map=${this.map} .parentFeatureViewModel=${this.parentFeatureViewModel} .referenceElement=${this.referenceElement} .state=${this._state} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} use-feature-next-flow-item .view=${this.view}></arcgis-feature-utility-network-association-list>`):F(p`<arcgis-feature-utility-network-association-list .autoDestroyDisabled=${this.autoDestroyDisabled} .associationViewModels=${this._associationViewModels} .description=${this._getParentFeatureDescription()} .flowItems=${this.flowItems} .flowType=${this.flowType} .heading=${this._getAssociationTypeTitle(t)} .messages=${this.messages} .map=${this.map} .parentFeatureViewModel=${this.parentFeatureViewModel} .referenceElement=${this.referenceElement} .state=${this._state} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${this.view}></arcgis-feature-utility-network-association-list>`);this._addFlowItem(e)}_clearAssociations(){this._attachmentAssociations.removeAll(),this._connectivityAssociations.removeAll(),this._containerAssociations.removeAll(),this._contentAssociations.removeAll(),this._structureAssociations.removeAll()}_clearFeatures(){this._associationFeatures.forEach(t=>t.removeAll()),this._associationFeatures.clear()}_compareByFeatureTitle(t,e){return t.title.localeCompare(e.title,void 0,{numeric:!0})}async _countAssociatedFeatureCount(t,e,s,a,i){let o=this._getFeatureQueryWhereClause(t,e,s,a);return await t.queryFeatureCount({where:o,outFields:["*"],returnGeometry:!1},{signal:i?.signal})}async _countAssociatedFeatures(t,e,s,a,i){if(!e.length)return 0;let o=await this._findLayersBySourceId(t);await this._loadLayers(o);let r=o.map(l=>this._countAssociatedFeatureCount(l,e,s,a,i));return(await Promise.all(r)).reduce((l,c)=>l+c,0)}async _createAssociationFeatureObjects(t,e,s,a,i){if(!t.length)return[];let o=new Map,r=Array.from(e.entries()).map(async([c,d])=>{let u=await this._findLayersBySourceId(c);await this._loadLayers(u);let h=u.map(m=>this._queryLayer(m,d,s,a,i));(await Promise.all(h)).forEach(m=>{m.forEach(n=>{if(this.source==="popup"?n.sourceLayer&&n.getEffectivePopupTemplate():n.sourceLayer){let _=n.layer.globalIdField??"",y=n.getAttribute(_),w=o.get(y)??[];w.push(n),o.set(y,w)}})})});await Promise.all(r);let l=[];return await Promise.all(t.toArray().map(async c=>{let{fromNetworkElement:d,toNetworkElement:u}=c,h=d.globalId===this._globalId?u:d,m=o.get(h.globalId)??[];await Promise.all(m.map(async n=>{let _=this._utilityNetwork?.getTerminalById(h?.terminalId??void 0)?.name,y=await n.sourceLayer.getFeatureTitle(n)||this._getFeatureTitle(n);l.push({title:y,feature:n,association:c,terminalName:_})}))})),l}_destroyAssociatedFeatureViewModels(){this._associationViewModels.forEach(t=>t.destroyAll())}_equals(t,e){if(t.globalId===j&&e.globalId===j){let s=function(d,u){return d.networkSourceId===u.networkSourceId&&d.globalId===u.globalId&&d.terminalId===u.terminalId&&d.firstUnit===u.firstUnit&&d.numUnits===u.numUnits},a=t.fromNetworkElement,i=t.toNetworkElement,o=e.fromNetworkElement,r=e.toNetworkElement,l=s(a,o),c=s(i,r);return l&&c&&t.associationType===e.associationType}return t.globalId!=null&&e.globalId!=null&&t.globalId===e.globalId}async _findLayersBySourceId(t){let{_utilityNetwork:e,map:s}=this;e?.loaded||await e?.load();let a=e.getLayerIdBySourceId(t),i=s.allLayers.filter(r=>!!e?.isUtilityLayer(r)&&r.layerId===a),o=s.allTables.filter(r=>!!e?.isUtilityLayer(r)&&r.layerId===a);return i.concat(o).toArray()}_getAssociationsByType(t){switch(t){case"attachment":return this._attachmentAssociations;case"structure":return this._structureAssociations;case"connectivity":return this._connectivityAssociations;case"container":return this._containerAssociations;case"content":return this._contentAssociations}}_getAssociationTypeTitle(t){let{messages:e}=this;if(t.title)return t.title;switch(t.type){case"attachment":return e?.associationsAttachments??this.messages?.noTitle??"";case"connectivity":return e?.associationsConnectivity??this.messages?.noTitle??"";case"structure":return e?.associationsStructure??this.messages?.noTitle??"";case"content":return e?.associationsContents??this.messages?.noTitle??"";case"container":return e?.associationsContainer??this.messages?.noTitle??""}}_getFeatureCountForAssociationType(t){switch(t){case"attachment":return this._attachmentFeatureCount;case"structure":return this._structureFeatureCount;case"content":return this._contentFeatureCount;case"container":return this._containerFeatureCount;case"connectivity":return this._connectivityFeatureCount}}_getFeatureQueryWhereClause(t,e,s,a){let i=t.globalIdField,o=t.fieldsIndex.get(D.assetGroup),r=t.fieldsIndex.get(D.assetType),l=s!=null,c=a!=null,d=i?V.sqlIn(i,e):null,u=l?`(${o?.name} = ${s})`:null,h=l&&c?`(${r?.name} = ${a})`:null;return[d,u,h].filter(Boolean).join(" AND ")}_getFeatureTitle(t){let e=t.attributes,s=t.sourceLayer;if(!e||!s)return"";let a="displayField"in s?s.displayField:null,i=a!=null?e[a.toString()]:null,o=i!=null?i.toString():null,r=t.getObjectId()?.toString();return o||r||""}_getParentFeatureDescription(){let{parentFeatureViewModel:t}=this;if(t){if("heading"in t)return t.heading;if("title"in t)return t.title}}async _loadUtiltyNetworks(){let t=this.map;if(!t)return;t.utilityNetworks&&await Promise.allSettled(t.utilityNetworks.map(s=>s.load()));let e=this._utilityNetwork;if(e){let s=a=>{if("layerId"in a&&e.isUtilityLayer(a)){let i=a.layerId!=null?e.getSourceIdByLayerId(a.layerId):null;i!=null&&this._networkSourceIdsInUse.add(i)}};this._networkSourceIdsInUse=new Set,t.allLayers.forEach(s),t.allTables.forEach(s)}}async _loadLayers(t){let e=t.filter(s=>!s.loaded).map(s=>s.load());e.length&&await Promise.allSettled(e)}_matchesGlobalFeature(t,e){return this._equals(t.association,e.association)}async _queryAssociatedFeatures(t,e){let{layer:s,_globalId:a,associationTypes:i,_utilityNetwork:o,_canQuery:r,_associationFeatures:l}=this;if(await Promise.allSettled([s?.load(),o?.load()]),!r||!s||!i||!o)return;let c=this._getAssociationsByType(t.type),{associatedAssetGroup:d,associatedAssetType:u}=t,h=new Map;c.forEach(n=>{let{fromNetworkElement:_,toNetworkElement:y}=n,{networkSourceId:w,elementGlobalId:b}=_.globalId===a?{networkSourceId:y.networkSourceId,elementGlobalId:y.globalId}:{networkSourceId:_.networkSourceId,elementGlobalId:_.globalId},g=h.get(w)||[];g.push(b),h.set(w,g)});let m=await this._createAssociationFeatureObjects(c,h,d,u,e);this._parseFeatureObjects(m,l)}async _queryAssociations(t){let{layer:e,_globalId:s,associationTypes:a,_utilityNetwork:i,_canQuery:o}=this;if(await Promise.allSettled([e?.load(),i?.load()]),this._clearAssociations(),!o||!e||!a||!i||!s)return;let r=I(e)?e.parent:e,l=new P({globalId:s,networkSourceId:i.getSourceIdByLayerId(r.layerId)}),c=new Set;a.forEach(n=>{switch(n.type){case"attachment":case"structure":c.add("attachment");break;case"container":case"content":c.add("containment");break;case"connectivity":c.add("connectivity"),c.add("junction-junction-connectivity"),c.add("junction-edge-from-connectivity"),c.add("junction-edge-midspan-connectivity"),c.add("junction-edge-to-connectivity");break}});let d=await i?.queryAssociations(new Q({elements:[l],types:Array.from(c)}),{signal:t?.signal}),u=new Map,h=new Map;a.forEach(n=>{h.set(n.type,n),u.set(n.type,[])}),d.forEach(n=>{let{toNetworkElement:_,fromNetworkElement:y}=n;switch(n.associationType){case"attachment":if(y?.globalId===s){if(this._shouldDiscardNetworkElement(_,"attachment",h))break;u.get("attachment")?.push(_.globalId),this._attachmentAssociations.add(n)}else{if(this._shouldDiscardNetworkElement(y,"structure",h))break;u.get("structure")?.push(y.globalId),this._structureAssociations.add(n)}break;case"connectivity":case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":case"junction-junction-connectivity":if(y?.globalId===s){if(this._shouldDiscardNetworkElement(_,"connectivity",h))break;u.get("connectivity")?.push(_.globalId)}else{if(this._shouldDiscardNetworkElement(y,"connectivity",h))break;u.get("connectivity")?.push(y.globalId)}this._connectivityAssociations.add(n);break;case"containment":if(y?.globalId===s){if(this._shouldDiscardNetworkElement(_,"content",h))break;u.get("content")?.push(_.globalId),this._contentAssociations.add(n)}else{if(this._shouldDiscardNetworkElement(y,"container",h))break;u.get("container")?.push(y.globalId),this._containerAssociations.add(n)}break}});let m=a.map(async n=>{let{associatedNetworkSourceId:_,associatedAssetGroup:y,associatedAssetType:w}=n,b=u.get(n.type),g=y!=null?await this._countAssociatedFeatures(_,b,y,w,t):b.length;switch(n.type){case"attachment":this._attachmentFeatureCount=g;break;case"connectivity":this._connectivityFeatureCount=g;break;case"container":this._containerFeatureCount=g;break;case"content":this._contentFeatureCount=g;break;case"structure":this._structureFeatureCount=g;break}});await Promise.allSettled(m)}async _queryFeatureCount(){await this._loadUtiltyNetworks();let{_queryFeatureCountAbortController:t,_canQuery:e}=this;if(!e){this._featureCount=0;return}await this._queryAssociations(t),this._featureCount=this._attachmentFeatureCount+this._connectivityFeatureCount+this._containerFeatureCount+this._contentFeatureCount+this._structureFeatureCount}async _queryLayer(t,e,s,a,i){let o=this._getFeatureQueryWhereClause(t,e,s,a),r=new B({where:o,outFields:["*"],cacheHint:this._supportsCacheHint}),{features:l}=await N(t,r,i);return l}_parseFeatureObjects(t,e){let s=k();t.forEach(a=>{let i=(a?.feature).sourceLayer;x(s,i,()=>new f).add(a)});for(let[a,i]of s)this._sortFeatureObjectsByTitle(i),e.set(a,i)}_selectAssociationType(t){let{flowItems:e}=this;e&&(this._activeAssociationType=t,this._setUpUtilityNetworkAssociationsViewModels(),this._addAssociationTypeFlowItem(t))}_setUpUtilityNetworkAssociationsViewModels(){this._associationViewModels.forEach((i,o)=>{let r=this._associationFeatures.get(o);r?i.forEach(l=>{r.find(c=>this._matchesGlobalFeature(l,c))||(i.remove(l),i.length||this._associationViewModels.delete(o))}):(i.removeAll(),this._associationViewModels.delete(o))});let{map:t,view:e,spatialReference:s,timeZone:a}=this;this._associationFeatures.forEach((i,o)=>{let r=this._associationViewModels.get(o)||new f;i?.filter(Boolean).forEach((l,c)=>{if(!r.some(d=>this._matchesGlobalFeature(d,l))){let{association:d,feature:u,terminalName:h,title:m}=l;r.add({title:m,association:d,featureViewModel:new G({abilities:{utilityNetworkAssociationsContent:!1},map:t,view:e,spatialReference:s,timeZone:a,graphic:u}),terminalName:h},c)}}),this._associationViewModels.set(o,r)})}_shouldDiscardNetworkElement(t,e,s){if(!t)return!1;let{networkSourceId:a}=t,i=s.get(e)?.associatedNetworkSourceId,o=this._networkSourceIdsInUse.has(a);return i!=null&&i!==a||!o}_sortFeatureObjectsByTitle(t){t.sort(this._compareByFeatureTitle)}render(){let{_state:t}=this;return p`<div class="root"><arcgis-feature-element-info .heading=${this.heading} .headingLevel=${this.headingLevel} .description=${this.description}></arcgis-feature-element-info>${t==="loading"?this._renderLoading():t==="disabled"?this._renderAssociationNotFound():this._renderContent()}</div>`}_renderAssociationNotFound(){return p`<calcite-notice icon=information kind=info open scale=s width=full><div slot=message>${this.messages?.noAssociations}</div></calcite-notice>`}_renderAssociationTypeList(t){return this._getFeatureCountForAssociationType(t.type)>0?this._renderAssociationTypeListItem(t):null}_renderAssociationTypeListItem(t){let e=this._getAssociationTypeTitle(t);return A(`association-type-${t.type}`,p`<calcite-list-item .description=${E(t.description)} .label=${E(e)} .value=${t.type} @calciteListItemSelect=${()=>this._selectAssociationType(t)}><calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon></calcite-list-item>`)}_renderContent(){let{_state:t,associationTypes:e,messages:s}=this,a=s?.associationsList??s?.noTitle??"";return A("list-container",p`<div class="list-container">${t==="ready"?p`<div><calcite-list display-mode=flat .label=${a}>${e.map(i=>this._renderAssociationTypeList(i))}</calcite-list></div>`:null}${this._renderStickyLoading()}</div>`)}_renderLoading(){return p`<div class="loading-container">${this._renderLoadingIcon()}${this._renderStickyLoading()}</div>`}_renderLoadingIcon(){return p`<calcite-loader inline label></calcite-loader>`}_renderStickyLoading(){return this._state==="querying"?p`<div class="sticky-loading-container">${this._renderLoadingIcon()}</div>`:null}};L("arcgis-feature-utility-network-associations",T);return T},"applications/Components/featureUtils","applications/Components/stringUtils","core/Collection","core/promiseUtils","core/reactiveUtils","core/sql","rest/networks/support/NetworkElement","rest/networks/support/QueryAssociationsParameters","rest/support/Query","popup/Feature",a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import b from"./VCOJNSMR.js";import a from"./ZDOE5UWP.js";export default $arcgis.t(([{isZoomScreenSize:m},{d:g},{d:u}])=>{function q(e){if(e.icon)return e.icon;if(!("image"in e&&e.image)&&!e.className)return"question"}function M(e){return e?{backgroundImage:`url(${e})`}:{}}function b(e){let{selectedFeature:r,location:o,view:t}=e;return t?r??o??null:null}function v(e){return"browseClusterEnabled"in e&&"featureMenuOpen"in e}function h(e){return"aggregatedFeaturesEnabled"in e}async function E(e,r,o){let{location:t,selectedFeature:a,view:i,zoomFactor:n}=e;await o?.viewModel?.updateGeometry();let s=o?.graphic,d=s?.geometry?s:b(e);if(!i||!d)throw new Error("Cannot zoom to location without a target and view.");let w=i.scale/n,c=s?.geometry??e.selectedFeature?.geometry??t,l=c?.type==="point"&&await m(s??a,i);r.active=!0,r.disabled=!0;try{await e.zoomTo({target:{target:d,scale:l?w:void 0}})}catch(f){if(g(f))return;throw new Error("Could not zoom to the location of the graphic.")}finally{r.active=!1,r.disabled=!1,l&&e.location!==c&&(e.location=c)}}async function p(e,r){let o=await e.whenLayerView(u(r)),t=o.createQuery(),a=r.getObjectId();return t.aggregateIds=a!=null?[a]:[],[o,t]}async function y(e,r){let{selectedFeature:o,view:t}=e;if(t?.type!=="2d")throw new Error("zoomToAggregate:invalid-view: View must be 2d MapView.");if(!o?.isAggregate)throw new Error("zoomToAggregate:invalid-selectedFeature: Selected feature must represent an aggregate graphic.");let[a,i]=await p(t,o);r.active=!0,r.disabled=!0;let{extent:n}=await a.queryExtent(i);n&&await e.zoomTo({target:n}),r.active=!1,r.disabled=!1}var T=async(e,r)=>{if(!e)throw new Error("trigger-action:missing-arguments: Event has no action");let{disabled:o,id:t}=e;if(!t)throw new Error("trigger-action:invalid-action: action.id is missing");if(o)throw new Error("trigger-action:invalid-action: Action is disabled");if(t==="zoom-to-feature")return await E(r,e).catch(a=>{if(!g(a))throw a});if(t==="zoom-to-aggregated-features")return await y(r,e);if(t==="browse-clustered-features"){if(!v(r))throw new Error("trigger-action:invalid-view-model: browse-clustered-features requires FeaturesViewModel.");r.browseClusterEnabled=!r.browseClusterEnabled,r.featureMenuOpen=r.browseClusterEnabled;return}if(t==="browse-aggregated-features"){if(!h(r))throw new Error("trigger-action:invalid-view-model: browse-aggregated-features requires Features.");r.aggregatedFeaturesEnabled=!r.aggregatedFeaturesEnabled;return}if(t==="remove-selected-feature"){r.open=!1;let{selectedFeature:a}=r;if(!a)throw new Error("trigger-action:missing-selected-feature: Cannot remove selected feature without a selected feature.");let i=u(a);i?i.remove(a):r.view?.graphics.remove(a)}};return{a:q,b:M,c:E,d:T}},"applications/Components/actionUtils",a,b)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import g from"./VCOJNSMR.js";import f from"./R3NYK6BO.js";import e from"./ZOPB777S.js";import{a as V}from"./TNDRCMN3.js";import d from"./V2RXBLNO.js";import c from"./OCLLMQGL.js";import{h as _}from"./CIFVM6AU.js";import"./EPO62377.js";import a from"./FKLH5Y2K.js";import{d as x}from"./TGNR3DAP.js";import{N as y,O as I,P as M,R as b,U as C,a as $,b as n,x as w}from"./MTKZBIHD.js";import"./3TTFCHAA.js";export default $arcgis.t(([{substitute:k},{renderingSanitizer:B},N,{watch:H},{stripHTML:Z},P,,,,R,,{a:F,b:L,c:T,d:E,e:A,i:D,p:c}])=>{var z=$`:host{display:flex;flex:1 1 auto;background-color:var(--calcite-color-foreground-1);--calcite-color-background: var(--calcite-color-foreground-1)}.root{flex:1 1 auto}.root calcite-icon{box-sizing:content-box}.loading-container{display:flex;justify-content:center;padding:var(--calcite-spacing-md) 0;width:100%}.content-element{margin-bottom:var(--calcite-spacing-lg);padding:0 var(--calcite-spacing-sm);display:flex;flex-direction:column}.content-element:only-child,.content-element:last-child{margin-bottom:var(--calcite-spacing-xxs)}.last-edited-info{padding-top:var(--calcite-spacing-xs);font-size:var(--calcite-font-size-sm)}`,U=R(P),v=class extends I{constructor(){super(...arguments),this.messages=V(),this._rootFlowNode=null,this.internalFlowItems=new N,this.flowType="feature",this.viewModel=U(this),this.view=this.viewModel.view,this.icon="icon",this.isFeatureFromTable=this.viewModel.isFeatureFromTable,this.graphic=this.viewModel.graphic,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.headingLevel=2,this.spatialReference=this.viewModel.spatialReference,this.timeZone=this.viewModel.timeZone,this.heading=this.viewModel.title,this.map=this.viewModel.map,this.chartAnimationDisabled=this.viewModel.abilities.chartAnimation,this.hideHeading=!1,this.hideContent=!1,this.hideAttachmentsContent=!1,this.hideCustomContent=!1,this.hideExpressionContent=!1,this.hideFieldsContent=!1,this.hideMediaContent=!1,this.showRelationshipContent=!1,this.hideTextContent=!1,this.showUtilityNetworkContent=!1,this.hideLastEditedInfo=!1,this.autoDestroyDisabled=!1,this.location=this.viewModel.location,this.state=this.viewModel.state,this.arcgisPropertyChange=_()("flowItems","state"),this.arcgisReady=w()}static{this.properties={popupTemplate:16,sourceLayer:16,fieldInfoMap:16,values:16,globalValues:16,internalFlowItems:16,flowType:1,viewModel:0,view:0,flowItems:0,referenceElement:1,icon:1,isFeatureFromTable:36,graphic:0,defaultPopupTemplateEnabled:5,headingLevel:9,spatialReference:0,timeZone:1,heading:0,map:0,chartAnimationDisabled:5,hideHeading:5,hideContent:5,hideAttachmentsContent:5,hideCustomContent:5,hideExpressionContent:5,hideFieldsContent:5,hideMediaContent:5,showRelationshipContent:5,hideTextContent:5,showUtilityNetworkContent:5,hideLastEditedInfo:5,autoDestroyDisabled:5,messageOverrides:0,label:1,location:0,state:32}}static{this.styles=z}get popupTemplate(){return T(this.graphic,this.defaultPopupTemplateEnabled)??void 0}get sourceLayer(){return E(this.graphic)}get fieldInfoMap(){return F(L(this.popupTemplate),this.sourceLayer)}get values(){return this.graphic?.attributes??{}}get globalValues(){return this.viewModel.formattedAttributes?.global??{}}async destroy(){this._removeFlowItems(),await this.manager.destroy()}async nextMedia(e){return this.viewModel.nextMedia(e)}async previousMedia(e){return this.viewModel.previousMedia(e)}async setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}async updateGeometry(){return await this.viewModel.updateGeometry()}loaded(){this.manager.onLifecycle(()=>[H(()=>[this.internalFlowItems?.length],()=>this._setFocus())])}_removeFlowItems(){this.internalFlowItems?.destroyAll()}_storeRootFlowNode(e){this._rootFlowNode=e}_setFocus(){this._rootFlowNode?.setFocus()}_handleDrillInBackClick(){this.internalFlowItems?.pop()?.destroy()}render(){let{state:e}=this.viewModel,t=n`<div class="container">${e==="error"?this._renderError():e==="loading"?this._renderLoading():this._renderContentContainer()}</div>`;return n`<div class="root">${t}</div>`}_renderError(){let{messages:e,hideHeading:t}=this;return n`<calcite-notice icon=exclamation-mark-circle kind=danger open scale=s>${t?null:n`<div slot=title>${e.error}</div>`}<div slot=message>${e.loadingError}</div></calcite-notice>`}_renderLoading(){return n`<div class="loading-container"><calcite-loader inline label></calcite-loader></div>`}_renderAttachments(e){let{values:t,fieldInfoMap:i,sourceLayer:o,globalValues:a}=this,s=c({values:t,fieldInfoMap:i,globalValues:a,layer:o,text:e.title}),r=c({values:t,fieldInfoMap:i,globalValues:a,layer:o,text:e.description});return n`<arcgis-feature-attachments .headingLevel=${this.headingLevel} .heading=${s} class="content-element" .displayType=${e.displayType} .attachmentKeywords=${e.attachmentKeywords??void 0} .attachmentTypes=${e.attachmentTypes??void 0} .orderByFields=${e.orderByFields??void 0} .graphic=${this.graphic??void 0} .description=${r} .messages=${this.messages}></arcgis-feature-attachments>`}_renderCustom(e){return n`<arcgis-feature-content .creator=${e.creator} .destroyer=${e.destroyer??void 0} .graphic=${this.graphic??void 0} class="content-element"></arcgis-feature-content>`}_renderFields(e,t){let i=this.viewModel.formattedAttributes,{values:o,fieldInfoMap:a,sourceLayer:s,popupTemplate:r,globalValues:l,graphic:d}=this,p=!!e?.fieldInfos,h=(e.fieldInfos??r?.fieldInfos??[])?.filter(({fieldName:m})=>!!m&&(D(m)||A(m)||m in o)),u=r?.expressionInfos,f=c({values:o,fieldInfoMap:a,globalValues:l,layer:s,text:e.title}),g=c({values:o,fieldInfoMap:a,globalValues:l,layer:s,text:e.description});return n`<arcgis-feature-fields .headingLevel=${this.headingLevel} .heading=${f} class="content-element" .messages=${this.messages} .graphic=${d??void 0} .isContentFieldInfos=${p} .layer=${s} .description=${g} .values=${{...i?.global,...i?.content?.[t]}} .fieldInfos=${h} .expressionInfos=${u??void 0}></arcgis-feature-fields>`}_renderMedia(e,t){let{values:i,graphic:o,fieldInfoMap:a,sourceLayer:s,popupTemplate:r,globalValues:l}=this,{formattedAttributes:d,relatedInfos:p}=this.viewModel,h={...d?.global,...d?.content?.[t]},u=c({values:i,fieldInfoMap:a,globalValues:l,layer:s,text:e.title}),f=c({values:i,fieldInfoMap:a,globalValues:l,layer:s,text:e.description});return n`<arcgis-feature-media .activeMediaInfoIndex=${e.activeMediaInfoIndex??0} .chartAnimationDisabled=${this.chartAnimationDisabled} .headingLevel=${this.headingLevel} .heading=${u} class="content-element" .description=${f} .values=${i} .layer=${s} .graphic=${o??void 0} .messages=${this.messages} .fieldInfoMap=${a} .mediaInfos=${e.mediaInfos??[]} .popupTemplate=${r??void 0} .relatedInfos=${p} .formattedValues=${h}></arcgis-feature-media>`}_renderText(e){return n`<arcgis-feature-content .creator=${e.text} .graphic=${this.graphic??void 0} class="content-element"></arcgis-feature-content>`}_renderExpression(e,t){let i=this.viewModel.formattedAttributes,{fieldInfoMap:o}=this;return n`<arcgis-feature-expression .expressionInfo=${e.expressionInfo} .map=${this.map??void 0} .spatialReference=${this.spatialReference??void 0} .view=${this.viewModel.view??void 0} .graphic=${this.graphic??void 0} .location=${this.location??void 0} .headingLevel=${this.headingLevel} class="content-element" .interceptor=${this.viewModel.interceptor} .messages=${this.messages} .fieldInfoMap=${o} .values=${{...i?.global,...i?.content?.[t]}}></arcgis-feature-expression>`}_renderRelationship(e,t){let{values:i,graphic:o,fieldInfoMap:a,sourceLayer:s,globalValues:r}=this,{displayCount:l,orderByFields:d,relationshipId:p}=e,{formattedAttributes:h,view:u}=this.viewModel,f={...h?.global,...h?.content?.[t]},g=c({values:i,fieldInfoMap:a,globalValues:r,layer:s,text:e.title}),m=c({values:i,fieldInfoMap:a,globalValues:r,layer:s,text:e.description});return n`<arcgis-feature-relationship .autoDestroyDisabled=${this.autoDestroyDisabled} class="content-element" .flowItems=${this.flowItems??this.internalFlowItems} .description=${m} .layer=${s} .map=${this.map??void 0} .displayCount=${l} .graphic=${o??void 0} .heading=${g} .headingLevel=${this.headingLevel} .messages=${this.messages} .orderByFields=${d??void 0} .relationshipId=${p??void 0} .spatialReference=${this.spatialReference??void 0} .timeZone=${this.timeZone??void 0} .values=${f} .view=${u??void 0}></arcgis-feature-relationship>`}_renderAssociation(e){let{fieldInfoMap:t,globalValues:i,graphic:o,messages:a,sourceLayer:s,values:r}=this,l=c({values:r,fieldInfoMap:t,globalValues:i,layer:s,text:e.title}),d=c({values:r,fieldInfoMap:t,globalValues:i,layer:s,text:e.description});return n`<arcgis-feature-utility-network-associations .autoDestroyDisabled=${this.autoDestroyDisabled} .associationTypes=${e.associationTypes} class="content-element" .description=${d} .flowItems=${this.flowItems??this.internalFlowItems} .graphic=${o??void 0} .heading=${l} .headingLevel=${this.headingLevel} .layer=${s} .map=${this.map??void 0} .messages=${a} .parentFeatureViewModel=${this.viewModel} .referenceElement=${this.referenceElement} .spatialReference=${this.spatialReference??void 0} .timeZone=${this.timeZone??void 0} .view=${this.viewModel.view??void 0}></arcgis-feature-utility-network-associations>`}_renderContentElement(e,t){switch(e.type){case"attachments":return this.hideAttachmentsContent?null:this._renderAttachments(e);case"custom":return this.hideCustomContent?null:this._renderCustom(e);case"fields":return this.hideFieldsContent?null:this._renderFields(e,t);case"media":return this.hideMediaContent?null:this._renderMedia(e,t);case"text":return this.hideTextContent?null:this._renderText(e);case"expression":return this.hideExpressionContent?null:this._renderExpression(e,t);case"relationship":return this.showRelationshipContent?this._renderRelationship(e,t):null;case"utility-network-associations":return this.showUtilityNetworkContent?this._renderAssociation(e):null;default:return null}}_renderContent(){let{content:e,graphic:t}=this.viewModel;return e?Array.isArray(e)&&e.length?e.length?e.map(this._renderContentElement,this):null:typeof e=="string"?n`<arcgis-feature-content .creator=${e} .graphic=${t??void 0} class="content-element"></arcgis-feature-content>`:e instanceof HTMLElement?e:null:null}_renderContentContainer(){let{hideContent:e,internalFlowItems:t,headingLevel:i,state:o,messages:a,heading:s,hideHeading:r}=this;if(e)return null;let l=n`<div class="main">${[this._renderContent(),this._renderLastEditInfo()]}</div>`,d=a.returnToInitialFeature??"";return this.flowItems?l:n`<calcite-flow ${y(this._storeRootFlowNode)}><calcite-flow-item .loading=${o==="loading"} .headingLevel=${i} .heading=${this.hideHeading?void 0:Z(this.heading)} .selected=${!t.length}>${!r&&s?n`<div slot=heading><div .innerHTML=${B.sanitize(s??"")??""}></div></div>`:null}${l}</calcite-flow-item>${t.toArray().map((p,h)=>n`<calcite-flow-item @calciteFlowItemBack=${u=>{u.preventDefault(),this._handleDrillInBackClick()}} .loading=${o==="loading"} .headingLevel=${i} .selected=${h===t.length-1}><calcite-action icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${d} title=${d??b}></calcite-action>${p}</calcite-flow-item>`)}</calcite-flow>`}_renderLastEditInfo(){let{hideLastEditedInfo:e,messages:t}=this,{lastEditInfo:i}=this.viewModel;if(!i||e)return null;let{date:o,user:a}=i,s=i.type==="edit"?a?t.lastEditedByUser:t.lastEdited:a?t.lastCreatedByUser:t.lastCreated,r=k(s??"",{date:o,user:a});return n`<div class=${M(x("last-edited-info","content-element"))}>${r}</div>`}};C("arcgis-feature",v);return v},"intl","applications/Components/sanitizerUtils","core/Collection","core/reactiveUtils","applications/Components/stringUtils","widgets/Feature/FeatureViewModel",a,c,d,e,f,g)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import c from"./VCOJNSMR.js";import b from"./R3NYK6BO.js";import{a as y}from"./HMWOHSHV.js";import a from"./ZDOE5UWP.js";import{a as p}from"./PC4PAQXQ.js";import{h as f}from"./CIFVM6AU.js";import"./EPO62377.js";import"./TGNR3DAP.js";import{O as F,S as _,U as A,a as m,b as d,o as n}from"./MTKZBIHD.js";import"./3TTFCHAA.js";export default $arcgis.t(([,v,b,S,{getDisplayedSymbol:x},{stripHTML:C},{watch:l},{d:I},,{d:w}])=>{var B=m`calcite-notice{padding:var(--calcite-space-lg)}`,u=class extends F{constructor(){super(...arguments),this._aggregatedGraphicsSet=new Set,this.aggregatedFeatureCount=0,this.selectedAggregatedFeatureIndex=-1,this.aggregatedFeatureItems=[],this.aggregatedFeatures=[],this.autoDestroyDisabled=!1,this.loading=!1,this.selectedAggregateBoundaryFeature=new b({symbol:new S({outline:{width:1.5,color:"cyan"},style:"none"})}),this.arcgisPropertyChange=f()("aggregatedFeatureCount","selectedAggregatedFeatureIndex","aggregatedFeatureItems","aggregatedFeatures","loading"),this._renderableAggregatedFeatureItems=[]}static{this.properties={_abortController:16,aggregatedFeatureCount:32,selectedAggregatedFeatureIndex:32,aggregatedFeatureItems:32,aggregatedFeatures:32,autoDestroyDisabled:5,feature:0,flowItems:0,loading:32,map:0,messages:0,selectedAggregateBoundaryFeature:32,spatialReference:0,timeZone:1,view:0}}static{this.styles=B}async destroy(){await this.manager.destroy(),this._cancelQuery(),this._clearAggregatedFeatureItems(),this._removeAggregateBoundaryFeature()}async next(){await this._selectRelativeAggregatedFeature(1)}async previous(){await this._selectRelativeAggregatedFeature(-1)}loaded(){this.manager.onLifecycle(()=>[l(()=>[this.feature,this.view],()=>{this._updateAggregatedFeatures()},{initial:!0}),l(()=>this._getAggregatedFeatureItemsHeadingSignature(),()=>this.requestUpdate()),l(()=>this.flowItems?.length,()=>{let{flowItems:e}=this,t=e?.getItemAt((e.length??0)-1)?.graphic??void 0;this._setSelectedAggregatedFeatureIndex(t?this.aggregatedFeatures.indexOf(t):-1),this._removeSelectedAggregatedFeature(),t&&this._aggregatedGraphicsSet.has(t)&&this._addSelectedAggregatedFeature(t)})])}disconnectedCallback(){super.disconnectedCallback(),this._cancelQuery(),this._clearAggregatedFeatureItems(),this._removeAggregateBoundaryFeature()}_setAggregatedFeatureCount(e){n(()=>this.aggregatedFeatureCount=e)}_setSelectedAggregatedFeatureIndex(e){n(()=>this.selectedAggregatedFeatureIndex=e)}_setAggregatedFeatureItemsReadOnly(e){n(()=>{this.aggregatedFeatureItems=e}),this._renderableAggregatedFeatureItems=e.filter(t=>!!t.graphic)}_setAggregatedFeatures(e){this._aggregatedGraphicsSet=new Set(e),n(()=>this.aggregatedFeatures=e)}_getAggregatedFeatureItemsHeadingSignature(){let e="";for(let t of this.aggregatedFeatureItems)e+=`${t.heading??""}|`;return e}_setLoading(e){n(()=>this.loading=e)}_cancelQuery(){this._abortController=p(this._abortController),this._setLoading(!1)}_removeBoundaryGraphicFromView(e){e?.graphics.remove(this.selectedAggregateBoundaryFeature)}_clearAggregatedFeatureItems(){this._setAggregatedFeatureItemsReadOnly([]),this._setSelectedAggregatedFeatureIndex(-1),this._removeSelectedAggregatedFeature()}_resetAggregatedFeaturesState(){this._setAggregatedFeatures([]),this._clearAggregatedFeatureItems(),this._setAggregatedFeatureCount(0),this._removeAggregateBoundaryFeature()}_setAggregatedFeatureItems(e){this._setAggregatedFeatureItemsReadOnly(e.map(t=>new v({graphic:t})))}_setAggregatedFeaturesState(e){this._setAggregatedFeatures(e),this._setAggregatedFeatureItems(e),this._setAggregatedFeatureCount(e.length)}_removeAggregateBoundaryFeature(){this._removeBoundaryGraphicFromView(this._boundaryGraphicView),this.selectedAggregateBoundaryFeature.geometry=null,this._boundaryGraphicView=void 0}_updateAggregateBoundaryFeature(e){let{view:t}=this,a=this._boundaryGraphicView;if(!t){this._removeAggregateBoundaryFeature();return}a!==t&&this._removeBoundaryGraphicFromView(a),this.selectedAggregateBoundaryFeature.geometry=e,this._boundaryGraphicView=t,t.graphics.includes(this.selectedAggregateBoundaryFeature)||t.graphics.add(this.selectedAggregateBoundaryFeature)}async _getLayerViewAndQuery(e){let{view:t}=this,a=w(e);if(!t||!a)return null;let r=await t.whenLayerView(a);if(!r?.createQuery||!r?.queryFeatures||!r?.queryExtent)return null;let g=r.createQuery(),s=e.getObjectId();return g.aggregateIds=s!=null?[s]:[],[r,g]}async _updateAggregatedFeatures(){this._cancelQuery();let{feature:e}=this;if(!e?.isAggregate){this._resetAggregatedFeaturesState();return}let t=await this._getLayerViewAndQuery(e);if(!t){this._resetAggregatedFeaturesState();return}let[a,r]=t,g=new AbortController;this._abortController=g,this._setLoading(!0);try{let[s,o]=await Promise.all([a.queryFeatures(r,{signal:g.signal}),a.queryExtent(r,{signal:g.signal})]);if(this._abortController!==g||g.signal.aborted)return;this._abortController=null,this._setLoading(!1);let i=s.features??[];this._setAggregatedFeaturesState(i),o.extent?this._updateAggregateBoundaryFeature(o.extent):this._removeAggregateBoundaryFeature()}catch(s){if(this._abortController!==g||(this._abortController=null,this._setLoading(!1),I(s)))return;this._resetAggregatedFeaturesState()}}_addFlowItem(e){e&&this.flowItems?.push(e)}async _addSelectedAggregatedFeature(e){let{view:t}=this;if(e&&t){let a=await x(e),r=e.clone();r.symbol=a,this._selectedAggregatedFeature=r,t.graphics.add(this._selectedAggregatedFeature)}}_removeSelectedAggregatedFeature(){this._selectedAggregatedFeature&&this.view&&(this.view.graphics.remove(this._selectedAggregatedFeature),this._selectedAggregatedFeature=void 0)}async _selectFeature(e){let{flowItems:t,view:a}=this;t&&this._addFlowItem(_(y(e,d`<arcgis-feature-next .autoDestroyDisabled=${this.autoDestroyDisabled} .flowItems=${t} .graphic=${e.graphic} .map=${this.map} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${a??void 0}></arcgis-feature-next>`)))}async _selectRelativeAggregatedFeature(e){let{aggregatedFeatures:t,aggregatedFeatureItems:a,flowItems:r}=this;if(!r||t.length===0||a.length===0)return;let g=t.length,s=this.selectedAggregatedFeatureIndex>=0&&this.selectedAggregatedFeatureIndex<g?this.selectedAggregatedFeatureIndex:-1;if(s===-1){let h=r.getItemAt(r.length-1)?.graphic;s=h?t.indexOf(h):-1}let o=s===-1?e>0?0:g-1:(s+e+g)%g,i=a[o];if(!i?.graphic)return;this._setSelectedAggregatedFeatureIndex(o);let c=r.getItemAt(r.length-1);if(c?.flowType==="feature"){c.graphic=i.graphic,this._removeSelectedAggregatedFeature(),await this._addSelectedAggregatedFeature(i.graphic);return}await this._selectFeature(i)}_renderChevronIconNode(){return d`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`}render(){let{_renderableAggregatedFeatureItems:e}=this,{loading:t}=this;return t||e.length>0?d`<calcite-list .loading=${t} display-mode=flat .filterEnabled=${e.length>10} .filterPlaceholder=${this.messages?.aggregatedFeaturesPlaceholder??""} .label=${this.messages?.aggregatedFeatures??""} selection-mode=none>${e.map(a=>d`<calcite-list-item .label=${C(a.heading)??""} @calciteListItemSelect=${()=>this._selectFeature(a)}>${this._renderChevronIconNode()}</calcite-list-item>`)}</calcite-list>`:d`<calcite-notice icon=information kind=brand open scale=s width=full><div slot=message>${this.messages?.noAggregatedFeatures}</div></calcite-notice>`}};A("arcgis-aggregated-features",u);return u},"core/Collection","popup/Feature","Graphic","symbols/SimpleFillSymbol","symbols/support/symbolUtils","applications/Components/stringUtils","core/reactiveUtils",a,b,c)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{a as _}from"./MP6Z45SA.js";import c from"./VCOJNSMR.js";import a from"./R3NYK6BO.js";import{a as f}from"./HMWOHSHV.js";import{d as P}from"./TGNR3DAP.js";import{M as O,N as S,O as j,P as R,S as b,U as Q,a as E,b as o}from"./MTKZBIHD.js";import"./3TTFCHAA.js";export default $arcgis.t(([{templateHasKey:V,stripHTML:T},{renderingSanitizer:k},{isRelatableFeatureSupportedLayer:J,findRelatedLayer:U},{substitute:X,formatNumber:H},{watch:F,on:Y},K,Z,{ignoreAbortErrors:D},ee,,{g:B}])=>{var te=E`:host{position:relative;flex:1 1 auto}.list{min-height:var(--calcite-spacing-xxxl)}.list-item-hidden{display:none}.feature-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.sticky-loading-container{display:flex;position:sticky;bottom:var(--calcite-spacing-sm);align-items:center;justify-content:center;z-index:2;margin:0;padding:0;height:var(--calcite-spacing-xxxl);pointer-events:none}`,re=y=>{let e=[];if(y.formTemplate){let{description:t,title:r}=y.formTemplate;y.fields?.forEach(i=>{let s=r&&V(r,i.name),a=t&&V(t,i.name);(s||a)&&e.push(i.name)})}return e},x=100,N=class extends j{constructor(){super(...arguments),this._increaseFeaturePage=()=>{let{state:e,showAllEnabled:t,relatedFeatures:r,featuresPerPage:i,featurePage:s}=this;e==="ready"&&t&&r.length>=i*s&&this.featurePage++},this._relatedFeatureIntersectionObserver=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._featurePage=1,this._cancelQuery=()=>{let{_queryAbortController:e}=this;e&&e.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{let{_queryFeatureCountAbortController:e}=this;e&&e.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{let{_queryPageAbortController:e}=this;e&&e.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();let e=new AbortController;this._queryAbortController=e,await D(this._query()),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();let e=new AbortController;this._queryFeatureCountAbortController=e,await D(this._queryFeatureCount()),this._queryFeatureCountAbortController===e&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{let e=new AbortController;this._queryPageAbortController=e,await D(this._queryPage()),this._queryPageAbortController===e&&(this._queryPageAbortController=null)},this._queryDebounced=_(this._queryController,x),this._queryFeatureCountDebounced=_(this._queryFeatureCountController,x),this._queryPageDebounced=_(this._queryPageController,x),this._query=async()=>{let{_queryAbortController:e,relatedFeatures:t}=this;!this.featureCount||this.relatedLayer?.type==="subtype-group"&&!this.activeCategory||(this.relatedFeatureViewModels.destroyAll(),this.featurePage=1,t.destroyAll(),t.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:e?.signal}))))},this._addFlowItem=e=>{e&&this.flowItems?.push(e)},this._relatedFeatureIntersectionObserverNode=O(),this.relatedFeatures=new K,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featureCount=0,this._loaded=!1,this.relatedFeatureViewModels=new K,this.autoDestroyDisabled=!1,this.featuresPerPage=10,this.useFeatureNextFlowItem=!1,this.flowType="feature-relationship",this.headingLevel=2,this.hideHeading=!1,this.hideDescription=!1,this.showAllEnabled=!1}static{this.properties={allCategories:16,_queryAbortController:16,_queryPageAbortController:16,_queryFeatureCountAbortController:16,featureCount:16,_loaded:16,canLoad:16,canQuery:16,displayShowAllButton:16,displayListItems:16,categories:16,itemDescriptionFieldName:16,relatedFeatureViewModels:16,state:16,autoDestroyDisabled:5,allItemsDescription:32,featurePage:9,featuresPerPage:9,flowItems:0,useFeatureNextFlowItem:5,flowType:1,headingLevel:9,messages:0,heading:1,description:1,values:0,activeCategory:0,hideHeading:5,hideDescription:5,displayCount:9,graphic:0,layer:0,map:0,view:0,spatialReference:0,timeZone:1,orderByFields:0,relationshipId:9,showAllEnabled:5,label:3}}static{this.styles=te}get orderByFieldsFixedCasing(){let{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(r=>{let i=r.clone();return i.field=B(r.field,t),i}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get allCategoriesCount(){return this.allCategories?.length??0}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedLayer(){let{layer:e,map:t,relationship:r}=this;if(!e?.loaded||!t||!r)return null;let i=e.type==="subtype-sublayer"&&e.parent&&J(e.parent)?e.parent:e;return U(t,i,r)??null}get relatedLayerKeyField(){let{relatedLayer:e,relationshipId:t}=this;return e?.loaded&&t!=null?e.relationships?.find(r=>r.id===t)?.keyField:null}get relatedLayerKeyFields(){let{relatedLayer:e}=this;return e?.loaded?e.relationships?.map(t=>t.keyField).filter(t=>t!=null)??[]:[]}get relationship(){let{relationshipId:e,layer:t}=this;return e!=null&&t?.loaded?t.relationships?.find(({id:r})=>r===e)??null:null}get relationshipKey(){let{relationshipKeyField:e}=this;return(e&&this.graphic?.attributes?.[e])??null}get relationshipKeyField(){return this.relationship?.keyField||null}get canLoad(){return!!this.map&&this.relationshipId!=null&&typeof this.objectId=="number"}get canQuery(){let e=this.layer?.capabilities?.queryRelated;return!!this.relatedLayer&&!!this.relationship&&this.relationshipId!=null&&this.objectId!=null&&!!e?.supportsCount&&e?.supportsPagination}get displayShowAllButton(){let{showAllEnabled:e,featureCount:t,displayCount:r,state:i,allCategoriesCount:s}=this,a=!!s&&(s>r||r===0),n=!!t&&(t>r||r===0);return!e&&i==="ready"&&(a||n)}get displayListItems(){let{relatedFeatures:e,allCategoriesCount:t}=this;return this.displayShowAllButton||!!e.length||!!t}get categories(){let{allCategories:e}=this;return this.showAllEnabled?e:e?.slice(0,this.displayCount)??null}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}get state(){let{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,canQuery:i,_loaded:s,canLoad:a}=this;return t||a&&!s?"loading":e||r?"querying":i?"ready":"disabled"}get allItemsDescription(){let{messages:e,featureCount:t,allCategories:r,allCategoriesCount:i}=this;return X(e?.numberRecords??"",{number:H(r?i:t)})}get featurePage(){return this._featurePage}set featurePage(e){let{featuresPerPage:t,featureCount:r}=this,i=1,s=Math.ceil(r/t)||1;this._featurePage=Math.min(Math.max(e,i),s)}get heading(){let{activeCategory:e}=this;return this._heading??e?.name}set heading(e){this._heading=e}get displayCount(){return this._displayCount??3}set displayCount(e){this._displayCount=Math.min(Math.max(e??3,0),10)}async destroy(){await this.manager.destroy()}loaded(){this.manager.onLifecycle(()=>[F(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount,this.activeCategory],()=>this._queryDebounced(),{initial:!0}),F(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),F(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery,this.activeCategory],()=>this._queryFeatureCountDebounced(),{initial:!0}),F(()=>[this.state,this.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),Y(()=>this.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels())]),this.manager.onDestroy(()=>{this.relatedFeatureViewModels.destroyAll(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage(),this._unobserveRelatedFeatureObserver()})}async _queryFeatureCount(){let{layer:e,relatedLayer:t}=this;await e?.load(),await t?.load();let{_queryFeatureCountAbortController:r,activeCategory:i,canQuery:s,objectId:a,relatedLayerKeyField:n,relationshipId:l,relationshipKey:p,supportsCacheHint:C}=this;if(!s||!e||!t||a==null){this.featureCount=0,this.allCategories=void 0;return}if(t?.type==="subtype-group"&&!i){if(this.featureCount=0,this.relatedFeatureViewModels.destroyAll(),this.featurePage=1,this.relatedFeatures.destroyAll(),n&&p!=null){let{default:I}=await $arcgis.t(m=>m[0],"smartMapping/statistics/uniqueValues"),{uniqueValueInfos:$}=await I({layer:t,sqlWhere:`${n} = '${p}'`,field:t.subtypeField??void 0,signal:r?.signal}),A=$.map(({count:u,value:c})=>{let m=t.subtypes?.find(q=>q.code===c)?.name;return c!=null&&m?{count:u,value:c,name:m}:void 0}).filter(u=>u!=null);this.allCategories=A}return}let{historicMoment:g,gdbVersion:w}=e,v=new Z({cacheHint:C,gdbVersion:w,historicMoment:g,relationshipId:l,returnGeometry:!1,objectIds:[a],where:this._getRelationshipWhereClause(t)}),h=await e.queryRelatedFeaturesCount(v,{signal:r?.signal});this.allCategories=void 0,this.featureCount=h[a]||0}_getRelationshipWhereClause(e){let{activeCategory:t}=this,r=e.createQuery(),i="subtypeField"in e?e.subtypeField:void 0,s=t&&i?`${i} = ${t.value}`:void 0,a=r.where;return a&&s?`(${a}) AND (${s})`:a??s}_sliceFeatures(e){let{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){let{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:i,featureCount:s}=this;!r||t<2||!s||this.relatedLayer?.type==="subtype-group"&&!this.activeCategory||e.addMany(await this._queryRelatedFeatures({signal:i?.signal}))}async _queryRelatedFeatures(e){let{displayCount:t,featureCount:r,featurePage:i,featuresPerPage:s,layer:a,orderByFieldsFixedCasing:n,relatedLayer:l,relatedLayerKeyFields:p,relationshipId:C,showAllEnabled:g,supportsCacheHint:w}=this,{canQuery:v,objectId:h}=this;if(!v||!a||!l||h==null)return[];let I=g?((i-1)*s+r)%r:0,$=g?s:t,A=l.objectIdField,u="subtypeField"in l?l.subtypeField:void 0,c=[...n.map(d=>d.field),...re(l),...p,A,u].filter(d=>d!=null),m=n.map(d=>`${d.field} ${d.order}`),{historicMoment:q,gdbVersion:z}=a,W=new Z({orderByFields:m,start:I,num:$,outFields:c,cacheHint:w,historicMoment:q,gdbVersion:z,relationshipId:C,returnGeometry:!1,objectIds:[h],where:this._getRelationshipWhereClause(l)}),L=(await a.queryRelatedFeatures(W,{signal:e?.signal}))[h]?.features||[];return l.type==="subtype-group"&&u?L.forEach(d=>{let G=d.attributes[u],M=l.findSublayerForSubtypeCode?.(G);d.sourceLayer=M,d.layer=M}):L.forEach(d=>{d.sourceLayer=l,d.layer=l}),L}_selectCategory(e){let{flowItems:t}=this;t&&this._addRelationshipFlowItem({showAllEnabled:!0,activeCategory:e})}_selectRecord(e){let{flowItems:t}=this;if(!t)return;let r=this.useFeatureNextFlowItem?b(f(e,o`<arcgis-feature-next .autoDestroyDisabled=${this.autoDestroyDisabled} .flowItems=${t} .flowType=${this.flowType} .graphic=${e.graphic} .map=${this.map} show-relationship-content .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${this.view}></arcgis-feature-next>`)):b(f(e,o`<arcgis-feature .autoDestroyDisabled=${this.autoDestroyDisabled} .flowItems=${t} .flowType=${this.flowType} .graphic=${e.graphic} .map=${this.map} show-relationship-content .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${this.view}></arcgis-feature>`));this._addFlowItem(r)}_addRelationshipFlowItem({showAllEnabled:e=!1,activeCategory:t}){this._addFlowItem(b(f(t,o`<arcgis-feature-relationship .autoDestroyDisabled=${this.autoDestroyDisabled} .messages=${this.messages} .activeCategory=${t} .displayCount=${this.displayCount} .flowItems=${this.flowItems} .flowType=${this.flowType} .graphic=${this.graphic} .heading=${this.heading} hide-description .showAllEnabled=${e} hide-heading .layer=${this.layer} .map=${this.map} .orderByFields=${this.orderByFields} .relationshipId=${this.relationshipId} .spatialReference=${this.spatialReference} .useFeatureNextFlowItem=${this.useFeatureNextFlowItem} .values=${this.values} .view=${this.view}></arcgis-feature-relationship>`)))}_showAllRecords(){let{flowItems:e}=this;e&&this._addRelationshipFlowItem({showAllEnabled:!0})}_handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();let{state:e,showAllEnabled:t}=this;this._relatedFeatureIntersectionObserverNode.value&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode.value)}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode.value&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode.value)}_matchesFeature(e,t){let r=e?.graphic?.getObjectId(),i=t?.getObjectId();return r!=null&&i!=null&&r===i}_setRelatedFeaturesViewModels(){let{relatedFeatures:e,relatedFeatureViewModels:t,map:r,view:i,spatialReference:s,timeZone:a}=this;e?.filter(Boolean).forEach(n=>{t.some(l=>this._matchesFeature(l,n))||t.add(new ee({abilities:{relationshipContent:!1},map:r,view:i,spatialReference:s,timeZone:a,graphic:n}))}),t.forEach(n=>{e?.find(l=>this._matchesFeature(n,l))||t.remove(n)})}render(){let{state:e}=this;return o`<div class="root"><arcgis-feature-element-info .heading=${this.heading} .headingLevel=${this.headingLevel} .description=${this.description}></arcgis-feature-element-info>${e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures()}</div>`}_renderStickyLoading(){return this.state==="querying"?o`<div class="sticky-loading-container">${this._renderLoadingIcon()}</div>`:null}_renderLoadingIcon(){return o`<calcite-loader inline label></calcite-loader>`}_renderLoading(){return o`<div class="loading-container">${this._renderLoadingIcon()}</div>`}_renderShowAllIconNode(){return o`<calcite-icon icon=list scale=s slot=content-end></calcite-icon>`}_renderChevronIconNode(){return o`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`}_renderCategory(e){let{count:t,name:r}=e,i=H(t);return o`<calcite-list-item class="list-item" .disabled=${!t} .label=${r} @calciteListItemSelect=${()=>this._selectCategory(e)}><calcite-chip .label=${i} scale=s slot=content-end>${i}</calcite-chip>${this._renderChevronIconNode()}</calcite-list-item>`}_renderRelatedFeature(e){let{itemDescriptionFieldName:t,values:r}=this,{formattedAttributes:i,state:s,heading:a}=e,n={...r,...i?.global},l=(t&&n?.[t])??"";return o`<calcite-list-item class=${R(P("list-item",{"list-item-hidden":s==="loading"}))} .description=${T(l.toString())} .label=${T(a)} @calciteListItemSelect=${()=>this._selectRecord(e)}><div slot=heading><div .innerHTML=${k.sanitize(a??"")??""}></div></div><div slot=description><div .innerHTML=${k.sanitize(l??"")??""}></div></div>${this._renderChevronIconNode()}</calcite-list-item>`}_renderShowAllListItem(){return this.displayShowAllButton?o`<calcite-list-item .description=${this.allItemsDescription} .label=${this.messages?.showAll} @calciteListItemSelect=${()=>this._showAllRecords()}>${this._renderShowAllIconNode()}</calcite-list-item>`:null}_renderNoRelatedFeaturesMessage(){return o`<calcite-notice icon=information kind=brand open scale=s width=full><div slot=message>${this.messages?.noRelatedFeatures}</div></calcite-notice>`}_renderFeatureObserver(){return o`<div class="feature-observer" ${S(this._relatedFeatureIntersectionObserverNode)}></div>`}_renderList(){let{relatedFeatureViewModels:e,categories:t}=this;return o`<calcite-list display-mode=flat .label=${this.messages?.relatedFeaturesList??""}>${t?.map(r=>this._renderCategory(r))??e.toArray().map(r=>this._renderRelatedFeature(r))}${this._renderShowAllListItem()}</calcite-list>`}_renderRelatedFeatures(){let{displayListItems:e}=this,{state:t}=this;return o`<div class=${R(P("list",{"list-querying":t==="querying"}))}>${e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null}${this._renderStickyLoading()}${this._renderFeatureObserver()}</div>`}_renderRelationshipNotFound(){return o`<calcite-notice icon=exclamation-mark-triangle kind=danger open scale=s width=full><div slot=message>${this.messages?.relationshipNotFound}</div></calcite-notice>`}};Q("arcgis-feature-relationship",N);return N},"applications/Components/stringUtils","applications/Components/sanitizerUtils","applications/Components/featureUtils","intl","core/reactiveUtils","core/Collection","rest/support/RelationshipQuery","core/promiseUtils","popup/Feature",a,c)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import d from"./JQVJUBK3.js";import b from"./R3NYK6BO.js";import{a as c}from"./HMWOHSHV.js";import{P as g,S as h,U as y,a as f,b as a}from"./MTKZBIHD.js";import"./3TTFCHAA.js";export default $arcgis.t(([{stripHTML:$},{formatNumber:F,substitute:_},{f:u},w])=>{var b=f`:host{position:relative;flex:1 1 auto}.list-item--hidden{display:none}.feature-observer{bottom:var(--calcite-spacing-xxl);position:relative;text-align:center;z-index:2}.loading-container{display:flex;justify-content:center;padding:var(--calcite-spacing-md) 0;width:100%}.notice-container{margin-bottom:var(--calcite-spacing-xs)}`,A="nested",p=class extends w{constructor(){super(...arguments),this.autoDestroyDisabled=!1,this.displayCount=3,this.useFeatureNextFlowItem=!1,this.flowType="feature-utility-network-association-type"}static{this.properties={autoDestroyDisabled:5,description:1,displayCount:9,endIndex:32,flowItems:0,useFeatureNextFlowItem:5,flowType:1,heading:1,map:0,referenceElement:1,spatialReference:0,timeZone:1,view:0}}static{this.styles=b}get endIndex(){let{currentFeaturePage:e,featuresPerPage:t,maxFeatureCount:s}=this;return Math.min(e*t,s)}async destroy(){await this.manager.destroy()}_featureViewModelMatch(e,t){let s=e.graphic,i=s?.layer,o=null;u(i)&&i.parent?o=i.parent.globalIdField??null:i&&"globalIdField"in i&&(o=i.globalIdField);let r=o?s?.getAttribute(o):null,l=t.graphic,n=l?.layer,d=null;u(n)&&n.parent?d=n.parent.globalIdField??null:n&&"globalIdField"in n&&(d=n.globalIdField);let m=d?l?.getAttribute(d):null;return!!(r&&m&&r===m)}_findFlowItem(e){return this.flowItems?.findIndex(t=>{if(t.flowType!=="feature-association")return!1;let s=t.viewModel;return this._featureViewModelMatch(s,e)})??-1}_formatPercentAlong(e){let{percentAlong:t}=e;return t==null?"":F(t,{style:"percent",maximumFractionDigits:2})}async _handleFeatureClick(e,t,s){let{flowItems:i}=this;if(e){i?.destroyAll();return}if(t<0||!i){await this._selectAssociation(s);return}for(;i.length>t+1;)i.pop()}_isConnectivityAssociation(e){let{associationType:t}=e;return t==="connectivity"||t==="junction-junction-connectivity"||t==="junction-edge-from-connectivity"||t==="junction-edge-midspan-connectivity"||t==="junction-edge-to-connectivity"}_isConnectivityMidspanAssociation(e){return e.associationType==="junction-edge-midspan-connectivity"}_isParentFeature(e){let t=this.flowItems?.getItemAt(0);if(!t)return!1;let s=t.parentFeatureViewModel;return this._featureViewModelMatch(s,e)}async _selectAssociation(e){let{flowItems:t}=this;if(!t)return;let s=this.useFeatureNextFlowItem?h(c(this.parentFeatureViewModel,a`<arcgis-feature-next .autoDestroyDisabled=${this.autoDestroyDisabled} .flowItems=${t} .flowType=${"feature-association"} .graphic=${e.graphic} .map=${this.map} .referenceElement=${this.referenceElement} show-utility-network-content .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${this.view}></arcgis-feature-next>`)):h(c(this.parentFeatureViewModel,a`<arcgis-feature .autoDestroyDisabled=${this.autoDestroyDisabled} .flowItems=${t} .flowType=${"feature-association"} .graphic=${e.graphic} .map=${this.map} .referenceElement=${this.referenceElement} show-utility-network-content .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${this.view}></arcgis-feature>`));t.push(s)}_showAllAssociations(e){let{flowItems:t,description:s}=this;if(!t||!e)return;this.showAllEnabled=!0;let i=e?.title??"";t.push(h(a`<arcgis-feature-utility-network-association-list .autoDestroyDisabled=${this.autoDestroyDisabled} .associationViewModels=${this.associationViewModels} .description=${s} .flowItems=${t} .flowType=${this.flowType} .heading=${i} .messages=${this.messages} .parentFeatureViewModel=${this.parentFeatureViewModel} .referenceElement=${this.referenceElement} .selectedLayer=${e} .showAllEnabled=${this.showAllEnabled} .useFeatureNextFlowItem=${this.useFeatureNextFlowItem}></arcgis-feature-utility-network-association-list>`))}render(){let{associationViewModels:e,state:t}=this,s=this.selectedLayer?.title??this.messages?.noTitle??"";return a`<div class="root">${t==="loading"||t==="querying"?this._renderLoading():a`<calcite-list .displayMode=${A} .filterEnabled=${this.showAllEnabled&&!!this.selectedLayer} .filterLabel=${this.messages?.associationFilterPlaceholder} .filterPlaceholder=${this.messages?.associationFilterPlaceholder} .label=${s}>${this.showAllEnabled&&this.selectedLayer?a`${this._renderFeatureCountWarning()}${this._renderAssociatedFeatureListPage()}${this._renderFeatureObserver()}`:Array.from(e.keys(),i=>this._renderTypeList(i))}</calcite-list>`}</div>`}_renderAssociatedFeature(e){let{featureViewModel:t,title:s}=e,i=this.state==="loading",o=this._findFlowItem(t),r=o<0&&this._isParentFeature(t),l=r||o>=0,n=`associated-feature-${e.association.globalId}`;return a`<calcite-list-item class=${g(i?"list-item--hidden":"")} .description=${$(e.terminalName??"")} .label=${$(s)} @calciteListItemSelect=${async()=>await this._handleFeatureClick(r,o,t)}>${this._isConnectivityAssociation(e.association)?this._renderConnectivityIcon(e.association.associationType,n):null}${this._isConnectivityMidspanAssociation(e.association)?a`<calcite-chip .label=${this._formatPercentAlong(e.association)} scale=s slot=content-end>${this._formatPercentAlong(e.association)}</calcite-chip>`:null}${this._renderChevronIconNode(l)}</calcite-list-item>`}_renderAssociatedFeatureList(e){return e.toArray().map(t=>this._renderAssociatedFeature(t))}_renderAssociatedFeatureListPage(){let e=this.associationViewModels.get(this.selectedLayer).slice(0,this.endIndex);return[...this._renderTooltips(e),...this._renderAssociatedFeatureList(e)]}_renderChevronIconNode(e){return a`<calcite-icon flip-rtl .icon=${e?"move-up":"chevron-right"} scale=s slot=content-end></calcite-icon>`}_renderItemTooltip(e){let{tooltipReferenceMap:t}=this,s=`associated-feature-${e.association.globalId}`;return this._isConnectivityAssociation(e.association)?a`<calcite-tooltip overlay-positioning=fixed .referenceElement=${t.get(s)}>${this.getConnectivityTooltip(e.association.associationType)}</calcite-tooltip>`:null}_renderTypeList(e){let{messages:t}=this,{displayCount:s}=this,i=this.associationViewModels.get(e),o=i.slice(0,s),r=o.length<i.length,l=_(t?.numberRecords??"",{number:i.length.toString()}),n=t?.showAll??"";return c("show-all",a`<calcite-list-item expanded .label=${e.title} .value=${e.id}><calcite-chip .label=${String(i.length)} scale=s slot=content-end>${i.length}</calcite-chip><calcite-list .group=${e.id} .label=${e.title??""}>${[this._renderTooltips(o),this._renderAssociatedFeatureList(o)]}${r?c("show-all-item",a`<calcite-list-item .description=${l} .label=${n} @calciteListItemSelect=${()=>this._showAllAssociations(e)}><calcite-icon icon=list scale=s slot=content-end></calcite-icon></calcite-list-item>`):null}</calcite-list></calcite-list-item>`)}_renderTooltips(e){return e.toArray().map(t=>this._renderItemTooltip(t))}};y("arcgis-feature-utility-network-association-list",p);return p},"applications/Components/stringUtils","intl",b,d)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import l from"./6QJQJ4I7.js";import j from"./VCOJNSMR.js";import i from"./R3NYK6BO.js";import{a as I}from"./HMWOHSHV.js";import h from"./ZDOE5UWP.js";import{a as k}from"./PC4PAQXQ.js";import e from"./ZOPB777S.js";import{a as H}from"./TNDRCMN3.js";import d from"./V2RXBLNO.js";import c from"./OCLLMQGL.js";import{h as P}from"./CIFVM6AU.js";import"./EPO62377.js";import a from"./FKLH5Y2K.js";import{a as D,d as A}from"./TGNR3DAP.js";import{M as f,N as v,O as N,P as b,R as g,S as O,U as R,a as L,b as o,o as T,x as C}from"./MTKZBIHD.js";import"./3TTFCHAA.js";export default $arcgis.t(([K,U,G,{initializeProjection:W},{renderingSanitizer:M},{stripHTML:S},{substitute:p,formatNumber:x},{watch:d},,,,z,,,{d:E},{c:V,d:Z}])=>{var X=L`:host{display:flex;overflow:hidden;flex:1 1 auto}.root{--calcite-color-background: var(--calcite-color-foreground-1);display:flex;overflow:hidden;flex:1 1 auto;flex-direction:column}.root img{image-orientation:from-image}.flow-item-collapsed{--calcite-flow-item-header-border-block-end: none}.container{display:flex;flex:1 1 auto;background-color:var(--calcite-color-foreground-1)}.container calcite-list{width:100%}.container:not(:empty,.content-hidden){padding:var(--arcgis-internal-padding-md, var(--calcite-spacing-md))}.root .arcgis-feature,.root .arcgis-feature-relationship,.root .arcgis-feature-utility-network-associations{background-color:transparent}.heading{word-break:break-word;word-wrap:break-word}.header,.footer{display:flex;align-items:center;justify-content:flex-end;background-color:var(--calcite-color-foreground-1)}.footer{flex:1}.pagination-text{padding-inline:var(--calcite-spacing-sm);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-sm)}.loader{align-self:center;padding-inline:var(--calcite-spacing-lg)}.pagination-action-bar{flex:1}.pagination-menu-button{padding-inline:var(--calcite-spacing-xxs);border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.icon{display:inline-block;flex:0 0 var(--calcite-spacing-lg);width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.action-image{flex:0 0 var(--calcite-spacing-lg);background-position:50% 50%;background-repeat:no-repeat;background-size:contain;width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.header{border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.content-feature{--calcite-flow-item-footer-padding: 0}.feature-menu-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.action-exit{transform:scaleX(-1)}.flow-item-drill-in{--calcite-flow-item-footer-padding: 0}`;function q(w){return w?.declaredClass.startsWith("esri.layers.")??!1}function J(w){if(!(!w||!("featureReduction"in w)))return w.featureReduction?.type}var Y=z(G),B=class extends N{constructor(){super(...arguments),this._zoomToFeature=new K({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}"}),this._fetchFeaturesController=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._rootFlowItemNode=f(),this._featureMenuViewportNode=f(),this._actionBarMenuNode=f(),this._flowContainerNode=f(),this._aggregatedFeaturesComponent=f(),this.messages=H(),this._selectedFeatureComponent=f(),this._cancelOpenRelatedFeature=()=>{this._openRelatedFeatureAbortController=k(this._openRelatedFeatureAbortController)},this._openRelatedFeatureAbortController=null,this.flowItems=new U,this._aggregatedFeatureCount=0,this._selectedAggregatedFeatureIndex=-1,this._aggregatedFeaturesLoading=!1,this._hasActionsStartSlotContent=!1,this._hasActionsEndSlotContent=!1,this.viewModel=Y(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.autoDestroyDisabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.effectiveHeading=this.viewModel.effectiveHeading,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=!1,this.featureNavigationTop=!1,this.features=this.viewModel.features,this.featuresPerPage=this.viewModel.featuresPerPage,this.featureItemAbilities=this.viewModel.featureItemAbilities,this.goToOverride=this.viewModel.goToOverride,this.headerActions=new U,this.heading=this.viewModel.heading,this.headingLevel=2,this.hideActionBar=!1,this.hideCloseButton=!1,this.hideFeatureMenuHeading=!1,this.hideFeatureNavigation=!1,this.hideFeatureListLayerTitle=!1,this.hideHeading=!1,this.hideSelectFeature=!1,this.hideSpinner=!1,this.hideContent=!1,this.chartAnimationDisabled=this.viewModel.featureItemAbilities?.chartAnimation,this.hideAttachmentsContent=this.viewModel.featureItemAbilities?.attachmentsContent,this.hideCustomContent=this.viewModel.featureItemAbilities?.customContent,this.hideExpressionContent=!1,this.hideFieldsContent=this.viewModel.featureItemAbilities?.fieldsContent,this.hideMediaContent=this.viewModel.featureItemAbilities?.mediaContent,this.hideRelationshipContent=this.viewModel.featureItemAbilities?.relationshipContent,this.hideTextContent=this.viewModel.featureItemAbilities?.textContent,this.hideUtilityNetworkContent=this.viewModel.featureItemAbilities?.utilityNetworkAssociationsContent,this.hideLastEditedInfo=!1,this.highlightDisabled=this.viewModel.highlightEnabled,this.includeDefaultActionsDisabled=this.viewModel.includeDefaultActions,this.initialDisplayMode=this.viewModel.initialDisplayMode,this.location=this.viewModel.location,this.map=this.viewModel.map,this.open=this.viewModel.open,this.promises=this.viewModel.promises,this.responsiveActionsEnabled=!1,this.selectedFeature=this.viewModel.selectedFeature,this.selectedFeatureIndex=this.viewModel.selectedFeatureIndex,this.showCollapseButton=!1,this.spatialReference=this.viewModel.spatialReference,this.state=this.viewModel.state,this.timeZone=this.viewModel.timeZone,this.updateLocationEnabled=this.viewModel.updateLocationEnabled,this.view=this.viewModel.view,this.arcgisPropertyChange=P()("active","collapsed","effectiveHeading","featureCount","featureMenuOpen","features","promises","selectedDrillInFeature","selectedFeature","selectedFeatureComponent","selectedFeatureIndex","state","open"),this.arcgisReady=C(),this.arcgisClose=C(),this.arcgisTriggerAction=C()}static{this.properties={_openRelatedFeatureAbortController:16,flowItems:16,_aggregatedFeatureCount:16,_selectedAggregatedFeatureIndex:16,_aggregatedFeaturesLoading:16,_hasActionsStartSlotContent:16,_hasActionsEndSlotContent:16,_hideActionText:16,_featureNavigationVisible:16,_isCollapsed:16,_collapseEnabled:16,_featureFlowItemSelected:16,viewModel:0,actions:0,active:0,autoDestroyDisabled:5,collapsed:5,content:1,defaultPopupTemplateEnabled:5,effectiveHeading:32,featureCount:9,featureMenuOpen:5,featureMenuTitle:1,featureNavigationTop:5,features:0,featuresPerPage:9,featureItemAbilities:0,goToOverride:0,headerActions:0,heading:1,headingLevel:9,hideActionBar:5,hideCloseButton:5,hideFeatureMenuHeading:5,hideFeatureNavigation:5,hideFeatureListLayerTitle:5,hideHeading:5,hideSelectFeature:5,hideSpinner:5,hideContent:5,chartAnimationDisabled:5,hideAttachmentsContent:5,hideCustomContent:5,hideExpressionContent:5,hideFieldsContent:5,hideMediaContent:5,hideRelationshipContent:5,hideTextContent:5,hideUtilityNetworkContent:5,hideLastEditedInfo:5,highlightDisabled:5,icon:1,includeDefaultActionsDisabled:5,initialDisplayMode:1,label:1,location:0,map:0,messageOverrides:0,open:5,referenceElement:1,promises:0,responsiveActionsEnabled:5,selectedDrillInFeature:32,selectedFeature:0,selectedFeatureComponent:32,selectedFeatureIndex:9,showCollapseButton:5,spatialReference:0,state:32,timeZone:1,updateLocationEnabled:5,view:0}}static{this.styles=X}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;let e=this.viewModel.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&!this.hideFeatureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.showCollapseButton&&(this.initialDisplayMode==="list"||!!(this.heading||this.viewModel.selectedFeatureItem?.heading)&&!!(this.content||this.viewModel.selectedFeatureItem?.content))}get _featureFlowItemSelected(){return this.initialDisplayMode==="list"?!!this.selectedFeature:!this.featureMenuOpen}clear(){this.viewModel.clear()}close(){this.open=!1}async destroy(){await this.manager.destroy(),await this._destroySpinner(this.referenceElement),this._cancelOpenRelatedFeature(),this._removeFlowItems(),this._unobserveFeatureMenuObserver(),this._cancelFetchingFeatures(),this._featureMenuIntersectionObserver?.disconnect()}async fetchFeatures(e,t){this._cancelFetchingFeatures();let{signal:a}=t??{},i=new AbortController,{signal:s}=i,n=a?AbortSignal.any([s,a]):s;if(this._fetchFeaturesController=i,!e&&this.view&&this.location&&(await W(this.location.spatialReference,this.view.spatialReference,null,{signal:n}),e=this.view.toScreen(this.location)??void 0),!e)return;let r=await this.viewModel.fetchFeatures(e,{...t,signal:n});this.location=r.location,this.promises=r.pendingFeatures}next(){this.viewModel.next()}previous(){this.viewModel.previous()}async setFocus(){await this._flowContainerNode.value?.setFocus()}async triggerAction(e){if(!e.disabled)return e?.type==="toggle"&&(e.value=!e.value),await Z(e,this.viewModel)}loaded(){this.manager.onLifecycle(()=>[d(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t)),d(()=>this.viewModel?.view?.scale,()=>this._viewScaleChange()),d(()=>this.viewModel?.view,(e,t)=>t&&this._viewChange()),d(()=>this._spinnerEl?.screenLocation,()=>this._closeOpenActionMenu()),d(()=>this.selectedFeatureComponent?.viewModel,()=>this._removeFlowItems()),d(()=>this.viewModel?.featureItems,()=>this._featureMenuViewportScrollTop()),d(()=>this.flowItems.length,()=>this._syncSelectedDrillInFeature()),d(()=>[this.flowItems?.length,this.featureMenuOpen],()=>{this.setFocus()}),d(()=>this.viewModel.aggregatedFeaturesEnabled,e=>{e||(this._aggregatedFeatureCount=0,this._selectedAggregatedFeatureIndex=-1,this._aggregatedFeaturesLoading=!1,this._removeFlowItems())}),d(()=>this.referenceElement,(e,t)=>{this._destroySpinner(t),this._createSpinner()},{initial:!0}),d(()=>[this.hideSpinner,this.viewModel?.view,this.viewModel?.location,this.viewModel?.waitingForResult],()=>{this._createSpinner()},{initial:!0})])}updated(){let e=this._selectedFeatureComponent.value??void 0;this.selectedFeatureComponent!==e&&T(()=>this.selectedFeatureComponent=e)}_cancelFetchingFeatures(){this._fetchFeaturesController=k(this._fetchFeaturesController)}_handleClose(){this.close(),this.arcgisClose.emit()}_groupResultsByLayer(){let{featureItems:e}=this.viewModel,t=new Map;return e.forEach(a=>{let i=a?.graphic;if(!i)return;let s=E(i),n=q(s)?s:null,r=t.get(n);r||(r=[],t.set(n,r)),r.push(a)}),t}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){this._cancelOpenRelatedFeature();let t=new AbortController;if(this._openRelatedFeatureAbortController=t,await e.updateGeometry(),t.signal.aborted)return;let a=e.graphic,i=a?.geometry;if(i==null||a==null){this._openRelatedFeatureAbortController=null;return}if(this._removeFlowItems(),await this.viewModel.zoomTo({target:i}),t.signal.aborted)return;let s=await $arcgis.t(m=>m[0],"geometry/operators/labelPointOperator");if(t.signal.aborted)return;let n=s.execute(i);n!=null&&(this.location=n),this.features=[a],this.open=!0,await this.setFocus(),this._openRelatedFeatureAbortController=null}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e}_previousFeature(){this.viewModel.previous()}_nextFeature(){this.viewModel.next()}_handleFeatureBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this._openFeatureMenu()}_handleFeatureMenuBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this.featureMenuOpen&&this._closeFeatureMenu()}_setActiveFeature(e){let{viewModel:t}=this;t.activeFeature=t.features?.[e]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){this.viewModel.selectedFeatureIndex=e,this.initialDisplayMode==="feature"?this._handleFeatureMenuBack():this.setFocus()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),e&&this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){let{messages:t,selectedFeature:a}=this,{id:i}=e,s=a?.attributes,n=e.title??"",r=i==="zoom-to-feature"?p(n,{messages:t}):i==="remove-selected-feature"?p(n,{messages:t}):i==="zoom-to-clustered-features"?p(n,{messages:t}):i==="browse-aggregated-features"?p(n,{messages:t}):e.title;return r&&s?p(r,s):r??""}_onMainKeydown(e){let{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous(),this.setFocus()),t==="ArrowRight"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next(),this.setFocus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode.value?.scrollContentTo({top:0})}_selectedFeatureIndexUpdated(e,t){let{featureCount:a,waitingForResult:i}=this.viewModel;i||!a||e===t||e===-1||(this._aggregatedFeatureCount=0,this._selectedAggregatedFeatureIndex=-1,this._removeFlowItems(),this._rootFlowItemNode.value?.scrollContentTo({top:0}))}_triggerAction(e){this.triggerAction(e),this.arcgisTriggerAction.emit({action:e})}_viewScaleChange(){let{selectedFeature:e}=this;!e?.isAggregate||J(E(e))!=="cluster"||(this.viewModel.aggregatedFeaturesEnabled=!1,this.open=!1,this.clear())}_viewChange(){this.viewModel.clear(),this.open=!1,this._aggregatedFeatureCount=0,this._removeFlowItems()}_handleAggregatedFeaturesPropertyChange({detail:e,target:t}){e.name==="aggregatedFeatureCount"&&(this._aggregatedFeatureCount=t.aggregatedFeatureCount),e.name==="selectedAggregatedFeatureIndex"&&(this._selectedAggregatedFeatureIndex=t.selectedAggregatedFeatureIndex,this._syncSelectedDrillInFeature()),e.name==="loading"&&(this._aggregatedFeaturesLoading=t.loading)}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e.value&&(e.value.menuOpen=!1)}_syncSelectedDrillInFeature(){let e=this.flowItems.getItemAt(this.flowItems.length-1);T(()=>this.selectedDrillInFeature=e?.graphic??void 0)}_removeFlowItems(){this.viewModel.aggregatedFeaturesEnabled=!1,this.flowItems?.destroyAll()}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":case"feature-utility-network-association-type":return e.description;case"feature-relationship":return e.allItemsDescription}}_handleDrillInBackClick(){this.flowItems?.pop()?.destroy()}_getHeading(){let{effectiveHeading:e}=this.viewModel;return!this.hideHeading&&e?e:""}_handleActionsStartSlotChange(e){this._hasActionsStartSlotContent=D(e)}_handleActionsEndSlotChange(e){this._hasActionsEndSlotContent=D(e)}async _destroySpinner(e){e?.manager?.component?.extraContent?.remove(this._spinnerEl)}async _createSpinner(){let e=this.referenceElement;e&&(await this._destroySpinner(e),this._spinnerEl=O(o`<arcgis-spinner auto-destroy-disabled .label=${this.messages.loading??""} .trackLocation=${!this.hideSpinner&&this.viewModel?.waitingForResult} .location=${this.viewModel?.location??void 0} .view=${this.viewModel?.view??void 0}></arcgis-spinner>`),e.manager?.component?.extraContent?.add(this._spinnerEl))}render(){return o`<div class="root" @keydown=${this._onMainKeydown}>${this._renderHeader()}${this._renderContentContainer()}</div>`}_renderFeatureNavigation(){return[this._renderPagination(()=>this._previousFeature(),()=>this._nextFeature()),this.initialDisplayMode==="list"?this._renderFeaturePaginationText(this.viewModel.featureCount,this.viewModel.selectedFeatureIndex):this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?o`<div class="header">${this._renderFeatureNavigation()}</div>`:null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?o`<div class="footer" slot=footer>${this._renderFeatureNavigation()}</div>`:null}_renderFeaturePaginationText(e,t){let{messages:a}=this;return o`<div class="pagination-text">${p(a.pageText??"",{index:x(t+1),total:x(e)})}</div>`}_renderFeatureMenuButton(){let{messages:e,viewModel:t}=this,{featureCount:a,selectedFeatureIndex:i,pendingPromisesCount:s}=t;return o`<calcite-action class="pagination-menu-button" icon=list .label=${e.selectFeature} .loading=${s>0} @click=${this._handlePaginationMenuButton} .text=${p(e.pageText??"",{index:x(i+1),total:x(a)})} text-enabled title=${e.selectFeature??g}></calcite-action>`}_renderPagination(e,t){let{previous:a,next:i}=this.messages;return o`<calcite-action-bar class="pagination-action-bar" expand-disabled layout=horizontal overflow-actions-disabled scale=s><calcite-action-group scale=s><calcite-action class="pagination-previous" icon=chevron-left icon-flip-rtl .label=${a??""} @click=${e} .text=${a??""} title=${a??""??g}></calcite-action><calcite-action icon=chevron-right icon-flip-rtl .label=${i??""} @click=${t} .text=${i??""} title=${i??""??g}></calcite-action></calcite-action-group></calcite-action-bar>`}_renderFeatureMenuItem(e,t){let{initialDisplayMode:a}=this,{selectedFeatureItem:i}=this.viewModel,s=e===i;return o`<calcite-list-item @blur=${this._removeActiveFeature} @focus=${()=>this._setActiveFeature(t)} @mouseleave=${this._removeActiveFeature} @mouseover=${()=>this._setActiveFeature(t)} .selected=${s} @calciteListItemSelect=${()=>this._selectFeature(t)}><span .innerHTML=${(M.sanitize(e.heading)||this.messages.untitled)??""} slot=content></span>${a==="list"?o`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`:null}</calcite-list-item>`}_renderFeatureMenu(){let{messages:e,viewModel:t}=this,a=this._groupResultsByLayer(),i=new Map;t.featureItems.forEach((n,r)=>i.set(n,r));let s=this.initialDisplayMode==="list"?"none":"single";return t.featureItems.length?o`<calcite-list display-mode=flat .label=${e?.featuresList??""} selection-appearance=icon .selectionMode=${s}>${Array.from(a.keys(),n=>{let r=a.get(n)?.map(l=>{let h=i.get(l);return h==null?null:this._renderFeatureMenuItem(l,h)}),c=n?n.title??this.messages.untitled:null;return!this.hideFeatureListLayerTitle&&c!==null?I(n??"map-graphics",o`<calcite-list-item-group .heading=${c}>${r}</calcite-list-item-group>`):r})}</calcite-list>`:null}_renderHeaderAction(e){let t=e.title||"";return e.visible?o`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .indicator=${e.active} .loading=${e.active} @click=${()=>this._triggerAction(e)} slot=header-actions-end .text=${t} title=${t??g}></calcite-action>`:null}_renderHeaderActions(){return this.headerActions.map(e=>this._renderHeaderAction(e)).toArray()}_renderContentFeature(e){let{headingLevel:t,hideCloseButton:a,_isCollapsed:i,_collapseEnabled:s,featureNavigationTop:n,initialDisplayMode:r,selectedFeature:c,hideHeading:l}=this,{active:h,selectedFeatureItem:m,content:_}=this.viewModel,u=this._getHeading();if(r==="list"&&!c)return null;let F=m?!m.content:!_;return o`<calcite-flow-item class=${b(A({"content-feature":!0,"flow-item-collapsed":i}))} .closable=${!a} .closed=${!h} .collapsed=${i} .collapseDirection=${n?"down":"up"} .collapsible=${s} .headingLevel=${t} .selected=${e} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} @calciteFlowItemBack=${this._handleFeatureBack} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} .heading=${!l&&u?S(u):void 0} ${v(this._rootFlowItemNode)}>${!l&&u?o`<div slot=heading><div .innerHTML=${M.sanitize(u??"")??""}></div></div>`:null}${this._renderHeaderActions()}${this._renderActionBar()}<div class=${b(A("container","content-container",{"content-hidden":F}))}>${this._renderContent()}</div>${this._renderFooter()}</calcite-flow-item>`}_renderFeatureMenuContainer(){let{viewModel:e,hideCloseButton:t,featureMenuTitle:a,messages:i,initialDisplayMode:s,featureMenuOpen:n,_featureFlowItemSelected:r,_collapseEnabled:c,_isCollapsed:l,featureNavigationTop:h,headingLevel:m}=this,{active:_,featureItems:u,pendingPromisesCount:F}=e,y=a??i.selectFeature;if(s==="feature"&&!n)return null;let $=!r;return o`<calcite-flow-item class=${b(A({"flow-item-collapsed":l}))} .closable=${s==="list"&&!t} .closed=${!_} .collapsed=${s==="list"&&l} .collapseDirection=${h?"down":"up"} .collapsible=${s==="list"&&c} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .description=${this.hideFeatureMenuHeading?void 0:p(i.total??"",{total:u.length})} .heading=${this.hideFeatureMenuHeading?void 0:y} .headingLevel=${m} .loading=${e.waitingForContents} .selected=${$} @calciteFlowItemBack=${j=>{j.preventDefault(),this._handleFeatureMenuBack()}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} ${v(this._featureMenuViewportNode)}>${s==="list"?this._renderHeaderActions():null}${F>0?o`<calcite-loader class="loader" inline .label=${i.loading??""} slot=header-actions-end></calcite-loader>`:null}<div class="container">${$?this._renderFeatureMenu():null}</div><div class="feature-menu-observer" ${v(this._featureMenuIntersectionObserverCreated)}></div>${s==="feature"?o`<calcite-button scale=s appearance=transparent @click=${this._handleFeatureMenuBack} slot=footer-start width=full>${i.back}</calcite-button>`:null}</calcite-flow-item>`}_renderFlowItem(e,t){let{messages:a,hideCloseButton:i,hideSelectFeature:s,active:n,hideHeading:r}=this,c="graphic"in e&&"isFeatureFromTable"in e&&!e.isFeatureFromTable,l=c&&!s,h=e.flowType==="feature-association",m=a.returnToInitialFeature??"",_=a?.selectFeature,u=this._getActionTitle(this._zoomToFeature),F=!this.hideActionBar&&h&&c,y=e.flowType==="feature"&&this.viewModel.aggregatedFeaturesEnabled?o`<div class="footer" slot=footer>${this._renderPagination(()=>{this._aggregatedFeaturesComponent.value?.previous()},()=>{this._aggregatedFeaturesComponent.value?.next()})}${this._renderFeaturePaginationText(this._aggregatedFeatureCount,this._selectedAggregatedFeatureIndex)}</div>`:null;return o`<calcite-flow-item .closable=${!i} .closed=${!n} class="flow-item-drill-in" .description=${S(this._getDrillInFlowItemDescription(e)??"")} .heading=${r?void 0:S(e.heading??"")} .selected=${t} @calciteFlowItemBack=${$=>{$.preventDefault(),this._handleDrillInBackClick()}} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose}>${r?null:o`<div slot=heading><div .innerHTML=${M.sanitize(e.heading??"")??""}></div></div>`}<div slot=description><div .innerHTML=${M.sanitize(this._getDrillInFlowItemDescription(e)??"")??""}></div></div><calcite-action class="action-exit" icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${m??""} title=${m??""??g}></calcite-action>${l?o`<calcite-action icon=zoom-to-object @click=${()=>this._openRelatedFeature(e)} slot=header-actions-end .text=${_??""} title=${_??g}></calcite-action>`:null}${F?o`<calcite-action-bar expand-disabled expanded scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s><calcite-action .disabled=${this._zoomToFeature.disabled} .icon=${this._zoomToFeature.icon??void 0} .loading=${this._zoomToFeature.active} scale=s text-enabled .text=${u} title=${u??g} @click=${()=>V(this.viewModel,this._zoomToFeature,e)}></calcite-action></calcite-action-group></calcite-action-bar>`:null}<div class="container">${e}</div>${y}</calcite-flow-item>`}_renderContentContainer(){let e=this.flowItems?.toArray(),t=e.length>0,a=this.viewModel.aggregatedFeaturesEnabled&&this.viewModel.selectedFeature?.isAggregate&&!t,i=a&&e.length===0,s=e.length===0&&this._featureFlowItemSelected&&!a,n=e?.map((l,h)=>this._renderFlowItem(l,this._featureFlowItemSelected&&h===e.length-1)),r=this._renderBrowseAggregateContainer(!!i),c=this.initialDisplayMode==="list"?[this._renderFeatureMenuContainer(),this._renderContentFeature(s)]:[this._renderContentFeature(s),this._renderFeatureMenuContainer()];return o`<calcite-flow ${v(this._flowContainerNode)}>${c}${r}${n}</calcite-flow>`}_renderBrowseAggregateContainer(e){let{hideCloseButton:t,active:a,messages:i}=this,{selectedFeature:s}=this.viewModel;return this.viewModel.aggregatedFeaturesEnabled&&s?.isAggregate?o`<calcite-flow-item .selected=${e} .closable=${!t} .closed=${!a} .description=${this._aggregatedFeatureCount?p(i.total??"",{total:this._aggregatedFeatureCount}):""} .heading=${i.aggregatedFeatures} @calciteFlowItemBack=${n=>{n.preventDefault(),this.viewModel.aggregatedFeaturesEnabled=!1}} .loading=${this._aggregatedFeaturesLoading} @calciteFlowItemClose=${this._handleClose}><arcgis-aggregated-features .autoDestroyDisabled=${this.autoDestroyDisabled} .feature=${s??void 0} .flowItems=${this.flowItems} .map=${this.map??void 0} .messages=${i} @arcgisPropertyChange=${this._handleAggregatedFeaturesPropertyChange} .spatialReference=${this.spatialReference??void 0} .timeZone=${this.timeZone??void 0} .view=${this.view??void 0} ${v(this._aggregatedFeaturesComponent)}></arcgis-aggregated-features><calcite-button appearance=transparent @click=${()=>this.viewModel.aggregatedFeaturesEnabled=!1} slot=footer-start scale=s width=full>${i.back}</calcite-button></calcite-flow-item>`:null}_renderActionBar(){let e=this.viewModel.selectedFeatureItem?.isFeatureFromTable,t=this.viewModel.allActions.toArray(),a=e&&!this.location?t.filter(s=>s.id!==this._zoomToFeature.id):t,i=!!a.length||this._hasActionsStartSlotContent||this._hasActionsEndSlotContent;return!this._isCollapsed&&!this.hideActionBar&&i?o`<calcite-action-bar expand-disabled .expanded=${!this._hideActionText} scale=s slot=action-bar><slot name=actions-start @slotchange=${this._handleActionsStartSlotChange}></slot><calcite-action-group overlay-positioning=fixed scale=s ${v(this._actionBarMenuNode)}>${this._renderActions(a)}</calcite-action-group><slot name=actions-end @slotchange=${this._handleActionsEndSlotChange}></slot></calcite-action-bar>`:null}_renderActions(e){return e.map(t=>{let a=this._getActionTitle(t);return o`<calcite-action .active=${t.type==="toggle"?t.value:!1} .disabled=${t.disabled} .icon=${t.icon??void 0} .loading=${t.active} scale=s .textEnabled=${!this._hideActionText} .text=${a??""} title=${a??g} .hidden=${!t.visible} @click=${()=>this._triggerAction(t)}></calcite-action>`})}_renderContent(){let{content:e,selectedFeatureItem:t}=this.viewModel;return t?I(t,o`<arcgis-feature-next .autoDestroyDisabled=${this.autoDestroyDisabled} .chartAnimationDisabled=${this.chartAnimationDisabled} .defaultPopupTemplateEnabled=${this.defaultPopupTemplateEnabled} .flowItems=${this.flowItems} .graphic=${t.graphic} .headingLevel=${this.headingLevel+1} .hideAttachmentsContent=${this.hideAttachmentsContent} .hideContent=${this.hideContent} .hideCustomContent=${this.hideCustomContent} .hideExpressionContent=${this.hideExpressionContent} .hideFieldsContent=${this.hideFieldsContent} hide-heading .hideLastEditedInfo=${this.hideLastEditedInfo} .hideMediaContent=${this.hideMediaContent} .hideTextContent=${this.hideTextContent} .location=${this.location} .map=${this.map} .referenceElement=${this.referenceElement} .showRelationshipContent=${!this.hideRelationshipContent} .showUtilityNetworkContent=${!this.hideUtilityNetworkContent} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} ${v(this._selectedFeatureComponent)}></arcgis-feature-next>`):typeof e=="string"?I(e,o`<div .innerHTML=${M.sanitize(e)??""}></div>`):e??null}};R("arcgis-features-next",B);return B},"support/actions/ActionButton","core/Collection","popup/Features","applications/Components/featureUtils","applications/Components/sanitizerUtils","applications/Components/stringUtils","intl","core/reactiveUtils",a,c,d,e,h,i,j,l)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{a as g}from"./HMWOHSHV.js";import f from"./ZDOE5UWP.js";import"./PC4PAQXQ.js";import e from"./ZOPB777S.js";import{a as v}from"./TNDRCMN3.js";import c from"./V2RXBLNO.js";import b from"./OCLLMQGL.js";import"./CIFVM6AU.js";import"./EPO62377.js";import a from"./FKLH5Y2K.js";import"./TGNR3DAP.js";import{N as h,O as m,U as y,a as d,b as r,p,x as n}from"./MTKZBIHD.js";import"./3TTFCHAA.js";export default $arcgis.t(([f,,{when:T},R,,,,w,{a:b}])=>{var $=d`:host{--arcgis-internal-color-black-30: color-mix(in srgb, #000000 30.2%, transparent);--arcgis-internal-box-shadow: var(--calcite-spacing-none) var(--calcite-spacing-px) var(--calcite-spacing-base) var(--arcgis-internal-color-black-30);--arcgis-internal-top-max-width: calc(min(100cqw, 100vw) - var(--calcite-spacing-xxxl));--arcgis-internal-panel-width: 300px;--arcgis-internal-panel-height: 100%;--arcgis-internal-panel-height-sm: 240px;--arcgis-internal-panel-height-md: 420px;--arcgis-internal-panel-height-lg: 540px;--arcgis-internal-panel-height-xl: 680px;--arcgis-internal-panel-gap: var(--calcite-spacing-lg);--arcgis-internal-panel-actions-gap: var(--calcite-spacing-sm);--arcgis-internal-basemap-gallery-width-lg: 450px;--arcgis-internal-collapse-icon-flip: scaleX(1);--arcgis-internal-row-direction: row;--arcgis-internal-legend-width: 300px;--arcgis-internal-layout-overlay-space-top: var(--arcgis-layout-overlay-space-top, 0px);--arcgis-internal-layout-overlay-space-bottom: var(--arcgis-layout-overlay-space-bottom, 0px);--arcgis-internal-layout-overlay-space-left: var(--arcgis-layout-overlay-space-left, 0px);--arcgis-internal-layout-overlay-space-right: var(--arcgis-layout-overlay-space-right, 0px);--arcgis-internal-view-color-focus: var(--arcgis-view-color-focus, var(--calcite-color-brand));--arcgis-internal-attribution-space-bottom: var(--arcgis-internal-layout-overlay-space-bottom);--arcgis-internal-attribution-space-left: var(--arcgis-internal-layout-overlay-space-left);--arcgis-internal-attribution-space-right: var(--arcgis-internal-layout-overlay-space-right);--arcgis-internal-attribution-font-size: var(--calcite-font-size-sm);--arcgis-internal-attribution-font-size-sm: var(--calcite-font-size-xs);--arcgis-internal-sketch-justify-content: flex-start}:host{display:flex;flex-direction:column;height:var(--arcgis-internal-panel-height, 100%)}.inputs-tab-container{display:flex;flex-direction:column;height:100%}.trace-inputs-warning{flex:none;height:fit-content;--calcite-panel-background-color: var(--calcite-color-foreground-1);calcite-notice{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) 0 var(--calcite-spacing-md)}}arcgis-utility-network-trace-inputs[mode=default]{height:auto}calcite-tabs{display:flex;flex-direction:column;height:100%}calcite-tab{--calcite-tab-content-space-y: 0;min-height:var(--arcgis-internal-panel-height-sm, 240px)}calcite-tab:not([selected]){flex:0}calcite-panel{--calcite-panel-background-color: var(--calcite-color-foreground-1)}calcite-notice{margin:var(--calcite-spacing-md)}`,C=w(R),u=class extends m{constructor(){super(...arguments),this._messages=v({blocking:!0}),this._viewModel=C(this),this._highlightHandles=[],this._handleRunTraceButtonClick=()=>{this._setTraceWarnings(),!(this.showNoStartingPointsWarning||this.showMissingTerminalWarning)&&(this.showNoStartingPointsWarning=!1,this.showMissingTerminalWarning=!1,this._clearTraceResult(),this._switchTab("results"),this._runTrace())},this._handleTraceInputsRefChange=e=>{e&&(this._traceInputsElement=e)},this._handleTraceResultsRefChange=e=>{e&&(this._traceResultsElement=e)},this.activeTab="input",this.showMissingTerminalWarning=!1,this.showNoStartingPointsWarning=!1,this.mode="default",this.autoDestroyDisabled=!1,this.aggregatedGeometryGraphicsColor=new f([255,255,0,.6]),this.disableHighlightFeatureResults=!1,this.hideActionBar=!1,this.hideFeatureResults=!1,this.state=this._viewModel.state,this.view=this._viewModel.view,this.arcgisHideGraphicsChange=n(),this.arcgisReady=n(),this.arcgisTraceLocationSelectEnd=n(),this.arcgisTraceLocationSelectStart=n(),this.arcgisTraceResultClear=n(),this.arcgisTraceResultFeaturesReady=n()}static{this.properties={activeTab:16,traceError:16,traceResult:16,showMissingTerminalWarning:16,showNoStartingPointsWarning:16,mode:16,autoDestroyDisabled:5,beforeTraceLocationSelectStart:0,aggregatedGeometryGraphicsColor:0,disableHighlightFeatureResults:5,hideActionBar:5,hideFeatureResults:5,label:3,messageOverrides:0,traceResultFeatures:32,referenceElement:1,state:32,view:0}}static{this.styles=$}get _allLayers(){let{view:e}=this;return e?.map?e.map.allLayers.toArray().concat(e.map.allTables.toArray()):[]}get traceResultFeatures(){return this._traceResultsElement?.traceResultFeatures??[]}async destroy(){this._clearHighlights(),this._traceResultsElement?.destroy(),this._traceInputsElement?.destroy(),await this.manager.destroy()}load(){this.manager.onLifecycle(()=>[T(()=>!this._viewModel.utilityNetwork,()=>this._switchTab("input"))])}_clearTraceResult(){this.traceResult=void 0,this._clearHighlights(),this._clearAggregatedGeometryGraphics()}_setTraceWarnings(){if(!this._traceInputsElement)return;let{traceLocations:e,traceLocationFlagInfos:t,unTraceConfiguration:a,isSubnetworkNameTraceSelected:i}=this._traceInputsElement,l=!!a?.subnetworkName,c=e?.some(s=>s.type==="starting-point"),o=t?.some(s=>!!s.flagProperties.terminalConfiguration&&!s.flagProperties.selectedTerminals?.size)??!1;this.traceError=void 0,this.showNoStartingPointsWarning=!i&&!c||i&&!l,this.showMissingTerminalWarning=o}_switchTab(e){this.activeTab=e}_getLoadError(e){let{_messages:t}=this;switch(e){case"no-user-type-extension":return t.errors.loadErrors.noUserTypeExtension;case"no-utility-network":return t.errors.loadErrors.noUtilityNetwork;case"no-view":return t.errors.loadErrors.noView;case"sceneView-not-supported":return t.errors.loadErrors.sceneViewNotSupported;default:return e}}_clearHighlights(){this._highlightHandles.forEach(e=>e.remove()),this._highlightHandles=[]}_clearAggregatedGeometryGraphics(){this._traceResultsElement?.clearAggregatedGeometryGraphics()}_highlightResults(){let{traceResult:e,view:t}=this,a=this._viewModel.utilityNetwork;!a||!e?.elements||!t||a.getObjectIdsFromElements(e.elements).forEach(i=>{let l=t.allLayerViews.find(o=>{let s=o.layer;if(a.isUtilityLayer(s)){let _=Number(i.layerUrl.split("/").pop());return s.layerId===_}return!1});if(!l)return;let c=l.highlight(i.objectIds);this._highlightHandles.push(c)})}async _runTrace(){let e=this._traceInputsElement?.selectedNamedTraceConfiguration,t=this._traceInputsElement?.unTraceConfiguration;if(!(e?.traceType&&t)){p("error",this,"Trace configuration not found");return}let a=this._traceInputsElement?.traceLocations;try{this.traceResult=await this._viewModel.executeTraceConfiguration({traceType:e.traceType,traceConfiguration:t,traceLocations:a??[],resultTypes:e.resultTypes,outSpatialReference:this.view?.spatialReference}),this.disableHighlightFeatureResults||this._highlightResults()}catch(i){b(i,this,"Error while running trace"),this.traceError=i,this.traceResult=void 0}}_handleHideGraphicsChange(e){e.stopPropagation(),this.arcgisHideGraphicsChange.emit(e.detail)}_handleTraceLocationSelectStart(e){e.stopPropagation(),this.arcgisTraceLocationSelectStart.emit(e.detail).defaultPrevented&&e.preventDefault()}_handleTraceLocationSelectEnd(e){e.stopPropagation(),this.arcgisTraceLocationSelectEnd.emit()}_handleTraceResultFeaturesReady(e){e.stopPropagation(),this.arcgisTraceResultFeaturesReady.emit()}_handleAggregatedGeometryGraphicsColorChange(e){let t=e.detail;this.aggregatedGeometryGraphicsColor=new f(t)}_handleSelectedNamedTraceConfigurationChange(){this.showNoStartingPointsWarning=!1,this.showMissingTerminalWarning=!1}_handleUtilityNetworkChange(){this._viewModel.utilityNetwork=this._traceInputsElement?.selectedUtilityNetwork}renderMissingTerminalWarning(){return r`<calcite-panel class="trace-inputs-warning"><calcite-notice open icon=exclamation-mark-triangle closable kind=danger scale=s @calciteNoticeClose=${()=>this.showMissingTerminalWarning=!1}><div slot=title>${this._messages.errors.missingTerminalTitle}</div><div slot=message>${this._messages.errors.missingTerminalBody}</div></calcite-notice></calcite-panel>`}renderNoStartingPointsWarning(){return r`<calcite-panel class="trace-inputs-warning"><calcite-notice open icon=exclamation-mark-triangle closable kind=danger scale=s @calciteNoticeClose=${()=>this.showNoStartingPointsWarning=!1}><div slot=title>${this._messages.errors.noStartingPointsTitle}</div><div slot=message>${this._messages.errors.noStartingPointsBody}</div></calcite-notice></calcite-panel>`}renderResultsTab(){return g(`${this.el.id}__results-tab-item`,r`<calcite-tab .selected=${this.activeTab==="results"}>${this.state==="executing"?r`<calcite-panel><calcite-loader .label=${this._messages.runningTrace} .text=${this._messages.runningTrace}></calcite-loader></calcite-panel>`:r`<arcgis-utility-network-trace-results .autoDestroyDisabled=${this.autoDestroyDisabled} .aggregatedGeometryGraphicsColor=${this.aggregatedGeometryGraphicsColor} .hideActionBar=${this.hideActionBar} .hideFeatureResults=${this.hideFeatureResults} .layers=${this._allLayers} .messageOverrides=${{resultFeaturesAreHidden:this.messageOverrides?.resultFeaturesAreHidden}} .referenceElement=${this.referenceElement} .traceConfigTitle=${this._selectedTraceConfig?.title} .traceError=${this.traceError} .traceResult=${this.traceResult} .utilityNetwork=${this._viewModel.utilityNetwork??void 0} .view=${this.view??void 0} @arcgisAggregatedGeometryGraphicsColorChange=${this._handleAggregatedGeometryGraphicsColorChange} @arcgisHideGraphicsChange=${this._handleHideGraphicsChange} @arcgisTraceResultFeaturesReady=${this._handleTraceResultFeaturesReady} ${h(this._handleTraceResultsRefChange)}></arcgis-utility-network-trace-results>`}</calcite-tab>`)}renderResultsFooter(){let{traceResult:e}=this,t=!!(e?.elements.length||e?.globalFunctionResults.length||e?.aggregatedGeometry)&&this._traceResultsElement?.state==="ready",a=this._traceResultsElement?.numResults??0;return r`<calcite-button appearance=outline width=full @click=${()=>{this._switchTab("input"),this._clearTraceResult(),this.arcgisTraceResultClear.emit()}} .disabled=${!t} slot=footer>${a>0&&!this.hideFeatureResults&&this.state!=="executing"?this._messages.buttons.clearResultsCustom.replace("{number}",a.toString()):this._messages.buttons.clearResultsGeneric}</calcite-button>`}renderInputTab(){let{mode:e}=this,{loadError:t}=this._viewModel,a=(t==="no-user-type-extension"||t==="sceneView-not-supported"?r`<calcite-notice kind=danger open scale=s slot=content-top width=auto><div slot=message>${this._getLoadError(t)}</div></calcite-notice>`:void 0)??r`${this.showNoStartingPointsWarning&&e==="default"&&this.renderNoStartingPointsWarning()||""}${this.showMissingTerminalWarning&&e==="default"&&this.renderMissingTerminalWarning()||""}<arcgis-utility-network-trace-inputs .autoDestroyDisabled=${this.autoDestroyDisabled} .hideActionBar=${this.hideActionBar} .referenceElement=${this.referenceElement} .view=${this.view??void 0} .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisPropertyChange=${i=>{i.stopPropagation(),i.detail.name==="mode"&&(this.mode=i.target.mode)}} @arcgisSelectedNamedTraceConfigurationChange=${this._handleSelectedNamedTraceConfigurationChange} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisUtilityNetworkChange=${this._handleUtilityNetworkChange} ${h(this._handleTraceInputsRefChange)}></arcgis-utility-network-trace-inputs>`;return g(`${this.el.id}__inputs-tab-item`,r`<calcite-tab .selected=${this.activeTab==="input"}><div class="inputs-tab-container">${a}</div></calcite-tab>`)}renderInputFooter(){let{mode:e,state:t}=this;if(e!=="default")return null;let a=t==="disabled"||t==="loading"||!this._traceInputsElement?.unTraceConfiguration;return r`<calcite-button appearance=solid width=full @click=${this._handleRunTraceButtonClick} slot=footer .disabled=${a}>${this._messages.buttons.getResults}</calcite-button>`}render(){let{activeTab:e,state:t}=this;return r`<calcite-panel><calcite-tabs layout=center position=top><calcite-tab-nav slot=title-group><calcite-tab-title @click=${()=>this._switchTab("input")} .selected=${e==="input"}>${this._messages.tabs.inputTab}</calcite-tab-title><calcite-tab-title @click=${()=>this._switchTab("results")} .selected=${e==="results"} .disabled=${t==="disabled"||t==="loading"}>${this._messages.tabs.resultsTab}</calcite-tab-title></calcite-tab-nav>${this.renderInputTab()}${t==="ready"||t==="executing"?this.renderResultsTab():null}</calcite-tabs>${e==="input"?this.renderInputFooter():null}${e==="results"?this.renderResultsFooter():null}</calcite-panel>`}};y("arcgis-utility-network-trace-analysis",u);return u},"Color","core/Error","core/reactiveUtils","networks/UtilityNetworkTraceAnalysis",a,b,c,e,f)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import b from"./R3NYK6BO.js";import a from"./ZDOE5UWP.js";import"./PC4PAQXQ.js";import{a as N}from"./TNDRCMN3.js";import{h as T}from"./CIFVM6AU.js";import"./EPO62377.js";import"./TGNR3DAP.js";import{N as h,O as k,U as S,a as f,b as r,p as d,r as y,s as _,x as l}from"./MTKZBIHD.js";import"./3TTFCHAA.js";export default $arcgis.t(([c,{watch:E},{substitute:I},U,F,x,v,A,{a:p},{a:C,b:g,d:m,e:L,f:$}])=>{var D=f`:host{height:100%;flex-grow:1}calcite-flow{min-height:var(--arcgis-internal-panel-height-sm, 240px)}calcite-block-group{flex-grow:1;padding-bottom:var(--calcite-spacing-md);background-color:var(--calcite-color-foreground-1)}calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}calcite-block calcite-combobox,calcite-block calcite-input{margin:0 var(--calcite-spacing-md)}calcite-block calcite-input-message{padding:var(--calcite-spacing-sm) var(--calcite-spacing-md) 0 var(--calcite-spacing-md)}calcite-notice{margin:var(--calcite-spacing-md)}#subnetwork-info-block{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) 0 var(--calcite-spacing-md)}#results-limited-message{padding:var(--calcite-spacing-sm)}.inline-loader{--calcite-loader-spacing: var(--calcite-spacing-md)}.add-spatial-mode{display:flex;flex-direction:column;gap:var(--calcite-spacing-md);margin:var(--calcite-spacing-md)}.heading{color:var(--calcite-color-text-1);margin:0 0 var(--calcite-spacing-md) 0;font-size:var(--calcite-font-size);font-style:normal;font-weight:var(--calcite-font-weight-medium)}`,b=`utility-network-trace-inputs-sketch-${Date.now()}`,M=20,w=class extends k{constructor(){super(...arguments),this._defaultPopupTemplateEnabled=!0,this._messages=N({blocking:!0}),this._layerIdToLayer=new Map,this._startingPoints=new c,this._barriers=new c,this._stoppingPoints=new c,this._subnetworkTraceTypes=new Set(["subnetwork","subnetwork-controller","upstream","downstream","isolation"]),this._setUpMap=()=>{if(this._error=void 0,!this.view?.map){this._error=this._messages.errors.noView,this.utilityNetworks=void 0;return}let e=this.view.map;this._setupUtilityNetworks(e),this._setupSketchViewModel(e)},this._hitTestPromise=null,this._displayLimit=20,this._traceLocationStartingRefChange=e=>{e&&(this._traceLocationStartingElement=e)},this._traceLocationBarrierRefChange=e=>{e&&(this._traceLocationBarrierElement=e)},this._traceLocationStoppingRefChange=e=>{e&&(this._traceLocationStoppingElement=e)},this._featuresComponentRefChange=e=>{e&&(this._featuresComponentElement=e)},this._handleFeaturesPropertyChange=({detail:e,target:t})=>{(e.name==="selectedDrillInFeature"||e.name==="selectedFeature")&&(this.selectedFeature=t.selectedDrillInFeature??t.selectedFeature??void 0)},this.candidateFeatures=[],this.compatibleSubnetworkNames=[],this.traceConfigurations=[],this._subnetworkNamesState="ready",this._exceedDisplayLimit=!1,this.autoDestroyDisabled=!1,this.hideActionBar=!1,this.mode="default",this.arcgisPropertyChange=T()("mode"),this.arcgisSelectedNamedTraceConfigurationChange=l(),this.arcgisTraceInputsChange=l(),this.arcgisTraceLocationSelectEnd=l(),this.arcgisTraceLocationSelectStart=l(),this.arcgisUtilityNetworkChange=l()}static{this.properties={selectedFeature:16,candidateFeatures:16,compatibleSubnetworkNames:16,subnetworksTable:16,traceConfigurations:16,utilityNetworks:16,_unTraceConfiguration:16,_error:16,_subnetworkNamesState:16,_activeTraceLocationType:16,_exceedDisplayLimit:16,beforeTraceLocationSelectStart:0,view:0,selectedUtilityNetwork:0,selectedNamedTraceConfiguration:0,autoDestroyDisabled:5,hideActionBar:5,unTraceConfiguration:32,isSubnetworkNameTraceSelected:32,referenceElement:1,mode:3,traceLocationFlagInfos:32,traceLocations:32}}static{this.styles=D}get selectedSubnetworkName(){return this._unTraceConfiguration?.subnetworkName??void 0}set selectedSubnetworkName(e){this._unTraceConfiguration&&(this._unTraceConfiguration.subnetworkName=e)}get _allLayers(){let{view:e}=this;return e?.map?e.map.allLayers.toArray().concat(e.map.allTables.toArray()):[]}get showStartingPoints(){return!this.isSubnetworkNameTraceSelected}get showStoppingPoints(){let e=this.selectedNamedTraceConfiguration?.traceType;return e==="path"||e==="circuit"}get _subnetworkLayerIds(){let e=this.selectedUtilityNetwork?.dataElement?.domainNetworks;return e?e.map(t=>t.subnetworkLayerId).filter(t=>t!=null&&t>-1):[]}get unTraceConfiguration(){return this._unTraceConfiguration}get isSubnetworkNameTraceSelected(){let{selectedNamedTraceConfiguration:e}=this;return!!e?.traceConfiguration?.subnetworkName&&e?.traceType==="subnetwork"}get traceLocationFlagInfos(){return new c([...this._startingPoints,...this._barriers,...this._stoppingPoints])}get traceLocations(){let e=[];return this.showStartingPoints&&this._startingPoints.forEach(t=>e.push(...this._createTraceLocations(t))),this.showStoppingPoints&&this._stoppingPoints.forEach(t=>e.push(...this._createTraceLocations(t))),this._barriers.forEach(t=>e.push(...this._createTraceLocations(t))),e}async destroy(){this._removeGraphicLayer(b),this._clearTraceLocations(),this._sketchViewModel?.cancel(),this._featuresComponentElement?.destroy(),this._traceLocationStartingElement?.destroy(),this._traceLocationBarrierElement?.destroy(),this._traceLocationStoppingElement?.destroy(),await this.manager.destroy()}load(){this._setUpMap(),this.manager.onLifecycle(()=>[E(()=>this.view?.map,()=>this._setUpMap())])}willUpdate(e){e.has("utilityNetworks")&&this._handleUtilityNetworksChange(),e.has("selectedUtilityNetwork")&&(this.arcgisUtilityNetworkChange.emit(),this._handleSelectedUtilityNetworkChange()),e.has("selectedNamedTraceConfiguration")&&(this.arcgisTraceInputsChange.emit(),this.arcgisSelectedNamedTraceConfigurationChange.emit(),this._handleTraceConfigChange()),e.has("selectedSubnetworkName")&&this.arcgisTraceInputsChange.emit()}disconnectedCallback(){super.disconnectedCallback(),this._layerIdToLayer.clear()}_createTraceLocations(e){let t=e.flagProperties.selectedTerminals;return e.flagProperties.terminalConfiguration&&t?.size?Array.from(t,i=>new x({type:e.traceLocation.type,isFilterBarrier:e.traceLocation.isFilterBarrier,globalId:e.traceLocation.globalId,percentAlong:e.traceLocation.percentAlong,terminalId:i})):[e.traceLocation]}_clearTraceLocations(){this._startingPoints.forEach(e=>{e.spatialProperties.flagGraphic&&this.view?.graphics.remove(e.spatialProperties.flagGraphic)}),this._startingPoints.removeAll(),this._barriers.forEach(e=>{e.spatialProperties.flagGraphic&&this.view?.graphics.remove(e.spatialProperties.flagGraphic)}),this._barriers.removeAll(),this._stoppingPoints.forEach(e=>{e.spatialProperties.flagGraphic&&this.view?.graphics.remove(e.spatialProperties.flagGraphic)}),this._stoppingPoints.removeAll()}_createGraphicLayer(e,t){if(!e.findLayerById(t)){let i=new U({id:t,listMode:"hide",title:t});C(this.view,i)}}_getGraphicLayer(e,t){let i=e.findLayerById(t);return m(i)?(e.reorder(i,e.layers.length-1),i):null}_removeGraphicLayer(e){if(!this.view?.map)return;let{map:t}=this.view,i=t?.findLayerById(e);i&&m(i)&&t?.remove(i)}_setSnappingOption(){if(!this._sketchViewModel)return;let e=new c;this._unLayers?.forEach(t=>{L(t)?t.sublayers.forEach(i=>{e.add(new v({layer:i,enabled:!0}))}):e.add(new v({layer:t,enabled:!0}))}),this._sketchViewModel.snappingOptions={enabled:!0,featureEnabled:!0,featureSources:e}}_initializeSketchViewModel(e){let{view:t}=this,i=this._getGraphicLayer(e,b);return new A({layer:i,view:t})}_setupSketchViewModel(e){this._createGraphicLayer(e,b),this._sketchViewModel=this._initializeSketchViewModel(e),this._setSnappingOption()}_clearSubnetworks(){this.selectedSubnetworkName=void 0,this.subnetworksTable=void 0,this.compatibleSubnetworkNames=[]}async _loadSubnetworksTable(){this.subnetworksTable||(this.subnetworksTable=await this.selectedUtilityNetwork?.loadSubnetworksTable())}async _querySubnetworks(){let{subnetworksTable:e}=this;if(!e)return;let t=e.fieldsIndex.get("SUBNETWORKNAME"),i=(o,n,u)=>n===0||o.getAttribute(t.name)!==u[n-1].getAttribute(t.name),a=e.createQuery();a.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,a.where=this._getSubnetworkQueryWhereClause(),a.outFields=[t.name],a.orderByFields=[t.name];let{features:s}=await g(e,a,void 0,!1);this.compatibleSubnetworkNames=s.filter(i).map(o=>o.getAttribute(t.name))}_getSubnetworkQueryWhereClause(){let e=this._unTraceConfiguration,t=`DOMAINNETWORKNAME = '${e.domainNetworkName}'`,i=`TIERNAME = '${e.tierName}'`;return[t,i].join(" AND ")}async _handleSubnetworkTraceConfigChange(e){await this._loadSubnetworksTable(),await this._querySubnetworks();let{compatibleSubnetworkNames:t}=this;e.subnetworkName&&!t.some(i=>i===e.subnetworkName)&&(this.selectedSubnetworkName=t.at(0))}_selectTraceConfigurationByGuid(e){let t=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.find(i=>i.globalId===e);if(!t){d("error",this,"`traceConfig` not found in `selectedUtilityNetwork.sharedNamedTraceConfigurations`");return}this.selectedNamedTraceConfiguration=t}async _handleTraceConfigChange(){let{selectedNamedTraceConfiguration:e}=this;if(!(e?.traceConfiguration instanceof F)){d("error",this,y("selectedNamedTraceConfiguration.traceConfiguration")),this._unTraceConfiguration=void 0;return}this._unTraceConfiguration=e.traceConfiguration.clone(),this.isSubnetworkNameTraceSelected&&(this._subnetworkNamesState="loading",await this._handleSubnetworkTraceConfigChange(this._unTraceConfiguration),this._subnetworkNamesState="ready")}async _handleSelectedUtilityNetworkChange(){let{selectedUtilityNetwork:e}=this;try{e&&!e.loaded&&await e.load()}catch(t){p(t,this,"Error while loading the selected utility network")}this._clearSubnetworks(),this._setupTraceConfigurations(),this._filterUnLayers(),this._clearTraceLocations()}_setupTraceConfigurations(){this._unTraceConfiguration=void 0,this.selectedNamedTraceConfiguration=void 0,this.traceConfigurations=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.filter(Boolean).filter(e=>e.traceType!=="circuit").sort((e,t)=>e.title.localeCompare(t.title))||[],this.traceConfigurations.length?this.selectedNamedTraceConfiguration=this.traceConfigurations.at(0):d("error",this,"The selected utility network has no compatible named trace configurations.")}_filterUnLayers(){let{selectedUtilityNetwork:e}=this;this._unLayers=new c(this._allLayers.filter(t=>e?.isUtilityLayer(t)&&!this._subnetworkLayerIds.includes(t.layerId))),this._setSnappingOption()}_handleUtilityNetworksChange(){let{utilityNetworks:e,selectedUtilityNetwork:t}=this;e?.length?(!t||!e.includes(t))&&(this.selectedUtilityNetwork=e.at(0)):(d("error",this,_("utilityNetworks")),this.selectedUtilityNetwork=void 0,this._error=this._messages.errors.noUtilityNetwork)}async _setupUtilityNetworks(e){try{e.loaded||await e.load()}catch(t){p(t,this,"Error while loading `view.map`")}finally{this.utilityNetworks=e.utilityNetworks||new c}}_handleTraceLocationSelectStart(e){if(e.stopPropagation(),this.arcgisTraceLocationSelectStart.emit(e.detail).defaultPrevented){e.preventDefault();return}this._activeTraceLocationType=e?.target?.traceLocationType,this.mode="add-spatial-instructions"}_getLayerByLayerId(e){if(e==null)return;let{_layerIdToLayer:t,_unLayers:i}=this;if(t.get(e))return t.get(e);if(!i)return;let a=i.find(s=>"layerId"in s&&s.layerId===e);return a&&t.set(e,a),a}async _queryFeaturesOnLayer(e,t){let i=e.createQuery();i.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,i.objectIds=t.map(s=>s.getObjectId()),i.outFields=["*"];let{features:a}=await g(e,i);return a.forEach(s=>{if(!s.getEffectivePopupTemplate(this._defaultPopupTemplateEnabled)){let o=s.layer;s.popupTemplate=o.createPopupTemplate()}}),a}async _queryFeatures(e){let t=new Map,i=[];return e.forEach(a=>{let s=$(a.layer)?a.layer.parent:a.layer;if(s){let o=this._getLayerByLayerId(s.layerId);if(o){let n=t.get(o)||[];n.push(a),t.set(o,n)}}}),await Promise.all(Array.from(t.keys()).map(async a=>{let s=t.get(a)??[],o=await this._queryFeaturesOnLayer(a,s);i.push(...o)})),i}async _handleHitTestComplete(e){return this._exceedDisplayLimit=e.length>this._displayLimit,this.candidateFeatures=await this._queryFeatures(e.slice(0,this._displayLimit)),this.candidateFeatures.length===0?(this._handleAddSpatialCancelClick(),await Promise.reject(Error("No features found"))):(this.candidateFeatures.length===1&&(this.selectedFeature=this.candidateFeatures.at(0)),this.mode="add-spatial-feature",this._hitTestPromise?.reject(),this._hitTestPromise=Promise.withResolvers(),await this._hitTestPromise.promise)}_handleTraceLocationSelectEnd(e){e.stopPropagation(),this.arcgisTraceLocationSelectEnd.emit(),this._activeTraceLocationType=void 0,this.mode="default",this._handleAddSpatialCancelClick()}_handleAddSpatialCancelClick(e){e?.stopPropagation(),this._featuresComponentElement?.clear(),this._handleFeaturesClose(),this._sketchViewModel?.cancel()}_handleFeaturesClose(){this.mode="default",this.candidateFeatures=[],this.selectedFeature=void 0,this._hitTestPromise?.reject(),this._hitTestPromise=null}_handleAddSpatialAddClick(){let{_hitTestPromise:e,_featuresComponentElement:t,selectedFeature:i}=this;if(e&&t){if(!i)return;e.resolve(i),this._hitTestPromise=null}}renderError(e,t=!1,i){return r`<calcite-notice .closable=${t} kind=danger open scale=s width=auto .icon=${i}><div slot=message>${e}</div></calcite-notice>`}renderLoader(){return r`<calcite-loader label=loading></calcite-loader>`}renderTraceSelection(){let e=this.traceConfigurations.map(i=>r`<calcite-combobox-item .value=${i.globalId} .heading=${i.title} .selected=${i.globalId===this.selectedNamedTraceConfiguration?.globalId}></calcite-combobox-item>`),t=this._messages.labels.traceConfiguration;return r`<calcite-block .heading=${t} .label=${t} expanded><calcite-combobox .label=${t} selection-mode=single-persist @calciteComboboxChange=${({currentTarget:i})=>{this._selectTraceConfigurationByGuid(i.selectedItems[0]?.value)}}>${e}</calcite-combobox></calcite-block>`}renderUtilityNetworkSelection(){let{_messages:e}=this,t=e.labels.utilityNetwork,i=this.utilityNetworks?.map(a=>r`<calcite-combobox-item .value=${a.id} .heading=${a.title||a.id} .selected=${a.id===this.selectedUtilityNetwork?.id}></calcite-combobox-item>`);return r`<calcite-block .heading=${t} .label=${t} expanded><calcite-combobox .label=${t} selection-mode=single-persist @calciteComboboxChange=${({currentTarget:a})=>{let s=a.selectedItems[0]?.value;this.selectedUtilityNetwork?.id!==s&&(this.selectedUtilityNetwork=this.utilityNetworks?.find(o=>o.id===s))}}>${i}</calcite-combobox></calcite-block>`}renderDefaultMode(){let{selectedUtilityNetwork:e}=this,{noView:t,noUtilityNetwork:i}=this._messages.errors,a;return this._error===t||this._error===i?a=this.renderError(this._error,!1,"exclamation-mark-triangle"):!e?.loaded&&!e?.loadError?a=this.renderLoader():a=this.renderContent(),r`<calcite-flow-item .selected=${this.mode==="default"}>${a}</calcite-flow-item>`}renderSpatialSelectInstructions(){let{_messages:e,_activeTraceLocationType:t,mode:i}=this,a=t==="starting-point"?e.labels.addSpatial.startingPoint:t==="barrier"?e.labels.addSpatial.barrier:e.labels.addSpatial.stoppingPoint;return r`<calcite-flow-item .selected=${i==="add-spatial-instructions"} .heading=${a} @calciteFlowItemBack=${s=>this._handleAddSpatialCancelClick(s)}><div class="add-spatial-mode"><div><h5 class="heading">${e.instructions.addSpatial.selectFeature.heading}</h5>${e.instructions.addSpatial.selectFeature.subheading}</div><div><h5 class="heading">${e.instructions.addSpatial.selectAssociatedFeature.heading}</h5>${e.instructions.addSpatial.selectAssociatedFeature.subheading}</div></div></calcite-flow-item>`}renderCandidateFeatures(){let{candidateFeatures:e}=this;if(!e.length)return this.mode="default",null;let t=this._activeTraceLocationType==="starting-point"?this._messages.labels.addSpatial.startingPoint:this._activeTraceLocationType==="barrier"?this._messages.labels.addSpatial.barrier:this._messages.labels.addSpatial.stoppingPoint,i=e.length===1?"feature":"list";return r`<arcgis-features .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this._defaultPopupTemplateEnabled} .features=${e} .featureMenuTitle=${t} .hideActionBar=${this.hideActionBar} hide-select-feature .initialDisplayMode=${i} @arcgisClose=${()=>this._handleFeaturesClose()} @arcgisPropertyChange=${this._handleFeaturesPropertyChange} open .referenceElement=${this.referenceElement} .view=${this.view} ${h(this._featuresComponentRefChange)}></arcgis-features>`}renderAddSpatialFooter(){let{mode:e,_messages:t,selectedFeature:i,selectedUtilityNetwork:a}=this,s=e==="add-spatial-feature"&&this._exceedDisplayLimit&&!i,o=I(t.warnings.exceededDisplayLimit,{limit:this._displayLimit.toString()}),n=i?!(a?.isUtilityLayer(i.layer)??!0):!0;return r`${s&&r`<calcite-input-message id=results-limited-message icon=exclamation-mark-circle status=idle>${o}</calcite-input-message>`||""}<calcite-button appearance=outline width=full @click=${()=>this._handleAddSpatialCancelClick()} slot=footer>${t.buttons.cancel}</calcite-button>${e==="add-spatial-feature"&&r`<calcite-button width=full slot=footer appearance=solid @click=${()=>this._handleAddSpatialAddClick()} .disabled=${n}>${t.buttons.add}</calcite-button>`||""}`}renderStartingPointSelection(){return r`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=starting-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._unLayers} .traceLocations=${this._startingPoints} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._traceLocationStartingRefChange)}></arcgis-utility-network-trace-location>`}renderStoppingPointSelection(){return r`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=stopping-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._unLayers} .traceLocations=${this._stoppingPoints} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._traceLocationStoppingRefChange)}></arcgis-utility-network-trace-location>`}renderBarrierSelection(){return r`<arcgis-utility-network-trace-location .view=${this.view} trace-location-type=barrier .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this._handleTraceLocationSelectStart} @arcgisTraceLocationSelectEnd=${this._handleTraceLocationSelectEnd} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this._sketchViewModel} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this._unLayers} .traceLocations=${this._barriers} .afterHitTest=${this._handleHitTestComplete.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this._traceLocationBarrierRefChange)}></arcgis-utility-network-trace-location>`}renderSubnetworkNameInput(){return r`<calcite-input clearable type=text .placeholder=${this._messages.instructions.enterSubnetworkName} max-length=64 .status=${this.selectedSubnetworkName?"valid":"invalid"} .value=${this.selectedSubnetworkName} @calciteInputInput=${e=>this.selectedSubnetworkName=e.target.value}></calcite-input><calcite-input-message icon=exclamation-mark-triangle status=idle>${this._messages.labels.tooManySubnetworks}</calcite-input-message>`}renderSubnetworkSelectList(){return r`<calcite-combobox .label=${this._messages.labels.subnetworkName} selection-mode=single-persist @calciteComboboxChange=${({currentTarget:e})=>{this.selectedSubnetworkName=e.selectedItems[0]?.value}}>${this.compatibleSubnetworkNames.map(e=>r`<calcite-combobox-item .value=${e} .heading=${e} .selected=${e===this.selectedSubnetworkName}></calcite-combobox-item>`)}</calcite-combobox>`}renderSubnetworkSelection(){let{compatibleSubnetworkNames:e}=this,t=this._messages.labels.subnetworkName;return this.isSubnetworkNameTraceSelected?this._subnetworkNamesState==="loading"?r`<calcite-loader class="inline-loader" label=loading scale=s></calcite-loader>`:e.length?r`<calcite-block .heading=${t} .label=${t} expanded>${e.length>M?this.renderSubnetworkNameInput():this.renderSubnetworkSelectList()}</calcite-block>`:this.renderError(this._messages.errors.noCompatibleSubnetworks,!1,"exclamation-mark-triangle"):null}renderSubnetworkInfo(){let{_messages:e,selectedNamedTraceConfiguration:t,_unTraceConfiguration:i}=this;return i&&t?.traceType&&this._subnetworkTraceTypes.has(t.traceType)?r`<calcite-block id=subnetwork-info-block expanded .label=${e.labels.subnetworkInfo}><arcgis-utility-network-subnetwork-info .namedTraceConfig=${t}></arcgis-utility-network-subnetwork-info></calcite-block>`:null}renderContent(){let{utilityNetworks:e,unTraceConfiguration:t}=this,{noTraceConfiguration:i,noNamedTraceConfigurations:a,utilityNetworkLoadFailed:s}=this._messages.errors,o=e&&e.length>1?this.renderUtilityNetworkSelection():null,n;this.selectedUtilityNetwork?.loadError?n=this.renderError(s,!1,"exclamation-mark-triangle"):this.traceConfigurations.length||(n=this.renderError(a,!1,"exclamation-mark-triangle"));let u=r`${this.renderTraceSelection()}${this.renderSubnetworkInfo()}${this.renderSubnetworkSelection()}`,P=t?r`${this.showStartingPoints?this.renderStartingPointSelection():null}${this.showStoppingPoints?this.renderStoppingPointSelection():null}${this.renderBarrierSelection()}`:this.renderError(i,!1,"exclamation-mark-triangle");return r`<calcite-block-group .label=${this._messages.labels.traceInputs}>${o}${n??r`${u}${P}`}</calcite-block-group>`}render(){let{mode:e}=this;return r`<calcite-panel>${e==="add-spatial-feature"?this.renderCandidateFeatures():null}<calcite-flow .hidden=${e==="add-spatial-feature"}>${this.renderDefaultMode()}${this.renderSpatialSelectInstructions()}</calcite-flow>${e!=="default"?this.renderAddSpatialFooter():null}</calcite-panel>`}};S("arcgis-utility-network-trace-inputs",w);return w},"core/Collection","core/reactiveUtils","intl","layers/GraphicsLayer","networks/support/UNTraceConfiguration","rest/networks/support/TraceLocation","views/interactive/snapping/FeatureSnappingLayerSource","widgets/Sketch/SketchViewModel",a,b)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import i from"./G4CNNMC7.js";import f from"./7EUCUK6E.js";import{a as E}from"./HMWOHSHV.js";import e from"./ZOPB777S.js";import{a as F}from"./TNDRCMN3.js";import"./54VXNFQ4.js";import d from"./V2RXBLNO.js";import c from"./OCLLMQGL.js";import{f as P,h as $}from"./CIFVM6AU.js";import"./EPO62377.js";import a from"./FKLH5Y2K.js";import{d as k}from"./TGNR3DAP.js";import{M as g,N as u,O as z,P as v,Q as D,U as A,a as M,b as h,x as b}from"./MTKZBIHD.js";import"./3TTFCHAA.js";export default $arcgis.t(([V,{stripHTML:B},{watch:p},I,,,,L,,N])=>{var R=M`:host{display:contents;--arcgis-internal-popup-pointer-size: 12px;--arcgis-internal-popup-content-small-size: 280px;--arcgis-internal-popup-content-medium-size: 340px;--arcgis-internal-popup-content-large-size: 400px;--arcgis-internal-popup-content-x-large-size: 460px;--arcgis-internal-popup-content-min-size-y: 48px;--arcgis-internal-popup-pointer-size-half: calc(var(--arcgis-internal-popup-pointer-size) / 2);--arcgis-internal-popup-pointer-size-half-negative: calc(var(--arcgis-internal-popup-pointer-size-half) * -1)}.root{display:flex;position:absolute;flex-flow:column nowrap;z-index:401;pointer-events:none;border:none;overflow:visible;padding:0;width:auto;height:auto;background-color:transparent}.hidden{visibility:hidden}.root:popover-open{display:flex;position:fixed;flex-flow:column nowrap;margin:0}arcgis-features{flex:1;width:100%}.shadow{box-shadow:var(--calcite-shadow-sm)}.aligned-top-center{transform-origin:50% 100%}.aligned-bottom-center{transform-origin:50% -5%}.aligned-top-left,.aligned-bottom-left{transform-origin:100% 50%}.aligned-top-right,.aligned-bottom-right{transform-origin:-5% 50%}.aligned-top-center,.aligned-top-left,.aligned-top-right{animation:popup-intro-animation-down .2s ease-in-out}.aligned-bottom-center,.aligned-bottom-left,.aligned-bottom-right{animation:popup-intro-animation-up .2s ease-in-out}.main-container{display:flex;position:relative;z-index:1;background-color:var(--calcite-color-foreground-1);width:var(--arcgis-internal-popup-content-medium-size);min-height:var(--arcgis-internal-popup-content-min-size-y);max-height:var(--arcgis-internal-popup-content-medium-size);overflow:hidden;pointer-events:auto}.pointer{position:absolute;width:0;height:0}.pointer-direction{position:absolute;width:var(--arcgis-internal-popup-pointer-size);height:var(--arcgis-internal-popup-pointer-size);content:"";background-color:var(--calcite-color-foreground-1)}.aligned-top-center .pointer{top:100%;left:50%;margin:0 0 0 var(--arcgis-internal-popup-pointer-size-half-negative)}.aligned-bottom-center .pointer{bottom:100%;left:50%;margin:0 0 0 var(--arcgis-internal-popup-pointer-size-half-negative)}.aligned-top-left .pointer{right:var(--arcgis-internal-popup-pointer-size-half);bottom:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(-45deg)}.aligned-bottom-left .pointer{top:var(--arcgis-internal-popup-pointer-size-half);right:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(45deg)}.aligned-top-right .pointer{bottom:var(--arcgis-internal-popup-pointer-size-half);left:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(45deg)}.aligned-bottom-right .pointer{top:var(--arcgis-internal-popup-pointer-size-half);left:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(-45deg)}.aligned-top-center .pointer-direction,.aligned-bottom-center .pointer-direction{transform:scale(.75,2) rotate(45deg)}.aligned-top-left .pointer-direction,.aligned-bottom-left .pointer-direction,.aligned-top-right .pointer-direction,.aligned-bottom-right .pointer-direction{top:var(--arcgis-internal-popup-pointer-size-half-negative);left:var(--arcgis-internal-popup-pointer-size-half-negative);transform:scale(.75,2.5) rotate(45deg)}.aligned-top-center .pointer-direction{top:var(--arcgis-internal-popup-pointer-size-half-negative);left:0}.aligned-bottom-center .pointer-direction{bottom:var(--arcgis-internal-popup-pointer-size-half-negative);left:0}.is-xl-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-x-large-size)}.is-lg-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-large-size)}.is-md-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-medium-size)}.is-sm-width-breakpoint .main-container,.is-xs-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-small-size)}.is-xs-width-breakpoint.is-docked-top-center,.is-xs-width-breakpoint.is-docked-bottom-center{margin:0;width:auto}.is-xs-width-breakpoint.is-docked-top-center .main-container,.is-xs-width-breakpoint.is-docked-bottom-center .main-container{position:absolute;right:0;left:0;width:100%;max-height:75%}.is-xs-width-breakpoint.is-docked-bottom-center .main-container{bottom:0}.is-xs-width-breakpoint.is-docked-top-center .main-container{top:0}.is-xl-height-breakpoint .main-container{max-height:var(--arcgis-internal-popup-content-x-large-size)}.is-lg-height-breakpoint .main-container{max-height:var(--arcgis-internal-popup-content-large-size)}.is-sm-height-breakpoint .main-container,.is-xs-height-breakpoint .main-container{max-height:var(--arcgis-internal-popup-content-small-size)}.is-docked{flex-flow:row nowrap;inset:0;margin:var(--arcgis-layout-overlay-space-top, 0) var(--arcgis-layout-overlay-space-right, 0) var(--arcgis-layout-overlay-space-bottom, 0) var(--arcgis-layout-overlay-space-left, 0);padding:var(--calcite-spacing-lg) var(--calcite-spacing-lg) var(--calcite-spacing-xxxl) var(--calcite-spacing-lg);animation:docking-animation .25s ease-out}.is-docked-top-left,.is-docked-top-center,.is-docked-top-right,.is-docked-top-start,.is-docked-top-end{align-items:flex-start}.is-docked-bottom-left,.is-docked-bottom-center,.is-docked-bottom-right,.is-docked-bottom-start,.is-docked-bottom-end{align-items:flex-end}.is-docked-top-left,.is-docked-bottom-left,.is-docked-top-start,.is-docked-bottom-start{justify-content:flex-start}.is-docked-top-center,.is-docked-bottom-center{justify-content:center}.is-docked-top-right,.is-docked-bottom-right,.is-docked-top-end,.is-docked-bottom-end{justify-content:flex-end}.is-docked-top-left.is-rtl,.is-docked-top-right.is-rtl,.is-docked-bottom-left.is-rtl,.is-docked-bottom-right.is-rtl{flex-direction:row-reverse}.is-docked-top-left .main-container,.is-docked-top-right .main-container,.is-docked-bottom-left .main-container,.is-docked-bottom-right .main-container,.is-docked-top-start .main-container,.is-docked-top-end .main-container,.is-docked-bottom-start .main-container,.is-docked-bottom-end .main-container{max-height:80%}.is-docked-top-center .main-container,.is-docked-bottom-center .main-container{max-height:40%}@media(prefers-reduced-motion){.aligned-top-center,.aligned-top-left,.aligned-top-right,.aligned-bottom-center,.aligned-bottom-left,.aligned-bottom-right{animation:none}}@media(prefers-reduced-motion){.is-docked{animation:none}}@keyframes docking-animation{0%{opacity:0}25%{opacity:0}to{opacity:1}}@keyframes popup-intro-animation-down{0%{transform:translateY(calc(var(--calcite-spacing-xs) * -1));opacity:0}to{transform:translate(0);opacity:1}}@keyframes popup-intro-animation-up{0%{transform:translateY(var(--calcite-spacing-xs));opacity:0}to{transform:translate(0);opacity:1}}`;function w(_){return _&&Number.parseInt(_.replaceAll(/[^-\d.]/gu,""),10)||0}var j=L(V),O={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},C=class extends z{constructor(){super(...arguments),this._direction=P(),this._featuresComponent=g(),this._dockAction=new I({id:"popup-dock-action"}),this._mainContainerNode=g(),this._pointerNode=g(),this.messages=F(),this.viewModel=j(this),this._containerNode=g(),this._popupResizeObserver=new ResizeObserver(()=>this._positionContainer()),this._positionContainer=()=>{this.positionStyle=this._calculatePositionStyle()},this.screenLocation=N(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.alignment="auto",this.autoCloseEnabled=!1,this.autoDestroyDisabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.dockEnabled=!1,this.effectiveHeading=this.viewModel.effectiveHeading,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=!1,this.features=this.viewModel.features,this.goToOverride=this.viewModel.goToOverride,this.heading=this.viewModel.heading,this.headingLevel=2,this.hideActionBar=!1,this.hideCloseButton=!1,this.hideCollapseButton=!1,this.hideFeatureMenuHeading=!1,this.hideFeatureNavigation=!1,this.hideFeatureListLayerTitle=!1,this.hideHeading=!1,this.hideSpinner=!1,this.highlightDisabled=this.viewModel.highlightEnabled,this.includeDefaultActionsDisabled=this.viewModel.includeDefaultActions,this.initialDisplayMode=this.viewModel.initialDisplayMode,this.location=this.viewModel.location,this.open=this.viewModel.open,this.promises=this.viewModel.promises,this.selectedFeature=this.viewModel.selectedFeature,this.selectedFeatureIndex=this.viewModel.selectedFeatureIndex,this.state=this.viewModel.state,this.topLayerDisabled=!1,this.updateLocationEnabled=this.viewModel.updateLocationEnabled,this.view=this.viewModel.view,this.arcgisPropertyChange=$()("active","collapsed","currentAlignment","dockEnabled","effectiveHeading","featureCount","featureMenuOpen","features","promises","selectedDrillInFeature","selectedFeature","selectedFeatureComponent","selectedFeatureIndex","state","open"),this.arcgisReady=b(),this.arcgisClose=b(),this.arcgisTriggerAction=b()}static{this.properties={screenLocation:16,positionStyle:16,_featureNavigationTop:16,actions:0,active:0,alignment:1,autoCloseEnabled:5,autoDestroyDisabled:5,collapsed:5,content:1,currentAlignment:32,currentDockPosition:32,defaultPopupTemplateEnabled:5,dockEnabled:5,dockOptions:0,effectiveHeading:32,featureCount:0,featureMenuOpen:5,featureMenuTitle:1,features:0,goToOverride:0,heading:1,headingLevel:9,hideActionBar:5,hideCloseButton:5,hideCollapseButton:5,hideFeatureMenuHeading:5,hideFeatureNavigation:5,hideFeatureListLayerTitle:5,hideHeading:5,hideSpinner:5,highlightDisabled:5,includeDefaultActionsDisabled:5,initialDisplayMode:1,label:1,location:0,messageOverrides:0,open:5,promises:0,referenceElement:1,selectedDrillInFeature:32,selectedFeature:0,selectedFeatureComponent:32,selectedFeatureIndex:9,state:32,topLayerDisabled:5,updateLocationEnabled:5,view:0}}static{this.styles=R}get trackLocation(){return this.active&&!this.dockEnabled}get _featureNavigationTop(){let{currentAlignment:t,currentDockPosition:e}=this;return t==="bottom-left"||t==="bottom-center"||t==="bottom-right"||t==="bottom-start"||t==="bottom-end"||e==="top-left"||e==="top-center"||e==="top-right"||e==="top-start"||e==="top-end"}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._dockOptions||O}set dockOptions(t){let e={...O},o=this.viewModel?.view?.breakpoints,i={};o&&(i.width=o.xsmall,i.height=o.xsmall);let a={...e,...t},n={...e.breakpoint,...i},{breakpoint:s}=a;typeof s=="object"?a.breakpoint={...n,...s}:s&&(a.breakpoint=n),this._dockOptions=a}get selectedDrillInFeature(){return this._featuresComponent.value?.selectedDrillInFeature??null}get selectedFeatureComponent(){return this._featuresComponent.value?.selectedFeatureComponent??null}async handleViewClick(t){return this.viewModel.handleViewClick(t)}async clear(){return this.viewModel.clear()}async destroy(){await this.manager.destroy(),this._dockAction.destroy(),this._popupResizeObserver.disconnect()}async fetchFeatures(t,e){return await this._featuresComponent.value?.fetchFeatures(t,e)}async next(){return this.viewModel.next()}async previous(){return this.viewModel.previous()}async setFocus(){this._featuresComponent.value?.setFocus()}async triggerAction(t){return await this._featuresComponent.value?.triggerAction(t)}loaded(){this.manager.onLifecycle(()=>[p(()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled,this._direction],()=>this._handleDockIcon(),{initial:!0}),p(()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock],()=>this._handleDockEnabled(),{initial:!0}),p(()=>[this.dockOptions,this._featuresComponent.value],()=>{let{_dockAction:t,dockOptions:e}=this,o=this._featuresComponent.value?.headerActions;o?.remove(t),e.buttonEnabled&&o?.add(t)},{initial:!0}),p(()=>[this._pointerNode.value,this.alignment,this.currentAlignment,this.dockEnabled,this.dockOptions,this.screenLocation,this.viewModel?.active,this.viewModel?.location,this.viewModel?.view?.size],()=>this._positionContainer(),{initial:!0}),p(()=>this._mainContainerNode.value,t=>{this._popupResizeObserver.disconnect(),t&&this._popupResizeObserver.observe(t)},{initial:!0}),p(()=>this.viewModel?.view?.size,(t,e)=>this._updateDockEnabledForViewSize(t,e)),p(()=>this.viewModel?.view?.ready,()=>this._setDockEnabledForViewSize(this.dockOptions),{initial:!0}),p(()=>this.view?.map,t=>{this.viewModel.map=t},{initial:!0}),p(()=>this.screenLocation,(t,e)=>this._autoClose(t,e)),p(()=>[this.active,this._containerNode.value,this.dockEnabled,this.topLayerDisabled],()=>this._togglePopover(),{initial:!0})])}_togglePopover(){this._containerNode.value?.togglePopover(this.active&&!this.dockEnabled&&!this.topLayerDisabled)}_handleClose(t){t.stopPropagation(),this.arcgisClose.emit()}_autoClose(t,e){this.autoCloseEnabled&&t!=null&&e!=null&&(this.open=!1)}_handleArcgisPropertyChange(t){t.detail.name==="collapsed"&&(this.collapsed=t.target.collapsed)}_handleArcgisTriggerAction(t){t.stopPropagation(),t.detail.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled),this.arcgisTriggerAction.emit({action:t.detail.action})}_isOutsideView(t){let{popupHeight:e,popupWidth:o,screenLocation:i,side:a,view:n}=t;return Number.isNaN(o)||Number.isNaN(e)||!n||!i?!1:a==="right"&&i.x+o/2>n.width||a==="left"&&i.x-o/2<0||a==="top"&&i.y-e<0||a==="bottom"&&i.y+e>n.height}_getPointerSize(){let{_pointerNode:t}=this,e=t.value?window.getComputedStyle(t.value):null,o=w(e?.height),i=w(e?.width);return Math.hypot(o,i)}_calculateAutoAlignment(t){if(t!=="auto")return t;let{_mainContainerNode:e,_popupRect:o,viewModel:i}=this,{view:a}=i,{screenLocation:n}=this;if(n==null||!a||!o||!e.value)return"top-center";let s=window.getComputedStyle(e.value),l=w(s.maxHeight),r=w(s.height),c=this._getPointerSize(),{height:d,width:y}=o,m=y+c,f=Math.max(d,l,r)+c,S=this._isOutsideView({popupHeight:f,popupWidth:m,screenLocation:n,side:"right",view:a}),T=this._isOutsideView({popupHeight:f,popupWidth:m,screenLocation:n,side:"left",view:a}),x=this._isOutsideView({popupHeight:f,popupWidth:m,screenLocation:n,side:"top",view:a}),H=this._isOutsideView({popupHeight:f,popupWidth:m,screenLocation:n,side:"bottom",view:a});return T?x?"bottom-right":"top-right":S?x?"bottom-left":"top-left":x?H?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(t){return typeof t=="function"?t.call(this):t}_getCurrentAlignment(){return this.dockEnabled||!this.active||!this._mainContainerNode.value?null:this._calculateAutoAlignment(this._callCurrentAlignment(this.alignment))}_callDockPosition(t){return typeof t=="function"?t.call(this):t}_getDockPosition(){return this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position))}_getCurrentDockPosition(){return this.dockEnabled&&this.active?this._getDockPosition():null}_calculateAutoDockPosition(t){if(t!=="auto")return t;let e=this.viewModel?.view,o="top-end";if(!e)return o;let{breakpoints:i}=e;return i?.xsmall&&e.width<=i.xsmall?"bottom-center":o}_getDockIcon(){let t=this._getDockPosition(),{_direction:e}=this;if(this.dockEnabled)return"minimize";switch(t){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";case"top-right":case"bottom-right":return"dock-right";case"top-start":case"bottom-start":return e==="rtl"?"dock-right":"dock-left";default:return e==="rtl"?"dock-left":"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_calculateAlignmentPosition(t,e,o,i){if(t<0||e<0||!o||!i||t>o.width||e>o.height)return;let{topLayerDisabled:a}=this,n=a?t:t+o.x,s=a?e:e+o.y,{_direction:l,currentAlignment:r}=this,c=this._getPointerSize(),d=c/2;if(r==="top-left"||r==="top-start"&&l==="ltr"||r==="top-end"&&l==="rtl")return{top:s-(i.height+d),left:n-i.width-d};if(r==="top-center")return{top:s-(i.height+c),left:n-i.width/2};if(r==="top-right"||r==="top-end"&&l==="ltr"||r==="top-start"&&l==="rtl")return{top:s-(i.height+d),left:n+d};if(r==="bottom-left"||r==="bottom-start"&&l==="ltr"||r==="bottom-end"&&l==="rtl")return{top:s+d,left:n-i.width-d};if(r==="bottom-center")return{top:s+c,left:n-i.width/2};if(r==="bottom-right"||r==="bottom-end"&&l==="ltr"||r==="bottom-start"&&l==="rtl")return{top:s+d,left:n+d}}_getPositionStyleValue(t){return t!=null?`${t}px`:"auto"}_calculatePositionStyle(){if(this.dockEnabled)return;let{screenLocation:t}=this;if(t==null)return;let e=this.view?.container?.getBoundingClientRect(),o=this._mainContainerNode.value?.getBoundingClientRect();this._popupRect=o;let i=this._calculateAlignmentPosition(t.x,t.y,e,o);if(i)return`inset: ${this._getPositionStyleValue(i.top)} ${this._getPositionStyleValue(i.right)} ${this._getPositionStyleValue(i.bottom)} ${this._getPositionStyleValue(i.left)};`}_dockingThresholdCrossed(t,e,o){let[i,a]=t,[n,s]=e,{width:l=0,height:r=0}=o??{};return i<=l&&n>l||i>l&&n<=l||a<=r&&s>r||a>r&&s<=r}_updateDockEnabledForViewSize(t,e){if(!t||!e||!this.viewModel?.view?.ready)return;let{dockOptions:o}=this,i=o.breakpoint;typeof i=="object"&&this._dockingThresholdCrossed(t,e,i)&&this._setDockEnabledForViewSize(o)}_shouldDockAtCurrentViewSize(t){let e=t.breakpoint,o=this.viewModel?.view?.ui;if(!o)return!1;let{width:i,height:a}=o;if(Number.isNaN(i)||Number.isNaN(a)||typeof e!="object")return!1;let n=typeof e.width=="number"&&i<=(e.width??0),s=typeof e.height=="number"&&a<=(e.height??0);return n||s}_setDockEnabledForViewSize(t){this.viewModel?.view?.ready&&typeof t.breakpoint=="object"&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(t))}render(){let{_direction:t,dockEnabled:e,currentAlignment:o,currentDockPosition:i,positionStyle:a}=this,{active:n,view:s}=this.viewModel,l=n&&e,r=n&&!e,c=s?.widthBreakpoint,d=s?.heightBreakpoint,y={"aligned-top-center":o==="top-center","aligned-bottom-center":o==="bottom-center","aligned-top-left":o==="top-left"||o==="top-start"&&t==="ltr"||o==="top-end"&&t==="rtl","aligned-bottom-left":o==="bottom-left"||o==="bottom-start"&&t==="ltr"||o==="bottom-end"&&t==="rtl","aligned-top-right":o==="top-right"||o==="top-end"&&t==="ltr"||o==="top-start"&&t==="rtl","aligned-bottom-right":o==="bottom-right"||o==="bottom-end"&&t==="ltr"||o==="bottom-start"&&t==="rtl","is-docked":l,shadow:r,"is-rtl":this._direction==="rtl","is-docked-top-start":i==="top-start","is-docked-top-end":i==="top-end","is-docked-top-left":i==="top-left","is-docked-top-center":i==="top-center","is-docked-top-right":i==="top-right","is-docked-bottom-left":i==="bottom-left","is-docked-bottom-center":i==="bottom-center","is-docked-bottom-right":i==="bottom-right","is-docked-bottom-start":i==="bottom-start","is-docked-bottom-end":i==="bottom-end","is-xl-width-breakpoint":c==="xlarge","is-lg-width-breakpoint":c==="large","is-md-width-breakpoint":c==="medium","is-sm-width-breakpoint":c==="small","is-xs-width-breakpoint":c==="xsmall","is-xl-height-breakpoint":d==="xlarge","is-lg-height-breakpoint":d==="large","is-md-height-breakpoint":d==="medium","is-sm-height-breakpoint":d==="small","is-xs-height-breakpoint":d==="xsmall"};return h`<div style=${D(a)} class=${v(k("root",y,{hidden:!n||!a&&!e}))} .ariaHidden=${!n} .ariaLabel=${B(this.heading??"")} role=dialog popover=manual ${u(this._containerNode)}>${this._renderMainContainer()}${this._renderPointer()}</div>`}_renderPointer(){return!this.dockEnabled||!this.active?h`<div class="pointer" role=presentation><div class=${v(k("pointer-direction","shadow"))} ${u(this._pointerNode)}></div></div>`:null}_renderMainContainer(){let t={shadow:this.dockEnabled};return h`<div class=${v(k("main-container",t))} ${u(this._mainContainerNode)}>${E(this.viewModel,h`<arcgis-features .collapsed=${this.collapsed} .autoDestroyDisabled=${this.autoDestroyDisabled} .featureNavigationTop=${this._featureNavigationTop} .headingLevel=${this.headingLevel} .hidden=${!this.active} .hideActionBar=${this.hideActionBar} .hideCloseButton=${this.hideCloseButton} .hideFeatureListLayerTitle=${this.hideFeatureListLayerTitle} .hideFeatureMenuHeading=${this.hideFeatureMenuHeading} .hideFeatureNavigation=${this.hideFeatureNavigation} .hideHeading=${this.hideHeading} .hideSpinner=${this.hideSpinner} @arcgisPropertyChange=${this._handleArcgisPropertyChange} @arcgisTriggerAction=${this._handleArcgisTriggerAction} @arcgisClose=${this._handleClose} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .referenceElement=${this.referenceElement} .responsiveActionsEnabled=${!0} .showCollapseButton=${!this.hideCollapseButton} .viewModel=${this.viewModel} ${u(this._featuresComponent)}><slot name=actions-start slot=actions-start></slot><slot name=actions-end slot=actions-end></slot></arcgis-features>`)}</div>`}};A("arcgis-popup",C);return C},"popup/Features","applications/Components/stringUtils","core/reactiveUtils","support/actions/ActionButton",a,c,d,e,f,i)
2
+ import i from"./G4CNNMC7.js";import f from"./7EUCUK6E.js";import{a as E}from"./HMWOHSHV.js";import e from"./ZOPB777S.js";import{a as F}from"./TNDRCMN3.js";import"./54VXNFQ4.js";import d from"./V2RXBLNO.js";import c from"./OCLLMQGL.js";import{f as P,h as $}from"./CIFVM6AU.js";import"./EPO62377.js";import a from"./FKLH5Y2K.js";import{d as k}from"./TGNR3DAP.js";import{M as g,N as u,O as z,P as v,Q as D,U as A,a as M,b as h,x as b}from"./MTKZBIHD.js";import"./3TTFCHAA.js";export default $arcgis.t(([V,{stripHTML:B},{watch:p},I,,,,L,,N])=>{var R=M`:host{display:contents;--arcgis-internal-popup-pointer-size: 12px;--arcgis-internal-popup-content-small-size: 280px;--arcgis-internal-popup-content-medium-size: 340px;--arcgis-internal-popup-content-large-size: 400px;--arcgis-internal-popup-content-x-large-size: 460px;--arcgis-internal-popup-content-min-size-y: 48px;--arcgis-internal-popup-pointer-size-half: calc(var(--arcgis-internal-popup-pointer-size) / 2);--arcgis-internal-popup-pointer-size-half-negative: calc(var(--arcgis-internal-popup-pointer-size-half) * -1)}.root{display:flex;position:absolute;flex-flow:column nowrap;z-index:401;pointer-events:none;border:none;overflow:visible;padding:0;width:auto;height:auto;background-color:transparent}.hidden{visibility:hidden}.root:popover-open{display:flex;position:fixed;flex-flow:column nowrap;margin:0}arcgis-features{flex:1;width:100%}.shadow{box-shadow:var(--calcite-shadow-sm)}.aligned-top-center{transform-origin:50% 100%}.aligned-bottom-center{transform-origin:50% -5%}.aligned-top-left,.aligned-bottom-left{transform-origin:100% 50%}.aligned-top-right,.aligned-bottom-right{transform-origin:-5% 50%}.aligned-top-center,.aligned-top-left,.aligned-top-right{animation:popup-intro-animation-down .2s ease-in-out}.aligned-bottom-center,.aligned-bottom-left,.aligned-bottom-right{animation:popup-intro-animation-up .2s ease-in-out}.main-container{display:flex;position:relative;z-index:1;background-color:var(--calcite-color-foreground-1);width:var(--arcgis-internal-popup-content-medium-size);min-height:var(--arcgis-internal-popup-content-min-size-y);max-height:var(--arcgis-internal-popup-content-medium-size);overflow:hidden;pointer-events:auto}.pointer{position:absolute;width:0;height:0}.pointer-direction{position:absolute;width:var(--arcgis-internal-popup-pointer-size);height:var(--arcgis-internal-popup-pointer-size);content:"";background-color:var(--calcite-color-foreground-1)}.aligned-top-center .pointer{top:100%;left:50%;margin:0 0 0 var(--arcgis-internal-popup-pointer-size-half-negative)}.aligned-bottom-center .pointer{bottom:100%;left:50%;margin:0 0 0 var(--arcgis-internal-popup-pointer-size-half-negative)}.aligned-top-left .pointer{right:var(--arcgis-internal-popup-pointer-size-half);bottom:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(-45deg)}.aligned-bottom-left .pointer{top:var(--arcgis-internal-popup-pointer-size-half);right:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(45deg)}.aligned-top-right .pointer{bottom:var(--arcgis-internal-popup-pointer-size-half);left:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(45deg)}.aligned-bottom-right .pointer{top:var(--arcgis-internal-popup-pointer-size-half);left:var(--arcgis-internal-popup-pointer-size-half);transform:rotate(-45deg)}.aligned-top-center .pointer-direction,.aligned-bottom-center .pointer-direction{transform:scale(.75,2) rotate(45deg)}.aligned-top-left .pointer-direction,.aligned-bottom-left .pointer-direction,.aligned-top-right .pointer-direction,.aligned-bottom-right .pointer-direction{top:var(--arcgis-internal-popup-pointer-size-half-negative);left:var(--arcgis-internal-popup-pointer-size-half-negative);transform:scale(.75,2.5) rotate(45deg)}.aligned-top-center .pointer-direction{top:var(--arcgis-internal-popup-pointer-size-half-negative);left:0}.aligned-bottom-center .pointer-direction{bottom:var(--arcgis-internal-popup-pointer-size-half-negative);left:0}.is-xl-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-x-large-size)}.is-lg-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-large-size)}.is-md-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-medium-size)}.is-sm-width-breakpoint .main-container,.is-xs-width-breakpoint .main-container{width:var(--arcgis-internal-popup-content-small-size)}.is-xs-width-breakpoint.is-docked-top-center,.is-xs-width-breakpoint.is-docked-bottom-center{margin:0;width:auto}.is-xs-width-breakpoint.is-docked-top-center .main-container,.is-xs-width-breakpoint.is-docked-bottom-center .main-container{position:absolute;right:0;left:0;width:100%;max-height:75%}.is-xs-width-breakpoint.is-docked-bottom-center .main-container{bottom:0}.is-xs-width-breakpoint.is-docked-top-center .main-container{top:0}.is-xl-height-breakpoint .main-container{max-height:var(--arcgis-internal-popup-content-x-large-size)}.is-lg-height-breakpoint .main-container{max-height:var(--arcgis-internal-popup-content-large-size)}.is-sm-height-breakpoint .main-container,.is-xs-height-breakpoint .main-container{max-height:var(--arcgis-internal-popup-content-small-size)}.is-docked{flex-flow:row nowrap;inset:0;margin:var(--arcgis-layout-overlay-space-top, 0) var(--arcgis-layout-overlay-space-right, 0) var(--arcgis-layout-overlay-space-bottom, 0) var(--arcgis-layout-overlay-space-left, 0);padding:var(--calcite-spacing-lg) var(--calcite-spacing-lg) var(--calcite-spacing-xxxl) var(--calcite-spacing-lg);animation:docking-animation .25s ease-out}.is-docked-top-left,.is-docked-top-center,.is-docked-top-right,.is-docked-top-start,.is-docked-top-end{align-items:flex-start}.is-docked-bottom-left,.is-docked-bottom-center,.is-docked-bottom-right,.is-docked-bottom-start,.is-docked-bottom-end{align-items:flex-end}.is-docked-top-left,.is-docked-bottom-left,.is-docked-top-start,.is-docked-bottom-start{justify-content:flex-start}.is-docked-top-center,.is-docked-bottom-center{justify-content:center}.is-docked-top-right,.is-docked-bottom-right,.is-docked-top-end,.is-docked-bottom-end{justify-content:flex-end}.is-docked-top-left.is-rtl,.is-docked-top-right.is-rtl,.is-docked-bottom-left.is-rtl,.is-docked-bottom-right.is-rtl{flex-direction:row-reverse}.is-docked-top-left .main-container,.is-docked-top-right .main-container,.is-docked-bottom-left .main-container,.is-docked-bottom-right .main-container,.is-docked-top-start .main-container,.is-docked-top-end .main-container,.is-docked-bottom-start .main-container,.is-docked-bottom-end .main-container{max-height:80%}.is-docked-top-center .main-container,.is-docked-bottom-center .main-container{max-height:40%}@media(prefers-reduced-motion){.aligned-top-center,.aligned-top-left,.aligned-top-right,.aligned-bottom-center,.aligned-bottom-left,.aligned-bottom-right{animation:none}}@media(prefers-reduced-motion){.is-docked{animation:none}}@keyframes docking-animation{0%{opacity:0}25%{opacity:0}to{opacity:1}}@keyframes popup-intro-animation-down{0%{transform:translateY(calc(var(--calcite-spacing-xs) * -1));opacity:0}to{transform:translate(0);opacity:1}}@keyframes popup-intro-animation-up{0%{transform:translateY(var(--calcite-spacing-xs));opacity:0}to{transform:translate(0);opacity:1}}`;function w(_){return _&&Number.parseInt(_.replaceAll(/[^-\d.]/gu,""),10)||0}var j=L(V),O={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},C=class extends z{constructor(){super(...arguments),this._direction=P(),this._featuresComponent=g(),this._dockAction=new I({id:"popup-dock-action"}),this._mainContainerNode=g(),this._pointerNode=g(),this.messages=F(),this.viewModel=j(this),this._containerNode=g(),this._popupResizeObserver=new ResizeObserver(()=>this._positionContainer()),this._positionContainer=()=>{this.positionStyle=this._calculatePositionStyle()},this.screenLocation=N(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.alignment="auto",this.autoCloseEnabled=!1,this.autoDestroyDisabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.dockEnabled=!1,this.effectiveHeading=this.viewModel.effectiveHeading,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=!1,this.features=this.viewModel.features,this.goToOverride=this.viewModel.goToOverride,this.heading=this.viewModel.heading,this.headingLevel=2,this.hideActionBar=!1,this.hideCloseButton=!1,this.hideCollapseButton=!1,this.hideFeatureMenuHeading=!1,this.hideFeatureNavigation=!1,this.hideFeatureListLayerTitle=!1,this.hideHeading=!1,this.hideSpinner=!1,this.highlightDisabled=this.viewModel.highlightEnabled,this.includeDefaultActionsDisabled=this.viewModel.includeDefaultActions,this.initialDisplayMode=this.viewModel.initialDisplayMode,this.location=this.viewModel.location,this.open=this.viewModel.open,this.promises=this.viewModel.promises,this.selectedFeature=this.viewModel.selectedFeature,this.selectedFeatureIndex=this.viewModel.selectedFeatureIndex,this.state=this.viewModel.state,this.topLayerDisabled=!1,this.updateLocationEnabled=this.viewModel.updateLocationEnabled,this.view=this.viewModel.view,this.arcgisPropertyChange=$()("active","collapsed","currentAlignment","dockEnabled","effectiveHeading","featureCount","featureMenuOpen","features","promises","selectedDrillInFeature","selectedFeature","selectedFeatureComponent","selectedFeatureIndex","state","open"),this.arcgisReady=b(),this.arcgisClose=b(),this.arcgisTriggerAction=b()}static{this.properties={screenLocation:16,positionStyle:16,_featureNavigationTop:16,actions:0,active:0,alignment:1,autoCloseEnabled:5,autoDestroyDisabled:5,collapsed:5,content:1,currentAlignment:32,currentDockPosition:32,defaultPopupTemplateEnabled:5,dockEnabled:5,dockOptions:0,effectiveHeading:32,featureCount:0,featureMenuOpen:5,featureMenuTitle:1,features:0,goToOverride:0,heading:1,headingLevel:9,hideActionBar:5,hideCloseButton:5,hideCollapseButton:5,hideFeatureMenuHeading:5,hideFeatureNavigation:5,hideFeatureListLayerTitle:5,hideHeading:5,hideSpinner:5,highlightDisabled:5,includeDefaultActionsDisabled:5,initialDisplayMode:1,label:1,location:0,messageOverrides:0,open:5,promises:0,referenceElement:1,selectedDrillInFeature:32,selectedFeature:0,selectedFeatureComponent:32,selectedFeatureIndex:9,state:32,topLayerDisabled:5,updateLocationEnabled:5,view:0}}static{this.styles=R}get trackLocation(){return this.active&&!this.dockEnabled}get _featureNavigationTop(){let{currentAlignment:t,currentDockPosition:e}=this;return t==="bottom-left"||t==="bottom-center"||t==="bottom-right"||t==="bottom-start"||t==="bottom-end"||e==="top-left"||e==="top-center"||e==="top-right"||e==="top-start"||e==="top-end"}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._dockOptions||O}set dockOptions(t){let e={...O},o=this.viewModel?.view?.breakpoints,i={};o&&(i.width=o.xsmall,i.height=o.xsmall);let a={...e,...t},n={...e.breakpoint,...i},{breakpoint:s}=a;typeof s=="object"?a.breakpoint={...n,...s}:s&&(a.breakpoint=n),this._dockOptions=a}get selectedDrillInFeature(){return this._featuresComponent.value?.selectedDrillInFeature??null}get selectedFeatureComponent(){return this._featuresComponent.value?.selectedFeatureComponent??null}async handleViewClick(t){return this.viewModel.handleViewClick(t)}async clear(){return this.viewModel.clear()}async destroy(){await this.manager.destroy(),this._dockAction.destroy(),this._popupResizeObserver.disconnect()}async fetchFeatures(t,e){return await this._featuresComponent.value?.fetchFeatures(t,e)}async next(){return this.viewModel.next()}async previous(){return this.viewModel.previous()}async setFocus(){this._featuresComponent.value?.setFocus()}async triggerAction(t){return await this._featuresComponent.value?.triggerAction(t)}loaded(){this.manager.onLifecycle(()=>[p(()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled,this._direction],()=>this._handleDockIcon(),{initial:!0}),p(()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock],()=>this._handleDockEnabled(),{initial:!0}),p(()=>[this.dockOptions,this._featuresComponent.value],()=>{let{_dockAction:t,dockOptions:e}=this,o=this._featuresComponent.value?.headerActions;o?.remove(t),e.buttonEnabled&&o?.add(t)},{initial:!0}),p(()=>[this._pointerNode.value,this.alignment,this.currentAlignment,this.dockEnabled,this.dockOptions,this.screenLocation,this.viewModel?.active,this.viewModel?.location,this.viewModel?.view?.size],()=>this._positionContainer(),{initial:!0}),p(()=>this._mainContainerNode.value,t=>{this._popupResizeObserver.disconnect(),t&&this._popupResizeObserver.observe(t)},{initial:!0}),p(()=>this.viewModel?.view?.size,(t,e)=>this._updateDockEnabledForViewSize(t,e)),p(()=>this.viewModel?.view?.ready,()=>this._setDockEnabledForViewSize(this.dockOptions),{initial:!0}),p(()=>this.view?.map,t=>{this.viewModel.map=t},{initial:!0}),p(()=>this.screenLocation,(t,e)=>this._autoClose(t,e)),p(()=>[this.active,this._containerNode.value,this.dockEnabled,this.topLayerDisabled],()=>this._togglePopover(),{initial:!0})])}_togglePopover(){this._containerNode.value?.togglePopover(this.active&&!this.dockEnabled&&!this.topLayerDisabled)}_handleClose(t){t.stopPropagation(),this.arcgisClose.emit()}_autoClose(t,e){this.autoCloseEnabled&&t!=null&&e!=null&&(this.open=!1)}_handleArcgisPropertyChange(t){t.detail.name==="collapsed"&&(this.collapsed=t.target.collapsed)}_handleArcgisTriggerAction(t){t.stopPropagation(),t.detail.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled),this.arcgisTriggerAction.emit({action:t.detail.action})}_isOutsideView(t){let{popupHeight:e,popupWidth:o,screenLocation:i,side:a,view:n}=t;return Number.isNaN(o)||Number.isNaN(e)||!n||!i?!1:a==="right"&&i.x+o/2>n.width||a==="left"&&i.x-o/2<0||a==="top"&&i.y-e<0||a==="bottom"&&i.y+e>n.height}_getPointerSize(){let{_pointerNode:t}=this,e=t.value?window.getComputedStyle(t.value):null,o=w(e?.height),i=w(e?.width);return Math.hypot(o,i)}_calculateAutoAlignment(t){if(t!=="auto")return t;let{_mainContainerNode:e,_popupRect:o,viewModel:i}=this,{view:a}=i,{screenLocation:n}=this;if(n==null||!a||!o||!e.value)return"top-center";let s=window.getComputedStyle(e.value),l=w(s.maxHeight),r=w(s.height),c=this._getPointerSize(),{height:d,width:y}=o,m=y+c,f=Math.max(d,l,r)+c,S=this._isOutsideView({popupHeight:f,popupWidth:m,screenLocation:n,side:"right",view:a}),T=this._isOutsideView({popupHeight:f,popupWidth:m,screenLocation:n,side:"left",view:a}),x=this._isOutsideView({popupHeight:f,popupWidth:m,screenLocation:n,side:"top",view:a}),H=this._isOutsideView({popupHeight:f,popupWidth:m,screenLocation:n,side:"bottom",view:a});return T?x?"bottom-right":"top-right":S?x?"bottom-left":"top-left":x?H?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(t){return typeof t=="function"?t.call(this):t}_getCurrentAlignment(){return this.dockEnabled||!this.active||!this._mainContainerNode.value?null:this._calculateAutoAlignment(this._callCurrentAlignment(this.alignment))}_callDockPosition(t){return typeof t=="function"?t.call(this):t}_getDockPosition(){return this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position))}_getCurrentDockPosition(){return this.dockEnabled&&this.active?this._getDockPosition():null}_calculateAutoDockPosition(t){if(t!=="auto")return t;let e=this.viewModel?.view,o="top-end";if(!e)return o;let{breakpoints:i}=e;return i?.xsmall&&e.width<=i.xsmall?"bottom-center":o}_getDockIcon(){let t=this._getDockPosition(),{_direction:e}=this;if(this.dockEnabled)return"minimize";switch(t){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";case"top-right":case"bottom-right":return"dock-right";case"top-start":case"bottom-start":return e==="rtl"?"dock-right":"dock-left";default:return e==="rtl"?"dock-left":"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_calculateAlignmentPosition(t,e,o,i){if(t<0||e<0||!o||!i||t>o.width||e>o.height)return;let{topLayerDisabled:a}=this,n=a?t:t+o.x,s=a?e:e+o.y,{_direction:l,currentAlignment:r}=this,c=this._getPointerSize(),d=c/2;if(r==="top-left"||r==="top-start"&&l==="ltr"||r==="top-end"&&l==="rtl")return{top:s-(i.height+d),left:n-i.width-d};if(r==="top-center")return{top:s-(i.height+c),left:n-i.width/2};if(r==="top-right"||r==="top-end"&&l==="ltr"||r==="top-start"&&l==="rtl")return{top:s-(i.height+d),left:n+d};if(r==="bottom-left"||r==="bottom-start"&&l==="ltr"||r==="bottom-end"&&l==="rtl")return{top:s+d,left:n-i.width-d};if(r==="bottom-center")return{top:s+c,left:n-i.width/2};if(r==="bottom-right"||r==="bottom-end"&&l==="ltr"||r==="bottom-start"&&l==="rtl")return{top:s+d,left:n+d}}_getPositionStyleValue(t){return t!=null?`${t}px`:"auto"}_calculatePositionStyle(){if(this.dockEnabled)return;let{screenLocation:t}=this;if(t==null)return;let e=this.view?.container?.getBoundingClientRect(),o=this._mainContainerNode.value?.getBoundingClientRect();this._popupRect=o;let i=this._calculateAlignmentPosition(t.x,t.y,e,o);if(i)return`inset: ${this._getPositionStyleValue(i.top)} ${this._getPositionStyleValue(i.right)} ${this._getPositionStyleValue(i.bottom)} ${this._getPositionStyleValue(i.left)};`}_dockingThresholdCrossed(t,e,o){let[i,a]=t,[n,s]=e,{width:l=0,height:r=0}=o??{};return i<=l&&n>l||i>l&&n<=l||a<=r&&s>r||a>r&&s<=r}_updateDockEnabledForViewSize(t,e){if(!t||!e||!this.viewModel?.view?.ready)return;let{dockOptions:o}=this,i=o.breakpoint;typeof i=="object"&&this._dockingThresholdCrossed(t,e,i)&&this._setDockEnabledForViewSize(o)}_shouldDockAtCurrentViewSize(t){let e=t.breakpoint,o=this.viewModel?.view?.ui;if(!o)return!1;let{width:i,height:a}=o;if(Number.isNaN(i)||Number.isNaN(a)||typeof e!="object")return!1;let n=typeof e.width=="number"&&i<=(e.width??0),s=typeof e.height=="number"&&a<=(e.height??0);return n||s}_setDockEnabledForViewSize(t){this.viewModel?.view?.ready&&typeof t.breakpoint=="object"&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(t))}render(){let{_direction:t,dockEnabled:e,currentAlignment:o,currentDockPosition:i,positionStyle:a}=this,{active:n,view:s}=this.viewModel,l=n&&e,r=n&&!e,c=s?.widthBreakpoint,d=s?.heightBreakpoint,y={"aligned-top-center":o==="top-center","aligned-bottom-center":o==="bottom-center","aligned-top-left":o==="top-left"||o==="top-start"&&t==="ltr"||o==="top-end"&&t==="rtl","aligned-bottom-left":o==="bottom-left"||o==="bottom-start"&&t==="ltr"||o==="bottom-end"&&t==="rtl","aligned-top-right":o==="top-right"||o==="top-end"&&t==="ltr"||o==="top-start"&&t==="rtl","aligned-bottom-right":o==="bottom-right"||o==="bottom-end"&&t==="ltr"||o==="bottom-start"&&t==="rtl","is-docked":l,shadow:r,"is-rtl":this._direction==="rtl","is-docked-top-start":i==="top-start","is-docked-top-end":i==="top-end","is-docked-top-left":i==="top-left","is-docked-top-center":i==="top-center","is-docked-top-right":i==="top-right","is-docked-bottom-left":i==="bottom-left","is-docked-bottom-center":i==="bottom-center","is-docked-bottom-right":i==="bottom-right","is-docked-bottom-start":i==="bottom-start","is-docked-bottom-end":i==="bottom-end","is-xl-width-breakpoint":c==="xlarge","is-lg-width-breakpoint":c==="large","is-md-width-breakpoint":c==="medium","is-sm-width-breakpoint":c==="small","is-xs-width-breakpoint":c==="xsmall","is-xl-height-breakpoint":d==="xlarge","is-lg-height-breakpoint":d==="large","is-md-height-breakpoint":d==="medium","is-sm-height-breakpoint":d==="small","is-xs-height-breakpoint":d==="xsmall"};return h`<div style=${D(a)} class=${v(k("root",y,{hidden:!n||!a&&!e}))} .ariaHidden=${!n} .ariaLabel=${B(this.heading??"")} role=dialog popover=manual ${u(this._containerNode)}>${this._renderMainContainer()}${this._renderPointer()}</div>`}_renderPointer(){return!this.dockEnabled||!this.active?h`<div class="pointer" role=presentation><div class=${v(k("pointer-direction","shadow"))} ${u(this._pointerNode)}></div></div>`:null}_renderMainContainer(){let t={shadow:this.dockEnabled};return h`<div class=${v(k("main-container",t))} ${u(this._mainContainerNode)}>${E(this.viewModel,h`<arcgis-features-next .collapsed=${this.collapsed} .autoDestroyDisabled=${this.autoDestroyDisabled} .featureNavigationTop=${this._featureNavigationTop} .headingLevel=${this.headingLevel} .hidden=${!this.active} .hideActionBar=${this.hideActionBar} .hideCloseButton=${this.hideCloseButton} .hideFeatureListLayerTitle=${this.hideFeatureListLayerTitle} .hideFeatureMenuHeading=${this.hideFeatureMenuHeading} .hideFeatureNavigation=${this.hideFeatureNavigation} .hideHeading=${this.hideHeading} .hideSpinner=${this.hideSpinner} @arcgisPropertyChange=${this._handleArcgisPropertyChange} @arcgisTriggerAction=${this._handleArcgisTriggerAction} @arcgisClose=${this._handleClose} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .referenceElement=${this.referenceElement} .responsiveActionsEnabled=${!0} .showCollapseButton=${!this.hideCollapseButton} .viewModel=${this.viewModel} ${u(this._featuresComponent)}><slot name=actions-start slot=actions-start></slot><slot name=actions-end slot=actions-end></slot></arcgis-features-next>`)}</div>`}};A("arcgis-popup",C);return C},"popup/Features","applications/Components/stringUtils","core/reactiveUtils","support/actions/ActionButton",a,c,d,e,f,i)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import j from"./YGYGCNWI.js";import{a as P}from"./CFHNK7GX.js";import i from"./ZDOE5UWP.js";import"./PC4PAQXQ.js";import g from"./ZOPB777S.js";import{a as C}from"./TNDRCMN3.js";import{a as u}from"./54VXNFQ4.js";import e from"./V2RXBLNO.js";import c from"./OCLLMQGL.js";import{h as M}from"./CIFVM6AU.js";import"./EPO62377.js";import a from"./FKLH5Y2K.js";import{d as _}from"./TGNR3DAP.js";import{M as v,N as b,O as w,P as d,R as y,U as E,a as f,b as p,x as h}from"./MTKZBIHD.js";import"./3TTFCHAA.js";export default $arcgis.t(([{watch:$},{property:c,subclass:G},D,{onLocaleChange:z},B,I,,,,T,{d:O},{a:S,b:L}])=>{var k=f`.arcgis-button{--calcite-icon-color: var(--calcite-color-text-3);--calcite-button-background-color: var(--calcite-color-foreground-1);color:var(--calcite-color-text-3);line-height:var(--calcite-font-line-height-relative-tight);calcite-button{--calcite-offset-invert-focus: 1}display:flex;flex-flow:column;cursor:pointer;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);:hover{--calcite-icon-color: var(--calcite-color-text-1);--calcite-button-background-color: var(--calcite-color-transparent-hover)}}:host{width:fit-content;height:fit-content}`,A=Object.defineProperty,R=Object.getOwnPropertyDescriptor,s=(e,t,i,a)=>{for(var o=a>1?void 0:a?R(t,i):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(o=(a?n(t,i,o):n(o))||o);return a&&o&&A(t,i,o),o},U=new I({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}"})._internalSetClassName("esri-icon-trash");function j(e){return new B({title:e.currentLocation,fieldInfos:[{fieldName:"timestamp",label:e.timestamp,format:{dateFormat:"short-date-short-time"}},{fieldName:"latitude",label:e.latitude,format:{places:4,digitSeparator:!0}},{fieldName:"longitude",label:e.longitude,format:{places:4,digitSeparator:!0}},{fieldName:"accuracy",label:e.accuracy,format:{places:0,digitSeparator:!0}},{fieldName:"altitude",label:e.altitude,format:{places:0,digitSeparator:!0}},{fieldName:"altitudeAccuracy",label:e.altitudeAccuracy,format:{places:0,digitSeparator:!0}},{fieldName:"heading",label:e.heading,format:{places:0,digitSeparator:!0}},{fieldName:"speed",label:e.speed,format:{places:0,digitSeparator:!0}}],actions:[U.clone()],content:[{type:"fields"}]})}var r=class extends L{constructor(e){super(e),this._getCurrentPosition=S,this.popupEnabled=!0,this.locate=this.locate.bind(this)}initialize(){this.addHandles([z(()=>{let{graphic:e,view:t}=this;e&&t?.graphics?.includes(e)&&this._updatePopupTemplate(e)})])}destroy(){this.cancelLocate()}get state(){return this._geolocationUsable?this.view?.ready?this._locateController?"locating":this.error!=null?"error":"ready":"disabled":"feature-unsupported"}async locate(){if(this.cancelLocate(),this.state==="disabled")throw new D("locate:disabled-state","Cannot locate when disabled.");if(this.state==="feature-unsupported")throw new D("locate:feature-unsupported-state","Cannot locate in unsecure domain.");let e=new AbortController;this._locateController=e,this.error=void 0;try{let t=await this._getCurrentPosition(this.geolocationOptions);if(await this.updatePosition(t,e),this._locateController!==e)return null;let{graphic:i}=this;return i&&this._updatePopupTemplate(i),this._addGraphic(),this.currentPosition=t,this._locateController=void 0,t}catch(t){if(O(t))return null;throw e===this._locateController&&(this._locateController=void 0),this.error=t,t}}cancelLocate(){this._clearGraphic(),this._locateController&&this._locateController.abort(),this._locateController=void 0}_updatePopupTemplate(e){if(!this.popupEnabled)return;let t=j(this.messages),i=e!==this.graphic;this.destroyed||i||(e.popupTemplate=t)}};s([c()],r.prototype,"_locateController",2);s([c()],r.prototype,"currentPosition",2);s([c()],r.prototype,"error",2);s([c()],r.prototype,"messages",2);s([c()],r.prototype,"popupEnabled",2);s([c({readOnly:!0})],r.prototype,"state",1);r=s([G("map-components.locate.LocateViewModel")],r);var N="gps-off",V=T(r),m=class extends w{constructor(){super(),this.locateButtonElement=v(),this.messages=C(),this.viewModel=V(this),this.hideErrorTooltip=()=>{this.isErrorTooltipOpen=!1},this.isErrorTooltipOpen=!1,this.view=this.viewModel.view,this.autoDestroyDisabled=!1,this.geolocationOptions=this.viewModel.geolocationOptions,this.goToLocationDisabled=this.viewModel.goToLocationEnabled,this.goToOverride=this.viewModel.goToOverride,this.graphic=this.viewModel.graphic,this.icon=N,this.popupDisabled=this.viewModel.popupEnabled,this.scale=this.viewModel.scale,this.state=this.viewModel.state,this.visualScale="m",this.arcgisError=h(),this.arcgisPropertyChange=M()("state"),this.arcgisReady=h(),this.arcgisSuccess=h(),this.listenOn(document,"click",this.hideErrorTooltip)}static{this.properties={isErrorTooltipOpen:16,view:0,autoDestroyDisabled:5,geolocationOptions:0,goToLocationDisabled:7,goToOverride:0,graphic:0,icon:1,label:1,messageOverrides:0,popupDisabled:5,referenceElement:1,scale:9,state:32,visualScale:1}}static{this.styles=k}async cancelLocate(){this.viewModel.cancelLocate()}async destroy(){await this.manager.destroy()}async locate(){return await this.viewModel.locate()}loaded(){this.viewModel.messages={...this.messages,...this.messageOverrides},this.manager.onLifecycle(()=>[$(()=>this.viewModel.error,t=>{this.isErrorTooltipOpen=!!t,this.arcgisError.emit({error:t})}),$(()=>this.viewModel.currentPosition,t=>{this.arcgisSuccess.emit({position:t})})])}_localizeError(t){if(t instanceof GeolocationPositionError)return t.code===GeolocationPositionError.PERMISSION_DENIED?this.messages?.permissionError:t.code===GeolocationPositionError.TIMEOUT?this.messages?.timeoutError:this.messages?.positionUnavailable;if(t instanceof Error)return t.message}_locate(){let{viewModel:t}=this;t.state==="locating"?t.cancelLocate():t.locate().catch(()=>{})}render(){let{viewModel:t,icon:i}=this,{state:a}=t,o=a==="locating",l=o?this.messages.cancel:this.messages.title,n=a==="feature-unsupported",x=P===void 0?N:void 0,g=this._localizeError(this.viewModel?.error);return p`<div class=${d(_("root",u.arcgisButton))}>${!n&&p`<calcite-button class=${d(u.widgetButton)} .disabled=${a==="disabled"} .loading=${o} .iconStart=${o?void 0:i??x} kind=neutral .label=${l} @click=${this._locate} .scale=${this.visualScale} title=${l??y} ${b(this.locateButtonElement)}></calcite-button>`||""}${g?p`<calcite-tooltip .open=${this.isErrorTooltipOpen} overlay-positioning=fixed .referenceElement=${this.locateButtonElement.value}>${g}</calcite-tooltip>`:null}</div>`}};E("arcgis-locate",m);return m},"core/reactiveUtils","core/accessorSupport/decorators","core/Error","intl","PopupTemplate","support/actions/ActionButton",a,c,e,g,i,j)
2
+ import{a as P}from"./CFHNK7GX.js";import j from"./YGYGCNWI.js";import i from"./ZDOE5UWP.js";import"./PC4PAQXQ.js";import g from"./ZOPB777S.js";import{a as C}from"./TNDRCMN3.js";import{a as u}from"./54VXNFQ4.js";import e from"./V2RXBLNO.js";import c from"./OCLLMQGL.js";import{h as M}from"./CIFVM6AU.js";import"./EPO62377.js";import a from"./FKLH5Y2K.js";import{d as _}from"./TGNR3DAP.js";import{M as v,N as b,O as w,P as d,R as y,U as E,a as f,b as p,x as h}from"./MTKZBIHD.js";import"./3TTFCHAA.js";export default $arcgis.t(([{watch:$},{property:c,subclass:G},D,{onLocaleChange:z},B,I,,,,T,{d:O},{a:S,b:L}])=>{var k=f`.arcgis-button{--calcite-icon-color: var(--calcite-color-text-3);--calcite-button-background-color: var(--calcite-color-foreground-1);color:var(--calcite-color-text-3);line-height:var(--calcite-font-line-height-relative-tight);calcite-button{--calcite-offset-invert-focus: 1}display:flex;flex-flow:column;cursor:pointer;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);:hover{--calcite-icon-color: var(--calcite-color-text-1);--calcite-button-background-color: var(--calcite-color-transparent-hover)}}:host{width:fit-content;height:fit-content}`,A=Object.defineProperty,R=Object.getOwnPropertyDescriptor,s=(e,t,i,a)=>{for(var o=a>1?void 0:a?R(t,i):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(o=(a?n(t,i,o):n(o))||o);return a&&o&&A(t,i,o),o},U=new I({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}"})._internalSetClassName("esri-icon-trash");function j(e){return new B({title:e.currentLocation,fieldInfos:[{fieldName:"timestamp",label:e.timestamp,format:{dateFormat:"short-date-short-time"}},{fieldName:"latitude",label:e.latitude,format:{places:4,digitSeparator:!0}},{fieldName:"longitude",label:e.longitude,format:{places:4,digitSeparator:!0}},{fieldName:"accuracy",label:e.accuracy,format:{places:0,digitSeparator:!0}},{fieldName:"altitude",label:e.altitude,format:{places:0,digitSeparator:!0}},{fieldName:"altitudeAccuracy",label:e.altitudeAccuracy,format:{places:0,digitSeparator:!0}},{fieldName:"heading",label:e.heading,format:{places:0,digitSeparator:!0}},{fieldName:"speed",label:e.speed,format:{places:0,digitSeparator:!0}}],actions:[U.clone()],content:[{type:"fields"}]})}var r=class extends L{constructor(e){super(e),this._getCurrentPosition=S,this.popupEnabled=!0,this.locate=this.locate.bind(this)}initialize(){this.addHandles([z(()=>{let{graphic:e,view:t}=this;e&&t?.graphics?.includes(e)&&this._updatePopupTemplate(e)})])}destroy(){this.cancelLocate()}get state(){return this._geolocationUsable?this.view?.ready?this._locateController?"locating":this.error!=null?"error":"ready":"disabled":"feature-unsupported"}async locate(){if(this.cancelLocate(),this.state==="disabled")throw new D("locate:disabled-state","Cannot locate when disabled.");if(this.state==="feature-unsupported")throw new D("locate:feature-unsupported-state","Cannot locate in unsecure domain.");let e=new AbortController;this._locateController=e,this.error=void 0;try{let t=await this._getCurrentPosition(this.geolocationOptions);if(await this.updatePosition(t,e),this._locateController!==e)return null;let{graphic:i}=this;return i&&this._updatePopupTemplate(i),this._addGraphic(),this.currentPosition=t,this._locateController=void 0,t}catch(t){if(O(t))return null;throw e===this._locateController&&(this._locateController=void 0),this.error=t,t}}cancelLocate(){this._clearGraphic(),this._locateController&&this._locateController.abort(),this._locateController=void 0}_updatePopupTemplate(e){if(!this.popupEnabled)return;let t=j(this.messages),i=e!==this.graphic;this.destroyed||i||(e.popupTemplate=t)}};s([c()],r.prototype,"_locateController",2);s([c()],r.prototype,"currentPosition",2);s([c()],r.prototype,"error",2);s([c()],r.prototype,"messages",2);s([c()],r.prototype,"popupEnabled",2);s([c({readOnly:!0})],r.prototype,"state",1);r=s([G("map-components.locate.LocateViewModel")],r);var N="gps-off",V=T(r),m=class extends w{constructor(){super(),this.locateButtonElement=v(),this.messages=C(),this.viewModel=V(this),this.hideErrorTooltip=()=>{this.isErrorTooltipOpen=!1},this.isErrorTooltipOpen=!1,this.view=this.viewModel.view,this.autoDestroyDisabled=!1,this.geolocationOptions=this.viewModel.geolocationOptions,this.goToLocationDisabled=this.viewModel.goToLocationEnabled,this.goToOverride=this.viewModel.goToOverride,this.graphic=this.viewModel.graphic,this.icon=N,this.popupDisabled=this.viewModel.popupEnabled,this.scale=this.viewModel.scale,this.state=this.viewModel.state,this.visualScale="m",this.arcgisError=h(),this.arcgisPropertyChange=M()("state"),this.arcgisReady=h(),this.arcgisSuccess=h(),this.listenOn(document,"click",this.hideErrorTooltip)}static{this.properties={isErrorTooltipOpen:16,view:0,autoDestroyDisabled:5,geolocationOptions:0,goToLocationDisabled:7,goToOverride:0,graphic:0,icon:1,label:1,messageOverrides:0,popupDisabled:5,referenceElement:1,scale:9,state:32,visualScale:1}}static{this.styles=k}async cancelLocate(){this.viewModel.cancelLocate()}async destroy(){await this.manager.destroy()}async locate(){return await this.viewModel.locate()}loaded(){this.viewModel.messages={...this.messages,...this.messageOverrides},this.manager.onLifecycle(()=>[$(()=>this.viewModel.error,t=>{this.isErrorTooltipOpen=!!t,this.arcgisError.emit({error:t})}),$(()=>this.viewModel.currentPosition,t=>{this.arcgisSuccess.emit({position:t})})])}_localizeError(t){if(t instanceof GeolocationPositionError)return t.code===GeolocationPositionError.PERMISSION_DENIED?this.messages?.permissionError:t.code===GeolocationPositionError.TIMEOUT?this.messages?.timeoutError:this.messages?.positionUnavailable;if(t instanceof Error)return t.message}_locate(){let{viewModel:t}=this;t.state==="locating"?t.cancelLocate():t.locate().catch(()=>{})}render(){let{viewModel:t,icon:i}=this,{state:a}=t,o=a==="locating",l=o?this.messages.cancel:this.messages.title,n=a==="feature-unsupported",x=P===void 0?N:void 0,g=this._localizeError(this.viewModel?.error);return p`<div class=${d(_("root",u.arcgisButton))}>${!n&&p`<calcite-button class=${d(u.widgetButton)} .disabled=${a==="disabled"} .loading=${o} .iconStart=${o?void 0:i??x} kind=neutral .label=${l} @click=${this._locate} .scale=${this.visualScale} title=${l??y} ${b(this.locateButtonElement)}></calcite-button>`||""}${g?p`<calcite-tooltip .open=${this.isErrorTooltipOpen} overlay-positioning=fixed .referenceElement=${this.locateButtonElement.value}>${g}</calcite-tooltip>`:null}</div>`}};E("arcgis-locate",m);return m},"core/reactiveUtils","core/accessorSupport/decorators","core/Error","intl","PopupTemplate","support/actions/ActionButton",a,c,e,g,i,j)