@arcgis/portal-components 5.2.0-next.6 → 5.2.0-next.61

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 (481) hide show
  1. package/README.md +2 -2
  2. package/dist/cdn/23EOLRF6.js +2 -0
  3. package/dist/cdn/25BWGJFT.js +2 -0
  4. package/dist/cdn/2GBRZSEC.js +2 -0
  5. package/dist/cdn/3527GI5O.js +2 -0
  6. package/dist/cdn/3LBJM7GA.js +2 -0
  7. package/dist/cdn/{GQFWFZXP.js → 3OBIA66A.js} +1 -1
  8. package/dist/cdn/3Y33UPZ6.js +2 -0
  9. package/dist/cdn/44XITKIX.js +2 -0
  10. package/dist/cdn/456GBBRQ.js +2 -0
  11. package/dist/cdn/4QA4AYHJ.js +3 -0
  12. package/dist/cdn/{QNUYUNEY.js → 52B4FWCM.js} +1 -1
  13. package/dist/cdn/55FL7WQV.js +2 -0
  14. package/dist/cdn/5KDFY5KE.js +2 -0
  15. package/dist/cdn/5VMPZXL3.js +2 -0
  16. package/dist/cdn/{7WZHZP6U.js → 63THOLAY.js} +9 -3
  17. package/dist/cdn/6LMJGR6F.js +2 -0
  18. package/dist/cdn/744FUP4K.js +2 -0
  19. package/dist/cdn/7NVVHX75.js +2 -0
  20. package/dist/cdn/{LQ3DMZ3K.js → 7ZXEX3LI.js} +1 -1
  21. package/dist/cdn/AEZFDUSX.js +2 -0
  22. package/dist/cdn/AT2DLVEF.js +2 -0
  23. package/dist/cdn/{DKBTJJMW.js → C7ZFXRPS.js} +1 -1
  24. package/dist/cdn/CFBSBZSS.js +2 -0
  25. package/dist/cdn/CG6FLLXZ.js +2 -0
  26. package/dist/cdn/DALGPO36.js +2 -0
  27. package/dist/cdn/DUBJA7PZ.js +2 -0
  28. package/dist/cdn/DUKSWZKG.js +2 -0
  29. package/dist/cdn/E6MGDW3D.js +2 -0
  30. package/dist/cdn/EB4XGKGD.js +2 -0
  31. package/dist/cdn/EE7XFMJG.js +2 -0
  32. package/dist/cdn/F3PB42AG.js +2 -0
  33. package/dist/cdn/FF24VDOG.js +65 -0
  34. package/dist/cdn/FGJNEKPQ.js +2 -0
  35. package/dist/cdn/G2NXASJO.js +2 -0
  36. package/dist/cdn/GBW3NV7Y.js +2 -0
  37. package/dist/cdn/HEA66RTI.js +2 -0
  38. package/dist/cdn/IJ3CLFAU.js +22 -0
  39. package/dist/cdn/IXATTQKO.js +2 -0
  40. package/dist/cdn/JPHGWARN.js +2 -0
  41. package/dist/cdn/JUNNQTQU.js +2 -0
  42. package/dist/cdn/{3PAHY5KA.js → KNRJ3WXR.js} +1 -1
  43. package/dist/cdn/KTTTBLZ6.js +2 -0
  44. package/dist/cdn/KZVNGOD4.js +635 -0
  45. package/dist/cdn/L2BME3WC.js +2 -0
  46. package/dist/cdn/{F6V7MLPY.js → L6KBBJEC.js} +1 -1
  47. package/dist/cdn/M7T6DKL2.js +2 -0
  48. package/dist/cdn/MNU537SB.js +2 -0
  49. package/dist/cdn/NITKS6KJ.js +2 -0
  50. package/dist/cdn/NMAP3FYP.js +2 -0
  51. package/dist/cdn/NYFFDBSL.js +2 -0
  52. package/dist/cdn/OBBYT2AV.js +2 -0
  53. package/dist/cdn/{WOZDQW3S.js → OECTWB22.js} +1 -1
  54. package/dist/cdn/{53MSUMA3.js → OT4PZJNB.js} +17 -1
  55. package/dist/cdn/PGCNY5GO.js +451 -0
  56. package/dist/cdn/PMCTFA5D.js +2 -0
  57. package/dist/cdn/PP7GTURX.js +2 -0
  58. package/dist/cdn/Q7SDLUZ6.js +2 -0
  59. package/dist/cdn/QE4CNVDQ.js +34 -0
  60. package/dist/cdn/{AQWTJKUH.js → QKCV7CY2.js} +10 -8
  61. package/dist/cdn/QQ432AB6.js +2 -0
  62. package/dist/cdn/QS3GXAIH.js +2 -0
  63. package/dist/cdn/SE5YJGIJ.js +2 -0
  64. package/dist/cdn/SKUPHVNO.js +2 -0
  65. package/dist/cdn/SLTFLCVR.js +99 -0
  66. package/dist/cdn/{ZTHTFEYA.js → SVRIKNKJ.js} +1 -1
  67. package/dist/cdn/{LAFNDBTQ.js → SWAVECPM.js} +1 -1
  68. package/dist/cdn/TAB5C3RK.js +2 -0
  69. package/dist/cdn/THRK2DGY.js +2 -0
  70. package/dist/cdn/{DXCPWJU4.js → TKCE4WYE.js} +1 -1
  71. package/dist/cdn/TNLGQ7HL.js +2 -0
  72. package/dist/cdn/{DHHSKOUY.js → TSTTPCWU.js} +1 -1
  73. package/dist/cdn/U5B2LAPJ.js +2 -0
  74. package/dist/cdn/UDTQ7U6L.js +2 -0
  75. package/dist/cdn/UL2NWFFH.js +2 -0
  76. package/dist/cdn/UZCHLKLO.js +2 -0
  77. package/dist/cdn/UZLQALHY.js +2 -0
  78. package/dist/cdn/{RR4BIAPA.js → V4EYW3O6.js} +1 -1
  79. package/dist/cdn/V4IAC7WR.js +2 -0
  80. package/dist/cdn/VD6VGWCQ.js +2 -0
  81. package/dist/cdn/VLHHC25R.js +2 -0
  82. package/dist/cdn/VMQIDO4Z.js +2 -0
  83. package/dist/cdn/VRCB4BN4.js +2 -0
  84. package/dist/cdn/{74XFARCV.js → VW7DSKPH.js} +1 -1
  85. package/dist/cdn/W2SYL7IJ.js +71 -0
  86. package/dist/cdn/{W6PSG4GX.js → W4FGRGLV.js} +10 -5
  87. package/dist/cdn/{SYJSVUUR.js → W4SAWMXS.js} +1 -1
  88. package/dist/cdn/WBZLQZYR.js +134 -0
  89. package/dist/cdn/WWMB4NWC.js +2 -0
  90. package/dist/cdn/XCJPHHX2.js +2 -0
  91. package/dist/cdn/XEK22IDA.js +2 -0
  92. package/dist/cdn/XHFAXT2P.js +2 -0
  93. package/dist/cdn/XMUR4HRH.js +2 -0
  94. package/dist/cdn/XX4U6IRN.js +2 -0
  95. package/dist/cdn/Y3RUZTB3.js +2 -0
  96. package/dist/cdn/Y7FCEDRU.js +2 -0
  97. package/dist/cdn/YIU7GBUN.js +2 -0
  98. package/dist/cdn/YVKSTDL6.js +2 -0
  99. package/dist/cdn/ZOEF7HBV.js +2 -0
  100. package/dist/cdn/{GT26WGJS.js → ZV4GLQQG.js} +1 -1
  101. package/dist/cdn/assets/portal-account-switcher/t9n/messages.en.json +1 -0
  102. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.en.json +1 -1
  103. package/dist/cdn/assets/portal-browser/t9n/messages.en.json +1 -0
  104. package/dist/cdn/assets/portal-group-badges/t9n/messages.en.json +1 -0
  105. package/dist/cdn/assets/portal-group-browser/t9n/messages.en.json +1 -0
  106. package/dist/cdn/assets/portal-group-card/t9n/messages.en.json +1 -0
  107. package/dist/cdn/assets/portal-item-type/icons/parquetfeaturelayer16.svg +1 -0
  108. package/dist/cdn/assets/portal-item-type/icons/parquetfeaturelayer32.svg +1 -0
  109. package/dist/cdn/assets/portal-item-type/icons/storymapframe16.svg +1 -0
  110. package/dist/cdn/assets/portal-item-type/icons/storymapframe32.svg +1 -0
  111. package/dist/cdn/assets/portal-item-type/t9n/messages.en.json +1 -1
  112. package/dist/cdn/assets/portal-navigation/apps/api-for-python.avif +0 -0
  113. package/dist/cdn/assets/portal-navigation/apps/appstudio.avif +0 -0
  114. package/dist/cdn/assets/portal-navigation/apps/arcade.avif +0 -0
  115. package/dist/cdn/assets/portal-navigation/apps/arcgis-360-vr.avif +0 -0
  116. package/dist/cdn/assets/portal-navigation/apps/arcgis-earth.avif +0 -0
  117. package/dist/cdn/assets/portal-navigation/apps/arcgis-enterprise.avif +0 -0
  118. package/dist/cdn/assets/portal-navigation/apps/arcgis-experience-builder.avif +0 -0
  119. package/dist/cdn/assets/portal-navigation/apps/arcgis-geoanalytics.avif +0 -0
  120. package/dist/cdn/assets/portal-navigation/apps/arcgis-hub.avif +0 -0
  121. package/dist/cdn/assets/portal-navigation/apps/arcgis-online.avif +0 -0
  122. package/dist/cdn/assets/portal-navigation/apps/arcgis-pro.avif +0 -0
  123. package/dist/cdn/assets/portal-navigation/apps/arcgis-reality-studio.avif +0 -0
  124. package/dist/cdn/assets/portal-navigation/apps/arcgis-urban.avif +0 -0
  125. package/dist/cdn/assets/portal-navigation/apps/blank.avif +0 -0
  126. package/dist/cdn/assets/portal-navigation/apps/business-analyst.avif +0 -0
  127. package/dist/cdn/assets/portal-navigation/apps/city-engine.avif +0 -0
  128. package/dist/cdn/assets/portal-navigation/apps/collector.avif +0 -0
  129. package/dist/cdn/assets/portal-navigation/apps/community-analyst.avif +0 -0
  130. package/dist/cdn/assets/portal-navigation/apps/configurable-apps.avif +0 -0
  131. package/dist/cdn/assets/portal-navigation/apps/dashboards-beta.avif +0 -0
  132. package/dist/cdn/assets/portal-navigation/apps/dashboards-classic.avif +0 -0
  133. package/dist/cdn/assets/portal-navigation/apps/data-pipelines.avif +0 -0
  134. package/dist/cdn/assets/portal-navigation/apps/deeplearningstudio.avif +0 -0
  135. package/dist/cdn/assets/portal-navigation/apps/demographics.avif +0 -0
  136. package/dist/cdn/assets/portal-navigation/apps/drone2map.avif +0 -0
  137. package/dist/cdn/assets/portal-navigation/apps/esri-events.avif +0 -0
  138. package/dist/cdn/assets/portal-navigation/apps/essential-apps.avif +0 -0
  139. package/dist/cdn/assets/portal-navigation/apps/excalibur.avif +0 -0
  140. package/dist/cdn/assets/portal-navigation/apps/explorer.avif +0 -0
  141. package/dist/cdn/assets/portal-navigation/apps/field-apps.avif +0 -0
  142. package/dist/cdn/assets/portal-navigation/apps/fieldmaps-beta.avif +0 -0
  143. package/dist/cdn/assets/portal-navigation/apps/fieldmaps-ea.avif +0 -0
  144. package/dist/cdn/assets/portal-navigation/apps/fieldmaps.avif +0 -0
  145. package/dist/cdn/assets/portal-navigation/apps/generic-app.avif +0 -0
  146. package/dist/cdn/assets/portal-navigation/apps/geobim.avif +0 -0
  147. package/dist/cdn/assets/portal-navigation/apps/geoplanner.avif +0 -0
  148. package/dist/cdn/assets/portal-navigation/apps/grid-view-9.avif +0 -0
  149. package/dist/cdn/assets/portal-navigation/apps/indoor.avif +0 -0
  150. package/dist/cdn/assets/portal-navigation/apps/indoors.avif +0 -0
  151. package/dist/cdn/assets/portal-navigation/apps/insights.avif +0 -0
  152. package/dist/cdn/assets/portal-navigation/apps/instant-apps.avif +0 -0
  153. package/dist/cdn/assets/portal-navigation/apps/ips.avif +0 -0
  154. package/dist/cdn/assets/portal-navigation/apps/knowledge-studio.avif +0 -0
  155. package/dist/cdn/assets/portal-navigation/apps/living-atlas.avif +0 -0
  156. package/dist/cdn/assets/portal-navigation/apps/location-platform.avif +0 -0
  157. package/dist/cdn/assets/portal-navigation/apps/map-maker.avif +0 -0
  158. package/dist/cdn/assets/portal-navigation/apps/map-viewer-beta.avif +0 -0
  159. package/dist/cdn/assets/portal-navigation/apps/map-viewer-classic.avif +0 -0
  160. package/dist/cdn/assets/portal-navigation/apps/map-viewer.avif +0 -0
  161. package/dist/cdn/assets/portal-navigation/apps/maps-adobe-cloud.avif +0 -0
  162. package/dist/cdn/assets/portal-navigation/apps/maps-for-office.avif +0 -0
  163. package/dist/cdn/assets/portal-navigation/apps/maps-for-power-bi.avif +0 -0
  164. package/dist/cdn/assets/portal-navigation/apps/maps-for-sharepoint.avif +0 -0
  165. package/dist/cdn/assets/portal-navigation/apps/marketplace.avif +0 -0
  166. package/dist/cdn/assets/portal-navigation/apps/mission.avif +0 -0
  167. package/dist/cdn/assets/portal-navigation/apps/monitor.avif +0 -0
  168. package/dist/cdn/assets/portal-navigation/apps/navigator.avif +0 -0
  169. package/dist/cdn/assets/portal-navigation/apps/notebook.avif +0 -0
  170. package/dist/cdn/assets/portal-navigation/apps/office-apps.avif +0 -0
  171. package/dist/cdn/assets/portal-navigation/apps/open-data.avif +0 -0
  172. package/dist/cdn/assets/portal-navigation/apps/operations-dashboard.avif +0 -0
  173. package/dist/cdn/assets/portal-navigation/apps/ortho-maker.avif +0 -0
  174. package/dist/cdn/assets/portal-navigation/apps/pro-extension.avif +0 -0
  175. package/dist/cdn/assets/portal-navigation/apps/quick-capture.avif +0 -0
  176. package/dist/cdn/assets/portal-navigation/apps/redistricting.avif +0 -0
  177. package/dist/cdn/assets/portal-navigation/apps/runtime.avif +0 -0
  178. package/dist/cdn/assets/portal-navigation/apps/scene-viewer.avif +0 -0
  179. package/dist/cdn/assets/portal-navigation/apps/sites.avif +0 -0
  180. package/dist/cdn/assets/portal-navigation/apps/solutions.avif +0 -0
  181. package/dist/cdn/assets/portal-navigation/apps/story-maps.avif +0 -0
  182. package/dist/cdn/assets/portal-navigation/apps/streetmap-premium.avif +0 -0
  183. package/dist/cdn/assets/portal-navigation/apps/survey123.avif +0 -0
  184. package/dist/cdn/assets/portal-navigation/apps/svg-app-circle.svg +1 -0
  185. package/dist/cdn/assets/portal-navigation/apps/svg-app-icon.svg +1 -0
  186. package/dist/cdn/assets/portal-navigation/apps/track-viewer.avif +0 -0
  187. package/dist/cdn/assets/portal-navigation/apps/user-type-extension-online.avif +0 -0
  188. package/dist/cdn/assets/portal-navigation/apps/user-type-extension.avif +0 -0
  189. package/dist/cdn/assets/portal-navigation/apps/vector-tile-style-editor.avif +0 -0
  190. package/dist/cdn/assets/portal-navigation/apps/velocity.avif +0 -0
  191. package/dist/cdn/assets/portal-navigation/apps/web-app-builder.avif +0 -0
  192. package/dist/cdn/assets/portal-navigation/apps/web-editor.avif +0 -0
  193. package/dist/cdn/assets/portal-navigation/apps/web-mapping.avif +0 -0
  194. package/dist/cdn/assets/portal-navigation/apps/workflow-manager-beta.avif +0 -0
  195. package/dist/cdn/assets/portal-navigation/apps/workflow-manager.avif +0 -0
  196. package/dist/cdn/assets/portal-navigation/apps/workforce.avif +0 -0
  197. package/dist/cdn/assets/portal-navigation/product-logos/advanced-editing-user-type-extension-glyph-32.svg +1 -0
  198. package/dist/cdn/assets/portal-navigation/product-logos/arc-hydro-glyph-32.svg +1 -0
  199. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-360-vr-glyph-32.svg +1 -0
  200. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-api-for-python-glyph-32.svg +1 -0
  201. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-appstudio-glyph-32.svg +1 -0
  202. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-arcade-expression-language-glyph-32.svg +1 -0
  203. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-business-analyst-glyph-32.svg +1 -0
  204. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-cityengine-glyph-32.svg +1 -0
  205. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-collector-glyph-32.svg +1 -0
  206. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-community-analyst-glyph-32.svg +1 -0
  207. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-connectors-for-power-automate-glyph-32.svg +1 -0
  208. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-dashboards-glyph-32.svg +1 -0
  209. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-data-interoperability-glyph-32.svg +1 -0
  210. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-data-pipelines-glyph-32.svg +1 -0
  211. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-data-reviewer-glyph-32.svg +1 -0
  212. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-deep-learning-studio-glyph-32.svg +1 -0
  213. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-drone2map-glyph-32.svg +1 -0
  214. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-earth-glyph-32.svg +1 -0
  215. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-enterprise-glyph-32.svg +1 -0
  216. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-excalibur-glyph-32.svg +1 -0
  217. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-excalibur-gray-glyph-32.svg +1 -0
  218. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-experience-builder-glyph-32.svg +1 -0
  219. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-explorer-glyph-32.svg +1 -0
  220. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-field-maps-designer-ea-glyph-32.svg +1 -0
  221. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-field-maps-glyph-32.svg +1 -0
  222. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-flight-glyph-32.svg +1 -0
  223. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-autocad-glyph-32.svg +1 -0
  224. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-autodesk-forma-glyph-32.svg +1 -0
  225. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-developers-glyph-32.svg +1 -0
  226. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-excel-glyph-32.svg +1 -0
  227. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-microsoft-365-glyph-32.svg +1 -0
  228. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-power-apps-glyph-32.svg +1 -0
  229. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-teams-glyph-32.svg +1 -0
  230. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-geoanalytics-engine-glyph-32.svg +1 -0
  231. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-geobim-glyph-32.svg +1 -0
  232. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-geoplanner-glyph-32.svg +1 -0
  233. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-hub-glyph-32.svg +1 -0
  234. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-image-glyph-32.svg +1 -0
  235. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-indoors-glyph-32.svg +1 -0
  236. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-insights-glyph-32.svg +1 -0
  237. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-instant-apps-glyph-32.svg +1 -0
  238. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-knowledge-glyph-32.svg +1 -0
  239. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-living-atlas-of-the-world-glyph-32.svg +1 -0
  240. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-location-platform-glyph-32.svg +1 -0
  241. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-logo-glyph-32.svg +76 -0
  242. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-for-adobe-creative-cloud-glyph-32.svg +1 -0
  243. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-for-power-bi-glyph-32.svg +1 -0
  244. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-for-sharepoint-glyph-32.svg +1 -0
  245. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-sdk-for-javascript-glyph-32.svg +1 -0
  246. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-sdks-for-game-engines-glyph-32.svg +1 -0
  247. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-sdks-for-native-apps-glyph-32.svg +1 -0
  248. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maritime-glyph-32.svg +1 -0
  249. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-marketplace-glyph-32.svg +1 -0
  250. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-mission-glyph-32.svg +1 -0
  251. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-monitor-glyph-32.svg +1 -0
  252. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-monitor-white-glyph-32.svg +1 -0
  253. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-navigator-glyph-32.svg +1 -0
  254. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-notebooks-glyph-32.svg +1 -0
  255. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-online-glyph-32.svg +1 -0
  256. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-open-data-glyph-32.svg +1 -0
  257. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-open-source-apps-glyph-32.svg +1 -0
  258. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-ortho-maker-glyph-32.svg +1 -0
  259. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-parcel-fabric-glyph-32.svg +1 -0
  260. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-pipeline-referencing-glyph-32.svg +1 -0
  261. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-pro-for-intelligence-glyph-32.svg +1 -0
  262. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-pro-glyph-32.svg +1 -0
  263. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-quickcapture-glyph-32.svg +1 -0
  264. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-reality-studio-glyph-32.svg +1 -0
  265. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-roads-and-highways-glyph-32.svg +1 -0
  266. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-sites-glyph-32.svg +1 -0
  267. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-solutions-glyph-32.svg +1 -0
  268. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-storymaps-glyph-32.svg +1 -0
  269. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-streetmap-premium-glyph-32.svg +1 -0
  270. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-survey123-connect-glyph-32.svg +1 -0
  271. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-survey123-glyph-32.svg +1 -0
  272. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-tracker-glyph-32.svg +1 -0
  273. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-urban-glyph-32.svg +1 -0
  274. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-utility-network-management-glyph-32.svg +1 -0
  275. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-velocity-glyph-32.svg +6 -0
  276. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-web-appbuilder-glyph-32.svg +1 -0
  277. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-web-editor-glyph-32.svg +1 -0
  278. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-workflow-manager-glyph-32.svg +1 -0
  279. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-workforce-glyph-32.svg +1 -0
  280. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-world-geocoder-glyph-32.svg +1 -0
  281. package/dist/cdn/assets/portal-navigation/product-logos/calcite-design-system-glyph-32.svg +1 -0
  282. package/dist/cdn/assets/portal-navigation/product-logos/esri-community-glyph-32.svg +1 -0
  283. package/dist/cdn/assets/portal-navigation/product-logos/esri-demographics-glyph-32.svg +1 -0
  284. package/dist/cdn/assets/portal-navigation/product-logos/esri-events-glyph-32.svg +1 -0
  285. package/dist/cdn/assets/portal-navigation/product-logos/esri-offline-documentation-center--glyph-32.svg +1 -0
  286. package/dist/cdn/assets/portal-navigation/product-logos/esri-redistricting-glyph-32.svg +1 -0
  287. package/dist/cdn/assets/portal-navigation/product-logos/esri-reports-glyph-32.svg +1 -0
  288. package/dist/cdn/assets/portal-navigation/product-logos/esri-support-glyph-32.svg +1 -0
  289. package/dist/cdn/assets/portal-navigation/product-logos/map-viewer-glyph-32.svg +1 -0
  290. package/dist/cdn/assets/portal-navigation/product-logos/sceneviewer-glyph-32.svg +1 -0
  291. package/dist/cdn/assets/portal-navigation/product-logos/site-scan-for-arcgis-glyph-32.svg +1 -0
  292. package/dist/cdn/assets/portal-navigation/product-logos/site-scan-for-arcgis-le-glyph-32.svg +1 -0
  293. package/dist/cdn/assets/portal-navigation/product-logos/vector-tile-style-editor-glyph-32.svg +1 -0
  294. package/dist/cdn/assets/portal-navigation/product-logos/xr-viewer-glyph-32.svg +1 -0
  295. package/dist/cdn/assets/portal-navigation/t9n/messages.en.json +1 -0
  296. package/dist/cdn/index.js +1 -1
  297. package/dist/cdn/main.css +1 -1
  298. package/dist/chunks/dom.js +41 -0
  299. package/dist/chunks/fieldAddDelete.js +1 -1
  300. package/dist/chunks/functionalities.js +6 -4
  301. package/dist/chunks/groups.js +13 -35
  302. package/dist/chunks/groups2.js +11 -0
  303. package/dist/chunks/icons.js +11 -0
  304. package/dist/chunks/item.js +15 -15
  305. package/dist/chunks/item2.js +34 -0
  306. package/dist/chunks/loadClassificationData.js +19 -19
  307. package/dist/chunks/portal-account-switcher.js +6 -0
  308. package/dist/chunks/portal-browser.js +223 -0
  309. package/dist/chunks/portal.js +91 -8
  310. package/dist/chunks/portal2.js +59 -0
  311. package/dist/chunks/query.js +159 -0
  312. package/dist/chunks/request.js +87 -0
  313. package/dist/chunks/requests.js +92 -44
  314. package/dist/chunks/store.js +14 -0
  315. package/dist/chunks/string.js +36 -0
  316. package/dist/chunks/thumbnail.js +189 -0
  317. package/dist/chunks/ui.js +9 -0
  318. package/dist/chunks/url.js +17 -0
  319. package/dist/chunks/user.js +99 -4
  320. package/dist/chunks/user2.js +13 -107
  321. package/dist/chunks/utils.js +649 -0
  322. package/dist/components/arcgis-portal-account-switcher/customElement.d.ts +99 -0
  323. package/dist/components/arcgis-portal-account-switcher/customElement.js +370 -0
  324. package/dist/components/arcgis-portal-account-switcher/index.d.ts +1 -0
  325. package/dist/components/arcgis-portal-account-switcher/index.js +11 -0
  326. package/dist/components/arcgis-portal-account-switcher-accounts/customElement.d.ts +100 -0
  327. package/dist/components/arcgis-portal-account-switcher-accounts/customElement.js +31 -0
  328. package/dist/components/arcgis-portal-account-switcher-accounts/index.d.ts +1 -0
  329. package/dist/components/arcgis-portal-account-switcher-accounts/index.js +5 -0
  330. package/dist/components/arcgis-portal-account-switcher-list/customElement.d.ts +104 -0
  331. package/dist/components/arcgis-portal-account-switcher-list/customElement.js +51 -0
  332. package/dist/components/arcgis-portal-account-switcher-list/index.d.ts +1 -0
  333. package/dist/components/arcgis-portal-account-switcher-list/index.js +7 -0
  334. package/dist/components/arcgis-portal-ai-assistant/agents/types.d.ts +60 -3
  335. package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +54 -2
  336. package/dist/components/arcgis-portal-ai-assistant/customElement.js +1629 -617
  337. package/dist/components/arcgis-portal-browser/customElement.d.ts +243 -0
  338. package/dist/components/arcgis-portal-browser/customElement.js +19 -0
  339. package/dist/components/arcgis-portal-browser/index.d.ts +1 -0
  340. package/dist/components/arcgis-portal-browser/index.js +6 -0
  341. package/dist/components/arcgis-portal-browser/utils/store.d.ts +31 -0
  342. package/dist/components/arcgis-portal-browser/utils/types.d.ts +24 -0
  343. package/dist/components/arcgis-portal-browser-actions/customElement.d.ts +185 -0
  344. package/dist/components/arcgis-portal-browser-actions/customElement.js +73 -0
  345. package/dist/components/arcgis-portal-browser-actions/index.d.ts +1 -0
  346. package/dist/components/arcgis-portal-browser-actions/index.js +6 -0
  347. package/dist/components/arcgis-portal-browser-actions/types.d.ts +9 -0
  348. package/dist/components/arcgis-portal-browser-filter/customElement.d.ts +226 -0
  349. package/dist/components/arcgis-portal-browser-filter/customElement.js +32 -0
  350. package/dist/components/arcgis-portal-browser-filter/index.d.ts +1 -0
  351. package/dist/components/arcgis-portal-browser-filter/index.js +4 -0
  352. package/dist/components/arcgis-portal-browser-filter-date/customElement.d.ts +233 -0
  353. package/dist/components/arcgis-portal-browser-filter-date/customElement.js +118 -0
  354. package/dist/components/arcgis-portal-browser-filter-date/index.d.ts +1 -0
  355. package/dist/components/arcgis-portal-browser-filter-date/index.js +5 -0
  356. package/dist/components/arcgis-portal-browser-filter-status/customElement.d.ts +193 -0
  357. package/dist/components/arcgis-portal-browser-filter-status/customElement.js +56 -0
  358. package/dist/components/arcgis-portal-browser-filter-status/index.d.ts +1 -0
  359. package/dist/components/arcgis-portal-browser-filter-status/index.js +5 -0
  360. package/dist/components/arcgis-portal-browser-filters/customElement.d.ts +7 -0
  361. package/dist/components/arcgis-portal-browser-filters/customElement.js +29 -0
  362. package/dist/components/arcgis-portal-browser-filters/index.d.ts +1 -0
  363. package/dist/components/arcgis-portal-browser-filters/index.js +2 -0
  364. package/dist/components/arcgis-portal-browser-pagination/customElement.d.ts +194 -0
  365. package/dist/components/arcgis-portal-browser-pagination/customElement.js +49 -0
  366. package/dist/components/arcgis-portal-browser-pagination/index.d.ts +1 -0
  367. package/dist/components/arcgis-portal-browser-pagination/index.js +2 -0
  368. package/dist/components/arcgis-portal-browser-search/customElement.d.ts +195 -0
  369. package/dist/components/arcgis-portal-browser-search/customElement.js +62 -0
  370. package/dist/components/arcgis-portal-browser-search/index.d.ts +1 -0
  371. package/dist/components/arcgis-portal-browser-search/index.js +3 -0
  372. package/dist/components/arcgis-portal-browser-sort/customElement.d.ts +196 -0
  373. package/dist/components/arcgis-portal-browser-sort/customElement.js +93 -0
  374. package/dist/components/arcgis-portal-browser-sort/index.d.ts +1 -0
  375. package/dist/components/arcgis-portal-browser-sort/index.js +9 -0
  376. package/dist/components/arcgis-portal-browser-sort/utils.d.ts +3 -0
  377. package/dist/components/arcgis-portal-browser-top-bar/customElement.d.ts +190 -0
  378. package/dist/components/arcgis-portal-browser-top-bar/customElement.js +50 -0
  379. package/dist/components/arcgis-portal-browser-top-bar/index.d.ts +1 -0
  380. package/dist/components/arcgis-portal-browser-top-bar/index.js +3 -0
  381. package/dist/components/arcgis-portal-browser-view/customElement.d.ts +21 -0
  382. package/dist/components/arcgis-portal-browser-view/customElement.js +30 -0
  383. package/dist/components/arcgis-portal-browser-view/index.d.ts +1 -0
  384. package/dist/components/arcgis-portal-browser-view/index.js +5 -0
  385. package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
  386. package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
  387. package/dist/components/arcgis-portal-group-badges/customElement.d.ts +101 -0
  388. package/dist/components/arcgis-portal-group-badges/customElement.js +51 -0
  389. package/dist/components/arcgis-portal-group-badges/index.d.ts +1 -0
  390. package/dist/components/arcgis-portal-group-badges/index.js +3 -0
  391. package/dist/components/arcgis-portal-group-badges/types.d.ts +3 -0
  392. package/dist/components/arcgis-portal-group-browser/customElement.d.ts +301 -0
  393. package/dist/components/arcgis-portal-group-browser/customElement.js +494 -0
  394. package/dist/components/arcgis-portal-group-browser/index.d.ts +1 -0
  395. package/dist/components/arcgis-portal-group-browser/index.js +6 -0
  396. package/dist/components/arcgis-portal-group-browser/types.d.ts +193 -0
  397. package/dist/components/arcgis-portal-group-browser-preview/customElement.d.ts +225 -0
  398. package/dist/components/arcgis-portal-group-browser-preview/customElement.js +150 -0
  399. package/dist/components/arcgis-portal-group-browser-preview/index.d.ts +1 -0
  400. package/dist/components/arcgis-portal-group-browser-preview/index.js +12 -0
  401. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.d.ts +82 -0
  402. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +92 -0
  403. package/dist/components/arcgis-portal-group-browser-preview-card/index.d.ts +1 -0
  404. package/dist/components/arcgis-portal-group-browser-preview-card/index.js +6 -0
  405. package/dist/components/arcgis-portal-group-card/customElement.d.ts +169 -0
  406. package/dist/components/arcgis-portal-group-card/customElement.js +163 -0
  407. package/dist/components/arcgis-portal-group-card/index.d.ts +1 -0
  408. package/dist/components/arcgis-portal-group-card/index.js +8 -0
  409. package/dist/components/arcgis-portal-group-thumbnail/customElement.d.ts +32 -0
  410. package/dist/components/arcgis-portal-group-thumbnail/customElement.js +153 -0
  411. package/dist/components/arcgis-portal-group-thumbnail/index.d.ts +1 -0
  412. package/dist/components/arcgis-portal-group-thumbnail/index.js +3 -0
  413. package/dist/components/arcgis-portal-info-banner/customElement.d.ts +14 -0
  414. package/dist/components/arcgis-portal-info-banner/customElement.js +31 -0
  415. package/dist/components/arcgis-portal-info-banner/index.d.ts +1 -0
  416. package/dist/components/arcgis-portal-info-banner/index.js +1 -0
  417. package/dist/components/arcgis-portal-item-type/customElement.d.ts +3 -1
  418. package/dist/components/arcgis-portal-item-type/customElement.js +22 -651
  419. package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +40 -38
  420. package/dist/components/arcgis-portal-navigation/customElement.d.ts +521 -0
  421. package/dist/components/arcgis-portal-navigation/customElement.js +1849 -0
  422. package/dist/components/arcgis-portal-navigation/index.d.ts +1 -0
  423. package/dist/components/arcgis-portal-navigation/index.js +32 -0
  424. package/dist/components/arcgis-portal-navigation/types.d.ts +44 -0
  425. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +70 -255
  426. package/dist/components/arcgis-portal-user-avatar/customElement.js +2 -2
  427. package/dist/components/arcgis-portal-user-popup/customElement.d.ts +5 -2
  428. package/dist/components/arcgis-portal-user-popup/customElement.js +81 -106
  429. package/dist/components/arcgis-portal-voice-input/customElement.d.ts +1 -1
  430. package/dist/components/portal-group-browser-filters/customElement.js +104 -0
  431. package/dist/components/portal-group-browser-filters/index.js +8 -0
  432. package/dist/components/portal-group-browser-pagination/customElement.js +13 -0
  433. package/dist/components/portal-group-browser-pagination/index.js +2 -0
  434. package/dist/components/portal-group-browser-sort/customElement.js +16 -0
  435. package/dist/components/portal-group-browser-sort/index.js +2 -0
  436. package/dist/docs/api.json +1 -1
  437. package/dist/docs/docs.json +1 -1
  438. package/dist/docs/vscode.html-custom-data.json +1 -1
  439. package/dist/docs/web-types.json +1 -1
  440. package/dist/index.d.ts +192 -2
  441. package/dist/loader.js +26 -4
  442. package/dist/types/app-switcher.d.ts +71 -0
  443. package/dist/types/group.d.ts +14 -16
  444. package/dist/types/item.d.ts +76 -1
  445. package/dist/types/lumina.d.ts +153 -1
  446. package/dist/types/portal.d.ts +6 -0
  447. package/dist/types/preact.d.ts +175 -1
  448. package/dist/types/react.d.ts +197 -1
  449. package/dist/types/search.d.ts +30 -0
  450. package/dist/types/stencil.d.ts +153 -1
  451. package/dist/types/user.d.ts +16 -3
  452. package/package.json +10 -11
  453. package/dist/cdn/35SKVD6F.js +0 -2
  454. package/dist/cdn/5VSDGPHH.js +0 -2
  455. package/dist/cdn/72N3KAXN.js +0 -2
  456. package/dist/cdn/ANPXRYLV.js +0 -5
  457. package/dist/cdn/B7633S2A.js +0 -422
  458. package/dist/cdn/BEHLBKKM.js +0 -2
  459. package/dist/cdn/EVDOPN3G.js +0 -54
  460. package/dist/cdn/G47ZZQYL.js +0 -2
  461. package/dist/cdn/G6QT6MYP.js +0 -65
  462. package/dist/cdn/GAHILDQF.js +0 -45
  463. package/dist/cdn/GHQ3ZW4U.js +0 -2
  464. package/dist/cdn/JNRN6DTV.js +0 -2
  465. package/dist/cdn/K3HS2LQ7.js +0 -2
  466. package/dist/cdn/KEKBRUUC.js +0 -2
  467. package/dist/cdn/L3BQK62N.js +0 -2
  468. package/dist/cdn/MX3F5ZCL.js +0 -2
  469. package/dist/cdn/O3KBWLGU.js +0 -2
  470. package/dist/cdn/OQDPULPD.js +0 -2
  471. package/dist/cdn/RNLVNDGG.js +0 -2
  472. package/dist/cdn/T25WZ6OL.js +0 -516
  473. package/dist/cdn/TMYTUOSS.js +0 -2
  474. package/dist/cdn/UPEVTVNZ.js +0 -2
  475. package/dist/cdn/V2EOXGK2.js +0 -2
  476. package/dist/cdn/X5NBQPTM.js +0 -2
  477. package/dist/cdn/YG5YYL6X.js +0 -2
  478. package/dist/cdn/YIMNOUTF.js +0 -2
  479. package/dist/cdn/YL7PGYWC.js +0 -5
  480. package/dist/cdn/YMPTDKT6.js +0 -2
  481. package/dist/cdn/YVJRXWM3.js +0 -3
