@arcgis/ai-components 5.2.0-next.76 → 5.2.0-next.78

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 (156) hide show
  1. package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
  2. package/dist/{chunks/adapter12.js → agents/tools/filter/clearFilters/adapter.js} +1 -1
  3. package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
  4. package/dist/{chunks/adapter13.js → agents/tools/filter/resetMap/adapter.js} +1 -1
  5. package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
  6. package/dist/{chunks/adapter14.js → agents/tools/filter/setFeatureEffect/adapter.js} +2 -2
  7. package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
  8. package/dist/{chunks/adapter11.js → agents/tools/help/listFields/adapter.js} +1 -1
  9. package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
  10. package/dist/{chunks/adapter2.js → agents/tools/navigation/goToAddress/adapter.js} +1 -1
  11. package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
  12. package/dist/{chunks/adapter3.js → agents/tools/navigation/goToBookmark/adapter.js} +1 -1
  13. package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
  14. package/dist/{chunks/adapter4.js → agents/tools/navigation/goToFeatures/adapter.js} +1 -1
  15. package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
  16. package/dist/{chunks/adapter5.js → agents/tools/navigation/goToFullExtent/adapter.js} +1 -1
  17. package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
  18. package/dist/{chunks/adapter6.js → agents/tools/navigation/goToHomeExtent/adapter.js} +1 -1
  19. package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
  20. package/dist/{chunks/adapter7.js → agents/tools/navigation/goToLayer/adapter.js} +1 -1
  21. package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
  22. package/dist/{chunks/adapter8.js → agents/tools/navigation/goToScale/adapter.js} +1 -1
  23. package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
  24. package/dist/{chunks/adapter9.js → agents/tools/navigation/goToViewpoint/adapter.js} +1 -1
  25. package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
  26. package/dist/{chunks/adapter10.js → agents/tools/navigation/goToZoom/adapter.js} +1 -1
  27. package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
  28. package/dist/{chunks/adapter15.js → agents/tools/query/getAttribute/adapter.js} +2 -2
  29. package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
  30. package/dist/{chunks/adapter16.js → agents/tools/query/getStatistics/adapter.js} +4 -4
  31. package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
  32. package/dist/{chunks/adapter17.js → agents/tools/query/getTopFeatures/adapter.js} +4 -4
  33. package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
  34. package/dist/{chunks/adapter18.js → agents/tools/query/queryFeatures/adapter.js} +4 -4
  35. package/dist/cdn/{GRHIFCQX.js → 2EY3BQQX.js} +1 -1
  36. package/dist/cdn/3LILAJUD.js +2 -0
  37. package/dist/cdn/{S6OYR4VI.js → 3ORURUNE.js} +7 -7
  38. package/dist/cdn/4F7Y4RNW.js +2 -0
  39. package/dist/cdn/{MM33KJPF.js → 4OGR5QKS.js} +1 -1
  40. package/dist/cdn/{66SKMECC.js → 4WIDLQUH.js} +1 -1
  41. package/dist/cdn/{WMZ24LWS.js → 5X7EG7D2.js} +1 -1
  42. package/dist/cdn/{B6CJG5UH.js → 6U4GTCLJ.js} +14 -14
  43. package/dist/cdn/{7E2QMWK6.js → 7V6OSTFC.js} +1 -1
  44. package/dist/cdn/{5WLNL4HZ.js → 7ZFAFKJT.js} +1 -1
  45. package/dist/cdn/ADJ63EDN.js +3 -0
  46. package/dist/cdn/ATFNWFKG.js +2 -0
  47. package/dist/cdn/{VYTYVWR6.js → BGD2CCRJ.js} +1 -1
  48. package/dist/cdn/{253R5CBD.js → BS3HNSXX.js} +1 -1
  49. package/dist/cdn/{QZ3NQTNQ.js → BWLXDT75.js} +1 -1
  50. package/dist/cdn/{I6PD2HSL.js → CJMUJXPL.js} +1 -1
  51. package/dist/cdn/CZLLPKMS.js +2 -0
  52. package/dist/cdn/{CWD37QFT.js → CZM4URK7.js} +1 -1
  53. package/dist/cdn/EBNVLMUU.js +2 -0
  54. package/dist/cdn/{UPWAOZXQ.js → ERNYKCUJ.js} +1 -1
  55. package/dist/cdn/G5XE5D36.js +2 -0
  56. package/dist/cdn/{5RVELJU4.js → GAPKW32H.js} +1 -1
  57. package/dist/cdn/{HZ5ARNAM.js → GFEOVHJK.js} +1 -1
  58. package/dist/cdn/{U3XIDLHO.js → HPU6K67Y.js} +1 -1
  59. package/dist/cdn/{2VBPA27M.js → I7KCB7KE.js} +1 -1
  60. package/dist/cdn/{323DHVYA.js → IIIUSDQR.js} +1 -1
  61. package/dist/cdn/{TQXLSW4A.js → J7OJABFU.js} +1 -1
  62. package/dist/cdn/{TKYI5QRL.js → JO5ETMPS.js} +1 -1
  63. package/dist/cdn/LXQFE5PJ.js +2 -0
  64. package/dist/cdn/NLEBWLVV.js +2 -0
  65. package/dist/cdn/ORRMONGJ.js +2 -0
  66. package/dist/cdn/{MDM2K3U7.js → PBMQI4MV.js} +1 -1
  67. package/dist/cdn/{6CLF7KIK.js → PKJY7FBV.js} +1 -1
  68. package/dist/cdn/{K33MZ726.js → PUHRBGKB.js} +1 -1
  69. package/dist/cdn/{5DVRVY4L.js → Q57QWN5W.js} +1 -1
  70. package/dist/cdn/QUMNJVKX.js +2 -0
  71. package/dist/cdn/{QRHZXLZN.js → RBE55SWR.js} +1 -1
  72. package/dist/cdn/{RADWN4ZP.js → T4RIGOXB.js} +1 -1
  73. package/dist/cdn/{5R6QUF5B.js → UHZG7SKO.js} +1 -1
  74. package/dist/cdn/{DUSILSNJ.js → XHGVCL22.js} +3 -3
  75. package/dist/cdn/XLHTQ7CF.js +2 -0
  76. package/dist/cdn/{V6HOUZPZ.js → YLGKKWZK.js} +1 -1
  77. package/dist/cdn/YLVJA4ZE.js +2 -0
  78. package/dist/cdn/{NIY32GK2.js → YWULKUQV.js} +1 -1
  79. package/dist/cdn/{IRNSIUBT.js → YYSRYOHL.js} +1 -1
  80. package/dist/cdn/ZOEMBHRF.js +2 -0
  81. package/dist/cdn/ZWBFTKHF.js +2 -0
  82. package/dist/cdn/agent-utils/index.js +1 -1
  83. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  84. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
  85. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
  86. package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
  87. package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
  88. package/dist/cdn/index.js +1 -1
  89. package/dist/chunks/adapter.js +57 -60
  90. package/dist/chunks/converterUtils.js +66 -48
  91. package/dist/chunks/helpGraph.js +1 -1
  92. package/dist/chunks/navigationGraph.js +9 -9
  93. package/dist/chunks/utils2.js +10 -41
  94. package/dist/chunks/utils3.js +41 -10
  95. package/dist/components/arcgis-assistant/customElement.d.ts +30 -1
  96. package/dist/components/arcgis-assistant/customElement.js +133 -135
  97. package/dist/components/arcgis-assistant-agent/customElement.js +18 -18
  98. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +11 -11
  99. package/dist/components/arcgis-assistant-help-agent/customElement.js +17 -17
  100. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  101. package/dist/components/arcgis-assistant-interrupt/customElement.js +10 -11
  102. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +12 -8
  103. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +18 -18
  104. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +18 -18
  105. package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
  106. package/dist/components/arcgis-assistant-message/customElement.js +9 -8
  107. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
  108. package/dist/components/arcgis-assistant-message-loading/customElement.js +11 -10
  109. package/dist/components/arcgis-assistant-message-text/customElement.js +4 -4
  110. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +9 -9
  111. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
  112. package/dist/components/arcgis-assistant-user-message/customElement.js +13 -10
  113. package/dist/docs/api.json +1 -1
  114. package/dist/docs/docs.json +1 -1
  115. package/dist/docs/vscode.html-custom-data.json +1 -1
  116. package/dist/docs/web-types.json +1 -1
  117. package/dist/loader.js +4 -4
  118. package/dist/types/lumina.d.ts +2 -2
  119. package/dist/types/preact.d.ts +2 -2
  120. package/dist/types/react.d.ts +2 -2
  121. package/dist/types/stencil.d.ts +2 -2
  122. package/package.json +22 -5
  123. package/dist/cdn/2GH3K5JP.js +0 -2
  124. package/dist/cdn/2Y4DTOGT.js +0 -2
  125. package/dist/cdn/3S5G5SIX.js +0 -2
  126. package/dist/cdn/5TI2F5XX.js +0 -2
  127. package/dist/cdn/DCSZPL7R.js +0 -2
  128. package/dist/cdn/FSGIG7UN.js +0 -2
  129. package/dist/cdn/GLBE7OW2.js +0 -2
  130. package/dist/cdn/IDUC4CPV.js +0 -2
  131. package/dist/cdn/K335IAIE.js +0 -2
  132. package/dist/cdn/KKLAQF3Z.js +0 -2
  133. package/dist/cdn/KLYNL2ZT.js +0 -2
  134. package/dist/cdn/OKMZQXBQ.js +0 -2
  135. package/dist/cdn/T4ECSHM7.js +0 -2
  136. package/dist/cdn/U6FBRUM4.js +0 -3
  137. package/dist/cdn/WSHWQDO2.js +0 -2
  138. package/dist/cdn/XRE5USHA.js +0 -2
  139. /package/dist/cdn/{BS2PFNU4.js → 5WYRJMBW.js} +0 -0
  140. /package/dist/cdn/{RU2T7GUX.js → 5ZFUGNRN.js} +0 -0
  141. /package/dist/cdn/{4YXYLX4H.js → 6HF36IKA.js} +0 -0
  142. /package/dist/cdn/{77QFSIWW.js → 7SRLZQVC.js} +0 -0
  143. /package/dist/cdn/{KA3FF3ZO.js → JKIESH74.js} +0 -0
  144. /package/dist/cdn/{CGXQAB3A.js → K2R6XVK3.js} +0 -0
  145. /package/dist/cdn/{LCFIADOZ.js → KITIP6J2.js} +0 -0
  146. /package/dist/cdn/{T2GJLEYV.js → KWD2ECTM.js} +0 -0
  147. /package/dist/cdn/{DYASSC7Z.js → LLUGJKAQ.js} +0 -0
  148. /package/dist/cdn/{3UEKINYC.js → MMHDT4KV.js} +0 -0
  149. /package/dist/cdn/{WS3T73IY.js → OAKRPM7D.js} +0 -0
  150. /package/dist/cdn/{Q4IQUEZN.js → U2D53TAX.js} +0 -0
  151. /package/dist/cdn/{4MFEKBKL.js → V52XWEGV.js} +0 -0
  152. /package/dist/cdn/{EAEQONP7.js → VLLZ2FFU.js} +0 -0
  153. /package/dist/cdn/{DY36ATOA.js → WKTQVBFJ.js} +0 -0
  154. /package/dist/cdn/{5PJXNTLZ.js → Y7XD7ZRD.js} +0 -0
  155. /package/dist/cdn/{UIXX3XEN.js → YEZ3AMNX.js} +0 -0
  156. /package/dist/cdn/{QVOMX3R6.js → Z5W4V7RC.js} +0 -0
