@arcgis/ai-components 5.1.0-next.7 → 5.1.0-next.70

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 (369) hide show
  1. package/dist/cdn/24MYCR6F.js +3 -0
  2. package/dist/cdn/276ERLGQ.js +2 -0
  3. package/dist/cdn/2MLMI2OK.js +2 -0
  4. package/dist/cdn/3D2FSGMT.js +75 -0
  5. package/dist/cdn/3M7XAZRH.js +2 -0
  6. package/dist/cdn/{ZYQ6U2YH.js → 5PT7ZFXF.js} +46 -6
  7. package/dist/cdn/7CRP5WU6.js +2 -0
  8. package/dist/cdn/{LTBEINKG.js → ABCHVJTB.js} +13 -1
  9. package/dist/cdn/B4DEC7PH.js +2 -0
  10. package/dist/cdn/B66A2V6H.js +2 -0
  11. package/dist/cdn/BUO7QQDY.js +2 -0
  12. package/dist/cdn/C5BYUKXO.js +72 -0
  13. package/dist/cdn/DR56NDCW.js +2 -0
  14. package/dist/cdn/{62K6RJZZ.js → ESTSYVJP.js} +15 -2
  15. package/dist/cdn/FEBQMS6F.js +2 -0
  16. package/dist/cdn/GY6V3KIF.js +2 -0
  17. package/dist/cdn/IHZ6MKIF.js +2 -0
  18. package/dist/cdn/IR3YHQ5A.js +225 -0
  19. package/dist/cdn/JG7SOQYZ.js +2 -0
  20. package/dist/cdn/{UY4FI7AP.js → KADK7ZYA.js} +1 -1
  21. package/dist/cdn/KVH3PDVW.js +2 -0
  22. package/dist/cdn/KWBMH7LU.js +61 -0
  23. package/dist/cdn/L7YTPHKQ.js +349 -0
  24. package/dist/cdn/MZBTKGRF.js +2 -0
  25. package/dist/cdn/MZJGADGH.js +122 -0
  26. package/dist/cdn/OLR6WPCR.js +2 -0
  27. package/dist/cdn/OQNCJHHX.js +2 -0
  28. package/dist/cdn/RFTAJAJW.js +2 -0
  29. package/dist/cdn/RMM7LKZF.js +3 -0
  30. package/dist/cdn/SGGBOB5K.js +4 -0
  31. package/dist/cdn/SN2JIWIP.js +2 -0
  32. package/dist/cdn/TD3EJQQF.js +2 -0
  33. package/dist/cdn/WH52UBDS.js +2 -0
  34. package/dist/cdn/WPWVMXUE.js +2 -0
  35. package/dist/cdn/Y4YK5Q2F.js +2 -0
  36. package/dist/cdn/{WBSNYWJJ.js → YGW7TUNX.js} +1 -1
  37. package/dist/cdn/ZDEYVBH7.js +44 -0
  38. package/dist/cdn/assets/assistant/t9n/messages.ar.json +1 -1
  39. package/dist/cdn/assets/assistant/t9n/messages.bg.json +1 -1
  40. package/dist/cdn/assets/assistant/t9n/messages.bs.json +1 -1
  41. package/dist/cdn/assets/assistant/t9n/messages.ca.json +1 -1
  42. package/dist/cdn/assets/assistant/t9n/messages.cs.json +1 -1
  43. package/dist/cdn/assets/assistant/t9n/messages.da.json +1 -1
  44. package/dist/cdn/assets/assistant/t9n/messages.de.json +1 -1
  45. package/dist/cdn/assets/assistant/t9n/messages.el.json +1 -1
  46. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  47. package/dist/cdn/assets/assistant/t9n/messages.es.json +1 -1
  48. package/dist/cdn/assets/assistant/t9n/messages.et.json +1 -1
  49. package/dist/cdn/assets/assistant/t9n/messages.fi.json +1 -1
  50. package/dist/cdn/assets/assistant/t9n/messages.fr.json +1 -1
  51. package/dist/cdn/assets/assistant/t9n/messages.he.json +1 -1
  52. package/dist/cdn/assets/assistant/t9n/messages.hr.json +1 -1
  53. package/dist/cdn/assets/assistant/t9n/messages.hu.json +1 -1
  54. package/dist/cdn/assets/assistant/t9n/messages.id.json +1 -1
  55. package/dist/cdn/assets/assistant/t9n/messages.it.json +1 -1
  56. package/dist/cdn/assets/assistant/t9n/messages.ja.json +1 -1
  57. package/dist/cdn/assets/assistant/t9n/messages.ko.json +1 -1
  58. package/dist/cdn/assets/assistant/t9n/messages.lt.json +1 -1
  59. package/dist/cdn/assets/assistant/t9n/messages.lv.json +1 -1
  60. package/dist/cdn/assets/assistant/t9n/messages.nl.json +1 -1
  61. package/dist/cdn/assets/assistant/t9n/messages.no.json +1 -1
  62. package/dist/cdn/assets/assistant/t9n/messages.pl.json +1 -1
  63. package/dist/cdn/assets/assistant/t9n/messages.pt-BR.json +1 -1
  64. package/dist/cdn/assets/assistant/t9n/messages.pt-PT.json +1 -1
  65. package/dist/cdn/assets/assistant/t9n/messages.ro.json +1 -1
  66. package/dist/cdn/assets/assistant/t9n/messages.ru.json +1 -1
  67. package/dist/cdn/assets/assistant/t9n/messages.sk.json +1 -1
  68. package/dist/cdn/assets/assistant/t9n/messages.sl.json +1 -1
  69. package/dist/cdn/assets/assistant/t9n/messages.sr.json +1 -1
  70. package/dist/cdn/assets/assistant/t9n/messages.sv.json +1 -1
  71. package/dist/cdn/assets/assistant/t9n/messages.th.json +1 -1
  72. package/dist/cdn/assets/assistant/t9n/messages.tr.json +1 -1
  73. package/dist/cdn/assets/assistant/t9n/messages.uk.json +1 -1
  74. package/dist/cdn/assets/assistant/t9n/messages.vi.json +1 -1
  75. package/dist/cdn/assets/assistant/t9n/messages.zh-CN.json +1 -1
  76. package/dist/cdn/assets/assistant/t9n/messages.zh-HK.json +1 -1
  77. package/dist/cdn/assets/assistant/t9n/messages.zh-TW.json +1 -1
  78. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ar.json +1 -1
  79. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.bg.json +1 -1
  80. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.bs.json +1 -1
  81. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ca.json +1 -1
  82. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.cs.json +1 -1
  83. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.da.json +1 -1
  84. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.de.json +1 -1
  85. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.el.json +1 -1
  86. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.en.json +1 -1
  87. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.es.json +1 -1
  88. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.et.json +1 -1
  89. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.fi.json +1 -1
  90. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.fr.json +1 -1
  91. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.he.json +1 -1
  92. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.hr.json +1 -1
  93. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.hu.json +1 -1
  94. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.id.json +1 -1
  95. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.it.json +1 -1
  96. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ja.json +1 -1
  97. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ko.json +1 -1
  98. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.lt.json +1 -1
  99. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.lv.json +1 -1
  100. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.nl.json +1 -1
  101. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.no.json +1 -1
  102. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.pl.json +1 -1
  103. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.pt-BR.json +1 -1
  104. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.pt-PT.json +1 -1
  105. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ro.json +1 -1
  106. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ru.json +1 -1
  107. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sk.json +1 -1
  108. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sl.json +1 -1
  109. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sr.json +1 -1
  110. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sv.json +1 -1
  111. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.th.json +1 -1
  112. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.tr.json +1 -1
  113. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.uk.json +1 -1
  114. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.vi.json +1 -1
  115. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.zh-CN.json +1 -1
  116. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.zh-HK.json +1 -1
  117. package/dist/cdn/assets/assistant-chat-entry/t9n/messages.zh-TW.json +1 -1
  118. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ar.json +1 -1
  119. package/dist/cdn/assets/assistant-interrupt/t9n/messages.bg.json +1 -1
  120. package/dist/cdn/assets/assistant-interrupt/t9n/messages.bs.json +1 -1
  121. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ca.json +1 -1
  122. package/dist/cdn/assets/assistant-interrupt/t9n/messages.cs.json +1 -1
  123. package/dist/cdn/assets/assistant-interrupt/t9n/messages.da.json +1 -1
  124. package/dist/cdn/assets/assistant-interrupt/t9n/messages.de.json +1 -1
  125. package/dist/cdn/assets/assistant-interrupt/t9n/messages.el.json +1 -1
  126. package/dist/cdn/assets/assistant-interrupt/t9n/messages.es.json +1 -1
  127. package/dist/cdn/assets/assistant-interrupt/t9n/messages.et.json +1 -1
  128. package/dist/cdn/assets/assistant-interrupt/t9n/messages.fi.json +1 -1
  129. package/dist/cdn/assets/assistant-interrupt/t9n/messages.fr.json +1 -1
  130. package/dist/cdn/assets/assistant-interrupt/t9n/messages.he.json +1 -1
  131. package/dist/cdn/assets/assistant-interrupt/t9n/messages.hr.json +1 -1
  132. package/dist/cdn/assets/assistant-interrupt/t9n/messages.hu.json +1 -1
  133. package/dist/cdn/assets/assistant-interrupt/t9n/messages.id.json +1 -1
  134. package/dist/cdn/assets/assistant-interrupt/t9n/messages.it.json +1 -1
  135. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ja.json +1 -1
  136. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ko.json +1 -1
  137. package/dist/cdn/assets/assistant-interrupt/t9n/messages.lt.json +1 -1
  138. package/dist/cdn/assets/assistant-interrupt/t9n/messages.lv.json +1 -1
  139. package/dist/cdn/assets/assistant-interrupt/t9n/messages.nl.json +1 -1
  140. package/dist/cdn/assets/assistant-interrupt/t9n/messages.no.json +1 -1
  141. package/dist/cdn/assets/assistant-interrupt/t9n/messages.pl.json +1 -1
  142. package/dist/cdn/assets/assistant-interrupt/t9n/messages.pt-BR.json +1 -1
  143. package/dist/cdn/assets/assistant-interrupt/t9n/messages.pt-PT.json +1 -1
  144. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ro.json +1 -1
  145. package/dist/cdn/assets/assistant-interrupt/t9n/messages.ru.json +1 -1
  146. package/dist/cdn/assets/assistant-interrupt/t9n/messages.sk.json +1 -1
  147. package/dist/cdn/assets/assistant-interrupt/t9n/messages.sl.json +1 -1
  148. package/dist/cdn/assets/assistant-interrupt/t9n/messages.sr.json +1 -1
  149. package/dist/cdn/assets/assistant-interrupt/t9n/messages.sv.json +1 -1
  150. package/dist/cdn/assets/assistant-interrupt/t9n/messages.th.json +1 -1
  151. package/dist/cdn/assets/assistant-interrupt/t9n/messages.tr.json +1 -1
  152. package/dist/cdn/assets/assistant-interrupt/t9n/messages.uk.json +1 -1
  153. package/dist/cdn/assets/assistant-interrupt/t9n/messages.vi.json +1 -1
  154. package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-CN.json +1 -1
  155. package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-HK.json +1 -1
  156. package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-TW.json +1 -1
  157. package/dist/cdn/assets/assistant-message-feedback/t9n/messages.en.json +1 -0
  158. package/dist/cdn/assets/assistant-message-footer/t9n/messages.en.json +1 -0
  159. package/dist/cdn/assets/assistant-message-read-aloud/t9n/messages.en.json +1 -0
  160. package/dist/cdn/assets/assistant-suggested-prompts/t9n/messages.en.json +1 -0
  161. package/dist/cdn/index.js +1 -1
  162. package/dist/cdn/main.css +1 -1
  163. package/dist/chunks/converterUtils.js +117 -0
  164. package/dist/chunks/utils.js +16 -14
  165. package/dist/chunks/utils2.js +8 -3
  166. package/dist/components/arcgis-assistant/customElement.d.ts +342 -27
  167. package/dist/components/arcgis-assistant/customElement.js +216 -147
  168. package/dist/components/arcgis-assistant/index.js +9 -2
  169. package/dist/components/arcgis-assistant/types.d.ts +136 -0
  170. package/dist/components/arcgis-assistant-agent/customElement.d.ts +22 -8
  171. package/dist/components/arcgis-assistant-agent/customElement.js +7 -7
  172. package/dist/components/arcgis-assistant-chat/customElement.d.ts +2 -9
  173. package/dist/components/arcgis-assistant-chat/customElement.js +13 -13
  174. package/dist/components/arcgis-assistant-chat/index.js +0 -1
  175. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +15 -12
  176. package/dist/components/arcgis-assistant-chat-entry/customElement.js +59 -25
  177. package/dist/components/arcgis-assistant-chat-entry/index.js +1 -2
  178. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.d.ts +73 -6
  179. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +5 -5
  180. package/dist/components/arcgis-assistant-help-agent/customElement.d.ts +73 -0
  181. package/dist/components/arcgis-assistant-help-agent/customElement.js +26 -0
  182. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +1 -1
  183. package/dist/components/arcgis-assistant-interrupt/customElement.js +8 -8
  184. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +6 -6
  185. package/dist/components/arcgis-assistant-message/customElement.d.ts +18 -0
  186. package/dist/components/arcgis-assistant-message/customElement.js +29 -0
  187. package/dist/components/arcgis-assistant-message/index.d.ts +1 -0
  188. package/dist/components/arcgis-assistant-message/index.js +4 -0
  189. package/dist/components/arcgis-assistant-message-block/customElement.d.ts +8 -0
  190. package/dist/components/arcgis-assistant-message-block/customElement.js +29 -0
  191. package/dist/components/arcgis-assistant-message-block/index.js +2 -0
  192. package/dist/components/arcgis-assistant-message-content/customElement.d.ts +12 -0
  193. package/dist/components/arcgis-assistant-message-content/customElement.js +62 -0
  194. package/dist/components/arcgis-assistant-message-content/index.js +4 -0
  195. package/dist/components/arcgis-assistant-message-feedback/customElement.d.ts +23 -0
  196. package/dist/components/arcgis-assistant-message-feedback/customElement.js +36 -0
  197. package/dist/components/arcgis-assistant-message-feedback/index.js +3 -0
  198. package/dist/components/arcgis-assistant-message-footer/customElement.d.ts +25 -0
  199. package/dist/components/arcgis-assistant-message-footer/customElement.js +62 -0
  200. package/dist/components/arcgis-assistant-message-footer/index.js +6 -0
  201. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +10 -0
  202. package/dist/components/arcgis-assistant-message-loading/customElement.js +23 -0
  203. package/dist/components/arcgis-assistant-message-loading/index.js +4 -0
  204. package/dist/components/arcgis-assistant-message-log/customElement.d.ts +11 -0
  205. package/dist/components/arcgis-assistant-message-log/customElement.js +29 -0
  206. package/dist/components/arcgis-assistant-message-log/index.d.ts +1 -0
  207. package/dist/components/arcgis-assistant-message-log/index.js +3 -0
  208. package/dist/components/arcgis-assistant-message-read-aloud/customElement.d.ts +19 -0
  209. package/dist/components/arcgis-assistant-message-read-aloud/customElement.js +104 -0
  210. package/dist/components/arcgis-assistant-message-read-aloud/index.d.ts +1 -0
  211. package/dist/components/arcgis-assistant-message-read-aloud/index.js +3 -0
  212. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +7 -0
  213. package/dist/components/arcgis-assistant-message-text/customElement.js +22 -0
  214. package/dist/components/arcgis-assistant-message-text/index.d.ts +1 -0
  215. package/dist/components/arcgis-assistant-message-text/index.js +1 -0
  216. package/dist/components/arcgis-assistant-navigation-agent/customElement.d.ts +53 -6
  217. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +5 -5
  218. package/dist/components/arcgis-assistant-speech-input/customElement.d.ts +31 -0
  219. package/dist/components/arcgis-assistant-speech-input/customElement.js +488 -0
  220. package/dist/components/arcgis-assistant-speech-input/index.d.ts +1 -0
  221. package/dist/components/arcgis-assistant-speech-input/index.js +2 -0
  222. package/dist/components/arcgis-assistant-speech-input/support/types.d.ts +20 -0
  223. package/dist/components/arcgis-assistant-suggested-prompts/customElement.d.ts +16 -0
  224. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +27 -0
  225. package/dist/components/arcgis-assistant-suggested-prompts/index.d.ts +1 -0
  226. package/dist/components/arcgis-assistant-suggested-prompts/index.js +3 -0
  227. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +10 -0
  228. package/dist/components/arcgis-assistant-user-message/customElement.js +23 -0
  229. package/dist/components/arcgis-assistant-user-message/index.d.ts +1 -0
  230. package/dist/components/arcgis-assistant-user-message/index.js +2 -0
  231. package/dist/docs/api.json +1 -1
  232. package/dist/docs/docs.json +1 -1
  233. package/dist/docs/vscode.html-custom-data.json +1 -1
  234. package/dist/docs/web-types.json +1 -1
  235. package/dist/index.d.ts +78 -22
  236. package/dist/loader.js +19 -11
  237. package/dist/types/lumina.d.ts +83 -26
  238. package/dist/types/preact.d.ts +96 -31
  239. package/dist/types/react.d.ts +109 -36
  240. package/dist/types/stencil.d.ts +83 -26
  241. package/dist/utils/index.d.ts +305 -0
  242. package/dist/utils/index.js +13 -0
  243. package/package.json +15 -8
  244. package/dist/cdn/26V7SXDR.js +0 -4
  245. package/dist/cdn/2PLHSU7P.js +0 -271
  246. package/dist/cdn/4Y73V2HU.js +0 -2
  247. package/dist/cdn/6T2EIYO4.js +0 -59
  248. package/dist/cdn/AIAY4NON.js +0 -245
  249. package/dist/cdn/CN6VFVA2.js +0 -19
  250. package/dist/cdn/GCFT45CD.js +0 -2
  251. package/dist/cdn/GN2HYJJX.js +0 -4
  252. package/dist/cdn/HN2HMAMX.js +0 -28
  253. package/dist/cdn/I22GHLAO.js +0 -2
  254. package/dist/cdn/IFSNQY7L.js +0 -2
  255. package/dist/cdn/IFWK7P7O.js +0 -2
  256. package/dist/cdn/J35M7O4J.js +0 -2
  257. package/dist/cdn/JABDBJPC.js +0 -2
  258. package/dist/cdn/KJZARHAM.js +0 -2
  259. package/dist/cdn/M672SFG6.js +0 -2
  260. package/dist/cdn/M7XUI5KY.js +0 -77
  261. package/dist/cdn/NKNUZCLA.js +0 -17
  262. package/dist/cdn/Q674OE2M.js +0 -2
  263. package/dist/cdn/SOWNHB7F.js +0 -30
  264. package/dist/cdn/VUHDKXFM.js +0 -2
  265. package/dist/cdn/X7WF7TCS.js +0 -2
  266. package/dist/cdn/XGVAPO3I.js +0 -2
  267. package/dist/cdn/XVUE27HC.js +0 -2
  268. package/dist/cdn/Y7UZYXEV.js +0 -2
  269. package/dist/cdn/ZF7JAW4Z.js +0 -2
  270. package/dist/cdn/assets/assistant-chat-card/t9n/messages.ar.json +0 -1
  271. package/dist/cdn/assets/assistant-chat-card/t9n/messages.bg.json +0 -1
  272. package/dist/cdn/assets/assistant-chat-card/t9n/messages.bs.json +0 -1
  273. package/dist/cdn/assets/assistant-chat-card/t9n/messages.ca.json +0 -1
  274. package/dist/cdn/assets/assistant-chat-card/t9n/messages.cs.json +0 -1
  275. package/dist/cdn/assets/assistant-chat-card/t9n/messages.da.json +0 -1
  276. package/dist/cdn/assets/assistant-chat-card/t9n/messages.de.json +0 -1
  277. package/dist/cdn/assets/assistant-chat-card/t9n/messages.el.json +0 -1
  278. package/dist/cdn/assets/assistant-chat-card/t9n/messages.en.json +0 -1
  279. package/dist/cdn/assets/assistant-chat-card/t9n/messages.es.json +0 -1
  280. package/dist/cdn/assets/assistant-chat-card/t9n/messages.et.json +0 -1
  281. package/dist/cdn/assets/assistant-chat-card/t9n/messages.fi.json +0 -1
  282. package/dist/cdn/assets/assistant-chat-card/t9n/messages.fr.json +0 -1
  283. package/dist/cdn/assets/assistant-chat-card/t9n/messages.he.json +0 -1
  284. package/dist/cdn/assets/assistant-chat-card/t9n/messages.hr.json +0 -1
  285. package/dist/cdn/assets/assistant-chat-card/t9n/messages.hu.json +0 -1
  286. package/dist/cdn/assets/assistant-chat-card/t9n/messages.id.json +0 -1
  287. package/dist/cdn/assets/assistant-chat-card/t9n/messages.it.json +0 -1
  288. package/dist/cdn/assets/assistant-chat-card/t9n/messages.ja.json +0 -1
  289. package/dist/cdn/assets/assistant-chat-card/t9n/messages.ko.json +0 -1
  290. package/dist/cdn/assets/assistant-chat-card/t9n/messages.lt.json +0 -1
  291. package/dist/cdn/assets/assistant-chat-card/t9n/messages.lv.json +0 -1
  292. package/dist/cdn/assets/assistant-chat-card/t9n/messages.nl.json +0 -1
  293. package/dist/cdn/assets/assistant-chat-card/t9n/messages.no.json +0 -1
  294. package/dist/cdn/assets/assistant-chat-card/t9n/messages.pl.json +0 -1
  295. package/dist/cdn/assets/assistant-chat-card/t9n/messages.pt-BR.json +0 -1
  296. package/dist/cdn/assets/assistant-chat-card/t9n/messages.pt-PT.json +0 -1
  297. package/dist/cdn/assets/assistant-chat-card/t9n/messages.ro.json +0 -1
  298. package/dist/cdn/assets/assistant-chat-card/t9n/messages.ru.json +0 -1
  299. package/dist/cdn/assets/assistant-chat-card/t9n/messages.sk.json +0 -1
  300. package/dist/cdn/assets/assistant-chat-card/t9n/messages.sl.json +0 -1
  301. package/dist/cdn/assets/assistant-chat-card/t9n/messages.sr.json +0 -1
  302. package/dist/cdn/assets/assistant-chat-card/t9n/messages.sv.json +0 -1
  303. package/dist/cdn/assets/assistant-chat-card/t9n/messages.th.json +0 -1
  304. package/dist/cdn/assets/assistant-chat-card/t9n/messages.tr.json +0 -1
  305. package/dist/cdn/assets/assistant-chat-card/t9n/messages.uk.json +0 -1
  306. package/dist/cdn/assets/assistant-chat-card/t9n/messages.vi.json +0 -1
  307. package/dist/cdn/assets/assistant-chat-card/t9n/messages.zh-CN.json +0 -1
  308. package/dist/cdn/assets/assistant-chat-card/t9n/messages.zh-HK.json +0 -1
  309. package/dist/cdn/assets/assistant-chat-card/t9n/messages.zh-TW.json +0 -1
  310. package/dist/cdn/assets/assistant-shell/t9n/messages.ar.json +0 -1
  311. package/dist/cdn/assets/assistant-shell/t9n/messages.bg.json +0 -1
  312. package/dist/cdn/assets/assistant-shell/t9n/messages.bs.json +0 -1
  313. package/dist/cdn/assets/assistant-shell/t9n/messages.ca.json +0 -1
  314. package/dist/cdn/assets/assistant-shell/t9n/messages.cs.json +0 -1
  315. package/dist/cdn/assets/assistant-shell/t9n/messages.da.json +0 -1
  316. package/dist/cdn/assets/assistant-shell/t9n/messages.de.json +0 -1
  317. package/dist/cdn/assets/assistant-shell/t9n/messages.el.json +0 -1
  318. package/dist/cdn/assets/assistant-shell/t9n/messages.en.json +0 -1
  319. package/dist/cdn/assets/assistant-shell/t9n/messages.es.json +0 -1
  320. package/dist/cdn/assets/assistant-shell/t9n/messages.et.json +0 -1
  321. package/dist/cdn/assets/assistant-shell/t9n/messages.fi.json +0 -1
  322. package/dist/cdn/assets/assistant-shell/t9n/messages.fr.json +0 -1
  323. package/dist/cdn/assets/assistant-shell/t9n/messages.he.json +0 -1
  324. package/dist/cdn/assets/assistant-shell/t9n/messages.hr.json +0 -1
  325. package/dist/cdn/assets/assistant-shell/t9n/messages.hu.json +0 -1
  326. package/dist/cdn/assets/assistant-shell/t9n/messages.id.json +0 -1
  327. package/dist/cdn/assets/assistant-shell/t9n/messages.it.json +0 -1
  328. package/dist/cdn/assets/assistant-shell/t9n/messages.ja.json +0 -1
  329. package/dist/cdn/assets/assistant-shell/t9n/messages.ko.json +0 -1
  330. package/dist/cdn/assets/assistant-shell/t9n/messages.lt.json +0 -1
  331. package/dist/cdn/assets/assistant-shell/t9n/messages.lv.json +0 -1
  332. package/dist/cdn/assets/assistant-shell/t9n/messages.nl.json +0 -1
  333. package/dist/cdn/assets/assistant-shell/t9n/messages.no.json +0 -1
  334. package/dist/cdn/assets/assistant-shell/t9n/messages.pl.json +0 -1
  335. package/dist/cdn/assets/assistant-shell/t9n/messages.pt-BR.json +0 -1
  336. package/dist/cdn/assets/assistant-shell/t9n/messages.pt-PT.json +0 -1
  337. package/dist/cdn/assets/assistant-shell/t9n/messages.ro.json +0 -1
  338. package/dist/cdn/assets/assistant-shell/t9n/messages.ru.json +0 -1
  339. package/dist/cdn/assets/assistant-shell/t9n/messages.sk.json +0 -1
  340. package/dist/cdn/assets/assistant-shell/t9n/messages.sl.json +0 -1
  341. package/dist/cdn/assets/assistant-shell/t9n/messages.sr.json +0 -1
  342. package/dist/cdn/assets/assistant-shell/t9n/messages.sv.json +0 -1
  343. package/dist/cdn/assets/assistant-shell/t9n/messages.th.json +0 -1
  344. package/dist/cdn/assets/assistant-shell/t9n/messages.tr.json +0 -1
  345. package/dist/cdn/assets/assistant-shell/t9n/messages.uk.json +0 -1
  346. package/dist/cdn/assets/assistant-shell/t9n/messages.vi.json +0 -1
  347. package/dist/cdn/assets/assistant-shell/t9n/messages.zh-CN.json +0 -1
  348. package/dist/cdn/assets/assistant-shell/t9n/messages.zh-HK.json +0 -1
  349. package/dist/cdn/assets/assistant-shell/t9n/messages.zh-TW.json +0 -1
  350. package/dist/components/arcgis-assistant-chat-card/customElement.d.ts +0 -32
  351. package/dist/components/arcgis-assistant-chat-card/customElement.js +0 -53
  352. package/dist/components/arcgis-assistant-chat-card/index.js +0 -6
  353. package/dist/components/arcgis-assistant-chat-card-content/customElement.d.ts +0 -12
  354. package/dist/components/arcgis-assistant-chat-card-content/customElement.js +0 -40
  355. package/dist/components/arcgis-assistant-chat-card-content/index.js +0 -2
  356. package/dist/components/arcgis-assistant-layer-filter-agent/customElement.d.ts +0 -8
  357. package/dist/components/arcgis-assistant-layer-filter-agent/customElement.js +0 -26
  358. package/dist/components/arcgis-assistant-layer-query-agent/customElement.d.ts +0 -8
  359. package/dist/components/arcgis-assistant-layer-query-agent/customElement.js +0 -26
  360. package/dist/components/arcgis-assistant-shell/customElement.d.ts +0 -37
  361. package/dist/components/arcgis-assistant-shell/customElement.js +0 -27
  362. package/dist/components/arcgis-assistant-shell/index.js +0 -6
  363. /package/dist/components/{arcgis-assistant-chat-card-content → arcgis-assistant-help-agent}/index.d.ts +0 -0
  364. /package/dist/components/{arcgis-assistant-layer-filter-agent → arcgis-assistant-help-agent}/index.js +0 -0
  365. /package/dist/components/{arcgis-assistant-chat-card → arcgis-assistant-message-block}/index.d.ts +0 -0
  366. /package/dist/components/{arcgis-assistant-layer-filter-agent → arcgis-assistant-message-content}/index.d.ts +0 -0
  367. /package/dist/components/{arcgis-assistant-layer-query-agent → arcgis-assistant-message-feedback}/index.d.ts +0 -0
  368. /package/dist/components/{arcgis-assistant-shell → arcgis-assistant-message-footer}/index.d.ts +0 -0
  369. /package/dist/components/{arcgis-assistant-layer-query-agent/index.js → arcgis-assistant-message-loading/index.d.ts} +0 -0
