@arcgis/coding-components 4.33.0-next.157 → 4.33.0-next.158

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 (76) hide show
  1. package/dist/addons/arcade-coding-assistant/chat-helper.d.ts +24 -7
  2. package/dist/addons.js +1 -1
  3. package/dist/cdn/{PEKLAPXM.js → 2GE4H4QO.js} +2 -2
  4. package/dist/cdn/{ROOAZ3XS.js → 3FHPHZ3V.js} +1 -1
  5. package/dist/cdn/{7WJ7J7VC.js → 42CM5GJA.js} +2 -2
  6. package/dist/cdn/{LRRRFZEI.js → 4DNYVR4W.js} +2 -2
  7. package/dist/cdn/{VVNVW53D.js → 4XTYUHXC.js} +2 -2
  8. package/dist/cdn/{JNFBWA7U.js → 4YT5QJKJ.js} +2 -2
  9. package/dist/cdn/{5A2W2JGQ.js → 6JKP2IIK.js} +1 -1
  10. package/dist/cdn/{B2DWB3RE.js → 6O4SLYFZ.js} +2 -2
  11. package/dist/cdn/{RLCNPMAX.js → 74KV3BWU.js} +2 -2
  12. package/dist/cdn/{AVRKPJBZ.js → AVAJNSY6.js} +2 -2
  13. package/dist/cdn/{ICCAXRYM.js → AW2OOGWE.js} +2 -2
  14. package/dist/cdn/{VBSRSKAI.js → CJACLIZA.js} +2 -2
  15. package/dist/cdn/{CF6C7RH4.js → D2YYIEXG.js} +2 -2
  16. package/dist/cdn/{NWCQS4RN.js → DKMNIOYZ.js} +2 -2
  17. package/dist/cdn/{63YGJX3Q.js → FK5EGI6F.js} +2 -2
  18. package/dist/cdn/{Q4MP4G7Q.js → IW7CKMFL.js} +2 -2
  19. package/dist/cdn/{REYPES3K.js → KKPLNDYV.js} +1 -1
  20. package/dist/cdn/{UXCNBPUL.js → L2HBHNJF.js} +2 -2
  21. package/dist/cdn/{AO6VJ7AR.js → LBAP55AH.js} +2 -2
  22. package/dist/cdn/{JINJ3MOZ.js → LGSXKHU5.js} +2 -2
  23. package/dist/cdn/{6T5Z42NQ.js → LKJZROOJ.js} +2 -2
  24. package/dist/cdn/{NL4UMVSX.js → MKD5JT7H.js} +2 -2
  25. package/dist/cdn/{YJ4XQUAL.js → NCULNBPP.js} +2 -2
  26. package/dist/cdn/{3DBMUM2E.js → OHSDBVY6.js} +2 -2
  27. package/dist/cdn/{GJYOLQU6.js → OZSITCUO.js} +2 -2
  28. package/dist/cdn/{UUKDOBDY.js → QOE57UBG.js} +2 -2
  29. package/dist/cdn/{H2D2PSIU.js → QWWZQSMA.js} +2 -2
  30. package/dist/cdn/{53BJLN5C.js → QXXH42TF.js} +2 -2
  31. package/dist/cdn/{VIRZ237W.js → RPHIEOT3.js} +2 -2
  32. package/dist/cdn/{OQZTMOH5.js → SLVGH5SU.js} +2 -2
  33. package/dist/cdn/{3IHAP57X.js → T6YDT5TQ.js} +2 -2
  34. package/dist/cdn/{KW5ZFYC6.js → TRU4N3HH.js} +2 -2
  35. package/dist/cdn/{5KKQKEM7.js → W52OGWNT.js} +4 -4
  36. package/dist/cdn/{DMVIP5KG.js → W6P7VWQI.js} +1 -1
  37. package/dist/cdn/{44ZQZJW7.js → WAAQ2C7V.js} +2 -2
  38. package/dist/cdn/XFOBWMCP.js +6 -0
  39. package/dist/cdn/{INEDXYQ2.js → XGCS5EOU.js} +2 -2
  40. package/dist/cdn/{2EOMTXAM.js → Y3RMI5FF.js} +2 -2
  41. package/dist/cdn/{DCIK6GAB.js → YBPQG5KU.js} +1 -1
  42. package/dist/cdn/{L5ZMTXUX.js → YQPEQZYY.js} +2 -2
  43. package/dist/cdn/{GX7GR7GP.js → YX6CZKVI.js} +2 -2
  44. package/dist/cdn/assets/code-editor/sql-expr.worker.js +8552 -8548
  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.js +133 -104
  62. package/dist/components/arcgis-arcade-editor/customElement.js +1 -1
  63. package/dist/components/arcgis-arcade-results/customElement.js +1 -1
  64. package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
  65. package/dist/components/arcgis-code-editor/customElement.js +1 -1
  66. package/dist/components/arcgis-editor-variables/customElement.js +1 -1
  67. package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
  68. package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
  69. package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
  70. package/dist/docs/api.json +2 -2
  71. package/dist/docs/docs.json +2 -2
  72. package/dist/docs/web-types.json +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/loader.js +1 -1
  75. package/package.json +5 -5
  76. package/dist/cdn/62VVIVFO.js +0 -6
@@ -1,24 +1,35 @@
1
- import { c as U } from "../../chunks/runtime.js";
1
+ import { c as N } from "../../chunks/runtime.js";
2
2
  import { html as c } from "lit-html";
3
- import { nothing as F, LitElement as _ } from "@arcgis/lumina";
4
- import { ref as N, createRef as V } from "lit/directives/ref.js";
5
- import D from "@arcgis/core/identity/IdentityManager.js";
6
- import { u as B } from "../../chunks/useT9n.js";
7
- import { b as z } from "../../chunks/arcade-defaults.js";
8
- import { css as H } from "@lit/reactive-element/css-tag.js";
3
+ import { nothing as U, LitElement as V } from "@arcgis/lumina";
4
+ import { ref as D, createRef as O } from "lit/directives/ref.js";
5
+ import B from "@arcgis/core/identity/IdentityManager.js";
6
+ import { u as z } from "../../chunks/useT9n.js";
7
+ import { b as H } from "../../chunks/arcade-defaults.js";
8
+ import { css as L } from "@lit/reactive-element/css-tag.js";
9
9
  import "lit";