@@ -89,13 +89,35 @@ export abstract class ArcgisAssistant extends LitElement {
89
89
  assistantLabel: string;
90
90
  stopButtonLabel: string;
91
91
  askButtonLabel: string;
92
+ stoppedByUserLabel: string;
93
+ noAgentsFoundMessage: string;
94
+ orchestratorInitializationErrorMessage: string;
95
+ signInErrorMessage: string;
96
+ signInRequiredMessage: string;
97
+ signInLabel: string;
98
+ signInToArcGISOnlineLabel: string;
99
+ noPortalInformationMessage: string;
100
+ readMoreLabel: string;
101
+ learnAboutWebMapEmbeddingsLabel: string;
102
+ waitingForUserInputMessage: string;
92
103
  } & T9nMeta<{
93
104
  assistantLabel: string;
94
105
  stopButtonLabel: string;
95
106
  askButtonLabel: string;
107
+ stoppedByUserLabel: string;
108
+ noAgentsFoundMessage: string;
109
+ orchestratorInitializationErrorMessage: string;
110
+ signInErrorMessage: string;
111
+ signInRequiredMessage: string;
112
+ signInLabel: string;
113
+ signInToArcGISOnlineLabel: string;
114
+ noPortalInformationMessage: string;
115
+ readMoreLabel: string;
116
+ learnAboutWebMapEmbeddingsLabel: string;
117
+ waitingForUserInputMessage: string;
96
118
  }>;
97
119
  /**
98
- * When `true`, disables the assistant avatar in the chat interface.
120
+ * When `true`, displays the assistant avatar in the chat interface.
99
121
  *
100
122
  * @default false
101
123
  * @since 5.1
@@ -310,6 +332,13 @@ export abstract class ArcgisAssistant extends LitElement {
310
332
  * ```
311
333
  */
312
334
  accessor suggestedPrompts: string[];
