@esri/solutions-components 5.1.0-next.146 → 5.1.0-next.147

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 (103) hide show
  1. package/dist/cdn/{BQE6IVEF.js → 3A2YSBVB.js} +1 -1
  2. package/dist/cdn/{E6YCTW3S.js → 3MRR3HKE.js} +13 -13
  3. package/dist/cdn/{QKJJHBMB.js → 42GXADY4.js} +1 -1
  4. package/dist/cdn/{L3UI7EZZ.js → 4DAGSZIC.js} +1 -1
  5. package/dist/cdn/{ULUJKWT5.js → 4FRYNYQ6.js} +1 -1
  6. package/dist/cdn/{7CLM77HQ.js → 4SBOBTOR.js} +1 -1
  7. package/dist/cdn/{FAIQTEVJ.js → 4YCLQ3RW.js} +1 -1
  8. package/dist/cdn/{CVRBLJ5O.js → 5MPDXVRM.js} +1 -1
  9. package/dist/cdn/{7ADKNWWI.js → 6AUKNSKW.js} +1 -1
  10. package/dist/cdn/{RIHOGDUV.js → 6IUKH3E3.js} +1 -1
  11. package/dist/cdn/{FSWG7SUT.js → 6K3C5JX2.js} +1 -1
  12. package/dist/cdn/6VCG2ITQ.js +2 -0
  13. package/dist/cdn/{NOXANMDF.js → 757HAEJS.js} +1 -1
  14. package/dist/cdn/{P4XNRWG7.js → 7Q5BT35O.js} +1 -1
  15. package/dist/cdn/{4NZDPHHF.js → 7WYPODAB.js} +1 -1
  16. package/dist/cdn/AH3PJQ6A.js +2 -0
  17. package/dist/cdn/{463VANZI.js → BH42V5CR.js} +1 -1
  18. package/dist/cdn/DD2Y5NOB.js +2 -0
  19. package/dist/cdn/{J5K2SIY6.js → DMM5WA5Q.js} +3 -3
  20. package/dist/cdn/{UKQPYE7U.js → DQQTSOMQ.js} +1 -1
  21. package/dist/cdn/{Y4KGXRSD.js → FWLPMS4Q.js} +1 -1
  22. package/dist/cdn/{M4II4TSX.js → G3C6IL5Y.js} +1 -1
  23. package/dist/cdn/{3DCFUYKP.js → GG4IIHQE.js} +1 -1
  24. package/dist/cdn/{MHVLVLRA.js → HYQVSB6C.js} +1 -1
  25. package/dist/cdn/I46CXTVR.js +2 -0
  26. package/dist/cdn/IZSM7ZJK.js +2 -0
  27. package/dist/cdn/{MIH5YMTN.js → JMBANG5V.js} +1 -1
  28. package/dist/cdn/KETYOYXQ.js +2 -0
  29. package/dist/cdn/{GJD7AOUI.js → KH5WPLZK.js} +1 -1
  30. package/dist/cdn/{IDEOFV22.js → LTLR4VF3.js} +1 -1
  31. package/dist/cdn/NQH7ZZWD.js +2 -0
  32. package/dist/cdn/OANAQ6HY.js +2 -0
  33. package/dist/cdn/PQL3UL3P.js +2 -0
  34. package/dist/cdn/{L6P26BYB.js → Q2DJUFVO.js} +1 -1
  35. package/dist/cdn/{LCV5GKUD.js → Q35DDH7J.js} +123 -123
  36. package/dist/cdn/QDKHYQJB.js +2 -0
  37. package/dist/cdn/{FCJSMT5G.js → RMO244NW.js} +1 -1
  38. package/dist/cdn/RY6KZ77P.js +2 -0
  39. package/dist/cdn/{PBGG3TGN.js → RYBSWXQQ.js} +1 -1
  40. package/dist/cdn/{2UMMLVCR.js → SYQ5E5TV.js} +1 -1
  41. package/dist/cdn/UBEU6ULP.js +2 -0
  42. package/dist/cdn/{MPCJZCL5.js → UTZUXO5F.js} +2 -2
  43. package/dist/cdn/UXKH44PB.js +2 -0
  44. package/dist/cdn/{2PUK3PST.js → W7I22AW3.js} +1 -1
  45. package/dist/cdn/{RUQ4RO4T.js → WUEJANIZ.js} +1 -1
  46. package/dist/cdn/{XGYNSCTA.js → Y37QLEAM.js} +1 -1
  47. package/dist/cdn/{O6ZQYZKL.js → YFJZN5K5.js} +1 -1
  48. package/dist/cdn/{6T35OGRG.js → YTU2BYBP.js} +1 -1
  49. package/dist/cdn/{5LF6C3S5.js → YWALGZAG.js} +1 -1
  50. package/dist/cdn/{F26SXWZ5.js → ZNH7LRND.js} +1 -1
  51. package/dist/cdn/{BMMIXOTR.js → ZWQWBXHR.js} +1 -1
  52. package/dist/cdn/index.js +1 -1
  53. package/dist/chunks/Auth.js +1 -1
  54. package/dist/chunks/deployFlowController.js +1 -1
  55. package/dist/chunks/helpers.js +47 -43
  56. package/dist/chunks/interfaces.js +105 -102
  57. package/dist/chunks/solution-builder-assistant.js +185 -121
  58. package/dist/chunks/solution-deploy-dialog.js +4 -4
  59. package/dist/chunks/solutions-deploy-app-nav.js +2 -2
  60. package/dist/components/arcgis-solutions-assistant/customElement.js +114 -97
  61. package/dist/components/arcgis-solutions-assistant/index.js +1 -0
  62. package/dist/components/card-manager/customElement.js +8 -8
  63. package/dist/components/create-feature/customElement.js +107 -113
  64. package/dist/components/crowdsource-reporter/customElement.js +1 -1
  65. package/dist/components/layer-table/customElement.d.ts +3 -0
  66. package/dist/components/layer-table/customElement.js +110 -100
  67. package/dist/components/solution-configure-titles/customElement.js +11 -10
  68. package/dist/components/solution-delete-dialog/customElement.js +9 -8
  69. package/dist/components/solution-deploy-dialog/customElement.d.ts +6 -2
  70. package/dist/components/solution-deployed-card-panel/customElement.js +41 -38
  71. package/dist/components/solution-details-card/customElement.js +1 -1
  72. package/dist/components/solution-details-panel/customElement.js +78 -64
  73. package/dist/components/solution-resource-card/customElement.js +1 -1
  74. package/dist/components/solution-snapshot-gallery/customElement.js +1 -1
  75. package/dist/components/solutions-all-panel/customElement.js +1 -1
  76. package/dist/components/solutions-deploy-app/customElement.js +9 -11
  77. package/dist/components/solutions-deployed-panel/customElement.js +7 -7
  78. package/dist/components/solutions-deployed-shell/customElement.js +1 -1
  79. package/dist/components/solutions-filter-panel/customElement.js +1 -1
  80. package/dist/components/solutions-searchsort-toolbar/customElement.js +1 -1
  81. package/dist/docs/api.json +1 -1
  82. package/dist/docs/docs.json +1 -1
  83. package/dist/docs/vscode.html-custom-data.json +1 -1
  84. package/dist/docs/web-types.json +1 -1
  85. package/dist/solutions-components_commit.txt +6 -6
  86. package/dist/types/lumina.d.ts +1 -0
  87. package/dist/types/preact.d.ts +1 -0
  88. package/dist/types/react.d.ts +1 -0
  89. package/dist/types/stencil.d.ts +1 -0
  90. package/package.json +1 -1
  91. package/dist/cdn/3JQ2RXVJ.js +0 -2
  92. package/dist/cdn/54AE7WD2.js +0 -2
  93. package/dist/cdn/7WD3GNG4.js +0 -2
  94. package/dist/cdn/D3XPV5W4.js +0 -2
  95. package/dist/cdn/KDNGZ47C.js +0 -2
  96. package/dist/cdn/KIPRPYME.js +0 -2
  97. package/dist/cdn/PBMTIFFX.js +0 -2
  98. package/dist/cdn/PECGJO2P.js +0 -2
  99. package/dist/cdn/QGCF64WY.js +0 -2
  100. package/dist/cdn/Z3B5KW2S.js +0 -2
  101. package/dist/cdn/ZM27FRZG.js +0 -2
  102. package/dist/cdn/ZUPXKH75.js +0 -2
  103. package/dist/cdn/ZYLKUZID.js +0 -2
