@arcgis/coding-components 4.34.0-next.86 → 4.34.0-next.88

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 (90) hide show
  1. package/dist/addons/arcade-coding-assistant/useArcadeAssistant.d.ts +2 -0
  2. package/dist/addons.js +1 -1
  3. package/dist/cdn/{BZZ3OLKH.js → 22CUL3UX.js} +2 -2
  4. package/dist/cdn/2GH2NPFM.js +4 -0
  5. package/dist/cdn/{UUABYQVD.js → 2ZKERAZ4.js} +2 -2
  6. package/dist/cdn/{NJOA4SBB.js → 3AA3VAS3.js} +2 -2
  7. package/dist/cdn/{FN2DWHGZ.js → 55WTGAHC.js} +2 -2
  8. package/dist/cdn/{FCJP5BTI.js → 5MVWTV6I.js} +2 -2
  9. package/dist/cdn/{RIP6VEEO.js → 7JE6E5DM.js} +2 -2
  10. package/dist/cdn/{TLZNAJL6.js → 7WDPVAKR.js} +2 -2
  11. package/dist/cdn/{KSSRE3XQ.js → 7XXD4H2S.js} +1 -1
  12. package/dist/cdn/{3B7VB2X6.js → A6VACHRY.js} +2 -2
  13. package/dist/cdn/{5YLMMOBI.js → AAXWW25P.js} +2 -2
  14. package/dist/cdn/{FQUTR3T7.js → ACWXOQCQ.js} +2 -2
  15. package/dist/cdn/AIR6P3PK.js +4 -0
  16. package/dist/cdn/{OAPYIJ47.js → ASQET4JI.js} +2 -2
  17. package/dist/cdn/{QXCWBWGD.js → BDCMKRWH.js} +1 -1
  18. package/dist/cdn/{TKSDZ3NF.js → BI3MDYLO.js} +2 -2
  19. package/dist/cdn/{MVR5JLC6.js → BT4ZX2SG.js} +2 -2
  20. package/dist/cdn/{2FUDGVYP.js → BUHMRTUD.js} +3 -3
  21. package/dist/cdn/{A6I4PFMU.js → BZ7PF4RD.js} +2 -2
  22. package/dist/cdn/{IJ2G4YOX.js → CRRDYGNS.js} +2 -2
  23. package/dist/cdn/{ZUBNBNKD.js → DEK7IDG5.js} +2 -2
  24. package/dist/cdn/{3WNLVJHE.js → EVDZKJZF.js} +2 -2
  25. package/dist/cdn/{6762YOZL.js → FD5CWRJI.js} +1 -1
  26. package/dist/cdn/{IFU7L5YA.js → HXQJ45ZI.js} +2 -2
  27. package/dist/cdn/{DA2MGOPY.js → KAM2XIYK.js} +2 -2
  28. package/dist/cdn/{A2Y6UL5A.js → KAWNVXLJ.js} +2 -2
  29. package/dist/cdn/{UK22SX7M.js → L7BR4ZAV.js} +2 -2
  30. package/dist/cdn/{CGEASYVQ.js → LIWZ75Z7.js} +2 -2
  31. package/dist/cdn/{IKMFNK6J.js → MLJNF3UH.js} +1 -1
  32. package/dist/cdn/{G4HQYD75.js → N7FIJZ6P.js} +1 -1
  33. package/dist/cdn/{5YL5E5KF.js → PH2FWBAZ.js} +4 -4
  34. package/dist/cdn/{GJYTYZLT.js → RKBA6CHG.js} +2 -2
  35. package/dist/cdn/{IPSQP7FX.js → ROOKN4TA.js} +2 -2
  36. package/dist/cdn/{267VXT7C.js → SI5WP4CZ.js} +2 -2
  37. package/dist/cdn/{ZZCOJ5X5.js → TGZSBCP6.js} +2 -2
  38. package/dist/cdn/{BCYG5NPA.js → THSY5WC7.js} +2 -2
  39. package/dist/cdn/{4D4OM3XG.js → TXX6LDEZ.js} +2 -2
  40. package/dist/cdn/{RFKVHUDC.js → UJDFGLV3.js} +1 -1
  41. package/dist/cdn/{5L2I6U32.js → UTD5AEKP.js} +2 -2
  42. package/dist/cdn/{7YDVVJVD.js → VUKQWE3K.js} +2 -2
  43. package/dist/cdn/{SKE3PFKL.js → WLMF7G6D.js} +2 -2
  44. package/dist/cdn/{ZDT6IM7U.js → XFLZQYYX.js} +2 -2
  45. package/dist/cdn/assets/arcade-editor/t9n/messages.en.json +1 -1
  46. package/dist/cdn/assets/code-editor/sql-expr.worker.js +45096 -44897
  47. package/dist/cdn/index.js +2 -2
  48. package/dist/chunks/arcade-defaults.js +1 -1
  49. package/dist/chunks/arcade-executor.js +1 -1
  50. package/dist/chunks/arcade-mode.js +1 -1
  51. package/dist/chunks/arcade-service-accessors.js +1 -1
  52. package/dist/chunks/editor.js +1 -1
  53. package/dist/chunks/fields.js +1 -1
  54. package/dist/chunks/language-defaults-base.js +1 -1
  55. package/dist/chunks/markdown.js +1 -1
  56. package/dist/chunks/monaco-importer.js +1 -1
  57. package/dist/chunks/runtime.js +1 -1
  58. package/dist/chunks/setup-monaco.js +1 -1
  59. package/dist/chunks/sql-expr-contribution.js +1 -1
  60. package/dist/chunks/sql-expr-defaults.js +1 -1
  61. package/dist/chunks/sql-expr-mode.js +1 -1
  62. package/dist/chunks/useT9n.js +1 -1
  63. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +1 -1
  64. package/dist/components/arcgis-arcade-editor/customElement.d.ts +4 -1
  65. package/dist/components/arcgis-arcade-editor/customElement.js +108 -56
  66. package/dist/components/arcgis-arcade-editor/index.d.ts +1 -0
  67. package/dist/components/arcgis-arcade-editor/index.js +1 -0
  68. package/dist/components/arcgis-arcade-results/customElement.js +1 -1
  69. package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
  70. package/dist/components/arcgis-code-editor/customElement.d.ts +1 -1
  71. package/dist/components/arcgis-code-editor/customElement.js +2 -2
  72. package/dist/components/arcgis-editor-variables/customElement.js +1 -1
  73. package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
  74. package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
  75. package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
  76. package/dist/docs/api.json +13 -24
  77. package/dist/docs/docs.json +23 -12
  78. package/dist/docs/vscode.html-custom-data.json +0 -5
  79. package/dist/docs/web-types.json +8 -10
  80. package/dist/index.js +1 -1
  81. package/dist/loader.js +6 -6
  82. package/dist/types/lumina.d.ts +1 -1
  83. package/dist/types/preact.d.ts +1 -1
  84. package/dist/types/react.d.ts +1 -1
  85. package/dist/types/stencil.d.ts +1 -1
  86. package/dist/utils/arcade-assistant/types.d.ts +28 -0
  87. package/dist/utils/arcade-assistant/utils.d.ts +9 -0
  88. package/package.json +5 -5
  89. package/dist/cdn/AWUIHID7.js +0 -4
  90. package/dist/cdn/LJKRENXI.js +0 -4
