@arcgis/ai-components 5.1.0-next.4 → 5.1.0-next.41

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 (95) hide show
  1. package/dist/cdn/24MYCR6F.js +3 -0
  2. package/dist/cdn/2JJGDGMG.js +67 -0
  3. package/dist/cdn/433QN6BZ.js +2 -0
  4. package/dist/cdn/{R3LASMEM.js → 6Z5UQ3RY.js} +106 -107
  5. package/dist/cdn/75CJ2C4L.js +2 -0
  6. package/dist/cdn/7ITNTTBI.js +2 -0
  7. package/dist/cdn/{CN6VFVA2.js → BSIB6MUI.js} +1 -0
  8. package/dist/cdn/COBFCTOX.js +2 -0
  9. package/dist/cdn/CXBXMIVC.js +2 -0
  10. package/dist/cdn/{UY4FI7AP.js → FHXNY4QC.js} +1 -1
  11. package/dist/cdn/HN2XKXPX.js +2 -0
  12. package/dist/cdn/HRAAW2JX.js +2 -0
  13. package/dist/cdn/NCO7XIEC.js +3 -0
  14. package/dist/cdn/OG537NIF.js +2 -0
  15. package/dist/cdn/RNZITNTO.js +2 -0
  16. package/dist/cdn/{62K6RJZZ.js → SA7B3M2J.js} +1 -1
  17. package/dist/cdn/TBEVPWWN.js +2 -0
  18. package/dist/cdn/UIXYUELQ.js +2 -0
  19. package/dist/cdn/UY42NIH7.js +2 -0
  20. package/dist/cdn/VC3I52HI.js +2 -0
  21. package/dist/cdn/{ZYQ6U2YH.js → VDUOWASW.js} +14 -0
  22. package/dist/cdn/{NKNUZCLA.js → W2A22QZU.js} +15 -0
  23. package/dist/cdn/XI5SV3HJ.js +47 -0
  24. package/dist/cdn/XSVSCXUM.js +2 -0
  25. package/dist/cdn/XUUCW7HH.js +2 -0
  26. package/dist/cdn/{M7XUI5KY.js → Z6ZNHTPJ.js} +35 -3
  27. package/dist/cdn/ZF5LIGCC.js +275 -0
  28. package/dist/cdn/ZPGX72R2.js +4 -0
  29. package/dist/cdn/index.js +1 -1
  30. package/dist/cdn/main.css +1 -1
  31. package/dist/chunks/converterUtils.js +117 -0
  32. package/dist/chunks/utils.js +16 -14
  33. package/dist/chunks/utils2.js +8 -3
  34. package/dist/components/arcgis-assistant/customElement.d.ts +286 -23
  35. package/dist/components/arcgis-assistant/customElement.js +172 -142
  36. package/dist/components/arcgis-assistant/index.js +2 -1
  37. package/dist/components/arcgis-assistant/types.d.ts +97 -0
  38. package/dist/components/arcgis-assistant-agent/customElement.d.ts +22 -8
  39. package/dist/components/arcgis-assistant-agent/customElement.js +7 -7
  40. package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -6
  41. package/dist/components/arcgis-assistant-chat/customElement.js +14 -14
  42. package/dist/components/arcgis-assistant-chat-card/customElement.d.ts +12 -5
  43. package/dist/components/arcgis-assistant-chat-card/customElement.js +59 -25
  44. package/dist/components/arcgis-assistant-chat-card/index.js +2 -0
  45. package/dist/components/arcgis-assistant-chat-card-content/customElement.js +14 -12
  46. package/dist/components/arcgis-assistant-chat-card-content/index.js +1 -0
  47. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +5 -2
  48. package/dist/components/arcgis-assistant-chat-entry/customElement.js +42 -20
  49. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.d.ts +73 -6
  50. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +5 -5
  51. package/dist/components/arcgis-assistant-help-agent/customElement.d.ts +73 -0
  52. package/dist/components/arcgis-assistant-help-agent/customElement.js +26 -0
  53. package/dist/components/arcgis-assistant-help-agent/index.d.ts +1 -0
  54. package/dist/components/arcgis-assistant-help-agent/index.js +1 -0
  55. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +1 -1
  56. package/dist/components/arcgis-assistant-interrupt/customElement.js +8 -8
  57. package/dist/components/arcgis-assistant-layer-filter-agent/customElement.js +3 -3
  58. package/dist/components/arcgis-assistant-layer-query-agent/customElement.js +10 -10
  59. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +6 -6
  60. package/dist/components/arcgis-assistant-navigation-agent/customElement.d.ts +53 -6
  61. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +5 -5
  62. package/dist/components/arcgis-assistant-shell/customElement.d.ts +3 -0
  63. package/dist/components/arcgis-assistant-shell/customElement.js +12 -11
  64. package/dist/docs/api.json +1 -1
  65. package/dist/docs/docs.json +1 -1
  66. package/dist/docs/vscode.html-custom-data.json +1 -1
  67. package/dist/docs/web-types.json +1 -1
  68. package/dist/index.d.ts +16 -0
  69. package/dist/loader.js +9 -8
  70. package/dist/types/lumina.d.ts +19 -5
  71. package/dist/types/preact.d.ts +20 -5
  72. package/dist/types/react.d.ts +21 -5
  73. package/dist/types/stencil.d.ts +19 -5
  74. package/dist/utils/index.d.ts +305 -0
  75. package/dist/utils/index.js +13 -0
  76. package/package.json +15 -8
  77. package/dist/cdn/26V7SXDR.js +0 -4
  78. package/dist/cdn/4Y73V2HU.js +0 -2
  79. package/dist/cdn/5DFZMIRZ.js +0 -2
  80. package/dist/cdn/6ULHJSIQ.js +0 -245
  81. package/dist/cdn/AQZDEJJZ.js +0 -2
  82. package/dist/cdn/GCFT45CD.js +0 -2
  83. package/dist/cdn/I22GHLAO.js +0 -2
  84. package/dist/cdn/IFWK7P7O.js +0 -2
  85. package/dist/cdn/KJZARHAM.js +0 -2
  86. package/dist/cdn/M672SFG6.js +0 -2
  87. package/dist/cdn/MLJ7GXKB.js +0 -2
  88. package/dist/cdn/PCBMGVNZ.js +0 -4
  89. package/dist/cdn/Q674OE2M.js +0 -2
  90. package/dist/cdn/QOIX2B5M.js +0 -2
  91. package/dist/cdn/SOWNHB7F.js +0 -30
  92. package/dist/cdn/SW3IAT6V.js +0 -2
  93. package/dist/cdn/VUHDKXFM.js +0 -2
  94. package/dist/cdn/XVUE27HC.js +0 -2
  95. package/dist/cdn/ZFFHP5DI.js +0 -2