@@ -1,450 +1,250 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as Z } from "../../chunks/runtime.js";
3
- import { LitElement as tt, createEvent as et } from "@arcgis/lumina";
4
- import { css as st, render as at, html as w } from "lit";
5
- import { createRef as M, ref as T } from "lit/directives/ref.js";
6
- import { u as rt } from "../../chunks/useT9n.js";
7
- import { a as P, t as ot } from "../../chunks/functionalities.js";
8
- import { Annotation as h, StateGraph as $, START as G, END as y, NodeInterrupt as V } from "@langchain/langgraph/web";
9
- import { sendTraceMessage as g, invokeStructuredPrompt as b, createChatModel as F, sendUXSuggestion as B, createAgentRuntimeStateWithSharedState as E } from "@arcgis/ai-components/utils/index.js";
10
- import n from "zod";
11
- import { ChatPromptTemplate as L } from "@langchain/core/prompts";
12
- import { createAgent as Q } from "langchain";
13
- import { tool as K } from "@langchain/core/tools";
14
- import { s as nt, g as it, a as lt, c as ct, q as ut } from "../../chunks/groups.js";
15
- import mt from "@arcgis/core/identity/IdentityManager.js";
16
- import k from "@arcgis/core/request.js";
17
- import { Annotation as dt } from "@langchain/langgraph";
18
- const x = (s) => {
19
- for (let t = s.length - 1; t >= 0; t -= 1) {
20
- const e = s[t];
21
- if (e.type !== "human")
22
- continue;
23
- const a = e.content;
24
- if (typeof a == "string")
25
- return a;
26
- if (Array.isArray(a))
27
- return a.map(
28
- (r) => typeof r == "string" ? r : "text" in r && typeof r.text == "string" ? r.text : ""
29
- ).join(" ").trim();
30
- }
31
- return "";
32
- }, pt = () => ({ latestItemId: null, memory: {} }), N = (s) => {
33
- const t = s?.agentExecutionContext.sharedState.portalItemAnalyticsSummaryMemory?.value;
34
- return t ? { latestItemId: t.latestItemId, memory: t.memory } : pt();
35
- }, gt = n.object({
36
- intent: n.enum(["summarize", "followUp", "clarify"]),
37
- itemId: n.string().default(""),
38
- question: n.string().default("")
39
- }), ht = n.object({ summary: n.string(), followUpQuestions: n.array(n.string()).default([]) }), ft = n.object({ answer: n.string(), isRelevant: n.boolean() }), yt = async (s, t) => {
40
- await g({ text: "Answering follow-up...", agentName: "analytics" }, t);
41
- const e = N(s), a = s.analyticsItemId ?? e.latestItemId, r = a ? e.memory[a] : void 0, l = s.analyticsQuestion || x(s.agentExecutionContext.messages);
42
- return r ? {
43
- status: "success",
44
- outputMessage: (await b({
45
- promptText: bt,
46
- schema: ft,
47
- modelTier: "default",
48
- inputVariables: {
49
- summary: r.summary,
50
- question: l,
51
- fullContext: JSON.stringify(r.fullContext)
52
- }
53
- })).answer
54
- } : {
55
- status: "success",
56
- outputMessage: "I don't have enough information yet. Please ask me to summarize the item first using summarize item <item id>."
57
- };
58
- }, bt = `
59
- You answer follow-up questions about an ArcGIS item.
60
-
61
- Ground your answer in the provided item context.
62
- If the answer is not available from the provided context, state that clearly and suggest what to check next.
63
-
64
- Response rules:
65
- - Reply in concise markdown.
66
- - Keep the answer focused on the follow-up question.
67
- - Do not include internal identifiers.
68
- - Mark isRelevant=false when the question is not about this item or cannot be grounded in this item context.
69
-
70
- Item summary:
71
- {summary}
72
-
73
- Item full context
74
- {fullContext}
75
-
76
- Question:
77
- {question}
78
- `;
79
- function I(s) {
80
- const { portal: t, user: e } = s ?? {};
81
- if (!s || !t || !e)
2
+ import { c as zt } from "../../chunks/runtime.js";
3
+ import { LitElement as Et, createEvent as $t } from "@arcgis/lumina";
4
+ import { css as Rt, render as Dt, html as M } from "lit";
5
+ import { createRef as P, ref as k } from "lit/directives/ref.js";
6
+ import { u as Ut } from "../../chunks/useT9n.js";
7
+ import { NodeInterrupt as dt, Annotation as h, StateGraph as C, START as A, END as w } from "@langchain/langgraph/web";
8
+ import { sendTraceMessage as g, invokeStructuredPrompt as b, sendUXSuggestion as j, createAgentRuntimeStateWithSharedState as N, createChatModel as L, getEmbeddings as Ft } from "@arcgis/ai-components/utils/index.js";
9
+ import r from "zod";
10
+ import { a as Ot, c as Kt, q as Vt } from "../../chunks/groups.js";
11
+ import jt from "@arcgis/core/identity/IdentityManager.js";
12
+ import W from "@arcgis/core/request.js";
13
+ import { a as z, t as Lt, b as Bt } from "../../chunks/functionalities.js";
14
+ import { ChatPromptTemplate as B } from "@langchain/core/prompts";
15
+ import { tool as pt } from "@langchain/core/tools";
16
+ import { s as Qt, a as Wt } from "../../chunks/item2.js";
17
+ import { g as Jt, e as _t, i as Yt, c as Ht, a as Xt } from "../../chunks/groups2.js";
18
+ import Zt from "@arcgis/core/portal/Portal.js";
19
+ const mt = (t) => {
20
+ const { portal: e, user: a } = t ?? {};
21
+ return !!t && !!e && !!a;
22
+ };
23
+ function x(t) {
24
+ if (!mt(t))
82
25
  throw new Error("Invalid context: PortalAssistantContext with portal and user is required.");
83
26
  }
84
- const W = K(
85
- async ({ itemTitle: s }, t) => {
86
- const e = s.trim();
87
- if (!e)
88
- return null;
89
- const a = t?.configurable?.context;
90
- I(a);
91
- const { result: r, error: l } = await nt(a.portal, e, { num: 1 });
92
- return l && console.error("Error searching for portal item by title:", l), r?.results[0]?.id || null;
93
- },
94
- {
95
- name: "resolvePortalItemIdByTitle",
96
- description: 'Resolves an ArcGIS Portal item title to the best-match item id. Use this when a user references an item by title (including hash mentions like #title or #"title with spaces") instead of an explicit item id.',
97
- schema: n.object({
98
- itemTitle: n.string().describe("The portal item title to resolve to an item id.")
99
- })
100
- }
101
- ), It = async (s, t) => {
102
- await g({ text: "Analyzing intent...", agentName: "analytics" }, t);
103
- const e = x(s.agentExecutionContext.messages), a = !!N(s).latestItemId, r = await L.fromTemplate(wt).format({
104
- userMessage: e,
105
- hasSummaryContext: String(a)
106
- }), c = await Q({
107
- model: await F({ modelTier: "fast" }),
108
- tools: [W],
109
- systemPrompt: r,
110
- responseFormat: gt,
111
- checkpointer: !0
112
- }).invoke({ messages: s.agentExecutionContext.messages }, t), { intent: i, itemId: o, question: u } = c.structuredResponse, m = i === "clarify" || i === "summarize" && !o || i === "followUp" && !u;
113
- return {
114
- agentExecutionContext: { ...s.agentExecutionContext },
115
- analyticsIntent: m ? "clarify" : i,
116
- analyticsItemId: o || null,
117
- analyticsQuestion: u || "",
118
- status: "success",
119
- outputMessage: m ? 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".' : ""
120
- };
121
- }, wt = `
122
- Classify the user analytics request.
27
+ const te = `
28
+ Write a concise, friendly success message for adding members to a group.
123
29
 
124
30
  Rules:
125
- - intent="summarize" only when the user explicitly asks to summarize/overview/recap an item.
126
- - intent="followUp" for analytical questions about item details, including schema/fields/attributes/layers.
127
- - intent="clarify" when neither summarize nor follow-up intent is clear.
128
- - itemId must be the final resolved item id.
129
- - If request has explicit item id, set itemId directly.
130
- - If request references item title (for example #title, #"title with spaces", or plain quoted title), call resolvePortalItemIdByTitle and set itemId to the returned value.
131
- - Never return item titles in output fields.
132
- - If intent is "followUp", set question to the user's full question/request text.
133
- - If intent is "summarize", set question="".
134
- - When user asks to show/list/explain fields, schema, attributes, columns, or layer details, classify as "followUp" unless they explicitly request a summary.
135
- - If hasSummaryContext is true, prefer "followUp" for detail-oriented requests that do not explicitly ask to summarize.
136
-
137
- Examples:
138
- - "Summarize item 0123456789abcdef0123456789abcdef" => summarize, itemId="0123456789abcdef0123456789abcdef"
139
- - "Summarize item #california" => summarize, call resolvePortalItemIdByTitle("california") and set itemId to tool result
140
- - "Summarize item #"california farmland"" => summarize, call resolvePortalItemIdByTitle("california farmland") and set itemId to tool result
141
- - "Show the layer's available fields" => followUp
142
- - "List attributes and explain what status means" => followUp
143
- - "What fields are available?" with hasSummaryContext=true => followUp
144
- - "Give me an overview of item 0123456789abcdef0123456789abcdef" => summarize
31
+ - Keep it to 1-2 short sentences.
32
+ - Use plain text only.
33
+ - If there is no notAddedMembers, confirm that all requested members were added successfully.
34
+ - If there are notAddedMembers, acknowledge that some members could not be added and list the added and not added members separately then mention why based on the context
35
+ - Make sure to bold the usernames
145
36
 
146
- hasSummaryContext:
147
- {hasSummaryContext}
37
+ Added members:
38
+ {addedMembers}
148
39
 
149
- User message:
150
- {userMessage}
151
- `, xt = async (s, t) => {
152
- const e = s.analyticsItemId;
153
- if (!e)
154
- return {
155
- status: "success",
156
- outputMessage: 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".'
157
- };
158
- await g({ text: `Summarizing item ${e}...`, agentName: "analytics" }, t);
159
- const a = t?.configurable?.context;
160
- I(a);
161
- const { portal: r, user: l } = a, { result: c, error: i } = await it(l, r, e);
162
- if (i || !c)
163
- return await g({ text: "Failed to get item context for summarization", agentName: "analytics" }, t), {
164
- status: "success",
165
- outputMessage: "Unable to retrieve item context for summarization."
166
- };
167
- const { context: o } = c, u = await b({
168
- promptText: vt,
169
- schema: ht,
170
- modelTier: "default",
171
- inputVariables: { context: JSON.stringify(o) }
172
- }), { followUpQuestions: d, summary: p } = u, m = N(s), f = {
173
- latestItemId: e,
174
- memory: {
175
- ...m.memory,
176
- [e]: { summary: p, followUpQuestions: d, fullContext: o }
177
- }
178
- };
179
- return d.length && await B({ type: "suggested-prompts", data: { prompts: d } }, t), {
180
- status: "success",
181
- outputMessage: p,
182
- sharedStatePatch: { portalItemAnalyticsSummaryMemory: { value: f } }
183
- };
184
- }, vt = `
185
- You are a item summary tool for ArcGIS. Your job is to summarize an item's info based on the provided context.
186
- Summary rules:
187
- - The summary should be concise markdown, make sure to format the output nicely so it's easy to read.
188
- - Target length: 80-150 words.
189
- - Provide one short descriptive paragraph.
190
- - Also propose 3 concise follow-up questions grounded in the item summary.
191
- - Keep follow-up questions specific and actionable.
192
- Follow-up questions rules:
193
- - These questions should be in the format of a prompt that the user can click on.
194
- - Make sure the questions are relevant to the item summary and that you can answer based solely on the provided context.
195
- Do not include internal identifiers.
196
- If the user asks for a detailed summary, you may expand the response up to 300 words.
197
- Item context:
198
- {context}
199
- `, C = (s, t) => t ?? s, O = h.Root({
200
- ...E(),
201
- // States shared only across nodes in the graph, not between invocations
202
- analyticsIntent: h({
203
- reducer: C,
204
- default: () => "clarify"
205
- }),
206
- analyticsItemId: h({
207
- reducer: C,
208
- default: () => null
209
- }),
210
- analyticsQuestion: h({
211
- reducer: C,
212
- default: () => ""
213
- })
214
- }), St = () => new $(O).addNode("detectAnalyticsIntent", It).addNode("summarizePortalItem", xt).addNode("answerAnalyticsFollowUp", yt).addEdge(G, "detectAnalyticsIntent").addConditionalEdges("detectAnalyticsIntent", (t) => t.analyticsIntent === "summarize" ? "summarizePortalItem" : t.analyticsIntent === "followUp" ? "answerAnalyticsFollowUp" : y).addEdge("summarizePortalItem", y).addEdge("answerAnalyticsFollowUp", y), Mt = String.raw`- **portal-item-analytics** - Portal item analytics assistant:
215
- - summarizes ArcGIS portal items from item context
216
- - suggests follow-up prompts grounded in the item
217
- `, Tt = {
218
- id: "portal-item-analytics",
219
- name: "Portal Item Analytics",
220
- description: Mt,
221
- createGraph: St,
222
- workspace: O
223
- }, Pt = (s) => s.map((t) => `"${t}"`).join(", "), At = n.object({
224
- successMessage: n.string().default("")
225
- }), q = "portal-group-creation", D = "approveAddMembers", Ct = async (s, t) => {
226
- if (s.intentParams.intent !== "addMembers")
40
+ Not added members:
41
+ {notAddedMembers}
42
+ `, ee = (t) => t.map((e) => `"${e}"`).join(", "), ae = r.object({
43
+ successMessage: r.string().default("")
44
+ }), J = "portal-group-creation", _ = "approveAddMembers", ne = async (t, e) => {
45
+ if (t.intentParams.intent !== "addMembers")
227
46
  return {
228
47
  status: "success",
229
48
  outputMessage: "Use @mention usernames for the members you want to add."
230
49
  };
231
- const e = s.agentExecutionContext.sharedState.createdGroupId?.value;
232
- if (!e)
50
+ const a = t.agentExecutionContext.sharedState.createdGroupId?.value;
51
+ if (!a)
233
52
  return {
234
53
  status: "success",
235
54
  outputMessage: "Create a group first, then add members using @mention usernames."
236
55
  };
237
- const a = s.intentParams.memberInfo.memberIdentifiers.map((m) => m.trim()).filter(Boolean);
238
- if (!a.length)
56
+ const n = t.intentParams.memberInfo.memberIdentifiers.map((p) => p.trim()).filter(Boolean);
57
+ if (!n.length)
239
58
  return {
240
59
  status: "success",
241
60
  outputMessage: "Use @mention usernames for the members you want to add."
242
61
  };
243
- const l = `The following member(s) will be added to the newly created group:
62
+ const s = `The following member(s) will be added to the newly created group:
244
63
 
245
- ${a.map((m) => `- **@${m}**`).join(`
64
+ ${n.map((p) => `- **@${p}**`).join(`
246
65
  `)}
247
66
 
248
- Do you want to continue?`, { hitlResponse: c } = t?.configurable ?? {};
249
- if (c?.agentId !== q || c.id !== D) {
250
- const m = {
251
- agentId: q,
252
- id: D,
67
+ Do you want to continue?`, { hitlResponse: i } = e?.configurable ?? {};
68
+ if (i?.agentId !== J || i.id !== _) {
69
+ const p = {
70
+ agentId: J,
71
+ id: _,
253
72
  kind: "booleanChoice",
254
- message: l,
73
+ message: s,
255
74
  metadata: {
256
75
  action: "addMembers",
257
- groupId: e,
258
- members: [...a]
76
+ groupId: a,
77
+ members: [...n]
259
78
  }
260
79
  };
261
- throw new V(m);
80
+ throw new dt(p);
262
81
  }
263
- if (c.payload !== !0)
82
+ if (i.payload !== !0)
264
83
  return {
265
84
  status: "success",
266
85
  outputMessage: "Okay, I cancelled adding members to the group."
267
86
  };
268
87
  await g(
269
- { text: `Adding members ${Pt(a)}...`, agentName: "group-creation" },
270
- t
88
+ { text: `Adding members ${ee(n)}...`, agentName: "group-creation" },
89
+ e
271
90
  );
272
- const i = t?.configurable?.context;
273
- I(i);
274
- const { result: o, error: u } = await lt(i.portal, e, a);
275
- if (u || !o)
91
+ const u = e?.configurable?.context;
92
+ x(u);
93
+ const { result: c, error: d } = await Ot(u.portal, a, n);
94
+ if (d || !c)
276
95
  return {
277
96
  status: "success",
278
97
  outputMessage: "I could not add members to that group. Please confirm group access and user accounts, then try again."
279
98
  };
280
- const { addedUsernames: d, notAddedUsers: p } = o;
99
+ const { addedUsernames: l, notAddedUsers: m } = c;
281
100
  try {
282
101
  const f = (await b({
283
- promptText: $t,
284
- schema: At,
102
+ promptText: te,
103
+ schema: ae,
285
104
  modelTier: "fast",
286
105
  inputVariables: {
287
- addedMembers: d.join(", "),
106
+ addedMembers: l.join(", "),
288
107
  notAddedMembers: JSON.stringify(
289
- p.map((v) => ({ username: v.username, reason: v.error.message }))
108
+ m.map((y) => ({ username: y.username, reason: y.error.message }))
290
109
  )
291
110
  }
292
111
  })).successMessage;
293
112
  if (f)
294
113
  return { status: "success", outputMessage: f };
295
- } catch (m) {
296
- console.error("Error generating add-members success message:", m);
114
+ } catch (p) {
115
+ console.error("Error generating add-members success message:", p);
297
116
  }
298
117
  return {};
299
- }, $t = `
300
- Write a concise, friendly success message for adding members to a group.
118
+ }, oe = `
119
+ Write a concise, friendly success message after creating a portal group.
120
+
121
+ Rules:
122
+ - Mention that the group was created successfully.
123
+ - Mention that the user can add members by using @mention usernames.
124
+ - Keep it to 1-2 short sentences.
125
+ - Make sure to bold the group title in the message.
126
+
127
+ Group title:
128
+ {groupTitle}
129
+ `, se = `
130
+ Write a concise, friendly failure message after an attempt to create a portal group.
301
131
 
302
132
  Rules:
303
133
  - Keep it to 1-2 short sentences.
304
134
  - Use plain text only.
305
- - If there is no notAddedMembers, confirm that all requested members were added successfully.
306
- - If there are notAddedMembers, acknowledge that some members could not be added and list the added and not added members separately then mention why based on the context
307
- - Make sure to bold the usernames
135
+ - Mention that group creation failed.
136
+ - Include the failure reason in user-friendly language.
137
+ - End with a clear next step the user can try.
308
138
 
309
- Added members:
310
- {addedMembers}
139
+ Group title:
140
+ {groupTitle}
311
141
 
312
- Not added members:
313
- {notAddedMembers}
314
- `, R = "portal-group-creation", U = "approveCreateGroup", Gt = n.object({
315
- successMessage: n.string().default("")
316
- }), Et = n.object({
317
- failureMessage: n.string().default("")
318
- }), Nt = async (s, t) => {
319
- if (s.intentParams.intent !== "create")
142
+ Failure reason:
143
+ {failureReason}
144
+ `, Y = "portal-group-creation", H = "approveCreateGroup", re = r.object({
145
+ successMessage: r.string().default("")
146
+ }), ie = r.object({
147
+ failureMessage: r.string().default("")
148
+ }), ue = async (t, e) => {
149
+ if (t.intentParams.intent !== "create")
320
150
  return {
321
151
  status: "success",
322
152
  outputMessage: "Tell me the group title you want to use."
323
153
  };
324
- const e = s.intentParams.title.trim();
325
- if (!e)
154
+ const a = t.intentParams.title.trim();
155
+ if (!a)
326
156
  return {
327
157
  status: "success",
328
158
  outputMessage: "What title would you like for the new group?"
329
159
  };
330
- const a = `A group with the title **${e}** will be created. Do you want to continue?`, { hitlResponse: r } = t?.configurable;
331
- if (r?.agentId !== R || r.id !== U) {
332
- const u = {
333
- agentId: R,
334
- id: U,
160
+ const n = `A group with the title **${a}** will be created. Do you want to continue?`, { hitlResponse: o } = e?.configurable;
161
+ if (o?.agentId !== Y || o.id !== H) {
162
+ const d = {
163
+ agentId: Y,
164
+ id: H,
335
165
  kind: "booleanChoice",
336
- message: a,
166
+ message: n,
337
167
  metadata: {
338
168
  action: "createGroup",
339
- title: e,
169
+ title: a,
340
170
  access: "private"
341
171
  }
342
172
  };
343
- throw new V(u);
173
+ throw new dt(d);
344
174
  }
345
- if (r.payload !== !0)
175
+ if (o.payload !== !0)
346
176
  return {
347
177
  status: "success",
348
- outputMessage: `Okay, I cancelled creating **${e}**.`
178
+ outputMessage: `Okay, I cancelled creating **${a}**.`
349
179
  };
350
- await g({ text: `Creating group "${e}"...`, agentName: "group-creation" }, t);
351
- const l = t?.configurable?.context;
352
- I(l);
353
- const { result: c, error: i } = await ct(l.portal, {
354
- title: e,
180
+ await g({ text: `Creating group "${a}"...`, agentName: "group-creation" }, e);
181
+ const s = e?.configurable?.context;
182
+ x(s);
183
+ const { result: i, error: u } = await Kt(s.portal, {
184
+ title: a,
355
185
  access: "private"
356
186
  });
357
- if (i || !c) {
358
- const u = i?.message?.trim() || "No additional details were provided.";
187
+ if (u || !i) {
188
+ const d = u?.message?.trim() || "No additional details were provided.";
359
189
  try {
360
- const p = (await b({
361
- promptText: qt,
362
- schema: Et,
190
+ const m = (await b({
191
+ promptText: se,
192
+ schema: ie,
363
193
  modelTier: "fast",
364
194
  inputVariables: {
365
- groupTitle: e,
366
- failureReason: u
195
+ groupTitle: a,
196
+ failureReason: d
367
197
  }
368
198
  })).failureMessage.trim();
369
- if (p)
199
+ if (m)
370
200
  return {
371
201
  status: "success",
372
- outputMessage: p
202
+ outputMessage: m
373
203
  };
374
- } catch (d) {
375
- console.error("Error generating create-group failure message:", d);
204
+ } catch (l) {
205
+ console.error("Error generating create-group failure message:", l);
376
206
  }
377
207
  return {
378
208
  status: "success",
379
209
  outputMessage: "I could not create that group. Please confirm your permissions and try again with the group title."
380
210
  };
381
211
  }
382
- const o = c.id;
212
+ const c = i.id;
383
213
  try {
384
- const d = (await b({
385
- promptText: kt,
386
- schema: Gt,
214
+ const l = (await b({
215
+ promptText: oe,
216
+ schema: re,
387
217
  modelTier: "fast",
388
218
  inputVariables: {
389
- groupTitle: e
219
+ groupTitle: a
390
220
  }
391
221
  })).successMessage.trim();
392
- if (d)
222
+ if (l)
393
223
  return {
394
224
  status: "success",
395
- outputMessage: d,
396
- sharedStatePatch: { createdGroupId: { value: o } },
397
- createdGroupId: o
225
+ outputMessage: l,
226
+ sharedStatePatch: { createdGroupId: { value: c } },
227
+ createdGroupId: c
398
228
  };
399
- } catch (u) {
400
- console.error("Error generating create-group success message:", u);
229
+ } catch (d) {
230
+ console.error("Error generating create-group success message:", d);
401
231
  }
402
232
  return {};
403
- }, kt = `
404
- Write a concise, friendly success message after creating a portal group.
405
-
406
- Rules:
407
- - Mention that the group was created successfully.
408
- - Mention that the user can add members by using @mention usernames.
409
- - Keep it to 1-2 short sentences.
410
- - Make sure to bold the group title in the message.
411
-
412
- Group title:
413
- {groupTitle}
414
- `, qt = `
415
- Write a concise, friendly failure message after an attempt to create a portal group.
416
-
417
- Rules:
418
- - Keep it to 1-2 short sentences.
419
- - Use plain text only.
420
- - Mention that group creation failed.
421
- - Include the failure reason in user-friendly language.
422
- - End with a clear next step the user can try.
423
-
424
- Group title:
425
- {groupTitle}
426
-
427
- Failure reason:
428
- {failureReason}
429
- `, Dt = n.object({
430
- intent: n.enum(["clarify", "create", "addMembers"]).default("clarify"),
431
- title: n.string().default(""),
432
- memberIdentifiers: n.array(n.string()).default([]),
433
- clarifyMessage: n.string().default("")
434
- }), Rt = async (s, t) => {
435
- await g({ text: "Thinking about groups...", agentName: "group-creation" }, t);
436
- const e = x(s.agentExecutionContext.messages).trim(), a = await b({
437
- promptText: Ut,
438
- schema: Dt,
439
- modelTier: "default",
440
- inputVariables: { userMessage: e }
441
- }), r = a.title.trim(), l = a.memberIdentifiers.filter(Boolean), c = a.clarifyMessage.trim(), i = a.intent === "create" && !!r, o = a.intent === "addMembers" && l.length > 0;
442
- return {
443
- intentParams: i ? { intent: "create", title: r } : o ? { intent: "addMembers", memberInfo: { memberIdentifiers: l } } : { intent: "clarify" },
444
- status: "success",
445
- outputMessage: !i && !o ? c : ""
446
- };
447
- }, Ut = `
233
+ }, v = (t) => {
234
+ for (let e = t.length - 1; e >= 0; e -= 1) {
235
+ const a = t[e];
236
+ if (a.type !== "human")
237
+ continue;
238
+ const n = a.content;
239
+ if (typeof n == "string")
240
+ return n;
241
+ if (Array.isArray(n))
242
+ return n.map(
243
+ (o) => typeof o == "string" ? o : "text" in o && typeof o.text == "string" ? o.text : ""
244
+ ).join(" ").trim();
245
+ }
246
+ return "";
247
+ }, ce = `
448
248
  You classify whether a user is asking to create a new ArcGIS Portal group or add members to an existing group.
449
249
 
450
250
  Rules:
@@ -470,385 +270,1597 @@ Examples:
470
270
 
471
271
  User message:
472
272
  {userMessage}
473
- `, zt = n.discriminatedUnion("destinationType", [
474
- n.object({
475
- destinationType: n.literal("portal-content")
476
- }),
477
- n.object({
478
- destinationType: n.literal("portal-groups")
479
- }),
480
- n.object({
481
- destinationType: n.literal("portal-item"),
482
- itemId: n.string().trim().min(1)
483
- }),
484
- n.object({
485
- destinationType: n.literal("portal-group"),
486
- groupId: n.string().trim().min(1)
487
- })
488
- ]);
489
- function jt(s) {
490
- const t = zt.safeParse(s);
491
- return t.success ? t.data : void 0;
492
- }
493
- const _ = "portal-navigation", J = async (s, t) => {
494
- await B({ type: _, data: { ...s } }, t);
495
- }, Vt = async (s, t) => {
496
- const e = s.createdGroupId ?? s.agentExecutionContext.sharedState.createdGroupId?.value;
497
- return e ? (await g({ text: "Preparing navigation...", agentName: "group-creation" }, t), await J({ destinationType: "portal-group", groupId: e }, t), {}) : {};
498
- }, z = (s, t) => t ?? s, Y = h.Root({
499
- ...E(),
273
+ `, le = r.object({
274
+ intent: r.enum(["clarify", "create", "addMembers"]).default("clarify"),
275
+ title: r.string().default(""),
276
+ memberIdentifiers: r.array(r.string()).default([]),
277
+ clarifyMessage: r.string().default("")
278
+ }), de = async (t, e) => {
279
+ await g({ text: "Thinking about groups...", agentName: "group-creation" }, e);
280
+ const a = v(t.agentExecutionContext.messages).trim(), n = await b({
281
+ promptText: ce,
282
+ schema: le,
283
+ modelTier: "default",
284
+ inputVariables: { userMessage: a }
285
+ }), o = n.title.trim(), s = n.memberIdentifiers.filter(Boolean), i = n.clarifyMessage.trim(), u = n.intent === "create" && !!o, c = n.intent === "addMembers" && s.length > 0;
286
+ return {
287
+ intentParams: u ? { intent: "create", title: o } : c ? { intent: "addMembers", memberInfo: { memberIdentifiers: s } } : { intent: "clarify" },
288
+ status: "success",
289
+ outputMessage: !u && !c ? i : ""
290
+ };
291
+ }, pe = ["favorites", "group", "living-atlas", "org"], me = ["featured", "my", "organization"], ge = ["licenses", "members", "overview", "reports", "settings", "status"], he = r.object({
292
+ destinationType: r.literal("portal-content"),
293
+ hash: r.enum(pe).optional(),
294
+ t9nKey: r.string().min(1).optional()
295
+ }), fe = r.object({
296
+ destinationType: r.literal("portal-groups"),
297
+ hash: r.enum(me).optional(),
298
+ t9nKey: r.string().min(1).optional()
299
+ }), ye = r.object({
300
+ destinationType: r.literal("portal-org"),
301
+ hash: r.enum(ge).optional(),
302
+ t9nKey: r.string().min(1).optional()
303
+ }), we = r.object({
304
+ destinationType: r.literal("portal-item"),
305
+ itemId: r.string().trim().min(1),
306
+ t9nKey: r.string().min(1).optional()
307
+ }), ve = r.object({
308
+ destinationType: r.literal("portal-group"),
309
+ groupId: r.string().trim().min(1),
310
+ t9nKey: r.string().min(1).optional()
311
+ }), be = r.object({
312
+ destinationType: r.union([
313
+ r.literal("portal-gallery"),
314
+ r.literal("portal-map-viewer"),
315
+ r.literal("portal-notebooks"),
316
+ r.literal("portal-scene-viewer")
317
+ ]),
318
+ t9nKey: r.string().min(1).optional()
319
+ }), Ie = r.union([
320
+ he,
321
+ fe,
322
+ ye,
323
+ we,
324
+ ve,
325
+ be
326
+ ]), gt = "portal-navigation", E = async (t, e) => {
327
+ const a = e?.configurable?.context;
328
+ !mt(a) || !a.navigationTargetMap?.[t.destinationType] || await j({ type: gt, data: { ...t } }, e);
329
+ }, xe = async (t, e) => {
330
+ const a = t.createdGroupId ?? t.agentExecutionContext.sharedState.createdGroupId?.value;
331
+ return a ? (await g({ text: "Preparing navigation...", agentName: "group-creation" }, e), await E({ destinationType: "portal-group", groupId: a }, e), {}) : {};
332
+ }, X = (t, e) => e ?? t, ht = h.Root({
333
+ ...N(),
500
334
  // * Shared state between nodes (but not persisted to the agent execution context)
501
335
  /** Parameters related to the user's intent for group creation actions */
502
- intentParams: h({ reducer: z, default: () => ({ intent: "clarify" }) }),
336
+ intentParams: h({ reducer: X, default: () => ({ intent: "clarify" }) }),
503
337
  /** The ID of the group that was created
504
338
  * even though we already have this in the shared state
505
339
  * we still need it here to also share between nodes
506
340
  */
507
- createdGroupId: h({ reducer: z, default: () => "" })
508
- }), Ft = () => new $(Y).addNode("detectGroupCreationIntent", Rt).addNode("createPortalGroup", Nt).addNode("addMembersToPortalGroup", Ct).addNode("suggestCreatedGroupNavigation", Vt).addEdge(G, "detectGroupCreationIntent").addConditionalEdges("detectGroupCreationIntent", (t) => {
509
- switch (t.intentParams.intent) {
341
+ createdGroupId: h({ reducer: X, default: () => "" })
342
+ }), Se = () => new C(ht).addNode("detectGroupCreationIntent", de).addNode("createPortalGroup", ue).addNode("addMembersToPortalGroup", ne).addNode("suggestCreatedGroupNavigation", xe).addEdge(A, "detectGroupCreationIntent").addConditionalEdges("detectGroupCreationIntent", (e) => {
343
+ switch (e.intentParams.intent) {
510
344
  case "create":
511
345
  return "createPortalGroup";
512
346
  case "addMembers":
513
347
  return "addMembersToPortalGroup";
514
348
  default:
515
- return y;
349
+ return w;
516
350
  }
517
- }).addEdge("createPortalGroup", "suggestCreatedGroupNavigation").addEdge("addMembersToPortalGroup", "suggestCreatedGroupNavigation").addEdge("suggestCreatedGroupNavigation", y), Bt = String.raw`- **portal-group-creation** - Portal group creation assistant:
351
+ }).addEdge("createPortalGroup", "suggestCreatedGroupNavigation").addEdge("addMembersToPortalGroup", "suggestCreatedGroupNavigation").addEdge("suggestCreatedGroupNavigation", w), Me = String.raw`- **portal-group-creation** - Portal group creation assistant:
518
352
  - creates a new ArcGIS Portal group for the signed-in user
519
353
  - adds users to the newly created group using @mention usernames
520
- `, Lt = {
354
+ `, Te = {
521
355
  id: "portal-group-creation",
522
356
  name: "Portal Group Creation",
523
- description: Bt,
524
- createGraph: Ft,
525
- workspace: Y
526
- }, H = "portalDocAssistantMemory", Qt = () => ({ conversationId: "" }), Kt = (s) => {
527
- const t = s?.[H]?.value;
528
- if (!t || typeof t != "object")
529
- return Qt();
530
- const e = t;
357
+ description: Me,
358
+ createGraph: Se,
359
+ workspace: ht
360
+ }, ft = "portalDocAssistantMemory", Ge = () => ({ conversationId: "" }), Ce = (t) => {
361
+ const e = t?.[ft]?.value;
362
+ if (!e || typeof e != "object")
363
+ return Ge();
364
+ const a = e;
365
+ return {
366
+ conversationId: typeof a.conversationId == "string" ? a.conversationId : ""
367
+ };
368
+ }, Ae = (t) => ({
369
+ [ft]: { value: t }
370
+ }), Ne = {
371
+ pipeline: {
372
+ follow_up: { allow: !1 }
373
+ }
374
+ };
375
+ function Pe(t) {
531
376
  return {
532
- conversationId: typeof e.conversationId == "string" ? e.conversationId : ""
377
+ kind: "DocAIAssistantRequest",
378
+ filters: {
379
+ ...Ne,
380
+ persona: { persona: t }
381
+ }
533
382
  };
534
- }, Wt = (s) => ({
535
- [H]: { value: s }
536
- });
537
- async function Ot({
538
- portal: s,
539
- question: t,
540
- persona: e,
541
- previousConversationId: a,
542
- signal: r,
543
- skillId: l
383
+ }
384
+ async function ke({
385
+ portal: t,
386
+ question: e,
387
+ persona: a,
388
+ previousConversationId: n,
389
+ signal: o,
390
+ skillId: s
544
391
  }) {
545
- l ??= "doc_ai_assistant";
546
- const i = await _t({
547
- portal: s,
548
- skillId: l,
549
- message: t,
550
- options: { context: {
551
- kind: "DocAIAssistantRequest",
552
- filters: { persona: { persona: e } }
553
- }, previousConversationId: a, signal: r }
392
+ s ??= "doc_ai_assistant";
393
+ const i = Pe(a), u = await qe({
394
+ portal: t,
395
+ skillId: s,
396
+ message: e,
397
+ options: { context: i, previousConversationId: n, signal: o }
554
398
  });
555
399
  return {
556
- reply: Jt(i, l),
557
- conversationId: i[0]?.conversationId ?? ""
400
+ reply: ze(u, s),
401
+ conversationId: u[0]?.conversationId ?? ""
558
402
  };
559
403
  }
560
- async function _t({
561
- portal: s,
562
- skillId: t,
563
- message: e,
564
- options: a
404
+ async function qe({
405
+ portal: t,
406
+ skillId: e,
407
+ message: a,
408
+ options: n
565
409
  }) {
566
- const l = `${s.helperServices.aiAssistantServices.url}/skills/${t}/chat`, c = {
410
+ const s = `${t.helperServices.aiAssistantServices.url}/skills/${e}/chat`, i = {
567
411
  "Content-Type": "application/json",
568
- token: mt.findCredential(s.url)?.token ?? ""
569
- }, i = await k(l, {
412
+ token: jt.findCredential(t.url)?.token ?? ""
413
+ }, u = await W(s, {
570
414
  method: "post",
571
415
  body: JSON.stringify({
572
- message: e,
573
- context: a.context,
574
- conversationId: a.previousConversationId
416
+ message: a,
417
+ context: n.context,
418
+ conversationId: n.previousConversationId
575
419
  }),
576
- headers: c,
577
- signal: a.signal
420
+ headers: i,
421
+ signal: n.signal
578
422
  });
579
- if (i.httpStatus !== 200)
580
- throw new Error(`Doc assistant chat failed (${i.httpStatus})`, {
581
- cause: i.data
423
+ if (u.httpStatus !== 200)
424
+ throw new Error(`Doc assistant chat failed (${u.httpStatus})`, {
425
+ cause: u.data
582
426
  });
583
- const o = i.data, u = [o], { conversationId: d, inquiryId: p } = o, m = async (f, v) => {
584
- if (!v)
427
+ const c = u.data, d = [c], { conversationId: l, inquiryId: m } = c, p = async (f, y) => {
428
+ if (!y)
585
429
  return;
586
- await ot(1e3);
587
- const S = await k(l, {
430
+ await Lt(500);
431
+ const I = await W(s, {
588
432
  method: "post",
589
- body: JSON.stringify({ conversationId: d, inquiryId: p, ackSequenceNumber: f }),
590
- headers: c,
591
- signal: a.signal
433
+ body: JSON.stringify({ conversationId: l, inquiryId: m, ackSequenceNumber: f }),
434
+ headers: i,
435
+ signal: n.signal
592
436
  });
593
- if (S.httpStatus !== 200)
594
- throw new Error(`Doc assistant poll failed (${S.httpStatus})`, {
595
- cause: S.data
437
+ if (I.httpStatus !== 200)
438
+ throw new Error(`Doc assistant poll failed (${I.httpStatus})`, {
439
+ cause: I.data
596
440
  });
597
- const A = S.data;
598
- u.push(A), await m(A.sequenceNumber, A.hasMore);
441
+ const S = I.data;
442
+ d.push(S), await p(S.sequenceNumber, S.hasMore);
599
443
  };
600
- return o.hasMore && await m(o.sequenceNumber, o.hasMore), u;
444
+ return c.hasMore && await p(c.sequenceNumber, c.hasMore), d;
601
445
  }
602
- function Jt(s, t) {
603
- switch (t) {
446
+ function ze(t, e) {
447
+ switch (e) {
604
448
  case "doc_chat":
605
- return s.find((e) => e.message != null)?.message ?? "";
449
+ return t.find((a) => a.message != null)?.message ?? "";
606
450
  case "doc_ai_assistant":
607
- for (let e = s.length - 1; e >= 0; e -= 1) {
608
- const a = s[e];
609
- if (a.context?.kind === "DocAIAssistantContext") {
610
- const r = a.context.results?.[0]?.reply;
611
- if (r)
612
- return r;
451
+ for (let a = t.length - 1; a >= 0; a -= 1) {
452
+ const n = t[a];
453
+ if (n.context?.kind === "DocAIAssistantContext") {
454
+ const o = n.context.results?.[0]?.reply;
455
+ if (o)
456
+ return o;
613
457
  }
614
458
  }
615
459
  return "";
616
460
  default:
617
- return P(t);
461
+ return z(e);
618
462
  }
619
463
  }
620
- const Yt = async (s, t) => {
621
- await g({ text: "Asking documentation assistant...", agentName: "doc-assistant" }, t);
622
- const e = x(s.agentExecutionContext.messages).trim();
623
- if (!e)
464
+ const Ee = async (t, e) => {
465
+ await g({ text: "Asking documentation assistant...", agentName: "doc-assistant" }, e);
466
+ const a = v(t.agentExecutionContext.messages).trim();
467
+ if (!a)
624
468
  return {
625
469
  status: "success",
626
470
  outputMessage: "Please share your question and I can help with ArcGIS and Portal documentation."
627
471
  };
628
- const a = t?.configurable?.context;
629
- I(a);
630
- const r = Kt(s.agentExecutionContext.sharedState), { reply: l, conversationId: c } = await Ot({
631
- portal: a.portal,
632
- question: e,
633
- previousConversationId: r.conversationId || void 0,
472
+ const n = e?.configurable?.context;
473
+ x(n);
474
+ const o = Ce(t.agentExecutionContext.sharedState), { reply: s, conversationId: i } = await ke({
475
+ portal: n.portal,
476
+ question: a,
477
+ previousConversationId: o.conversationId || void 0,
634
478
  skillId: "doc_ai_assistant",
635
- persona: "developers"
479
+ persona: "doc-online"
636
480
  });
637
481
  return {
638
482
  status: "success",
639
- outputMessage: l.trim() || "I could not retrieve a response from the documentation assistant.",
640
- sharedStatePatch: Wt({
641
- conversationId: c || r.conversationId
483
+ outputMessage: s.trim() || "I could not retrieve a response from the documentation assistant.",
484
+ sharedStatePatch: Ae({
485
+ conversationId: i || o.conversationId
642
486
  })
643
487
  };
644
- }, Ht = K(
645
- async ({ groupTitle: s }, t) => {
646
- const e = s.trim();
647
- if (!e)
488
+ }, yt = pt(
489
+ async ({ groupTitle: t }, e) => {
490
+ const a = t.trim();
491
+ if (!a)
648
492
  return null;
649
- const a = t?.configurable?.context;
650
- I(a);
493
+ const n = e?.configurable?.context;
494
+ x(n);
651
495
  try {
652
- return (await ut(a.portal, { query: `title:${e}`, num: 1 }))?.results[0]?.id || null;
653
- } catch (r) {
654
- return console.error("Error searching for portal group by title:", r), null;
496
+ return (await Vt(n.portal, { query: `title:${a}`, num: 1 }))?.results[0]?.id || null;
497
+ } catch (o) {
498
+ return console.error("Error searching for portal group by title:", o), null;
655
499
  }
656
500
  },
657
501
  {
658
502
  name: "resolvePortalGroupIdByTitle",
659
503
  description: "Resolves an ArcGIS Portal group title to the best-match group id. Use this when a user references a group by title instead of an explicit group id.",
660
- schema: n.object({
661
- groupTitle: n.string().describe("The portal group title to resolve to a group id.")
504
+ schema: r.object({
505
+ groupTitle: r.string().describe("The portal group title to resolve to a group id.")
662
506
  })
663
507
  }
664
- ), j = n.object({
665
- shouldSuggestNavigation: n.boolean().default(!1),
666
- destinationType: n.enum(["none", "portal-content", "portal-item", "portal-groups", "portal-group"]).default("none"),
667
- itemId: n.string().default(""),
668
- groupId: n.string().default("")
669
- }), Xt = async (s, t) => {
670
- await g({ text: "Extracting navigation intent...", agentName: "doc-assistant" }, t);
671
- const e = s.outputMessage.trim();
672
- if (!e)
673
- return {};
674
- const a = x(s.agentExecutionContext.messages).trim(), r = await L.fromTemplate(te).format({
675
- question: a,
676
- response: e
677
- }), c = await Q({
678
- model: await F({ modelTier: "default" }),
679
- tools: [W, Ht],
680
- systemPrompt: r,
681
- responseFormat: j,
682
- checkpointer: !0
683
- }).invoke({ messages: s.agentExecutionContext.messages }, t), i = j.parse(c.structuredResponse ?? {});
684
- if (!i.shouldSuggestNavigation || i.destinationType === "none")
685
- return {};
686
- const o = Zt(i);
687
- return o ? (await J(o, t), {}) : {};
688
- };
689
- function Zt({
690
- destinationType: s,
691
- itemId: t,
692
- groupId: e
693
- }) {
694
- switch (s) {
695
- case "portal-content":
696
- return { destinationType: "portal-content" };
697
- case "portal-groups":
698
- return { destinationType: "portal-groups" };
699
- case "portal-item":
700
- return t ? { destinationType: "portal-item", itemId: t } : null;
701
- case "portal-group":
702
- return e ? { destinationType: "portal-group", groupId: e } : null;
703
- case "none":
508
+ ), wt = pt(
509
+ async ({ itemTitle: t }, e) => {
510
+ const a = t.trim();
511
+ if (!a)
704
512
  return null;
705
- default:
706
- return P(s);
513
+ const n = e?.configurable?.context;
514
+ x(n);
515
+ const { result: o, error: s } = await Qt(n.portal, a, { num: 1 });
516
+ return s && console.error("Error searching for portal item by title:", s), o?.results[0]?.id || null;
517
+ },
518
+ {
519
+ name: "resolvePortalItemIdByTitle",
520
+ description: 'Resolves an ArcGIS Portal item title to the best-match item id. Use this when a user references an item by title (including hash mentions like #title or #"title with spaces") instead of an explicit item id.',
521
+ schema: r.object({
522
+ itemTitle: r.string().describe("The portal item title to resolve to an item id.")
523
+ })
707
524
  }
525
+ );
526
+ function G(t, e = "#") {
527
+ const a = t.match(new RegExp(`\\${e}"([^"]+)"`, "u"));
528
+ if (a?.[1])
529
+ return a[1].trim();
530
+ const n = t.match(new RegExp(`\\${e}([^\\s"']+)`, "u"));
531
+ return n?.[1] ? n[1].trim() : null;
708
532
  }
709
- const te = `
533
+ const vt = {
534
+ "portal-content": {
535
+ description: "The main content page of the portal.",
536
+ hints: ["My content", "Content"]
537
+ },
538
+ "portal-content-favorites": {
539
+ description: "The Favorites view under Content in the portal.",
540
+ hints: ["My favorites", "Favorites", "Content favorites"]
541
+ },
542
+ "portal-content-group": {
543
+ description: "The Groups view under Content in the portal.",
544
+ hints: ["Content groups", "Group content", "My groups content"]
545
+ },
546
+ "portal-content-living-atlas": {
547
+ description: "The Living Atlas view under Content in the portal.",
548
+ hints: ["Living Atlas", "Content living atlas"]
549
+ },
550
+ "portal-content-organization": {
551
+ description: "The Organization view under Content in the portal.",
552
+ hints: ["Organization content", "Content organization", "My organization content"]
553
+ },
554
+ "portal-gallery": {
555
+ description: "The gallery page of the portal.",
556
+ hints: ["Gallery", "Featured content", "Maps and apps"]
557
+ },
558
+ "portal-group": {
559
+ description: "A specific group page in the portal.",
560
+ hints: ["Group", "group page"]
561
+ },
562
+ "portal-groups": {
563
+ description: "The groups listing page of the portal.",
564
+ hints: ["Groups", "Browse groups"]
565
+ },
566
+ "portal-groups-featured": {
567
+ description: "The Featured groups view under Groups in the portal.",
568
+ hints: ["Featured groups", "Groups featured"]
569
+ },
570
+ "portal-groups-my": {
571
+ description: "The My groups view under Groups in the portal.",
572
+ hints: ["My groups", "Groups my"]
573
+ },
574
+ "portal-groups-organization": {
575
+ description: "The Organization groups view under Groups in the portal.",
576
+ hints: ["Organization groups", "Groups organization", "My organization groups"]
577
+ },
578
+ "portal-item": {
579
+ description: "A specific item page in the portal.",
580
+ hints: ["Item", "item page"]
581
+ },
582
+ "portal-map-viewer": {
583
+ description: "The Map Viewer app of the portal.",
584
+ hints: ["Map Viewer", "Map", "Open map"]
585
+ },
586
+ "portal-notebooks": {
587
+ description: "The Notebooks home page of the portal.",
588
+ hints: ["Notebooks", "Notebook home", "My notebooks"]
589
+ },
590
+ "portal-scene-viewer": {
591
+ description: "The Scene Viewer app of the portal.",
592
+ hints: ["Scene Viewer", "Scene", "3D scene"]
593
+ },
594
+ "portal-org-security": {
595
+ description: "The Organization > Settings > Security page of the portal.",
596
+ hints: ["Organization settings", "Security", "Organization > Settings > Security"]
597
+ }
598
+ }, $e = Bt(vt), Re = Object.entries(vt).map(([t, { description: e, hints: a }]) => ` - ${t}: ${e} (hints: ${a.join(", ")})`).join(`
599
+ `), De = `
710
600
  You decide whether the assistant response should include a navigation action to ArcGIS Portal.
711
601
 
712
602
  Given the user question and assistant response:
713
603
  - Decide if a navigation action would help the user complete the task.
714
- - If yes, choose one destination type:
715
- - portal-content: portal content page
716
- - portal-groups: groups listing page
717
- - portal-item: specific item page (requires itemId)
718
- - portal-group: specific group page (requires groupId)
604
+ - If yes, choose one destinationType:
605
+ ${Re}
719
606
 
720
607
  Rules:
608
+ - Only suggest navigation when you are highly confident the destination will help complete the user's task.
609
+ - If confidence is below 0.85, set shouldSuggestNavigation=false and destinationType=none.
610
+ - If there is no clear destination from the allowed types, set shouldSuggestNavigation=false and destinationType=none.
721
611
  - If no navigation is useful, set shouldSuggestNavigation=false and destinationType=none.
722
- - If destinationType is portal-item and user references an item by title (for example #title, #"title with spaces", or plain quoted title), call resolvePortalItemIdByTitle and set itemId from the tool result.
723
- - If destinationType is portal-group and user references a group by title (for example $title, $"title with spaces", or plain quoted group title), call resolvePortalGroupIdByTitle and set groupId from the tool result.
724
- - Do not invent itemId.
725
- - Do not invent groupId.
726
- - Prefer destinationType=portal-content for generic "go to content" guidance.
612
+ - Prefer the most specific destination that is clearly supported by the question and response.
613
+ - Use entity-level destinations over collection/root destinations when both could apply and the entity target is explicit.
614
+ - Use collection/root destinations only for generic browsing intent with no specific entity target.
615
+ - If a chosen destination requires parameters, include all required parameters.
616
+ - If required parameters are missing or uncertain, set shouldSuggestNavigation=false and destinationType=none.
617
+ - Do not invent required parameters.
618
+ - Always include a confidence score from 0 to 1 in the output.
619
+ - Confidence means confidence that a navigation suggestion should be shown to the user.
620
+ - If shouldSuggestNavigation=false or destinationType=none, confidence must be <= 0.5.
621
+ - Use confidence >= 0.85 only when shouldSuggestNavigation=true and destinationType is not none.
727
622
 
728
623
  User question:
729
624
  {question}
730
625
 
731
626
  Assistant response:
732
627
  {response}
733
- `, X = dt.Root({
734
- ...E()
735
- }), ee = () => new $(X).addNode("answerDocQuestion", Yt).addNode("extractNavigationIntent", Xt).addEdge(G, "answerDocQuestion").addEdge("answerDocQuestion", "extractNavigationIntent").addEdge("extractNavigationIntent", y), se = String.raw`- **portal-doc-assistant** - General ArcGIS documentation and Portal help assistant:
736
- - answers general ArcGIS, Portal, Enterprise, and JavaScript SDK questions
737
- - acts as a fallback when specialized agents are not applicable
738
- `, ae = {
739
- id: "portal-doc-assistant",
740
- name: "Portal Doc Assistant",
741
- description: se,
742
- createGraph: ee,
743
- workspace: X
744
- }, re = st`:host{height:100%;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);display:block;width:100%;--tw-shadow: 0 1px 6px -1px rgba(0, 0, 0, .16), 0 1px 2px -1px rgba(0, 0, 0, .08);--tw-shadow-colored: 0 1px 6px -1px var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.chat-entry{display:flex;flex-direction:column;gap:.75rem;width:100%}.chat-actions{display:flex;justify-content:flex-end;gap:.5rem}.header-actions{display:flex;gap:.5rem;padding-inline-start:.75rem}.navigation-block{display:flex;flex-direction:column;align-items:stretch;gap:.35rem;margin-top:.5rem}.navigation-button{width:100%;margin-block:.25rem}.navigation-block-description{font-size:.75rem;color:var(--calcite-color-text-3)}`, oe = (s, t) => {
745
- const { destinationType: e } = s, a = `${t.url}/home`;
746
- switch (e) {
628
+ `, Z = r.object({
629
+ shouldSuggestNavigation: r.boolean().default(!1),
630
+ destinationType: r.enum(["none", ...$e]).default("none"),
631
+ itemId: r.string().default(""),
632
+ groupId: r.string().default(""),
633
+ confidence: r.number().min(0).max(1).default(0)
634
+ }), Ue = async (t, e) => {
635
+ await g({ text: "Extracting navigation intent...", agentName: "doc-assistant" }, e);
636
+ const a = t.outputMessage.trim();
637
+ if (!a)
638
+ return {};
639
+ const n = v(t.agentExecutionContext.messages).trim(), o = await B.fromTemplate(De).format({
640
+ question: n,
641
+ response: a
642
+ }), i = (await L({ modelTier: "fast" })).withStructuredOutput(Z), u = Z.parse(await i.invoke(o));
643
+ if (!u.shouldSuggestNavigation || u.destinationType === "none")
644
+ return {};
645
+ if (u.destinationType === "portal-item" && !u.itemId) {
646
+ const d = G(n, "#");
647
+ d && (u.itemId = await wt.invoke({ itemTitle: d }, e) ?? "");
648
+ }
649
+ if (u.destinationType === "portal-group" && !u.groupId) {
650
+ const d = G(n, "$") ?? G(n, "#");
651
+ d && (u.groupId = await yt.invoke({ groupTitle: d }, e) ?? "");
652
+ }
653
+ const c = Fe(u);
654
+ return c ? (await E(c, e), {}) : {};
655
+ };
656
+ function Fe({
657
+ destinationType: t,
658
+ itemId: e,
659
+ groupId: a
660
+ }) {
661
+ switch (t) {
747
662
  case "portal-content":
748
- return `${a}/content.html`;
663
+ case "portal-gallery":
749
664
  case "portal-groups":
750
- return `${a}/groups.html`;
665
+ case "portal-map-viewer":
666
+ case "portal-notebooks":
667
+ case "portal-scene-viewer":
668
+ return { destinationType: t };
669
+ case "portal-org-security":
670
+ return { destinationType: "portal-org", hash: "settings" };
671
+ case "portal-content-favorites":
672
+ return { destinationType: "portal-content", hash: "favorites" };
673
+ case "portal-content-group":
674
+ return { destinationType: "portal-content", hash: "group" };
675
+ case "portal-content-living-atlas":
676
+ return { destinationType: "portal-content", hash: "living-atlas" };
677
+ case "portal-content-organization":
678
+ return { destinationType: "portal-content", hash: "org" };
679
+ case "portal-groups-featured":
680
+ return { destinationType: "portal-groups", hash: "featured" };
681
+ case "portal-groups-my":
682
+ return { destinationType: "portal-groups", hash: "my" };
683
+ case "portal-groups-organization":
684
+ return { destinationType: "portal-groups", hash: "organization" };
751
685
  case "portal-item":
752
- return `${a}/item.html?id=${s.itemId}`;
686
+ return e ? { destinationType: t, itemId: e } : null;
753
687
  case "portal-group":
754
- return `${a}/group.html?id=${s.groupId}`;
688
+ return a ? { destinationType: t, groupId: a } : null;
689
+ case "none":
690
+ return null;
755
691
  default:
756
- return P(e);
757
- }
758
- };
759
- class ne extends tt {
760
- constructor() {
761
- super(...arguments), this.t9n = rt({ blocking: !0 }), this.assistantEl = M(), this.formEl = M(), this.voiceInputEl = M(), this.inputEl = M(), this.navigationSlotElements = /* @__PURE__ */ new Map(), this.handleSlottableRequest = (t) => {
762
- const e = t.detail, a = e.data?.block;
763
- if (!a)
764
- return;
765
- const r = this.getNavigationAction(a);
766
- r && this.upsertNavigationSlotElement(e.slotName, r);
767
- }, this.inputText = "", this.showVoiceInput = !0, this.isListening = !1, this.isVoiceInputDisabled = !1, this.interrupt = null, this.autoDestroyDisabled = !1, this.defaultClosed = !1, this.arcgisPortalNavigationRequest = et();
692
+ return z(t);
768
693
  }
769
- static {
770
- this.properties = { inputText: 16, showVoiceInput: 16, isListening: 16, isVoiceInputDisabled: 16, interrupt: 16, autoDestroyDisabled: 5, portal: 0, user: 0, config: 0, defaultClosed: 5 };
694
+ }
695
+ const bt = h.Root({
696
+ ...N()
697
+ }), Oe = () => new C(bt).addNode("answerDocQuestion", Ee).addNode("extractNavigationIntent", Ue).addEdge(A, "answerDocQuestion").addEdge("answerDocQuestion", "extractNavigationIntent").addEdge("extractNavigationIntent", w), Ke = String.raw`- **portal-doc-assistant** - General ArcGIS documentation and Portal help assistant:
698
+ - answers general ArcGIS, Portal, Enterprise, and JavaScript SDK questions
699
+ - acts as a fallback when specialized agents are not applicable
700
+ `, Ve = {
701
+ id: "portal-doc-assistant",
702
+ name: "Portal Doc Assistant",
703
+ description: Ke,
704
+ createGraph: Oe,
705
+ workspace: bt
706
+ }, je = () => ({ latestGroupId: null, memory: {} }), $ = (t) => {
707
+ const e = t?.agentExecutionContext.sharedState.portalGroupSummaryMemory?.value;
708
+ return e ? { latestGroupId: e.latestGroupId, memory: e.memory } : je();
709
+ }, It = `
710
+ Shared markdown formatting rules:
711
+ - Use clear markdown headings (##) to separate sections.
712
+ - Use concise bullet points for lists of facts, counts, or signals.
713
+ - Emphasize key metrics with bold labels (for example: **Recent items:** 4).
714
+ - Keep wording direct and analytical; avoid filler language but make sure the language is friendly.
715
+ - Do not include raw internal IDs unless explicitly requested.
716
+ `, Le = `
717
+ You answer follow-up questions about ArcGIS group analytics.
718
+
719
+ ${It}
720
+
721
+ Ground your answer in the provided group analytics summary and context.
722
+ If the answer is not available from the provided context, state that clearly and suggest what to check next.
723
+
724
+ Response rules:
725
+ - Reply in concise markdown with this section structure:
726
+ 1) ## Answer
727
+ 2) ## Evidence
728
+ 3) ## Gaps (only when data is missing)
729
+ - Keep the answer focused on the follow-up question.
730
+ - Do not include internal identifiers.
731
+ - Mark isRelevant=false when the question is not about this group or cannot be grounded in this group context.
732
+
733
+ Group analytics summary:
734
+ {summary}
735
+
736
+ Group full context:
737
+ {fullContext}
738
+
739
+ Question:
740
+ {question}
741
+ `, Be = async (t, e) => {
742
+ await g({ text: "Answering group follow-up...", agentName: "group-analytics" }, e);
743
+ const a = $(t), n = t.groupSummaryGroupId ?? a.latestGroupId, o = n ? a.memory[n] : void 0, s = t.groupSummaryQuestion || v(t.agentExecutionContext.messages);
744
+ return o ? {
745
+ status: "success",
746
+ outputMessage: (await b({
747
+ promptText: Le,
748
+ schema: Qe,
749
+ modelTier: "default",
750
+ inputVariables: {
751
+ summary: o.summary,
752
+ question: s,
753
+ fullContext: JSON.stringify(o.fullContext)
754
+ }
755
+ })).answer
756
+ } : {
757
+ status: "success",
758
+ outputMessage: "I do not have group analytics context yet. Ask me to analyze a group first with analyze group <group id>."
759
+ };
760
+ }, Qe = r.object({
761
+ answer: r.string(),
762
+ isRelevant: r.boolean()
763
+ }), We = `
764
+ Classify the user's request for ArcGIS Portal group analytics.
765
+
766
+ Rules:
767
+ - intent="summarize" only when the user explicitly asks to summarize, analyze, overview, or recap a group.
768
+ - intent="followUp" for follow-up questions about a previously analyzed group.
769
+ - intent="navigation" when the user asks to open, go to, navigate to, or view the group page.
770
+ - intent="clarify" when intent or required group target is missing.
771
+ - groupId must be the final resolved group id.
772
+ - If request has explicit group id, set groupId directly.
773
+ - If request references group title (for example $title, $"title with spaces", or plain quoted group title), call resolvePortalGroupIdByTitle and set groupId to the tool result.
774
+ - Never return group titles in output fields.
775
+ - If intent is "followUp", set question to the user's full question/request text.
776
+ - If intent is "navigation", set question="".
777
+ - If intent is "summarize", set question="".
778
+ - If intent is "navigation" and no group is specified, leave groupId empty so the system can navigate to the groups listing page.
779
+ - If hasAnalyticsContext is true and the user asks about the same group context without an explicit summarize/analyze command, prefer "followUp".
780
+
781
+ Examples:
782
+ - "Analyze group 0123456789abcdef0123456789abcdef" => summarize, groupId="0123456789abcdef0123456789abcdef"
783
+ - "Analyze group $living atlas" => summarize, call resolvePortalGroupIdByTitle("living atlas") and set groupId to tool result
784
+ - "Analyze group $"living atlas basemaps"" => summarize, call resolvePortalGroupIdByTitle("living atlas basemaps") and set groupId to tool result
785
+ - "Is this group active?" with hasAnalyticsContext=true => followUp
786
+
787
+ hasAnalyticsContext:
788
+ {hasAnalyticsContext}
789
+
790
+ User message:
791
+ {userMessage}
792
+ `, Je = async (t, e) => {
793
+ await g({ text: "Analyzing group-analytics intent...", agentName: "group-analytics" }, e);
794
+ const a = v(t.agentExecutionContext.messages), n = !!$(t).latestGroupId, o = await B.fromTemplate(We).format({
795
+ userMessage: a,
796
+ hasAnalyticsContext: String(n)
797
+ }), i = (await L({ modelTier: "fast" })).withStructuredOutput(tt), u = tt.parse(await i.invoke(o));
798
+ let c = u.groupId;
799
+ if ((u.intent === "summarize" || u.intent === "navigation") && !c) {
800
+ const y = G(a, "$");
801
+ y && (c = await yt.invoke({ groupTitle: y }, e) ?? "");
802
+ }
803
+ const { intent: d, question: l } = u, m = d === "summarize" && !c, p = d === "followUp" && !(l ?? "").trim(), f = d === "clarify" || m || p;
804
+ return {
805
+ groupSummaryIntent: f ? "clarify" : d,
806
+ groupSummaryGroupId: c || null,
807
+ groupSummaryQuestion: l || "",
808
+ status: "success",
809
+ outputMessage: f ? "Please clarify with a group id or title" : ""
810
+ };
811
+ }, tt = r.object({
812
+ intent: r.enum(["summarize", "followUp", "navigation", "clarify"]),
813
+ groupId: r.string().default(""),
814
+ question: r.string().default("")
815
+ }), _e = async (t, e) => {
816
+ const a = $(t), n = t.groupSummaryGroupId ?? a.latestGroupId;
817
+ return await g({ text: "Preparing navigation...", agentName: "group-analytics" }, e), await E(
818
+ n ? { destinationType: "portal-group", groupId: n } : { destinationType: "portal-groups" },
819
+ e
820
+ ), { status: "success" };
821
+ };
822
+ function xt({ timestamp: t, now: e, windowMs: a }) {
823
+ return t ? e - t <= a : !1;
824
+ }
825
+ const Ye = 720 * 60 * 60 * 1e3;
826
+ function He(t) {
827
+ const e = Jt(t);
828
+ return {
829
+ id: t.id ?? "",
830
+ title: t.title ?? "",
831
+ description: t.description ?? "",
832
+ snippet: t.snippet ?? "",
833
+ access: t.access ?? null,
834
+ owner: t.owner ?? "",
835
+ tags: t.tags ?? [],
836
+ created: t.created?.getTime(),
837
+ modified: t.modified?.getTime(),
838
+ isInvitationOnly: t.isInvitationOnly,
839
+ sourceSignals: {
840
+ capabilities: Xt(t),
841
+ membershipAccess: Ht(t),
842
+ isOpenData: Yt(t),
843
+ isDistributedCollaborationGroup: _t(t),
844
+ orgId: e.orgId,
845
+ hiddenMembers: e.hiddenMembers,
846
+ isViewOnly: e.isViewOnly,
847
+ isReadOnly: e.isReadOnly,
848
+ leavingDisallowed: e.leavingDisallowed
849
+ }
850
+ };
851
+ }
852
+ async function Xe(t) {
853
+ const e = { owner: t.owner ?? "", admins: [], users: [] };
854
+ try {
855
+ return await t.fetchMembers();
856
+ } catch (a) {
857
+ return console.warn("Unable to fetch group members for analytics context", a), e;
858
+ }
859
+ }
860
+ function Ze(t) {
861
+ return t.map((e) => ({
862
+ id: e.id ?? "",
863
+ title: e.title ?? "Untitled",
864
+ type: e.type ?? "Unknown",
865
+ owner: e.owner ?? "",
866
+ created: e.created?.getTime(),
867
+ modified: e.modified?.getTime()
868
+ }));
869
+ }
870
+ function ta(t, e) {
871
+ return t.filter(
872
+ (a) => a.modified ? xt({ timestamp: a.modified, now: e, windowMs: Ye }) : !1
873
+ );
874
+ }
875
+ function ea(t) {
876
+ const e = /* @__PURE__ */ new Map();
877
+ for (const a of t)
878
+ e.set(a.type, (e.get(a.type) ?? 0) + 1);
879
+ return [...e.entries()].sort((a, n) => n[1] - a[1] || a[0].localeCompare(n[0])).slice(0, 6).map(([a, n]) => ({ type: a, count: n }));
880
+ }
881
+ async function aa(t) {
882
+ const e = await t.queryItems({ num: 20, sortField: "modified", sortOrder: "desc" }), a = Ze(e.results), n = Date.now();
883
+ return {
884
+ total: e.total,
885
+ topItems: a,
886
+ recentlyModifiedItems: ta(a, n),
887
+ topItemTypes: ea(a)
888
+ };
889
+ }
890
+ async function na(t, e) {
891
+ if (!e)
892
+ return { error: { code: "missingGroupId", message: "Group id is required." } };
893
+ try {
894
+ const n = (await t.queryGroups({ query: `id:${e}`, num: 1 })).results[0];
895
+ if (!n)
896
+ return { error: { code: "groupNotFound", message: `No group found for id: ${e}` } };
897
+ const o = He(n), s = await Xe(n), i = await aa(n);
898
+ return { result: { group: o, members: s, items: i } };
899
+ } catch (a) {
900
+ return console.error("Error fetching portal group analytics context:", a), { error: { code: "unhandledError" } };
901
+ }
902
+ }
903
+ const oa = `
904
+ You summarize ArcGIS Portal groups based on structured context and deterministic activity signals.
905
+
906
+ ${It}
907
+
908
+ Output format requirements:
909
+ - Return concise markdown with clear sections in this order:
910
+ 1) Overview
911
+ 2) Activity
912
+ 3) Members
913
+ 4) Content Theme
914
+ 5) Contribution Model
915
+ 6) Unknowns / Data Gaps
916
+ - Keep total response about 180-280 words unless the user asked for extra detail.
917
+ - Avoid internal-only implementation details and do not expose raw IDs unless user explicitly asks.
918
+
919
+ Reasoning rules:
920
+ - Use deterministicSignals as the source of truth for active/recent status.
921
+ - If group description/snippet are empty, infer purpose from tags, item title patterns, and item type distribution.
922
+ - For members, report owner/admin/user counts when available; if unavailable due to permission scope, explicitly say so.
923
+ - For contribution model, use membershipAccess, capabilities, and sourceJSON flags to characterize collaboration vs distribution behavior.
924
+ - Be explicit when signals are heuristic or unavailable.
925
+
926
+ Follow-up prompt rules:
927
+ - Generate exactly 3 follow-up prompts.
928
+ - Write them as direct first-person user chat prompts that can be clicked and sent as-is.
929
+ - Do not write meta-questions such as "Would you like..." or "Do you want me to...".
930
+ - Keep each prompt short, specific, and actionable.
931
+ - Every prompt must be answerable using only the provided group context and deterministic signals.
932
+ - Do not require external data, navigation, or additional fetches.
933
+ - Tailor each prompt to this specific group's available signals (content mix, activity, members, and contribution model).
934
+ - Avoid repeating phrasing from prior prompts or using generic template wording.
935
+ - If a signal is unavailable (for example members), do not ask follow-ups that depend on that missing signal.
936
+
937
+ Group context:
938
+ {context}
939
+
940
+ Deterministic signals:
941
+ {deterministicSignals}
942
+ `, sa = 2160 * 60 * 60 * 1e3, ra = async (t, e) => {
943
+ const a = t.groupSummaryGroupId;
944
+ if (!a)
945
+ return {
946
+ status: "success",
947
+ outputMessage: 'Please clarify with analyze group <group id>, analyze group $<title>, or analyze group $"<title with spaces>".'
948
+ };
949
+ await g({ text: `Analyzing group ${a}...`, agentName: "group-analytics" }, e);
950
+ const n = e?.configurable?.context;
951
+ x(n);
952
+ const { result: o, error: s } = await na(n.portal, a);
953
+ if (s || !o)
954
+ return await g({ text: "Failed to fetch group context", agentName: "group-analytics" }, e), {
955
+ status: "success",
956
+ outputMessage: "Unable to retrieve group context for analytics."
957
+ };
958
+ const { group: i, items: u } = o, c = Date.now(), d = i.modified, l = d ? xt({ timestamp: d, now: c, windowMs: sa }) : !1, m = u.recentlyModifiedItems.length, p = m > 0, f = l || p, y = await b({
959
+ promptText: oa,
960
+ schema: ia,
961
+ modelTier: "default",
962
+ inputVariables: {
963
+ context: JSON.stringify(o),
964
+ deterministicSignals: JSON.stringify({
965
+ isGroupActive: f,
966
+ isGroupRecentlyModified: l,
967
+ hasRecentlyAddedOrUpdatedContent: p,
968
+ recentItemCount: m
969
+ })
970
+ }
971
+ }), { followUpQuestions: I, summary: S } = y, kt = $(t), qt = {
972
+ latestGroupId: a,
973
+ memory: {
974
+ ...kt.memory,
975
+ [a]: { summary: S, followUpQuestions: I, fullContext: o }
976
+ }
977
+ };
978
+ return I.length && await j({ type: "suggested-prompts", data: { prompts: I } }, e), {
979
+ status: "success",
980
+ outputMessage: S,
981
+ sharedStatePatch: { portalGroupSummaryMemory: { value: qt } }
982
+ };
983
+ }, ia = r.object({
984
+ summary: r.string(),
985
+ followUpQuestions: r.array(r.string()).default([])
986
+ }), R = (t, e) => e ?? t, St = h.Root({
987
+ ...N(),
988
+ groupSummaryIntent: h({
989
+ reducer: R,
990
+ default: () => "clarify"
991
+ }),
992
+ groupSummaryGroupId: h({
993
+ reducer: R,
994
+ default: () => null
995
+ }),
996
+ groupSummaryQuestion: h({
997
+ reducer: R,
998
+ default: () => ""
999
+ })
1000
+ }), ua = () => new C(St).addNode("detectGroupSummaryIntent", Je).addNode("summarizePortalGroup", ra).addNode("answerGroupSummaryFollowUp", Be).addNode("suggestGroupSummaryNavigation", _e).addEdge(A, "detectGroupSummaryIntent").addConditionalEdges("detectGroupSummaryIntent", (e) => e.groupSummaryIntent === "summarize" ? "summarizePortalGroup" : e.groupSummaryIntent === "followUp" ? "answerGroupSummaryFollowUp" : e.groupSummaryIntent === "navigation" ? "suggestGroupSummaryNavigation" : w).addEdge("summarizePortalGroup", w).addEdge("answerGroupSummaryFollowUp", w).addEdge("suggestGroupSummaryNavigation", w), ca = String.raw`- **portal-group-analytics** - Portal group analytics assistant:
1001
+ - summarizes ArcGIS portal groups from group context and sourceJSON details
1002
+ - answers follow-up questions grounded in the summarized group
1003
+ - suggests navigation to groups when relevant
1004
+ `, la = {
1005
+ id: "portal-group-analytics",
1006
+ name: "Portal Group Analytics",
1007
+ description: ca,
1008
+ createGraph: ua,
1009
+ workspace: St
1010
+ }, da = () => ({ latestItemId: null, memory: {} }), Q = (t) => {
1011
+ const e = t?.agentExecutionContext.sharedState.portalItemAnalyticsSummaryMemory?.value;
1012
+ return e ? { latestItemId: e.latestItemId, memory: e.memory } : da();
1013
+ }, et = r.object({
1014
+ intent: r.enum(["summarize", "followUp", "clarify"]),
1015
+ itemId: r.string().default(""),
1016
+ question: r.string().default("")
1017
+ }), pa = r.object({ summary: r.string(), followUpQuestions: r.array(r.string()).default([]) }), ma = r.object({ answer: r.string(), isRelevant: r.boolean() }), ga = `
1018
+ You answer follow-up questions about an ArcGIS item.
1019
+
1020
+ Ground your answer in the provided item context.
1021
+ If the answer is not available from the provided context, state that clearly and suggest what to check next.
1022
+
1023
+ Response rules:
1024
+ - Reply in concise markdown.
1025
+ - Keep the answer focused on the follow-up question.
1026
+ - Do not include internal identifiers.
1027
+ - Mark isRelevant=false when the question is not about this item or cannot be grounded in this item context.
1028
+
1029
+ Item summary:
1030
+ {summary}
1031
+
1032
+ Item full context
1033
+ {fullContext}
1034
+
1035
+ Question:
1036
+ {question}
1037
+ `, ha = async (t, e) => {
1038
+ await g({ text: "Answering follow-up...", agentName: "analytics" }, e);
1039
+ const a = Q(t), n = t.analyticsItemId ?? a.latestItemId, o = n ? a.memory[n] : void 0, s = t.analyticsQuestion || v(t.agentExecutionContext.messages);
1040
+ return o ? {
1041
+ status: "success",
1042
+ outputMessage: (await b({
1043
+ promptText: ga,
1044
+ schema: ma,
1045
+ modelTier: "default",
1046
+ inputVariables: {
1047
+ summary: o.summary,
1048
+ question: s,
1049
+ fullContext: JSON.stringify(o.fullContext)
1050
+ }
1051
+ })).answer
1052
+ } : {
1053
+ status: "success",
1054
+ outputMessage: "I don't have enough information yet. Please ask me to summarize the item first using summarize item <item id>."
1055
+ };
1056
+ }, fa = `
1057
+ Classify the user analytics request.
1058
+
1059
+ Rules:
1060
+ - intent="summarize" only when the user explicitly asks to summarize/overview/recap an item.
1061
+ - intent="followUp" for analytical questions about item details, including schema/fields/attributes/layers.
1062
+ - intent="clarify" when neither summarize nor follow-up intent is clear.
1063
+ - itemId must be the final resolved item id.
1064
+ - If request has explicit item id, set itemId directly.
1065
+ - If request references item title (for example #title, #"title with spaces", or plain quoted title), call resolvePortalItemIdByTitle and set itemId to the returned value.
1066
+ - Never return item titles in output fields.
1067
+ - If intent is "followUp", set question to the user's full question/request text.
1068
+ - If intent is "summarize", set question="".
1069
+ - When user asks to show/list/explain fields, schema, attributes, columns, or layer details, classify as "followUp" unless they explicitly request a summary.
1070
+ - If hasSummaryContext is true, prefer "followUp" for detail-oriented requests that do not explicitly ask to summarize.
1071
+
1072
+ Examples:
1073
+ - "Summarize item 0123456789abcdef0123456789abcdef" => summarize, itemId="0123456789abcdef0123456789abcdef"
1074
+ - "Summarize item #california" => summarize, call resolvePortalItemIdByTitle("california") and set itemId to tool result
1075
+ - "Summarize item #"california farmland"" => summarize, call resolvePortalItemIdByTitle("california farmland") and set itemId to tool result
1076
+ - "Show the layer's available fields" => followUp
1077
+ - "List attributes and explain what status means" => followUp
1078
+ - "What fields are available?" with hasSummaryContext=true => followUp
1079
+ - "Give me an overview of item 0123456789abcdef0123456789abcdef" => summarize
1080
+
1081
+ hasSummaryContext:
1082
+ {hasSummaryContext}
1083
+
1084
+ User message:
1085
+ {userMessage}
1086
+ `, ya = async (t, e) => {
1087
+ await g({ text: "Analyzing intent...", agentName: "analytics" }, e);
1088
+ const a = v(t.agentExecutionContext.messages), n = !!Q(t).latestItemId, o = await B.fromTemplate(fa).format({
1089
+ userMessage: a,
1090
+ hasSummaryContext: String(n)
1091
+ }), i = (await L({ modelTier: "fast" })).withStructuredOutput(et), u = et.parse(await i.invoke(o));
1092
+ let c = u.itemId;
1093
+ if (u.intent === "summarize" && !c) {
1094
+ const y = G(a, "#");
1095
+ y && (c = await wt.invoke({ itemTitle: y }, e) ?? "");
1096
+ }
1097
+ const { intent: d, question: l } = u, f = d === "clarify" || d === "summarize" && !c || d === "followUp" && !l;
1098
+ return {
1099
+ agentExecutionContext: { ...t.agentExecutionContext },
1100
+ analyticsIntent: f ? "clarify" : d,
1101
+ analyticsItemId: c || null,
1102
+ analyticsQuestion: l || "",
1103
+ status: "success",
1104
+ outputMessage: f ? 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".' : ""
1105
+ };
1106
+ }, wa = `
1107
+ You are a item summary tool for ArcGIS. Your job is to summarize an item's info based on the provided context.
1108
+ Summary rules:
1109
+ - The summary should be concise markdown, make sure to format the output nicely so it's easy to read.
1110
+ - Target length: 80-150 words.
1111
+ - Provide one short descriptive paragraph.
1112
+ - Also propose 3 concise follow-up questions grounded in the item summary.
1113
+ - Keep follow-up questions specific and actionable.
1114
+ Follow-up questions rules:
1115
+ - These questions should be in the format of a prompt that the user can click on.
1116
+ - Make sure the questions are relevant to the item summary and that you can answer based solely on the provided context.
1117
+ Do not include internal identifiers.
1118
+ If the user asks for a detailed summary, you may expand the response up to 300 words.
1119
+ Item context:
1120
+ {context}
1121
+ `, va = async (t, e) => {
1122
+ const a = t.analyticsItemId;
1123
+ if (!a)
1124
+ return {
1125
+ status: "success",
1126
+ outputMessage: 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".'
1127
+ };
1128
+ await g({ text: `Summarizing item ${a}...`, agentName: "analytics" }, e);
1129
+ const n = e?.configurable?.context;
1130
+ x(n);
1131
+ const { portal: o, user: s } = n, { result: i, error: u } = await Wt(s, o, a);
1132
+ if (u || !i)
1133
+ return await g({ text: "Failed to get item context for summarization", agentName: "analytics" }, e), {
1134
+ status: "success",
1135
+ outputMessage: "Unable to retrieve item context for summarization."
1136
+ };
1137
+ const { context: c } = i, d = await b({
1138
+ promptText: wa,
1139
+ schema: pa,
1140
+ modelTier: "default",
1141
+ inputVariables: { context: JSON.stringify(c) }
1142
+ }), { followUpQuestions: l, summary: m } = d, p = Q(t), f = {
1143
+ latestItemId: a,
1144
+ memory: {
1145
+ ...p.memory,
1146
+ [a]: { summary: m, followUpQuestions: l, fullContext: c }
1147
+ }
1148
+ };
1149
+ return l.length && await j({ type: "suggested-prompts", data: { prompts: l } }, e), {
1150
+ status: "success",
1151
+ outputMessage: m,
1152
+ sharedStatePatch: { portalItemAnalyticsSummaryMemory: { value: f } }
1153
+ };
1154
+ }, D = (t, e) => e ?? t, Mt = h.Root({
1155
+ ...N(),
1156
+ // States shared only across nodes in the graph, not between invocations
1157
+ analyticsIntent: h({
1158
+ reducer: D,
1159
+ default: () => "clarify"
1160
+ }),
1161
+ analyticsItemId: h({
1162
+ reducer: D,
1163
+ default: () => null
1164
+ }),
1165
+ analyticsQuestion: h({
1166
+ reducer: D,
1167
+ default: () => ""
1168
+ })
1169
+ }), ba = () => new C(Mt).addNode("detectAnalyticsIntent", ya).addNode("summarizePortalItem", va).addNode("answerAnalyticsFollowUp", ha).addEdge(A, "detectAnalyticsIntent").addConditionalEdges("detectAnalyticsIntent", (e) => e.analyticsIntent === "summarize" ? "summarizePortalItem" : e.analyticsIntent === "followUp" ? "answerAnalyticsFollowUp" : w).addEdge("summarizePortalItem", w).addEdge("answerAnalyticsFollowUp", w), Ia = String.raw`- **portal-item-analytics** - Portal item analytics assistant:
1170
+ - answers questions about one specific ArcGIS portal item when item context is present
1171
+ - summarizes item details, metadata, and context grounded in that item
1172
+ - suggests follow-up prompts grounded in the same item
1173
+ - use for item-specific requests, not for gallery browsing, featured content, or opening Map Viewer
1174
+ `, xa = {
1175
+ id: "portal-item-analytics",
1176
+ name: "Portal Item Analytics",
1177
+ description: Ia,
1178
+ createGraph: ba,
1179
+ workspace: Mt
1180
+ }, Sa = {
1181
+ schemaVersion: "1.0",
1182
+ capabilities: [
1183
+ {
1184
+ id: "my-content",
1185
+ title: "My content",
1186
+ description: "Browse, discover, search, and filter ArcGIS content—including maps, apps, datasets, and other items—that you own or can access.",
1187
+ hints: ["view my content", "show my content", "my content"],
1188
+ platforms: ["online", "enterprise"],
1189
+ resolutions: {
1190
+ navigate: {
1191
+ routeKey: "content"
1192
+ }
1193
+ }
1194
+ },
1195
+ {
1196
+ id: "create-feature-layer",
1197
+ title: "Create feature layer",
1198
+ description: "Generate an editable feature layer by copying fields from templates or existing layers.",
1199
+ hints: ["add a feature layer", "make a feature layer", "generate a feature layer"],
1200
+ platforms: ["online", "enterprise"],
1201
+ resolutions: {
1202
+ navigate: {
1203
+ routeKey: "content"
1204
+ }
1205
+ }
1206
+ },
1207
+ {
1208
+ id: "create-folder",
1209
+ title: "Create folder",
1210
+ description: "Create a new folder in your ArcGIS content to organize your items.",
1211
+ hints: ["create a folder", "make a folder", "set up a folder", "new folder"],
1212
+ platforms: ["online", "enterprise"],
1213
+ resolutions: {
1214
+ navigate: {
1215
+ routeKey: "content"
1216
+ }
1217
+ }
1218
+ }
1219
+ ]
1220
+ }, Ma = {
1221
+ schemaVersion: "1.0",
1222
+ capabilities: [
1223
+ {
1224
+ id: "my groups",
1225
+ title: "My groups",
1226
+ description: "Browse, discover, search, and filter ArcGIS content collections—including maps, apps, datasets, and other items—that you own, belong to, or can access.",
1227
+ hints: ["view my groups", "show my groups", "my groups"],
1228
+ platforms: ["online", "enterprise"],
1229
+ resolutions: {
1230
+ navigate: {
1231
+ routeKey: "groups"
1232
+ }
1233
+ }
1234
+ },
1235
+ {
1236
+ id: "create-group",
1237
+ title: "Create group",
1238
+ description: "Create a new ArcGIS Portal group owned by the signed-in user.",
1239
+ hints: ["create a group", "make a group", "set up a group", "new group"],
1240
+ platforms: ["online", "enterprise"],
1241
+ resolutions: {
1242
+ navigate: {
1243
+ routeKey: "groups"
1244
+ }
1245
+ }
1246
+ },
1247
+ {
1248
+ id: "featured-groups",
1249
+ title: "Featured groups",
1250
+ description: "Browse, discover, search, and filter ArcGIS content collections—including maps, apps, datasets, and other items—that organization administrators choose to highlight in ArcGIS.",
1251
+ hints: ["view featured groups", "show featured groups", "highlighted groups", "top groups"],
1252
+ platforms: ["online", "enterprise"],
1253
+ resolutions: {
1254
+ navigate: {
1255
+ routeKey: "groups",
1256
+ hash: "featured"
1257
+ }
1258
+ }
1259
+ },
1260
+ {
1261
+ id: "organization-groups",
1262
+ title: "Organization groups",
1263
+ description: "Browse, discover, search, and filter ArcGIS content collections—including maps, apps, datasets, and other items—that are specific to your organization in ArcGIS.",
1264
+ hints: ["view organization groups", "show organization groups"],
1265
+ platforms: ["online", "enterprise"],
1266
+ resolutions: {
1267
+ navigate: {
1268
+ routeKey: "groups",
1269
+ hash: "organization"
1270
+ }
1271
+ }
1272
+ }
1273
+ ]
1274
+ }, Ta = {
1275
+ schemaVersion: "1.0",
1276
+ capabilities: [
1277
+ {
1278
+ id: "org-config-mfa",
1279
+ title: "Multifactor Authentication (MFA)",
1280
+ description: "Configure organization-level multifactor authentication (MFA) settings. Administrators can enable MFA for ArcGIS logins, allow recovery codes for members, view MFA adoption status, enforce MFA requirements for all members, manage the MFA exemption list, and designate administrators who can troubleshoot MFA issues.",
1281
+ hints: ["config MFA", "set up MFA"],
1282
+ platforms: ["online", "enterprise"],
1283
+ resolutions: {
1284
+ navigate: {
1285
+ routeKey: "organization",
1286
+ queryParams: {
1287
+ tab: "security"
1288
+ },
1289
+ hash: "settings"
1290
+ }
1291
+ }
1292
+ }
1293
+ ]
1294
+ }, Ga = {
1295
+ "contentRouteRegistry.ts": Sa,
1296
+ "groupsRouteRegistry.ts": Ma,
1297
+ "orgSettingsRouteRegistry.ts": Ta
1298
+ };
1299
+ function Ca(t) {
1300
+ const e = [], a = /* @__PURE__ */ new Set();
1301
+ for (const [n, o] of Object.entries(t))
1302
+ for (const s of o.capabilities) {
1303
+ if (a.has(s.id))
1304
+ throw new Error(`${n}: duplicate capability id "${s.id}" across registries`);
1305
+ a.add(s.id), e.push(s);
1306
+ }
1307
+ return e;
1308
+ }
1309
+ let at;
1310
+ function T() {
1311
+ return at ??= Ca(Ga), at;
1312
+ }
1313
+ const Aa = /^(?:take me to|navigate to|go to|show me|open)\s+(?:the\s+)?/u;
1314
+ function q(t) {
1315
+ return t.toLowerCase().replace(/[^a-z0-9]+/gu, " ").trim().replace(Aa, "").trim();
1316
+ }
1317
+ const Na = r.object({
1318
+ capabilityIds: r.array(r.string()).default([]),
1319
+ confidence: r.number().min(0).max(1).default(0),
1320
+ reason: r.string().default("")
1321
+ }), nt = 0.8, Pa = String.raw`You select Portal navigation capabilities for a user's request.
1322
+
1323
+ Select only capability IDs from the supplied candidates. Return an empty array when none fit.
1324
+ A named surface is required: do not select a capability on another Portal surface.
1325
+ Retrieval scores are hints only, not ground truth.
1326
+
1327
+ User request:
1328
+ {userRequest}
1329
+
1330
+ Candidates:
1331
+ {candidates}`, ka = async (t, e) => {
1332
+ if (t.outputMessage || t.targets.length === 0)
1333
+ return {};
1334
+ const a = v(t.agentExecutionContext.messages).trim(), n = qa(a, t);
1335
+ if (n.length === 1)
1336
+ return console.info("[arcgis-portal-ai-assistant] navigation capability selection:", {
1337
+ method: "exact-match",
1338
+ request: a,
1339
+ selectedCapabilityIds: n
1340
+ }), { chosenCapabilityIds: n };
1341
+ await g({ text: "Choosing a navigation destination...", agentName: "navigation" }, e);
1342
+ const o = JSON.stringify(
1343
+ t.targets.map(({ capability: s, keywordScore: i, semanticScore: u }) => ({
1344
+ id: s.id,
1345
+ title: s.title,
1346
+ description: s.description,
1347
+ route: s.resolutions.navigate,
1348
+ keywordScore: i,
1349
+ semanticScore: u
1350
+ }))
1351
+ );
1352
+ try {
1353
+ const s = await b({
1354
+ promptText: Pa,
1355
+ schema: Na,
1356
+ modelTier: "fast",
1357
+ inputVariables: { candidates: o, userRequest: a }
1358
+ }), i = new Set(t.targets.map(({ capability: c }) => c.id)), u = s.capabilityIds.filter((c) => i.has(c));
1359
+ return console.info("[arcgis-portal-ai-assistant] navigation capability selection:", {
1360
+ confidence: s.confidence,
1361
+ method: "structured-model",
1362
+ reason: s.reason,
1363
+ request: a,
1364
+ selectedCapabilityIds: u
1365
+ }), s.confidence < nt ? {
1366
+ chosenCapabilityIds: [],
1367
+ status: "failed",
1368
+ summary: `Navigation selection confidence ${s.confidence} is below the required ${nt}; defer to the Portal Doc Assistant.`
1369
+ } : { chosenCapabilityIds: u };
1370
+ } catch {
1371
+ return console.info("[arcgis-portal-ai-assistant] navigation capability selection:", {
1372
+ method: "structured-model-unavailable",
1373
+ request: a,
1374
+ selectedCapabilityIds: []
1375
+ }), { chosenCapabilityIds: [] };
1376
+ }
1377
+ };
1378
+ function qa(t, e) {
1379
+ const a = q(t);
1380
+ return e.targets.filter(
1381
+ ({ capability: n }) => [n.title, ...n.hints].some(
1382
+ (o) => q(o) === a
1383
+ )
1384
+ ).map(({ capability: n }) => n.id);
1385
+ }
1386
+ function za(t) {
1387
+ return T().flatMap((e) => {
1388
+ const a = $a(e);
1389
+ return a && Ra(a, t) ? [{ capability: e, target: a }] : [];
1390
+ });
1391
+ }
1392
+ function Ea(t, e) {
1393
+ return za(e).find(({ capability: a }) => a.id === t);
1394
+ }
1395
+ function $a(t) {
1396
+ const { hash: e, queryParams: a, routeKey: n } = t.resolutions.navigate;
1397
+ switch (n) {
1398
+ case "content":
1399
+ switch (t.id) {
1400
+ case "my-content":
1401
+ return { destinationType: "portal-content", t9nKey: "myContent" };
1402
+ case "create-feature-layer":
1403
+ return { destinationType: "portal-content", t9nKey: "createFeatureLayer" };
1404
+ case "create-folder":
1405
+ return { destinationType: "portal-content", t9nKey: "createFolder" };
1406
+ default:
1407
+ return { destinationType: "portal-content" };
1408
+ }
1409
+ case "groups":
1410
+ if (e === "featured")
1411
+ return { destinationType: "portal-groups", hash: "featured", t9nKey: "featuredGroups" };
1412
+ if (e === "organization")
1413
+ return { destinationType: "portal-groups", hash: "organization", t9nKey: "organizationGroups" };
1414
+ switch (t.id) {
1415
+ case "my groups":
1416
+ return { destinationType: "portal-groups", hash: "my", t9nKey: "myGroups" };
1417
+ case "create-group":
1418
+ return { destinationType: "portal-groups", t9nKey: "createGroup" };
1419
+ default:
1420
+ return { destinationType: "portal-groups" };
1421
+ }
1422
+ case "organization":
1423
+ return a?.tab !== "security" ? void 0 : t.id === "org-config-mfa" ? { destinationType: "portal-org", hash: "settings", t9nKey: "configureMultifactorAuthentication" } : { destinationType: "portal-org", hash: "settings" };
1424
+ default:
1425
+ return;
1426
+ }
1427
+ }
1428
+ function Ra(t, e) {
1429
+ return !e || !!e[t.destinationType];
1430
+ }
1431
+ const Da = async (t, e) => {
1432
+ if (t.outputMessage || t.status === "failed")
1433
+ return {};
1434
+ const a = t.targets.find(({ capability: o }) => t.chosenCapabilityIds.includes(o.id)) ?? t.targets[0];
1435
+ if (!a)
1436
+ return {
1437
+ outputMessage: "I couldn't find a matching Portal page. Try asking to open your content, groups, or organization settings.",
1438
+ sharedStatePatch: { navLastAnsweredRequest: { value: U(t) } },
1439
+ status: "success",
1440
+ summary: "Navigation could not find a matching capability; route another agent if appropriate."
1441
+ };
1442
+ const n = Ea(a.capability.id);
1443
+ return n ? (await g({ text: "Preparing navigation...", agentName: "navigation" }, e), await E(n.target, e), {
1444
+ outputMessage: t.chosenCapabilityIds.length ? `Click the button below to open ${a.capability.title}.` : `The closest place to start is ${a.capability.title}. Click the button below to open it.`,
1445
+ status: "success",
1446
+ summary: `Navigation suggested ${a.capability.id}${t.retrievalDegraded ? " using keyword-only retrieval" : ""}.`,
1447
+ sharedStatePatch: { navLastAnsweredRequest: { value: U(t) } }
1448
+ }) : (console.warn(`Navigation capability ${a.capability.id} was not found in the resolver.`), {
1449
+ outputMessage: "I found a possible destination, but couldn't resolve a valid Portal navigation target. Try asking to open your content, groups, or organization settings.",
1450
+ status: "success",
1451
+ summary: `Navigation resolver could not map ${a.capability.id}.`,
1452
+ sharedStatePatch: { navLastAnsweredRequest: { value: U(t) } }
1453
+ });
1454
+ };
1455
+ function U(t) {
1456
+ return v(t.agentExecutionContext.messages) || t.agentExecutionContext.userRequest;
1457
+ }
1458
+ async function Tt(t) {
1459
+ return t.length === 0 ? [] : (await Zt.getDefault().load(), await Ft(t));
1460
+ }
1461
+ const Ua = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1462
+ __proto__: null,
1463
+ generateEmbeddings: Tt
1464
+ }, Symbol.toStringTag, { value: "Module" }));
1465
+ function Fa(t) {
1466
+ const e = [], a = `${t.title}. ${t.description}`;
1467
+ a.trim().length > 0 && e.push({ field: "summary", text: a });
1468
+ const n = t.hints;
1469
+ if (Array.isArray(n))
1470
+ for (const o of n)
1471
+ typeof o == "string" && o.trim().length > 0 && e.push({ field: "hint", text: o });
1472
+ return e;
1473
+ }
1474
+ let F, Gt;
1475
+ async function Oa(t = {}) {
1476
+ return F ??= Va(t.embed ?? ja).then((e) => (Gt = e, e)).catch((e) => {
1477
+ throw F = void 0, e;
1478
+ }), await F;
1479
+ }
1480
+ function Ka() {
1481
+ return Gt;
1482
+ }
1483
+ async function Va(t) {
1484
+ const e = La(), a = await t(e.map((n) => n.text));
1485
+ if (a.length !== e.length)
1486
+ throw new Error(`Expected ${e.length} vectors, got ${a.length}`);
1487
+ return e.map((n, o) => ({
1488
+ ...n,
1489
+ vector: a[o]
1490
+ }));
1491
+ }
1492
+ async function ja(t) {
1493
+ const { generateEmbeddings: e } = await Promise.resolve().then(() => Ua);
1494
+ return await e(t);
1495
+ }
1496
+ function La() {
1497
+ return T().flatMap(
1498
+ (t) => Fa(t).map(({ field: e, text: a }) => ({
1499
+ capabilityId: t.id,
1500
+ field: e,
1501
+ text: a
1502
+ }))
1503
+ );
1504
+ }
1505
+ const ot = 1.2, st = 0.75, Ba = 60, Qa = 0.65, O = {
1506
+ description: 1,
1507
+ hint: 2,
1508
+ title: 3
1509
+ };
1510
+ let rt;
1511
+ async function Wa(t, e = {}) {
1512
+ const a = Ha(Ct(t));
1513
+ let n = [], o = !1, s;
1514
+ if (t.trim()) {
1515
+ const i = e.loadEmbeddings, u = Ka();
1516
+ if (!i && !u)
1517
+ o = !0, s = "Capability embeddings are still loading.";
1518
+ else
1519
+ try {
1520
+ if (i) {
1521
+ const [c, d] = await Promise.all([
1522
+ (e.embedQuery ?? ut)(t),
1523
+ i()
1524
+ ]);
1525
+ n = it(c, d);
1526
+ } else if (u) {
1527
+ const c = await (e.embedQuery ?? ut)(t);
1528
+ n = it(c, u);
1529
+ }
1530
+ } catch {
1531
+ o = !0, s = "Semantic search is unavailable.";
1532
+ }
1533
+ }
1534
+ return {
1535
+ degraded: o,
1536
+ ...s ? { degradedReason: s } : {},
1537
+ // RRF combines ranks rather than raw scores because BM25 and cosine
1538
+ // similarity are on different scales.
1539
+ matches: Za(a, n, e.topN ?? 5)
1540
+ };
1541
+ }
1542
+ function Ja() {
1543
+ return rt ??= _a(T()), rt;
1544
+ }
1545
+ function _a(t) {
1546
+ const e = /* @__PURE__ */ new Map(), a = t.map((n) => {
1547
+ const o = /* @__PURE__ */ new Map();
1548
+ K(o, n.title, O.title), K(o, n.description, O.description);
1549
+ for (const s of n.hints)
1550
+ K(o, s, O.hint);
1551
+ for (const s of o.keys())
1552
+ e.set(s, (e.get(s) ?? 0) + 1);
1553
+ return {
1554
+ capability: n,
1555
+ length: Ya(o),
1556
+ termFrequencies: o
1557
+ };
1558
+ });
1559
+ return {
1560
+ averageDocumentLength: a.length ? a.reduce((n, o) => n + o.length, 0) / a.length : 0,
1561
+ documentFrequency: e,
1562
+ documents: a
1563
+ };
1564
+ }
1565
+ function K(t, e, a) {
1566
+ for (const n of Ct(e))
1567
+ t.set(n, (t.get(n) ?? 0) + a);
1568
+ }
1569
+ function Ya(t) {
1570
+ return [...t.values()].reduce((e, a) => e + a, 0);
1571
+ }
1572
+ function Ct(t) {
1573
+ return t.toLowerCase().split(/[^a-z0-9]+/u).filter(Boolean);
1574
+ }
1575
+ function Ha(t) {
1576
+ const e = Ja(), a = new Set(t), n = e.documents.length;
1577
+ return e.documents.map(({ capability: o, length: s, termFrequencies: i }) => {
1578
+ let u = 0;
1579
+ for (const c of a) {
1580
+ const d = i.get(c), l = e.documentFrequency.get(c);
1581
+ if (!d || !l)
1582
+ continue;
1583
+ const m = Math.log(1 + (n - l + 0.5) / (l + 0.5)), p = ot * (1 - st + st * (s / e.averageDocumentLength));
1584
+ u += m * (d * (ot + 1) / (d + p));
1585
+ }
1586
+ return { capability: o, score: u };
1587
+ }).filter(({ score: o }) => o > 0).sort(At);
1588
+ }
1589
+ function it(t, e) {
1590
+ const a = /* @__PURE__ */ new Map();
1591
+ for (const o of e) {
1592
+ const s = Xa(t, o.vector);
1593
+ if (s === void 0)
1594
+ continue;
1595
+ const i = a.get(o.capabilityId);
1596
+ (i === void 0 || s > i) && a.set(o.capabilityId, s);
1597
+ }
1598
+ const n = new Map(T().map((o) => [o.id, o]));
1599
+ return [...a.entries()].flatMap(([o, s]) => {
1600
+ const i = n.get(o);
1601
+ return i && s >= Qa ? [{ capability: i, score: s }] : [];
1602
+ }).sort(At);
1603
+ }
1604
+ function Xa(t, e) {
1605
+ if (t.length === 0 || t.length !== e.length)
1606
+ return;
1607
+ let a = 0, n = 0, o = 0;
1608
+ for (let i = 0; i < t.length; i += 1)
1609
+ a += t[i] * e[i], n += t[i] ** 2, o += e[i] ** 2;
1610
+ const s = Math.sqrt(n) * Math.sqrt(o);
1611
+ return s === 0 ? void 0 : a / s;
1612
+ }
1613
+ async function ut(t) {
1614
+ const [e] = await Tt([t]);
1615
+ if (!e)
1616
+ throw new Error("Expected one query embedding.");
1617
+ return e;
1618
+ }
1619
+ function Za(t, e, a) {
1620
+ const n = /* @__PURE__ */ new Map();
1621
+ return ct(n, t, "keyword"), ct(n, e, "semantic"), [...n.values()].sort((o, s) => s.score !== o.score ? s.score - o.score : (s.semanticScore ?? 0) !== (o.semanticScore ?? 0) ? (s.semanticScore ?? 0) - (o.semanticScore ?? 0) : (s.keywordScore ?? 0) !== (o.keywordScore ?? 0) ? (s.keywordScore ?? 0) - (o.keywordScore ?? 0) : o.capability.id.localeCompare(s.capability.id)).slice(0, Math.max(0, a));
1622
+ }
1623
+ function ct(t, e, a) {
1624
+ for (const [n, { capability: o, score: s }] of e.entries()) {
1625
+ const i = n + 1, u = t.get(o.id) ?? { capability: o, score: 0 };
1626
+ u.score += 1 / (Ba + i), a === "keyword" ? (u.keywordRank = i, u.keywordScore = s) : (u.semanticRank = i, u.semanticScore = s), t.set(o.id, u);
1627
+ }
1628
+ }
1629
+ function At(t, e) {
1630
+ return e.score - t.score || t.capability.id.localeCompare(e.capability.id);
1631
+ }
1632
+ const tn = async (t, e) => {
1633
+ await g({ text: "Finding a place to navigate...", agentName: "navigation" }, e);
1634
+ const a = v(t.agentExecutionContext.messages).trim();
1635
+ try {
1636
+ const n = await Wa(a, { topN: 5 });
1637
+ return console.table(
1638
+ n.matches.map(({ capability: o, keywordRank: s, keywordScore: i, semanticRank: u, semanticScore: c, score: d }) => ({
1639
+ capability: o.title,
1640
+ fusedScore: d,
1641
+ keywordRank: s,
1642
+ keywordScore: i,
1643
+ semanticRank: u,
1644
+ semanticScore: c
1645
+ }))
1646
+ ), n.degradedReason && console.info("[arcgis-portal-ai-assistant] navigation semantic search:", n.degradedReason), {
1647
+ chosenCapabilityIds: [],
1648
+ retrievalDegraded: n.degradedReason ?? "",
1649
+ targets: en(a, n.matches)
1650
+ };
1651
+ } catch {
1652
+ return {
1653
+ chosenCapabilityIds: [],
1654
+ outputMessage: "I couldn't look up a Portal page right now. Please try again.",
1655
+ status: "failed",
1656
+ targets: []
1657
+ };
1658
+ }
1659
+ };
1660
+ function en(t, e) {
1661
+ const a = q(t), n = e.filter(
1662
+ ({ capability: s }) => [s.title, ...s.hints].some(
1663
+ (i) => q(i) === a
1664
+ )
1665
+ );
1666
+ if (n.length !== 1)
1667
+ return e;
1668
+ const [o] = n;
1669
+ return [o, ...e.filter((s) => s !== o)];
1670
+ }
1671
+ const V = (t, e) => e ?? t, Nt = h.Root({
1672
+ ...N(),
1673
+ chosenCapabilityIds: h({ reducer: V, default: () => [] }),
1674
+ // Empty when hybrid keyword-and-semantic retrieval succeeds; otherwise
1675
+ // contains the semantic-search failure reason for response diagnostics.
1676
+ retrievalDegraded: h({ reducer: V, default: () => "" }),
1677
+ targets: h({ reducer: V, default: () => [] })
1678
+ }), an = () => new C(Nt).addNode("retrieveNavigationTargets", tn).addNode("chooseNavigationTargets", ka).addNode("respondWithNavigation", Da).addEdge(A, "retrieveNavigationTargets").addEdge("retrieveNavigationTargets", "chooseNavigationTargets").addEdge("chooseNavigationTargets", "respondWithNavigation").addEdge("respondWithNavigation", w), nn = T().map(({ hints: t, title: e }) => t[0] ?? e).join(", "), on = String.raw`- **portal-navigation** - Portal page navigation assistant:
1679
+ - routes requests to open, show, or navigate to a Portal page, including creation-flow pages
1680
+ - falls back to the closest Portal page where a workflow starts when another agent cannot perform the action
1681
+ - handles short navigation follow-ups after asking the user to open a page
1682
+ - capability examples: ${nn}
1683
+ - do not use for general "how do I" questions unless the user explicitly asks to reach a page
1684
+ `, sn = {
1685
+ id: "navigation",
1686
+ name: "Portal Navigation",
1687
+ description: on,
1688
+ createGraph: an,
1689
+ workspace: Nt
1690
+ }, rn = Rt`:host{height:100%;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);display:block;width:100%;--tw-shadow: 0 1px 6px -1px rgba(0, 0, 0, .16), 0 1px 2px -1px rgba(0, 0, 0, .08);--tw-shadow-colored: 0 1px 6px -1px var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.chat-entry{display:flex;flex-direction:column;gap:.75rem;width:100%}.chat-actions{display:flex;justify-content:flex-end;gap:.5rem}.header-actions{display:flex;gap:.5rem;padding-inline-start:.75rem}.navigation-block{display:flex;flex-direction:column;align-items:stretch;gap:.35rem;margin-top:.5rem}.navigation-button{width:100%;margin-block:.25rem}.navigation-block-description{font-size:.75rem;color:var(--calcite-color-text-3)}`;
1691
+ function un(t, e) {
1692
+ if (!e)
1693
+ return;
1694
+ const { destinationType: a } = t;
1695
+ switch (a) {
1696
+ case "portal-content":
1697
+ return e[a]?.(t.hash);
1698
+ case "portal-groups":
1699
+ return e[a]?.(t.hash);
1700
+ case "portal-org":
1701
+ return e[a]?.(t.hash);
1702
+ case "portal-gallery":
1703
+ return e[a];
1704
+ case "portal-map-viewer":
1705
+ case "portal-notebooks":
1706
+ case "portal-scene-viewer":
1707
+ return e[a];
1708
+ case "portal-item":
1709
+ return e[a]?.(t.itemId);
1710
+ case "portal-group":
1711
+ return e[a]?.(t.groupId);
1712
+ default:
1713
+ return z(a);
1714
+ }
1715
+ }
1716
+ function cn(t) {
1717
+ const e = Ie.safeParse(t);
1718
+ return e.success ? e.data : void 0;
1719
+ }
1720
+ const ln = { myContent: "My content", createFeatureLayer: "Create feature layer", createFolder: "Create folder", myGroups: "My groups", createGroup: "Create group", featuredGroups: "Featured groups", organizationGroups: "Organization groups", configureMultifactorAuthentication: "Configure multifactor authentication" }, Pt = {
1721
+ navigationTargets: ln
1722
+ };
1723
+ function dn(t, e) {
1724
+ const a = lt(t.t9nKey, e.navigationTargets) ?? lt(t.t9nKey, Pt.navigationTargets);
1725
+ if (a)
1726
+ return a;
1727
+ const n = e.navigation;
1728
+ switch (t.destinationType) {
1729
+ case "portal-content":
1730
+ switch (t.hash) {
1731
+ case "favorites":
1732
+ return n.openContentFavorites;
1733
+ case "group":
1734
+ return n.openContentGroup;
1735
+ case "living-atlas":
1736
+ return n.openContentLivingAtlas;
1737
+ case "org":
1738
+ return n.openContentOrganization;
1739
+ default:
1740
+ return n.openContent;
1741
+ }
1742
+ case "portal-gallery":
1743
+ return n.openGallery;
1744
+ case "portal-groups":
1745
+ switch (t.hash) {
1746
+ case "featured":
1747
+ return n.openGroupsFeatured;
1748
+ case "my":
1749
+ return n.openGroupsMy;
1750
+ case "organization":
1751
+ return n.openGroupsOrganization;
1752
+ default:
1753
+ return n.openGroups;
1754
+ }
1755
+ case "portal-map-viewer":
1756
+ return n.openMapViewer;
1757
+ case "portal-notebooks":
1758
+ return n.openNotebooks;
1759
+ case "portal-scene-viewer":
1760
+ return n.openSceneViewer;
1761
+ case "portal-org":
1762
+ return n.openOrgSettings;
1763
+ case "portal-item":
1764
+ return n.openItem;
1765
+ case "portal-group":
1766
+ return n.openGroup;
1767
+ default:
1768
+ return z(t);
1769
+ }
1770
+ }
1771
+ function lt(t, e) {
1772
+ if (!(!t || !e || !pn(t)))
1773
+ return e[t];
1774
+ }
1775
+ function pn(t) {
1776
+ return t in Pt.navigationTargets;
1777
+ }
1778
+ class mn extends Et {
1779
+ constructor() {
1780
+ super(), this.t9n = Ut({ blocking: !0 }), this.assistantEl = P(), this.formEl = P(), this.voiceInputEl = P(), this.inputEl = P(), this.navigationSlotElements = /* @__PURE__ */ new Map(), this.handleSlottableRequest = (e) => {
1781
+ const a = e.detail, n = a.data?.block;
1782
+ if (!n)
1783
+ return;
1784
+ const o = this.getNavigationAction(n);
1785
+ o && this.upsertNavigationSlotElement(a.slotName, o);
1786
+ }, this.inputText = "", this.showVoiceInput = !0, this.isListening = !1, this.isVoiceInputDisabled = !1, this.interrupt = null, this.autoDestroyDisabled = !1, this.navigationAgentEnabled = !0, this.defaultClosed = !1, this.arcgisPortalNavigationRequest = $t(), T();
1787
+ }
1788
+ static {
1789
+ this.properties = { inputText: 16, showVoiceInput: 16, isListening: 16, isVoiceInputDisabled: 16, interrupt: 16, autoDestroyDisabled: 5, portal: 0, user: 0, config: 0, navigationTargetMap: 0, navigationAgentEnabled: 5, defaultClosed: 5 };
771
1790
  }
772
1791
  static {
773
- this.styles = re;
1792
+ this.styles = rn;
774
1793
  }
775
- getNavigationAction(t) {
776
- if (t?.type !== _)
1794
+ async load() {
1795
+ try {
1796
+ await Oa();
1797
+ } catch (e) {
1798
+ console.warn("[arcgis-portal-ai-assistant] embeddings warm-up failed:", e);
1799
+ }
1800
+ }
1801
+ getNavigationAction(e) {
1802
+ if (e?.type !== gt)
777
1803
  return;
778
- const e = jt(t.data);
779
- if (!e)
1804
+ const a = cn(e.data);
1805
+ if (!a)
780
1806
  return;
781
- const a = oe(e, this.portal);
782
- if (a)
783
- return { href: a, targetDetail: e, label: this.getNavigationText(e.destinationType) };
1807
+ const n = un(a, this.navigationTargetMap);
1808
+ if (n)
1809
+ return { href: n, targetDetail: a, label: dn(a, this.t9n) };
784
1810
  }
785
- upsertNavigationSlotElement(t, e) {
786
- const a = this.assistantEl.value;
787
- if (!a)
1811
+ upsertNavigationSlotElement(e, a) {
1812
+ const n = this.assistantEl.value;
1813
+ if (!n)
788
1814
  return;
789
- let r = this.navigationSlotElements.get(t);
790
- r || (r = document.createElement("div"), r.slot = t, this.navigationSlotElements.set(t, r), a.append(r)), at(w`<div><calcite-button class="navigation-button" appearance=outline width=full .href=${e.href} icon-end=launch @click=${(l) => {
791
- l.preventDefault(), this.arcgisPortalNavigationRequest.emit({
792
- href: e.href,
793
- targetDetail: e.targetDetail
1815
+ const o = `navigation:${e}`;
1816
+ let s = this.navigationSlotElements.get(o);
1817
+ s || (s = document.createElement("div"), s.slot = e, this.navigationSlotElements.set(o, s), n.append(s)), Dt(M`<div><calcite-button class="navigation-button" appearance=outline width=full .href=${a.href} icon-end=launch @click=${(i) => {
1818
+ i.preventDefault(), this.arcgisPortalNavigationRequest.emit({
1819
+ href: a.href,
1820
+ targetDetail: a.targetDetail
794
1821
  });
795
- }}>${e.label}</calcite-button>${e.description ? w`<div class="navigation-block-description">${e.description}</div>` : null}</div>`, r);
796
- }
797
- getNavigationText(t) {
798
- const e = this.t9n.navigation;
799
- switch (t) {
800
- case "portal-content":
801
- return e.openContent;
802
- case "portal-groups":
803
- return e.openGroups;
804
- case "portal-item":
805
- return e.openItem;
806
- case "portal-group":
807
- return e.openGroup;
808
- default:
809
- return P(t);
810
- }
1822
+ }}>${a.label}</calcite-button>${a.description ? M`<div class="navigation-block-description">${a.description}</div>` : null}</div>`, s);
811
1823
  }
812
1824
  render() {
813
- const { t9n: t, inputText: e, portal: a, user: r, showVoiceInput: l, isListening: c, isVoiceInputDisabled: i } = this;
814
- return w`<arcgis-assistant log-enabled keep-suggested-prompts .heading=${t.heading} .entryMessage=${t.entryMessage} @arcgisSlottableRequest=${this.handleSlottableRequest} @arcgisInterrupt=${({ detail: o }) => {
815
- this.interrupt = o;
1825
+ const { t9n: e, inputText: a, portal: n, user: o, navigationTargetMap: s, navigationAgentEnabled: i, showVoiceInput: u, isListening: c, isVoiceInputDisabled: d } = this;
1826
+ return M`<arcgis-assistant log-enabled keep-suggested-prompts .heading=${e.heading} .entryMessage=${e.entryMessage} @arcgisSlottableRequest=${this.handleSlottableRequest} @arcgisInterrupt=${({ detail: l }) => {
1827
+ this.interrupt = l;
816
1828
  }} @arcgisInterruptCancel=${() => {
817
1829
  this.interrupt = null;
818
1830
  }} @arcgisInterruptSubmit=${() => {
819
1831
  this.interrupt = null;
820
- }} @arcgisPromptSelect=${({ detail: o }) => {
821
- this.inputText = o.prompt, requestAnimationFrame(() => {
1832
+ }} @arcgisPromptSelect=${({ detail: l }) => {
1833
+ this.inputText = l.prompt, requestAnimationFrame(() => {
822
1834
  this.inputEl.value?.focusTextArea();
823
1835
  });
824
- }} ${T(this.assistantEl)}><div slot=header-actions-start class="header-actions"><calcite-icon icon=effects></calcite-icon></div><form slot=chat-entry class="chat-entry" @submit=${(o) => {
825
- o.preventDefault();
826
- const u = e.trim();
827
- u && (this.assistantEl.value?.submitMessage(u), this.inputText = "");
828
- }} ${T(this.formEl)}><arcgis-portal-mentionable-text-area .portal=${a} .user=${r} rows=3 .popoverListLabel=${t.mentionEntities} .placeholder=${t.placeholder} .value=${e} @arcgisUserMentionableTextAreaKeyDown=${({ detail: o }) => {
829
- o.key === "Enter" && !o.shiftKey && (o.preventDefault(), this.formEl.value?.requestSubmit());
830
- }} @arcgisUserMentionableTextAreaChange=${({ detail: o }) => {
831
- this.inputText = o ?? "";
832
- }} ${T(this.inputEl)}></arcgis-portal-mentionable-text-area><div class="chat-actions"><arcgis-portal-voice-input @arcgisVoiceInputStart=${() => {
1836
+ }} ${k(this.assistantEl)}><div slot=header-actions-start class="header-actions"><calcite-icon icon=effects></calcite-icon></div><form slot=chat-entry class="chat-entry" @submit=${(l) => {
1837
+ l.preventDefault();
1838
+ const m = a.trim();
1839
+ m && (this.assistantEl.value?.submitMessage(m), this.inputText = "");
1840
+ }} ${k(this.formEl)}><arcgis-portal-mentionable-text-area .portal=${n} .user=${o} rows=3 .popoverListLabel=${e.mentionEntities} .placeholder=${e.placeholder} .value=${a} @arcgisUserMentionableTextAreaKeyDown=${({ detail: l }) => {
1841
+ l.key === "Enter" && !l.shiftKey && (l.preventDefault(), this.formEl.value?.requestSubmit());
1842
+ }} @arcgisUserMentionableTextAreaChange=${({ detail: l }) => {
1843
+ this.inputText = l ?? "";
1844
+ }} ${k(this.inputEl)}></arcgis-portal-mentionable-text-area><div class="chat-actions"><arcgis-portal-voice-input @arcgisVoiceInputStart=${() => {
833
1845
  this.isListening = !0, this.isVoiceInputDisabled = !1;
834
1846
  }} @arcgisVoiceInputStop=${() => {
835
1847
  this.isListening = !1, this.isVoiceInputDisabled = !1;
836
- }} @arcgisVoiceInputError=${(o) => {
837
- o.detail.errorCode === "not-supported" && (this.showVoiceInput = !1);
838
- }} @arcgisVoiceInputInterimTranscription=${(o) => {
839
- this.inputText = o.detail.text;
840
- }} ${T(this.voiceInputEl)}></arcgis-portal-voice-input>${l && w`<calcite-button icon-start=microphone .label=${t.voiceInput} round .disabled=${i} .appearance=${c ? "solid" : "outline-fill"} @click=${async () => {
1848
+ }} @arcgisVoiceInputError=${(l) => {
1849
+ l.detail.errorCode === "not-supported" && (this.showVoiceInput = !1);
1850
+ }} @arcgisVoiceInputInterimTranscription=${(l) => {
1851
+ this.inputText = l.detail.text;
1852
+ }} ${k(this.voiceInputEl)}></arcgis-portal-voice-input>${u && M`<calcite-button icon-start=microphone .label=${e.voiceInput} round .disabled=${d} .appearance=${c ? "solid" : "outline-fill"} @click=${async () => {
841
1853
  this.isVoiceInputDisabled = !0;
842
- const o = this.voiceInputEl.value;
843
- c ? await o?.stopListening() : await o?.startListening();
844
- }}></calcite-button>` || ""}<calcite-button type=submit icon-start=send round .disabled=${!e.trim()} .label=${t.send}>${t.send}</calcite-button></div></form><arcgis-assistant-agent .agent=${Tt} .context=${{ portal: a, user: r }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${Lt} .context=${{ portal: a, user: r }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${ae} .context=${{ portal: a, user: r }}></arcgis-assistant-agent>${this.interrupt && w`<arcgis-portal-ai-assistant-interrupt slot=interrupt .type=${this.interrupt.type} .message=${this.interrupt.message} .options=${this.interrupt.options} @arcgisSubmit=${({ detail: o }) => {
845
- this.assistantEl.value?.submitInterrupt(o);
1854
+ const l = this.voiceInputEl.value;
1855
+ c ? await l?.stopListening() : await l?.startListening();
1856
+ }}></calcite-button>` || ""}<calcite-button type=submit icon-start=send round .disabled=${!a.trim()} .label=${e.send}>${e.send}</calcite-button></div></form><arcgis-assistant-agent .agent=${xa} .context=${{ portal: n, user: o, navigationTargetMap: s }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${Te} .context=${{ portal: n, user: o, navigationTargetMap: s }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${Ve} .context=${{ portal: n, user: o, navigationTargetMap: s }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${la} .context=${{ portal: n, user: o, navigationTargetMap: s }}></arcgis-assistant-agent>${i && M`<arcgis-assistant-agent .agent=${sn} .context=${{ portal: n, user: o, navigationTargetMap: s }}></arcgis-assistant-agent>` || ""}${this.interrupt && M`<arcgis-portal-ai-assistant-interrupt slot=interrupt .type=${this.interrupt.type} .message=${this.interrupt.message} .options=${this.interrupt.options} @arcgisSubmit=${({ detail: l }) => {
1857
+ this.assistantEl.value?.submitInterrupt(l);
846
1858
  }} @arcgisCancel=${() => {
847
1859
  this.assistantEl.value?.cancelInterrupt();
848
1860
  }}></arcgis-portal-ai-assistant-interrupt>` || ""}</arcgis-assistant>`;
849
1861
  }
850
1862
  }
851
- Z("arcgis-portal-ai-assistant", ne);
1863
+ zt("arcgis-portal-ai-assistant", mn);
852
1864
  export {
853
- ne as ArcgisPortalAiAssistant
1865
+ mn as ArcgisPortalAiAssistant
854
1866
  };