335
+ /**
336
+ * When `true`, displays the user avatar in the chat interface.
337
+ *
338
+ * @default false
339
+ * @since 5.2
340
+ */
341
+ accessor userAvatarEnabled: boolean;
313
342
  /**
314
343
  * Cancels the active interrupt, if one is pending.
315
344
  *
@@ -1,36 +1,36 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import { c as x } from "../../chunks/runtime.js";
3
3
  import { css as A, html as c } from "lit";
4
- import T from "@arcgis/core/core/Collection.js";
5
- import { whenOnce as L, watch as R, when as D } from "@arcgis/core/core/reactiveUtils.js";
6
- import O from "@arcgis/core/portal/Portal.js";
7
- import { LitElement as M, createEvent as g, nothing as k } from "@arcgis/lumina";
4
+ import L from "@arcgis/core/core/Collection.js";
5
+ import { whenOnce as T, watch as R, when as D } from "@arcgis/core/core/reactiveUtils.js";
6
+ import M from "@arcgis/core/portal/Portal.js";
7
+ import { LitElement as O, createEvent as p, nothing as f } from "@arcgis/lumina";
8
8
  import * as B from "@arcgis/toolkit/log";
9
9
  import { rethrowError as z } from "@arcgis/toolkit/log";
10
- import { createRef as y, ref as v } from "lit/directives/ref.js";
11
- import { u as N } from "../../chunks/useT9n.js";
12
- import { O as U } from "../../chunks/orchestrator.js";
10
+ import { createRef as v, ref as w } from "lit/directives/ref.js";
11
+ import { u as U } from "../../chunks/useT9n.js";
12
+ import { O as q } from "../../chunks/orchestrator.js";
13
13
  import "@langchain/core/callbacks/dispatch/web";
14
14
  import "@langchain/core/prompts";
15
15
  import "@langchain/openai";
16
16
  import "@arcgis/core/request.js";
17
- import V from "@arcgis/core/identity/IdentityManager.js";
17
+ import N from "@arcgis/core/identity/IdentityManager.js";
18
18
  import "@arcgis/toolkit/string";
19
19
  import "@arcgis/core/config.js";
20
20
  import "@langchain/core/messages";
21
21
  import "@arcgis/core/layers/FeatureLayer.js";
22
22
  import "../../chunks/generateLayerDescriptions.js";
23
23
  import "@langchain/langgraph/web";
24
- import j from "@arcgis/core/core/Accessor.js";
25
- import { property as m, subclass as q } from "@arcgis/core/core/accessorSupport/decorators.js";
24
+ import V from "@arcgis/core/core/Accessor.js";
25
+ import { property as m, subclass as F } from "@arcgis/core/core/accessorSupport/decorators.js";
26
26
  import { marked as E } from "marked";
27
- import { g as H } from "../../chunks/utils3.js";
28
- import { g as S } from "../../chunks/slottableRequestUtils.js";
29
- const F = A`:host{display:block;width:var(--arcgis-internal-panel-width, 100%);height:var(--arcgis-internal-expand-max-height, 100%);--calcite-panel-content-bottom-space: 0}.footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative;overflow:auto}.suggested-prompts-container{display:flex;justify-content:center;width:100%;background:var(--calcite-panel-background-color, var(--calcite-color-background))}.suggested-prompts{display:block;padding:var(--calcite-spacing-md);max-width:100%;box-sizing:border-box}.error-notice{padding:var(--calcite-spacing-sm)}.interrupt-waiting-message{font-style:italic;color:var(--calcite-color-text-2)}`;
30
- function w(o) {
27
+ import { g as j } from "../../chunks/utils2.js";
28
+ import { g as $ } from "../../chunks/slottableRequestUtils.js";
29
+ const H = A`:host{display:block;width:var(--arcgis-internal-panel-width, 100%);height:var(--arcgis-internal-expand-max-height, 100%);--calcite-panel-content-bottom-space: 0}.footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative;overflow:auto}.suggested-prompts-container{display:flex;justify-content:center;width:100%;background:var(--calcite-panel-background-color, var(--calcite-color-background))}.suggested-prompts{display:block;padding:var(--calcite-spacing-md);max-width:100%;box-sizing:border-box}.error-notice{padding:var(--calcite-spacing-sm)}.interrupt-waiting-message{font-style:italic;color:var(--calcite-color-text-2)}`;
30
+ function k(o) {
31
31
  return o.trim() ? E.lexer(o).filter((t) => t.type !== "space").map((t) => E.parser([t])) : [];
32
32
  }
33
- class I {
33
+ class C {
34
34
  constructor() {
35
35
  this._stableParts = [], this._stableText = "", this._rawText = "";
36
36
  }
@@ -42,11 +42,11 @@ class I {
42
42
  // Parse the remaining live tail. Call once at stream end.
43
43
  finalize() {
44
44
  const t = this._rawText.slice(this._stableText.length);
45
- return t.trim() && (this._stableParts.push(...w(t)), this._stableText = this._rawText), this._stableParts;
45
+ return t.trim() && (this._stableParts.push(...k(t)), this._stableText = this._rawText), this._stableParts;
46
46
  }
47
47
  // Get full output: stable segments + current live tail.
48
48
  getParts() {
49
- const t = this._trimIncompleteTail(this._rawText.slice(this._stableText.length)), s = t.trim() ? w(t) : [];
49
+ const t = this._trimIncompleteTail(this._rawText.slice(this._stableText.length)), s = t.trim() ? k(t) : [];
50
50
  return [...this._stableParts, ...s];
51
51
  }
52
52
  reset() {
@@ -57,8 +57,8 @@ class I {
57
57
  const t = this._rawText.slice(this._stableText.length), s = this._lastSafeBoundary(t);
58
58
  if (s <= 0)
59
59
  return;
60
- const i = t.slice(0, s);
61
- this._stableParts.push(...w(i)), this._stableText += i;
60
+ const r = t.slice(0, s);
61
+ this._stableParts.push(...k(r)), this._stableText += r;
62
62
  }
63
63
  /**
64
64
  * Find the last blank-line boundary that is outside code fences.
@@ -67,9 +67,9 @@ class I {
67
67
  _lastSafeBoundary(t) {
68
68
  const s = t.split(`
69
69
  `);
70
- let i = !1, e = 0, n = 0;
71
- for (const r of s)
72
- /^\s*(```|~~~)/u.test(r) && (i = !i), n += r.length + 1, r.trim() === "" && !i && (e = n);
70
+ let r = !1, e = 0, n = 0;
71
+ for (const i of s)
72
+ /^\s*(```|~~~)/u.test(i) && (r = !r), n += i.length + 1, i.trim() === "" && !r && (e = n);
73
73
  return e < t.length ? e : 0;
74
74
  }
75
75
  /**
@@ -83,9 +83,9 @@ class I {
83
83
  const s = t.lastIndexOf("<");
84
84
  if (s !== -1 && !t.includes(">", s))
85
85
  return t.slice(0, s);
86
- const i = this._earliestUnclosedTag(t);
87
- if (i !== -1)
88
- return t.slice(0, i);
86
+ const r = this._earliestUnclosedTag(t);
87
+ if (r !== -1)
88
+ return t.slice(0, r);
89
89
  const e = t.lastIndexOf("[");
90
90
  if (e !== -1) {
91
91
  const n = t.slice(e);
@@ -113,14 +113,14 @@ class I {
113
113
  "source",
114
114
  "track",
115
115
  "wbr"
116
- ]), i = /<(\/?)([a-zA-Z][\w-]*)\b[^>]*?(\/?)>/gu, e = [];
117
- for (let n = i.exec(t); n; n = i.exec(t)) {
118
- const [, r, a, l] = n, h = a.toLowerCase();
116
+ ]), r = /<(\/?)([a-zA-Z][\w-]*)\b[^>]*?(\/?)>/gu, e = [];
117
+ for (let n = r.exec(t); n; n = r.exec(t)) {
118
+ const [, i, a, l] = n, h = a.toLowerCase();
119
119
  if (!(s.has(h) || l === "/"))
120
- if (r === "/") {
121
- for (let p = e.length - 1; p >= 0; p--)
122
- if (e[p].name === h) {
123
- e.splice(p);
120
+ if (i === "/") {
121
+ for (let g = e.length - 1; g >= 0; g--)
122
+ if (e[g].name === h) {
123
+ e.splice(g);
124
124
  break;
125
125
  }
126
126
  } else
@@ -129,41 +129,41 @@ class I {
129
129
  return e.length ? e[0].index : -1;
130
130
  }
131
131
  }
132
- function G(o) {
133
- const t = new I();
132
+ function W(o) {
133
+ const t = new C();
134
134
  return t.push(o), t.finalize();
135
135
  }
136
- const W = async (o) => await new Promise((t) => setTimeout(t, o));
137
- async function* Y(o, { chunkSize: t = 15, delay: s = 50 } = {}) {
138
- const i = new I();
136
+ const G = async (o) => await new Promise((t) => setTimeout(t, o));
137
+ async function* Z(o, { chunkSize: t = 15, delay: s = 50 } = {}) {
138
+ const r = new C();
139
139
  for (let e = 0; e < o.length; e += t)
140
- yield i.push(o.slice(e, e + t)), await W(s);
141
- yield i.finalize();
140
+ yield r.push(o.slice(e, e + t)), await G(s);
141
+ yield r.finalize();
142
142
  }
143
- var Z = Object.defineProperty, J = Object.getOwnPropertyDescriptor, u = (o, t, s, i) => {
144
- for (var e = i > 1 ? void 0 : i ? J(t, s) : t, n = o.length - 1, r; n >= 0; n--)
145
- (r = o[n]) && (e = (i ? r(t, s, e) : r(e)) || e);
146
- return i && e && Z(t, s, e), e;
143
+ var J = Object.defineProperty, K = Object.getOwnPropertyDescriptor, u = (o, t, s, r) => {
144
+ for (var e = r > 1 ? void 0 : r ? K(t, s) : t, n = o.length - 1, i; n >= 0; n--)
145
+ (i = o[n]) && (e = (r ? i(t, s, e) : i(e)) || e);
146
+ return r && e && J(t, s, e), e;
147
147
  };
148
- const $ = (o) => !o || typeof o != "object" ? !1 : o.name === "AbortError";
149
- async function* C(o, t, s, i, e = !1) {
148
+ const S = (o) => !o || typeof o != "object" ? !1 : o.name === "AbortError";
149
+ async function* I(o, t, s, r, e = !1) {
150
150
  if (e) {
151
- if (i?.aborted) {
151
+ if (r?.aborted) {
152
152
  yield { type: "cancelled", log: s, runId: t };
153
153
  return;
154
154
  }
155
- yield { type: "block-data", blockType: "text", data: { parts: G(o) }, runId: t };
155
+ yield { type: "block-data", blockType: "text", data: { parts: W(o) }, runId: t };
156
156
  return;
157
157
  }
158
- for await (const n of Y(o)) {
159
- if (i?.aborted) {
158
+ for await (const n of Z(o)) {
159
+ if (r?.aborted) {
160
160
  yield { type: "cancelled", log: s, runId: t };
161
161
  return;
162
162
  }
163
163
  yield { type: "block-data", blockType: "text", data: { parts: n }, runId: t };
164
164
  }
165
165
  }
166
- let d = class extends j {
166
+ let d = class extends V {
167
167
  constructor(o) {
168
168
  super(o), this.view = null, this.streamingDisabled = !1, this.loading = !1, this.processing = !1, this.processingStep = "";
169
169
  }
@@ -179,9 +179,9 @@ let d = class extends j {
179
179
  this.orchestrator?.dispose(), super.destroy();
180
180
  }
181
181
  async _initialize() {
182
- this.removeHandles(), await Promise.all([this.portal.load(), this.view?.when()]), this.view && await L(() => !this.view.updating), this._set(
182
+ this.removeHandles(), await Promise.all([this.portal.load(), this.view?.when()]), this.view && await T(() => !this.view.updating), this._set(
183
183
  "orchestrator",
184
- await U.init({
184
+ await q.init({
185
185
  agents: [...this.agents],
186
186
  view: this.view ?? void 0
187
187
  })
@@ -202,61 +202,61 @@ let d = class extends j {
202
202
  throw new Error("Orchestrator not initialized yet.");
203
203
  this._set("processing", !0), this._set("processingStep", "");
204
204
  const s = [];
205
- let i, e = "pending";
205
+ let r, e = "pending";
206
206
  try {
207
207
  const n = this.orchestrator.ask(o);
208
- for await (const r of n)
209
- switch (e = r.runId, r.type) {
208
+ for await (const i of n)
209
+ switch (e = i.runId, i.type) {
210
210
  case "trace": {
211
- this._set("processingStep", r.data.text), s.push(r.data.text);
211
+ this._set("processingStep", i.data.text), s.push(i.data.text);
212
212
  break;
213
213
  }
214
214
  case "completed": {
215
215
  this._set("processing", !1), this._set("processingStep", "");
216
- const a = r.result, l = !!a.content.length, h = !!i?.length;
216
+ const a = i.result, l = !!a.content.length, h = !!r?.length;
217
217
  if (!l && !h) {
218
218
  yield { type: "completed", error: "No response received.", log: s, runId: e };
219
219
  return;
220
220
  }
221
- const p = a.content;
222
- if (yield { type: "block-start", blockType: "text", runId: e }, yield* C(p, e, s, t, this.streamingDisabled), yield { type: "block-end", blockType: "text", runId: e }, h)
223
- for (const f of i) {
221
+ const g = a.content;
222
+ if (yield { type: "block-start", blockType: "text", runId: e }, yield* I(g, e, s, t, this.streamingDisabled), yield { type: "block-end", blockType: "text", runId: e }, h)
223
+ for (const _ of r) {
224
224
  if (t?.aborted) {
225
225
  yield { type: "cancelled", log: s, runId: e };
226
226
  return;
227
227
  }
228
- const { type: b, data: _ } = f;
228
+ const { type: b, data: y } = _;
229
229
  if (yield { type: "block-start", blockType: b, runId: e }, b === "text") {
230
- const P = typeof _?.content == "string" ? _.content : "";
231
- yield* C(P, e, s, t, this.streamingDisabled);
230
+ const P = typeof y?.content == "string" ? y.content : "";
231
+ yield* I(P, e, s, t, this.streamingDisabled);
232
232
  } else
233
- yield { type: "block-data", blockType: b, data: _, runId: e };
233
+ yield { type: "block-data", blockType: b, data: y, runId: e };
234
234
  yield { type: "block-end", blockType: b, runId: e };
235
235
  }
236
- yield { type: "completed", response: p, blocks: i, log: s, runId: e };
236
+ yield { type: "completed", response: g, blocks: r, log: s, runId: e };
237
237
  return;
238
238
  }
239
239
  case "ux-suggestion": {
240
- const a = r.suggestion;
241
- i = i ? [...i, a] : [a];
240
+ const a = i.suggestion;
241
+ r = r ? [...r, a] : [a];
242
242
  break;
243
243
  }
244
244
  case "interrupt": {
245
- const { kind: a, message: l, metadata: h } = r.interrupt, p = Array.isArray(h) ? h.filter((b) => typeof b == "string") : [], f = (() => {
245
+ const { kind: a, message: l, metadata: h } = i.interrupt, g = Array.isArray(h) ? h.filter((b) => typeof b == "string") : [], _ = (() => {
246
246
  switch (a) {
247
247
  case "booleanChoice":
248
- return { type: "boolean-choice", message: l, options: p };
248
+ return { type: "boolean-choice", message: l, options: g };
249
249
  case "singleSelection":
250
- return { type: "single-select", message: l, options: p };
250
+ return { type: "single-select", message: l, options: g };
251
251
  case "multipleSelection":
252
- return { type: "multi-select", message: l, options: p };
252
+ return { type: "multi-select", message: l, options: g };
253
253
  case "textInput":
254
254
  return { type: "text-input", message: l };
255
255
  default:
256
- return { type: a, message: l, options: p };
256
+ return { type: a, message: l, options: g };
257
257
  }
258
258
  })();
259
- this._set("processingStep", "Waiting for user input..."), yield { type: "interrupt", payload: f, runId: e };
259
+ this._set("processingStep", "Waiting for user input..."), yield { type: "interrupt", payload: _, runId: e };
260
260
  break;
261
261
  }
262
262
  case "cancelled": {
@@ -264,20 +264,20 @@ let d = class extends j {
264
264
  return;
265
265
  }
266
266
  case "error": {
267
- if (t?.aborted || $(r.error)) {
267
+ if (t?.aborted || S(i.error)) {
268
268
  yield { type: "cancelled", log: s, runId: e };
269
269
  return;
270
270
  }
271
- yield { type: "completed", error: r.error.message, log: s, runId: e };
271
+ yield { type: "completed", error: i.error.message, log: s, runId: e };
272
272
  return;
273
273
  }
274
274
  default: {
275
- console.warn("Unknown event type:", r);
275
+ console.warn("Unknown event type:", i);
276
276
  break;
277
277
  }
278
278
  }
279
279
  } catch (n) {
280
- if (t?.aborted || $(n)) {
280
+ if (t?.aborted || S(n)) {
281
281
  yield { type: "cancelled", log: s, runId: e };
282
282
  return;
283
283
  }
@@ -316,12 +316,12 @@ u([
316
316
  m({ readOnly: !0 })
317
317
  ], d.prototype, "processingStep", 2);
318
318
  d = u([
319
- q("OrchestratorController")
319
+ F("OrchestratorController")
320
320
  ], d);
321
- const K = "Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.", Q = "Embeddings not found for this web map.", X = "https://developers.arcgis.com/javascript/latest/agentic-apps/ai-webmap-setup/#embeddings";
322
- class tt extends M {
321
+ const Q = "Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.", X = "Embeddings not found for this web map.", Y = "https://developers.arcgis.com/javascript/latest/agentic-apps/ai-webmap-setup/#embeddings";
322
+ class tt extends O {
323
323
  constructor() {
324
- super(...arguments), this._messages = N({ blocking: !0 }), this.#t = y(), this.#l = y(), this.#s = y(), this.#e = null, this.#r = /* @__PURE__ */ new Map(), this.#i = O.getDefault(), this.#a = (t) => {
324
+ super(...arguments), this._messages = U({ blocking: !0 }), this.#t = v(), this.#l = v(), this.#s = v(), this.#e = null, this.#i = /* @__PURE__ */ new Map(), this.#r = M.getDefault(), this.#a = (t) => {
325
325
  t.stopPropagation(), this.cancelInterrupt();
