@arcgis/coding-components 4.33.0-next.150 → 4.33.0-next.151

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 (81) hide show
  1. package/dist/addons/arcade-coding-assistant/temporary-strings.d.ts +25 -0
  2. package/dist/addons.js +18 -10
  3. package/dist/cdn/{6XKML3NL.js → 2HQ55QOQ.js} +2 -2
  4. package/dist/cdn/{XUJ3QZ6S.js → 2VMEZJ7C.js} +2 -2
  5. package/dist/cdn/{IYCJQDLN.js → 4T2OTCQS.js} +2 -2
  6. package/dist/cdn/{7OE4P3FG.js → 6AJHHM4F.js} +2 -2
  7. package/dist/cdn/{AVVJB2NU.js → 6OD6Z622.js} +1 -1
  8. package/dist/cdn/{SY4SDRJF.js → 7AAQHP62.js} +2 -2
  9. package/dist/cdn/{4PDT53YO.js → AIPJ7DBR.js} +2 -2
  10. package/dist/cdn/{HBN7AGZ6.js → APO6RKET.js} +2 -2
  11. package/dist/cdn/{3GZRQS2N.js → BADABQJZ.js} +2 -2
  12. package/dist/cdn/{LGKX2AQY.js → BCMA3EB7.js} +2 -2
  13. package/dist/cdn/{J2YGSZ6C.js → BF6OI6YK.js} +2 -2
  14. package/dist/cdn/{56ICCW7Z.js → BJSKIYRO.js} +2 -2
  15. package/dist/cdn/{MTRIRUI6.js → C4YG5PJ5.js} +2 -2
  16. package/dist/cdn/{74FAXUGZ.js → C7JBSRC3.js} +1 -1
  17. package/dist/cdn/{35B2GIJU.js → EGQZ57T6.js} +1 -1
  18. package/dist/cdn/{D2XHDZFY.js → FFHMIZTT.js} +2 -2
  19. package/dist/cdn/{RXE7FSVN.js → FIIJOKKA.js} +2 -2
  20. package/dist/cdn/{YYIIN6MW.js → GM4Y2UNL.js} +2 -2
  21. package/dist/cdn/{Z5RJEDND.js → KO4PBGZQ.js} +1 -1
  22. package/dist/cdn/LKZKETI7.js +4 -0
  23. package/dist/cdn/{PVPRF7B4.js → LVNSPHRF.js} +2 -2
  24. package/dist/cdn/{ANTHLBOG.js → MLI23XSH.js} +2 -2
  25. package/dist/cdn/MMIGXEYT.js +4 -0
  26. package/dist/cdn/{QZ4MGA7E.js → N5CVITC3.js} +2 -2
  27. package/dist/cdn/{D7WLGIQ5.js → NWPOENOM.js} +2 -2
  28. package/dist/cdn/{L3HJHI6X.js → OC2FT2K5.js} +2 -2
  29. package/dist/cdn/{KPKOCO2O.js → OZ6ZD5VG.js} +2 -2
  30. package/dist/cdn/PCN3NQUL.js +4 -0
  31. package/dist/cdn/{H2T4AM4F.js → PZCYZ7IX.js} +2 -2
  32. package/dist/cdn/{M3EHQG7N.js → Q5OQDO6K.js} +2 -2
  33. package/dist/cdn/{NAVLBCWN.js → QD72Y6KR.js} +1 -1
  34. package/dist/cdn/{QSQOTIOO.js → QKJ6ILXG.js} +2 -2
  35. package/dist/cdn/{N4HIJJSD.js → RLAECZUK.js} +4 -4
  36. package/dist/cdn/{5DC2QCE4.js → SQFUBFLV.js} +2 -2
  37. package/dist/cdn/{BQ54MGAY.js → VZANX756.js} +2 -2
  38. package/dist/cdn/{KN6U24B3.js → VZNW3MMC.js} +2 -2
  39. package/dist/cdn/{2SNVOJYB.js → W3MUGXE5.js} +2 -2
  40. package/dist/cdn/{XQN5DJMT.js → WXHTSSPA.js} +2 -2
  41. package/dist/cdn/{6L6DJHL4.js → X56VCOPY.js} +2 -2
  42. package/dist/cdn/{D6OJWF67.js → X7GV5CND.js} +2 -2
  43. package/dist/cdn/{GWDFSDKO.js → YFM2HXY7.js} +2 -2
  44. package/dist/cdn/assets/code-editor/sql-expr.worker.js +191 -194
  45. package/dist/cdn/index.js +2 -2
  46. package/dist/chunks/arcade-defaults.js +1 -1
  47. package/dist/chunks/arcade-executor.js +1 -1
  48. package/dist/chunks/arcade-mode.js +1 -1
  49. package/dist/chunks/arcade-service-accessors.js +1 -1
  50. package/dist/chunks/editor.js +1 -1
  51. package/dist/chunks/fields.js +1 -1
  52. package/dist/chunks/language-defaults-base.js +1 -1
  53. package/dist/chunks/markdown.js +1 -1
  54. package/dist/chunks/monaco-importer.js +1 -1
  55. package/dist/chunks/runtime.js +1 -1
  56. package/dist/chunks/setup-monaco.js +1 -1
  57. package/dist/chunks/sql-expr-contribution.js +1 -1
  58. package/dist/chunks/sql-expr-defaults.js +1 -1
  59. package/dist/chunks/sql-expr-mode.js +1 -1
  60. package/dist/chunks/useT9n.js +1 -1
  61. package/dist/components/arcgis-arcade-coding-assistant/customElement.d.ts +2 -0
  62. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +195 -137
  63. package/dist/components/arcgis-arcade-coding-assistant/functional.d.ts +39 -2
  64. package/dist/components/arcgis-arcade-coding-assistant/index.d.ts +7 -4
  65. package/dist/components/arcgis-arcade-coding-assistant/index.js +7 -4
  66. package/dist/components/arcgis-arcade-editor/customElement.js +1 -1
  67. package/dist/components/arcgis-arcade-results/customElement.js +1 -1
  68. package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
  69. package/dist/components/arcgis-code-editor/customElement.js +1 -1
  70. package/dist/components/arcgis-editor-variables/customElement.js +1 -1
  71. package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
  72. package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
  73. package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
  74. package/dist/docs/api.json +2 -2
  75. package/dist/docs/docs.json +2 -2
  76. package/dist/docs/web-types.json +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/loader.js +1 -1
  79. package/package.json +5 -5
  80. package/dist/cdn/NFYZNGHO.js +0 -4
  81. package/dist/cdn/U2TKCKFR.js +0 -4
@@ -1,139 +1,174 @@
1
- import { c as T } from "../../chunks/runtime.js";
2
- import { html as o } from "lit-html";
3
- import { nothing as V, LitElement as I, safeClassMap as D } from "@arcgis/lumina";
4
- import { ref as P, createRef as _ } from "lit/directives/ref.js";
1
+ import { c as q } from "../../chunks/runtime.js";
2
+ import { html as n } from "lit-html";
3
+ import { nothing as P, LitElement as V } from "@arcgis/lumina";
4
+ import { ref as _, createRef as D } from "lit/directives/ref.js";
5
5
  import j from "@arcgis/core/identity/IdentityManager.js";
6
- import { u as N } from "../../chunks/useT9n.js";
6
+ import { u as z } from "../../chunks/useT9n.js";
7
7
  import { b as O } from "../../chunks/arcade-defaults.js";
8
8
  import { css as U } from "@lit/reactive-element/css-tag.js";
9
9
  import "lit";
10
- import $ from "@arcgis/core/request.js";
11
- import { a as A, e as S } from "../../chunks/monaco-importer.js";
10
+ import S from "@arcgis/core/request.js";
11
+ import { a as N, e as B } from "../../chunks/monaco-importer.js";
12
+ import { repeat as H } from "lit-html/directives/repeat.js";
12
13
  import "@arcgis/components-utils";