package/dist/cdn/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
2
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
3
- v4.34.0-next.86 */
4
- import{C as i,o as e}from"./IFU7L5YA.js";import"./LJKRENXI.js";import"./6762YOZL.js";var r=e(i,{"arcgis-arcade-coding-assistant":[()=>import("./GJYTYZLT.js"),"appVersion,assistantsEnabled,closed,closePanel:,editorRef:,feedbackServiceUrl,helpBase,insertText:,layer,portalUrl,serviceUrl;destroy"],"arcgis-arcade-editor":[()=>import("./AWUIHID7.js"),"customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,openedSidePanel:,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getEditorInstance,getScript,getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./A6I4PFMU.js"),"consoleLogs:,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./4D4OM3XG.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./2FUDGVYP.js"),"editorInstance:,editorOptions:,language,modelId,value;getEditorInstance,getValue,insertSnippet,insertText,setFocus,setValue"],"arcgis-editor-variables":[()=>import("./OAPYIJ47.js"),"closed,loading,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./ZUBNBNKD.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./UK22SX7M.js"),"hideSideBar,profile:,script"],"arcgis-sql-expression-fields":[()=>import("./FN2DWHGZ.js"),"loading,modelId"]});r({resourcesUrl:import.meta.url});var o=new CSSStyleSheet;o.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-sql-expression-editor){visibility:hidden}:root{--arcgis-coding-components-border: 1px solid var(--calcite-color-border-3);--arcgis-coding-components-background-color: var(--calcite-color-foreground-1);--arcgis-coding-components-side-action-bar-max-w: 25%;--arcgis-coding-components-side-panel-w: 600px;--arcgis-coding-components-side-panel-max-w: 45%;--arcgis-editor-comment: #606060;--arcgis-editor-constant: #9809C8;--arcgis-editor-date: #296389;--arcgis-editor-identifier: #0000B3;--arcgis-editor-keyword: #BF4900;--arcgis-editor-number: #136D3D;--arcgis-editor-string: #A31515}.calcite-mode-dark{--arcgis-editor-comment: #BFBFBF;--arcgis-editor-constant: #CDBAEA;--arcgis-editor-date: #97A6CE;--arcgis-editor-identifier: #9FD4F3;--arcgis-editor-keyword: #EEAA5A;--arcgis-editor-number: #AAD04B;--arcgis-editor-string: #F2877B}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,o];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,i)
3
+ v4.34.0-next.88 */
4
+ import{C as i,o as e}from"./HXQJ45ZI.js";import"./AIR6P3PK.js";import"./FD5CWRJI.js";var r=e(i,{"arcgis-arcade-coding-assistant":[()=>import("./RKBA6CHG.js"),"appVersion,assistantsEnabled,closed,closePanel:,editorRef:,feedbackServiceUrl,helpBase,insertText:,layer,portalUrl,serviceUrl;destroy"],"arcgis-arcade-editor":[()=>import("./2GH2NPFM.js"),"arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,openedSidePanel:,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getEditorInstance,getScript,getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./BZ7PF4RD.js"),"consoleLogs:,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./TXX6LDEZ.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./BUHMRTUD.js"),"editorInstance:,editorOptions:,language,modelId:,value;getEditorInstance,getValue,insertSnippet,insertText,setFocus,setValue"],"arcgis-editor-variables":[()=>import("./ASQET4JI.js"),"closed,loading,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./DEK7IDG5.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./L7BR4ZAV.js"),"hideSideBar,profile:,script"],"arcgis-sql-expression-fields":[()=>import("./55WTGAHC.js"),"loading,modelId"]});r({resourcesUrl:import.meta.url});var o=new CSSStyleSheet;o.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-sql-expression-editor){visibility:hidden}:root{--arcgis-coding-components-border: 1px solid var(--calcite-color-border-3);--arcgis-coding-components-background-color: var(--calcite-color-foreground-1);--arcgis-coding-components-side-action-bar-max-w: 25%;--arcgis-coding-components-side-panel-w: 600px;--arcgis-coding-components-side-panel-max-w: 45%;--arcgis-editor-comment: #606060;--arcgis-editor-constant: #9809C8;--arcgis-editor-date: #296389;--arcgis-editor-identifier: #0000B3;--arcgis-editor-keyword: #BF4900;--arcgis-editor-number: #136D3D;--arcgis-editor-string: #A31515}.calcite-mode-dark{--arcgis-editor-comment: #BFBFBF;--arcgis-editor-constant: #CDBAEA;--arcgis-editor-date: #97A6CE;--arcgis-editor-identifier: #9FD4F3;--arcgis-editor-keyword: #EEAA5A;--arcgis-editor-number: #AAD04B;--arcgis-editor-string: #F2877B}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,o];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,i)
@@ -4,7 +4,7 @@ import { g as m } from "./runtime.js";
4
4
  import { CompletionItemKind as w, InsertTextFormat as f, InsertTextMode as d } from "vscode-languageserver-types";
5
5
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
6
6
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
7
- v4.34.0-next.86 */
7
+ v4.34.0-next.88 */
8
8
  async function S(e) {
9
9
  const { apiVersion: i, bundles: t, hiddenApiItems: n } = e.toEditorProfileDefinition(), r = await h(e.dictionaryVariables);
10
10
  return { apiVersion: i, bundles: t, variables: r, hiddenApiItems: n?.map((s) => s.toLowerCase()) };
@@ -1,7 +1,7 @@
1
1
  import { createArcadeExecutor as C } from "@arcgis/core/arcade.js";
2
2
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
- v4.34.0-next.86 */
4
+ v4.34.0-next.88 */
5
5
  const G = "https://developers.arcgis.com/arcade/", O = 100, A = 100;
6
6
  function u(t) {
7
7
  return !!t && typeof t == "object" && "declaredRootClass" in t && typeof t.declaredRootClass == "string" && t.declaredRootClass === "esri.arcade.featureset.support.FeatureSet";
@@ -9,7 +9,7 @@ import { debounce as F } from "@arcgis/toolkit/function";
9
9
  import { Deferred as _ } from "@arcgis/toolkit/promise";
10
10
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
11
11
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
12
- v4.34.0-next.86 */
12
+ v4.34.0-next.88 */
13
13
  const S = [
14
14
  "<=",
15
15
  ">=",
@@ -1,6 +1,6 @@
1
1
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
2
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
3
- v4.34.0-next.86 */
3
+ v4.34.0-next.88 */
4
4
  async function a() {
5
5
  return (await e()).getArcadeDiagnosticService();
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { css as e } from "lit";
2
2
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
- v4.34.0-next.86 */
4
+ v4.34.0-next.88 */
5
5
  const o = e`@layer{arcgis-arcade-editor,arcgis-sql-expression-editor{.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-panel{flex:1 0 auto}.position-relative{position:relative}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.border-inline-start{border-inline-start:var(--arcgis-coding-components-border)!important;box-sizing:border-box}.border-inline-end{border-inline-end:var(--arcgis-coding-components-border)!important;box-sizing:border-box}.side-action-bar{max-width:var(--arcgis-coding-components-side-action-bar-max-w)}.side-panel{max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w)}.side-panel calcite-flow{height:100%}}}`;
6
6
  export {
7
7
  o as s
@@ -1,6 +1,6 @@
1
1
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
2
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
3
- v4.34.0-next.86 */
3
+ v4.34.0-next.88 */
4
4
  function t(e) {
5
5
  switch (e.type) {
6
6
  case "oid":
@@ -14,7 +14,7 @@ import { filterApiLibraryForContext as le } from "@arcgis/languages-api-utils";
14
14
  import { Emitter as x, Uri as $ } from "monaco-editor";
15
15
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
16
16
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
17
- v4.34.0-next.86 */
17
+ v4.34.0-next.88 */
18
18
  function B(t) {
19
19
  return !!t && typeof t == "object" && "declaredClass" in t && typeof t.declaredClass == "string" && t.declaredClass.startsWith("esri.layers.") && g(t) && "queryFeatures" in t && typeof t.queryFeatures == "function";
20
20
  }
@@ -4,7 +4,7 @@ import { IStandaloneThemeService as ie } from "monaco-editor/esm/vs/editor/stand
4
4
  import { generateTokensCSSForColorMap as we } from "monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js";
5
5
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
6
6
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
7
- v4.34.0-next.86 */
7
+ v4.34.0-next.88 */
8
8
  async function ye(r, e) {
9
9
  return await (await me()).colorize(r, e, { tabSize: 2 });
10
10
  }
@@ -6,7 +6,7 @@ import "monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js";
6
6
  import "monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js";
7
7
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
8
8
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
9
- v4.34.0-next.86 */
9
+ v4.34.0-next.88 */
10
10
  function $(e, n, l, i) {
11
11
  if (!n)
12
12
  return [];
@@ -2,7 +2,7 @@ import { makeRuntime as e } from "@arcgis/lumina";
2
2
  import { trackAccess as s, createObservable as r, createTrackingTarget as a, runTracked as c } from "@arcgis/core/applications/Components/reactiveUtils.js";
3
3
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
4
4
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
5
- v4.34.0-next.86 */
5
+ v4.34.0-next.88 */
6
6
  const t = e({ defaultAssetPath: "https://jsdev.arcgis.com/next/coding-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: d, setAssetPath: i } = t;
7
7
  t.t = s;
8
8
  t.o = r;
@@ -1,7 +1,7 @@
1
1
  import i from "@arcgis/core/request.js";
2
2
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
- v4.34.0-next.86 */
4
+ v4.34.0-next.88 */
5
5
  function p() {
6
6
  return !!window.MonacoEnvironment?.getWorkerUrl;
7
7
  }
@@ -8,7 +8,7 @@ import { g as c } from "./arcade-service-accessors.js";
8
8
  import { a as n } from "./sql-expr-defaults.js";
9
9
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
10
10
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
11
- v4.34.0-next.86 */
11
+ v4.34.0-next.88 */
12
12
  const s = /* @__PURE__ */ new Set();
13
13
  function g(e, o) {
14
14
  return () => {
@@ -4,7 +4,7 @@ import { fetchT9nStringsBundle as M } from "@arcgis/toolkit/intl";
4
4
  import { g as b } from "./runtime.js";
5
5
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
6
6
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
7
- v4.34.0-next.86 */
7
+ v4.34.0-next.88 */
8
8
  const x = (r) => {
9
9
  const e = r.variables[0], i = e && e.type === "featureSet" ? A(e) : void 0, { apiVersion: t, bundles: o, hiddenApiItems: s } = r.toEditorProfileDefinition();
10
10
  return {
@@ -8,7 +8,7 @@ import { a as d } from "./sql-expr-defaults.js";
8
8
  import { debounce as N } from "@arcgis/toolkit/function";
9
9
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
10
10
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
11
- v4.34.0-next.86 */
11
+ v4.34.0-next.88 */
12
12
  let h = new _();
13
13
  class k {
14
14
  constructor(e) {
@@ -2,7 +2,7 @@ import { makeT9nController as o } from "@arcgis/lumina/controllers";
2
2
  import { g as t } from "./runtime.js";
3
3
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
4
4
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
5
- v4.34.0-next.86 */
5
+ v4.34.0-next.88 */
6
6
  const s = o(t);
7
7
  export {
8
8
  s as u
@@ -16,7 +16,7 @@ import K from "@arcgis/core/Graphic.js";
16
16
  import { b as X } from "../../chunks/language-defaults-base.js";
17
17
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
18
18
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
19
- v4.34.0-next.86 */
19
+ v4.34.0-next.88 */
20
20
  const Z = W`:host(:not([closed])){--calcite-block-border-color: var(--calcite-color-transparent);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);.submission-actions-wrapper{display:flex;flex-direction:column;width:100%;gap:.75rem}.submission-actions{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between}.gaps{display:flex;gap:.25rem}.align-inline-end{margin-inline-start:auto}.action .error-display{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between}.context-popover p{padding:0 .5rem;font-size:var(--calcite-font-size-sm)}.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;max-height:30vh;overflow-y:auto}.feedback-sheet{--calcite-sheet-height: auto;--calcite-sheet-max-height: 100%;--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;margin-block:0}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;border-radius:var(--calcite-corner-radius-round);margin:.75rem;overflow:hidden;--calcite-color-border-input: transparent;position:sticky;box-shadow:var(--calcite-shadow-sm);flex:none}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-button{font-weight:var(--calcite-font-weight-medium)}.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{display:flex;flex-direction:row;gap:.5rem;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{display:flex;flex-direction:row;padding:0;overflow-y:hidden;overflow-x:auto;margin:.25rem 0 .75rem;align-items:center;max-width:100%;span{overflow-x:auto;overflow-y:hidden}}.copy-feedback{display:none}.copy-prompt-button{align-self:flex-start;margin-inline-start:auto}.response-secondary-action-button[data-copied]+.copy-feedback,.copy-prompt-button[data-copied]+.copy-feedback{display:block;span{padding:.75rem 1rem;font-size:var(--calcite-font-size--2);line-height:1.375;color:var(--calcite-color-text--2);font-weight:var(--calcite-font-weight-medium)}}.copy-prompt-button[data-copied]~.copy-tooltip,.response-secondary-action-button[data-copied]~.copy-tooltip{display:none}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}.response-secondary-action-button{margin-left:.5rem}.add-to-editor-button{--calcite-internal-button-border-color: unset}}.collapsible-code{padding:.5rem}.collapsible-code summary{cursor:pointer;font-weight:500;color:var(--calcite-color-brand);outline:none;padding:.25rem 0}.collapsible-code[open] summary{color:var(--calcite-color-text-2)}.collapsible-error{padding:.5rem}.collapsible-error summary{cursor:pointer;font-weight:500;color:var(--calcite-color-status-danger);outline:none;padding:.25rem 0}.collapsible-error[open] summary{color:var(--calcite-color-text-2)}.response-error-container{padding:.5rem;background:color-mix(in srgb,var(--calcite-color-status-warning) 10%,transparent);border-radius:var(--calcite-corner-radius-round);margin:1rem 0;font-size:var(--calcite-font-size--2);--calcite-input-message-icon-color: var(--calcite-color-status-warning)}.response-error-chip{--calcite-internal-chip-background-color: var(--calcite-color-status-warning);--calcite-chip-icon-color: var(--calcite-color-foreground-1);--calcite-chip-border-color: var(--calcite-color-transparent)}.feedback-actions{gap:unset}}:host([closed]){display:none}`;
21
21
  class y extends Error {
22
22
  constructor({
@@ -10,6 +10,7 @@ import { EditorProfile } from '../../utils/profile/editor-profile';
10
10
  import { ArcadeResult, IEditorTestContext } from '../../utils/arcade-executor';
11
11
  import { ResultPanelName } from '../arcgis-arcade-results/customElement.js';
12
12
  import { ICustomPanel } from '../../utils/custom-panel';
13
+ import { ArcadeAssistantConfig, ArcadeAssistantRemoteState } from '../../utils/arcade-assistant/types';
13
14
 
14
15
  type SidePanelName = "api" | "none" | "suggestions" | "variables";
15
16
  type WithCustomPanels = {
@@ -73,7 +74,7 @@ export declare class ArcgisArcadeEditor<T extends WithCustomPanels = object> ext
73
74
  * Example:
74
75
  * ```
75
76
  * {
76
- * bundles: ["core", "dataAccess", "geometry", "portal"],
77
+ * bundles: ["core", "dataAccess", "geometry", "portal-access"],
77
78
  * variables: [
78
79
  * {
79
80
  * name: "$feature",
@@ -110,6 +111,8 @@ export declare class ArcgisArcadeEditor<T extends WithCustomPanels = object> ext
110
111
  * @internal
111
112
  */
112
113
  customPanels?: ICustomPanel[];
114
+ /** enables and configures the arcade assistant */
115
+ arcadeAssistant?: ArcadeAssistantConfig;
113
116
  /** @deprecated **Deprecated** since 4.30. Use `script` property instead. */
114
117
  getScript(): Promise<string | undefined>;
115
118
  /** Returns the Arcade result for the script for the provided test data. */
@@ -1,40 +1,80 @@
1
- import { g as u, c as g } from "../../chunks/runtime.js";
2
- import { css as _, html as t, nothing as r } from "lit";
3
- import { KeyCode as m } from "monaco-editor";
1
+ import { g as b, c as x } from "../../chunks/runtime.js";
2
+ import { css as A, html as i, nothing as u } from "lit";
3
+ import { KeyCode as v } from "monaco-editor";
4
4
  import "monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js";
5
5
  import "monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js";
6
6
  import "monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js";
7
- import { LitElement as f, createEvent as c, noShadowRoot as x, safeClassMap as a } from "@arcgis/lumina";
8
- import { generateGuid as b } from "@arcgis/toolkit/string";
9
- import { Deferred as P } from "@arcgis/toolkit/promise";
10
- import { D as v, e as l } from "../../chunks/arcade-executor.js";
11
- import { s as $ } from "../../chunks/setup-monaco.js";
12
- import { b as s } from "../../chunks/arcade-defaults.js";
13
- import { a as E } from "../../chunks/arcade-service-accessors.js";
14
- import { u as S } from "../../chunks/useT9n.js";
15
- import { createRef as A, ref as w } from "lit-html/directives/ref.js";
16
- import { s as y } from "../../chunks/editor.js";
7
+ import { LitElement as S, createEvent as g, noShadowRoot as $, safeClassMap as r } from "@arcgis/lumina";
8
+ import { generateGuid as P } from "@arcgis/toolkit/string";
9
+ import { Deferred as E } from "@arcgis/toolkit/promise";
10
+ import { D as w, e as f } from "../../chunks/arcade-executor.js";
11
+ import { s as y } from "../../chunks/setup-monaco.js";
12
+ import { b as c } from "../../chunks/arcade-defaults.js";
13
+ import { a as R } from "../../chunks/arcade-service-accessors.js";
14
+ import { u as D } from "../../chunks/useT9n.js";
15
+ import { createRef as C, ref as B } from "lit-html/directives/ref.js";
16
+ import { s as k } from "../../chunks/editor.js";
17
+ import I from "@arcgis/core/identity/IdentityManager.js";
17
18
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
18
19
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
19
- v4.34.0-next.86 */
20
- const D = _`@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
- class C extends f {
20
+ v4.34.0-next.88 */
21
+ const M = A`@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}}}`, L = "https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0", T = [
22
+ "popup",
23
+ "popup-element",
24
+ "visualization",
25
+ "labeling",
26
+ "aggregate-field",
27
+ "popup-feature-reduction",
28
+ "popup-voxel"
29
+ ], F = (s) => {
30
+ const e = T.includes(s);
31
+ return e || console.warn(`Profile "${s}" is not supported by the Arcade Coding Assistant.`), e;
32
+ }, U = (s) => {
33
+ const { aiAssistantsEnabled: e } = s;
34
+ return e === void 0 ? (console.warn("areAiAssistantsEnabled is not defined in the organizations settings."), !1) : e;
35
+ }, j = async (s) => (await I.getCredential(s)).token;
36
+ async function N({
37
+ portalUrl: s,
38
+ profile: e
39
+ }) {
40
+ let t;
41
+ if (e && "id" in e && (t = e.id), t === void 0 || !F(t))
42
+ return console.error("Arcade assistant addon initialization failed: unsupported profile."), { shouldRender: !1 };
43
+ const a = await j(s), n = `${s}/sharing/rest/portals/self?f=json&token=${a}`, h = `${s}/sharing/rest/portals/self/settings?f=json&token=${a}`, [l, d] = await Promise.all([
44
+ fetch(n, { credentials: "include" }).then((o) => o.json()),
45
+ fetch(h, { credentials: "include" }).then((o) => o.json())
46
+ ]).catch((o) => (console.error("Error fetching portal self or settings response:", o), [{}, {}])), p = l?.helperServices?.aiAssistantServices?.url;
47
+ if (!p)
48
+ return console.warn("Arcade Assistant service URL is not available in the portal self response."), { shouldRender: !1 };
49
+ const _ = l.helpBase || "";
50
+ if (!d)
51
+ return console.warn("Arcade Assistant settings response is not available."), { shouldRender: !1 };
52
+ const m = U(d);
53
+ return {
54
+ shouldRender: !0,
55
+ serviceUrl: p,
56
+ helpBase: _,
57
+ assistantsEnabled: m,
58
+ feedbackServiceUrl: L
59
+ };
60
+ }
61
+ class O extends S {
22
62
  constructor() {
23
- super(...arguments), this._codeEditorElt = A(), this._componentReadyDefer = new P(), this._disposables = [], this._editorProfilePromise = Promise.resolve(void 0), this.messages = S(), this._modelId = b(), this._openArcadeHelp = () => void window.open(v, "Arcade Help"), this._toggleSidePanel = (e) => {
63
+ super(...arguments), this._codeEditorElt = C(), this._componentReadyDefer = new E(), this._disposables = [], this._editorProfilePromise = Promise.resolve(void 0), this.messages = D(), this._modelId = P(), this._openArcadeHelp = () => void window.open(w, "Arcade Help"), this._toggleSidePanel = (e) => {
24
64
  if (!e.target)
25
65
  return;
26
- const i = e.target?.dataset.panelName ?? "none";
27
- this.openedSidePanel = i === this.openedSidePanel ? "none" : i, this.openedSidePanel === "none" && this._codeEditorElt.value?.setFocus().catch(console.error);
28
- }, this._consoleLogs = [], this._executingScript = !1, this._preparingArcade = !1, this._resultPanel = "output", this._showExecutionPanel = !1, this.hideDocumentationActions = !1, this.hideSideBar = !1, this.openedSidePanel = "none", this.script = "", this.sideActionBarExpanded = !1, this.arcgisDiagnosticsChange = c({ bubbles: !1 }), this.arcgisScriptChange = c({ bubbles: !1 });
66
+ const t = e.target?.dataset.panelName ?? "none";
67
+ this.openedSidePanel = t === this.openedSidePanel ? "none" : t, this.openedSidePanel === "none" && this._codeEditorElt.value?.setFocus().catch(console.error);
68
+ }, this._consoleLogs = [], this._executingScript = !1, this._preparingArcade = !1, this._resultPanel = "output", this._showExecutionPanel = !1, this._arcadeAssistantRemoteState = { shouldRender: !1 }, this.hideDocumentationActions = !1, this.hideSideBar = !1, this.openedSidePanel = "none", this.script = "", this.sideActionBarExpanded = !1, this.arcgisDiagnosticsChange = g({ bubbles: !1 }), this.arcgisScriptChange = g({ bubbles: !1 });
29
69
  }
30
70
  static {
31
- this.properties = { _apiLibrary: 16, _consoleLogs: 16, _editorProfile: 16, _executingScript: 16, _executionResult: 16, _preparingArcade: 16, _resultPanel: 16, _showExecutionPanel: 16, editorInstance: 32, editorOptions: 0, hideDocumentationActions: 5, hideSideBar: 5, openedSidePanel: 2, profile: 0, script: 1, sideActionBarExpanded: 7, snippets: 0, suggestions: 0, testData: 0, customPanels: 0 };
71
+ this.properties = { _apiLibrary: 16, _consoleLogs: 16, _editorProfile: 16, _executingScript: 16, _executionResult: 16, _preparingArcade: 16, _resultPanel: 16, _showExecutionPanel: 16, _arcadeAssistantRemoteState: 16, editorInstance: 32, editorOptions: 0, hideDocumentationActions: 5, hideSideBar: 5, openedSidePanel: 2, profile: 0, script: 1, sideActionBarExpanded: 7, snippets: 0, suggestions: 0, testData: 0, customPanels: 0, arcadeAssistant: 0 };
32
72
  }
33
73
  static {
34
- this.shadowRootOptions = x;
74
+ this.shadowRootOptions = $;
35
75
  }
36
76
  static {
37
- this.styles = [D, y];
77
+ this.styles = [M, k];
38
78
  }
39
79
  get editorInstance() {
40
80
  return this._codeEditorElt.value?.editorInstance;
@@ -52,25 +92,25 @@ class C extends f {
52
92
  if (!e)
53
93
  return { type: "error", value: "Missing editor profile", error: null };
54
94
  await this._componentReadyDefer.promise;
55
- const i = this._codeEditorElt.value?.value;
56
- return await l(e.definition, i, this.testData);
95
+ const t = this._codeEditorElt.value?.value;
96
+ return await f(e.definition, t, this.testData);
57
97
  }
58
98
  async setFocus() {
59
99
  await this._componentReadyDefer.promise, await this._codeEditorElt.value?.setFocus();
60
100
  }
61
101
  async load() {
62
- const e = u("./assets");
63
- $(e), await this._updateEditorProfile();
102
+ const e = b("./assets");
103
+ y(e), await this._updateEditorProfile(), await this._updateArcadeAssistantRemoteState();
64
104
  }
65
105
  willUpdate(e) {
66
- (e.has("messages") || e.has("profile")) && this._updateDataModelDeps(), e.has("testData") && this._testDataChanged(), e.has("snippets") && s.updateApiContextForModel(this._modelId, {
106
+ (e.has("messages") || e.has("profile")) && this._updateDataModelDeps(), e.has("testData") && this._testDataChanged(), e.has("snippets") && c.updateApiContextForModel(this._modelId, {
67
107
  snippets: this.snippets
68
- });
108
+ }), e.has("arcadeAssistant") && this._updateArcadeAssistantRemoteState();
69
109
  }
70
110
  async loaded() {
71
111
  this._componentReadyDefer.resolve(), await this._updateApiLibrary();
72
- const e = await E();
73
- this._disposables.push(e.onDiagnosticsChange((i) => !this._preparingArcade && this.arcgisDiagnosticsChange.emit(i.diagnostics))), this.testData && this._addExecuteScriptAction(), await this._codeEditorElt.value?.setFocus();
112
+ const e = await R();
113
+ this._disposables.push(e.onDiagnosticsChange((t) => !this._preparingArcade && this.arcgisDiagnosticsChange.emit(t.diagnostics))), this.testData && this._addExecuteScriptAction(), await this._codeEditorElt.value?.setFocus();
74
114
  }
75
115
  disconnectedCallback() {
76
116
  for (super.disconnectedCallback(); this._disposables.length; )
@@ -85,10 +125,10 @@ class C extends f {
85
125
  async _updateEditorProfile() {
86
126
  this._preparingArcade = !0;
87
127
  try {
88
- await s.setProfileForModel(this._modelId, this.profile, {
128
+ await c.setProfileForModel(this._modelId, this.profile, {
89
129
  locale: this.messages._t9nLocale,
90
130
  snippets: this.snippets
91
- }), this._editorProfile = s.getEditorProfileForModel(this._modelId);
131
+ }), this._editorProfile = c.getEditorProfileForModel(this._modelId);
92
132
  } catch {
93
133
  this._editorProfile = void 0;
94
134
  } finally {
@@ -96,20 +136,20 @@ class C extends f {
96
136
  }
97
137
  }
98
138
  async _updateApiLibrary() {
99
- this._apiLibrary = await s.getApiLibraryForModel(this._modelId);
139
+ this._apiLibrary = await c.getApiLibraryForModel(this._modelId);
100
140
  }
101
141
  async _executeScript() {
102
142
  const e = this.testData;
103
143
  if (!this._codeEditorElt.value || !e)
104
144
  return;
105
- const i = await this._editorProfilePromise;
106
- if (!i) {
145
+ const t = await this._editorProfilePromise;
146
+ if (!t) {
107
147
  this._executionResult = { type: "error", value: "Missing editor profile", error: null };
108
148
  return;
109
149
  }
110
150
  this._showExecutionPanel = !0, this._executingScript = !0, this._consoleLogs = [], setTimeout(() => void (async () => {
111
- const o = this._codeEditorElt.value?.value;
112
- this._executionResult = await l(i.definition, o, e, (n) => setTimeout(() => this._consoleLogs = [...this._consoleLogs, n], 0)), this._executingScript = !1;
151
+ const a = this._codeEditorElt.value?.value;
152
+ this._executionResult = await f(t.definition, a, e, (n) => setTimeout(() => this._consoleLogs = [...this._consoleLogs, n], 0)), this._executingScript = !1;
113
153
  })(), 0);
114
154
  }
115
155
  _toggleShowExecutionPanel() {
@@ -141,7 +181,7 @@ class C extends f {
141
181
  // An unique identifier for the action.
142
182
  id: "run-script",
143
183
  label: "Run Arcade Expression",
144
- keybindings: [m.F5],
184
+ keybindings: [v.F5],
145
185
  contextMenuGroupId: "code",
146
186
  contextMenuOrder: 1,
147
187
  run: () => {
@@ -151,20 +191,26 @@ class C extends f {
151
191
  e && (this._executeScriptAction = e, this._disposables.push(e));
152
192
  }
153
193
  _disposeSafely(e) {
154
- const i = this._disposables.indexOf(e);
155
- i !== -1 && this._disposables.splice(i, 1), e.dispose();
194
+ const t = this._disposables.indexOf(e);
195
+ t !== -1 && this._disposables.splice(t, 1), e.dispose();
196
+ }
197
+ async _updateArcadeAssistantRemoteState() {
198
+ this.arcadeAssistant && (this._arcadeAssistantRemoteState = await N({
199
+ ...this.arcadeAssistant,
200
+ profile: this.profile
201
+ }));
156
202
  }
157
203
  renderMainActionBar() {
158
- return this.testData ? t`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .text=${this.messages.run ?? ""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${() => void this._executeScript().catch(console.error)}></calcite-action>${this._executionResult ? t`<calcite-action .text=${this.messages.lastresults ?? ""} .active=${this._showExecutionPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>` : null}</calcite-action-group></calcite-action-bar>` : null;
204
+ return this.testData ? i`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .text=${this.messages.run ?? ""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${() => void this._executeScript().catch(console.error)}></calcite-action>${this._executionResult ? i`<calcite-action .text=${this.messages.lastresults ?? ""} .active=${this._showExecutionPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>` : null}</calcite-action-group></calcite-action-bar>` : null;
159
205
  }
160
206
  renderMainPanel() {
161
- return t`<arcgis-code-editor class="flex-adjustable" .editorOptions=${this.editorOptions} .language=${s.languageId} .value=${this.script ?? ""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${w(this._codeEditorElt)}></arcgis-code-editor>`;
207
+ return i`<arcgis-code-editor class="flex-adjustable" .editorOptions=${this.editorOptions} .language=${c.languageId} .value=${this.script ?? ""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${B(this._codeEditorElt)}></arcgis-code-editor>`;
162
208
  }
163
- renderAction({ id: e, label: i, icon: o, active: n, panelName: d, iconFlipRtl: h = !1, onClick: p = this._toggleSidePanel }) {
164
- return t`<calcite-action id=${e ?? r} .text=${i} .textEnabled=${this.sideActionBarExpanded} .icon=${o} .active=${n} @click=${p} data-panel-name=${d ?? r} .iconFlipRtl=${h}></calcite-action>${!this.sideActionBarExpanded && t`<calcite-tooltip .referenceElement=${e}><span>${i}</span></calcite-tooltip>` || ""}`;
209
+ renderAction({ id: e, label: t, icon: a, active: n, panelName: h, iconFlipRtl: l = !1, onClick: d = this._toggleSidePanel }) {
210
+ return i`<calcite-action id=${e ?? u} .text=${t} .textEnabled=${this.sideActionBarExpanded} .icon=${a} .active=${n} @click=${d} data-panel-name=${h ?? u} .iconFlipRtl=${l}></calcite-action>${!this.sideActionBarExpanded && i`<calcite-tooltip .referenceElement=${e}><span>${t}</span></calcite-tooltip>` || ""}`;
165
211
  }
166
212
  renderSideActionBar() {
167
- return this.hideSideBar ? null : t`<calcite-action-bar class="side-action-bar border-inline-start" .expanded=${!!this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({
213
+ return this.hideSideBar ? null : i`<calcite-action-bar class="side-action-bar border-inline-start" .expanded=${!!this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({
168
214
  id: "profile-variables-action",
169
215
  label: this.messages.profilevariables ?? "",
170
216
  icon: "profile-variables",
@@ -182,7 +228,13 @@ class C extends f {
182
228
  icon: "lightbulb",
183
229
  active: this.openedSidePanel === "suggestions",
184
230
  panelName: "suggestions"
185
- }) : null}${this.customPanels?.map((e) => e.enabled ? this.renderAction({
231
+ }) : null}${this._arcadeAssistantRemoteState.shouldRender && this.renderAction({
232
+ id: "arcade-assistant-action",
233
+ label: this.messages.arcadeassistant ?? "Arcade assistant",
234
+ icon: "effects",
235
+ active: this.openedSidePanel === "arcade-assistant",
236
+ panelName: "arcade-assistant"
237
+ }) || ""}${this.customPanels?.map((e) => e.enabled ? this.renderAction({
186
238
  id: e.id,
187
239
  label: e.name,
188
240
  icon: e.icon,
@@ -202,31 +254,31 @@ class C extends f {
202
254
  if (this.hideSideBar)
203
255
  return null;
204
256
  const { openedSidePanel: e } = this;
205
- return t`<arcgis-language-api-panel class=${a(e === "api" && "side-panel flex-panel border-inline-start")} .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${this._toggleSidePanel} data-panel-name=none .closed=${e !== "api"}></arcgis-language-api-panel><arcgis-editor-variables class=${a(e === "variables" && "side-panel flex-panel border-inline-start")} .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${this._toggleSidePanel} data-panel-name=none .variable=${this._editorProfile} .closed=${e !== "variables"}></arcgis-editor-variables>${this.suggestions?.length && t`<arcgis-arcade-suggestions class=${a(e === "suggestions" && "side-panel flex-panel border-inline-start")} .closed=${e !== "suggestions"} .suggestions=${this.suggestions} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${this._toggleSidePanel} data-panel-name=none></arcgis-arcade-suggestions>` || ""}${this.customPanels?.map((i) => (
257
+ return i`<arcgis-language-api-panel class=${r(e === "api" && "side-panel flex-panel border-inline-start")} .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${this._toggleSidePanel} data-panel-name=none .closed=${e !== "api"}></arcgis-language-api-panel><arcgis-editor-variables class=${r(e === "variables" && "side-panel flex-panel border-inline-start")} .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${this._toggleSidePanel} data-panel-name=none .variable=${this._editorProfile} .closed=${e !== "variables"}></arcgis-editor-variables>${this.suggestions?.length && i`<arcgis-arcade-suggestions class=${r(e === "suggestions" && "side-panel flex-panel border-inline-start")} .closed=${e !== "suggestions"} .suggestions=${this.suggestions} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${this._toggleSidePanel} data-panel-name=none></arcgis-arcade-suggestions>` || ""}${this.arcadeAssistant && this._arcadeAssistantRemoteState.shouldRender && i`<arcgis-arcade-coding-assistant class=${r(e === "arcade-assistant" && "side-panel flex-panel border-inline-start")} .closed=${e !== "arcade-assistant"} .insertText=${this._insertText.bind(this)} .closePanel=${this._toggleSidePanel} .portalUrl=${this.arcadeAssistant.portalUrl} .serviceUrl=${this._arcadeAssistantRemoteState.serviceUrl} .helpBase=${this._arcadeAssistantRemoteState.helpBase} .assistantsEnabled=${this._arcadeAssistantRemoteState.assistantsEnabled} .feedbackServiceUrl=${this._arcadeAssistantRemoteState.feedbackServiceUrl} .editorRef=${this.el} .appVersion=${this.arcadeAssistant.appVersion}></arcgis-arcade-coding-assistant>` || ""}${this.customPanels?.map((t) => (
206
258
  /** If useFlows is true, we check to make sure the input starts with calcite-flow-item, and if so, we allow them to render custom flow items */
207
- i?.useFlows ? i.renderer?.({
259
+ t?.useFlows ? t.renderer?.({
208
260
  closePanel: this._toggleSidePanel,
209
261
  insertText: this._insertText.bind(this),
210
- closed: e !== i.id,
262
+ closed: e !== t.id,
211
263
  /** pass this.el instead of "this" as it is what actually gets attached to the dom */
212
264
  editorRef: this.el
213
- }) : t`<calcite-flow class=${a(e === i.id ? "side-panel flex-panel border-inline-start" : "hidden")}><calcite-flow-item .heading=${i.name} closable @calciteFlowItemClose=${this._toggleSidePanel} .description=${i.description}>${i.renderer?.({
265
+ }) : i`<calcite-flow class=${r(e === t.id ? "side-panel flex-panel border-inline-start" : "hidden")}><calcite-flow-item .heading=${t.name} closable @calciteFlowItemClose=${this._toggleSidePanel} .description=${t.description}>${t.renderer?.({
214
266
  closePanel: this._toggleSidePanel,
215
267
  insertText: this._insertText.bind(this),
216
- closed: e !== i.id,
268
+ closed: e !== t.id,
217
269
  /** pass this.el instead of "this" as it is what actually gets attached to the dom */
218
270
  editorRef: this.el
219
271
  })}</calcite-flow-item></calcite-flow>`
220
272
  ))}`;
221
273
  }
222
274
  renderResultsPanel() {
223
- return this._showExecutionPanel ? t`<arcgis-arcade-results class="flex-adjustable" .openedResultPanel=${this._resultPanel} .loading=${this._executingScript} .result=${this._executionResult} .consoleLogs=${this._consoleLogs} @arcgisOpenedResultPanelChange=${this._onResultPanelChange} @arcgisClose=${this._onExecutionPanelClose}></arcgis-arcade-results>` : null;
275
+ return this._showExecutionPanel ? i`<arcgis-arcade-results class="flex-adjustable" .openedResultPanel=${this._resultPanel} .loading=${this._executingScript} .result=${this._executionResult} .consoleLogs=${this._consoleLogs} @arcgisOpenedResultPanelChange=${this._onResultPanelChange} @arcgisClose=${this._onExecutionPanelClose}></arcgis-arcade-results>` : null;
224
276
  }
225
277
  render() {
226
- return t`${this.renderMainActionBar()}<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable">${this.renderMainPanel()}${this.renderResultsPanel()}</div>${this.renderSidePanel()}${this.renderSideActionBar()}</div>`;
278
+ return i`${this.renderMainActionBar()}<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable">${this.renderMainPanel()}${this.renderResultsPanel()}</div>${this.renderSidePanel()}${this.renderSideActionBar()}</div>`;
227
279
  }
228
280
  }
229
- g("arcgis-arcade-editor", C);
281
+ x("arcgis-arcade-editor", O);
230
282
  export {
231
- C as ArcgisArcadeEditor
283
+ O as ArcgisArcadeEditor
232
284
  };
@@ -6,6 +6,7 @@ import "@esri/calcite-components/components/calcite-tooltip";
6
6
  import "../arcgis-language-api-panel/index.js";
7
7
  import "../arcgis-editor-variables/index.js";
8
8
  import "../arcgis-arcade-suggestions/index.js";
9
+ import "../arcgis-arcade-coding-assistant/index.js";
9
10
  import "@esri/calcite-components/components/calcite-flow";
10
11
  import "@esri/calcite-components/components/calcite-flow-item";
11
12
  import "../arcgis-arcade-results/index.js";
@@ -6,6 +6,7 @@ import "@esri/calcite-components/components/calcite-tooltip";
6
6
  import "../arcgis-language-api-panel/index.js";
7
7
  import "../arcgis-editor-variables/index.js";
8
8
  import "../arcgis-arcade-suggestions/index.js";
9
+ import "../arcgis-arcade-coding-assistant/index.js";
9
10
  import "@esri/calcite-components/components/calcite-flow";
10
11
  import "@esri/calcite-components/components/calcite-flow-item";
11
12
  import "../arcgis-arcade-results/index.js";
@@ -8,7 +8,7 @@ import { s as O } from "../../chunks/fields.js";
8
8
  import "@arcgis/toolkit/function";
9
9
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
10
10
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
11
- v4.34.0-next.86 */
11
+ v4.34.0-next.88 */
12
12
  const D = C`: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",
@@ -8,7 +8,7 @@ import { f as b } from "../../chunks/monaco-importer.js";
8
8
  import { u as _ } from "../../chunks/useT9n.js";
9
9
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
10
10
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
11
- v4.34.0-next.86 */
11
+ v4.34.0-next.88 */
12
12
  function v(o) {
13
13
  return !Array.isArray(o) || !o.length ? !1 : Array.isArray(o[0].suggestions);
14
14
  }
@@ -38,7 +38,7 @@ export declare class ArcgisCodeEditor extends LitElement {
38
38
  * For example, with arcade, the model id is used to store the arcade profile and other metadata.
39
39
  * The unique identifier is especially useful when there are multiple editors on the same page.
40
40
  */
41
- modelId: string;
41
+ modelId: `${string}-${string}-${string}-${string}-${string}`;
42
42
  /**
43
43
  * The initial value for the editor.
44
44
  * The value is the script, code, css, json, etc.
@@ -11,7 +11,7 @@ import { load as h } from "@arcgis/lumina/controllers";
11
11
  import { Range as M, Uri as c, KeyMod as n, KeyCode as t } from "monaco-editor";
12
12
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
13
13
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
14
- v4.34.0-next.86 */
14
+ v4.34.0-next.88 */
15
15
  const x = m`@layer{/*!-----------------------------------------------------------
16
16
  * Copyright (c) Microsoft Corporation. All rights reserved.
17
17
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -36,7 +36,7 @@ class I extends w {
36
36
  super(...arguments), this._componentReadyDefer = new l(), this._disposables = [], this._monacoEditor = h(d), this.modelId = B(), this.value = "", this.arcgisSelectionChange = i({ bubbles: !1 }), this.arcgisValueChange = i({ bubbles: !1 });
37
37
  }
38
38
  static {
39
- this.properties = { editorInstance: 32, editorOptions: 0, language: 1, modelId: 1, value: 1 };
39
+ this.properties = { editorInstance: 32, editorOptions: 0, language: 1, modelId: 0, value: 1 };
40
40
  }
41
41
  static {
42
42
  this.shadowRootOptions = E;
@@ -7,7 +7,7 @@ import { createFilterExpression as f } from "@arcgis/toolkit/string";
7
7
  import { u } from "../../chunks/useT9n.js";
8
8
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
9
9
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
10
- v4.34.0-next.86 */
10
+ v4.34.0-next.88 */
11
11
  const m = n`: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 { u as v } from "../../chunks/useT9n.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.34/esri/copyright.txt for details.
13
- v4.34.0-next.86 */
13
+ v4.34.0-next.88 */
14
14
  const y = h`: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 p {
16
16
  constructor() {