@@ -0,0 +1,73 @@
1
+ /// <reference path="../../index.d.ts" />
2
+ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
3
+ import type { ArcgisMap as ArcgisMap } from "@arcgis/map-components/components/arcgis-map";
4
+
5
+ /**
6
+ * The Help Agent provides contextual assistance and guidance to the end user within an
7
+ * agentic web mapping application. It can provide answers to questions about the web map provided
8
+ * to the [referenceElement](https://developers.arcgis.com/javascript/latest/references/ai-components/components/arcgis-assistant-help-agent/#referenceElement) property and answer questions about other agents included
9
+ * as subcomponents to the [arcgis-assistant](https://developers.arcgis.com/javascript/latest/references/ai-components/components/arcgis-assistant/) component.
10
+ *
11
+ * This is an unrendered component that must be added as a child of the `arcgis-assistant` component in
12
+ * either HTML or JavaScript.
13
+ *
14
+ * ```html
15
+ * <arcgis-map id="my-map"></arcgis-map>
16
+ * <arcgis-assistant reference-element="my-map">
17
+ * <arcgis-assistant-help-agent></arcgis-assistant-help-agent>
18
+ * </arcgis-assistant>
19
+ * ```
20
+ *
21
+ * ```js
22
+ * const assistant = document.querySelector("arcgis-assistant");
23
+ * const helpAgent = document.createElement("arcgis-assistant-help-agent");
24
+ * assistant.appendChild(helpAgent);
25
+ * ```
26
+ *
27
+ * Once added to the assistant, the agent is loaded and ready to receive user messages related to help and guidance.
28
+ *
29
+ * ### Example questions
30
+ *
31
+ * The following are example questions a user can ask within the bounds of the help agent:
32
+ *
33
+ * - "What kind of questions can I ask?"
34
+ * - "What layers are in this map?"
35
+ * - "What kind of data can I ask questions about?"
36
+ *
37
+ * The following are examples of the types of questions that fall outside the bounds of the
38
+ * help agent and should therefore be avoided:
39
+ *
40
+ * - "Search the Esri documentation for ways that I can query my data."
41
+ * - "Log a bug related to map navigation to the Esri support team."
42
+ * - "How do I bake a cake?"
43
+ * - "How does map navigation work in ArcGIS?"
44
+ *
45
+ * > Due to the non-deterministic nature of generative AI, there may be inaccuracies or unexpected behavior when using the
46
+ * out-of-the-box agents.
47
+ *
48
+ * @since 5.0
49
+ * @beta
50
+ * @see [arcgis-assistant](https://developers.arcgis.com/javascript/latest/references/ai-components/components/arcgis-assistant/)
51
+ * @see [Intro to building agentic mapping applications](https://developers.arcgis.com/javascript/latest/agentic-apps/ai-introduction/)
52
+ * @see [AI Assistant component sample](https://developers.arcgis.com/javascript/latest/sample-code/ai-assistant/)
53
+ */
54
+ export abstract class ArcgisAssistantHelpAgent extends LitElement {
55
+ /**
56
+ * The reference element to the map that provides context for the help agent. Currently,
57
+ * this is only scoped to `arcgis-map` elements. This shows the help agent which map for which to
58
+ * provide assistance. This allows users to ask questions about the specific map provided to the agent.
59
+ *
60
+ * Setting this property is not necessary if you set the reference element on the parent
61
+ * `arcgis-assistant` component.
62
+ *
63
+ * @see [arcgis-assistant.referenceElement](https://developers.arcgis.com/javascript/latest/references/ai-components/components/arcgis-assistant/#referenceElement)
64
+ * @example
65
+ * ```html
66
+ * <arcgis-map id="my-map"></arcgis-map>
67
+ * <arcgis-assistant>
68
+ * <arcgis-assistant-help-agent reference-element="my-map"></arcgis-assistant-help-agent>
69
+ * </arcgis-assistant>
70
+ * ```
71
+ */
72
+ accessor referenceElement: ArcgisMap | string | undefined;
73
+ }
@@ -0,0 +1,26 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import { c as t } from "../../chunks/runtime.js";
3
+ import { LitElement as e } from "@arcgis/lumina";
4
+ import { HelpAgent as s } from "@arcgis/ai-agents";
5
+ import { r as i, a as r } from "../../chunks/utils.js";
6
+ class a extends e {
7
+ constructor() {
8
+ super(...arguments), this.agent = s;
9
+ }
10
+ static {
11
+ this.properties = { referenceElement: 1 };
12
+ }
13
+ #t;
14
+ getContext() {
15
+ if (!this.#t)
16
+ throw new Error("arcgis-assistant-help-agent requires a mapView");
17
+ return { mapView: this.#t };
18
+ }
19
+ load() {
20
+ this.#t = i(this, "arcgis-assistant-help-agent"), r(this);
21
+ }
22
+ }
23
+ t("arcgis-assistant-help-agent", a);
24
+ export {
25
+ a as ArcgisAssistantHelpAgent
26
+ };
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -20,7 +20,7 @@ export abstract class ArcgisAssistantInterrupt extends LitElement {
20
20
  accessor options: string[] | undefined;
21
21
  accessor type: "boolean-choice" | "multi-select" | "single-select" | "text-input";
22
22
  readonly arcgisCancel: import("@arcgis/lumina").TargetedEvent<this, void>;
23
- readonly arcgisSubmit: import("@arcgis/lumina").TargetedEvent<this, string[] | string>;
23
+ readonly arcgisSubmit: import("@arcgis/lumina").TargetedEvent<this, string[] | boolean | string>;
24
24
  readonly "@eventTypes": {
25
25
  arcgisCancel: ArcgisAssistantInterrupt["arcgisCancel"]["detail"];
26
26
  arcgisSubmit: ArcgisAssistantInterrupt["arcgisSubmit"]["detail"];
@@ -1,10 +1,10 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import { c as l } from "../../chunks/runtime.js";
3
- import { css as a, html as e } from "lit";
4
- import { LitElement as c, createEvent as s } from "@arcgis/lumina";
2
+ import { c as a } from "../../chunks/runtime.js";
3
+ import { css as c, html as e } from "lit";
4
+ import { LitElement as l, createEvent as s } from "@arcgis/lumina";
5
5
  import { u as n } from "../../chunks/useT9n.js";
6
- const r = a``;
7
- class o extends c {
6
+ const r = c``;
7
+ class o extends l {
8
8
  constructor() {
9
9
  super(...arguments), this.#t = [], this._messages = n({ blocking: !0 }), this.arcgisCancel = s(), this.arcgisSubmit = s();
10
10
  }
@@ -22,16 +22,16 @@ class o extends c {
22
22
  case "multi-select":
23
23
  return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${(t) => this.#t = t.target.selectedItems.map((i) => i.value)}>${this.options?.map((t) => e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;
24
24
  case "boolean-choice":
25
- return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${(t) => this.#t = t.target.selectedItems[0]?.value}>${this.options?.map((t) => e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;
25
+ return null;
26
26
  case "text-input":
27
27
  return e`<calcite-input .label=${this._messages.enterTextLabel} @calciteInputInput=${(t) => this.#t = t.target.value}></calcite-input>`;
28
28
  }
29
29
  }
30
30
  render() {
31
- return e`<calcite-panel .description=${this.message}>${this._renderInterruptOptions()}<calcite-button slot=footer-end appearance=outline @click=${() => this.arcgisCancel.emit()}>${this._messages.cancelButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid @click=${() => this.arcgisSubmit.emit(this.#t)}>${this._messages.submitButtonLabel}</calcite-button></calcite-panel>`;
31
+ return e`<calcite-panel .description=${this.message}>${this._renderInterruptOptions()}<calcite-button slot=footer-end appearance=outline @click=${() => this.arcgisCancel.emit()}>${this._messages.cancelButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid @click=${() => this.arcgisSubmit.emit(this.type === "boolean-choice" ? !0 : this.#t)}>${this._messages.submitButtonLabel}</calcite-button></calcite-panel>`;
32
32
  }
33
33
  }
34
- l("arcgis-assistant-interrupt", o);
34
+ a("arcgis-assistant-interrupt", o);
35
35
  export {
36
36
  o as ArcgisAssistantInterrupt
37
37
  };
@@ -2,7 +2,7 @@
2
2
  import { c as t } from "../../chunks/runtime.js";
3
3
  import { LitElement as e } from "@arcgis/lumina";
4
4
  import { LayerFilterAgent as r } from "@arcgis/ai-agents";
5
- import { r as s, i } from "../../chunks/utils.js";
5
+ import { r as s, a as i } from "../../chunks/utils.js";
6
6
  class a extends e {
7
7
  constructor() {
8
8
  super(...arguments), this.agent = r;
@@ -16,8 +16,8 @@ class a extends e {
16
16
  throw new Error("arcgis-assistant-layer-filter-agent requires a mapView");
17
17
  return { mapView: this.#t };
18
18
  }
19
- async load() {
20
- this.#t = await s(this, "arcgis-assistant-layer-filter-agent"), i(this);
19
+ load() {
20
+ this.#t = s(this, "arcgis-assistant-layer-filter-agent"), i(this);
21
21
  }
22
22
  }
23
23
  t("arcgis-assistant-layer-filter-agent", a);
@@ -1,26 +1,26 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import { c as t } from "../../chunks/runtime.js";
3
- import { LitElement as e } from "@arcgis/lumina";
2
+ import { c as e } from "../../chunks/runtime.js";
3
+ import { LitElement as t } from "@arcgis/lumina";
4
4
  import { LayerQueryAgent as r } from "@arcgis/ai-agents";
5
- import { r as s, i as a } from "../../chunks/utils.js";
6
- class i extends e {
5
+ import { r as s, a } from "../../chunks/utils.js";
6
+ class i extends t {
7
7
  constructor() {
8
8
  super(...arguments), this.agent = r;
9
9
  }
10
10
  static {
11
11
  this.properties = { referenceElement: 1 };
12
12
  }
13
- #t;
13
+ #e;
14
14
  getContext() {
15
- if (!this.#t)
15
+ if (!this.#e)
16
16
  throw new Error("arcgis-assistant-layer-query-agent requires a mapView");
17
- return { mapView: this.#t };
17
+ return { mapView: this.#e };
18
18
  }
19
- async load() {
20
- this.#t = await s(this, "arcgis-assistant-layer-query-agent"), a(this);
19
+ load() {
20
+ this.#e = s(this, "arcgis-assistant-layer-query-agent"), a(this);
21
21
  }
22
22
  }
23
- t("arcgis-assistant-layer-query-agent", i);
23
+ e("arcgis-assistant-layer-query-agent", i);
24
24
  export {
25
25
  i as ArcgisAssistantLayerQueryAgent
26
26
  };
@@ -2,8 +2,8 @@
2
2
  import { c as t } from "../../chunks/runtime.js";
3
3
  import { LitElement as s } from "@arcgis/lumina";
4
4
  import { LayerStylingAgent as e } from "@arcgis/ai-agents";
5
- import { r as i, i as a } from "../../chunks/utils.js";
6
- class r extends s {
5
+ import { r as i, a as r } from "../../chunks/utils.js";
6
+ class a extends s {
7
7
  constructor() {
8
8
  super(...arguments), this.agent = e;
9
9
  }
@@ -16,11 +16,11 @@ class r extends s {
16
16
  throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");
17
17
  return { mapView: this.#t };
18
18
  }
19
- async load() {
20
- this.#t = await i(this, "arcgis-assistant-layer-styling-agent"), a(this);
19
+ load() {
20
+ this.#t = i(this, "arcgis-assistant-layer-styling-agent"), r(this);
21
21
  }
22
22
  }
23
- t("arcgis-assistant-layer-styling-agent", r);
23
+ t("arcgis-assistant-layer-styling-agent", a);
24
24
  export {
25
- r as ArcgisAssistantLayerStylingAgent
25
+ a as ArcgisAssistantLayerStylingAgent
26
26
  };
@@ -3,14 +3,14 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
3
3
  import type { ArcgisMap as ArcgisMap } from "@arcgis/map-components/components/arcgis-map";
4
4
 
5
5
  /**
6
- * The Navigation Agent component enables the end user to navigate to different areas of a web map.
7
- * It allows you to type in a place name, address, or layer title to navigate to the desired location.
8
- * Currently, this is only scoped to navigation within a 2D map view.
6
+ * The Navigation Agent enables the end user to navigate to different areas of a web map. See the list
7
+ * of capabilities below for more details.
9
8
  *
10
9
  * This is an unrendered component that must be added as a child of the `arcgis-assistant` component in either HTML or JavaScript.
11
10
  *
12
11
  * ```html
13
- * <arcgis-assistant>
12
+ * <arcgis-map id="my-map"></arcgis-map>
13
+ * <arcgis-assistant reference-element="my-map">
14
14
  * <arcgis-assistant-navigation-agent></arcgis-assistant-navigation-agent>
15
15
  * </arcgis-assistant>
16
16
  * ```
@@ -21,14 +21,61 @@ import type { ArcgisMap as ArcgisMap } from "@arcgis/map-components/components/a
21
21
  * assistant.appendChild(navigationAgent);
22
22
  * ```
23
23
  *
24
+ * Once added to the assistant, the agent is loaded and ready to receive user messages related to navigation.
25
+ *
26
+ * ### Capabilities
27
+ *
28
+ * The navigation agent provides the following capabilities related to map navigation:
29
+ *
30
+ * - **Geocoding** - Navigate to an address using Esri's World Geocoding Service.
31
+ * - **Go to extent** - Navigate to the extent of a bookmark in the map, the home extent of the web map,
32
+ * or the extent of a layer.
33
+ * - **Go to features** - Navigate to a specified feature or set of features.
34
+ * - **Go to viewpoint** - Navigate to a specified viewpoint, which can include center, zoom, and/or
35
+ * rotation.
36
+ *
37
+ * ### Example questions
38
+ *
39
+ * The following are example questions a user can ask within the bounds of the navigation agent:
40
+ *
41
+ * - "Go to the Golden Gate Bridge"
42
+ * - "Zoom to a 1 to 24,000 scale"
43
+ * - "Zoom in"
44
+ * - "Go to the parks layer"
45
+ *
46
+ * The following are examples of the types of questions that fall outside the bounds of the
47
+ * navigation agent and should therefore be avoided:
48
+ *
49
+ * - "Rotate the map 45 degrees" (this capability is not currently supported but may be in the future)
50
+ * - "Make this map 3D and tilt the view to a 45 degree angle" (3D navigation is currently not supported)
51
+ * - "Where am I?" (the navigation agent does not have access to the user's location)
52
+ *
53
+ * > Due to the non-deterministic nature of generative AI, there may be inaccuracies or unexpected behavior when using the
54
+ * out-of-the-box agents.
55
+ *
24
56
  * @since 5.0
25
57
  * @beta
26
58
  * @see [arcgis-assistant](https://developers.arcgis.com/javascript/latest/references/ai-components/components/arcgis-assistant/)
59
+ * @see [Intro to building agentic mapping applications](https://developers.arcgis.com/javascript/latest/agentic-apps/ai-introduction/)
60
+ * @see [AI Assistant component sample](https://developers.arcgis.com/javascript/latest/sample-code/ai-assistant/)
27
61
  */
28
62
  export abstract class ArcgisAssistantNavigationAgent extends LitElement {
29
63
  /**
30
- * A reference to the map element or its ID string used to resolve the MapView for this agent.
31
- * If not provided, the agent will attempt to find the closest parent `arcgis-map` element.
64
+ * The reference element to the map that provides context for the navigation agent. Currently,
65
+ * this is only scoped to `arcgis-map` elements. This shows the navigation agent which map on which to
66
+ * perform navigation actions. This is required for the navigation agent to function properly.
67
+ *
68
+ * Setting this property is not necessary if you set the reference element on the parent
69
+ * `arcgis-assistant` component.
70
+ *
71
+ * @see [arcgis-assistant.referenceElement](https://developers.arcgis.com/javascript/latest/references/ai-components/components/arcgis-assistant/#referenceElement)
72
+ * @example
73
+ * ```html
74
+ * <arcgis-map id="my-map"></arcgis-map>
75
+ * <arcgis-assistant>
76
+ * <arcgis-assistant-navigation-agent reference-element="my-map"></arcgis-assistant-navigation-agent>
77
+ * </arcgis-assistant>
78
+ * ```
32
79
  */
33
80
  accessor referenceElement: ArcgisMap | string | undefined;
34
81
  }
@@ -1,11 +1,11 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
2
  import { c as t } from "../../chunks/runtime.js";
3
3
  import { LitElement as i } from "@arcgis/lumina";
4
- import { NavigationAgent as a } from "@arcgis/ai-agents";
5
- import { r as s, i as e } from "../../chunks/utils.js";
4
+ import { NavigationAgent as s } from "@arcgis/ai-agents";
5
+ import { r as a, a as e } from "../../chunks/utils.js";
6
6
  class n extends i {
7
7
  constructor() {
8
- super(...arguments), this.agent = a;
8
+ super(...arguments), this.agent = s;
9
9
  }
10
10
  static {
11
11
  this.properties = { referenceElement: 1 };
@@ -16,8 +16,8 @@ class n extends i {
16
16
  throw new Error("arcgis-assistant-navigation-agent requires a mapView");
17
17
  return { mapView: this.#t };
18
18
  }
19
- async load() {
20
- this.#t = await s(this, "arcgis-assistant-navigation-agent"), e(this);
19
+ load() {
20
+ this.#t = a(this, "arcgis-assistant-navigation-agent"), e(this);
21
21
  }
22
22
  }
23
23
  t("arcgis-assistant-navigation-agent", n);
@@ -1,5 +1,7 @@
1
1
  /// <reference path="../../index.d.ts" />
2
+ import type Collection from "@arcgis/core/core/Collection.js";
2
3
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
4
+ import type { ChatMessage } from "../arcgis-assistant/types.js";
3
5
  import type { T9nMeta } from "@arcgis/lumina/controllers";
4
6
 
5
7
  /** @internal */
@@ -26,6 +28,7 @@ export abstract class ArcgisAssistantShell extends LitElement {
26
28
  accessor inputValue: string;
27
29
  /** @default false */
28
30
  accessor loading: boolean;
31
+ accessor messages: Collection<ChatMessage>;
29
32
  accessor status: "error" | "ready" | "working" | undefined;
30
33
  accessor suggestedPrompts: string[];
31
34
  readonly arcgisCancel: import("@arcgis/lumina").TargetedEvent<this, void>;
@@ -1,27 +1,28 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
2
  import { c as i } from "../../chunks/runtime.js";
3
3
  import { css as a, html as t } from "lit";
4
- import { LitElement as l, createEvent as e } from "@arcgis/lumina";
5
- import { u as n } from "../../chunks/useT9n.js";
6
- const o = a`.assistant-shell__footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.assistant-shell__content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative}.assistant-shell__suggested-prompts-container{position:absolute;bottom:0;display:flex;justify-content:center;width:100%}.assistant-shell__suggested-prompts{padding:var(--calcite-spacing-md)}.assistant-shell__suggested-prompt{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal}`;
7
- class r extends l {
4
+ import { LitElement as n, createEvent as e } from "@arcgis/lumina";
5
+ import { u as l } from "../../chunks/useT9n.js";
6
+ import o from "@arcgis/core/core/Collection.js";
7
+ const r = a`.assistant-shell__footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.assistant-shell__content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative;overflow:auto}.assistant-shell__suggested-prompts-container{display:flex;justify-content:center;width:100%}.assistant-shell__suggested-prompts{padding:var(--calcite-spacing-md);max-width:100%;box-sizing:border-box}calcite-chip{max-width:100%}.assistant-shell__suggested-prompt{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;cursor:pointer}`;
8
+ class c extends n {
8
9
  constructor() {
9
- super(...arguments), this._messages = n({ blocking: !0 }), this.description = "", this.loading = !1, this.entryMessageClosed = !1, this.awaitingResponse = !1, this.suggestedPrompts = [], this.inputValue = "", this.arcgisCancel = e(), this.arcgisSubmit = e();
10
+ super(...arguments), this._messages = l({ blocking: !0 }), this.description = "", this.loading = !1, this.entryMessageClosed = !1, this.awaitingResponse = !1, this.suggestedPrompts = [], this.inputValue = "", this.messages = new o([]), this.arcgisCancel = e(), this.arcgisSubmit = e();
10
11
  }
11
12
  static {
12
- this.properties = { heading: 1, description: 1, loading: 5, entryMessage: 1, entryMessageClosed: 5, awaitingResponse: 5, suggestedPrompts: 0, inputValue: 1, status: 1 };
13
+ this.properties = { heading: 1, description: 1, loading: 5, entryMessage: 1, entryMessageClosed: 5, awaitingResponse: 5, suggestedPrompts: 0, inputValue: 1, status: 1, messages: 0 };
13
14
  }
14
15
  static {
15
- this.styles = o;
16
+ this.styles = r;
16
17
  }
17
18
  _renderSuggestedPrompts() {
18
- return this.suggestedPrompts?.length ? t`<div class="assistant-shell__suggested-prompts-container"><calcite-chip-group class="assistant-shell__suggested-prompts" .label=${this._messages.suggestedPromptsLabel ?? "suggested prompts"} selection-mode=single-persist @calciteChipGroupSelect=${(s) => this.inputValue = s.target.selectedItems[0]?.value ?? ""}>${this.suggestedPrompts.map((s) => t`<calcite-chip closable .value=${s} .label=${s} appearance=outline-fill kind=brand><div class="assistant-shell__suggested-prompt">${s}</div></calcite-chip>`)}</calcite-chip-group></div>` : null;
19
+ return this.suggestedPrompts?.length ? t`<div class="assistant-shell__suggested-prompts-container"><calcite-chip-group class="assistant-shell__suggested-prompts" .label=${this._messages.suggestedPromptsLabel ?? "suggested prompts"}>${this.suggestedPrompts.map((s) => t`<calcite-chip .value=${s} .label=${s} appearance=outline-fill kind=brand @calciteChipSelect=${() => this.inputValue = s}><div class="assistant-shell__suggested-prompt">${s}</div></calcite-chip>`)}</calcite-chip-group></div>` : null;
19
20
  }
20
21
  render() {
21
- return t`<calcite-panel .loading=${this.loading} .heading=${this.heading ?? this._messages.shellHeading} .description=${this.description}><slot slot=header-actions-end name=header-actions-end></slot><div class="assistant-shell__content-container"><slot></slot>${this._renderSuggestedPrompts()}</div><div class="assistant-shell__footer-container" slot=footer><slot name=entry-message>${this.entryMessageClosed ? null : t`<calcite-notice slot=entry-message .open=${!this.entryMessageClosed} kind=info closable icon width=full><div slot=message>${this.entryMessage ?? this._messages.shellEntryMessage}</div></calcite-notice>`}</slot><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse} .arcgisSubmit=${this.arcgisSubmit} .arcgisCancel=${this.arcgisCancel} .inputValue=${this.inputValue} .status=${this.status}><slot name=entry-actions-start slot=entry-actions-start></slot></arcgis-assistant-chat-entry><slot name=footer-content></slot></div></calcite-panel>`;
22
+ return t`<calcite-panel .loading=${this.loading} .heading=${this.heading ?? this._messages.shellHeading} .description=${this.description}><slot slot=header-actions-end name=header-actions-end></slot><div class="assistant-shell__content-container"><slot></slot></div>${this._renderSuggestedPrompts()}<div class="assistant-shell__footer-container" slot=footer><slot name=entry-message>${this.entryMessageClosed ? null : t`<calcite-notice slot=entry-message .open=${!this.entryMessageClosed} kind=info closable icon width=full><div slot=message>${this.entryMessage ?? this._messages.shellEntryMessage}</div></calcite-notice>`}</slot><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse} .arcgisSubmit=${this.arcgisSubmit} .arcgisCancel=${this.arcgisCancel} .inputValue=${this.inputValue} .status=${this.status} .messages=${this.messages}><slot name=entry-actions-start slot=entry-actions-start></slot></arcgis-assistant-chat-entry><slot name=footer-content></slot></div></calcite-panel>`;
22
23
  }
23
24
  }
24
- i("arcgis-assistant-shell", r);
25
+ i("arcgis-assistant-shell", c);
25
26
  export {
26
- r as ArcgisAssistantShell
27
+ c as ArcgisAssistantShell
27
28
  };