13
- import { unsafeHTML as z } from "lit/directives/unsafe-html.js";
14
- import H from "@arcgis/core/layers/FeatureLayer.js";
15
- import Q from "@arcgis/core/Graphic.js";
14
+ import { unsafeHTML as y } from "lit/directives/unsafe-html.js";
15
+ import W from "@arcgis/core/layers/FeatureLayer.js";
16
+ import G from "@arcgis/core/Graphic.js";
16
17
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
17
18
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
18
- v4.33.0-next.150 */
19
- const B = U`:host(:not([closed])){flex:1 0 auto;border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box;max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w)}:host([closed]){display:none}.response-actions{display:flex;align-items:center;padding:.5rem;gap:.5rem}.response-actions>div{display:flex;gap:.5rem}.prompt-list calcite-list-item{margin-block-end:.5rem;border-radius:var(--calcite-corner-radius-round);--calcite-color-border-3: transparent;overflow:hidden}.feedback-content{padding:1rem;display:flex;flex-direction:column;gap:.75rem}.feedback-sheet{--calcite-sheet-height: auto;--calcite-sheet-max-height: auto;--calcite-sheet-min-height: auto}calcite-chip[slot=header-actions-end]{align-self:center;margin-inline-end:.5rem}calcite-list-item:focus calcite-button{position:relative;top:-2px}.prompt-list calcite-list-item:last-of-type{margin-block-end:0}calcite-list{--calcite-color-foreground-1: transparent;background-color:transparent}calcite-list-item{--calcite-color-foreground-1: white}calcite-flow-item calcite-shell{background:transparent}calcite-block{width:100%;max-width:100%;align-self:flex-end;background-color:transparent}calcite-sheet{--calcite-sheet-scrim-background: rgba(200, 200, 200, .5)}.type-suggestion{--calcite-color-foreground-1: var(--calcite-color-foreground-current);--calcite-color-text-3: var(--calcite-color-text-2);--calcite-icon-color: var(--calcite-color-brand)}.type-history{--calcite-icon-color: var(--calcite-color-text-2)}.type-response{--calcite-icon-color: var(--calcite-color-brand);--calcite-font-family: monospace}.block-response{align-self:flex-start;margin-block-end:4rem;border-block-end:0;--calcite-block-text-color: var(--calcite-color-brand)}calcite-list-item calcite-button{margin-inline-end:.25rem}.type-docs{--calcite-color-foreground-1: var(--calcite-color-foreground-3);--calcite-icon-color: var(--calcite-color-text-1)}.type-error{--calcite-icon-color: var(--calcite-color-status-danger);--calcite-font-family: monospace;border:1px solid var(--calcite-color-status-danger)}#thumbs-up{margin-inline-start:auto;--calcite-icon-color: var(--calcite-color-border-input)}#thumbs-down{--calcite-icon-color: var(--calcite-color-border-input)}calcite-flow-item calcite-shell calcite-notice{margin-block:1rem}.no-space-block,.no-space-block[open]{margin:0}calcite-block[open]:last-of-type{border-block-end:0}.text-area-wrapper{display:flex;flex-direction:column;background:#fff;border-radius:4px;margin:.75rem;width:calc(100% - 1.5rem);overflow:hidden;max-width:calc(100% - 1.5rem);--calcite-color-border-input: transparent;--calcite-text-area-divider-color: transparent;position:sticky;align-self:flex-end;box-shadow:var(--calcite-shadow-sm);flex:none}.text-area-wrapper calcite-button:last-of-type{margin-inline-start:auto;align-self:flex-end}calcite-text-area{height:auto;min-height:5.75rem;overflow:hidden;border-radius:4px 4px 0 0;--calcite-font-weight-normal: 500;font-weight:500;line-height:1.2}calcite-tooltip{--calcite-tooltip-z-index: 1000}.standalone-list{margin:1rem;width:calc(100% - 2rem)}.result-disclaimer{display:block;width:24rem;max-width:90%;margin:2rem auto .25rem;text-align:center;line-height:1.125rem;font-size:.875rem;font-style:italic}calcite-flow{height:100%}calcite-popover calcite-list{--calcite-list-background-color: transparent;--calcite-input-border-color: transparent}calcite-popover calcite-list calcite-filter{--calcite-spacing-sm: 0}.break-spaces{white-space:break-spaces}.feedback-button-container{margin-inline-start:auto;gap:0}.info-heading{font-size:var(--calcite-font-size-1);color:var(--calcite-color-text-1)}`;
19
+ v4.33.0-next.151 */
20
+ const Q = U`:host(:not([closed])){flex:1 0 auto;border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box;max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w);.response-actions{display:flex;align-items:center;padding:.5rem;gap:.5rem}.response-actions>div{display:flex;gap:.5rem}.prompt-list calcite-list-item{margin-block-end:.5rem;border-radius:var(--calcite-corner-radius-round);--calcite-color-border-3: transparent;overflow:hidden}.feedback-content{padding:1rem;display:flex;flex-direction:column;gap:.75rem}.feedback-sheet{--calcite-sheet-height: auto;--calcite-sheet-max-height: auto;--calcite-sheet-min-height: auto}calcite-chip[slot=header-actions-end]{align-self:center;margin-inline-end:.5rem}calcite-list-item:focus calcite-button{position:relative;top:-2px}.prompt-list calcite-list-item:last-of-type{margin-block-end:0}calcite-list{--calcite-color-foreground-1: transparent;background-color:transparent}calcite-list-item{--calcite-color-foreground-1: white}calcite-flow-item calcite-shell{background:transparent}calcite-block{width:100%;max-width:100%;align-self:flex-end;background-color:transparent}calcite-sheet{--calcite-sheet-scrim-background: rgba(200, 200, 200, .5)}.type-suggestion{--calcite-color-foreground-1: var(--calcite-color-foreground-current);--calcite-color-text-3: var(--calcite-color-text-2);--calcite-icon-color: var(--calcite-color-brand)}.type-history{--calcite-icon-color: var(--calcite-color-text-2)}.type-response{--calcite-icon-color: var(--calcite-color-brand);--calcite-font-family: monospace}.block-response{align-self:flex-start;margin-block-end:4rem;border-block-end:0;--calcite-block-text-color: var(--calcite-color-brand)}calcite-list-item calcite-button{margin-inline-end:.25rem}.type-docs{--calcite-color-foreground-1: var(--calcite-color-foreground-3);--calcite-icon-color: var(--calcite-color-text-1)}.type-error{--calcite-icon-color: var(--calcite-color-status-danger);--calcite-font-family: monospace;border:1px solid var(--calcite-color-status-danger)}#thumbs-up{margin-inline-start:auto;--calcite-icon-color: var(--calcite-color-border-input)}#thumbs-down{--calcite-icon-color: var(--calcite-color-border-input)}calcite-flow-item calcite-shell calcite-notice{margin-block:1rem}.no-space-block,.no-space-block[open]{margin:0}calcite-block[open]:last-of-type{border-block-end:0}.text-area-wrapper{display:flex;flex-direction:column;background:#fff;border-radius:var(--calcite-corner-radius-round);margin:.75rem;width:calc(100% - 1.5rem);overflow:hidden;max-width:calc(100% - 1.5rem);--calcite-color-border-input: transparent;--calcite-text-area-divider-color: transparent;position:sticky;align-self:flex-end;box-shadow:var(--calcite-shadow-sm);flex:none}.text-area-wrapper calcite-button:last-of-type{margin-inline-start:auto;align-self:flex-end}calcite-text-area{height:auto;min-height:5.75rem;overflow:hidden;border-radius:var(--calcite-corner-radius-round) var(--calcite-corner-radius-round) 0 0;--calcite-font-weight-normal: 500;font-weight:500;line-height:1.2}calcite-tooltip{--calcite-tooltip-z-index: 1000}.standalone-list{margin:1rem;width:calc(100% - 2rem)}.result-disclaimer{display:block;width:24rem;max-width:90%;margin:1rem auto;text-align:center;line-height:1.125rem;font-size:.875rem;font-style:italic}calcite-flow{height:100%}calcite-popover calcite-list{--calcite-list-background-color: transparent;--calcite-input-border-color: transparent}calcite-popover calcite-list calcite-filter{--calcite-spacing-sm: 0}.break-spaces{white-space:break-spaces}.feedback-button-container{margin-inline-start:auto;gap:0}.info-heading{font-size:var(--calcite-font-size-1);color:var(--calcite-color-text-1)}.welcome-display-graphic{width:100%;height:6rem;background:var(--calcite-color-foreground-current);position:relative;display:flex;align-items:center;justify-content:center;--calcite-icon-color: var(--calcite-color-brand)}.unstyled-shell{position:unset;inset:unset;display:unset;block-size:unset;inline-size:unset}.suggestion-chips{--calcite-chip-background-color: var(--calcite-color-foreground-current);--calcite-chip-text-color: var(--calcite-color-brand);calcite-chip{cursor:pointer}}#result-block{calcite-card-group{--calcite-card-group-gap: 1.25rem}calcite-card{--calcite-card-corner-radius: var(--calcite-corner-radius-round);--calcite-card-background-color: white;--calcite-card-border-color: transparent;width:100%}.positioned-code-content{display:flex;flex-direction:row;padding:.25rem .5rem;gap:.5rem}calcite-card [slot=title] calcite-chip{margin-block-start:.25rem}.code-response-wrapper{position:relative;background:var(--calcite-color-foreground-2);border-radius:var(--calcite-corner-radius-round)}.prior-prompt{margin:.25rem 0 .75rem;max-width:90%;padding:0}pre{font-size:12px;margin:0;padding:0;overflow-x:auto;font-family:Fira Mono,Consolas,Menlo,monospace;display:block;max-height:12rem;position:relative}code{display:block;margin:0;padding:0 1rem}.code-collapse{margin-inline-start:auto}}}:host([closed]){display:none}`;
20
21
  function R(i) {
21
22
  if (!i)
22
23
  return;
23
24
  const e = i.indexOf('{"error":');
24
25
  if (e !== -1)
25
26
  try {
26
- const t = i.slice(e), s = JSON.parse(t);
27
- if (s && typeof s == "object" && s.error)
28
- return s.error;
27
+ const t = i.slice(e), a = JSON.parse(t);
28
+ if (a && typeof a == "object" && a.error)
29
+ return a.error;
29
30
  } catch {
30
31
  return;
31
32
  }
32
33
  }