10
- import T from "@arcgis/core/request.js";
11
- import { a as L, e as O } from "../../chunks/monaco-importer.js";
12
- import { repeat as j } from "lit-html/directives/repeat.js";
10
+ import C from "@arcgis/core/request.js";
11
+ import { a as j, e as W } from "../../chunks/monaco-importer.js";
12
+ import { repeat as Q } from "lit-html/directives/repeat.js";
13
13
  import "@arcgis/components-utils";
14
14
  import { unsafeHTML as S } from "lit/directives/unsafe-html.js";
15
- import W from "@arcgis/core/layers/FeatureLayer.js";
16
- import Q from "@arcgis/core/Graphic.js";
17
- import { b as G } from "../../chunks/language-defaults-base.js";
15
+ import G from "@arcgis/core/layers/FeatureLayer.js";
16
+ import J from "@arcgis/core/Graphic.js";
17
+ import { b as Y } from "../../chunks/language-defaults-base.js";
18
18
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
19
19
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
20
- v4.33.0-next.157 */
21
- const J = H`: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)}.unstyled-h3{margin:unset;font-size:var(--calcite-font-size-md)}.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}}.info-block{max-width:450px}#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{flex-direction:row;gap:.5rem;display:flex;padding:.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);margin-top:-1.5rem}.prior-prompt{margin:.25rem 0 .75rem;max-width:95%;overflow-y:hidden;overflow-x:auto;padding:0}code{white-space:pre;font-size:12px;margin:0;overflow-x:auto;font-family:Fira Mono,Consolas,Menlo,monospace;display:block;max-height:12rem;position:relative;padding:.5rem}.code-collapse{margin-inline-start:auto}.copy-button{margin-left:.5rem}.add-to-editor-button{--calcite-internal-button-border-color: unset}}}:host([closed]){display:none}`;
20
+ v4.33.0-next.158 */
21
+ const K = L`: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)}.unstyled-h3{margin:unset;font-size:var(--calcite-font-size-md)}.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}}.info-block{max-width:450px}#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{flex-direction:row;gap:.5rem;display:flex;padding:.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);margin-top:-1.5rem}.prior-prompt{margin:.25rem 0 .75rem;max-width:95%;overflow-y:hidden;overflow-x:auto;padding:0}code{white-space:pre;font-size:12px;margin:0;overflow-x:auto;font-family:Fira Mono,Consolas,Menlo,monospace;display:block;max-height:12rem;position:relative;padding:.5rem}.code-collapse{margin-inline-start:auto}.copy-button{margin-left:.5rem}.add-to-editor-button{--calcite-internal-button-border-color: unset}}}:host([closed]){display:none}`;
22
+ class x extends Error {
23
+ constructor({
24
+ message: e,
25
+ code: t,
26
+ subCode: a,
27
+ details: s,
28
+ source: o
29
+ }) {
30
+ super(e), this.name = "ArcadeAssistantError", this.code = t, this.subCode = a, this.details = s, this.source = o;
31
+ }
32
+ }
22
33
  function E(i) {
23
34
  if (!i)
24
35
  return;
@@ -32,15 +43,15 @@ function E(i) {
32
43
  return;
33
44
  }
34
45
  }