326
326
  }, this.#n = (t) => {
327
327
  t.stopPropagation();
@@ -337,57 +337,57 @@ class tt extends M {
337
337
  return;
338
338
  }
339
339
  this._orchestratorController?.cancel(), this.#e?.abort(), this.#e = null;
340
- }, this.#p = (t) => {
340
+ }, this.#g = (t) => {
341
341
  t.stopPropagation();
342
342
  const s = t.detail;
343
343
  this.arcgisFeedback.emit(s);
344
- }, this.#g = (t) => {
344
+ }, this.#p = (t) => {
345
345
  t.stopPropagation();
346
346
  const s = t.detail;
347
347
  this._inputValue = s.prompt, this.arcgisPromptSelect.emit(s);
348
348
  }, this.#d = (t) => {
349
349
  this.arcgisSlottableRequest.emit(t.detail);
350
- }, this._orchestratorController = null, this._interrupt = null, this._interruptDetails = [], this._error = null, this._inputValue = "", this._isAnswering = !1, this._canceling = !1, this.messages = new T([]), this.referenceElement = null, this.suggestedPrompts = [], this.feedbackEnabled = !1, this.keepSuggestedPrompts = !1, this.streamingDisabled = !1, this.logEnabled = !1, this.copyEnabled = !1, this.voiceInputEnabled = !1, this.readAloudEnabled = !1, this.assistantAvatarEnabled = !1, this.arcgisCancel = g(), this.arcgisError = g(), this.arcgisFeedback = g(), this.arcgisInterrupt = g(), this.arcgisInterruptCancel = g(), this.arcgisInterruptSubmit = g(), this.arcgisPromptSelect = g(), this.arcgisReady = g(), this.arcgisSubmit = g(), this.arcgisSlottableRequest = g({ bubbles: !1, composed: !1 }), this.arcgisResponse = g();
350
+ }, this._orchestratorController = null, this._interrupt = null, this._interruptDetails = [], this._error = null, this._inputValue = "", this._isAnswering = !1, this._canceling = !1, this.messages = new L([]), this.referenceElement = null, this.suggestedPrompts = [], this.feedbackEnabled = !1, this.keepSuggestedPrompts = !1, this.streamingDisabled = !1, this.logEnabled = !1, this.copyEnabled = !1, this.voiceInputEnabled = !1, this.readAloudEnabled = !1, this.assistantAvatarEnabled = !1, this.userAvatarEnabled = !1, this.arcgisCancel = p(), this.arcgisError = p(), this.arcgisFeedback = p(), this.arcgisInterrupt = p(), this.arcgisInterruptCancel = p(), this.arcgisInterruptSubmit = p(), this.arcgisPromptSelect = p(), this.arcgisReady = p(), this.arcgisSubmit = p(), this.arcgisSlottableRequest = p({ bubbles: !1, composed: !1 }), this.arcgisResponse = p();
351
351
  }