@@ -8,7 +8,7 @@ import { createLongId as C, UserSession as $, getItemBase as O, getProp as D } f
8
8
  import { C as E } from "./converter.js";
9
9
  import { c as x } from "./deployAppContexts.js";
10
10
  import { deploySolution as A } from "@esri/solution-deployer";
11
- import { a as U, i as T, p as F } from "./helpers.js";
11
+ import { a as U, i as T, q as F } from "./helpers.js";
12
12
  import { a as P, c as I } from "./validators.js";
13
13
  import { createRef as u, ref as p } from "lit/directives/ref.js";
14
14
  const V = R`*[tabindex]:focus-visible{outline:2px solid var(--calcite-color-brand);outline-offset:2px}.error-icon-color{--calcite-icon-color: var(--calcite-color-status-danger)}.outline{--calcite-block-border-color: var(--calcite-color-border-2);border:1px solid var(--calcite-color-border-input)}.space-around{margin:.5rem}.title-label{--calcite-label-margin-bottom: 1rem;font-weight:var(--calcite-font-weight-medium)}.padding-around{padding:1rem}.padding-top{padding-top:.5rem}.hidden{display:none}`, _ = "", m = "AzMGxyZ9AveCc5IZ", f = "dev", g = !1, b = "https://devext.arcgis.com", w = "9133940fea834c6fa8cd055d7e3d4802", j = {
@@ -41,8 +41,8 @@ class M extends v {
41
41
  static {
42
42
  this.styles = V;
43
43
  }
44
- close() {
45
- this._isFormValid = !0, this._showAlertNameError = !1, this._showAlertFailed = !1, this._solutionTitle = this._tempUniqueTitle, this.open = !1, this.deployCancelled.emit();
44
+ close(e = !0) {
45
+ this._isFormValid = !0, this._showAlertNameError = !1, this._showAlertFailed = !1, this._solutionTitle = this._tempUniqueTitle, this.open = !1, e && this.deployCancelled.emit();
46
46
  }
47
47
  closeAlert() {
48
48
  this._showAlertFailed = !1;
@@ -83,7 +83,7 @@ class M extends v {
83
83
  (t || o) && this._configContextConsumer.value?.authentication?.IsSignedIn && this._generateSolutionName(this._solutionTitle.trim()), (e.has("userOptions") || e.has("open")) && (await this._checkUserOptionState(), this._hasSpatialReferenceOption && this._wkid === "" && (this._isFormValid = !1));
84
84
  }
85
85
  render() {
86
- return this.open ? l`<calcite-dialog .heading=${this._translations.title.replace("{{solutionTitle}}", this.card?.title ?? "")} id=${this._translations.title.replace("{{solutionTitle}}", this.card?.title ?? "") ?? S} modal open outside-close-disabled @calciteDialogClose=${this.close} width=m><div class="space-around">${this.renderUpdateSolutionName()}${this.renderSpatialReferenceSelection()}</div><calcite-button appearance=outline @click=${this.close} slot=footer-end>${this._translations.cancel}</calcite-button>${this._isFormValid ? l`<calcite-button kind=brand @click=${this.deploy} slot=footer-end>${this._translations.deploy}</calcite-button>` : l`<calcite-button kind=brand slot=footer-end disabled>${this._translations.deploy}</calcite-button>`}<calcite-alert auto-close icon=exclamation-mark-triangle kind=danger .label=${this._translations.failedToDeploy.replace("{{solutionTitle}}", this.card.title)} @calciteAlertClose=${() => {
86
+ return this.open ? l`<calcite-dialog .heading=${this._translations.title.replace("{{solutionTitle}}", this.card?.title ?? "")} id=${this._translations.title.replace("{{solutionTitle}}", this.card?.title ?? "") ?? S} modal open outside-close-disabled @calciteDialogClose=${() => this.close()} width=m><div class="space-around">${this.renderUpdateSolutionName()}${this.renderSpatialReferenceSelection()}</div><calcite-button appearance=outline @click=${() => this.close()} slot=footer-end>${this._translations.cancel}</calcite-button>${this._isFormValid ? l`<calcite-button kind=brand @click=${this.deploy} slot=footer-end>${this._translations.deploy}</calcite-button>` : l`<calcite-button kind=brand slot=footer-end disabled>${this._translations.deploy}</calcite-button>`}<calcite-alert auto-close icon=exclamation-mark-triangle kind=danger .label=${this._translations.failedToDeploy.replace("{{solutionTitle}}", this.card.title)} @calciteAlertClose=${() => {
87
87
  this._showAlertFailed = !1;
88
88
  }} .open=${this._showAlertFailed} ${p(this._failedAlertRef)}><div slot=title>${this._translations.failedToDeploy.replace("{{solutionTitle}}", this.card.title)}</div></calcite-alert></calcite-dialog>` : "";
89
89
  }
@@ -4,13 +4,13 @@ import { u as f } from "./useT9n.js";
4
4
  import { LitElement as y, createEvent as p, safeClassMap as w, nothing as h } from "@arcgis/lumina";
5
5
  import { css as M, html as a, svg as C } from "lit";
6
6
  import { A as S } from "./Auth.js";
7
- import { q as k, k as c } from "./helpers.js";
7
+ import { u as k, l as c } from "./helpers.js";
8
8
  import { T as _, A as $ } from "./interfaces.js";
9
9
  import { createRef as o, ref as l } from "lit-html/directives/ref.js";
10
10
  import { UserSession as E } from "@esri/solution-common";
11
11
  const T = M`.esri-global-nav__title{margin-block-start:0;position:relative;margin-bottom:0;font-size:var(--calcite-font-size-xl);font-weight:var(--calcite-font-weight-medium);padding-inline-end:var(--calcite-spacing-xxl);align-self:center;height:100%;display:flex;align-items:center}.esri-global-nav__logo-link{color:var(--calcite-color-text-1);text-decoration:unset;margin-block-start:0px;position:relative;margin-bottom:0;align-self:center;height:100%;display:flex;align-items:center}.esri-global-nav__logo-link:focus{outline:2px solid var(--calcite-color-brand);outline-offset:-2px}.cursor-pointer{cursor:pointer}.side{border-right:solid 1px;color:var(--calcite-color-text-1);height:34px;align-self:center}.display-flex{display:flex}.align-self-center{align-self:center}.padding-top-1{padding-top:var(--calcite-spacing-lg)}.padding-end-1{padding-inline-end:var(--calcite-spacing-lg)}.padding-start-1{padding-inline-start:var(--calcite-spacing-lg)}.padding-bottom-1{padding-bottom:var(--calcite-spacing-lg)}.margin-start-end-1{margin-inline-start:var(--calcite-spacing-lg);margin-inline-end:var(--calcite-spacing-lg)}.margin-start-end-1-5{margin-inline-start:var(--calcite-spacing-xxl);margin-inline-end:var(--calcite-spacing-xxl)}.height-full{height:100%}.user-label{--calcite-label-margin-bottom: 0px}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-normal{font-weight:var(--calcite-font-weight-normal)}.logo-padding{padding-inline-start:var(--calcite-spacing-none);height:100%}@media(max-width:800px){.logo-padding{padding-inline-start:var(--calcite-spacing-lg)}}.signin-padding{padding-inline-end:var(--calcite-spacing-none)}@media(max-width:800px){.signin-padding{padding-inline-end:var(--calcite-spacing-lg)}}calcite-action{--calcite-font-size-0: var(--calcite-font-size--1);--calcite-internal-action-padding-inline: var(--calcite-spacing-lg)}calcite-navigation{--calcite-color-border-3: transparent}.border-bottom{border-bottom-color:var(--calcite-color-border-1);border-bottom-width:var(--calcite-spacing-px);border-bottom-style:solid}.border{height:var(--calcite-spacing-px);border-bottom-color:var(--calcite-color-border-2);border-bottom-style:solid;border-bottom-width:var(--calcite-border-width-sm);box-sizing:border-box;position:absolute;top:65px;left:0;width:100%;z-index:1}.height-66{height:66px}.sub-nav-constrained{width:calc(100% - var(--assistant-panel-width, 420px));overflow:hidden}`, u = {
12
12
  name: "arcgis-solutions-app",
13
- version: "2.0",
13
+ version: "2.1",
14
14
  dev: {
15
15
  amazon: {
16
16
  userPoolID: "us-east-1:7345bcf2-bffa-4849-a379-a83178f63eef",
@@ -2,19 +2,19 @@
2
2
  import { c as _e } from "../../chunks/runtime.js";
3
3
  import { u as Te } from "../../chunks/useT9n.js";
4
4
  import { LitElement as ke, createEvent as X, nothing as Z } from "@arcgis/lumina";
5
- import { css as Ee, html as E } from "lit";
5
+ import { css as Ee, html as I } from "lit";
6
6
  import { unsafeHTML as Ae } from "lit/directives/unsafe-html.js";
7
7
  import { useContextConsumer as ee } from "@arcgis/lumina/context";
8
8
  import { c as Le, b as Re } from "../../chunks/deployAppContexts.js";
9
9
  import { T as De } from "../../chunks/interfaces.js";
10
- import { l as Fe } from "../../chunks/helpers.js";
10
+ import { m as Fe } from "../../chunks/helpers.js";
11
11
  import te from "@arcgis/core/config.js";
12
12
  import { createRef as $e, ref as Me } from "lit-html/directives/ref.js";
13
- import { Annotation as b, StateGraph as O, START as z, END as v, NodeInterrupt as ne } from "@langchain/langgraph/web";
14
- import { createAgentRuntimeState as j, sendTraceMessage as w, invokeStructuredPrompt as _, getEmbeddings as Be, cosineSimilarity as Ne, invokeTextPrompt as qe } from "@arcgis/ai-orchestrator";
13
+ import { Annotation as b, StateGraph as O, START as z, END as x, NodeInterrupt as ne } from "@langchain/langgraph/web";
14
+ import { createAgentRuntimeState as j, sendTraceMessage as w, invokeStructuredPrompt as T, getEmbeddings as Be, cosineSimilarity as Ne, invokeTextPrompt as Pe } from "@arcgis/ai-orchestrator";
15
15
  import r, { z as D } from "zod";
16
16
  import * as J from "@esri/arcgis-rest-portal";
17
- import { applyPatch as Pe } from "fast-json-patch";
17
+ import { applyPatch as qe } from "fast-json-patch";
18
18
  import "@langchain/core/messages";
19
19
  import { C as ie } from "../../chunks/converter.js";
20
20
  import { t as oe, g as B, c as ae, r as re, d as L } from "../../chunks/templates.js";
@@ -133,7 +133,7 @@ const He = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
133
133
  reducer: (t, e) => e ?? t,
134
134
  default: () => null
135
135
  })
136
- }), Ke = () => new O(We).addNode("initializeAgent", Ye).addNode("askSolutionsQuestions", Qe).addEdge(z, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions", v), ue = async (t, e, s, n) => {
136
+ }), Ke = () => new O(We).addNode("initializeAgent", Ye).addNode("askSolutionsQuestions", Qe).addEdge(z, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions", x), ue = async (t, e, s, n) => {
137
137
  if (!t) return;
138
138
  const i = de(t);
139
139
  if (!i) return;
@@ -188,7 +188,7 @@ const He = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
188
188
  l = A.source, i = [
189
189
  ...i,
190
190
  ...A.allMatches.filter(
191
- (T) => !i.some((k) => k.solution.id === T.solution.id)
191
+ (k) => !i.some((E) => E.solution.id === k.solution.id)
192
192
  )
193
193
  ];
194
194
  }
@@ -549,7 +549,7 @@ const ot = r.object({
549
549
  promptModules: o
550
550
  } = t;
551
551
  try {
552
- return (await _({
552
+ return (await T({
553
553
  promptText: await y(o, "explainValidationFailure"),
554
554
  modelTier: "fast",
555
555
  temperature: 0,
@@ -567,9 +567,9 @@ const ot = r.object({
567
567
  { error: a }
568
568
  ), i;
569
569
  }
570
- }, V = (t) => t in L, yt = 5, xt = 0.8, vt = 0.15, wt = "Web Mapping Application", St = "Embeddings";
571
- let F = null, P = null, $ = null, M = null;
572
- const It = "Build", I = /* @__PURE__ */ Object.assign({
570
+ }, V = (t) => t in L, yt = 5, vt = 0.8, xt = 0.15, wt = "Web Mapping Application", St = "Embeddings";
571
+ let F = null, q = null, $ = null, M = null;
572
+ const It = "Build", C = /* @__PURE__ */ Object.assign({
573
573
  "./prompts/assessBuildRequest.md": () => import("../../chunks/assessBuildRequest.js").then((t) => t.default),
574
574
  "./prompts/assessUpdateRequest.md": () => import("../../chunks/assessUpdateRequest.js").then((t) => t.default),
575
575
  "./prompts/description.md": () => import("../../chunks/description2.js").then((t) => t.default),
@@ -622,7 +622,7 @@ const kt = async (t, e, s) => {
622
622
  } catch {
623
623
  return null;
624
624
  }
625
- }, C = (t, e = {}) => {
625
+ }, _ = (t, e = {}) => {
626
626
  let s = t;
627
627
  return "itemId" in e && (s = {
628
628
  ...s,
@@ -653,8 +653,8 @@ const kt = async (t, e, s) => {
653
653
  };
654
654
  }
655
655
  }, H = async (t) => {
656
- if (P) {
657
- Object.entries(P).forEach(([a, l]) => {
656
+ if (q) {
657
+ Object.entries(q).forEach(([a, l]) => {
658
658
  L[a] && (L[a].initialTemplate = l);
659
659
  });
660
660
  return;
@@ -681,7 +681,7 @@ const kt = async (t, e, s) => {
681
681
  ...l,
682
682
  buildSolution: m
683
683
  };
684
- o[u] = C(
684
+ o[u] = _(
685
685
  new ie(d).dumpToLlmTemplate(),
686
686
  {
687
687
  itemId: a.id,
@@ -692,7 +692,7 @@ const kt = async (t, e, s) => {
692
692
  ...l,
693
693
  initialTemplate: o[u]
694
694
  };
695
- })), P = o;
695
+ })), q = o;
696
696
  }, fe = (t) => {
697
697
  const e = t?.configurable?.context?.token;
698
698
  return typeof e != "string" || !e.trim() ? null : e;
@@ -705,16 +705,16 @@ const kt = async (t, e, s) => {
705
705
  return `${e.replace(/\/+$/, "")}/sharing/rest`;
706
706
  }, At = async (t) => {
707
707
  await Promise.all([
708
- ve(t),
708
+ xe(t),
709
709
  H(t)
710
710
  ]);
711
- }, xe = async (t) => {
711
+ }, ve = async (t) => {
712
712
  const e = fe(t);
713
713
  (!$ || e && e !== M) && (M = e ?? M, $ = At(t).catch((n) => {
714
714
  throw $ = null, M = null, n;
715
715
  })), await $;
716
716
  };
717
- async function ve(t) {
717
+ async function xe(t) {
718
718
  if (F) return F;
719
719
  const e = be(t);
720
720
  if (!e)
@@ -733,14 +733,14 @@ Description: ${e.description}`).join(`
733
733
  if (typeof e != "string" || !e.trim())
734
734
  return null;
735
735
  try {
736
- const s = JSON.parse(e), n = C(
736
+ const s = JSON.parse(e), n = _(
737
737
  { response: "", ...s },
738
738
  { itemId: s?.solution?.itemId ?? null }
739
739
  ), i = G.safeParse(n);
740
740
  if (!i.success)
741
741
  return null;
742
742
  const { response: o, ...a } = i.data, l = s.templateId, u = typeof l == "string" && V(l) ? l : null;
743
- return C(
743
+ return _(
744
744
  a,
745
745
  {
746
746
  sourceBuildSolution: s.sourceBuildSolution,
@@ -792,9 +792,9 @@ Description: ${e.description}`).join(`
792
792
  const s = Rt(e), n = s?.templateId ?? null, i = {};
793
793
  return JSON.stringify(t.currentDesign) !== JSON.stringify(s) && (i.currentDesign = s), n && t.selectedTemplate !== n && (i.selectedTemplate = n), i;
794
794
  }, $t = async (t, e) => {
795
- await w({ text: h("understandingRequest", e) }, e), await xe(e);
796
- const s = t.agentExecutionContext.userRequest, n = Lt(), i = t.agentExecutionContext.messages.slice(-11), o = await _({
797
- promptText: await y(I, "assessBuildRequest"),
795
+ await w({ text: h("understandingRequest", e) }, e), await ve(e);
796
+ const s = t.agentExecutionContext.userRequest, n = Lt(), i = t.agentExecutionContext.messages.slice(-11), o = await T({
797
+ promptText: await y(C, "assessBuildRequest"),
798
798
  modelTier: "advanced",
799
799
  temperature: 0,
800
800
  schema: ht,
@@ -805,7 +805,7 @@ Description: ${e.description}`).join(`
805
805
  ), l = {
806
806
  ...o,
807
807
  matchedTemplates: a
808
- }, [u, c] = a, f = !!u && u.confidence >= xt && (c === void 0 || u.confidence - c.confidence >= vt) ? u.templateId : null;
808
+ }, [u, c] = a, f = !!u && u.confidence >= vt && (c === void 0 || u.confidence - c.confidence >= xt) ? u.templateId : null;
809
809
  return {
810
810
  assessment: l,
811
811
  selectedTemplate: f,
@@ -831,8 +831,8 @@ Description: ${e.description}`).join(`
831
831
  await w({ text: h("understandingRequest", e) }, e);
832
832
  const n = t.agentExecutionContext.userRequest, i = t.agentExecutionContext.messages.slice(-11);
833
833
  return {
834
- updateAssessment: await _({
835
- promptText: await y(I, "assessUpdateRequest"),
834
+ updateAssessment: await T({
835
+ promptText: await y(C, "assessUpdateRequest"),
836
836
  modelTier: "advanced",
837
837
  temperature: 0,
838
838
  schema: pt,
@@ -850,7 +850,7 @@ Description: ${e.description}`).join(`
850
850
  summary: s,
851
851
  status: "success"
852
852
  };
853
- }, qt = (t, e) => {
853
+ }, Pt = (t, e) => {
854
854
  const { hitlResponse: s } = e.configurable, n = "selectTemplate", i = t.assessment?.matchedTemplates.filter(
855
855
  (c) => V(c.templateId)
856
856
  ) ?? [], o = i.map((c) => `${c.templateDescription}`);
@@ -868,9 +868,9 @@ Description: ${e.description}`).join(`
868
868
  return {
869
869
  selectedTemplate: (l >= 0 ? i[l] : void 0)?.templateId ?? i[0]?.templateId ?? null
870
870
  };
871
- }, Pt = async (t, e) => {
871
+ }, qt = async (t, e) => {
872
872
  await w({ text: h("searchingExistingSolutions", e) }, e);
873
- const s = t.agentExecutionContext.userRequest, n = tt(t.agentExecutionContext.messages) || s, i = await ve(e);
873
+ const s = t.agentExecutionContext.userRequest, n = tt(t.agentExecutionContext.messages) || s, i = await xe(e);
874
874
  if (!i)
875
875
  return console.warn("Solutions Search: failed to load solution embeddings cache; skipping search."), { existingMatches: [] };
876
876
  if (!i.length)
@@ -888,8 +888,8 @@ Snippet: ${d.snippet}
888
888
  Description: ${d.description}`).join(`
889
889
 
890
890
  `), c = t.agentExecutionContext.messages.slice(-11);
891
- return { existingMatches: (await _({
892
- promptText: await y(I, "findExistingSolution"),
891
+ return { existingMatches: (await T({
892
+ promptText: await y(C, "findExistingSolution"),
893
893
  modelTier: "fast",
894
894
  temperature: 0,
895
895
  schema: mt,
@@ -922,21 +922,21 @@ Description: ${d.description}`).join(`
922
922
  status: "success"
923
923
  };
924
924
  }, we = async (t, e) => {
925
- await xe(e);
925
+ await ve(e);
926
926
  const { currentDesign: s } = t, n = t.agentExecutionContext.userRequest;
927
927
  await w({ text: h("creatingDesign", e) }, e);
928
928
  let i = B(t.selectedTemplate);
929
929
  if (i?.initialTemplate || (await H(e), i = B(t.selectedTemplate)), !i?.initialTemplate)
930
930
  throw new Error("No hydrated templates are available for solution design.");
931
- const o = C(
931
+ const o = _(
932
932
  s ?? i.initialTemplate,
933
933
  {
934
934
  itemId: (s ?? i.initialTemplate)?.solution?.itemId ?? null,
935
935
  sourceBuildSolution: s?.sourceBuildSolution ?? i.initialTemplate.sourceBuildSolution,
936
936
  params: s?.params ?? i.initialTemplate.params ?? null
937
937
  }
938
- ), a = t.agentExecutionContext.messages.slice(-11), l = await _({
939
- promptText: await y(I, "designSolution"),
938
+ ), a = t.agentExecutionContext.messages.slice(-11), l = await T({
939
+ promptText: await y(C, "designSolution"),
940
940
  modelTier: "advanced",
941
941
  temperature: 0,
942
942
  schema: G,
@@ -949,7 +949,7 @@ Description: ${d.description}`).join(`
949
949
  }), { response: u, featureLayer: c, ...m } = l, f = re(
950
950
  c,
951
951
  o.featureLayer
952
- ), d = C(
952
+ ), d = _(
953
953
  { ...m, featureLayer: f },
954
954
  {
955
955
  itemId: o?.solution?.itemId,
@@ -965,16 +965,16 @@ Description: ${d.description}`).join(`
965
965
  ), {
966
966
  outputMessage: h("createDesignFailed", e)
967
967
  };
968
- const A = d.sourceBuildSolution, T = he(d, A);
969
- if (!T.ok) {
968
+ const A = d.sourceBuildSolution, k = he(d, A);
969
+ if (!k.ok) {
970
970
  console.warn(
971
971
  "[SolutionBuilder] designSolution Esri JSON conversion failed:",
972
- { error: T.error, llmResponse: l, design: d }
972
+ { error: k.error, llmResponse: l, design: d }
973
973
  );
974
- const k = h("createDesignFailed", e);
974
+ const E = h("createDesignFailed", e);
975
975
  return {
976
- outputMessage: k,
977
- summary: k,
976
+ outputMessage: E,
977
+ summary: E,
978
978
  status: "success"
979
979
  };
980
980
  }
@@ -992,8 +992,8 @@ Description: ${d.description}`).join(`
992
992
  await w({ text: h("updatingDesign", e) }, e);
993
993
  let o;
994
994
  try {
995
- o = await _({
996
- promptText: await y(I, "updateDesign"),
995
+ o = await T({
996
+ promptText: await y(C, "updateDesign"),
997
997
  modelTier: "advanced",
998
998
  temperature: 0,
999
999
  schema: dt,
@@ -1005,10 +1005,10 @@ Description: ${d.description}`).join(`
1005
1005
  });
1006
1006
  } catch (p) {
1007
1007
  console.warn("[SolutionBuilder] updateDesign structured prompt failed:", p);
1008
- const x = h("applyChangeFailed", e);
1008
+ const v = h("applyChangeFailed", e);
1009
1009
  return {
1010
- outputMessage: x,
1011
- summary: x,
1010
+ outputMessage: v,
1011
+ summary: v,
1012
1012
  status: "success"
1013
1013
  };
1014
1014
  }
@@ -1023,7 +1023,7 @@ Description: ${d.description}`).join(`
1023
1023
  try {
1024
1024
  return JSON.parse(p);
1025
1025
  } catch {
1026
- const x = p.replace(/[\u0000-\u001F]/g, (Y) => {
1026
+ const v = p.replace(/[\u0000-\u001F]/g, (Y) => {
1027
1027
  switch (Y) {
1028
1028
  case "\b":
1029
1029
  return "\\b";
@@ -1041,7 +1041,7 @@ Description: ${d.description}`).join(`
1041
1041
  }
1042
1042
  });
1043
1043
  try {
1044
- return JSON.parse(x);
1044
+ return JSON.parse(v);
1045
1045
  } catch {
1046
1046
  return p;
1047
1047
  }
@@ -1051,24 +1051,24 @@ Description: ${d.description}`).join(`
1051
1051
  path: p.path.replace(/\/+$/, ""),
1052
1052
  ...p.value != null && p.value !== "" ? { value: u(p.value) } : {},
1053
1053
  ...p.from != null && p.from !== "" ? { from: p.from } : {}
1054
- }))].sort((p, x) => p.op !== "remove" || x.op !== "remove" ? 0 : x.path.localeCompare(p.path, void 0, { numeric: !0 })), f = structuredClone(
1054
+ }))].sort((p, v) => p.op !== "remove" || v.op !== "remove" ? 0 : v.path.localeCompare(p.path, void 0, { numeric: !0 })), f = structuredClone(
1055
1055
  ae(s)
1056
1056
  );
1057
1057
  try {
1058
- Pe(f, m, !0);
1058
+ qe(f, m, !0);
1059
1059
  } catch (p) {
1060
1060
  console.warn(
1061
1061
  "[SolutionBuilder] updateDesign JSON patch failed:",
1062
1062
  { error: p, llmResponse: o, patches: m, patchTarget: f }
1063
1063
  );
1064
- const x = h("applyChangeFailed", e);
1064
+ const v = h("applyChangeFailed", e);
1065
1065
  return {
1066
- outputMessage: x,
1067
- summary: x,
1066
+ outputMessage: v,
1067
+ summary: v,
1068
1068
  status: "success"
1069
1069
  };
1070
1070
  }
1071
- const d = C(
1071
+ const d = _(
1072
1072
  { response: "", ...f },
1073
1073
  { itemId: s.solution?.itemId ?? null }
1074
1074
  ), g = G.safeParse(d);
@@ -1084,11 +1084,11 @@ Description: ${d.description}`).join(`
1084
1084
  status: "success"
1085
1085
  };
1086
1086
  }
1087
- const { response: A, featureLayer: T, ...k } = g.data, Ie = re(
1088
- T,
1087
+ const { response: A, featureLayer: k, ...E } = g.data, Ie = re(
1088
+ k,
1089
1089
  s.featureLayer
1090
- ), S = C(
1091
- { ...k, featureLayer: Ie },
1090
+ ), S = _(
1091
+ { ...E, featureLayer: Ie },
1092
1092
  {
1093
1093
  itemId: s.solution?.itemId,
1094
1094
  sourceBuildSolution: s.sourceBuildSolution,
@@ -1099,18 +1099,18 @@ Description: ${d.description}`).join(`
1099
1099
  let R = B(t.selectedTemplate);
1100
1100
  if (R?.initialTemplate || (await H(e), R = B(t.selectedTemplate)), !R?.initialTemplate)
1101
1101
  throw new Error("No hydrated templates are available for solution design.");
1102
- const q = new me(S, R.initialTemplate, !1);
1103
- if (!q.isValid) {
1102
+ const P = new me(S, R.initialTemplate, !1);
1103
+ if (!P.isValid) {
1104
1104
  console.warn(
1105
1105
  "[SolutionBuilder] updateDesign validation failed:",
1106
- { issues: q.issues, llmResponse: o, patchedDesign: S }
1106
+ { issues: P.issues, llmResponse: o, patchedDesign: S }
1107
1107
  );
1108
1108
  const p = await bt({
1109
1109
  query: n,
1110
- validationIssues: q.issues,
1110
+ validationIssues: P.issues,
1111
1111
  recentMessages: i,
1112
1112
  fallbackMessage: h("applyChangeFailed", e),
1113
- promptModules: I
1113
+ promptModules: C
1114
1114
  });
1115
1115
  return {
1116
1116
  outputMessage: p,
@@ -1137,7 +1137,7 @@ Description: ${d.description}`).join(`
1137
1137
  status: "success",
1138
1138
  currentDesign: S
1139
1139
  };
1140
- }, jt = (t) => t.currentDesign !== null ? "assessUpdateRequest" : "assessBuildRequest", Jt = (t) => !t.updateAssessment || !t.updateAssessment.isValidUpdate ? "invalidUpdateExit" : "updateDesign", Gt = (t) => !t.assessment || !t.assessment.isValidUseCase ? "invalidBuildExit" : !t.selectedTemplate && t.assessment.matchedTemplates.length > 1 ? "selectTemplateHIL" : "findExistingSolutions", Vt = (t) => t.existingMatches.length > 0 ? "confirmContinueBuildingHIL" : "designSolution", Ht = (t) => t.continueBuilding === !1 ? "declineContinueBuildingExit" : "designSolution", Wt = () => new O(Dt).addNode("syncCurrentDesignFromContext", Ft).addNode("assessBuildRequest", $t).addNode("assessUpdateRequest", Bt).addNode("invalidBuildExit", Mt).addNode("invalidUpdateExit", Nt).addNode("selectTemplateHIL", qt).addNode("findExistingSolutions", Pt).addNode("confirmContinueBuildingHIL", Ut).addNode("declineContinueBuildingExit", Ot).addNode("designSolution", we).addNode("updateDesign", zt).addEdge(z, "syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext", jt, {
1140
+ }, jt = (t) => t.currentDesign !== null ? "assessUpdateRequest" : "assessBuildRequest", Jt = (t) => !t.updateAssessment || !t.updateAssessment.isValidUpdate ? "invalidUpdateExit" : "updateDesign", Gt = (t) => !t.assessment || !t.assessment.isValidUseCase ? "invalidBuildExit" : !t.selectedTemplate && t.assessment.matchedTemplates.length > 1 ? "selectTemplateHIL" : "findExistingSolutions", Vt = (t) => t.existingMatches.length > 0 ? "confirmContinueBuildingHIL" : "designSolution", Ht = (t) => t.continueBuilding === !1 ? "declineContinueBuildingExit" : "designSolution", Wt = () => new O(Dt).addNode("syncCurrentDesignFromContext", Ft).addNode("assessBuildRequest", $t).addNode("assessUpdateRequest", Bt).addNode("invalidBuildExit", Mt).addNode("invalidUpdateExit", Nt).addNode("selectTemplateHIL", Pt).addNode("findExistingSolutions", qt).addNode("confirmContinueBuildingHIL", Ut).addNode("declineContinueBuildingExit", Ot).addNode("designSolution", we).addNode("updateDesign", zt).addEdge(z, "syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext", jt, {
1141
1141
  assessUpdateRequest: "assessUpdateRequest",
1142
1142
  assessBuildRequest: "assessBuildRequest"
1143
1143
  }).addConditionalEdges("assessUpdateRequest", Jt, {
@@ -1147,14 +1147,14 @@ Description: ${d.description}`).join(`
1147
1147
  invalidBuildExit: "invalidBuildExit",
1148
1148
  selectTemplateHIL: "selectTemplateHIL",
1149
1149
  findExistingSolutions: "findExistingSolutions"
1150
- }).addEdge("invalidBuildExit", v).addEdge("invalidUpdateExit", v).addEdge("selectTemplateHIL", "findExistingSolutions").addConditionalEdges("findExistingSolutions", Vt, {
1150
+ }).addEdge("invalidBuildExit", x).addEdge("invalidUpdateExit", x).addEdge("selectTemplateHIL", "findExistingSolutions").addConditionalEdges("findExistingSolutions", Vt, {
1151
1151
  confirmContinueBuildingHIL: "confirmContinueBuildingHIL",
1152
1152
  designSolution: "designSolution"
1153
1153
  }).addConditionalEdges("confirmContinueBuildingHIL", Ht, {
1154
1154
  declineContinueBuildingExit: "declineContinueBuildingExit",
1155
1155
  designSolution: "designSolution"
1156
- }).addEdge("declineContinueBuildingExit", v).addEdge("designSolution", v).addEdge("updateDesign", v);
1157
- await y(I, "description");
1156
+ }).addEdge("declineContinueBuildingExit", x).addEdge("designSolution", x).addEdge("updateDesign", x);
1157
+ await y(C, "description");
1158
1158
  const Kt = D.object({
1159
1159
  tool: D.enum(["explorer", "builder", "other"]).describe("The selected tool based on the user's query."),
1160
1160
  confidence: D.number().min(0).max(1).describe("A confidence score (0.00–1.00)."),
@@ -1163,11 +1163,11 @@ const Kt = D.object({
1163
1163
  "./prompts/assistantResponse.md": () => import("../../chunks/assistantResponse.js").then((t) => t.default),
1164
1164
  "./prompts/classifyIntent.md": () => import("../../chunks/classifyIntent.js").then((t) => t.default),
1165
1165
  "./prompts/description.md": () => import("../../chunks/description.js").then((t) => t.default)
1166
- }), K = () => {
1167
- const t = new CustomEvent("assistantProcessing", {
1168
- detail: !1
1166
+ }), K = (t) => {
1167
+ const e = new CustomEvent("assistantProcessing", {
1168
+ detail: { finished: !0, agent: t }
1169
1169
  });
1170
- window.dispatchEvent(t);
1170
+ window.dispatchEvent(e);
1171
1171
  }, Se = b.Root({
1172
1172
  ...j(),
1173
1173
  selectedTool: b({
@@ -1192,7 +1192,7 @@ const Kt = D.object({
1192
1192
  } catch {
1193
1193
  a = !1;
1194
1194
  }
1195
- const l = await y(W, "classifyIntent"), u = await _({
1195
+ const l = await y(W, "classifyIntent"), u = await T({
1196
1196
  promptText: l,
1197
1197
  modelTier: "advanced",
1198
1198
  temperature: 0,
@@ -1206,24 +1206,24 @@ const Kt = D.object({
1206
1206
  };
1207
1207
  }, Yt = async (t, e) => {
1208
1208
  const n = await Ke().compile().invoke(t, e);
1209
- return K(), n;
1209
+ return K("explorer"), n;
1210
1210
  }, Xt = async (t, e) => {
1211
1211
  const n = await Wt().compile().invoke(t, e);
1212
- return K(), n;
1212
+ return K("builder"), n;
1213
1213
  }, Zt = async (t, e) => {
1214
1214
  const s = N(e), n = t.agentExecutionContext.userRequest, i = t.intentRationale ?? "No rationale available.";
1215
1215
  await w(
1216
1216
  { text: s?.executingSolutionsAssistantAgent },
1217
1217
  e
1218
1218
  );
1219
- const o = await y(W, "assistantResponse"), a = t.agentExecutionContext.messages.slice(-11), l = await qe({
1219
+ const o = await y(W, "assistantResponse"), a = t.agentExecutionContext.messages.slice(-11), l = await Pe({
1220
1220
  promptText: o,
1221
1221
  modelTier: "advanced",
1222
1222
  temperature: 0,
1223
1223
  messages: a,
1224
1224
  inputVariables: { query: n, rationale: i }
1225
1225
  });
1226
- return K(), {
1226
+ return K("assistant"), {
1227
1227
  outputMessage: l,
1228
1228
  summary: l,
1229
1229
  status: "success"
@@ -1232,7 +1232,7 @@ const Kt = D.object({
1232
1232
  explorer: "routeToExplorer",
1233
1233
  builder: "routeToBuilder",
1234
1234
  other: "assistantResponse"
1235
- }).addEdge("routeToExplorer", v).addEdge("routeToBuilder", v).addEdge("assistantResponse", v), ss = await y(W, "description"), ns = {
1235
+ }).addEdge("routeToExplorer", x).addEdge("routeToBuilder", x).addEdge("assistantResponse", x), ss = await y(W, "description"), ns = {
1236
1236
  id: "solutionsAssistant",
1237
1237
  name: "Solutions Assistant Agent",
1238
1238
  description: ss,
@@ -1245,7 +1245,7 @@ class as extends ke {
1245
1245
  aiAssistantsEnabled: !1,
1246
1246
  blockBetaApps: !0,
1247
1247
  colocateCompute: !1
1248
- }, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations = Te({ name: "arcgis-solutions-assistant", blocking: !0 }), this._builderWidth = 48, this._solutionDesignJson = '{ "solution": null }', this._isAssistantBusy = !1, this._isBuilderBusy = !1, this._preChatCheck = !1, this._assistantRef = $e(), this._configContextConsumer = ee({
1248
+ }, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations = Te({ name: "arcgis-solutions-assistant", blocking: !0 }), this._builderWidth = 48, this._solutionDesignJson = '{ "solution": null }', this._isAssistantBusy = !1, this._isBuilderBusy = !1, this._preChatCheck = !1, this._showNewChatConfirm = !1, this._assistantRef = $e(), this._configContextConsumer = ee({
1249
1249
  context: Le,
1250
1250
  subscribe: !0,
1251
1251
  callback: (e) => {
@@ -1259,6 +1259,17 @@ class as extends ke {
1259
1259
  }
1260
1260
  }), this._handleResize = () => {
1261
1261
  this._isMobile = window.innerWidth <= 800;
1262
+ }, this._chatStartTime = null, this._handleAssistantProcessingFinished = (e) => {
1263
+ const s = e;
1264
+ if (s.detail?.finished && this._chatStartTime !== null) {
1265
+ const n = Fe(this._chatStartTime);
1266
+ this._telemetry?.logEvent({
1267
+ category: De.ASSISTANT,
1268
+ action: "Chat",
1269
+ dimensions: [s.detail.agent],
1270
+ metrics: [n]
1271
+ }), this._chatStartTime = null, this.assistantProcessing.emit(!1);
1272
+ }
1262
1273
  }, this.closeAssistant = X(), this.assistantProcessing = X(), this._handleAssistantLinkClick = (e) => {
1263
1274
  const s = e.composedPath().find((n) => n instanceof HTMLAnchorElement);
1264
1275
  if (s?.href)
@@ -1277,10 +1288,12 @@ class as extends ke {
1277
1288
  }, this.listenOn(window, "arcgisFeedback", (e) => {
1278
1289
  const s = e.detail, { agentPicked: n, taskAssigned: i, userMessage: o } = this._parseAgentPickedAndTask(s);
1279
1290
  this._sendFeedback(s.content, o ?? i ?? "", s.feedback?.positive ? "Good" : s.feedback?.positive == "Bad" ? "Bad" : "N/A", n ?? "");
1291
+ }), this.listenOn(window, "clearAssistantConversation", () => {
1292
+ this._clearConversation();
1280
1293
  });
1281
1294
  }
1282
1295
  static {
1283
- this.properties = { open: 5, userFirstName: 1, builderVisible: 5, hasActiveBuilderDesign: 5, _conversationId: 16, _orgSettings: 16, _suggestedPrompts: 16, _hasInteracted: 16, _isMobile: 16, _translations: 16, _builderWidth: 16, _solutionDesignJson: 16, _isAssistantBusy: 16, _isBuilderBusy: 16, _preChatCheck: 16 };
1296
+ this.properties = { open: 5, userFirstName: 1, builderVisible: 5, hasActiveBuilderDesign: 5, _conversationId: 16, _orgSettings: 16, _suggestedPrompts: 16, _hasInteracted: 16, _isMobile: 16, _translations: 16, _builderWidth: 16, _solutionDesignJson: 16, _isAssistantBusy: 16, _isBuilderBusy: 16, _preChatCheck: 16, _showNewChatConfirm: 16 };
1284
1297
  }
1285
1298
  static {
1286
1299
  this.styles = ze;
@@ -1289,10 +1302,10 @@ class as extends ke {
1289
1302
  return this._configContextConsumer.value?.telemetrySession;
1290
1303
  }
1291
1304
  connectedCallback() {
1292
- super.connectedCallback(), window.addEventListener("arcgis-solution-design-update", this._onSolutionDesignUpdate), this.el.addEventListener("click", this._handleAssistantLinkClick), window.addEventListener("resize", this._handleResize), this._builderDesignContextConsumer;
1305
+ super.connectedCallback(), window.addEventListener("arcgis-solution-design-update", this._onSolutionDesignUpdate), this.el.addEventListener("click", this._handleAssistantLinkClick), window.addEventListener("resize", this._handleResize), window.addEventListener("assistantProcessing", this._handleAssistantProcessingFinished), this._builderDesignContextConsumer;
1293
1306
  }
1294
1307
  disconnectedCallback() {
1295
- window.removeEventListener("arcgis-solution-design-update", this._onSolutionDesignUpdate), this.el.removeEventListener("click", this._handleAssistantLinkClick), window.removeEventListener("resize", this._handleResize), super.disconnectedCallback();
1308
+ window.removeEventListener("arcgis-solution-design-update", this._onSolutionDesignUpdate), this.el.removeEventListener("click", this._handleAssistantLinkClick), window.removeEventListener("resize", this._handleResize), window.removeEventListener("assistantProcessing", this._handleAssistantProcessingFinished), super.disconnectedCallback();
1296
1309
  }
1297
1310
  loaded() {
1298
1311
  this._checkURLOpenParameter();
@@ -1307,24 +1320,17 @@ class as extends ke {
1307
1320
  e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (ue(this._configContextConsumer.value?.authentication.Portal, this._configContextConsumer.value?.userSession?.token, this._configContextConsumer.value?.locale ?? "en"), this._preChatCheck = !0)), this._configContextConsumer.value?.userSession?.token && this._configContextConsumer.value?.authentication?.CanUseAI;
1308
1321
  }
1309
1322
  _renderNoSign() {
1310
- return E`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage ?? Z} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`;
1323
+ return I`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage ?? Z} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`;
1311
1324
  }
1312
1325
  _renderNoPermission() {
1313
- return E`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Ae(this._translations.noPermissionMessage.replace("{{orgUrl}}", is).replace("{{configAI}}", os))}</div></calcite-notice>`;
1326
+ return I`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Ae(this._translations.noPermissionMessage.replace("{{orgUrl}}", is).replace("{{configAI}}", os))}</div></calcite-notice>`;
1314
1327
  }
1315
1328
  render() {
1316
1329
  let e = this._suggestedPrompts.length > 0 ? this._suggestedPrompts : this._hasInteracted ? [] : Object.values(this._translations.defaultFollowUpQuestions);
1317
- return this._suggestedPrompts.length > 0 ? e = this._suggestedPrompts : this._hasInteracted || (e = [...Object.values(this._translations.defaultFollowUpQuestions)]), E`<calcite-panel class="chat-panel"><div class="header-content" slot=header-content><span class="header-title">${this._translations.solutionAssistantTitle}</span></div>${this._configContextConsumer.value?.userSession?.token ? this._configContextConsumer.value?.authentication?.CanUseAI ? E`${!this._isMobile && E`<calcite-action id=solutionBuilderAction icon=pencil-square .text=${this._translations.tooltips.builder} text-enabled .indicator=${this.hasActiveBuilderDesign} .disabled=${!this.hasActiveBuilderDesign} .active=${this.builderVisible} selection-appearance=highlight @click=${() => {
1330
+ return this._suggestedPrompts.length > 0 ? e = this._suggestedPrompts : this._hasInteracted || (e = [...Object.values(this._translations.defaultFollowUpQuestions)]), I`<calcite-panel class="chat-panel"><div class="header-content" slot=header-content><span class="header-title">${this._translations.solutionAssistantTitle}</span></div>${this._configContextConsumer.value?.userSession?.token ? this._configContextConsumer.value?.authentication?.CanUseAI ? I`${!this._isMobile && I`<calcite-action id=solutionBuilderAction icon=pencil-square .text=${this._translations.tooltips.builder} text-enabled .indicator=${this.hasActiveBuilderDesign} .disabled=${!this.hasActiveBuilderDesign} .active=${this.builderVisible} selection-appearance=highlight @click=${() => {
1318
1331
  window.dispatchEvent(new CustomEvent("toggleSolutionBuilder"));
1319
- }} scale=m slot=header-actions-end></calcite-action>` || ""}${!this._isMobile && E`<calcite-tooltip placement=bottom reference-element=solutionBuilderAction><span>${this._translations.tooltips.solutionBuilder}</span></calcite-tooltip>` || ""}<arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage ?? Z} .suggestedPrompts=${e} @arcgisSubmit=${(s) => {
1320
- console.log("arcgis submit: ", s.detail), this._suggestedPrompts = [], e = [], this._hasInteracted = !0;
1321
- const n = Date.now(), i = Fe(n), o = s.detail || "Unknown";
1322
- this._telemetry?.logEvent({
1323
- category: De.ASSISTANT,
1324
- action: "Chat",
1325
- dimensions: [o],
1326
- metrics: [i]
1327
- }), this.assistantProcessing.emit(!0);
1332
+ }} scale=m slot=header-actions-end></calcite-action>` || ""}${!this._isMobile && I`<calcite-tooltip placement=bottom reference-element=solutionBuilderAction><span>${this._translations.tooltips.solutionBuilder}</span></calcite-tooltip>` || ""}<arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage ?? Z} .suggestedPrompts=${e} @arcgisSubmit=${(s) => {
1333
+ console.log("arcgis submit: ", s.detail), this._suggestedPrompts = [], e = [], this._hasInteracted = !0, this._chatStartTime = Date.now(), this.assistantProcessing.emit(!0);
1328
1334
  }} @arcgisFeedback=${(s) => {
1329
1335
  s.detail;
1330
1336
  }} @arcgisInterrupt=${() => {
@@ -1334,7 +1340,7 @@ class as extends ke {
1334
1340
  }} @arcgisInterruptSubmit=${() => {
1335
1341
  this._queryElementInShadowDom(this.el, ".footer-container", !1);
1336
1342
  }} ${Me(this._assistantRef)}><calcite-button appearance=transparent id=newChatButton icon-start=speech-bubble-plus kind=neutral .label=${this._translations.tooltips.newChat} @click=${() => {
1337
- this._conversationId = void 0, this._suggestedPrompts = [], this._hasInteracted = !1, this._assistantRef.value?.clearChatHistory(), this._queryElementInShadowDom(this.el, ".footer-container", !1);
1343
+ this.hasActiveBuilderDesign ? this._showNewChatConfirm = !0 : this._clearConversation();
1338
1344
  }} round scale=m slot=entry-actions-start>${this._translations.tooltips.newChat}</calcite-button><arcgis-assistant-agent .agent=${ns} .context=${{
1339
1345
  token: this._configContextConsumer.value?.userSession?.token,
1340
1346
  configContext: this._configContextConsumer.value,
@@ -1349,10 +1355,21 @@ class as extends ke {
1349
1355
  clearSuggestedPrompts: () => {
1350
1356
  this._suggestedPrompts = [];
1351
1357
  }
1352
- }}></arcgis-assistant-agent></arcgis-assistant><div slot=footer class="disclaimer-div width-100"><calcite-chip class="beta-chip" appearance=solid kind=neutral .label=${this._translations.betaTag} scale=s>${this._translations.betaTag}</calcite-chip><span>${this._translations.disclaimerMessage} <a href=https://links.esri.com/solutions/security-concern rel="noopener noreferrer" target=_blank>${this._translations.reportConcern}</a></span></div>` : this._renderNoPermission() : this._renderNoSign()}<calcite-action icon=x id=closeAssistantButton .label=${this._translations.tooltips.close} @click=${() => {
1358
+ }}></arcgis-assistant-agent></arcgis-assistant><div slot=footer class="disclaimer-div width-100"><calcite-chip class="beta-chip" appearance=solid kind=neutral .label=${this._translations.betaTag} scale=s>${this._translations.betaTag}</calcite-chip><span>${this._translations.disclaimerMessage} <a href=https://links.esri.com/solutions/security-concern rel="noopener noreferrer" target=_blank>${this._translations.reportConcern}</a></span></div>` : this._renderNoPermission() : this._renderNoSign()}${this._showNewChatConfirm && I`<calcite-dialog close-disabled escape-disabled heading="Start new conversation" modal open>${this._translations.builderMessages.discardMessage}<calcite-button appearance=outline @click=${() => {
1359
+ this._showNewChatConfirm = !1;
1360
+ }} slot=footer-end>\r\n Cancel</calcite-button><calcite-button appearance=solid kind=danger @click=${() => {
1361
+ this._showNewChatConfirm = !1, window.dispatchEvent(new CustomEvent("requestBuilderDiscard"));
1362
+ }} slot=footer-end>\r\n Discard</calcite-button></calcite-dialog>` || ""}<calcite-action icon=x id=closeAssistantButton .label=${this._translations.tooltips.close} @click=${() => {
1353
1363
  this.closeAssistant.emit(!0);
1354
1364
  }} slot=header-actions-end .text=${this._translations.tooltips.close}></calcite-action><calcite-tooltip placement=bottom reference-element=closeAssistantButton><span>${this._translations.tooltips.close}</span></calcite-tooltip></calcite-panel>`;
1355
1365
  }
1366
+ _clearConversation() {
1367
+ this._conversationId = void 0, this._suggestedPrompts = [], this._hasInteracted = !1, this._assistantRef.value?.clearChatHistory(), this._queryElementInShadowDom(this.el, ".footer-container", !1), console.log("[arcgis-solutions-assistant] Conversation after clear:", {
1368
+ conversationId: this._conversationId,
1369
+ suggestedPrompts: this._suggestedPrompts,
1370
+ hasInteracted: this._hasInteracted
1371
+ });
1372
+ }
1356
1373
  _sendFeedback(e, s, n, i) {
1357
1374
  const o = `https://survey123.arcgis.com/share/6e349a50b4504ca6b6107216d568db5f?field:_source=${encodeURIComponent("Solutions Assistant")}&field:user_evaluation=${encodeURIComponent(n)}&field:question=${encodeURIComponent(s)}&field:answer=${encodeURIComponent(e)}&field:context=${encodeURIComponent(JSON.stringify({ agent: i }))}&field:version=${encodeURIComponent("v2")}`;
1358
1375
  window.open(o, "_blank");
@@ -7,4 +7,5 @@ import "@arcgis/ai-components/components/arcgis-assistant";
7
7
  import "@esri/calcite-components/components/calcite-button";
8
8
  import "@arcgis/ai-components/components/arcgis-assistant-agent";
9
9
  import "@esri/calcite-components/components/calcite-chip";
10
+ import "@esri/calcite-components/components/calcite-dialog";
10
11
  export * from "./customElement.js";