35
- async function Y(i) {
46
+ async function X(i) {
36
47
  const { baseUrl: e, skillId: t, message: a, authToken: s, previousConversationId: o, context: l } = i, r = t ? `${e}/skills/${t}/chat` : `${e}/chat`, n = [], d = {
37
48
  message: a,
38
49
  context: l
39
50
  };
40
51
  o && (d.conversation_id = o);
41
- let g;
52
+ let b;
42
53
  try {
43
- g = await T(r, {
54
+ b = await C(r, {
44
55
  method: "post",
45
56
  headers: {
46
57
  "Content-Type": "application/json",
@@ -49,108 +60,126 @@ async function Y(i) {
49
60
  body: JSON.stringify(d),
50
61
  responseType: "json"
51
62
  });
52
- } catch (v) {
53
- const y = v?.details?.rawResponse || v?.message || String(v), w = E(y), k = new Error(
54
- `Failed to send message: ${a}. Response: ${y}`
55
- );
56
- throw w && (k.arcadeAssistantError = w), k;
63
+ } catch (g) {
64
+ const v = g, A = v.details?.rawResponse || v.message || String(g), y = E(A);
65
+ throw y ? new x(y) : g;
57
66
  }
58
- const h = g.data;
59
- if (!h.hasMore)
60
- throw new Error("Expected hasMore to be true");
61
- n.push(h);
62
- const m = h.conversationId, $ = h.inquiryId;
63
- let p = h.sequenceNumber;
64
- async function x() {
65
- let v = 0;
66
- const y = 25;
67
- for (; v < y; ) {
68
- await new Promise((b) => setTimeout(b, 1e3));
69
- const w = K(m, p, $);
70
- let k;
67
+ const f = b.data;
68
+ n.push(f);
69
+ const h = f.conversationId, $ = f.inquiryId;
70
+ let p = f.sequenceNumber;
71
+ async function w() {
72
+ let g = 0;
73
+ const v = 25;
74
+ for (; g < v; ) {
75
+ await new Promise((k) => setTimeout(k, 1e3));
76
+ const A = Z(h, p, $);
77
+ let y;
71
78
  try {
72
- k = await T(r, {
79
+ y = await C(r, {
73
80
  method: "post",
74
81
  headers: {
75
82
  "Content-Type": "application/json",
76
83
  token: s
77
84
  },
78
- body: JSON.stringify(w),
85
+ body: JSON.stringify(A),
79
86
  responseType: "json"
80
87
  });
81
- } catch (b) {
82
- const R = b?.details?.rawResponse || b?.message || String(b), I = E(R), C = new Error(
83
- `Polling failed. Response: ${R}`
84
- );
85
- throw I && (C.arcadeAssistantError = I), C;
86
- }
87
- const f = k.data;
88
- if (f.context && f.context.kind === "ArcgisErrorAsContext" && f.context.error) {
89
- const b = new Error(
90
- f.context.error.message || "ArcGIS Assistant error"
91
- );
92
- throw b.arcadeAssistantError = { message: f.context.error.message ?? "ArcGIS Assistant error" }, b;
88
+ } catch (k) {
89
+ const T = k, _ = T.details?.rawResponse || T.message || String(k), I = E(_);
90
+ throw I ? new x(I) : k;
93
91
  }
94
- if (n.push(f), p = f.sequenceNumber, v++, !f.hasMore)
92
+ const m = y.data;
93
+ if (m.context && m.context.kind === "ArcgisErrorAsContext" && m.context.error)
94
+ throw new x({
95
+ message: m.context.error.message || "ArcGIS Assistant error",
96
+ code: m.context.error.code,
97
+ subCode: m.context.error.subCode,
98
+ details: m.context.error.details,
99
+ source: "polling-response"
100
+ });
101
+ if (n.push(m), p = m.sequenceNumber, g++, !m.hasMore)
95
102
  break;
96
103
  }
97
- if (v === y)
98
- throw new Error("Request timed out");
104
+ if (g === v)
105
+ throw new x({
106
+ message: "Request timed out",
107
+ code: "TIMEOUT",
108
+ source: "polling"
109
+ });
99
110
  }
100
- return await x(), n;
111
+ const F = 2 * 60 * 1e3;
112
+ return await Promise.race([
113
+ w(),
114
+ new Promise(
115
+ (g, v) => setTimeout(
116
+ () => v(
117
+ new x({
118
+ message: "Request timed out",
119
+ code: "TIMEOUT",
120
+ source: "hard-timeout"
121
+ })
122
+ ),
123
+ F
124
+ )
125
+ )
126
+ ]), n;
101
127
  }
102
- function K(i, e, t) {
128
+ function Z(i, e, t) {
103
129
  return {
104
130
  conversationId: i,
105
131
  inquiryId: t,
106
132
  ackSequenceNumber: e
107
133
  };
108
134
  }
109
- const X = (i) => {
135
+ function ee(i) {
136
+ return i.message.match(/Error in prompt shield/u) ? "I'm having trouble with this request. Try again by rephrasing the question." : i.code === "TIMEOUT" ? "I'm having trouble with this request. Try again by re-asking the same question or rephrasing it." : i.message;
137
+ }
138
+ const te = (i) => {
110
139
  const e = i.value.length, t = 72, a = 180, s = i.offsetWidth, l = Math.max(1, Math.floor(s / 8)), r = Math.ceil(e / l), n = t + (r - 2) * 24;
111
140
  i.style.setProperty("--calcite-text-area-min-height", `${Math.min(n, a)}px`);
112
141
  };
113
- function Z({ messages: i }) {
142
+ function ie({ messages: i }) {
114
143
  return c`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${i.beta ?? "Beta"}>${i.beta ?? "Beta"}</calcite-chip>`;
115
144
  }
116
- function ee({ popoverContent: i }) {
145
+ function ae({ popoverContent: i }) {
117
146
  return c`<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>`;
118
147
  }
119
- function te({ errorMessage: i }) {
148
+ function oe({ errorMessage: i }) {
120
149
  return c`<calcite-input-message id=error-message status=invalid slot=footer-start icon=exclamation-mark-triangle scale=m>${i}</calcite-input-message>`;
121
150
  }
122
- function ie({ active: i, setActive: e, messages: t }) {
151
+ function se({ active: i, setActive: e, messages: t }) {
123
152
  return c`<calcite-alert slot=alerts .open=${i} placement=bottom kind=success icon=check-circle-f auto-close @calciteAlertClose=${() => e(!1)} .label=${t.expressionapplied ?? "Expression applied"}><div slot=message>${t.expressionapplied ?? "Expression applied to editor."}</div></calcite-alert>`;
124
153
  }
125
- function ae({ isDisabled: i, isReadOnly: e, setQuestion: t, setIsViewingResult: a, textAreaRef: s, question: o, errorMessage: l, setErrorMessage: r, submitQuestion: n, messages: d, mode: g }) {
126
- return c`<div class="text-area-wrapper"><calcite-text-area resize=vertical .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=${o} @calciteTextAreaInput=${(h) => {
127
- X(h.target), t(h.target.value);
128
- }} ${N(s)}>${l && te({ errorMessage: l }) || ""}</calcite-text-area><div class="response-actions" slot=footer-end><calcite-button round kind=neutral .hidden=${g !== "refine"} icon-start=arrow-left appearance=solid .disabled=${i} @click=${async () => {
154
+ function ce({ isDisabled: i, isReadOnly: e, setQuestion: t, setIsViewingResult: a, textAreaRef: s, question: o, errorMessage: l, setErrorMessage: r, submitQuestion: n, messages: d, mode: b }) {
155
+ return c`<div class="text-area-wrapper"><calcite-text-area resize=vertical .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=${o} @calciteTextAreaInput=${(f) => {
156
+ te(f.target), t(f.target.value);
157
+ }} ${D(s)}>${l && oe({ errorMessage: l }) || ""}</calcite-text-area><div class="response-actions" slot=footer-end><calcite-button round kind=neutral .hidden=${b !== "refine"} icon-start=arrow-left appearance=solid .disabled=${i} @click=${async () => {
129
158
  a(!1), t("");
130
159
  }}>${d.startover ?? "Start Over"}</calcite-button><calcite-button round icon-end=effects appearance=solid .loading=${i} .disabled=${i} @click=${async () => {
131
160
  r(o ? "" : d.enteraprompt ?? "Please enter a prompt"), await n();
132
- }}>${g === "prompt" ? d.ask ?? "Generate" : d.refine ?? "Refine"}</calcite-button></div></div>`;
161
+ }}>${b === "prompt" ? d.ask ?? "Generate" : d.refine ?? "Refine"}</calcite-button></div></div>`;
133
162
  }
134
- const oe = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-statement", se = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement";
135
- function ce({ setOpen: i, messages: e, feedback: t, setFeedback: a, onSubmit: s }) {
163
+ const re = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-statement", ne = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement";
164
+ function le({ setOpen: i, messages: e, feedback: t, setFeedback: a, onSubmit: s }) {
136
165
  return c`<calcite-sheet class="feedback-sheet" .label=${e.feedback ?? "Feedback"} slot=sheets display-mode=float position=block-end .open=${t.active} @calciteSheetClose=${() => i(!1)}><calcite-panel .heading=${e.providefeedback ?? "Provide feedback"} .description=${e.experiencehelps ?? "Your experience helps guide future improvements"}><div class="feedback-content"><calcite-label>${e.experiencehelpful ?? "Was the assistant helpful?"}<calcite-segmented-control scale=l><calcite-segmented-control-item icon-start=thumbs-up .checked=${t.value === "good"} @click=${() => a({ ...t, value: "good" })}></calcite-segmented-control-item><calcite-segmented-control-item icon-start=thumbs-down .checked=${t.value === "bad"} @click=${() => a({ ...t, value: "bad" })}></calcite-segmented-control-item></calcite-segmented-control></calcite-label><calcite-label>${e.describeexperience ?? "Describe your experience"}<calcite-text-area resize=vertical .value=${t.text} @calciteTextAreaInput=${(o) => a({ ...t, text: o.target.value })}></calcite-text-area></calcite-label><calcite-label layout=inline scale=s><calcite-checkbox scale=l .checked=${t.termsAccepted} @calciteCheckboxChange=${(o) => {
137
166
  a({ ...t, termsAccepted: o.target.checked });
138
- }}></calcite-checkbox><span>${S(e.agreement?.replace("{EsriPrivacyStatement}", `<calcite-link href=${oe} target="_blank">${e.esriprivacystatement ?? "Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}", `<calcite-link href=${se} target="_blank">${e.supplement ?? "Supplement"}</calcite-link>`))}</span></calcite-label></div><calcite-button slot=footer width=full @click=${s} .disabled=${!t.termsAccepted || t.submitting} .loading=${t.submitting}>${e.submitfeedback ?? "Submit Feedback"}</calcite-button></calcite-panel></calcite-sheet>`;
167
+ }}></calcite-checkbox><span>${S(e.agreement?.replace("{EsriPrivacyStatement}", `<calcite-link href=${re} target="_blank">${e.esriprivacystatement ?? "Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}", `<calcite-link href=${ne} target="_blank">${e.supplement ?? "Supplement"}</calcite-link>`))}</span></calcite-label></div><calcite-button slot=footer width=full @click=${s} .disabled=${!t.termsAccepted || t.submitting} .loading=${t.submitting}>${e.submitfeedback ?? "Submit Feedback"}</calcite-button></calcite-panel></calcite-sheet>`;
139
168
  }
140
169
  function M({ assistantsEnabled: i, messages: e, slot: t, assistantHelpUrl: a, helpTopicUrl: s }) {
141
- return c`<calcite-block .label=${e.assistantinformation ?? "Assistant information"} slot=${t ?? F} expanded class="info-block"><calcite-chip .label=${e.new ?? "new"} kind=brand>${e.new}</calcite-chip><h1 class="info-heading">${e.introducing}</h1><p>${e.capabilities}</p>${i ? c`<p>${e.keepinmind ?? "Keep in mind the following:"}<ul><li>${e.beconsise ?? "Be concise, but also clear in your request"}</li><li>${e.avoidambiguity ?? "Avoid ambiguity and vagueness"}</li><li>${e.moredetails ?? "you do not need to use exact field names in your instructions, but more detail is generally better"}</li></ul>${S((e.seedocumentation ?? "Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}", `<calcite-link href=${s} target="_blank">${e.documentation ?? "documentation"}</calcite-link>`))}</p>` : c`<p>${S(e.useofassistant?.replace("{aiassistants}", `<strong>${e.aiassistants ?? "Ai Assistants"}</strong>`))}<calcite-link .href=${a} target=_blank icon-end=launch-2>${e.opensettings ?? "Open Settings"}</calcite-link></p>`}</calcite-block>`;
170
+ return c`<calcite-block .label=${e.assistantinformation ?? "Assistant information"} slot=${t ?? U} expanded class="info-block"><calcite-chip .label=${e.new ?? "new"} kind=brand>${e.new}</calcite-chip><h1 class="info-heading">${e.introducing}</h1><p>${e.capabilities}</p>${i ? c`<p>${e.keepinmind ?? "Keep in mind the following:"}<ul><li>${e.beconsise ?? "Be concise, but also clear in your request"}</li><li>${e.avoidambiguity ?? "Avoid ambiguity and vagueness"}</li><li>${e.moredetails ?? "you do not need to use exact field names in your instructions, but more detail is generally better"}</li></ul>${S((e.seedocumentation ?? "Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}", `<calcite-link href=${s} target="_blank">${e.documentation ?? "documentation"}</calcite-link>`))}</p>` : c`<p>${S(e.useofassistant?.replace("{aiassistants}", `<strong>${e.aiassistants ?? "Ai Assistants"}</strong>`))}<calcite-link .href=${a} target=_blank icon-end=launch-2>${e.opensettings ?? "Open Settings"}</calcite-link></p>`}</calcite-block>`;
142
171
  }
143
- function re({ messages: i, onProceed: e, onExit: t, helpTopicUrl: a }) {
172
+ function de({ messages: i, onProceed: e, onExit: t, helpTopicUrl: a }) {
144
173
  return c`<calcite-dialog close-disabled placement=top .heading=${i.welcome} slot=dialogs open width-scale=m id=welcome-dialog><h3 class="unstyled-h3">${i.beforeyougetstarted}</h3><ul><li>${i.maybeincorrect}</li><li>${S(i.pleasereadhelp.replace("{helpTopic}", `<calcite-link href=${a} target="_blank">${i.helptopic}</calcite-link>`))}</li></ul><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
174
  }
146
- function ne({ messages: i, suggestions: e, onSuggestionClick: t }) {
147
- return c`<calcite-block .heading=${i.promptsuggestions} expanded collapsible id=suggestion-block><calcite-chip-group .label=${i.promptsuggestions} class="suggestion-chips">${j(e, (a) => a, (a) => c`<calcite-chip .label=${i.promptsuggestion} .value=${a} icon=effects @click=${() => t?.(a)}>${a}</calcite-chip>`)}</calcite-chip-group></calcite-block>`;
175
+ function pe({ messages: i, suggestions: e, onSuggestionClick: t }) {
176
+ return c`<calcite-block .heading=${i.promptsuggestions} expanded collapsible id=suggestion-block><calcite-chip-group .label=${i.promptsuggestions} class="suggestion-chips">${Q(e, (a) => a, (a) => c`<calcite-chip .label=${i.promptsuggestion} .value=${a} icon=effects @click=${() => t?.(a)}>${a}</calcite-chip>`)}</calcite-chip-group></calcite-block>`;
148
177
  }
149
- function le({ hidden: i = !1, expanded: e = !1, messages: t, cards: a, heading: s, collapsible: o = !1, showEffectsIcon: l = !1, editorInsertMode: r = "add", setEditorInsertMode: n }) {
150
- const d = r === "replace", g = d ? t.replaceineditor ?? "Replace in editor" : t.addtoeditor ?? "Add to editor", h = d ? t.addtoeditor ?? "Add to editor" : t.replaceineditor ?? "Replace in editor";
151
- return c`<calcite-block .hidden=${i} id=result-block .heading=${s ?? t.besteffort ?? "Here is the assistant's best effort"} .expanded=${e} .collapsible=${o}>${l && c`<calcite-chip label slot=content-start icon=effects kind=brand></calcite-chip>` || ""}<calcite-card-group .label=${t.assistantresponses}>${a.map((m, $) => c`<calcite-card><div slot=heading><div class="prior-prompt">${m.priorPrompt}</div></div><div><div class="code-response-wrapper"><div class="positioned-code-content">${m.chips?.map((p, x) => c`${p.tooltip && c`<calcite-tooltip .referenceElement=${`response-chip-${p.conversationId}-${x}`}>${p.tooltip}</calcite-tooltip>` || ""}<calcite-chip .label=${p.label} .scale=${p.scale ?? "s"} .appearance=${p.appearance ?? "outline"} .icon=${p.icon} .id=${`response-chip-${p.conversationId}-${x}`}>${p.label}</calcite-chip>`)}</div><code>${m.code}</code></div></div><div slot=footer-start><calcite-split-button primary-text=${g ?? F} appearance=outline-fill class="add-to-editor-button" @calciteSplitButtonPrimaryClick=${() => m.onAddToEditor()} overlay-positioning=fixed><calcite-dropdown-item @calciteDropdownItemSelect=${() => {
178
+ function ue({ hidden: i = !1, expanded: e = !1, messages: t, cards: a, heading: s, collapsible: o = !1, showEffectsIcon: l = !1, editorInsertMode: r = "add", setEditorInsertMode: n }) {
179
+ const d = r === "replace", b = d ? t.replaceineditor ?? "Replace in editor" : t.addtoeditor ?? "Add to editor", f = d ? t.addtoeditor ?? "Add to editor" : t.replaceineditor ?? "Replace in editor";
180
+ return c`<calcite-block .hidden=${i} id=result-block .heading=${s ?? t.besteffort ?? "Here is the assistant's best effort"} .expanded=${e} .collapsible=${o}>${l && c`<calcite-chip label slot=content-start icon=effects kind=brand></calcite-chip>` || ""}<calcite-card-group .label=${t.assistantresponses}>${a.map((h, $) => c`<calcite-card><div slot=heading><div class="prior-prompt">${h.priorPrompt}</div></div><div><div class="code-response-wrapper"><div class="positioned-code-content">${h.chips?.map((p, w) => c`${p.tooltip && c`<calcite-tooltip .referenceElement=${`response-chip-${p.conversationId}-${w}`}>${p.tooltip}</calcite-tooltip>` || ""}<calcite-chip .label=${p.label} .scale=${p.scale ?? "s"} .appearance=${p.appearance ?? "outline"} .icon=${p.icon} .id=${`response-chip-${p.conversationId}-${w}`}>${p.label}</calcite-chip>`)}</div><code>${h.code}</code></div></div><div slot=footer-start><calcite-split-button primary-text=${b ?? U} appearance=outline-fill class="add-to-editor-button" @calciteSplitButtonPrimaryClick=${() => h.onAddToEditor()} overlay-positioning=fixed><calcite-dropdown-item @calciteDropdownItemSelect=${() => {
152
181
  n?.(d ? "add" : "replace");
153
- }}>${h}</calcite-dropdown-item></calcite-split-button><calcite-button round icon-start=copy-to-clipboard kind=neutral @click=${() => m.onCopy($)} class="copy-button">${m.copySuccessIndex === $ ? t.copied ?? "copied" : ""}</calcite-button></div><div slot=footer-end class="feedback-actions"><calcite-action .text=${t.thumbsup} scale=s icon=thumbs-up @click=${m.onThumbsUp}></calcite-action><calcite-action .text=${t.thumbsdown} scale=s icon=thumbs-down @click=${m.onThumbsDown}></calcite-action></div></calcite-card>`)}</calcite-card-group></calcite-block>`;
182
+ }}>${f}</calcite-dropdown-item></calcite-split-button><calcite-button round icon-start=copy-to-clipboard kind=neutral @click=${() => h.onCopy($)} class="copy-button">${h.copySuccessIndex === $ ? t.copied ?? "copied" : ""}</calcite-button></div><div slot=footer-end class="feedback-actions"><calcite-action .text=${t.thumbsup} scale=s icon=thumbs-up @click=${h.onThumbsUp}></calcite-action><calcite-action .text=${t.thumbsdown} scale=s icon=thumbs-down @click=${h.onThumbsDown}></calcite-action></div></calcite-card>`)}</calcite-card-group></calcite-block>`;
154
183
  }
155
184
  const u = {
156
185
  welcome: "Welcome to the new assistant experience",
@@ -186,7 +215,7 @@ const u = {
186
215
  numlayers: "{numLayers} {layerOrLayers}",
187
216
  numlayersplural: "layers",
188
217
  numlayerssingular: "layer"
189
- }, de = "arcade_generation", pe = "ArcadeCodeRequest", A = "visualization", ue = "ArcadeAssistant", he = [
218
+ }, he = "arcade_generation", me = "ArcadeCodeRequest", R = "visualization", fe = "ArcadeAssistant", ge = [
190
219
  "your_comments",
191
220
  "user_evaluation",
192
221
  "question",
@@ -197,10 +226,10 @@ const u = {
197
226
  "context",
198
227
  "extras"
199
228
  ];
200
- let P = [], q = !0;
201
- class me extends _ {
229
+ let q = [], P = !0;
230
+ class be extends V {
202
231
  constructor() {
203
- super(...arguments), this.textAreaRef = V(), this.messages = B(), this._feedbackService = void 0, this.handleFeedbackButton = (e, t) => {
232
+ super(...arguments), this.textAreaRef = O(), this.messages = z(), this._feedbackService = void 0, this.handleFeedbackButton = (e, t) => {
204
233
  this.feedback = { ...this.feedback, active: !0, value: e, item: t };
205
234
  }, this.handleFeedbackSheetClose = () => {
206
235
  this.feedback = {
@@ -224,7 +253,7 @@ class me extends _ {
224
253
  question: this.question,
225
254
  answer: this.feedback.item?.script ?? "",
226
255
  useragent: navigator.userAgent,
227
- _source: ue,
256
+ _source: fe,
228
257
  version: this.appVersion ?? "",
229
258
  context: a ? JSON.stringify(a) : "",
230
259
  extras: a?.profileName ?? "",
@@ -232,7 +261,7 @@ class me extends _ {
232
261
  privacy_statement: this.feedback.termsAccepted ? "I_agree" : ""
233
262
  };
234
263
  try {
235
- await e.applyEdits({ addFeatures: [new Q({ attributes: s })] });
264
+ await e.applyEdits({ addFeatures: [new J({ attributes: s })] });
236
265
  } catch (o) {
237
266
  console.error("Error submitting feedback:", o);
238
267
  }
@@ -256,7 +285,7 @@ class me extends _ {
256
285
  this.properties = { isViewingResult: 16, confirmationActive: 16, isSubmitting: 16, errorMessage: 16, question: 16, history: 16, feedback: 16, copySuccessIndex: 16, splashActive: 16, editorInsertMode: 16, closePanel: 0, insertText: 0, helpBase: 1, assistantsEnabled: 5, layer: [1, { type: Object }], orgBaseUrl: 1, serviceUrl: 1, closed: 7, editorRef: 0, feedbackServiceUrl: 1, appVersion: 1 };
257
286
  }
258
287
  static {
259
- this.styles = J;
288
+ this.styles = K;
260
289
  }
261
290
  get disclaimerComment() {
262
291
  return `// ${this.messages.disclaimercomment}
@@ -271,10 +300,10 @@ class me extends _ {
271
300
  async destroy() {
272
301
  }
273
302
  connectedCallback() {
274
- super.connectedCallback(), this.history = P, this.splashActive = q;
303
+ super.connectedCallback(), this.history = q, this.splashActive = P;
275
304
  }
276
305
  disconnectedCallback() {
277
- super.disconnectedCallback(), P = this.history, q = this.splashActive, this.copySuccessTimer && (clearTimeout(this.copySuccessTimer), this.copySuccessTimer = void 0);
306
+ super.disconnectedCallback(), q = this.history, P = this.splashActive, this.copySuccessTimer && (clearTimeout(this.copySuccessTimer), this.copySuccessTimer = void 0);
278
307
  }
279
308
  setFeedbackState(e) {
280
309
  this.feedback = e;
@@ -284,9 +313,9 @@ class me extends _ {
284
313
  return this._feedbackService;
285
314
  if (!this.feedbackServiceUrl)
286
315
  return;
287
- const e = new W({ url: this.feedbackServiceUrl });
316
+ const e = new G({ url: this.feedbackServiceUrl });
288
317
  await e.load();
289
- const t = he.filter((a) => !e.fields.some((s) => s.name === a));
318
+ const t = ge.filter((a) => !e.fields.some((s) => s.name === a));
290
319
  if (t.length > 0) {
291
320
  console.error(`Missing the following fields in feedback service: ${t.join(", ")}. Feedback will not be logged.`);
292
321
  return;
@@ -303,13 +332,13 @@ class me extends _ {
303
332
  const e = await this.getToken(), t = this.getModel();
304
333
  if (!t)
305
334
  return;
306
- const { profileName: a, metadata: s, layerName: o } = await this.getProfileAndMetadata(t.uri), r = (await Y({
335
+ const { profileName: a, metadata: s, layerName: o } = await this.getProfileAndMetadata(t.uri), r = (await X({
307
336
  baseUrl: this.serviceUrl,
308
- skillId: de,
337
+ skillId: he,
309
338
  message: this.question,
310
339
  authToken: e,
311
340
  context: {
312
- kind: pe,
341
+ kind: me,
313
342
  context: {
314
343
  profile_name: a,
315
344
  metadata: s
@@ -320,7 +349,7 @@ class me extends _ {
320
349
  return;
321
350
  r.context?.kind === "ArcadeCodeResponse" && (this.history.unshift({
322
351
  script: r?.context?.arcadeCode?.code,
323
- formattedScript: L(r?.context?.arcadeCode?.code ?? ""),
352
+ formattedScript: j(r?.context?.arcadeCode?.code ?? ""),
324
353
  error: void 0,
325
354
  question: this.question,
326
355
  profile: a,
@@ -328,19 +357,19 @@ class me extends _ {
328
357
  layerName: o ?? void 0
329
358
  }), this.isViewingResult = !0, this.errorMessage = void 0);
330
359
  } catch (e) {
331
- 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);
360
+ e instanceof Error && e.name === "ArcadeAssistantError" ? this.errorMessage = ee(e) || this.messages.erroroccurred || "An error occurred." : this.errorMessage = this.messages.erroroccurred || "An error occurred.", console.error("Error in Arcade Assistant:", e);
332
361
  } finally {
333
362
  this.isSubmitting = !1;
334
363
  }
335
364
  }
336
365
  }
337
366
  async getToken() {
338
- const { token: e } = await D.getCredential(this.orgBaseUrl);
367
+ const { token: e } = await B.getCredential(this.orgBaseUrl);
339
368
  return e;
340
369
  }
341
370
  async getProfileAndMetadata(e) {
342
- let t = A;
343
- const a = z.getEditorProfileForModel(e);
371
+ let t = R;
372
+ const a = H.getEditorProfileForModel(e);
344
373
  a?.loaded || await a?.loadSource();
345
374
  const s = this.editorRef.profile;
346
375
  s && "id" in s && (t = s.id);
@@ -350,23 +379,23 @@ class me extends _ {
350
379
  name: n.name,
351
380
  type: n.type,
352
381
  alias: n.alias
353
- })), G(o?.definition) && (r = o.definition.title)), { profileName: t, metadata: l, layerName: r };
382
+ })), Y(o?.definition) && (r = o.definition.title)), { profileName: t, metadata: l, layerName: r };
354
383
  }
355
384
  render() {
356
- return this.closed ? null : this.assistantsEnabled ? c`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.splashActive && c`<calcite-scrim></calcite-scrim>` || ""}${Z({ messages: this.messages })}${ee({ popoverContent: M({ assistantsEnabled: this.assistantsEnabled, messages: { ...this.messages, ...u }, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.helpTopicUrl }) })}<calcite-shell class="unstyled-shell">${this.splashActive && re({ messages: { ...u, ...this.messages }, onProceed: () => {
385
+ return this.closed ? null : this.assistantsEnabled ? c`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.splashActive && c`<calcite-scrim></calcite-scrim>` || ""}${ie({ messages: this.messages })}${ae({ popoverContent: M({ assistantsEnabled: this.assistantsEnabled, messages: { ...this.messages, ...u }, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.helpTopicUrl }) })}<calcite-shell class="unstyled-shell">${this.splashActive && de({ messages: { ...u, ...this.messages }, onProceed: () => {
357
386
  this.splashActive = !1;
358
- }, helpTopicUrl: this.helpTopicUrl, onExit: (e) => this.closePanel && this.closePanel(e) }) || ""}${ie({ active: this.confirmationActive, setActive: (e) => this.confirmationActive = e, messages: this.messages })}${ae({ 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: { ...u, ...this.messages } })}<calcite-block-group label="interactive blocks">${!this.isViewingResult && !this.isSubmitting && ne({ messages: { ...this.messages, ...u }, 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>${le({ expanded: this.isViewingResult || this.history.length > 0, messages: { ...this.messages, ...u }, collapsible: !0, showEffectsIcon: this.isViewingResult, editorInsertMode: this.editorInsertMode, setEditorInsertMode: (e) => this.editorInsertMode = e, cards: this.history.reduce((e, t, a) => (!t.script || this.isViewingResult && a > 0 || (e.push({
387
+ }, helpTopicUrl: this.helpTopicUrl, onExit: (e) => this.closePanel && this.closePanel(e) }) || ""}${se({ active: this.confirmationActive, setActive: (e) => this.confirmationActive = e, messages: this.messages })}${ce({ 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: { ...u, ...this.messages } })}<calcite-block-group label="interactive blocks">${!this.isViewingResult && !this.isSubmitting && pe({ messages: { ...this.messages, ...u }, 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>${ue({ expanded: this.isViewingResult || this.history.length > 0, messages: { ...this.messages, ...u }, collapsible: !0, showEffectsIcon: this.isViewingResult, editorInsertMode: this.editorInsertMode, setEditorInsertMode: (e) => this.editorInsertMode = e, cards: this.history.reduce((e, t, a) => (!t.script || this.isViewingResult && a > 0 || (e.push({
359
388
  priorPrompt: t.question,
360
389
  code: t.formattedScript || t.error || "",
361
390
  chips: [
362
391
  // TODO implement profile and layer chips
363
392
  {
364
- label: t.profile ?? A,
393
+ label: t.profile ?? R,
365
394
  icon: "map-information",
366
395
  appearance: "outline",
367
396
  scale: "s",
368
397
  conversationId: t.conversationId ?? "",
369
- tooltip: u.profilecontextlabel.replace("{profileName}", t.profile ?? A)
398
+ tooltip: u.profilecontextlabel.replace("{profileName}", t.profile ?? R)
370
399
  },
371
400
  ...t.layerName ? [
372
401
  {
@@ -380,7 +409,7 @@ class me extends _ {
380
409
  ] : []
381
410
  ],
382
411
  onAddToEditor: () => {
383
- O(this.editorRef.editorInstance, t.formattedScript ?? "", this.editorInsertMode, this.disclaimerComment);
412
+ W(this.editorRef.editorInstance, t.formattedScript ?? "", this.editorInsertMode, this.disclaimerComment);
384
413
  },
385
414
  onCopy: (s) => {
386
415
  const o = t.formattedScript ? `${this.disclaimerComment}
@@ -394,10 +423,10 @@ ${t.formattedScript}` : "";
394
423
  onThumbsUp: () => this.handleFeedbackButton("good", t),
395
424
  onThumbsDown: () => this.handleFeedbackButton("bad", t),
396
425
  copySuccessIndex: this.copySuccessIndex
397
- }), 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>${this.feedback.active ? ce({ setOpen: this.handleFeedbackSheetClose, messages: { ...this.messages, ...u }, onSubmit: this.handleFeedbackSubmit, feedback: this.feedback, setFeedback: this.setFeedbackState.bind(this) }) : null}</calcite-shell></calcite-flow-item></calcite-flow>` : c`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${M({ slot: "content-top", messages: { ...this.messages, ...u }, assistantsEnabled: this.assistantsEnabled, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.helpTopicUrl })}</calcite-flow-item></calcite-flow>`;
426
+ }), 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>${this.feedback.active ? le({ setOpen: this.handleFeedbackSheetClose, messages: { ...this.messages, ...u }, onSubmit: this.handleFeedbackSubmit, feedback: this.feedback, setFeedback: this.setFeedbackState.bind(this) }) : null}</calcite-shell></calcite-flow-item></calcite-flow>` : c`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${M({ slot: "content-top", messages: { ...this.messages, ...u }, assistantsEnabled: this.assistantsEnabled, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.helpTopicUrl })}</calcite-flow-item></calcite-flow>`;
398
427
  }
399
428
  }
400
- U("arcgis-arcade-coding-assistant", me);
429
+ N("arcgis-arcade-coding-assistant", be);
401
430
  export {
402
- me as ArcgisArcadeCodingAssistant
431
+ be as ArcgisArcadeCodingAssistant
403
432
  };
@@ -16,7 +16,7 @@ import { css as w } from "@lit/reactive-element/css-tag.js";
16
16
  import { s as y } from "../../chunks/editor.js";
17
17
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
18
18
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
19
- v4.33.0-next.157 */
19
+ v4.33.0-next.158 */
20
20
  const D = w`@layer{arcgis-arcade-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border)!important;box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%;.sticky{position:sticky;top:0;z-index:10}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1);text-align:center}.main-action-bar{border-bottom:var(--arcgis-coding-components-border)!important;flex:0 0 auto;calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}arcgis-arcade-results{border-top:var(--arcgis-coding-components-border)!important;box-sizing:border-box;max-height:50%;min-height:50%;margin-bottom:-1px}calcite-flow{[slot=footer]{word-break:break-word}}.hidden{display:none}}}`;
21
21
  class C extends m {
22
22
  constructor() {
@@ -8,7 +8,7 @@ import { css as L } from "@lit/reactive-element/css-tag.js";
8
8
  import { s as O } from "../../chunks/fields.js";
9
9
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
10
10
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
11
- v4.33.0-next.157 */
11
+ v4.33.0-next.158 */
12
12
  const D = L`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}.ltr-container{direction:ltr}calcite-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.color-info{color:var(--calcite-color-status-info)}.color-error{color:var(--calcite-color-status-danger)}.color-success{color:var(--calcite-color-status-success)}[class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-md)}.console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-md);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}.result-value-table{table{display:block;max-width:fit-content;overflow-x:auto;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}}.tree-item-label,.number-value,.string-value,.boolean-value{font-family:var(--calcite-code-family)}.tree-item-label,.value-type{color:var(--calcite-color-text-2);font-weight:var(--calcite-font-weight-normal)}.dictionary-property{color:var(--arcgis-editor-identifier)}.number-value{color:var(--arcgis-editor-number)}.string-value{color:var(--arcgis-editor-string);white-space:pre-wrap}.constant-value{color:var(--arcgis-editor-constant)}.date-value{color:var(--arcgis-editor-date)}}`, l = {
13
13
  lines: !0,
14
14
  selectionMode: "none",
@@ -9,7 +9,7 @@ import { u as b } from "../../chunks/useT9n.js";
9
9
  import { css as _ } from "@lit/reactive-element/css-tag.js";
10
10
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
11
11
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
12
- v4.33.0-next.157 */
12
+ v4.33.0-next.158 */
13
13
  function v(o) {
14
14
  return !Array.isArray(o) || !o.length ? !1 : Array.isArray(o[0].suggestions);
15
15
  }
@@ -9,7 +9,7 @@ import { load as h } from "@arcgis/lumina/controllers";
9
9
  import { Range as M, Uri as c, KeyMod as n, KeyCode as t } from "monaco-editor";
10
10
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
11
11
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
12
- v4.33.0-next.157 */
12
+ v4.33.0-next.158 */
13
13
  const x = m`@layer{/*!-----------------------------------------------------------
14
14
  * Copyright (c) Microsoft Corporation. All rights reserved.
15
15
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -7,7 +7,7 @@ import { u as f } from "../../chunks/useT9n.js";
7
7
  import { css as u } from "@lit/reactive-element/css-tag.js";
8
8
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
9
9
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
10
- v4.33.0-next.157 */
10
+ v4.33.0-next.158 */
11
11
  const m = u`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-list-item-group{background-color:var(--calcite-color-foreground-2);word-break:break-word}}`;
12
12
  function g(l) {
13
13
  l.key === "Enter" && l.stopPropagation();
@@ -10,7 +10,7 @@ import { css as v } from "@lit/reactive-element/css-tag.js";
10
10
  import { s as d } from "../../chunks/sql-expr-contribution.js";
11
11
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
12
12
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
13
- v4.33.0-next.157 */
13
+ v4.33.0-next.158 */
14
14
  const y = v`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}code{font-family:var(--calcite-code-family)}pre{direction:ltr;overflow-x:auto;background-color:var(--calcite-color-foreground-2);padding:var(--calcite-spacing-sm);code{font-size:var(--calcite-font-size--2)}}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}}`;
15
15
  class I extends f {
16
16
  constructor() {
@@ -9,7 +9,7 @@ import { css as g } from "@lit/reactive-element/css-tag.js";
9
9
  import { s as f } from "../../chunks/editor.js";
10
10
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
11
11
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
12
- v4.33.0-next.157 */
12
+ v4.33.0-next.158 */
13
13
  const _ = g`@layer{arcgis-sql-expression-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border)!important;box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%}}`;
14
14
  class m extends r {
15
15
  constructor() {
@@ -7,7 +7,7 @@ import { u as m } from "../../chunks/useT9n.js";
7
7
  import { css as d } from "@lit/reactive-element/css-tag.js";
8
8
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
9
9
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
10
- v4.33.0-next.157 */
10
+ v4.33.0-next.158 */
11
11
  const h = d`:host{calcite-flow{height:100%}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}}`;
12
12
  class f extends r {
13
13
  constructor() {
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2025-06-11T04:37:26",
2
+ "timestamp": "2025-06-12T04:35:56",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "4.33.0-next.157",
5
+ "version": "4.33.0-next.158",
6
6
  "typescriptVersion": "5.8.3"
7
7
  },
8
8
  "schemaVersion": "1.0.0",
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2025-06-11T04:37:26",
2
+ "timestamp": "2025-06-12T04:35:56",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "4.33.0-next.157",
5
+ "version": "4.33.0-next.158",
6
6
  "typescriptVersion": "5.8.3"
7
7
  },
8
8
  "components": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@arcgis/coding-components",
4
- "version": "4.33.0-next.157",
4
+ "version": "4.33.0-next.158",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { a as c } from "./chunks/arcade-defaults.js";
3
3
  import { s as p } from "./chunks/sql-expr-defaults.js";
4
4
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
5
5
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
6
- v4.33.0-next.157 */
6
+ v4.33.0-next.158 */
7
7
  const a = s, r = t;
8
8
  export {
9
9
  c as arcade,