352
352
  static {
353
- this.properties = { _orchestratorController: 16, _interrupt: 16, _interruptDetails: 16, _error: 16, _inputValue: 16, _isAnswering: 16, _signedInUserId: 16, _canceling: 16, _isSignedIn: 16, _user: 16, awaitingResponse: 32, awaitingResponseStep: 32, interrupt: 32, messages: 0, orchestrator: 32, entryMessage: 1, heading: 1, description: 1, referenceElement: 1, suggestedPrompts: 0, feedbackEnabled: 5, keepSuggestedPrompts: 5, streamingDisabled: 5, logEnabled: 5, copyEnabled: 5, voiceInputEnabled: 5, readAloudEnabled: 5, assistantAvatarEnabled: 5 };
353
+ this.properties = { _orchestratorController: 16, _interrupt: 16, _interruptDetails: 16, _error: 16, _inputValue: 16, _isAnswering: 16, _signedInUserId: 16, _canceling: 16, _isSignedIn: 16, _user: 16, awaitingResponse: 32, awaitingResponseStep: 32, interrupt: 32, messages: 0, orchestrator: 32, entryMessage: 1, heading: 1, description: 1, referenceElement: 1, suggestedPrompts: 0, feedbackEnabled: 5, keepSuggestedPrompts: 5, streamingDisabled: 5, logEnabled: 5, copyEnabled: 5, voiceInputEnabled: 5, readAloudEnabled: 5, assistantAvatarEnabled: 5, userAvatarEnabled: 5 };
354
354
  }