33
- async function L(i) {
34
- const { baseUrl: e, skillId: t, message: s, authToken: a, previousConversationId: r, context: n } = i, c = t ? `${e}/skills/${t}/chat` : `${e}/chat`, l = [], d = {
35
- message: s,
36
- context: n
34
+ async function J(i) {
35
+ const { baseUrl: e, skillId: t, message: a, authToken: c, previousConversationId: o, context: r } = i, s = t ? `${e}/skills/${t}/chat` : `${e}/chat`, d = [], l = {
36
+ message: a,
37
+ context: r
37
38
  };
38
- r && (d.conversation_id = r);
39
- let f;
39
+ o && (l.conversation_id = o);
40
+ let m;
40
41
  try {
41
- f = await $(c, {
42
+ m = await S(s, {
42
43
  method: "post",
43
44
  headers: {
44
45
  "Content-Type": "application/json",
45
- token: a
46
+ token: c
46
47
  },
47
- body: JSON.stringify(d),
48
+ body: JSON.stringify(l),
48
49
  responseType: "json"
49
50
  });
50
- } catch (h) {
51
- const m = h?.details?.rawResponse || h?.message || String(h), k = R(m), g = new Error(
52
- `Failed to send message: ${s}. Response: ${m}`
51
+ } catch (f) {
52
+ const b = f?.details?.rawResponse || f?.message || String(f), v = R(b), g = new Error(
53
+ `Failed to send message: ${a}. Response: ${b}`
53
54
  );
54
- throw k && (g.arcadeAssistantError = k), g;
55
+ throw v && (g.arcadeAssistantError = v), g;
55
56
  }
56
- const b = f.data;
57
- if (!b.hasMore)
57
+ const p = m.data;
58
+ if (!p.hasMore)
58
59
  throw new Error("Expected hasMore to be true");
59
- l.push(b);
60
- const M = b.conversationId, q = b.inquiryId;
61
- let v = b.sequenceNumber;
60
+ d.push(p);
61
+ const T = p.conversationId, M = p.inquiryId;
62
+ let w = p.sequenceNumber;
62
63
  async function F() {
63
- let h = 0;
64
- const m = 25;
65
- for (; h < m; ) {
66
- await new Promise((u) => setTimeout(u, 1e3));
67
- const k = W(M, v, q);
64
+ let f = 0;
65
+ const b = 25;
66
+ for (; f < b; ) {
67
+ await new Promise((h) => setTimeout(h, 1e3));
68
+ const v = L(T, w, M);
68
69
  let g;
69
70
  try {
70
- g = await $(c, {
71
+ g = await S(s, {
71
72
  method: "post",
72
73
  headers: {
73
74
  "Content-Type": "application/json",
74
- token: a
75
+ token: c
75
76
  },
76
- body: JSON.stringify(k),
77
+ body: JSON.stringify(v),
77
78
  responseType: "json"
78
79
  });
79
- } catch (u) {
80
- const y = u?.details?.rawResponse || u?.message || String(u), x = R(y), w = new Error(
81
- `Polling failed. Response: ${y}`
80
+ } catch (h) {
81
+ const x = h?.details?.rawResponse || h?.message || String(h), $ = R(x), A = new Error(
82
+ `Polling failed. Response: ${x}`
82
83
  );
83
- throw x && (w.arcadeAssistantError = x), w;
84
+ throw $ && (A.arcadeAssistantError = $), A;
84
85
  }
85
- const p = g.data;
86
- if (p.context && p.context.kind === "ArcgisErrorAsContext" && p.context.error)
87
- throw new Error(
88
- p.context.error.message || "ArcGIS Assistant error"
86
+ const u = g.data;
87
+ if (u.context && u.context.kind === "ArcgisErrorAsContext" && u.context.error) {
88
+ const h = new Error(
89
+ u.context.error.message || "ArcGIS Assistant error"
89
90
  );
90
- if (l.push(p), v = p.sequenceNumber, h++, !p.hasMore)
91
+ throw h.arcadeAssistantError = { message: u.context.error.message ?? "ArcGIS Assistant error" }, h;
92
+ }
93
+ if (d.push(u), w = u.sequenceNumber, f++, !u.hasMore)
91
94
  break;
92
95
  }
93
- if (h === m)
96
+ if (f === b)
94
97
  throw new Error("Request timed out");
95
98
  }
96
- return await F(), l;
99
+ return await F(), d;
97
100
  }
98
- function W(i, e, t) {
101
+ function L(i, e, t) {
99
102
  return {
100
103
  conversationId: i,
101
104
  inquiryId: t,
102
105
  ackSequenceNumber: e
103
106
  };
104
107
  }
105
- const G = (i) => {
106
- const e = i.value.length, t = 72, s = 180, a = i.offsetWidth, n = Math.max(1, Math.floor(a / 8)), c = Math.ceil(e / n), l = t + (c - 2) * 24;
107
- i.style.setProperty("--calcite-text-area-min-height", `${Math.min(l, s)}px`);
108
+ const Y = (i) => {
109
+ const e = i.value.length, t = 72, a = 180, c = i.offsetWidth, r = Math.max(1, Math.floor(c / 8)), s = Math.ceil(e / r), d = t + (s - 2) * 24;
110
+ i.style.setProperty("--calcite-text-area-min-height", `${Math.min(d, a)}px`);
108
111
  };
109
- function J({ messages: i }) {
110
- return o`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${i.beta ?? "Beta"}>${i.beta ?? "Beta"}</calcite-chip>`;
112
+ function K({ messages: i }) {
113
+ return n`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${i.beta ?? "Beta"}>${i.beta ?? "Beta"}</calcite-chip>`;
111
114
  }
112
- function Y({ popoverContent: i }) {
113
- return o`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-popover reference-element=legal-disclaimer overlay-positioning=fixed label=legal-disclaimer placement=bottom auto-close>${i}</calcite-popover>`;
115
+ function X({ popoverContent: i }) {
116
+ return n`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-popover reference-element=legal-disclaimer overlay-positioning=fixed label=legal-disclaimer placement=bottom auto-close>${i}</calcite-popover>`;
114
117
  }
115
- function K({ errorMessage: i }) {
116
- return o`<calcite-input-message id=error-message status=invalid slot=footer-start icon=exclamation-mark-triangle scale=m>${i}</calcite-input-message>`;
118
+ function Z({ errorMessage: i }) {
119
+ return n`<calcite-input-message id=error-message status=invalid slot=footer-start icon=exclamation-mark-triangle scale=m>${i}</calcite-input-message>`;
117
120
  }
118
- function X({ active: i, setActive: e, messages: t }) {
119
- return o`<calcite-alert slot=alerts .open=${i} placement=bottom kind=success icon=check-circle-f auto-close @calciteAlertClose=${() => e(!1)} label=confirmation-alert><div slot=message>${t.expressionapplied ?? "Expression applied to editor."}</div></calcite-alert>`;
121
+ function ee({ active: i, setActive: e, messages: t }) {
122
+ return n`<calcite-alert slot=alerts .open=${i} placement=bottom kind=success icon=check-circle-f auto-close @calciteAlertClose=${() => e(!1)} label=confirmation-alert><div slot=message>${t.expressionapplied ?? "Expression applied to editor."}</div></calcite-alert>`;
120
123
  }
121
- function Z({ isDisabled: i, isReadOnly: e, setQuestion: t, setIsViewingResult: s, textAreaRef: a, question: r, errorMessage: n, setErrorMessage: c, submitQuestion: l, messages: d }) {
122
- return o`<div class="text-area-wrapper"><calcite-text-area resize=none .readOnly=${i || e} class="styled-text-area" .placeholder=${d.askaquestion ?? `Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${r} @calciteTextAreaInput=${(f) => {
123
- G(f.target), t(f.target.value);
124
- }} ${P(a)}>${n && K({ errorMessage: n }) || ""}</calcite-text-area><div class="response-actions">${e ? o`<calcite-button round appearance=outline-fill icon-start=speech-bubble-plus @click=${() => {
125
- t(""), s(!1);
126
- }}>${d.askagain || "Ask again"}</calcite-button>` : o`<calcite-button alignment=end round icon-end=effects appearance=solid .loading=${i} .disabled=${i} @click=${async () => {
127
- c(r ? "" : d.enteraprompt ?? "Please enter a prompt"), await l();
128
- }}>${d.ask || "Ask"}</calcite-button>`}</div></div>`;
124
+ function te({ isDisabled: i, isReadOnly: e, setQuestion: t, setIsViewingResult: a, textAreaRef: c, question: o, errorMessage: r, setErrorMessage: s, submitQuestion: d, messages: l, mode: m }) {
125
+ return n`<div class="text-area-wrapper"><calcite-text-area resize=vertical .readOnly=${i || e} class="styled-text-area" .placeholder=${l.askaquestion ?? `Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${o} @calciteTextAreaInput=${(p) => {
126
+ Y(p.target), t(p.target.value);
127
+ }} ${_(c)}>${r && Z({ errorMessage: r }) || ""}</calcite-text-area><div class="response-actions" slot=footer-end><calcite-button round kind=neutral .hidden=${m !== "refine"} icon-start=arrow-left appearance=solid .disabled=${i} @click=${async () => {
128
+ a(!1), t("");
129
+ }}>${l.startover ?? "Start Over"}</calcite-button><calcite-button round icon-end=effects appearance=solid .loading=${i} .disabled=${i} @click=${async () => {
130
+ s(o ? "" : l.enteraprompt ?? "Please enter a prompt"), await d();
131
+ }}>${m === "prompt" ? l.ask ?? "Generate" : l.refine ?? "Refine"}</calcite-button></div></div>`;
129
132
  }
130
- function ee({ open: i, setOpen: e, messages: t, feedbackValue: s, setFeedbackValue: a, feedbackText: r, setFeedbackText: n, onSubmit: c }) {
131
- return o`<calcite-sheet class="feedback-sheet" .label=${t.feedback ?? "Feedback"} slot=sheets display-mode=float position=block-end .open=${i} @calciteSheetClose=${() => e(!1)}><calcite-panel .heading=${t.providefeedback ?? "Provide feedback"} .description=${t.experiencehelps ?? "Your experience helps guide future improvements"}><div class="feedback-content"><calcite-label>${t.experiencehelpful ?? "Was the assistant helpful?"}<calcite-segmented-control scale=l><calcite-segmented-control-item icon-start=thumbs-up .checked=${s === "good"} @click=${() => a("good")}></calcite-segmented-control-item><calcite-segmented-control-item icon-start=thumbs-down .checked=${s === "bad"} @click=${() => a("bad")}></calcite-segmented-control-item></calcite-segmented-control></calcite-label><calcite-label>${t.describeexperience ?? "Describe your experience"}<calcite-text-area resize=vertical .value=${r} @calciteTextAreaInput=${(l) => n(l.target.value)}></calcite-text-area></calcite-label></div><calcite-button slot=footer width=full @click=${c}>${t.submitfeedback ?? "Submit Feedback"}</calcite-button></calcite-panel></calcite-sheet>`;
133
+ function ie({ open: i, setOpen: e, messages: t, feedbackValue: a, setFeedbackValue: c, feedbackText: o, setFeedbackText: r, onSubmit: s }) {
134
+ return n`<calcite-sheet class="feedback-sheet" .label=${t.feedback ?? "Feedback"} slot=sheets display-mode=float position=block-end .open=${i} @calciteSheetClose=${() => e(!1)}><calcite-panel .heading=${t.providefeedback ?? "Provide feedback"} .description=${t.experiencehelps ?? "Your experience helps guide future improvements"}><div class="feedback-content"><calcite-label>${t.experiencehelpful ?? "Was the assistant helpful?"}<calcite-segmented-control scale=l><calcite-segmented-control-item icon-start=thumbs-up .checked=${a === "good"} @click=${() => c("good")}></calcite-segmented-control-item><calcite-segmented-control-item icon-start=thumbs-down .checked=${a === "bad"} @click=${() => c("bad")}></calcite-segmented-control-item></calcite-segmented-control></calcite-label><calcite-label>${t.describeexperience ?? "Describe your experience"}<calcite-text-area resize=vertical .value=${o} @calciteTextAreaInput=${(d) => r(d.target.value)}></calcite-text-area></calcite-label></div><calcite-button slot=footer width=full @click=${s}>${t.submitfeedback ?? "Submit Feedback"}</calcite-button></calcite-panel></calcite-sheet>`;
132
135
  }
133
136
  function C({ assistantsEnabled: i, messages: e, slot: t }) {
134
- return o`<calcite-block label=info slot=${t ?? V} expanded><calcite-chip .label=${e.new ?? "new"} kind=brand>${e.new}</calcite-chip><h1 class="info-heading">${e.introducing}</h1><p>${e.capabilities}</p>${!i && o`<p>${z(e.useofassistant?.replace("{aiassistants}", `<strong>${e.aiassistants ?? "Ai Assistants"}</strong>`))}<calcite-link href=https://doc.arcgis.com/en/arcgis-online/administer/configure-assistants.htm target=_blank icon-end=launch-2>${e.opensettings ?? "Open Settings"}</calcite-link></p>` || ""}</calcite-block>`;
137
+ return n`<calcite-block label=info slot=${t ?? P} expanded><calcite-chip .label=${e.new ?? "new"} kind=brand>${e.new}</calcite-chip><h1 class="info-heading">${e.introducing}</h1><p>${e.capabilities}</p>${!i && n`<p>${y(e.useofassistant?.replace("{aiassistants}", `<strong>${e.aiassistants ?? "Ai Assistants"}</strong>`))}<calcite-link href=https://doc.arcgis.com/en/arcgis-online/administer/configure-assistants.htm target=_blank icon-end=launch-2>${e.opensettings ?? "Open Settings"}</calcite-link></p>` || ""}</calcite-block>`;
138
+ }
139
+ function ae({ messages: i, onProceed: e, onExit: t }) {
140
+ return n`<calcite-scrim></calcite-scrim><calcite-dialog close-disabled placement=top .heading=${i.welcome} slot=dialogs open width-scale=m id=welcome-dialog><div class="welcome-display-graphic" slot=content-top><calcite-chip scale=l icon=effects label=effects></calcite-chip></div><calcite-notice scale=s open width=full><div slot=title>${i.beforeyougetstarted}</div></calcite-notice>&bull; ${i.maybeincorrect} <br><br><span>${y(`&bull; ${i.pleasereadhelp.replace("{helpTopic}", `<calcite-link href="https://doc.arcgis.com/en/arcgis-online/help/arcade-assistant.htm" target="_blank">${i.helptopic}</calcite-link>`)}`)}</span><br><div slot=content-bottom>${y(i.consultprivacy.replace(
141
+ "{privacyStatement}",
142
+ // TODO get correct link
143
+ `<calcite-link href="https://www.esri.com/en-us/privacy/arcgis-online-privacy-statement" target="_blank">${i.privacyStatement}</calcite-link>`
144
+ ).replace("{privacySupplement}", `<calcite-link href="https://www.esri.com/en-us/privacy/arcgis-online-privacy-supplement" target="_blank">${i.privacySupplement}</calcite-link>`))}</div><calcite-button id=welcome-proceed slot=footer-end @click=${e}>${i.proceed}</calcite-button><calcite-button id=welcome-decline slot=footer-start @click=${t} kind=neutral>${i.exit}</calcite-button></calcite-dialog>`;
145
+ }
146
+ function se({ messages: i, suggestions: e, onSuggestionClick: t }) {
147
+ return n`<calcite-block .heading=${i.promptsuggestions} expanded collapsible id=suggestion-block><calcite-chip-group .label=${i.promptsuggestions} class="suggestion-chips">${H(e, (a) => a, (a) => n`<calcite-chip .label=${i.promptsuggestion} .value=${a} icon=effects @click=${() => t?.(a)}>${a}</calcite-chip>`)}</calcite-chip-group></calcite-block>`;
148
+ }
149
+ function ce({ hidden: i = !1, expanded: e = !1, messages: t, cards: a, heading: c, collapsible: o = !1, showEffectsIcon: r = !1 }) {
150
+ return n`<calcite-block .hidden=${i} id=result-block .heading=${c ?? t.besteffort ?? "Here is the assistant's best effort"} .expanded=${e} .collapsible=${o}>${r && n`<calcite-chip label slot=content-start icon=effects kind=brand></calcite-chip>` || ""}<calcite-card-group .label=${t.assistantresponses}>${a.map((s, d) => n`<calcite-card><div slot=title><div class="prior-prompt">${s.priorPrompt}</div><div class="code-response-wrapper"><div class="positioned-code-content">${s.chips?.map((l) => n`<calcite-chip .label=${l.label} .scale=${l.scale ?? "s"} .appearance=${l.appearance ?? "outline"} .icon=${l.icon}>${l.label}</calcite-chip>`)}</div><pre><code>${s.code}</code></pre></div></div><div slot=footer-start><calcite-button round icon-start=plus appearance=outline-fill class="add-to-editor-button" @click=${s.onAddToEditor}>${t.addtoeditor ?? "Add to editor"}</calcite-button><calcite-button round icon-start=copy-to-clipboard kind=neutral @click=${() => s.onCopy(d)}>${s.copySuccessIndex === d ? t.copied ?? "copied" : ""}</calcite-button></div><div slot=footer-end class="feedback-actions"><calcite-action .text=${t.thumbsup} scale=s icon=thumbs-up @click=${s.onThumbsUp}></calcite-action><calcite-action .text=${t.thumbsdown} scale=s icon=thumbs-down @click=${s.onThumbsDown}></calcite-action></div></calcite-card>`)}</calcite-card-group></calcite-block>`;
135
151
  }
136
- const te = "arcade_generation", ie = "ArcadeCodeRequest", se = "visualization", ae = "ArcadeAssistant", ce = [
152
+ const k = {
153
+ welcome: "Welcome to the new assistant experience",
154
+ beforeyougetstarted: "Before you get started be aware:",
155
+ maybeincorrect: "AI generated code may occasionally be incorrect or biased. Review carefully.",
156
+ pleasereadhelp: "Please read the Arcade Assistant (beta) overview {helpTopic} for more details.",
157
+ consultprivacy: "Consult the {privacyStatement} and {privacySupplement}.",
158
+ privacyStatement: "privacy statement",
159
+ privacySupplement: "privacy supplement",
160
+ proceed: "Proceed",
161
+ exit: "Exit",
162
+ promptsuggestions: "Prompt suggestions",
163
+ promptsuggestion: "Prompt suggestion",
164
+ assistantresponses: "Assistant responses",
165
+ collapse: "Collapse",
166
+ thumbsup: "Thumbs up",
167
+ thumbsdown: "Thumbs down",
168
+ refine: "Refine",
169
+ startover: "Start over",
170
+ helptopic: "help topic"
171
+ }, oe = "arcade_generation", re = "ArcadeCodeRequest", ne = "visualization", le = "ArcadeAssistant", de = [
137
172
  "your_comments",
138
173
  "user_evaluation",
139
174
  "question",
@@ -144,64 +179,67 @@ const te = "arcade_generation", ie = "ArcadeCodeRequest", se = "visualization",
144
179
  "context",
145
180
  "extras"
146
181
  ];
147
- let E = [];
148
- class oe extends I {
182
+ let E = [], I = !0;
183
+ class pe extends V {
149
184
  constructor() {
150
- super(...arguments), this.textAreaRef = _(), this.messages = N(), this._feedbackService = void 0, this.handleFeedbackButton = (e) => {
151
- this.feedbackValue === e && this.feedbackActive ? (this.feedbackActive = !1, this.feedbackValue = void 0, this.feedbackText = "") : (this.feedbackValue = e, this.feedbackActive = !0);
185
+ super(...arguments), this.textAreaRef = D(), this.messages = z(), this._feedbackService = void 0, this.handleFeedbackButton = (e, t) => {
186
+ this.feedback.active && this.feedback.value === e ? this.feedback = { active: !1, value: void 0, text: "", item: void 0 } : this.feedback = { ...this.feedback, active: !0, value: e, item: t };
152
187
  }, this.handleFeedbackSheetClose = () => {
153
- this.feedbackActive = !1, this.feedbackValue = void 0, this.feedbackText = "";
188
+ this.feedback = { active: !1, value: void 0, text: "", item: void 0 };
154
189
  }, this.handleFeedbackSubmit = async () => {
155
190
  const e = await this.ensureFeedbackService();
156
191
  if (!e) {
157
192
  this.handleFeedbackSheetClose();
158
193
  return;
159
194
  }
160
- const t = this.getModel(), s = t ? await this.getProfileAndMetadata(t.uri) : void 0, a = {
161
- user_evaluation: this.feedbackValue,
162
- your_comments: this.feedbackText || void 0,
195
+ const t = this.getModel(), a = t ? await this.getProfileAndMetadata(t.uri) : void 0, c = {
196
+ user_evaluation: this.feedback.value,
197
+ your_comments: this.feedback.text || void 0,
163
198
  question: this.question,
164
- answer: this.history[0]?.script ?? "",
199
+ answer: this.feedback.item?.script ?? "",
165
200
  useragent: navigator.userAgent,
166
- _source: ae,
201
+ _source: le,
167
202
  version: this.appVersion ?? "",
168
- context: s ? JSON.stringify(s) : "",
169
- extras: s?.profileName ?? ""
203
+ context: a ? JSON.stringify(a) : "",
204
+ extras: a?.profileName ?? "",
205
+ conversation_id: this.feedback.item?.conversationId ?? ""
170
206
  };
171
207
  try {
172
- await e.applyEdits({ addFeatures: [new Q({ attributes: a })] });
173
- } catch (r) {
174
- console.error("Error submitting feedback:", r);
208
+ await e.applyEdits({ addFeatures: [new G({ attributes: c })] });
209
+ } catch (o) {
210
+ console.error("Error submitting feedback:", o);
175
211
  }
176
212
  this.handleFeedbackSheetClose();
177
213
  }, this.handleClose = (e) => {
178
214
  this.closed = !0, this.closePanel?.(e);
179
215
  }, this.setQuestion = (e) => {
180
216
  this.question = e;
181
- }, this.isViewingResult = !1, this.confirmationActive = !1, this.isDisabled = !1, this.errorMessage = void 0, this.question = "", this.history = [], this.feedbackActive = !1, this.feedbackValue = void 0, this.feedbackText = "", this.copySuccess = !1, this.assistantsEnabled = !1, this.closed = !1;
217
+ }, this.onSuggestionClick = (e) => {
218
+ this.textAreaRef.value && (this.textAreaRef.value.value = e, this.textAreaRef.value.setFocus(), this.setQuestion(e));
219
+ }, this.isViewingResult = !1, this.confirmationActive = !1, this.isSubmitting = !1, this.errorMessage = void 0, this.question = "", this.history = [], this.feedback = { active: !1, value: void 0, text: "", item: void 0 }, this.copySucessIndex = -1, this.splashActive = !0, this.assistantsEnabled = !1, this.closed = !1;
182
220
  }
183
221
  static {
184
- this.properties = { isViewingResult: 16, confirmationActive: 16, isDisabled: 16, errorMessage: 16, question: 16, history: 16, feedbackActive: 16, feedbackValue: 16, feedbackText: 16, copySuccess: 16, closePanel: 0, insertText: 0, assistantsEnabled: 5, layer: [1, { type: Object }], orgBaseUrl: 1, serviceUrl: 1, closed: 7, editorRef: 0, feedbackServiceUrl: 1, appVersion: 1 };
222
+ this.properties = { isViewingResult: 16, confirmationActive: 16, isSubmitting: 16, errorMessage: 16, question: 16, history: 16, feedback: 16, copySucessIndex: 16, splashActive: 16, closePanel: 0, insertText: 0, assistantsEnabled: 5, layer: [1, { type: Object }], orgBaseUrl: 1, serviceUrl: 1, closed: 7, editorRef: 0, feedbackServiceUrl: 1, appVersion: 1 };
185
223
  }
186
224
  static {
187
- this.styles = B;
225
+ this.styles = Q;
188
226
  }
189
227
  async destroy() {
190
228
  }
191
229
  connectedCallback() {
192
- super.connectedCallback(), this.history = E;
230
+ super.connectedCallback(), this.history = E, this.splashActive = I;
193
231
  }
194
232
  disconnectedCallback() {
195
- super.disconnectedCallback(), E = this.history;
233
+ super.disconnectedCallback(), E = this.history, I = this.splashActive;
196
234
  }
197
235
  async ensureFeedbackService() {
198
236
  if (this._feedbackService)
199
237
  return this._feedbackService;
200
238
  if (!this.feedbackServiceUrl)
201
239
  return;
202
- const e = new H({ url: this.feedbackServiceUrl });
240
+ const e = new W({ url: this.feedbackServiceUrl });
203
241
  await e.load();
204
- const t = ce.filter((s) => !e.fields.some((a) => a.name === s));
242
+ const t = de.filter((a) => !e.fields.some((c) => c.name === a));
205
243
  if (t.length > 0) {
206
244
  console.error(`Missing the following fields in feedback service: ${t.join(", ")}. Feedback will not be logged.`);
207
245
  return;
@@ -213,35 +251,37 @@ class oe extends I {
213
251
  }
214
252
  async submitQuestion() {
215
253
  if (this.question) {
216
- this.isDisabled = !0;
254
+ this.isSubmitting = !0;
217
255
  try {
218
256
  const e = await this.getToken(), t = this.getModel();
219
257
  if (!t)
220
258
  return;
221
- const { profileName: s, metadata: a } = await this.getProfileAndMetadata(t.uri), n = (await L({
259
+ const { profileName: a, metadata: c } = await this.getProfileAndMetadata(t.uri), r = (await J({
222
260
  baseUrl: this.serviceUrl,
223
- skillId: te,
261
+ skillId: oe,
224
262
  message: this.question,
225
263
  authToken: e,
226
264
  context: {
227
- kind: ie,
265
+ kind: re,
228
266
  context: {
229
- profile_name: s,
230
- metadata: a
267
+ profile_name: a,
268
+ metadata: c
231
269
  }
232
270
  }
233
- })).find((c) => c.context?.kind === "ArcadeCodeResponse");
234
- if (!n)
271
+ })).find((s) => s.context?.kind === "ArcadeCodeResponse");
272
+ if (!r)
235
273
  return;
236
- n.context?.kind === "ArcadeCodeResponse" && (this.history.unshift({
237
- script: n?.context?.arcadeCode?.code,
274
+ r.context?.kind === "ArcadeCodeResponse" && (this.history.unshift({
275
+ script: r?.context?.arcadeCode?.code,
238
276
  error: void 0,
239
- question: this.question
240
- }), this.isViewingResult = !0, this.errorMessage = void 0), this.handleFeedbackSubmit();
277
+ question: this.question,
278
+ profile: a,
279
+ conversationId: r.conversationId
280
+ }), this.isViewingResult = !0, this.errorMessage = void 0);
241
281
  } catch (e) {
242
282
  typeof e == "object" && e && "arcadeAssistantError" in e ? this.errorMessage = e.arcadeAssistantError.message || this.messages.erroroccurred || "An error occurred." : e instanceof Error ? this.errorMessage = this.messages.erroroccurred ?? "An error occurred." : this.errorMessage = this.messages.erroroccurred || "An error occurred.", console.error("Error in Arcade Assistant:", e);
243
283
  } finally {
244
- this.isDisabled = !1;
284
+ this.isSubmitting = !1;
245
285
  }
246
286
  }
247
287
  }
@@ -250,35 +290,53 @@ class oe extends I {
250
290
  return e;
251
291
  }
252
292
  async getProfileAndMetadata(e) {
253
- let t = se;
254
- const s = O.getEditorProfileForModel(e);
255
- s?.loaded || await s?.loadSource();
256
- const a = this.editorRef.profile;
257
- a && "id" in a && (t = a.id);
258
- const r = s?.definition?.variables?.find((c) => c.type === "feature");
259
- let n = [];
260
- return r?.definition && "fields" in r.definition && (n = r.definition.fields.map((c) => ({
261
- name: c.name,
262
- type: c.type,
263
- alias: c.alias
264
- }))), { profileName: t, metadata: n };
293
+ let t = ne;
294
+ const a = O.getEditorProfileForModel(e);
295
+ a?.loaded || await a?.loadSource();
296
+ const c = this.editorRef.profile;
297
+ c && "id" in c && (t = c.id);
298
+ const o = a?.definition?.variables?.find((s) => s.type === "feature");
299
+ let r = [];
300
+ return o?.definition && "fields" in o.definition && (r = o.definition.fields.map((s) => ({
301
+ name: s.name,
302
+ type: s.type,
303
+ alias: s.alias
304
+ }))), { profileName: t, metadata: r };
265
305
  }
266
306
  render() {
267
- return this.closed ? null : this.assistantsEnabled ? o`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${J({ messages: this.messages })}${Y({ popoverContent: C({ assistantsEnabled: this.assistantsEnabled, messages: this.messages }) })}${X({ active: this.confirmationActive, setActive: (e) => this.confirmationActive = e, messages: this.messages })}${Z({ isDisabled: this.isDisabled, isReadOnly: this.isViewingResult, setQuestion: this.setQuestion, setIsViewingResult: (e) => this.isViewingResult = e, textAreaRef: this.textAreaRef, question: this.question, errorMessage: this.errorMessage, setErrorMessage: (e) => this.errorMessage = e, submitQuestion: this.submitQuestion.bind(this), messages: this.messages })}<calcite-block .hidden=${!this.isDisabled} .heading=${this.messages.generatingresponse ?? "Generating response..."}></calcite-block>${this.isViewingResult && o`<calcite-block class="block-response" icon-start=effects .heading=${this.messages.besteffort ?? "Here's the assistant's best effort"} expanded><calcite-list class="prompt-list" .label=${this.messages.promptlist ?? "Prompt list"}><calcite-list-item expanded class=${D(this.history[0]?.error ? "type-error" : "type-response")} .label=${A(this.history[0]?.script ?? "") || this.history[0]?.error} @calciteListItemSelect=${() => {
268
- S(this.editorRef.editorInstance, this.history[0]?.script ?? "", this.messages.disclaimercomment ?? "Expression generated by ArcGIS Arcade Assistant (beta)"), this.isViewingResult = !1, this.setQuestion("");
269
- }}><code slot=content><pre class="break-spaces">${A(this.history[0]?.script ?? "")}</pre></code></calcite-list-item></calcite-list><div class="response-actions"><calcite-button icon-start=plus round kind=brand @click=${() => {
270
- S(this.editorRef.editorInstance, this.history[0]?.script ?? "", this.messages.disclaimercomment ?? "Expression generated by ArcGIS Arcade Assistant (beta)"), this.isViewingResult = !1, this.setQuestion("");
271
- }}>${this.messages.addtoeditor ?? "Add to editor"}</calcite-button><calcite-button id=copy-to-clipboard icon-start=${this.copySuccess ? "check" : "copy-to-clipboard"} round kind=neutral @click=${async () => {
272
- const e = this.history[0]?.script ?? "";
273
- e && (await navigator.clipboard.writeText(e), this.copySuccess = !0, setTimeout(() => {
274
- this.copySuccess = !1;
275
- }, 1500));
276
- }}>${this.copySuccess ? this.messages.copied ?? "Copied!" : ""}</calcite-button><div class="feedback-button-container" id=feedback-buttons><calcite-button id=thumbs-up icon-start=thumbs-up appearance=transparent @click=${() => this.handleFeedbackButton("good")}></calcite-button><calcite-button id=thumbs-down appearance=transparent icon-start=thumbs-down @click=${() => this.handleFeedbackButton("bad")}></calcite-button><calcite-tooltip reference-element=feedback-buttons>${this.messages.providefeedback ?? "Provide feedback"}</calcite-tooltip></div></div><span class="result-disclaimer">${this.messages.reviewcodedisclaimer ?? "Review AI-generated code for accuracy, coherence, and relevance before using it."}</span></calcite-block>` || ""}<calcite-block .hidden=${this.isViewingResult || this.isDisabled || this.history.length < 1} .disabled=${this.isViewingResult || this.isDisabled || this.history.length < 1} class="no-space-block" collapsible .expanded=${this.history.length > 0} .heading=${this.messages.recentprompts ?? "Recent prompts"}><calcite-list class="prompt-list" .label=${this.messages.historylist ?? "History list"}>${this.history.map((e) => o`<calcite-list-item class="type-history" .label=${e.question} @calciteListItemSelect=${() => {
277
- this.errorMessage = "", this.setQuestion(e.question), this.textAreaRef.value?.setFocus();
278
- }}><calcite-icon icon=recent scale=s slot=content-end></calcite-icon></calcite-list-item>`)}</calcite-list></calcite-block>${this.feedbackActive ? o`<calcite-shell>${ee({ open: this.feedbackActive, setOpen: this.handleFeedbackSheetClose, messages: this.messages, feedbackValue: this.feedbackValue ?? "good", setFeedbackValue: (e) => this.feedbackValue = e, feedbackText: this.feedbackText ?? "", setFeedbackText: (e) => this.feedbackText = e, onSubmit: this.handleFeedbackSubmit })}</calcite-shell>` : null}${!this.isViewingResult && o`<span class="result-disclaimer">${this.messages.aigenerated} ${this.messages.seeterms}</span>` || ""}</calcite-flow-item></calcite-flow>` : o`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${C({ slot: "content-top", messages: this.messages, assistantsEnabled: this.assistantsEnabled })}</calcite-flow-item></calcite-flow>`;
307
+ return this.closed ? null : this.assistantsEnabled ? n`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${K({ messages: this.messages })}${X({ popoverContent: C({ assistantsEnabled: this.assistantsEnabled, messages: this.messages }) })}<calcite-shell class="unstyled-shell">${this.splashActive && ae({ messages: { ...k, ...this.messages }, onProceed: () => {
308
+ this.splashActive = !1;
309
+ }, onExit: (e) => this.closePanel && this.closePanel(e) }) || ""}${ee({ active: this.confirmationActive, setActive: (e) => this.confirmationActive = e, messages: this.messages })}${te({ isDisabled: this.isSubmitting, isReadOnly: !1, setQuestion: this.setQuestion, setIsViewingResult: (e) => this.isViewingResult = e, mode: this.isViewingResult ? "refine" : "prompt", textAreaRef: this.textAreaRef, question: this.question, errorMessage: this.errorMessage, setErrorMessage: (e) => this.errorMessage = e, submitQuestion: this.submitQuestion.bind(this), messages: { ...k, ...this.messages } })}<calcite-block-group label="interactive blocks">${!this.isViewingResult && !this.isSubmitting && se({ messages: { ...this.messages, ...k }, suggestions: ["Round value to one decimal place", 'Return "Yes" if value > 10'], onSuggestionClick: this.onSuggestionClick }) || ""}<calcite-block .hidden=${!this.isSubmitting} .heading=${this.messages.generatingresponse ?? "Generating response..."}></calcite-block>${ce({ expanded: this.isViewingResult || this.history.length > 0, messages: { ...this.messages, ...k }, collapsible: !0, showEffectsIcon: this.isViewingResult, cards: this.history.reduce((e, t, a) => (!t.script || this.isViewingResult && a > 0 || (e.push({
310
+ priorPrompt: t.question,
311
+ code: N(t.script ?? "") || t.error || "",
312
+ chips: [
313
+ // TODO implement profile and layer chips
314
+ // {
315
+ // label: item.profile ?? defaultProfile,
316
+ // icon: "map-information",
317
+ // appearance: "outline",
318
+ // scale: "s",
319
+ // },
320
+ // { label: "1 layer", icon: "layer", appearance: "outline", scale: "s" },
321
+ ],
322
+ onAddToEditor: () => {
323
+ B(this.editorRef.editorInstance, t.script ?? "", this.messages.disclaimercomment ?? "Expression generated by ArcGIS Arcade Assistant (beta)");
324
+ },
325
+ onCopy: (c) => {
326
+ const o = t.script ?? "";
327
+ o && navigator.clipboard.writeText(o).then(() => {
328
+ this.copySucessIndex = c, setTimeout(() => {
329
+ this.copySucessIndex = -1;
330
+ }, 1500);
331
+ });
332
+ },
333
+ onThumbsUp: () => this.handleFeedbackButton("good", t),
334
+ onThumbsDown: () => this.handleFeedbackButton("bad", t),
335
+ copySuccessIndex: this.copySucessIndex
336
+ }), this.isViewingResult), e), []), heading: this.isViewingResult ? this.messages.besteffort ?? "Here's the assistant's best effort" : this.messages.recentprompts ?? "Recent prompts", hidden: this.isViewingResult ? !this.isViewingResult : !1 })}</calcite-block-group><span class="result-disclaimer">${this.messages.reviewcodedisclaimer ?? "Review AI-generated code for accuracy, coherence, and relevance before using it."}</span>${this.feedback.active ? ie({ open: this.feedback.active, setOpen: this.handleFeedbackSheetClose, messages: this.messages, feedbackValue: this.feedback.value ?? "good", setFeedbackValue: (e) => this.feedback = { ...this.feedback, value: e }, feedbackText: this.feedback.text ?? "", setFeedbackText: (e) => this.feedback = { ...this.feedback, text: e }, onSubmit: this.handleFeedbackSubmit }) : null}</calcite-shell></calcite-flow-item></calcite-flow>` : n`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${C({ slot: "content-top", messages: this.messages, assistantsEnabled: this.assistantsEnabled })}</calcite-flow-item></calcite-flow>`;
279
337
  }
280
338
  }
281
- T("arcgis-arcade-coding-assistant", oe);
339
+ q("arcgis-arcade-coding-assistant", pe);
282
340
  export {
283
- oe as ArcgisArcadeCodingAssistant
341
+ pe as ArcgisArcadeCodingAssistant
284
342
  };
@@ -1,4 +1,5 @@
1
1
  import { JsxNode } from '@arcgis/lumina';
2
+ import { temporaryStrings as TempStrings } from '../../addons/arcade-coding-assistant/temporary-strings.js';
2
3
  import { Ref } from 'lit/directives/ref.js';
3
4
  declare const strings: (value: {
4
5
  arcadeassistant: string;
@@ -101,7 +102,7 @@ export declare function ConfirmationDisplay({ active, setActive, messages, }: {
101
102
  setActive: (e: boolean) => void;
102
103
  messages: Partial<ReturnType<typeof strings>>;
103
104
  }): JsxNode;
104
- export declare function SubmissionDisplay({ isDisabled, isReadOnly, setQuestion, setIsViewingResult, textAreaRef, question, errorMessage, setErrorMessage, submitQuestion, messages, }: {
105
+ export declare function SubmissionDisplay({ isDisabled, isReadOnly, setQuestion, setIsViewingResult, textAreaRef, question, errorMessage, setErrorMessage, submitQuestion, messages, mode, }: {
105
106
  isDisabled: boolean;
106
107
  isReadOnly: boolean;
107
108
  setQuestion: (e: string) => void;
@@ -111,7 +112,8 @@ export declare function SubmissionDisplay({ isDisabled, isReadOnly, setQuestion,
111
112
  errorMessage?: string;
112
113
  setErrorMessage: (e: string) => void;
113
114
  submitQuestion: () => Promise<void>;
114
- messages: Partial<ReturnType<typeof strings>>;
115
+ messages: Partial<ReturnType<typeof strings>> & typeof TempStrings;
116
+ mode: "prompt" | "refine";
115
117
  }): JsxNode;
116
118
  export declare function FeedbackSheetDisplay({ open, setOpen, messages, feedbackValue, setFeedbackValue, feedbackText, setFeedbackText, onSubmit, }: {
117
119
  open: boolean;
@@ -128,4 +130,39 @@ export declare function InfoDisplay({ assistantsEnabled, messages, slot, }: {
128
130
  messages: Partial<ReturnType<typeof strings>>;
129
131
  slot?: HTMLCalciteBlockElement["slot"];
130
132
  }): JsxNode;
133
+ export declare function SplashDisplay({ messages, onProceed, onExit, }: {
134
+ messages: Partial<ReturnType<typeof strings>> & typeof TempStrings;
135
+ onProceed: () => void;
136
+ onExit: (e: Event) => void;
137
+ }): JsxNode;
138
+ export declare function PromptSuggestionsDisplay({ messages, suggestions, onSuggestionClick, }: {
139
+ suggestions: string[];
140
+ onSuggestionClick: (value: string) => void;
141
+ messages: Partial<ReturnType<typeof strings>> & typeof TempStrings;
142
+ }): JsxNode;
143
+ export interface ResponseDisplayCardChip {
144
+ label: string;
145
+ icon?: string;
146
+ scale?: "l" | "m" | "s";
147
+ appearance?: "outline-fill" | "outline" | "solid";
148
+ }
149
+ export interface ResponseDisplayCard {
150
+ priorPrompt: string;
151
+ code: string;
152
+ chips?: ResponseDisplayCardChip[];
153
+ onAddToEditor: () => void;
154
+ onCopy: (index: number) => void;
155
+ onThumbsUp: () => void;
156
+ onThumbsDown: () => void;
157
+ copySuccessIndex?: number;
158
+ }
159
+ export declare function ResponseDisplay({ hidden, expanded, messages, cards, heading, collapsible, showEffectsIcon, }: {
160
+ hidden?: boolean;
161
+ expanded?: boolean;
162
+ heading?: string;
163
+ messages: Partial<ReturnType<typeof strings>> & typeof TempStrings;
164
+ cards: ResponseDisplayCard[];
165
+ showEffectsIcon?: boolean;
166
+ collapsible?: boolean;
167
+ }): JsxNode;
131
168
  export {};
@@ -12,11 +12,14 @@ import "@esri/calcite-components/components/calcite-segmented-control";
12
12
  import "@esri/calcite-components/components/calcite-segmented-control-item";
13
13
  import "@esri/calcite-components/components/calcite-block";
14
14
  import "@esri/calcite-components/components/calcite-link";
15
+ import "@esri/calcite-components/components/calcite-scrim";
16
+ import "@esri/calcite-components/components/calcite-dialog";
17
+ import "@esri/calcite-components/components/calcite-notice";
18
+ import "@esri/calcite-components/components/calcite-chip-group";
19
+ import "@esri/calcite-components/components/calcite-card-group";
20
+ import "@esri/calcite-components/components/calcite-card";
15
21
  import "@esri/calcite-components/components/calcite-flow";
16
22
  import "@esri/calcite-components/components/calcite-flow-item";
17
- import "@esri/calcite-components/components/calcite-list";
18
- import "@esri/calcite-components/components/calcite-list-item";
19
- import "@esri/calcite-components/components/calcite-tooltip";
20
- import "@esri/calcite-components/components/calcite-icon";
21
23
  import "@esri/calcite-components/components/calcite-shell";
24
+ import "@esri/calcite-components/components/calcite-block-group";
22
25
  export * from "./customElement.js";