@@ -0,0 +1,225 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import a from"./L7YTPHKQ.js";export default $arcgis.t(([lt,ge,Pe,ct,{addressToLocations:dt},O,de,ut,Ge,Be,{formatDateOnly:mt,convertDateFormatToIntlOptions:H,formatTimeOnly:ht,formatDate:Re},Qe,Ue,pt,ft,{createRenderer:gt},{getSchemesByTag:yt,getSchemes:wt},{getBackgroundColorTheme:qe},{createAgeRenderer:bt,createContinuousRenderer:xt},{getSchemesByTag:ye},{createContinuousRenderer:vt},{createRenderer:Et},{getSchemesByTag:St},{createRenderer:Tt},{getSchemesByTag:kt},{createRenderer:It},{getSchemesByTag:Ct},{createRenderer:_t},{getSchemesByTag:$t},{createAgeRenderer:Nt,createContinuousRenderer:Ft},{createRenderer:At},{getSchemesByTag:Rt},We,Le,Me,{executeQueryStreaming:qt},Lt,{a:A,b:T,c:Te,d:W,e:K,f:ke,g:Ie,h:V,i:le,j:Z,k:P,l:N,m:w,n:g,o:Ce,p:_e,q:R,r:i,s:p,t:I,u:$e,v:Ne,w:j}])=>{var Ae=e=>Array.isArray(e)&&e.every(V),ot=e=>typeof e=="object"&&e!=null&&"messages"in e&&Ae(e.messages),nt=e=>typeof e=="object"&&e!=null&&"lg_tool_call"in e,q=class extends Ce{tools;handleToolErrors=!0;trace=!1;constructor(e,t){let{name:r,tags:a,handleToolErrors:o}=t??{};super({name:r,tags:a,func:(n,s)=>this.run(n,s)}),this.tools=e,this.handleToolErrors=o??this.handleToolErrors}async runTool(e,t){let r=this.tools.find(a=>a.name===e.name);try{if(r===void 0)throw new Error(`Tool "${e.name}" not found.`);let a=await r.invoke({...e,type:"tool_call"},t);return V(a)&&a.getType()==="tool"||K(a)?a:new le({status:"success",name:r.name,content:typeof a=="string"?a:JSON.stringify(a),tool_call_id:e.id})}catch(a){if(!this.handleToolErrors||Ie(a))throw a;return new le({status:"error",content:`Error: ${a.message}
3
+ Please fix your mistakes.`,name:e.name,tool_call_id:e.id??""})}}async run(e,t){let r;if(nt(e))r=[await this.runTool(e.lg_tool_call,t)];else{let n;if(Ae(e))n=e;else if(ot(e))n=e.messages;else throw new Error("ToolNode only accepts BaseMessage[] or { messages: BaseMessage[] } as input.");let s=new Set(n.filter(c=>c.getType()==="tool").map(c=>c.tool_call_id)),l;for(let c=n.length-1;c>=0;c-=1){let d=n[c];if(P(d)){l=d;break}}if(l==null||!P(l))throw new Error("ToolNode only accepts AIMessages as input.");r=await Promise.all(l.tool_calls?.filter(c=>c.id==null||!s.has(c.id)).map(c=>this.runTool(c,t))??[])}if(!r.some(K))return Array.isArray(e)?r:{messages:r};let a=[],o=null;for(let n of r)K(n)?n.graph===W.PARENT&&Array.isArray(n.goto)&&n.goto.every(s=>Te(s))?o?o.goto.push(...n.goto):o=new W({graph:W.PARENT,goto:n.goto}):a.push(n):a.push(Array.isArray(e)?[n]:{messages:[n]});return o&&a.push(o),a}};var _i=g.Root({llmInputMessages:g({reducer:(e,t)=>_e([],t),default:()=>[]})});var Q=(e,t)=>({...e,...t}),U=(e="",t)=>{let r=typeof t=="string"?t.trim():"";if(!r)return e;let a=e.trim();if(!a)return r;if(a===r)return e;let o=a.split(`
4
+
5
+ `);return o[o.length-1]?.trim()===r?e:`${e}
6
+
7
+ ${r}`},D=(e,t)=>t??e,Ke=g.Root({agentExecutionContext:g({reducer:Q,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[]})}),outputMessage:g({reducer:U,default:()=>""}),summary:g({reducer:D,default:()=>""}),status:g({reducer:D,default:()=>"success"}),intent:g({reducer:(e,t)=>t}),vectorSearchLayerResults:g({reducer:(e,t)=>t,default:()=>[]}),vectorSearchFieldResults:g({reducer:(e,t)=>t})});async function Mt(e,t){let r=O.getDefault().helperServices,a=r.geocode.find(S=>S.name==="ArcGIS World Geocoding Service")??r.geocode[0];if(!a)throw new Error("No geocoding service found in helperServices.");let o=a.url,n=`${de.assetsPath?.endsWith("/")?de.assetsPath:`${de.assetsPath}/`}esri/images/search/search-symbol-32.png`,s=(await dt(o,{address:{SingleLine:e},outFields:["Match_addr"]}))?.[0];if(!s?.extent)throw new Error(`Could not find location for: ${e}`);let{xmin:l,ymin:c,xmax:d,ymax:m,spatialReference:u}=s.extent,h=new Pe({xmin:l,ymin:c,xmax:d,ymax:m,spatialReference:u}),y=(l+d)/2,E=(c+m)/2,f=new ge({x:y,y:E,spatialReference:u}),x=new ct({url:n,width:24,height:24}),b=new lt({geometry:f,symbol:x});return t.graphics.removeAll(),t.graphics.add(b),await t.goTo(h),`Successfully zoomed to: ${e}. Location coordinates: x=${y}, y=${E}, wkid=${u.wkid}`}var zt=["mapView"];function C(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("NavigationAgent context missing");let r=zt.filter(a=>!(a in t));if(r.length)throw new Error(`NavigationAgent context missing: ${r.join(", ")}`);return t}async function jt({address:e},t){let{mapView:r}=C(t);return await Mt(e,r)}var Ot=i.object({address:i.string().describe("The full address or place name to locate.")}),Dt=w(jt,{name:"goToAddress",description:"Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",schema:Ot});async function Vt(e,t){let r=t.map.bookmarks;if(!r||r.length===0)throw new Error("No bookmarks found in the map.");let a=r.find(n=>n.name===e);if(!a)throw new Error(`Bookmark with name "${e}" not found.`);let o=a.viewpoint;if(!o)throw new Error(`Bookmark with name "${e}" does not have a valid viewpoint.`);return await t.goTo(o),`Navigated to bookmark: ${e}`}async function Pt({bookmarkName:e},t){let{mapView:r}=C(t);return await Promise.resolve(Vt(e,r))}var Gt=N.object({bookmarkName:N.string().describe("The name of the bookmark to navigate to.")}),Bt=w(Pt,{name:"goToBookmark",description:"Go to the extent of the bookmark with the given name.",schema:Gt});async function Qt(e,t,r){let a=r.map?.allLayers.find(n=>n.id===e);if(!a)return`Error: Layer with id ${e} not found`;let o=a.createQuery();o.where=t??"1=1";try{let{extent:n,count:s}=await a.queryExtent(o);if(s===0)return`No features found in ${a.title} matching: ${t}`;if(n)await r.goTo(n);else return`Error: Unable to determine extent for ${a.title}`;return`Successfully zoomed to ${s} feature(s) in ${a.title}`}catch(n){return console.error("Error in goToFeatures:",n),`Error: ${n instanceof Error?n.message:"Unknown error"}`}}async function Ut({layerId:e,where:t},r){let{mapView:a}=C(r);return await Qt(e,t,a)}var Wt=N.object({layerId:N.string().describe("The layerId of the layer to zoom to."),where:N.string().describe("The sql-92 where clause used to query features to zoom to")}),Kt=w(Ut,{name:"goToFeatures",description:"Go to the features that match the given filter related to the given layerId.",schema:Wt});async function Zt(e){let t=new Pe({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:{wkid:4326}}).expand(.7);return await e.goTo(t),"Successfully zoomed to world extent"}async function Ht(e,t){let{mapView:r}=C(t);return await Zt(r)}var Jt=N.object({}),Yt=w(Ht,{name:"goToFullExtent",description:"Zooms the map to the full world extent using Esri's Geocoding Service.",schema:Jt});async function Xt(e){let t=e.map.initialViewProperties?.viewpoint?.targetGeometry;if(t)await e.goTo(t);else throw new Error("Initial extent is undefined");return"Successfully zoomed to home extent"}async function er(e,t){let{mapView:r}=C(t);return await Xt(r)}var tr=i.object({}),rr=w(er,{name:"goToHomeExtent",description:"Go to the initial web map view extent",schema:tr});async function ar(e,t){await t.when();let r=t.map?.allLayers.find(o=>o.id===e);if(!r)return console.warn(`[goToLayer] No matching FeatureLayer found for: ${e}`),`Could not find layer for: ${e}`;let a;return(r.type==="link-chart"||r.type==="knowledge-graph-sublayer")&&t.map?.activeLinkChartLayer?a=t.map.diagramNodesExtent:a=r.fullExtent,a?(await t.goTo(a),r.visible=!0,`Successfully zoomed to: ${r.title??""}`):"Layer has no defined extent. Cannot zoom to layer."}async function or({layerId:e},t){let{mapView:r}=C(t);return await ar(e,r)}var nr=N.object({layerId:N.string().describe("The id of the layer to navigate to")}),ir=w(or,{name:"goToLayer",description:"Zooms the map view to the full extent of the top matching layer.",schema:nr});async function sr(e,t){return await t.goTo({scale:e}),`Successfully zoomed to: ${e}`}async function lr({scale:e},t){let{mapView:r}=C(t);return await sr(e,r)}var cr=i.object({scale:i.number().describe("The map scale of the view to go to.")}),dr=w(lr,{name:"goToScale",description:"Go to the specified view scale.",schema:cr});async function ur(e,t,r){let a={target:new ge({longitude:e.longitude,latitude:e.latitude,spatialReference:{wkid:4326}})};return r?.zoom!==void 0&&(a.zoom=r.zoom),r?.scale!==void 0&&(a.scale=r.scale),await t.goTo(a),`Successfully navigated to: ${[`(${e.latitude}\xB0, ${e.longitude}\xB0)`,r?.zoom!==void 0?`zoom ${r.zoom}`:"",r?.scale!==void 0?`scale 1:${r.scale}`:""].filter(Boolean).join(", ")}`}async function mr({center:e,zoom:t,scale:r},a){let{mapView:o}=C(a);return await ur(e,o,{zoom:t,scale:r})}var hr=i.object({center:i.object({longitude:i.number().describe("The longitude (x-coordinate) of the point to navigate to."),latitude:i.number().describe("The latitude (y-coordinate) of the point to navigate to.")}),zoom:i.number().optional().describe("The zoom level. Higher values = more zoomed in."),scale:i.number().optional().describe("The map scale. Alternative to zoom. Smaller numbers = more zoomed in.")}),pr=w(mr,{name:"goToViewpoint",description:"Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",schema:hr});async function fr(e,t){return await t.goTo({zoom:e}),`Successfully zoomed to: ${e}`}async function gr({zoom:e},t){let{mapView:r}=C(t);return await fr(e,r)}var yr=i.object({zoom:i.number().min(1).max(20).describe("The zoom level of the view to go to.")}),wr=w(gr,{name:"goToZoom",description:'Go to the specified zoom level. If input is generic (e.g. "zoom in", then only zoom to the next appropriate level - increase level for zooming in and decrease for zooming out.).',schema:yr}),we=[Dt,Bt,Kt,Yt,rr,ir,dr,pr,wr],ze=Object.assign({"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_lc_context.md":()=>import("./LSGRWCAO.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_intent_prompt.md":()=>import("./KKHKKCYH.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_tool_prompt.md":()=>import("./KQ6LEQHH.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_filter_prompt.md":()=>import("./MZJGADGH.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_query_prompt.md":()=>import("./5PT7ZFXF.js").then(e=>e.default),"../agents/dataExploration/prompts/summarize_query_response_prompt.md":()=>import("./KWBMH7LU.js").then(e=>e.default),"../agents/help/prompts/help_prompt.md":()=>import("./ESTSYVJP.js").then(e=>e.default),"../agents/layerStyling/prompts/layer_styling_prompt.md":()=>import("./CFT5BBC6.js").then(e=>e.default),"../agents/navigation/prompts/navigation_intent_prompt.md":()=>import("./ZDEYVBH7.js").then(e=>e.default),"../agents/navigation/prompts/navigation_tool_prompt.md":()=>import("./ABCHVJTB.js").then(e=>e.default)});async function L(e){let t=Object.entries(ze).find(([r])=>r.endsWith(`/${e}.md`));if(!t)throw new Error(`Prompt not found: ${e}
8
+ Available prompts:
9
+ ${Object.keys(ze).join(`
10
+ `)}`);return await t[1]()}var $=(e,t=3)=>{let r=e.map((o,n)=>o.type==="human"?n:-1).filter(o=>o!==-1);if(r.length===0)return[];let a=r.length>t?r[r.length-t]:r[0];return e.slice(a)};async function br(e,t){let r=await L("navigation_tool_prompt"),{mapView:a}=C(t),o=a.map,n=e.vectorSearchLayerResults?.length>0?e.vectorSearchLayerResults.map((E,f)=>`${f+1}. layerId=${E.id} | title=${E.title??""} | name=${E.name??""} | score=${E.score.toFixed(2)}`).join(`
11
+ `):"",s=e.vectorSearchFieldResults?.length>0?JSON.stringify(e.vectorSearchFieldResults,null,2):"",l=e.intent==="goToBookmark"&&o.bookmarks?.length?`Available bookmarks:
12
+ ${JSON.stringify(o.bookmarks,null,2)}`:"",c=(e.intent==="goToLayer"||e.intent==="goToFeatures")&&e.vectorSearchLayerResults?.length?`Candidate layers:
13
+ ${n}`:"",d=e.intent==="goToFeatures"&&e.vectorSearchFieldResults?.length?`Candidate fields:
14
+ ${s}`:"",m={intent:e.intent,bookmarksSection:l,layersSection:c,fieldsSection:d,currentZoom:a.zoom,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},u=await j({promptText:r,modelTier:"advanced",messages:$(e.agentExecutionContext.messages),inputVariables:m,tools:we}),h=[...e.agentExecutionContext.messages,u],y=(u.tool_calls?.length??0)>0?[...h]:[...h,u];return{...e,agentExecutionContext:{...e.agentExecutionContext,messages:y}}}async function xr(e,t){let r=await new q(we).invoke({messages:$(e.agentExecutionContext.messages)},t),a=r.messages.map(s=>s.text).join(`
15
+ `);await p({text:`Finished executing navigation tool: ${a}`},t);let o=[...e.agentExecutionContext.messages,...r.messages],n=r.messages.map(s=>s.text).join(`
16
+ `);return{...e,agentExecutionContext:{...e.agentExecutionContext,messages:o},outputMessage:n}}async function vr(e,t){let r=await L("navigation_intent_prompt"),{mapView:a}=C(t),o=we.map(u=>({name:u.name,description:u.description,schema:u.schema})),n=a.map,s=n.bookmarks?.length?`Available bookmarks:
17
+ ${JSON.stringify(n.bookmarks,null,2)}`:"",l={tools:o.map(({name:u,description:h,schema:y})=>`${u}: ${h}, ${JSON.stringify(y)}`).join(`
18
+ `),bookmarks:s,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},c=i.object({intent:i.string()}),d=await Ne({promptText:r,messages:$(e.agentExecutionContext.messages),inputVariables:l,schema:c}),m=typeof d.intent=="string"?d.intent.trim().replace(/^"|"$/gu,""):"";return{...e,intent:m||""}}var v=(e,t)=>{let r=e?.configurable?.services?.[t];if(r==null)throw new Error(`${t} missing in config.configurable.services`);return r},Er=.7,Sr=async(e,t)=>{try{await p({text:`Similarity search to find layers: ${e.agentExecutionContext.assignedTask}`},t);let r=v(t,"layerSearch"),a=v(t,"layersAndFieldsRegistry"),o=v(t,"embeddingCache"),n=(await r.searchLayers({text:e.agentExecutionContext.assignedTask,minScore:Er,embeddingCache:o})).map(({id:l,score:c})=>{let d=a.get(l)?.layerItem;return{id:l,title:d?.title,name:d?.name??void 0,score:c}}),s;return n.length>0?s=`Vector search completed. Matching layers:
19
+ ${n.map(l=>`- layerId=${l.id} | title=${l.title??""} | name=${l.name??""} | score=${l.score.toFixed(2)}`).join(`
20
+ `)}`:s="Vector search completed. No matching layers found.",await p({text:s},t),{...e,vectorSearchLayerResults:n}}catch(r){throw await p({text:`Error during vector search layers: ${r instanceof Error?r.message:String(r)}`},t),r}},je=.7,Tr=10,kr=async(e,t)=>{try{await p({text:`Similarity search to find fields: ${e.agentExecutionContext.assignedTask}`},t);let r=v(t,"fieldSearch"),a=v(t,"layersAndFieldsRegistry"),o=v(t,"embeddingCache"),n=e.vectorSearchLayerResults?.map(c=>c.id)??[];if(n.length===0)return await p({text:"No candidate layers for field search"},t),e;let s=(await r.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:n,minScore:je,topResults:Tr,embeddingCache:o})).map(({layerId:c,results:d})=>{let m=a.get(c)?.fieldRegistry;return{layerId:c,layerName:a.get(c)?.layerItem.name,results:d.map(u=>{let h=m?.get(u.name);return{name:u.name,score:u.score,type:h?.type,alias:h?.alias,description:h?.description,statistics:h?.statistics}})}}),l;return s.length>0?l=`Vector search completed. Matching layers and fields:
21
+ ${s.map(c=>`${c.layerName??c.layerId}:
22
+ ${c.results.map(d=>` - ${d.name} (${d.score.toFixed(2)})`).join(`
23
+ `)}`).join(`
24
+ `)}`:l=`No vector search field results found for score over ${je}.`,await p({text:l},t),{...e,vectorSearchFieldResults:s}}catch(r){throw await p({text:`Error during vector search fields: ${r instanceof Error?r.message:String(r)}`},t),r}},oe=(e,t)=>(r,a)=>{let o=a?.configurable?.services;for(let n of e)if(!o?.[n])throw new Error(`${t} requires services.${n} to be available.`);return r},Ir=(e,t)=>oe(["layerSearch","layersAndFieldsRegistry"],"Navigation Agent")(e,t),Cr=()=>new R(Ke).addNode("requireNavigationServices",Ir).addNode("intentLLM",vr).addNode("vectorSearchLayers",Sr).addNode("vectorSearchFields",kr).addNode("agent",br).addNode("tools",xr).addEdge(A,"requireNavigationServices").addEdge("requireNavigationServices","intentLLM").addConditionalEdges("intentLLM",e=>e.intent==="goToLayer"||e.intent==="goToFeatures"?"vectorSearchLayers":"agent",{vectorSearchLayers:"vectorSearchLayers",agent:"agent"}).addConditionalEdges("vectorSearchLayers",e=>e.intent==="goToFeatures"?"vectorSearchFields":"agent",{vectorSearchFields:"vectorSearchFields",agent:"agent"}).addEdge("vectorSearchFields","agent").addEdge("agent","tools").addEdge("tools",T),_r=String.raw`- **navigation** — Enables users to interact with the map by navigating to specific locations, layers, features, or extents.
25
+ This includes zooming, panning, centering, or geocoding based on user input. The agent is designed to handle explicit map movement requests. NOTE: DO NOT call this agent if the user asks "show me...", that is meant to be handled by another agent. If the query is about where a certain address is, call this agent.
26
+
27
+ Supported actions:
28
+ - **Zooming**: Adjust the map's zoom level (e.g., "Zoom to level 10", "Zoom in").
29
+ - **Viewpoints**: Navigate to a specific center point with optional zoom or scale (e.g., "Center the map on San Francisco at zoom level 16").
30
+ - **Scales**: Set the map to a specific scale (e.g., "Set the map scale to 1:50,000").
31
+ - **Layers**: Zoom to the full extent of a specific layer (e.g., "Go to the water mains layer"). For the purposes of link charts, if the user requests to go to the extent of a link chart or the entities/nodes within it, that should be treated as a request to use the goToLayer tool on the link chart layer
32
+ - **Features**: Zoom to features in a layer that match a filter (e.g., "Zoom to all schools in the city").
33
+ - **Bookmarks**: Navigate to a predefined bookmark extent (e.g., "Go to the Downtown bookmark").
34
+ - **Extents**: Reset to the initial web map extent or zoom to the full world extent (e.g., "Reset the map", "Zoom to the full world extent").
35
+ - **Addresses**: Zoom to an address or place name (e.g., "Zoom to 1600 Pennsylvania Ave").
36
+
37
+ _Example: “Zoom to Texas”_
38
+ _Example: “Go to the water mains layer”_
39
+ _Example: “Zoom to to the extent of my link chart”_
40
+ _Example: “Center the map on San Francisco at scale 50000”_
41
+ _Example: “Zoom to the features in the schools layer where city = 'Austin'”_
42
+ _Example: “Go to the Downtown bookmark”_
43
+ _Example: “Where is Mount Rainier?”_`,Ns={id:"navigation",name:"Navigation Agent",description:_r,createGraph:Cr,workspace:Ke},Ze=g.Root({agentExecutionContext:g({reducer:Q,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[]})}),outputMessage:g({reducer:U,default:()=>""}),summary:g({reducer:D,default:()=>""}),status:g({reducer:D,default:()=>"success"}),vectorSearchLayerIds:g(),vectorSearchFieldResults:g(),layerFieldInfo:g(),queryResponse:g()}),$r=async(e,t)=>(await p({text:"Exiting Data Exploration agent"},t),e),be=async(e,t)=>{let r=e.tool_calls??[];if(r.length===0){await p({text:`LLM did not request any tool calls: ${String(e?.content)}`},t);return}await Promise.all(r.map(async a=>await p({text:`LLM invoked ${a.name} tool with arguments: ${JSON.stringify(a.args,null,2)}`},t)))},Nr=["mapView"];function M(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("DataExplorationAgent context missing");let r=Nr.filter(a=>!(a in t));if(r.length)throw new Error(`DataExplorationAgent context missing: ${r.join(", ")}`);return t}var Fr=e=>{let t=e.map?.allLayers.filter(a=>a.type==="feature"),r=0;return t?.forEach(a=>{let o=a;o.featureEffect&&(o.featureEffect=null,r++)}),r>0?`Cleared filters from ${r} layer(s). View unchanged.`:"No active filters to clear. View unchanged."},Ar=async(e,t)=>{let{mapView:r}=M(t);return Fr(r)},Rr=w(Ar,{name:"clearFilters",description:"Clears all feature effects/filters from the map but does NOT change the current view. Use when user says 'clear filters', 'reset filters', 'remove filters', 'show all features', or wants to remove emphasis without navigating anywhere.",schema:i.object({})}),qr=async e=>{e.map?.allLayers.filter(r=>r.type==="feature")?.forEach(r=>{let a=r;a.featureEffect&&(a.featureEffect=null)});let t=e.map.initialViewProperties?.viewpoint?.targetGeometry;return t?(await e.goTo(t),"Cleared all filters and returned to home extent."):"Cleared all filters. Could not determine home extent."},Lr=async(e,t)=>{let{mapView:r}=M(t);return await qr(r)},Mr=w(Lr,{name:"resetMap",description:"Clears all feature effects/filters from the map AND zooms to the home extent (initial map view). Use when user says 'reset map', 'reset the map', 'start over', or wants to both clear filters and return to the initial view.",schema:i.object({})});function X(e){return"point"in e&&e.point!==void 0}function G(e){return"layerId"in e&&e.layerId!==void 0}var ne=async(e,t)=>{if(X(e)){let{point:r}=e;return{geometry:new ge({x:r.x,y:r.y,spatialReference:r.spatialReference?{wkid:r.spatialReference.wkid}:t.spatialReference})}}if(G(e)){let r=t.map?.allLayers.find(a=>a.id===e.layerId);if(!r)return{error:`Could not find geometry layer with ID: ${e.layerId}`};try{let a=await r.queryFeatures({where:e.where,returnGeometry:!0,outSpatialReference:t.spatialReference});if(!a.features.length)return{error:`No features found in geometry layer with the specified where clause: ${e.where}`};let o;if(a.features.length===1){let n=a.features[0].geometry;if(!n)return{error:"The geometry of the first feature is undefined or null."};o=n}else{let n=a.features.map(l=>l.geometry),s=Be.executeMany(n);if(!s)return{error:"Failed to create a combined geometry."};o=s}return o.spatialReference||(o.spatialReference=t.spatialReference),{geometry:o}}catch(a){return{error:`Failed to query geometry: ${String(a)}`}}}return{error:"Invalid geometry configuration provided"}},zr=async(e,t,r,a,o,n)=>{let s=e.map?.allLayers.find(c=>c.id===t);if(!s)return{success:!1,error:`Layer '${t}' not found.`};let l=s.createQuery();l.where=r??"1=1",a&&(l.geometry=a,l.spatialRelationship="intersects",o&&(l.distance=o),n&&(l.units=n));try{let{extent:c,count:d}=await s.queryExtent(l);return!c||d===0?{success:!1,error:`No features found for filter (where: ${l.where}${a?", spatial filter used":""})`}:(await e.goTo(c),{success:!0})}catch(c){return{success:!1,error:c instanceof Error?c.message:String(c)}}},jr=async(e,t,r,a,o,n)=>{let s=t.map?.allLayers.find(u=>u.id===e.layerId);if(!s)return`Could not find target layer with ID: ${e.layerId}`;let l;if(o){let u=await ne(o,t);if("error"in u)return u.error;l=u.geometry}if(s.featureEffect=null,s.featureEffect=new ut({filter:new Ge({...e.objectIds?.length?{objectIds:e.objectIds}:{where:e.where},geometry:l,spatialRelationship:"intersects",distance:o?.distance,units:o?.units}),includedEffect:r,excludedEffect:a}),s.visible=!0,n)return`Applied feature effects to "${s.title??e.layerId}" within current map extent.`;let c=e.objectIds?.length?`${s.objectIdField} IN (${e.objectIds.join(",")})`:e.where,d=await zr(t,e.layerId,c,l,o?.distance,o?.units),m=s.title??e.layerId;return d.success?`Applied feature effects to target layer "${s.title??e.layerId}"${o&&"layerId"in o?` using geometry from layer "${o.layerId}"`:""}.`:`Applied filter to "${m}" but no features matched. ${d.error}`},Or=["feet","kilometers","meters","miles","nautical-miles","us-nautical-miles"],z=i.enum(Or),Dr=async({targetLayer:e,geometryFilter:t,useCurrentExtent:r,includedEffect:a="drop-shadow(2px, 2px, 2px, gray)",excludedEffect:o="grayscale(100%) opacity(60%) blur(2px)"},n)=>{let{mapView:s}=M(n);return await jr(e,s,a,o,t,r)},Vr=i.object({layerId:i.string().describe("The layerId of the layer containing the geometry by which to filter."),where:i.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:i.number().optional().describe("The buffer distance around the geometry."),units:z.optional().describe("The units for the distance buffer.")}),Pr=i.object({point:i.object({x:i.number().describe("X coordinate (longitude) from navigation result"),y:i.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:i.object({wkid:i.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:i.number().optional().describe("Optional buffer distance around the point."),units:z.optional().describe("The units for the distance buffer.")}),Gr=i.object({targetLayer:i.object({layerId:i.string().describe("The layerId of the layer on which to set a feature effect."),where:i.string().describe("The SQL-92 where clause representing the features to emphasize."),objectIds:i.array(i.number()).optional().describe("Array of objectIds from a previous query result. Use this instead of a where clause when the query returned objectIds (e.g. top N results). If provided, takes precedence over where clause.")}),geometryFilter:i.union([Vr,Pr]).optional().describe("Optional geometry-based filtering parameters for spatial queries."),useCurrentExtent:i.boolean().optional().describe("Set to true when the previous query used the current map extent as a spatial filter. This ensures the feature effect applies only to features visible in the current view. Default is false."),includedEffect:i.string().default("drop-shadow(2px, 2px, 2px, gray)").describe("The effect applied to features that meet the filter requirements. Valid effects include: bloom, blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, and sepia. Prefer default unless specified."),excludedEffect:i.string().default("grayscale(100%) opacity(60%) blur(2px)").describe("The effect applied to features that do not meet the filter requirements. Valid effects include: bloom, blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, and sepia. Prefer default unless specified.")}),Br=w(Dr,{name:"setFeatureEffect",description:"Sets a feature effect on a given layer with given filter parameters and feature effects to emphasize certain features that meet a filter requirement. If no feature effect information is provided, then use the default effect provided.",schema:Gr}),ee=(e,t,r)=>{if(e&&typeof e!="function"){let a="getField"in r&&r.getField?.(e),o=a&&"getFieldDomain"in r&&r.getFieldDomain?r.getFieldDomain(a.name):null;if(o?.type==="coded-value"){let n=o.codedValues.find(s=>s.code===t);return n?n.name:null}}return null},Qr=new Set(["date","date-only","time-only","timestamp-offset"]),me=e=>{if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"&&Number.isFinite(e)){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}return null},Ur=e=>!e||e==="system"?Intl.DateTimeFormat().resolvedOptions().timeZone:e==="unknown"?"UTC":e,Wr=e=>{if(typeof e=="string"&&e)return e;let t=me(e);return t?t.toISOString().slice(0,10):null},He=()=>{let e=new Date().getTimezoneOffset(),t=e<=0?"+":"-",r=Math.floor(Math.abs(e)/60).toString().padStart(2,"0"),a=(Math.abs(e)%60).toString().padStart(2,"0"),o=`${t}${r}:${a}`;return{userTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,userTimezoneOffset:o}},te=e=>e?Qr.has(e.toLowerCase()):!1,re=(e,t,r)=>{let a=t?.toLowerCase();if(a==="date-only"){let n=Wr(e);return n?mt(n,H("short-date")):e}if(a==="time-only"){if(typeof e=="string"&&e)return ht(e,H("long-time"));let n=me(e);return n?Re(n,{...H("long-time"),timeZone:"UTC"}):e}let o=me(e);return o?Re(o,{...H("short-date-short-time"),timeZone:Ur(r)}):e},Kr=(e,t,r)=>{let a=e.createQuery();return a.outFields=[t],a.where=r||"1=1",a.num=1,a},Zr=async(e,t,r,a)=>{let o=a.map?.allLayers.find(u=>u.id===e),n=Kr(o,t,r.where),s=(await o.queryFeatures(n)).features[0],l=s?s.attributes[t]:null,c=o.fields.find(u=>u.name===t),d=ee(t,l,o)||l,m=c&&te(c.type)?re(d,c.type,a.timeZone):d;return{tool:"getAttribute",layerName:o.title??e,summary:`${t} = ${m}`,details:{fieldName:t,value:m,where:r.where}}};async function Hr({layerId:e,fieldName:t,query:r},a){let{mapView:o}=M(a),n=await Zr(e,t,r,o);return JSON.stringify(n,null,2)}var Jr=i.object({layerId:i.string().describe("The layerId of the layer containing the field from which to get a value."),fieldName:i.string().describe("The name of the field/attribute from which to get a field value."),query:i.object({where:i.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")})}),Yr=w(Hr,{name:"getAttribute",description:"Returns an attribute value for a given feature.",schema:Jr}),xe=(e,t,r)=>r?e.hasAllFeaturesInView&&e.availableFields===t:e.hasAllFeatures&&e.availableFields===t;function ae(e,t){let r=e??"";return t!=null&&t&&(r=r?`(${r}) AND (${t})`:t),r||null}var Xr=async e=>{let{targetLayer:t,fieldName:r,statisticType:a,mapView:o,layersAndFieldsRegistry:n,geometryFilter:s}=e,l=o.map?.allLayers.find(b=>b.id===t.layerId);if(!l)throw new Error(`Layer '${t.layerId}' not found.`);let c=await o.whenLayerView(l),d=n.get(t.layerId)?.fieldRegistry.get(r),m=d?.alias;if(!d)throw new Error(`Field '${r}' not found.`);let u,h;if(s){let b=await ne(s,o);if("error"in b)throw new Error(b.error);if(!b.geometry)throw G(s)?new Error(`No features found matching: ${s.where}`):new Error("Failed to create geometry");G(s)?u={geometryLayerId:s.layerId,geometryWhere:s.where,distance:s.distance,units:s.units,applied:!0}:X(s)&&(u={point:s.point,distance:s.distance,units:s.units,applied:!0}),h=new Ge({geometry:b.geometry,distance:s.distance,units:s.units,spatialRelationship:"intersects"})}let y=xe(c,[r],!1),E=null,f=null,x=10;if(d.type!=="geometry"&&d.type!=="oid"&&d.type!=="global-id")try{let b={layer:l,useFeaturesInView:y,view:y?o:void 0,field:r,sqlWhere:ae(l.definitionExpression,t.where),...h&&{filter:h},outStatisticTypes:{include:[a]}};E=await Qe(b);let S=["string","small-integer","integer"],k=d.domain?.type==="coded-value"?d.domain:null;(S.includes(d.type)||k)&&(f=(await Ue({layer:l,useFeaturesInView:y,view:y?o:void 0,field:r,sqlWhere:ae(l.definitionExpression,t.where),...h&&{filter:h}})).uniqueValueInfos.sort((F,se)=>se.count-F.count).slice(0,x)),f&&d.domain?.type==="coded-value"&&(f=f.map(F=>({...F,value:k?k.getName(F.value)??F.value:F.value})))}catch(b){console.error("Statistics error:",b)}return{tool:"getStatistics",layerName:l.title??t.layerId,summary:`${a} = ${typeof E?.[a]=="number"?E[a]:"N/A"}`,details:{fieldName:r,fieldAlias:m,statisticType:a,statistic:E?.[a]??null,summaryStatistics:E,uniqueValues:f,where:t.where,spatialFilterInfo:u}}};async function ea({targetLayer:e,fieldName:t,statisticType:r,geometryFilter:a},o){let n=v(o,"layersAndFieldsRegistry"),{mapView:s}=M(o),l=await Xr({targetLayer:e,fieldName:t,statisticType:r,mapView:s,layersAndFieldsRegistry:n,geometryFilter:a});return JSON.stringify(l,null,2)}var ta=i.object({layerId:i.string().describe("The layerId of the layer containing the geometry by which to filter."),where:i.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:i.number().optional().describe("The buffer distance around the geometry."),units:z.optional().describe("The units for the distance buffer.")}),ra=i.object({point:i.object({x:i.number().describe("X coordinate (longitude) from navigation result"),y:i.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:i.object({wkid:i.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:i.number().optional().describe("Optional buffer distance around the point."),units:z.optional().describe("The units for the distance buffer.")}),aa=i.object({targetLayer:i.object({layerId:i.string().describe("The layerId of the layer containing the field from which to get a value."),where:i.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")}),geometryFilter:i.union([ta,ra]).optional().describe("Geometry filter for spatial queries. Use 'point' option with x/y coordinates from navigation results to find features at that location (point-in-polygon). Use 'layerId/where' option to filter by features from another layer."),fieldName:i.string().describe("The name of the field for which to get statistics. STRICTLY DO NOT use OBJECTID. Use any other field"),statisticType:i.enum(["avg","max","median","min","stddev","sum","variance","nullcount","count"]).describe("The statistic type to calculate.")}),oa=w(ea,{name:"getStatistics",description:`Computes a single aggregate statistic (max, min, avg, sum, median, stddev, variance) for a numeric field across matching features. Also returns frequency analysis for categorical fields.
44
+
45
+ USE THIS TOOL FOR:
46
+ - "What is the average/maximum/minimum/total [field]?" \u2014 aggregate computations
47
+ - "Most common/frequent value of [field]?" \u2014 frequency analysis
48
+ - Questions requiring a mathematical aggregation across many features
49
+
50
+ DO NOT USE FOR:
51
+ - "How many features match X?" \u2014 use queryFeatures instead (it returns totalCount)
52
+ - "Show / list / find features" \u2014 use queryFeatures instead
53
+ - Simple counts of features matching a condition \u2014 use queryFeatures instead
54
+
55
+ Only call this tool when the answer requires computing an aggregate (avg, max, min, sum, median, stddev) over a field's values, not just counting or listing features.`,schema:aa}),na=async(e,t,r,a,o)=>{let n=r.map?.allLayers.find(h=>h.id===e.layerId),s=await r.whenLayerView(n),l=n.title??e.layerId,c;if(a){let h=await ne(a,r);if("error"in h)return{tool:"getTopFeatures",layerName:l,summary:"Geometry lookup failed",details:{error:h.error}};if(!h.geometry)return{tool:"getTopFeatures",layerName:l,summary:"No features found for geometry filter",details:{error:`No features found matching: ${"where"in a?a.where:"unknown criteria"}`}};c=h.geometry}else o&&(c=r.extent.clone());let d=t.groupByFields&&t.groupByFields.length>0,m=n.objectIdField,u=e.outFields.includes("*")?["*"]:[...new Set([...e.outFields,m])];try{let h;if(d){let f=new pt({where:e.where||"1=1",outFields:u,orderByFields:e.orderByFields,geometry:c,spatialRelationship:c?"intersects":void 0,distance:a?.distance,units:a?.units,topFilter:new ft({topCount:t.topCount,groupByFields:t.groupByFields,orderByFields:t.orderByFields})});h=await n.queryTopFeatures(f)}else{let f=n.createQuery();f.where=ae(n.definitionExpression,e.where||"1=1"),f.outFields=u.length?u:["*"],f.orderByFields=t.orderByFields,f.num=t.topCount,c&&(f.geometry=c,f.spatialRelationship="intersects"),a?.distance&&(f.distance=a.distance),a?.units&&(f.units=a.units),f.outSpatialReference=r.spatialReference;let x=xe(s,e.outFields,o??!1);try{h=x?await s.queryFeatures(f):await n.queryFeatures(f)}catch(b){console.warn("Client-side query failed, falling back to server:",b),h=await n.queryFeatures(f)}}let y=h.features.map(f=>f.attributes[m]),E=h.features.map(f=>{let x=f.attributes,b={};return n.fields.forEach(S=>{if(S.name===n.objectIdField){b[S.name]=x[S.name];return}let k=x[S.name],F=ee(S.name,k,n),se=S.alias||S.name,Se=F??k;b[se]=te(S.type)?re(Se,S.type,r.timeZone):Se}),b});return{tool:"getTopFeatures",layerName:l,summary:`Top ${t.topCount} features extracted`,details:{topCount:t.topCount,attributes:E,objectIds:y,objectIdField:m,where:e.where,orderByFields:t.orderByFields,...d&&{groupByFields:t.groupByFields}}}}catch(h){return{tool:"getTopFeatures",layerName:l,summary:"Query failed",details:{error:h instanceof Error?h.message:String(h)}}}},ia=async({targetLayer:e,topFilter:t,geometryFilter:r,useCurrentExtent:a},o)=>{let{mapView:n}=M(o),s=await na(e,t,n,r,a);return JSON.stringify(s,null,2)},sa=i.object({layerId:i.string().describe("The layerId of the layer containing the geometry by which to filter."),where:i.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:i.number().optional().describe("The buffer distance around the geometry."),units:z.optional().describe("The units for the distance buffer.")}),la=i.object({point:i.object({x:i.number().describe("X coordinate (longitude) from navigation result"),y:i.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:i.object({wkid:i.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:i.number().optional().describe("Optional buffer distance around the point."),units:z.optional().describe("The units for the distance buffer.")}),ca=i.object({targetLayer:i.object({layerId:i.string().describe("The layerId of the layer containing the field from which to get a value."),where:i.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value."),orderByFields:i.array(i.string().describe("The field(s) and order for which to sort the resulting features.")),outFields:i.array(i.string().describe('The fields to include in the output that will be presented to the user. This should include identifying information about the resulting features, like a name or id, along with the values desired in the output. If unsure, choose all fields ("*").').default("*"))}),geometryFilter:i.union([sa,la]).optional().describe("Geometry filter for spatial queries. Use 'point' option with x/y coordinates from navigation results to find features at that location (point-in-polygon). Use 'layerId/where' option to filter by features from another layer."),topFilter:i.object({topCount:i.number().describe("Number of top features to return per group."),orderByFields:i.array(i.string().describe("Field(s) to rank by with ASC/DESC. Must be existing field names, not aggregate functions.")),groupByFields:i.array(i.string().describe("Field(s) to group results by. Returns top N per group."))}),useCurrentExtent:i.boolean().optional().describe("Set to true ONLY when user explicitly asks about features 'in my view', 'on my map', 'I am looking at'. Default is false (queries entire layer).")}),da=w(ia,{name:"getTopFeatures",description:'Returns top N features ranked by an existing field value. Use for "highest", "lowest", "top N" questions where ranking is based on a field that already exists in the data (e.g., population, value, date, depth). orderByFields must be actual field names with ASC/DESC. Do NOT use aggregate functions like COUNT(), SUM(), AVG() - those require getStatistics.',schema:ca}),ue=25,ua=async(e,t,r,a)=>{let o=t.map?.allLayers.find(f=>f.id===e.layerId),n=await t.whenLayerView(o),s=o.title??e.layerId,l;if(r){let f=await ne(r,t);if("error"in f){let x={error:f.error};return G(r)?(x.geometryLayerId=r.layerId,x.geometryWhere=r.where):X(r)&&(x.point=r.point),{tool:"queryFeatures",layerName:s,summary:"Geometry lookup failed",details:x}}if(!f.geometry){let x={};return G(r)?(x.error=`No features found matching: ${r.where}`,x.geometryLayerId=r.layerId,x.geometryWhere=r.where):X(r)&&(x.error="Failed to create point geometry",x.point=r.point),{tool:"queryFeatures",layerName:s,summary:"No features found for geometry filter",details:x}}l=f.geometry}else a&&(l=t.extent.clone());let c=xe(n,e.outFields,a??!1),d=o.objectIdField,m=o.createQuery();m.where=ae(o.definitionExpression,e.where||"1=1"),m.outFields=e.outFields.includes("*")?["*"]:[...new Set([...e.outFields,d])],m.orderByFields=e.orderByFields,l&&(m.geometry=l,m.spatialRelationship="intersects"),r?.distance&&(m.distance=r.distance),r?.units&&(m.units=r.units),m.outSpatialReference=t.spatialReference;let u,h;try{u=c?await n.queryFeatureCount(m):await o.queryFeatureCount(m),u>0&&u<=ue&&(h=c?await n.queryFeatures(m):await o.queryFeatures(m),h&&h.features.forEach(f=>{let x=f.attributes;o.fields.forEach(b=>{let S=x[b.name],k=ee(b.name,S,o)??S;x[b.name]=te(b.type)?re(k,b.type,t.timeZone):k})}))}catch(f){console.warn("Client-side query failed, falling back to server:",f),u=await o.queryFeatureCount(m),u>0&&u<=ue&&(h=await o.queryFeatures(m),h&&h.features.forEach(x=>{o.fields.forEach(b=>{let S=x.attributes[b.name],k=ee(b.name,S,o)??S;x.attributes[b.name]=te(b.type)?re(k,b.type,t.timeZone):k})}))}let y=h?.features.map(f=>f.attributes[d]),E=h?.features.map(f=>f.attributes);return{tool:"queryFeatures",layerName:s,summary:`${u} features found`,details:{totalCount:u,where:e.where,orderByFields:e.orderByFields,outFields:e.outFields,...y&&{objectIds:y,objectIdField:d},...E&&{attributes:E},...u>ue&&{note:`${u} features found.`}}}};async function ma({targetLayer:e,geometryFilter:t,useCurrentExtent:r},a){let{mapView:o}=M(a),n=await ua(e,o,t,r);return JSON.stringify(n,null,2)}var ha=i.object({layerId:i.string().describe("The layerId of the layer containing the geometry by which to filter."),where:i.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:i.number().optional().describe("The buffer distance around the geometry."),units:z.optional().describe("The units for the distance buffer.")}),pa=i.object({point:i.object({x:i.number().describe("X coordinate (longitude) from navigation result"),y:i.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:i.object({wkid:i.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:i.number().optional().describe("Optional buffer distance around the point."),units:z.optional().describe("The units for the distance buffer.")}),fa=i.object({targetLayer:i.object({layerId:i.string().describe("The layerId of the layer containing the field from which to get a value."),where:i.string().describe("SQL-92 where clause. IMPORTANT: When using geometryFilter.point for point-in-polygon queries, set this to '1=1' to return all features that intersect the point. Only add attribute filters if the user specifically requests them in addition to the spatial query."),orderByFields:i.array(i.string().describe("The field(s) and order for which to sort the resulting features.")),outFields:i.array(i.string().describe('The fields to include in the output that will be presented to the user. This should include identifying information about the resulting features, like a name or id, along with the values desired in the output. If unsure, choose all fields ("*").').default("*"))}),geometryFilter:i.union([ha,pa]).optional().describe("Geometry filter for spatial queries. Use 'point' option with x/y coordinates from navigation results to find features at that location (point-in-polygon). Use 'layerId/where' option to filter by features from another layer."),useCurrentExtent:i.boolean().optional().describe("Set to true ONLY when user explicitly asks about features 'in my view', 'on my map', 'I am looking at', OR when the user refers back to features previously identified using the current extent (e.g. 'these', 'those', 'them', 'the same ones'). Default is false (queries entire layer).")}),ga=w(ma,{name:"queryFeatures",description:`Queries features from a layer. Returns the total count of matching features, plus individual feature attributes if \u226425 features match.
56
+
57
+ USE THIS TOOL FOR:
58
+ - "Show / display / list features where..." \u2014 finding and listing features
59
+ - "How many X are Y?" \u2014 counting features that match a condition
60
+ - "Which features..." / "Find features..." \u2014 identifying specific features
61
+ - Spatial queries \u2014 finding features near/within/intersecting other features
62
+ - Any question where the user wants to SEE or COUNT matching features
63
+
64
+ This is the DEFAULT tool for most queries. When in doubt, use this tool.`,schema:fa}),Je=[Yr,oa,da,ga],Ye=[Br,Mr,Rr],ya=async(e,t)=>{await p({text:"Requesting LLM for layer filter results"},t);let r=await L("data_explore_filter_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer filter tools");let{userTimezone:a,userTimezoneOffset:o}=He(),n={layerFieldInfo:e.layerFieldInfo,userTimezone:a,userTimezoneOffset:o,queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},s=await j({promptText:r,modelTier:"advanced",messages:$(e.agentExecutionContext.messages),inputVariables:n,tools:Ye}),l=[...e.agentExecutionContext.messages,s];if(!((s.tool_calls?.length??0)>0))return await p({text:"LLM determined no filter changes needed"},t),{...e,agentExecutionContext:{...e.agentExecutionContext,messages:l}};let c=[...l,s],d=s.content.toString();return await be(s,t),{...e,agentExecutionContext:{...e.agentExecutionContext,messages:c},outputMessage:d}},wa=async(e,t)=>{await p({text:"Requesting LLM for layer query results"},t);let r=await L("data_explore_query_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer query tools");let{userTimezone:a,userTimezoneOffset:o}=He(),n={layerFieldInfo:e.layerFieldInfo,userTimezone:a,userTimezoneOffset:o,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},s=await j({promptText:r,modelTier:"advanced",messages:$(e.agentExecutionContext.messages),inputVariables:n,tools:Je}),l=[...e.agentExecutionContext.messages,s],c=s.content.toString();return await be(s,t),{...e,agentExecutionContext:{...e.agentExecutionContext,messages:l},outputMessage:c}},ba=async(e,t)=>{try{await p({text:"Requesting LLM for summary on query results"},t);let r=await L("summarize_query_response_prompt"),a={queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},o=await $e({promptText:r,modelTier:"fast",messages:$(e.agentExecutionContext.messages),inputVariables:a}),n=typeof o=="string"?o:o.content,s=new Z(n);return await p({text:`Received response from LLM: ${n}`},t),{...e,outputMessage:n,agentExecutionContext:{...e.agentExecutionContext,messages:[...e.agentExecutionContext.messages,s]}}}catch(r){throw await p({text:"Error during filter LLM request"},t),new Error(`Error during filter LLM request: ${r instanceof Error?r.message:String(r)}`)}};async function xa(e,t){let r=await new q(Ye).invoke({messages:$(e.agentExecutionContext.messages)},t),a=[...e.agentExecutionContext.messages,...r.messages],o=r.messages.map(s=>new Z({content:s.content,additional_kwargs:s.additional_kwargs}));await p({text:`Finished executing layer filter tool: ${r.messages.map(s=>s.content).join(", ")}`},t);let n=[...a,...o];return{...e,agentExecutionContext:{...e.agentExecutionContext,messages:n}}}var va=new q(Je);async function Ea(e,t){let{messages:r}=await va.invoke({messages:$(e.agentExecutionContext.messages)},t),a=[],o=[];for(let s of r){let l=s.content,c;typeof l!="string"&&(c={tool:s.name??"unknown",layerName:"unknown",summary:"Query failed",details:{error:"Skipping non-string tool output:",raw:l}});try{typeof l=="string"?c=JSON.parse(l):c={tool:s.name??"unknown",layerName:"unknown",summary:"Query failed",details:{error:"Invalid tool output type",raw:l}}}catch{c={tool:s.name??"unknown",layerName:"unknown",summary:"Query failed",details:{error:l}}}a.push(c),c.details&&typeof c.details=="object"&&"error"in c.details?o.push(`- ${c.tool}: Error - ${String(c.details.error)}`):o.push(`- ${c.layerName}: ${c.summary}`)}let n=[...e.agentExecutionContext.messages,...r];return await p({text:`Finished executing layer query tool: ${o.join(", ")}`},t),{...e,agentExecutionContext:{...e.agentExecutionContext,messages:n},queryResponse:a}}var Sa=10,Ta=["string","small-integer","integer"],ka=async(e,t)=>{let r=null,a=null;try{if(t.type!=="geometry"&&t.type!=="oid"&&t.type!=="global-id"){r=await Qe({layer:e,field:t.name});let o=t.domain?.type==="coded-value"?t.domain:null;(Ta.includes(t.type)||o)&&(a=(await Ue({layer:e,field:t.name})).uniqueValueInfos.sort((n,s)=>s.count-n.count).slice(0,Sa),o&&(a=a.map(n=>({...n,value:o.getName(n.value)??n.value}))))}}catch(o){console.error(`Error fetching statistics for field ${t.name}:`,o)}return{summaryStatistics:r,uniqueValues:a}};async function Ia(e,t,r){let a=[],o=[];for(let n of e){let s=function(h){let y=t.get(h)?.layerItem;return y?[y.name&&`Name: ${y.name}`,y.title&&`Title: ${y.title}`,y.description&&`Description: ${y.description}`].filter(Boolean).join(" | "):h},{layerId:l,results:c}=n,d=r.map?.allLayers.find(h=>h.id===l),m=t.get(l)?.fieldRegistry;if(!m)continue;let u=a.find(h=>h.layerId===l);u||(u={layerId:l,layerSummary:s(l),fieldInfos:[]},a.push(u));for(let h of c){let y=m.get(h.name);if(y){if(!y.statistics){let E=ka(d,y).then(f=>{m.set(y.name,{...y,statistics:f}),y.statistics=f});o.push(E)}u.fieldInfos.push(y)}}}return await Promise.all(o),a}var Ca=async(e,t)=>{try{await p({text:"Getting statistics for vector search results"},t);let r=v(t,"layersAndFieldsRegistry"),{mapView:a}=M(t),o=await Ia(e.vectorSearchFieldResults,r,a);return await p({text:"Statistics retrieved"},t),{...e,layerFieldInfo:o}}catch(r){throw await p({text:"Error during fetching statistics"},t),new Error(`Error during fetching statistics: ${r instanceof Error?r.message:String(r)}`)}},Oe=.7,_a=10,$a=async(e,t)=>{try{await p({text:"Similarity search to find fields"},t);let r=v(t,"fieldSearch"),a=v(t,"layersAndFieldsRegistry"),o=v(t,"embeddingCache"),n=await r.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:e.vectorSearchLayerIds,minScore:Oe,topResults:_a,embeddingCache:o}),s=n.map(({layerId:c,results:d})=>{let m=d.map(u=>` - ${u.name} (${u.score.toFixed(2)})`).join(`
65
+ `);return`${a.get(c)?.layerItem.name??c}:
66
+ ${m}`}).join(`
67
+ `),l;return n.length>0?l=`Vector search completed. Matching layers and fields with scores:
68
+ ${s}`:l=`No vector search results found for score over ${Oe}.`,await p({text:l},t),{...e,vectorSearchFieldResults:n}}catch(r){throw await p({text:`Error during vector search: ${r instanceof Error?r.message:String(r)}`},t),new Error(`Vector search failed: ${r instanceof Error?r.message:String(r)}`)}},Na=.7,Fa=async(e,t)=>{try{await p({text:`Similarity search to find layers: ${e.agentExecutionContext.assignedTask}`},t);let r=v(t,"layerSearch"),a=v(t,"layersAndFieldsRegistry"),o=v(t,"embeddingCache"),n=await r.searchLayers({text:e.agentExecutionContext.assignedTask,minScore:Na,embeddingCache:o}),s=n.map(d=>d.id),l=n.map(({id:d,score:m})=>`${a.get(d)?.layerItem.name??d} (${m.toFixed(2)})`).join(`
69
+ `),c;return s.length>0?c=`Vector search completed. Matching layers with scores:
70
+ ${l}`:c="Vector search completed. No matching layers found.",await p({text:c},t),{...e,vectorSearchLayerIds:s}}catch(r){throw await p({text:`Error during vector search: ${r instanceof Error?r.message:String(r)}`},t),new Error(`Vector search failed: ${r instanceof Error?r.message:String(r)}`)}},Aa=(e,t)=>oe(["layerSearch","fieldSearch","layersAndFieldsRegistry"],"Data Exploration Agent")(e,t),Ra=()=>new R(Ze).addNode("requireDataExplorationServices",Aa).addNode("vectorSearchLayers",Fa).addNode("vectorSearchFields",$a).addNode("fieldStatistics",Ca).addNode("queryAgent",wa).addNode("queryTools",Ea).addNode("summarizeQueryResponseLLM",ba).addNode("filterAgent",ya).addNode("filterTools",xa).addNode("earlyExit",$r).addEdge(A,"requireDataExplorationServices").addEdge("requireDataExplorationServices","vectorSearchLayers").addConditionalEdges("vectorSearchLayers",e=>e.vectorSearchLayerIds.length?"vectorSearchFields":"earlyExit").addConditionalEdges("vectorSearchFields",e=>e.vectorSearchFieldResults.length?"fieldStatistics":"earlyExit").addEdge("fieldStatistics","queryAgent").addConditionalEdges("queryAgent",e=>(e.agentExecutionContext.messages[e.agentExecutionContext.messages.length-1]?.tool_calls?.length??0)>0?"queryTools":"filterAgent").addConditionalEdges("queryTools",e=>e.queryResponse.length?"summarizeQueryResponseLLM":"filterAgent").addEdge("summarizeQueryResponseLLM","filterAgent").addConditionalEdges("filterAgent",e=>(e.agentExecutionContext.messages[e.agentExecutionContext.messages.length-1]?.tool_calls?.length??0)>0?"filterTools":T).addEdge("filterTools",T).addEdge("earlyExit",T),qa=String.raw`- **data exploration** — User is asking about the feature layer’s data (e.g. counts, summaries, statistics, field values), either for all features, a subset based on a condition, or for a subset based on the current view. And/Or user wants to include or exclude features based on field values, or visually style features differently (e.g., highlight or deemphasize them).
71
+ The Data Exploration Agent will automatically zoom to the affected features for action taken by this agent. In this case, no need to call navigation tool separately.
72
+ _Example: “Only show stations where Brand is Shell”_
73
+ _Example: “Make Shell stations stand out on the map”_
74
+ _Example: “Gray out all stations that aren’t Shell”_
75
+ This also includes questions that ask which feature meets a given condition or where a particular feature in the data is located (e.g., “Where is the spring with the highest elevation?”). However, this agent does not handle addresses.
76
+ _Example: “How many features are there?”_
77
+ _Example: “What’s the average population?”_
78
+ _Example: “Which values are in the status field?”_`,Fs={id:"dataExploration",name:"Data Exploration Agent",description:qa,createGraph:Ra,workspace:Ze},De=.7,La=10,Ma=async(e,t)=>{try{await p({text:"Similarity search to find fields"},t);let r=v(t,"fieldSearch"),a=v(t,"layersAndFieldsRegistry"),o=v(t,"embeddingCache"),n=await r.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:e.vectorSearchLayerIds,minScore:De,topResults:La,embeddingCache:o}),s=n.map(({layerId:c,results:d})=>{let m=d.map(u=>` - ${u.name} (${u.score.toFixed(2)})`).join(`
79
+ `);return`${a.get(c)?.layerItem.name??c}:
80
+ ${m}`}).join(`
81
+ `),l;return n.length>0?l=`Vector search completed. Matching layers and fields with scores:
82
+ ${s}`:l=`No vector search results found for score over ${De}.`,await p({text:l},t),{...e,vectorSearchFieldResults:n}}catch(r){throw await p({text:`Error during vector search: ${r instanceof Error?r.message:String(r)}`},t),new Error(`Vector search failed: ${r instanceof Error?r.message:String(r)}`)}},za=.7,ja=async(e,t)=>{try{await p({text:`Similarity search to find layers: ${e.agentExecutionContext.assignedTask}`},t);let r=v(t,"layerSearch"),a=v(t,"layersAndFieldsRegistry"),o=await r.searchLayers({text:e.agentExecutionContext.assignedTask,minScore:za}),n=o.map(c=>c.id),s=o.map(({id:c,score:d})=>`${a.get(c)?.layerItem.name??c} (${d.toFixed(2)})`).join(`
83
+ `),l;return n.length>0?l=`Vector search completed. Matching layers with scores:
84
+ ${s}`:l="Vector search completed. No matching layers found.",await p({text:l},t),{...e,vectorSearchLayerIds:n}}catch(r){throw await p({text:`Error during vector search: ${r instanceof Error?r.message:String(r)}`},t),new Error(`Vector search failed: ${r instanceof Error?r.message:String(r)}`)}};async function Oa(e){let{fields:t,layer:r,view:a,styleName:o,colorSchemeTags:n}=e,s;return n?s=yt({basemapTheme:await qe(a),geometryType:r.geometryType,includedTags:n,numColors:Math.min(t.length,8)})[0]:s=wt({basemapTheme:await qe(a),geometryType:r.geometryType,numColors:Math.min(t.length,8)}).primaryScheme,{layer:r,view:a,attributes:t.map(l=>({field:l,label:r.fields.find(c=>c.name===l)?.alias??""})).slice(0,8),outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,includeSizeVariable:o.includes("Size"),pieChartScheme:s}}async function Da(e){return await gt(e)}async function Va({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,includeSize:n}){let s=t,l=e?.allLayers.find(d=>d.id===r);if(!l)return`Could not find layer for id: ${r}`;let c={styleName:n?"chart-size":"chart",fields:a,layer:l,view:s,colorSchemeTags:o};try{let d=await Oa(c),m=await Da(d);return l.renderer=m.renderer,l.visible=!0,`Chart renderer applied to layer: ${l.title??l.id} using fields ${a.join(", ")}`}catch(d){return`Error applying chart renderer: ${d instanceof Error?d.message:String(d)}`}}var Pa=["mapView"];function _(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("LayerStylingAgent context missing");let r=Pa.filter(a=>!(a in t));if(r.length)throw new Error(`LayerStylingAgent context missing: ${r.join(", ")}`);return t}async function Ga({layerId:e,fields:t,colorSchemes:r,includeSize:a},o){let{mapView:n}=_(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await Va({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,includeSize:a})}var Ba=i.object({layerId:i.string().describe("The id of the layer to apply the chart renderer to"),fields:i.array(i.string()).describe("The fields to use for the chart renderer (multiple numeric fields)"),colorSchemes:i.array(i.string()).optional().describe("Optional color scheme tags to use"),includeSize:i.boolean().optional().describe("Whether to vary the chart size (chart-size)")}),Qa=w(Ga,{name:"chart",description:`Label: Charts
85
+ Description: Show the values of two or more categories as a proportion of the total using a pie chart.
86
+ Keywords: pie, chart, all categories, breakdown, proportion
87
+ Example: Show the total number of homes built in each decade using a pie chart for each feature.
88
+ Fields: This style requires 2-8 number fields.
89
+
90
+ Label: Charts and Size
91
+ Description: Show the values of two or more categories as a proportion of the total using a pie chart and use size to capture the total amount or magnitude.
92
+ Keywords: pie, chart, all categories, breakdown, proportion, total, amount, how much, sum, graduated size, proportional size
93
+ Example: Show the total number of homes built in each decade using a pie chart for each feature and vary the size of each chart based on the total of all categories.
94
+ Fields: This style requires 2-8 number fields.`,schema:Ba});function Ua(e){let{fields:t,layer:r,view:a,theme:o,colorSchemeTags:n}=e,s=t[0],l;return n&&(l=ye({geometryType:r.geometryType,includedTags:n,theme:o||"high-to-low"})[0]),{layer:r,view:a,startTime:s,endTime:new Date,theme:o,sizeOptimizationEnabled:!0,outlineOptimizationEnabled:!0,colorScheme:l}}async function Wa(e){return await bt(e)}async function Ka({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,theme:n}){let s=t,l=e?.allLayers.find(d=>d.id===r);if(!l)return`Could not find layer for id: ${r}`;let c={styleName:"color-age",fields:a,layer:l,view:s,colorSchemeTags:o,theme:n};try{let d=Ua(c),m=await Wa(d);return l.renderer=m.renderer,l.visible=!0,`Color-age renderer applied to layer: ${l.title??l.id} using fields ${a.join(", ")}`}catch(d){return`Error applying color-age renderer: ${d instanceof Error?d.message:String(d)}`}}async function Za({layerId:e,fields:t,colorSchemes:r,theme:a},o){let{mapView:n}=_(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await Ka({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,theme:a})}var Ha=i.object({layerId:i.string().describe("The id of the layer to apply the color-age renderer to"),fields:i.array(i.string()).describe("The field(s) to use for the color-age renderer (temporal/date data)"),colorSchemes:i.array(i.string()).optional().describe("Optional color scheme tags to use"),theme:i.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the color ramp")}),Ja=w(Za,{name:"color-age",description:`Label: Age (color)
95
+ Description: Use colors along a continuous color ramp to represent the age of features. Age reflects the length of time from a start date to an end date.
96
+ Keywords: since, age, how old, how long
97
+ Example: Show the age of each feature based on its reported date.
98
+ Fields: This style requires at least one field with a date type.`,schema:Ha});function Ya(e){let{fields:t,layer:r,view:a,colorSchemeTags:o}=e,{theme:n}=e,s=t[1],l=t[0],c;return o&&(c=ye({geometryType:r.geometryType,includedTags:o,theme:n||"high-to-low"})[0]),{layer:r,view:a,field:l,normalizationField:s,theme:n,sizeOptimizationEnabled:!0,outlineOptimizationEnabled:!0,colorScheme:c}}async function Xa(e){return await xt(e)}async function eo({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,theme:n}){let s=t,l=e?.allLayers.find(d=>d.id===r);if(!l)return`Could not find layer for id: ${r}`;let c={styleName:"color",fields:a,layer:l,view:s,colorSchemeTags:o,theme:n};try{let d=Ya(c),m=await Xa(d);return l.renderer=m.renderer,l.visible=!0,`Color renderer applied to layer: ${l.title??l.id} using fields ${a.join(", ")}`}catch(d){return`Error applying color renderer: ${d instanceof Error?d.message:String(d)}`}}async function to({layerId:e,fields:t,colorSchemes:r,theme:a},o){let{mapView:n}=_(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await eo({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,theme:a})}var ro=i.object({layerId:i.string().describe("The id of the layer to apply the color renderer to"),fields:i.array(i.string()).describe("The field(s) to use for the color renderer"),colorSchemes:i.array(i.string()).optional().describe("Optional color scheme tags to use"),theme:i.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the color ramp")}),ao=w(to,{name:"color",description:`Label: Counts and Amounts (color)
99
+ Description: Vary color along a continuous color ramp to represent numeric or ranked data.
100
+ Keywords: graduated color, choropleth, continuous color, hue, color, gradation, saturation, lightness, percent, rate, ratio, index, how much, increase, decrease
101
+ Example: Color each feature based on the population density.
102
+ Fields: This style requires a single field with a number type. A second number field may be specified for normalizing the value of the first field.`,schema:ro});function oo(e){let{fields:t,layer:r,view:a,colorSchemeTags:o,theme:n}=e,s,l,c=t[0];return o&&(l=ye({geometryType:r.geometryType,includedTags:o,theme:n||"high-to-low"})[0]),{layer:r,view:a,field:c,normalizationField:s,theme:n,colorOptions:{colorScheme:l}}}async function no(e){return await vt(e)}async function io({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,theme:n}){let s=t,l=e?.allLayers.find(d=>d.id===r);if(!l)return`Could not find layer for id: ${r}`;let c={styleName:"color-size-univariate",fields:a,layer:l,view:s,colorSchemeTags:o,theme:n};try{let d=oo(c),m=await no(d);return l.renderer=m.renderer,l.visible=!0,`Color-size-univariate renderer applied to layer: ${l.title??l.id} using fields ${a.join(", ")}`}catch(d){return`Error applying color-size-univariate renderer: ${d instanceof Error?d.message:String(d)}`}}async function so({layerId:e,fields:t,colorSchemes:r,theme:a},o){let{mapView:n}=_(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await io({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,theme:a})}var lo=i.object({layerId:i.string().describe("The id of the layer to apply the color-size univariate renderer to"),fields:i.array(i.string()).describe("The fields to use for the color-size univariate renderer"),colorSchemes:i.array(i.string()).optional().describe("Optional color scheme tags to use"),theme:i.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the color and size ramps")}),co=w(so,{name:"color-size-univariate",description:`Label: Color and Size (univariate)
103
+ Description: Vary symbol size and color based on the values of two numeric attributes.
104
+ Keywords: continuous color, hue, color, size, gradation, saturation, lightness, percent, rate, ratio, index, how much, increase, decrease, amount
105
+ Example: Color each feature based on the percentage of the population that owns a home and vary the size of each point based on total population.
106
+ Fields: This style requires at least two fields: one determining the color of each feature, the other determining the size of each feature. Each field may be normalized by an additional normalization field.`,schema:lo});function uo(e){let{fields:t,layer:r,view:a,colorSchemeTags:o}=e,n;return o&&(n=St({includedTags:o,numColors:Math.min(t.length,8)})[0]),{layer:r,view:a,legendOptions:{unit:"units"},attributes:t.map(s=>({field:s,label:r.fields.find(l=>l.name===s)?.alias??""})).slice(0,8),outlineOptimizationEnabled:!0,dotDensityScheme:n}}async function mo(e){return await Et(e)}async function ho({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o}){let n=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let l={styleName:"dot-density",fields:a,layer:s,view:n,colorSchemeTags:o};try{let c=uo(l),d=await mo(c);return s.renderer=d.renderer,s.visible=!0,`Dot Density renderer applied to layer: ${s.title??s.id} using fields ${a.join(", ")}`}catch(c){return`Error applying dot density renderer: ${c instanceof Error?c.message:String(c)}`}}async function po({layerId:e,fields:t,colorSchemes:r},a){let{mapView:o}=_(a);return await I({type:"show-legend",data:{layerIds:[e]}},a),await ho({arcgisMap:o.map,arcgisMapView:o,layerId:e,fields:t,colorSchemes:r})}var fo=i.object({layerId:i.string().describe("The id of the layer to apply the dot density renderer to"),fields:i.array(i.string()).describe("The field(s) to use for the dot density renderer (population or count data)"),colorSchemes:i.array(i.string()).optional().describe("Optional color scheme tags to use")}),go=w(po,{name:"dot-density",description:`Dot Density
107
+ Use dot density to visualize the distribution of one attribute or compare the density of multiple attributes. This is only valid for polygon layers.
108
+ **Use cases:**
109
+ - Population distribution visualization
110
+ - Comparing multiple categories within areas
111
+ - Showing spatial distribution patterns
112
+ **Examples:**
113
+ - Show the density of the population based on various race/ethnic groups
114
+ - Visualize distribution of different crops across regions
115
+ - Display demographic patterns within census tracts
116
+ **Fields:** Requires 2-8 number fields.
117
+ **Keywords:** density, how much, how many, total, number, amount`,schema:fo});function yo(e){let{fields:t,layer:r,view:a,colorSchemeTags:o}=e,n,s=t[0];return o&&(n=kt({includedTags:o,basemap:a.map?.basemap||"topo"})[0]),{layer:r,view:a,field:s,heatmapScheme:n}}async function wo(e){return await Tt(e)}async function bo({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o}){let n=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let l={styleName:"heatmap",fields:a,layer:s,view:n,colorSchemeTags:o};try{let c=yo(l),d=await wo(c);return s.renderer=d.renderer,s.visible=!0,`Heatmap renderer applied to layer: ${s.title??s.id} using fields ${a.join(", ")}`}catch(c){return`Error applying heatmap renderer: ${c instanceof Error?c.message:String(c)}`}}async function xo({layerId:e,fields:t,colorSchemes:r},a){let{mapView:o}=_(a);return await I({type:"show-legend",data:{layerIds:[e]}},a),await bo({arcgisMap:o.map,arcgisMapView:o,layerId:e,fields:t,colorSchemes:r})}var vo=i.object({layerId:i.string().describe("The id of the layer to apply the heatmap renderer to"),fields:i.array(i.string()).describe("The field(s) to use for the heatmap renderer (typically point density)"),colorSchemes:i.array(i.string()).optional().describe("Optional color scheme tags to use")}),Eo=w(xo,{name:"heatmap",description:`Label: Heat Map
118
+ Description: Show areas of high density with colors that appear to glow hotter. This is only valid for point layers.
119
+ Keywords: density, heatmap, hot spots, pattern, cluster
120
+ Example: Create a heatmap
121
+ Fields: This typically requires zero or one field of type number.`,schema:vo});function So(e){let{fields:t,layer:r,view:a,styleName:o,colorSchemeTags:n}=e,s;return n&&(s=Ct({geometryType:r.geometryType,includedTags:n,numColors:Math.min(t.length,10)})[0]),{layer:r,view:a,fields:t.map(l=>({name:l})).slice(0,9),outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,includeSizeVariable:o.includes("Size"),predominanceScheme:s}}async function To(e){return await It(e)}async function ko({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,includeSize:n}){let s=t,l=e?.allLayers.find(d=>d.id===r);if(!l)return`Could not find layer for id: ${r}`;let c={styleName:n?"predominance-size":"predominance",fields:a,layer:l,view:s,colorSchemeTags:o};try{let d=So(c),m=await To(d);return l.renderer=m.renderer,l.visible=!0,`Predominance renderer applied to layer: ${l.title??l.id} using fields ${a.join(", ")}`}catch(d){return`Error applying predominance renderer: ${d instanceof Error?d.message:String(d)}`}}async function Io({layerId:e,fields:t,colorSchemes:r,includeSize:a},o){let{mapView:n}=_(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await ko({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,includeSize:a})}var Co=i.object({layerId:i.string().describe("The id of the layer to apply the predominance renderer to"),fields:i.array(i.string()).describe("The fields to use for the predominance renderer (competing categories)"),colorSchemes:i.array(i.string()).optional().describe("Optional color scheme tags to use"),includeSize:i.boolean().optional().describe("Whether to include size visualization (predominance-size)")}),_o=w(Io,{name:"predominance",description:`Label: Predominant category
122
+ Description: Compare attributes that share a common subject and unit of measurement to see which has the highest value.
123
+ Keywords: predominant, winner, won, competing, most, most common, most frequent, dominant, prevalent, top
124
+ Example: Using fields for Corn Acres, Wheat Acres, and Cotton Acres, show the predominant crop harvested in each area.
125
+ Fields: This style relies on 2-10 number fields.
126
+
127
+ Label: Predominant category and Size
128
+ Description: Compare attributes that share a common subject and unit of measurement to see which has the highest value. Also varies the size of each symbol based on the total of all categories.
129
+ Keywords: predominant, winner, won, competing, most, most common, most frequent, dominant, prevalent, top, amount, total, how much, proportional size, graduated size, sum
130
+ Example: Show the predominant crop in each area and vary the size of each symbol based on the total of all categories.
131
+ Fields: This style relies on 2-10 number fields.`,schema:Co});function $o(e){let{fields:t,layer:r,view:a,colorSchemeTags:o}=e,n,s={field:t[0]},l={field:t[1]};return o&&(n=$t({geometryType:r.geometryType,includedTags:o})[0]),{layer:r,view:a,field1:s,field2:l,outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,relationshipScheme:n}}async function No(e){return await _t(e)}async function Fo({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o}){let n=t,s=e?.allLayers.find(c=>c.id===r);if(!s)return`Could not find layer for id: ${r}`;let l={styleName:"relationship",fields:a,layer:s,view:n,colorSchemeTags:o};try{let c=$o(l),d=await No(c);return s.renderer=d.renderer,s.visible=!0,`Relationship renderer applied to layer: ${s.title??s.id} using fields ${a.join(", ")}`}catch(c){return`Error applying relationship renderer: ${c instanceof Error?c.message:String(c)}`}}async function Ao({layerId:e,fields:t,colorSchemes:r},a){let{mapView:o}=_(a);return await I({type:"show-legend",data:{layerIds:[e]}},a),await Fo({arcgisMap:o.map,arcgisMapView:o,layerId:e,fields:t,colorSchemes:r})}var Ro=i.object({layerId:i.string().describe("The id of the layer to apply the relationship renderer to"),fields:i.array(i.string()).describe("The two fields to use for the relationship renderer (bivariate visualization)"),colorSchemes:i.array(i.string()).optional().describe("Optional color scheme tags to use")}),qo=w(Ao,{name:"relationship",description:`Label: Relationship
132
+ Description: Overlays two color ramps to represent the relationship between two numeric attributes.
133
+ Keywords: relationship, correlation, compare, related, bivariate choropleth, bivariate color
134
+ Example: Show the relationship between tree height and carbon storage
135
+ Fields: This style requires two number fields.`,schema:Ro});function Lo(e){let{fields:t,layer:r,view:a,theme:o}=e,n=t[0];return{layer:r,view:a,startTime:n,endTime:new Date,theme:o,sizeOptimizationEnabled:!0,outlineOptimizationEnabled:!0}}async function Mo(e){return await Nt(e)}async function zo({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,theme:n}){let s=t,l=e?.allLayers.find(d=>d.id===r);if(!l)return`Could not find layer for id: ${r}`;let c={styleName:"size-age",fields:a,layer:l,view:s,colorSchemeTags:o,theme:n};try{let d=Lo(c),m=await Mo(d);return l.renderer=m.renderer,l.visible=!0,`Size-age renderer applied to layer: ${l.title??l.id} using fields ${a.join(", ")}`}catch(d){return`Error applying size-age renderer: ${d instanceof Error?d.message:String(d)}`}}async function jo({layerId:e,fields:t,colorSchemes:r,theme:a},o){let{mapView:n}=_(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await zo({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,theme:a})}var Oo=i.object({layerId:i.string().describe("The id of the layer to apply the size-age renderer to"),fields:i.array(i.string()).describe("The field(s) to use for the size-age renderer (temporal data with size)"),colorSchemes:i.array(i.string()).optional().describe("Optional color scheme tags to use"),theme:i.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the size ramp")}),Do=w(jo,{name:"size-age",description:`Label: Age (size)
136
+ Description: Vary symbol sizes along a continuous ramp to represent the age of features. Age reflects the length of time from a start date to an end date.
137
+ Keywords: since, age, how old, how long
138
+ Example: Change the size of features so older features are larger than new features.
139
+ Fields: This style requires at least one field with a date type.`,schema:Oo});function Vo(e){let{fields:t,layer:r,view:a}=e,{theme:o}=e,n=t[1],s=t[0];return{layer:r,view:a,field:s,normalizationField:n,theme:o,sizeOptimizationEnabled:!0,outlineOptimizationEnabled:!0}}async function Po(e){return await Ft(e)}async function Go({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,theme:n}){let s=t,l=e?.allLayers.find(d=>d.id===r);if(!l)return`Could not find layer for id: ${r}`;let c={styleName:"size",fields:a,layer:l,view:s,colorSchemeTags:o,theme:n};try{let d=Vo(c),m=await Po(d);return l.renderer=m.renderer,l.visible=!0,`Size renderer applied to layer: ${l.title??l.id} using fields ${a.join(", ")}`}catch(d){return`Error applying size renderer: ${d instanceof Error?d.message:String(d)}`}}async function Bo({layerId:e,fields:t,colorSchemes:r,theme:a},o){let{mapView:n}=_(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await Go({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,theme:a})}var Qo=i.object({layerId:i.string().describe("The id of the layer to apply the size renderer to"),fields:i.array(i.string()).describe("The field(s) to use for the size renderer (numeric data)"),colorSchemes:i.array(i.string()).optional().describe("Optional color scheme tags to use"),theme:i.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the size ramp")}),Uo=w(Bo,{name:"size",description:`Label: Counts and Amounts (size)
140
+ Description: Vary symbol sizes along a continuous ramp to represent numeric or ranked data.
141
+ Keywords: graduated size, proportional size, how much, total, number, amount, size
142
+ Example: Vary the size of each point based on the total population.
143
+ Fields: This style requires a single field with a number type. A second number field may be specified for normalizing the value of the first field.
144
+
145
+ Label: Continuous Timeline (size)
146
+ Description: Vary symbol sizes along a continuous ramp to represent dates.
147
+ Keywords: graduated size, proportional size, classed size, how much, total, number, when
148
+ Example: Vary the size of each feature based on the date a ticket was completed.
149
+ Fields: This style requires a single field with a date type.`,schema:Qo});function Wo(e){let{fields:t,layer:r,view:a,colorSchemeTags:o}=e,n=t[0],s=t[1],l=t[2],c;return o&&(c=Rt({geometryType:r.geometryType,includedTags:o})[0]),{layer:r,view:a,field:n,field2:s,field3:l,outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,typeScheme:c}}async function Ko(e){return await At(e)}async function Zo({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,theme:n}){let s=t,l=e?.allLayers.find(d=>d.id===r);if(!l)return`Could not find layer for id: ${r}`;let c={styleName:"type",fields:a,layer:l,view:s,colorSchemeTags:o,theme:n};try{let d=Wo(c),m=await Ko(d);return l.renderer=m.renderer,l.visible=!0,`Type renderer applied to layer: ${l.title??l.id} using fields ${a.join(", ")}`}catch(d){return`Error applying type renderer: ${d instanceof Error?d.message:String(d)}`}}async function Ho({layerId:e,fields:t,colorSchemes:r,theme:a},o){let{mapView:n}=_(o);return await I({type:"show-legend",data:{layerIds:[e]}},o),await Zo({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,theme:a})}var Jo=i.object({layerId:i.string().describe("The id of the layer to apply the type renderer to"),fields:i.array(i.string()).describe("The field(s) to use for the type renderer (categorical data)"),colorSchemes:i.array(i.string()).optional().describe("Optional color scheme tags to use"),theme:i.enum(["above-and-below","above","below","centered-on","extremes","high-to-low"]).optional().describe("Optional theme for the color scheme")}),Yo=w(Ho,{name:"type",description:`Label: Types (unique symbols)
150
+ Description: Represent features as categories with different symbol colors or shapes. Examples include type of tree, road class, or province name.
151
+ Keywords: categorical, category, type, unique, discrete, point of interest, region, group
152
+ Example: Color each feature based on the region it belongs to
153
+ Fields: This style requires a single field which may be a string, number, or date type. It is usually a string.`,schema:Jo}),Xe=[Qa,Ja,ao,co,go,Eo,_o,qo,Do,Uo,Yo],Xo=async(e,t)=>{await p({text:"Requesting LLM for layer query results"},t);let r=await L("navigation_intent_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer query tools");let a={layerFieldInfo:e.layerFieldInfo},o=await j({promptText:r,modelTier:"advanced",messages:$(e.agentExecutionContext.messages),inputVariables:a,tools:Xe});return await be(o,t),{...e,agentExecutionContext:{...e.agentExecutionContext,messages:[...e.agentExecutionContext.messages,o]}}};async function en(e,t){let r=await new q(Xe).invoke({messages:$(e.agentExecutionContext.messages)},t),a=r.messages.map(n=>n.text).join(`
154
+ `);await p({text:`Finished executing layer filter tool: ${a}`},t);let o=r.messages.map(n=>n.text).join(`
155
+ `);return{...e,outputMessage:o}}var et=g.Root({agentExecutionContext:g({reducer:Q,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[]})}),outputMessage:g({reducer:U,default:()=>""}),vectorSearchLayerIds:g(),vectorSearchFieldResults:g(),layerFieldInfo:g(),selectedLayerId:g()}),tn=async(e,t)=>(await p({text:"Exiting Layer Styling agent"},t),e),rn=async(e,t)=>{try{await p({text:"Populating layer and field info"},t);let r=[];for(let a of e.vectorSearchFieldResults){let o=function(m){let u=l.get(m)?.layerItem;return u?[u.name&&`Name: ${u.name}`,u.title&&`Title: ${u.title}`,u.description&&`Description: ${u.description}`].filter(Boolean).join(" | "):m},{layerId:n,results:s}=a,l=v(t,"layersAndFieldsRegistry"),c=l.get(n)?.fieldRegistry;if(!c)continue;let d=r.find(m=>m.layerId===n);d||(d={layerId:n,layerSummary:o(n),fieldInfos:[]},r.push(d));for(let m of s){let u=c.get(m.name);u&&d.fieldInfos.push(u)}}return await p({text:"Populated layerFieldInfo"},t),{...e,layerFieldInfo:r}}catch(r){throw await p({text:"Error populating layerFieldInfo"},t),new Error(`Error populating layerFieldInfo: ${r instanceof Error?r.message:String(r)}`)}},an=(e,t)=>{let r=e.vectorSearchLayerIds??[];if(r.length<=1)return{...e,selectedLayerId:e.vectorSearchLayerIds[0]};let{hitlResponse:a}=t.configurable;if(!a||a.agentId!==Ve.id||a.id!=="reviewLayerSelection"){let n={agentId:Ve.id,id:"reviewLayerSelection",kind:"singleSelection",message:"Choose a layer to apply the styles.",metadata:[...r]};throw new ke(n)}let o=null;return Array.isArray(a.payload)&&a.payload.length>0&&(o=a.payload[0]),{...e,selectedLayerId:o??e.vectorSearchLayerIds[0]}},on=(e,t)=>oe(["layerSearch","fieldSearch","layersAndFieldsRegistry"],"Layer Styling Agent")(e,t),nn=()=>new R(et).addNode("requireLayerStylingServices",on).addNode("vectorSearchLayers",ja).addNode("layerSelectionHITL",an).addNode("vectorSearchFields",Ma).addNode("populateLayerFieldInfo",rn).addNode("agent",Xo).addNode("tools",en).addNode("earlyExit",tn).addEdge(A,"requireLayerStylingServices").addEdge("requireLayerStylingServices","vectorSearchLayers").addConditionalEdges("layerSelectionHITL",e=>e.vectorSearchLayerIds.length?"vectorSearchFields":"earlyExit").addConditionalEdges("vectorSearchFields",e=>e.vectorSearchFieldResults.length?"populateLayerFieldInfo":"earlyExit").addEdge("populateLayerFieldInfo","agent").addEdge("agent","tools").addEdge("tools",T).addEdge("earlyExit",T),sn=String.raw`- **layerStyling** — User wants to change how features are drawn or styled on the map based on their data, such as applying color, size, transparency, symbols, or charts according to field values.
156
+ _Example: “Color points by sales amount”_
157
+ _Example: “Show population density with a color gradient”_
158
+ _Example: “Create a relationship map between height and depth”_
159
+ _Example: “Vary circle sizes according to population”_`,Ve={id:"layerStyling",name:"Layer Styling Agent",description:sn,createGraph:nn,workspace:et},tt=g.Root({agentExecutionContext:g({reducer:Q,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[]})}),outputMessage:g({reducer:U,default:()=>""}),summary:g({reducer:D,default:()=>""}),status:g({reducer:D,default:()=>"success"})}),ln=(e,t)=>{let r=Array.from(e.values()).find(({layerItem:n})=>n.title?.toLowerCase().includes(t.toLowerCase()));if(!r){let n=Array.from(e.values()).map(s=>s.layerItem.title).join(", ");return`Could not find a layer matching "${t}". Available layers: ${n}`}let a=Array.from(r.fieldRegistry.values()),o=a.map(n=>`- **${n.alias||n.name}** (\`${n.name}\`, ${n.type})${n.description?`: ${n.description}`:""}`).join(`
160
+ `);return`**${r.layerItem.title}** has ${a.length} field(s):
161
+
162
+ ${o}`},cn=async({layerTitle:e},t)=>{let r=v(t,"layersAndFieldsRegistry");return ln(r,e)},dn=w(cn,{name:"listLayerFields",description:"Lists all fields for a given layer by title. Use when the user asks to see fields, columns, or attributes of a specific layer.",schema:i.object({layerTitle:i.string().describe("The title or partial title of the layer to list fields for.")})}),rt=[dn],un=e=>{if(!e||e.size===0)return"No layers available in this map.";let t=Array.from(e.values()).map(({layerItem:r,fieldRegistry:a},o)=>{let n=Array.from(a.values()).map(l=>l.name).slice(0,10).join(", "),s=a.size>10?` (and ${a.size-10} more)`:"";return`${o+1}. "${r.title}". Description: ${r.description}
163
+ Fields: ${n}${s}`}).join(`
164
+
165
+ `);return`This map contains ${e.size} layer(s):
166
+
167
+ ${t}`},mn=e=>{let t=e?.list()??[];return t.length?t.map(r=>`- ${r.agent.name}: ${r.agent.description}`).join(`
168
+ `):"No agents currently available."};async function hn(e,t){let r=await L("help_prompt"),a=v(t,"layersAndFieldsRegistry"),o=v(t,"agentRegistry");try{let n=await j({promptText:r,modelTier:"fast",tools:rt,inputVariables:{layerSummary:un(a),agents:mn(o),assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps}}),s=n.content.toString(),l=[...e.agentExecutionContext.messages,n];return{...e,agentExecutionContext:{...e.agentExecutionContext,messages:l},outputMessage:s,summary:"Provided map-related help based on the assigned task.",status:"success"}}catch(n){let s=n instanceof Error?n.message:String(n);return{...e,outputMessage:`Error invoking help agent: ${s}`,summary:"Help agent execution failed.",status:"failed"}}}var pn=(e,t)=>oe(["agentRegistry"],"Help Agent")(e,t);async function fn(e,t){let r=await new q(rt).invoke({messages:e.agentExecutionContext.messages},t),a=[...e.agentExecutionContext.messages,...r.messages],o=r.messages.map(n=>n.text).join(`
169
+ `);return{...e,agentExecutionContext:{...e.agentExecutionContext,messages:a},outputMessage:o}}var gn=()=>new R(tt).addNode("requireHelpServices",pn).addNode("agent",hn).addNode("tools",fn).addEdge(A,"requireHelpServices").addEdge("requireHelpServices","agent").addConditionalEdges("agent",e=>(e.agentExecutionContext.messages[e.agentExecutionContext.messages.length-1]?.tool_calls?.length??0)>0?"tools":T).addEdge("tools",T),yn=String.raw`- **help** — Enables users to ask questions about the map, layers, fields, and it's capabilities.
170
+
171
+ _Example: “Tell me about this map”_
172
+ _Example: “List all layers in this map”_
173
+ _Example: “List fields in protected areas layer”_
174
+ _Example: “What agents are available to me?”_
175
+ _Example: “What can you do?”_
176
+ _Example: “What can I ask”_
177
+
178
+ Even if the user asks unrelated queries like "What are the vowels in English alphabet" or "How to cook", call this agent.
179
+
180
+ IF the user asks map related queries, but those that are not performed by any of the agents, call this agent so we can respond accordingly.
181
+ _Example: "Create a chart"_
182
+ _Example: "Create a table"_`,As={id:"help",name:"Help Agent",description:yn,createGraph:gn,workspace:tt},Rs=g.Root({agentExecutionContext:g({reducer:Q,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[]})}),outputMessage:g({reducer:U,default:()=>""}),intent:g({reducer:(e,t)=>t})}),J={conversationId:""},wn=["linkChartView"],bn=["knowledgeGraph"];function ie(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("ArcgisKnowledgeAgent context missing");let r=wn.filter(a=>!(a in t));if(r.length)throw new Error(`Link Chart context missing: ${r.join(", ")}`);return t}function ve(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("ArcgisKnowledgeAgent context missing");let r=bn.filter(a=>!(a in t));if(r.length)throw new Error(`Knowledge Graph context missing: ${r.join(", ")}`);return t}var he=class{constructor(t){this.dataModel=t,this.kind="GraphQueryGenerationRequest",this.explainQuery=!0,this.schemaInformation=pe.fromDataModel(t)}},pe=class e{constructor(){this.schemaType="ArcgisGraphSchema",this.entityTypes=[],this.relationshipTypes=[],this.identifierInfo={mappingInfo:{identifierMapsTo:"UniformPropertyIdentifier",identifierPropertyName:"globalid"}}}static fromDataModel(t){let r=new e;for(let a of t.entityTypes)r.entityTypes.push(B.fromEntityType(a));for(let a of t.relationshipTypes)r.relationshipTypes.push(fe.fromRelationshipType(a));return r.identifierInfo={mappingInfo:{identifierMapsTo:xn(t.identifierInfo.identifierMappingInfo.identifierInfoType),identifierPropertyName:t.identifierInfo.identifierMappingInfo.uniformPropertyIdentifier.identifierPropertyName}},r.spatialReference=JSON.parse(JSON.stringify(t.spatialReference)),r}},B=class e{constructor(){this.name="",this.properties=[]}static fromEntityType(t){let r=new e;r.name=t.name,r.alias=t.alias?t.alias:void 0,r.role=vn(t.role);for(let a of t.properties){let o={name:a.name,alias:a.alias?a.alias:void 0,fieldType:a.fieldType,role:En(a.role),geometryDef:a.fieldType==="esriFieldTypeGeometry"?{geometryType:a.geometryType??"esriGeometryAny",hasM:a.hasM?a.hasM:void 0,hasZ:a.hasZ?a.hasZ:void 0}:void 0};r.properties.push(o)}return r}},fe=class extends B{constructor(){super(...arguments),this.observedEndPoints=[]}static fromRelationshipType(t){let r=B.fromEntityType(t);r.observedEndPoints=[];for(let a of t.endPoints)r.observedEndPoints.push({originEntityType:a.originEntityType,destinationEntityType:a.destinationEntityType});return r}},xn=e=>{switch(e){case"esriIdentifierInfoTypeUNSPECIFIED":return"UNSPECIFIED";case"esriIdentifierInfoTypeDatabaseNative":return"DatabaseNative";case"esriIdentifierInfoTypeUniformProperty":return"UniformPropertyIdentifier";default:return e}},vn=e=>{switch(e){case"Regular":return"esriGraphNamedObjectRegular";case"Provenance":return"esriGraphNamedObjectProvenance";case"Document":return"esriGraphNamedObjectDocument";default:return e}};function En(e){switch(e){case"esriGraphPropertyRegular":return"Regular";case"esriGraphPropertyDocumentName":return"Document_Name";case"esriGraphPropertyDocumentTitle":return"Document_Title";case"esriGraphPropertyDocumentUrl":return"Document_Url";case"esriGraphPropertyDocumentText":return"Document_Text";case"esriGraphPropertyDocumentKeywords":return"Document_Keywords";case"esriGraphPropertyDocumentContentType":return"Document_ContentType";case"esriGraphPropertyDocumentMetadata":return"Document_Metadata";case"esriGraphPropertyDocumentFileExtension":return"Document_FileExtension";case"esriGraphPropertyProvenanceInstanceId":return"Provenance_InstanceId";case"esriGraphPropertyProvenanceSourceType":return"Provenance_SourceType";case"esriGraphPropertyProvenanceSourceName":return"Provenance_SourceName";case"esriGraphPropertyProvenanceSource":return"Provenance_Source";case"esriGraphPropertyProvenanceComment":return"Provenance_Comment";case"esriGraphPropertyProvenanceTypeName":return"Provenance_TypeName";case"esriGraphPropertyProvenancePropertyName":return"Provenance_PropertyName";default:return"Regular"}}async function Sn(e,t,r,a){let{graphQuery:o,explanation:n}=await Ee(e,t,r,a);return`Generated Graph Query:
183
+ ${o}
184
+
185
+ Explanation: ${n}`}async function Ee(e,t,r,a){let o={message:e,context:new he(t)};J.conversationId&&(o.conversationId=J.conversationId),await p({text:"Attempting to generate a cypher query from your prompt..."},a);let n=await Le(`${r}/chat`,{method:"post",body:JSON.stringify(o),headers:{"Content-Type":"application/json",token:Me.findCredential(O.getDefault().url)?.token??""}});if(n.httpStatus!==200)throw new Error(`Graph query service returned an error: ${n.httpStatus}`,{cause:n.data});J.conversationId||(J.conversationId=n.data.conversationId);let s=!1,l=Date.now(),c=n.data.sequenceNumber,d="",m="",u=1;for(;!s;){await new Promise(y=>setTimeout(y,1e3)),await p({text:`Periodically requesting status of job from ArcGIS AI Services${"...".substring(0,u)}`},a),u=u%3+1;let h=await Le(`${r}/chat`,{method:"post",body:JSON.stringify({conversationId:n.data.conversationId,inquiryId:n.data.inquiryId,ackSequenceNumber:c}),headers:{"Content-Type":"application/json",token:Me.findCredential(O.getDefault().url)?.token??""}});if(h.httpStatus!==200)throw new Error(`Graph query service polling returned an error: ${h.httpStatus}`,{cause:h.data});if(h.data.context)d=h.data.context.graphQuery,m=h.data.message||"";else if(!h.data.hasMore)s=!0;else if(Date.now()-l>6e4)throw new Error("Graph query service polling timed out after 1 minute.");c=h.data.sequenceNumber}return{graphQuery:d,explanation:m}}function Y(e,t){if(!(!e||typeof e!="object")){if(kn(e))for(let r of e.path)Y(r,t);else if(Tn(e))t.set(`${e.typeName}__${e.id}`,{id:e.id,typeName:e.typeName});else if(Array.isArray(e))for(let r of e)Y(r,t);else if(In(e))for(let r of Object.values(e.properties??{}))Y(r,t)}}function Tn(e){return!e||typeof e!="object"||Array.isArray(e)?!1:"id"in e&&"typeName"in e}function kn(e){return!e||typeof e!="object"||Array.isArray(e)?!1:e&&"path"in e&&Array.isArray(e.path)}function In(e){return!e||typeof e!="object"||Array.isArray(e)||"id"in e?!1:"properties"in e&&typeof e.properties=="object"}function Cn(e,t){let r=[];for(let a of[...t.dataModel.entityTypes,...t.dataModel.relationshipTypes]){let o=e.getMemberIdsByType(a.name);for(let n of o)r.push({id:n,typeName:a.name})}return r}var _n=async e=>{let t=new Map,r=e.resultRowsStream.getReader();for(;;){let{done:a,value:o}=await r.read();if(a)break;for(let n of o)for(let s of n)Y(s,t)}return Array.from(t.values())};async function $n(e,t,r,a,o){let{graphQuery:n,explanation:s}=await Ee(e,t.dataModel,r,o);await p({text:`Attempting to execute query: ${n.substring(0,500)}${n.length>500?"...":""}`},o);let l=await qt(t,new We({openCypherQuery:n}),{signal:o?.signal,timeout:o?.timeout}),c=await _n(l);return await p({text:`Query Results parsed into ${c.length} unique relationships and entities. Atempting to add to link chart...`},o),await a.map.addRecords(c),a.goTo(a.map.diagramNodesExtent),`Link Chart updated successfully. Cypher Query used:
186
+ ${n}
187
+
188
+ Explanation: ${s}`}async function Nn({prompt:e},t){let{knowledgeGraph:r}=ve(t),{linkChartView:a}=ie(t),o=O.getDefault().helperServices,n=await L("arcgis_knowledge_current_lc_context"),s=Cn(a.map,r),l=`${e}
189
+
190
+ ${n}${JSON.stringify(s)}`;return await $n(l,r,`${o.aiAssistantServices.url}${o.aiAssistantServices.graphQueryAssistant}`,a,t)}var Fn=i.object({prompt:i.string().describe("The user's inquiry into the knowledge graph that needs to be run.")}),qs=w(Nn,{name:"addRecords",description:"Adds records (entities or relationships) to the current link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the records to be added to the link chart. The user should have explicitly requested to add records to the current link chart from their prompt.",schema:Fn});async function An(e,t){return await t.map.applyLayout(e),`Successfully applied layout: ${e}.`}async function Rn({layout:e},t){let{linkChartView:r}=ie(t);return await An(e,r)}var qn=i.object({layout:i.enum(["organic-standard","organic-community","basic-grid","hierarchical-bottom-to-top","radial-root-centric","tree-left-to-right","geographic-organic-standard","chronological-mono-timeline","chronological-multi-timeline"]).describe("The layout mode to apply to the link chart. The value must be one of the following: organic-standard, organic-community, basic-grid, hierarchical-bottom-to-top, radial-root-centric, tree-left-to-right, geographic-organic-standard, chronological-mono-timeline, chronological-multi-timeline")}),Ls=w(Rn,{name:"applyLayout",description:"Apply a diagram layout to the link chart",schema:qn});function Ln(e,t){return t.map.changeNonspatialDataDisplay(e),`Successfully applied nonspatial visibility setting: ${e}.`}function Mn({setting:e},t){let{linkChartView:r}=ie(t);return Ln(e,r)}var zn=i.object({setting:i.enum(["hidden","visible"]).describe("The setting of nonspatial visibility")}),Ms=w(Mn,{name:"changeNonspatialVisibility",description:"Change whether or not nonspatial data is visible in the link chart. The value must be either 'hidden' or 'visible'.",schema:zn});async function jn(e,t,r,a,o){let{graphQuery:n,explanation:s}=await Ee(e,t.dataModel,r,o);await p({text:`Attempting to create link chart from derived query: ${n}`},o);let l=await Lt.fromCypherQuery(t,new We({openCypherQuery:n}));return await p({text:"Link chart created successfully, loading..."},o),a.map=l,await l.load(),await a.when(),`Link chart created successfully. Cypher Query used to create the link chart:
191
+ ${n}
192
+
193
+ Explanation: ${s}`}async function On({prompt:e},t){let{knowledgeGraph:r}=ve(t),{linkChartView:a}=ie(t),o=O.getDefault().helperServices;return await jn(e,r,`${o.aiAssistantServices.url}${o.aiAssistantServices.graphQueryAssistant}`,a,t)}var Dn=i.object({prompt:i.string().describe("The user's inquiry into the knowledge graph that needs to be transformed into a link chart visualization.")}),zs=w(On,{name:"createLinkChart",description:"Creates a new link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the new link chart. The user should have explicitly requested the creation of a new link chart from their prompt.",schema:Dn});async function Vn({prompt:e},t){let{knowledgeGraph:r}=ve(t),a=O.getDefault().helperServices;return await Sn(e,r.dataModel,`${a.aiAssistantServices.url}${a.aiAssistantServices.graphQueryAssistant}`,t)}var Pn=i.object({prompt:i.string().describe("The user's inquiry into the knowledge graph that needs to be translated into a cypher query.")}),js=w(Vn,{name:"generateCypher",description:"Generates an Open Cypher query based on the user's prompt which represents an inquiry into the data of the knowledge service and its graph database, attempting to filter based on certain conditions and traverse specified relationships. The generated query should be syntactically correct and optimized for performance.",schema:Pn});var Os=String.raw`The purpose of this agent is to work with Knowledge Graph data, a graph database technology that represents and stores data as interconnected entities (nodes) and relationships (edges).
194
+ This agent has two categories of skills: those that work with an active link chart visualization of a subset of the data in the knowledge graph, and those that work with the knowledge graph data more generally against the entire dataset in the service and database.
195
+ For link charts, the agent enables users to interact with a link chart by adding new entities (also called nodes) or relationships (also called edges), removing existing entities or relationships,
196
+ expanding the graph from particular entities, finding relationships between specified entities on the link chart and adding them to the link chart, finding all relationships
197
+ that exist out from specified entities and adding those to the link chart, changing whether or not nonspatial data is visible, or changing the layout of the link chart.
198
+ This agent is designed to handle requests that manipulate the specific link chart.
199
+ For knowledge graph data more generally, the agent can generate Open Cypher queries based on user prompts that represent inquiries into the data of the knowledge service and its graph database,
200
+ and can alternatively use those queries to create a new link chart visualization from the results if requested.
201
+
202
+ Supported actions:
203
+ - **Change or Apply Layout**: Changes the current layout visualization strategy of the link chart (e.g., "Change the layout to basic-grid", "Apply hierarchical layout"). Valid layout types include organic-standard, organic-community, basic-grid, hierarchical-bottom-to-top, radial-root-centric, tree-left-to-right, geographic-organic-standard, chronological-mono-timeline. A best effort should be made to transform the user's request into one of these layout types.
204
+ - **Change Nonspatial Data Visibility**: Changes whether or not nonspatial data is visible on the link chart (e.g., "Show nonspatial data", "Hide nonspatial data"). Valid settings are "hidden" and "visible". A best effort should be made to transform the user's request into one of these settings.
205
+ - **Generate a cypher query**: Generates an Open Cypher query based on the user's prompt which represents an inquiry into the data of the knowledge service and its graph database, attempting to filter based on certain conditions and traverse specified relationships. The generated query should be syntactically correct and optimized for performance. The user should explicitly request that a cypher query be returned - if they do not, the purpose of the query is for one of the other tools or skills.
206
+ - **Create a New Link Chart from a user prompt**: Identifies that the users prompt is an inquiry into the data of the knowledge service and its graph database and creates a new link chart from the results. The user should have requested that a link chart be created or made(or similar term) from their prompt
207
+ - **Add Records (entities or relationships)**: Identifies that the users prompt is an inquiry into the data of the knowledge graph service and its graph database, and that the user wants to take the result of the inquiry and add those entities and/or relationships to the link chart. The generated query should be syntactically correct and optimized for performance.
208
+
209
+ _example: "Change the layout to hierarchical-bottom-to-top"_
210
+ _example: "Apply radial-root-centric layout"_
211
+ _example: "Show nonspatial data"_
212
+ _example: "Hide nonspatial data"_
213
+ _example: "Turn off nonspatial visibility"_
214
+ _example: "Generate a cypher query to find all entities connected to 'Entity A' via 'Relationship X' that were created after 2020"_
215
+ _example: "Generate a query to find all employees of Company Esri who joined after 2015 and are located in California"_
216
+ _example: "Tell me how to find all products supplied by Supplier Y that have a price greater than $1000"_
217
+ _example: "Create a new link chart showing all entities related to 'Entity B' through 'Relationship Y'"_
218
+ _example: "Find all people who work for Microsoft and put them on a new link chart"_
219
+ _example: "Add all entities connected to 'Entity C' via 'Relationship Z' to the current link chart"_
220
+ _example: "Add all the people who work for Esri to the current link chart, and all the cars that they drive"_
221
+ _example: "Find all the products supplied by Supplier X and add them to my visualization"_
222
+ _example: "Expand the link chart from 'Entity D' to show its direct connections"_
223
+ _example: "Find all the cars and then add everything up to two hops away from them on the link chart"_
224
+ _example: "Connect Emma and Rob on the link chart if there is a relationship between them"
225
+ _example: "Discover and add all the relationships originating at 'Entity E' to the link chart"_`;return{a:Ns,b:Fs,c:Ve,d:As}},"Graphic","geometry/Point","geometry/Extent","symbols/PictureMarkerSymbol","rest/locator","portal/Portal","config","layers/support/FeatureEffect","layers/support/FeatureFilter","geometry/operators/unionOperator","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/support/TopFeaturesQuery","rest/support/TopFilter","smartMapping/renderers/pieChart","smartMapping/symbology/pieChart","views/support/colorUtils","smartMapping/renderers/color","smartMapping/symbology/color","smartMapping/renderers/univariateColorSize","smartMapping/renderers/dotDensity","smartMapping/symbology/dotDensity","smartMapping/renderers/heatmap","smartMapping/symbology/heatmap","smartMapping/renderers/predominance","smartMapping/symbology/predominance","smartMapping/renderers/relationship","smartMapping/symbology/relationship","smartMapping/renderers/size","smartMapping/renderers/type","smartMapping/symbology/type","rest/knowledgeGraph/GraphQueryStreaming","request","identity/IdentityManager","rest/knowledgeGraphService","WebLinkChart",a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{b as e,c as i}from"./B4DEC7PH.js";import"./KVH3PDVW.js";import"./YGW7TUNX.js";import{v as s,y as a}from"./SGGBOB5K.js";import"./CFDTXKJ6.js";var t=class extends s{static{this.properties={agent:0,context:0}}async getContext(){return e(this.context)?await this.context():this.context}load(){i(this)}};a("arcgis-assistant-agent",t);export{t as ArcgisAssistantAgent};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as $,c as k}from"./WBSNYWJJ.js";import{a as C,b as L,c as m,d as f,e as P,f as O,i as g,j as v,l as w,u as N}from"./26V7SXDR.js";var _=t=>(...s)=>{let o=f(),e=new t(...s),r=e.exports;m(o.at(-1));let n=e.component.manager;n.W(e,r),e.watchExports(n.W.bind(n,e)),P(e);let a=[e.component,...o].reverse();return v(a,i=>i===void 0?void 0:j(e,i,r),r)},j=(t,{host:s,key:o,isReactive:e},r)=>{let n=s,a=n[o]!==t.exports,i=n[o]!==r,c=r!==t.exports;if(a&&!i&&c&&(n[o]=t.exports),s===t.component){if(e){let l=t.component.manager;i&&l.W(t,n[o]),t.onUpdate(u=>{if(u.has(o)){let x=n[o];x!==t.exports&&l.W(t,x)}})}t.O=e?void 0:o}let d=t.component.constructor.elementProperties.get(o)?.readOnly;t.watchExports(()=>{n[o]!==t.exports&&(d?O(()=>{n[o]=t.exports}):n[o]=t.exports)})};var z="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),M=new Set(z),h="en",U={pt:"pt-PT",nb:"no",nn:"no",zh:"zh-CN"},F=async(t,s,o="")=>{let e=`${s}/${o}`,r=`${e}${t}.json`;return b[r]??(b[r]=A(t,e)),await b[r]},b={},A=async(t,s)=>{let o=`${s}${t}.json`;try{let e=await fetch(o);if(e.ok)return await e.json()}catch(e){return g("error","intl",`An unknown error occurred while fetching localization strings at ${o}`,{detail:{error:e}}),{}}return t===h?{}:await A(h,s)},y=t=>{let s=k(t,"lang",globalThis.navigator?.language||h);return{lang:s,t9nLocale:T(s)}},T=t=>{let[s,o]=t.split("-"),e=s.toLowerCase(),r=e;return o&&(r=`${e}-${o.toUpperCase()}`),r=U[r]??r,M.has(r)?r:o?T(e):h},D=(t,s,o,e)=>{let r,n=()=>K(t,s(),e).then(a=>{(r?.lang!==a.lang||r.t9nLocale!==a.t9nLocale||r.t9nStrings!==a.t9nStrings)&&o(a),r=a}).catch(a=>{g("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(n),$(t,["lang"],n)},K=async(t,s,o=t.localName.split("-").slice(1).join("-"))=>{let{lang:e,t9nLocale:r}=y(t),n=`${s}/${o}/t9n`,i=o===null?{}:await F(r,n,"messages.");return{lang:e,t9nLocale:r,t9nStrings:i}};var W=t=>I(void 0,t);var E=class extends w{constructor(s,o){super(s);let e=this.exports;try{L(this.component);let r=o(this.component,this),n=this.exports!==e;if(C(r)){n||this.setProvisionalExports(r);let a=r.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!n||r!==void 0)&&(this.exports=r),queueMicrotask(()=>super.catchUpLifecycle())}catch(r){this.P.reject(r)}}catchUpLifecycle(){}},I=_(E);var S=t=>(s={})=>W((o,e)=>{let r=y(o.el),n={_lang:r.lang,_t9nLocale:r.t9nLocale,_loading:!0},a=o;e.onLifecycle(()=>D(o.el,()=>t("./assets"),({t9nLocale:c,t9nStrings:p,lang:d})=>{let l={...p,_lang:d,_t9nLocale:c,_loading:!1};e.exports=l;let u=p.componentLabel;typeof u=="string"&&"label"in o&&o.label==null&&(o.label??=u),i(a.messageOverrides)},s.name));let i=c=>{let p=e.exports,d=p._original??p,l=V(d,c);c&&(l._original=d),e.exports=l};return"messageOverrides"in a&&e.onUpdate(c=>{c.has("messageOverrides")&&i(a.messageOverrides)}),s.blocking?(e.setProvisionalExports(n,!1),e.ready):n}),V=(t,s)=>{if(!s)return t;let o={...t};return Object.entries(s).forEach(([e,r])=>{t[e]!==void 0&&(typeof r=="object"?o[e]=V(t[e],r):o[e]=r??t[e])}),o};var ct=S(N);export{ct as a};
2
+ import{a as $,c as k}from"./YGW7TUNX.js";import{a as C,b as L,c as m,d as f,e as P,f as O,k as g,m as v,o as w,z as N}from"./SGGBOB5K.js";var _=t=>(...s)=>{let o=f(),e=new t(...s),r=e.exports;m(o.at(-1));let n=e.component.manager;n.W(e,r),e.watchExports(n.W.bind(n,e)),P(e);let a=[e.component,...o].reverse();return v(a,i=>i===void 0?void 0:j(e,i,r),r)},j=(t,{host:s,key:o,isReactive:e},r)=>{let n=s,a=n[o]!==t.exports,i=n[o]!==r,c=r!==t.exports;if(a&&!i&&c&&(n[o]=t.exports),s===t.component){if(e){let l=t.component.manager;i&&l.W(t,n[o]),t.onUpdate(u=>{if(u.has(o)){let x=n[o];x!==t.exports&&l.W(t,x)}})}t.O=e?void 0:o}let d=t.component.constructor.elementProperties.get(o)?.readOnly;t.watchExports(()=>{n[o]!==t.exports&&(d?O(()=>{n[o]=t.exports}):n[o]=t.exports)})};var z="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),M=new Set(z),h="en",U={pt:"pt-BR",nb:"no",nn:"no",zh:"zh-CN"},F=async(t,s,o="")=>{let e=`${s}/${o}`,r=`${e}${t}.json`;return b[r]??(b[r]=A(t,e)),await b[r]},b={},A=async(t,s)=>{let o=`${s}${t}.json`;try{let e=await fetch(o);if(e.ok)return await e.json()}catch(e){return g("error","intl",`An unknown error occurred while fetching localization strings at ${o}`,{detail:{error:e}}),{}}return t===h?{}:await A(h,s)},y=t=>{let s=k(t,"lang",globalThis.navigator?.language||h);return{lang:s,t9nLocale:D(s)}},D=t=>{let[s,o]=t.split("-"),e=s.toLowerCase(),r=e;return o&&(r=`${e}-${o.toUpperCase()}`),r=U[r]??r,M.has(r)?r:o?D(e):h},T=(t,s,o,e)=>{let r,n=()=>K(t,s(),e).then(a=>{(r?.lang!==a.lang||r.t9nLocale!==a.t9nLocale||r.t9nStrings!==a.t9nStrings)&&o(a),r=a}).catch(a=>{g("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(n),$(t,["lang"],n)},K=async(t,s,o=t.localName.split("-").slice(1).join("-"))=>{let{lang:e,t9nLocale:r}=y(t),n=`${s}/${o}/t9n`,i=o===null?{}:await F(r,n,"messages.");return{lang:e,t9nLocale:r,t9nStrings:i}};var W=t=>I(void 0,t);var E=class extends w{constructor(s,o){super(s);let e=this.exports;try{L(this.component);let r=o(this.component,this),n=this.exports!==e;if(C(r)){n||this.setProvisionalExports(r);let a=r.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!n||r!==void 0)&&(this.exports=r),queueMicrotask(()=>super.catchUpLifecycle())}catch(r){this.P.reject(r)}}catchUpLifecycle(){}},I=_(E);var S=t=>(s={})=>W((o,e)=>{let r=y(o.el),n={_lang:r.lang,_t9nLocale:r.t9nLocale,_loading:!0},a=o;e.onLifecycle(()=>T(o.el,()=>t("./assets"),({t9nLocale:c,t9nStrings:p,lang:d})=>{let l={...p,_lang:d,_t9nLocale:c,_loading:!1};e.exports=l;let u=p.componentLabel;typeof u=="string"&&"label"in o&&o.label==null&&(o.label??=u),i(a.messageOverrides)},s.name));let i=c=>{let p=e.exports,d=p._original??p,l=V(d,c);c&&(l._original=d),e.exports=l};return"messageOverrides"in a&&e.onUpdate(c=>{c.has("messageOverrides")&&i(a.messageOverrides)}),s.blocking?(e.setProvisionalExports(n,!1),e.ready):n}),V=(t,s)=>{if(!s)return t;let o={...t};return Object.entries(s).forEach(([e,r])=>{t[e]!==void 0&&(typeof r=="object"?o[e]=V(t[e],r):o[e]=r??t[e])}),o};var ct=S(N);export{ct as a};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{b as r}from"./YGW7TUNX.js";function c(t,e){return e?typeof e=="string"?u(t,e)??null:e:r(t,"arcgis-map")??null}function u(t,e){let l=e.includes("#")||e.includes(".")||e.includes("["),n=t.getRootNode();return(l?void 0:n.querySelector(`#${e}`))??n.querySelector(e)??void 0}export{c as a};
@@ -0,0 +1,61 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import"./CFDTXKJ6.js";var e=`## Task: Summarize Geographic Features
3
+
4
+ You are given features from ArcGIS Feature layer for multiple layers:
5
+ {queryResponse}
6
+
7
+ ## Input
8
+
9
+ Assigned task:
10
+ {assignedTask}
11
+
12
+ Latest user request:
13
+ {userRequest}
14
+
15
+ Prior steps:
16
+ {priorSteps}
17
+
18
+ Use the assigned task as the primary instruction for the current query.
19
+ Use the latest user request as supporting context when needed.
20
+ Use prior steps only when the assigned task clearly depends on earlier results.
21
+ Use chat history only when necessary to understand conversational references, and do not override the assigned task.
22
+
23
+ ### Your goal:
24
+
25
+ 1. If the assigned task is about a **specific calculation** (e.g., average, total, count, min, max), return only the **direct numeric answer** \u2014 short and clear.
26
+ - Example: \u201CThe average price is $4.00.\u201D
27
+
28
+ 2. If the question is more general or there are **multiple features with varying attributes**, write a **brief summary** (2\u20133 sentences max) that highlights key patterns or insights.
29
+
30
+ 3. The response can be per layer, or summarize based on the question.
31
+
32
+ 4. DO NOT ramble.
33
+
34
+ 5. If a \`geometryFilter\` is used, do NOT assume the feature referenced in that geometry (e.g., "ApplicationNumber = 'XYZ'") must appear in the results. It may only be used as a spatial anchor.
35
+
36
+ Only describe what _was_ found \u2014 not what was _used to search_.
37
+
38
+ 6. If no feature \`attributes\` are returned but \`totalCount\` is present, assume the spatial filter was applied correctly. There is no need to say the subset was not returned \u2014 just summarize based on the count and available context.
39
+
40
+ 7. Do not give suggestions like exporting the results as the tools are not capable to do that.
41
+
42
+ 8. Use bullet points for lists and use new lines (\\n) and appropriate formatting in your response.
43
+
44
+ 9. Do NOT say things like "I can't change the map", "I can't highlight features", or suggest WHERE clauses for the user to run manually. A separate system handles map visualization automatically after this step. Your job is ONLY to summarize the data returned by the query.
45
+
46
+ In all cases:
47
+
48
+ - Focus on **notable attribute values**, **commonalities or differences**, and **interesting trends**.
49
+ - If the feature list is empty or not meaningful, state that clearly.
50
+
51
+ ### STRICT OUTPUT RULES
52
+
53
+ - Do NOT ask follow-up questions.
54
+ - Do NOT offer additional actions or suggestions.
55
+ - Do NOT explain what you can do next.
56
+ - Do NOT add conversational phrases.
57
+ - Do NOT add any text beyond the requested summary or numeric answer.
58
+ - End the response immediately after the summary.
59
+ - Do NOT include introductory phrases (e.g., "Found", "Here are", "The results show").
60
+ - Do NOT restate the assigned task or user\u2019s question.
61
+ `;export{e as default};