355
355
  static {
356
- this.styles = F;
356
+ this.styles = H;
357
357
  }
358
358
  #t;
359
359
  #l;
360
360
  #s;
361
361
  #e;
362
- #r;
363
362
  #i;
363
+ #r;
364
364
  #a;
365
365
  #n;
366
366
  #c;
367
367
  #h;
368
- #p;
369
368
  #g;
369
+ #p;
370
370
  #d;
371
371
  async #o() {
372
372
  try {
373
- const t = H(this.el, this.referenceElement);
373
+ const t = j(this.el, this.referenceElement);
374
374
  await t?.componentOnReady();
375
- const s = [...this.#r.values()];
375
+ const s = [...this.#i.values()];
376
376
  return s.length ? (this._orchestratorController?.destroy(), this._orchestratorController = new d({
377
377
  agents: s,
378
- portal: this.#i,
378
+ portal: this.#r,
379
379
  streamingDisabled: this.streamingDisabled,
380
380
  view: t?.view
381
- }), await this._orchestratorController.load(), !0) : (this._error = "No agents found.", !1);
381
+ }), await this._orchestratorController.load(), this.requestUpdate(), !0) : (this._error = this._messages.noAgentsFoundMessage, !1);
382
382
  } catch (t) {
383
- return this._error = t?.message ?? "Error initializing orchestrator.", z(this)(t), !1;
383
+ return this._error = t?.message ?? this._messages.orchestratorInitializationErrorMessage, z(this)(t), !1;
384
384
  }
385
385
  }
386
386
  get _isSignedIn() {
387
- return !!this.#i?.user || !!this._signedInUserId;
387
+ return !!this.#r?.user || !!this._signedInUserId;
388
388
  }
389
389
  get _user() {
390
- return this.#i?.user?.fullName || this.#i?.user?.username;
390
+ return this.#r?.user?.fullName || this.#r?.user?.username;
391
391
  }
392
392
  get awaitingResponse() {
393
393
  return this._orchestratorController?.processing ?? !1;
@@ -408,10 +408,10 @@ class tt extends M {
408
408
  this.arcgisInterruptCancel.emit(), this.orchestrator?.cancelInterrupt(), this._interrupt = null;
409
409
  }
410
410
  register(t) {
411
- this.#r.set(t.agent.id, t), this._orchestratorController && this.#o();
411
+ this.#i.set(t.agent.id, t), this._orchestratorController && this.#o();
412
412
  }
413
413
  unregister(t) {
414
- this.#r.delete(t), this._orchestratorController && this.#o();
414
+ this.#i.delete(t), this._orchestratorController && this.#o();
415
415
  }
416
416
  async submitMessage(t) {
417
417
  const s = t.trim();
@@ -423,16 +423,16 @@ class tt extends M {
423
423
  }), !this._orchestratorController))
424
424
  return;
425
425
  this.#e = new AbortController(), this._orchestratorController.streamingDisabled = this.streamingDisabled;
426
- const i = this._orchestratorController.ask(s, this.#e?.signal);
427
- for await (const e of i) {
428
- const n = e.runId, r = this.messages.at(-1);
426
+ const r = this._orchestratorController.ask(s, this.#e?.signal);
427
+ for await (const e of r) {
428
+ const n = e.runId, i = this.messages.at(-1);
429
429
  switch (e.type) {
430
430
  case "block-start": {
431
431
  this._isAnswering = !0;
432
432
  const a = { type: e.blockType, isPending: !0 };
433
- if (r?.role === "assistant" && r.id === n) {
434
- const l = [...r.blocks ?? [], a];
435
- this.messages.splice(-1, 1, { ...r, blocks: l });
433
+ if (i?.role === "assistant" && i.id === n) {
434
+ const l = [...i.blocks ?? [], a];
435
+ this.messages.splice(-1, 1, { ...i, blocks: l });
436
436
  } else
437
437
  this.messages.push({
438
438
  role: "assistant",
@@ -444,28 +444,28 @@ class tt extends M {
444
444
  break;
445
445
  }
446
446
  case "block-data": {
447
- if (r?.role !== "assistant" || r?.id !== n)
447
+ if (i?.role !== "assistant" || i?.id !== n)
448
448
  break;
449
- const a = [...r.blocks ?? []], l = a[a.length - 1], { blockType: h, data: p } = e;
449
+ const a = [...i.blocks ?? []], l = a[a.length - 1], { blockType: h, data: g } = e;
450
450
  if (l?.type !== h || !l.isPending)
451
451
  break;
452
452
  h === "text" ? a[a.length - 1] = {
453
453
  ...l,
454
454
  data: {
455
455
  ...l.data,
456
- parts: p?.parts
456
+ parts: g?.parts
457
457
  }
458
- } : a[a.length - 1] = { ...l, data: { ...l.data, ...p ?? {} } }, this.messages.splice(-1, 1, { ...r, blocks: a });
458
+ } : a[a.length - 1] = { ...l, data: { ...l.data, ...g ?? {} } }, this.messages.splice(-1, 1, { ...i, blocks: a });
459
459
  break;
460
460
  }
461
461
  case "block-end": {
462
- if (r?.role !== "assistant" || r?.id !== n)
462
+ if (i?.role !== "assistant" || i?.id !== n)
463
463
  break;
464
- const a = [...r.blocks ?? []], l = a[a.length - 1];
464
+ const a = [...i.blocks ?? []], l = a[a.length - 1];
465
465
  if (l?.type !== e.blockType || !l.isPending)
466
466
  break;
467
467
  const h = l;
468
- a[a.length - 1] = { ...h, data: { ...h.data }, isPending: !1 }, this.messages.splice(-1, 1, { ...r, blocks: a });
468
+ a[a.length - 1] = { ...h, data: { ...h.data }, isPending: !1 }, this.messages.splice(-1, 1, { ...i, blocks: a });
469
469
  break;
470
470
  }
471
471
  case "completed":
@@ -475,10 +475,10 @@ class tt extends M {
475
475
  error: e.error,
476
476
  id: n,
477
477
  interrupts: this._interruptDetails
478
- }), this._interruptDetails = []) : r?.role === "assistant" && r.id === n && this.messages.splice(-1, 1, {
479
- ...r,
478
+ }), this._interruptDetails = []) : i?.role === "assistant" && i.id === n && this.messages.splice(-1, 1, {
479
+ ...i,
480
480
  content: e.response,
481
- blocks: r.blocks?.map((a) => ({ ...a, data: { ...a.data }, isPending: !1 })) ?? [],
481
+ blocks: i.blocks?.map((a) => ({ ...a, data: { ...a.data }, isPending: !1 })) ?? [],
482
482
  isStreaming: !1,
483
483
  log: e.log
484
484
  }), this._isAnswering = !1, this.#e = null, this._canceling = !1;
@@ -487,18 +487,16 @@ class tt extends M {
487
487
  this._interrupt = { ...e.payload, id: n }, this.arcgisInterrupt.emit(this._interrupt);
488
488
  break;
489
489
  case "cancelled":
490
- r?.role === "assistant" && r.id === n ? this.messages.splice(-1, 1, {
491
- ...r,
492
- blocks: r.blocks?.filter((a) => a.type === "text" || !a.isPending) ?? [],
490
+ i?.role === "assistant" && i.id === n ? this.messages.splice(-1, 1, {
491
+ ...i,
492
+ blocks: i.blocks?.filter((a) => a.type === "text" || !a.isPending) ?? [],
493
493
  isStreaming: !1,
494
494
  log: e.log,
495
- error: "(Stopped by user)"
496
- // TODO: use strings from t9n
495
+ error: `(${this._messages.stoppedByUserLabel})`
497
496
  }) : (this.messages.push({
498
497
  role: "assistant",
499
498
  log: e.log,
500
- error: "(Stopped by user)",
501
- // TODO: use strings from t9n
499
+ error: `(${this._messages.stoppedByUserLabel})`,
502
500
  id: n,
503
501
  interrupts: this._interruptDetails
504
502
  }), this._interruptDetails = []), this._isAnswering = !1, this.#e = null, this._canceling = !1;
@@ -514,20 +512,20 @@ class tt extends M {
514
512
  }
515
513
  loaded() {
516
514
  this.manager.onLifecycle(() => {
517
- this.#t.value?.addEventListener("arcgisPromptSelect", this.#g), this.#t.value?.addEventListener("arcgisSubmit", this.#c), this.#t.value?.addEventListener("arcgisCancel", this.#h), this.#t.value?.addEventListener("arcgisFeedback", this.#p);
515
+ this.#t.value?.addEventListener("arcgisPromptSelect", this.#p), this.#t.value?.addEventListener("arcgisSubmit", this.#c), this.#t.value?.addEventListener("arcgisCancel", this.#h), this.#t.value?.addEventListener("arcgisFeedback", this.#g);
518
516
  const t = D(() => !!this._interrupt && !!this.#s.value, () => {
519
- const i = this.#s.value;
520
- i.removeEventListener("arcgisSubmit", this.#n), i.removeEventListener("arcgisCancel", this.#a), i.addEventListener("arcgisSubmit", this.#n, { once: !0 }), i.addEventListener("arcgisCancel", this.#a, { once: !0 });
521
- }), s = this.messages.on("after-add", (i) => {
522
- const e = i.item;
517
+ const r = this.#s.value;
518
+ r.removeEventListener("arcgisSubmit", this.#n), r.removeEventListener("arcgisCancel", this.#a), r.addEventListener("arcgisSubmit", this.#n, { once: !0 }), r.addEventListener("arcgisCancel", this.#a, { once: !0 });
519
+ }), s = this.messages.on("after-add", (r) => {
520
+ const e = r.item;
523
521
  e.role === "assistant" && (e.error || e.content) && this.arcgisResponse.emit(e);
524
522
  });
525
523
  return queueMicrotask(() => {
526
- this.#o().then((i) => {
527
- i ? this.arcgisReady.emit() : this._error && this.arcgisError.emit(new Error(this._error));
524
+ this.#o().then((r) => {
525
+ r ? this.arcgisReady.emit() : this._error && this.arcgisError.emit(new Error(this._error));
528
526
  });
529
527
  }), () => {
530
- t.remove(), s.remove(), this.#t.value?.removeEventListener("arcgisPromptSelect", this.#g), this.#s.value?.removeEventListener("arcgisSubmit", this.#n), this.#s.value?.removeEventListener("arcgisCancel", this.#a), this.#t.value?.removeEventListener("arcgisSubmit", this.#c), this.#t.value?.removeEventListener("arcgisCancel", this.#h), this.#t.value?.removeEventListener("arcgisFeedback", this.#p), this._orchestratorController?.destroy(), this._orchestratorController = null;
528
+ t.remove(), s.remove(), this.#t.value?.removeEventListener("arcgisPromptSelect", this.#p), this.#s.value?.removeEventListener("arcgisSubmit", this.#n), this.#s.value?.removeEventListener("arcgisCancel", this.#a), this.#t.value?.removeEventListener("arcgisSubmit", this.#c), this.#t.value?.removeEventListener("arcgisCancel", this.#h), this.#t.value?.removeEventListener("arcgisFeedback", this.#g), this._orchestratorController?.destroy(), this._orchestratorController = null;
531
529
  };
532
530
  });
533
531
  }
@@ -538,21 +536,21 @@ class tt extends M {
538
536
  return this._isSignedIn ? this._error ? this._renderErrorNotice() : this.entryMessage ? this.messages.length > 0 ? null : c`<calcite-notice open kind=brand closable icon width=full><div slot=message>${this.entryMessage}</div></calcite-notice>` : c`<slot name=entry-message></slot>` : this._renderSignInNotice();
539
537
  }
540
538
  _renderSignInNotice() {
541
- const t = this.#i;
542
- return c`<calcite-notice slot=entry-message open kind=brand icon width=full><div slot=message>You need to sign in to use the assistant chat.</div>${t ? c`<calcite-link slot=link @click=${async () => {
539
+ const t = this.#r;
540
+ return c`<calcite-notice slot=entry-message open kind=brand icon width=full><div slot=message>${this._messages.signInRequiredMessage}</div>${t ? c`<calcite-link slot=link @click=${async () => {
543
541
  try {
544
- const s = await V.getCredential(`${t.url}/sharing`);
542
+ const s = await N.getCredential(`${t.url}/sharing`);
545
543
  this._signedInUserId = s.userId, this._error = null, this.requestUpdate(), await this.#o() ? this.arcgisReady.emit() : this._error && this.arcgisError.emit(new Error(this._error));
546
544
  } catch (s) {
547
- this._error = s?.message ?? "Error signing in.", this.arcgisError.emit(new Error(this._error)), B.log("error", this, "Error signing in:", { detail: { error: s } });
545
+ this._error = s?.message ?? this._messages.signInErrorMessage, this.arcgisError.emit(new Error(this._error)), B.log("error", this, "Error signing in:", { detail: { error: s } });
548
546
  }
549
- }} target=_blank title="Sign in to ArcGIS Online">Sign in</calcite-link>` : c`<div slot=link>No portal information available</div>`}</calcite-notice>`;
547
+ }} target=_blank title=${this._messages.signInToArcGISOnlineLabel ?? f}>${this._messages.signInLabel}</calcite-link>` : c`<div slot=link>${this._messages.noPortalInformationMessage}</div>`}</calcite-notice>`;
550
548
  }
551
549
  _renderErrorNotice() {
552
- return this._error ? c`<calcite-notice slot=entry-message open kind=brand icon width=full>${this._error === K ? c`<div slot=message>${Q}</div><calcite-link slot=link .href=${X} target=_blank title="Learn about web map embeddings">Read more</calcite-link>` : c`<div slot=message>${this._error}</div>`}</calcite-notice>` : null;
550
+ return this._error ? c`<calcite-notice slot=entry-message open kind=brand icon width=full>${this._error === Q ? c`<div slot=message>${X}</div><calcite-link slot=link .href=${Y} target=_blank title=${this._messages.learnAboutWebMapEmbeddingsLabel ?? f}>${this._messages.readMoreLabel}</calcite-link>` : c`<div slot=message>${this._error}</div>`}</calcite-notice>` : null;
553
551
  }
554
552
  render() {
555
- return c`<calcite-panel .loading=${!this._orchestratorController && !this._error || this._orchestratorController?.loading} .heading=${this.heading ?? this._messages.assistantLabel} .description=${this.description} ${v(this.#t)}><slot name=header-actions-start slot=header-actions-start></slot><slot name=header-actions-end slot=header-actions-end></slot><div class="content-container"><arcgis-assistant-chat .loading=${this.awaitingResponse} .messages=${this.messages} .interrupt=${this._interrupt}><slot name=message-starter slot=message-starter></slot><slot name=messages slot=messages>${this.messages.map((t) => t.role === "assistant" ? c`<arcgis-assistant-message .message=${t} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled} @arcgisSlottableRequest=${this.#d} .assistantAvatarEnabled=${this.assistantAvatarEnabled}>${t.blocks?.map((s, i) => c`<slot name=${S(t.id, i) ?? k} slot=${S(t.id, i) ?? k}><arcgis-assistant-message-block .block=${s}></arcgis-assistant-message-block></slot>`)}</arcgis-assistant-message>` : c`<arcgis-assistant-user-message .message=${t} .user=${this._user}></arcgis-assistant-user-message>`)}</slot>${this._interrupt ? c`<div slot=message-loading><div class="interrupt-waiting-message">waiting for user input...</div></div>` : c`<slot name=message-loading slot=message-loading><arcgis-assistant-message-loading .loading=${this.awaitingResponse} .loadingMessage=${this.awaitingResponseStep} .assistantAvatarEnabled=${this.assistantAvatarEnabled} .interrupts=${this._interruptDetails}></arcgis-assistant-message-loading></slot>`}</arcgis-assistant-chat></div>${this._interrupt ? c`<slot name=interrupt><arcgis-assistant-interrupt slot=content-bottom .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${v(this.#s)}></arcgis-assistant-interrupt></slot>` : this.suggestedPrompts?.length ? c`<div class="suggested-prompts-container" slot=content-bottom><arcgis-assistant-suggested-prompts class="suggested-prompts" .prompts=${this.suggestedPrompts}></arcgis-assistant-suggested-prompts></div>` : null}<div class="footer-container" slot=footer>${this._renderEntryMessage()}<slot name=chat-entry><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse || this._isAnswering} .inputValue=${this._inputValue} .messages=${this.messages} .voiceInputEnabled=${this.voiceInputEnabled} .disabled=${this._canceling || !this._isSignedIn || !!this._interrupt} ${v(this.#l)}><slot name=entry-actions-start slot=entry-actions-start></slot><slot name=entry-actions-end slot=entry-actions-end><calcite-button .iconStart=${this.awaitingResponse || this._isAnswering ? "circle-stop" : "send"} @click=${() => {
553
+ return c`<calcite-panel .loading=${!this._orchestratorController && !this._error || this._orchestratorController?.loading} .heading=${this.heading ?? this._messages.assistantLabel} .description=${this.description} ${w(this.#t)}><slot name=header-actions-start slot=header-actions-start></slot><slot name=header-actions-end slot=header-actions-end></slot><div class="content-container"><arcgis-assistant-chat .loading=${this.awaitingResponse} .messages=${this.messages} .interrupt=${this._interrupt}><slot name=message-starter slot=message-starter></slot><slot name=messages slot=messages>${this.messages.map((t) => t.role === "assistant" ? c`<arcgis-assistant-message .message=${t} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled} @arcgisSlottableRequest=${this.#d} .assistantAvatarEnabled=${this.assistantAvatarEnabled}>${t.blocks?.map((s, r) => c`<slot name=${$(t.id, r) ?? f} slot=${$(t.id, r) ?? f}><arcgis-assistant-message-block .block=${s}></arcgis-assistant-message-block></slot>`)}</arcgis-assistant-message>` : c`<arcgis-assistant-user-message .message=${t} .user=${this._user} .userAvatarEnabled=${this.userAvatarEnabled}></arcgis-assistant-user-message>`)}</slot>${this._interrupt ? c`<div slot=message-loading><div class="interrupt-waiting-message">${this._messages.waitingForUserInputMessage}</div></div>` : c`<slot name=message-loading slot=message-loading><arcgis-assistant-message-loading .loading=${this.awaitingResponse} .loadingMessage=${this.awaitingResponseStep} .assistantAvatarEnabled=${this.assistantAvatarEnabled} .interrupts=${this._interruptDetails}></arcgis-assistant-message-loading></slot>`}</arcgis-assistant-chat></div>${this._interrupt ? c`<slot name=interrupt><arcgis-assistant-interrupt slot=content-bottom .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${w(this.#s)}></arcgis-assistant-interrupt></slot>` : this.suggestedPrompts?.length ? c`<div class="suggested-prompts-container" slot=content-bottom><arcgis-assistant-suggested-prompts class="suggested-prompts" .prompts=${this.suggestedPrompts}></arcgis-assistant-suggested-prompts></div>` : null}<div class="footer-container" slot=footer>${this._renderEntryMessage()}<slot name=chat-entry><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse || this._isAnswering} .inputValue=${this._inputValue} .messages=${this.messages} .voiceInputEnabled=${this.voiceInputEnabled} .disabled=${this._canceling || !this._isSignedIn || !!this._interrupt} ${w(this.#l)}><slot name=entry-actions-start slot=entry-actions-start></slot><slot name=entry-actions-end slot=entry-actions-end><calcite-button .iconStart=${this.awaitingResponse || this._isAnswering ? "circle-stop" : "send"} @click=${() => {
556
554
  this.#l.value?.submitMessage();
557
555
  }} round>${this.awaitingResponse || this._isAnswering ? this._messages.stopButtonLabel : this._messages.askButtonLabel}</calcite-button></slot></arcgis-assistant-chat-entry></slot><slot name=footer-content></slot></div></calcite-panel>`;
558
556
  }