@arcgis/coding-components 4.34.0-next.125 → 4.34.0-next.126
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.
- package/dist/addons.js +1 -1
- package/dist/cdn/{E32XMARU.js → 4X6CFVQV.js} +2 -2
- package/dist/cdn/{VF3GPNIR.js → 56H4OXDX.js} +2 -2
- package/dist/cdn/{J5SRTNFX.js → 5RUZVY63.js} +2 -2
- package/dist/cdn/{XMNS2AMG.js → 64VQXMLZ.js} +2 -2
- package/dist/cdn/{DLBR7H3C.js → 6BLHJHZI.js} +2 -2
- package/dist/cdn/6RKTFULC.js +6 -0
- package/dist/cdn/{UVQCJUPD.js → 75II5JHK.js} +2 -2
- package/dist/cdn/{YO7DAFZV.js → 7IT6MDFT.js} +2 -2
- package/dist/cdn/7XB5VCVE.js +4 -0
- package/dist/cdn/{YUYT7A4Q.js → AENCWWMC.js} +2 -2
- package/dist/cdn/{VYFOJC4T.js → AG5NFQGH.js} +1 -1
- package/dist/cdn/{CFMAASMV.js → AKII2FQ2.js} +2 -2
- package/dist/cdn/{6WSJJRZH.js → CBKNAZWC.js} +2 -2
- package/dist/cdn/{V7AP47DK.js → CJ4ZNOMR.js} +2 -2
- package/dist/cdn/{NXZCMRTV.js → CUZ5DGJX.js} +1 -1
- package/dist/cdn/{UBOR3LK5.js → E7HQFXE7.js} +2 -2
- package/dist/cdn/{FO2JLEYN.js → EC5UAIMG.js} +2 -2
- package/dist/cdn/{K2ZTYOPH.js → EHPKVJZZ.js} +2 -2
- package/dist/cdn/{JZU3ZQVI.js → EW7C7ZAQ.js} +2 -2
- package/dist/cdn/{ZT2MY6JP.js → GDG4NBW6.js} +1 -1
- package/dist/cdn/{XNP5WDRF.js → HSAI26CX.js} +2 -2
- package/dist/cdn/{ZSLS5APT.js → HZ24NNFG.js} +2 -2
- package/dist/cdn/{6AHL6AZO.js → KT6K6XJJ.js} +2 -2
- package/dist/cdn/{7LQEOJIC.js → LELXN3TI.js} +2 -2
- package/dist/cdn/{EN5YQO7E.js → LIWYZAZG.js} +2 -2
- package/dist/cdn/{735NEHPE.js → P5RRW4PO.js} +2 -2
- package/dist/cdn/{XHOB2Y35.js → QU4ELNGF.js} +2 -2
- package/dist/cdn/{M5RHS3KM.js → R7WMOWM2.js} +1 -1
- package/dist/cdn/{U432E4UL.js → RGTLIGAV.js} +2 -2
- package/dist/cdn/{FEEGKDY3.js → S4GRTXCU.js} +2 -2
- package/dist/cdn/{I3YYZV2R.js → SLP74X6X.js} +1 -1
- package/dist/cdn/{AC3W5G2Y.js → SOFORF4N.js} +2 -2
- package/dist/cdn/{VWVCAOVL.js → T2H633U7.js} +2 -2
- package/dist/cdn/{2GDZLUV7.js → TIMAZ23C.js} +2 -2
- package/dist/cdn/{PD2ZPE6T.js → V5XSSDXL.js} +2 -2
- package/dist/cdn/{D7QSIB5F.js → VPACQSTP.js} +4 -4
- package/dist/cdn/{VONGISVP.js → VST6355H.js} +2 -2
- package/dist/cdn/{WEYDBUPW.js → W7M7SFOH.js} +2 -2
- package/dist/cdn/{CT2SSRPF.js → XVAFMNJ4.js} +1 -1
- package/dist/cdn/{UTFXKWES.js → XYQIVAQQ.js} +2 -2
- package/dist/cdn/{GYSXQ7C2.js → Y5QLFY32.js} +2 -2
- package/dist/cdn/{RQ2AYTIG.js → ZPRTM6IZ.js} +1 -1
- package/dist/cdn/{OVRXTFBM.js → ZV3CUAN3.js} +2 -2
- package/dist/cdn/{WVK7TRLB.js → ZWE2P6A2.js} +2 -2
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +73179 -76008
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/arcade-defaults.js +1 -1
- package/dist/chunks/arcade-executor.js +1 -1
- package/dist/chunks/arcade-mode.js +1 -1
- package/dist/chunks/arcade-service-accessors.js +1 -1
- package/dist/chunks/editor.js +1 -1
- package/dist/chunks/fields.js +1 -1
- package/dist/chunks/language-defaults-base.js +1 -1
- package/dist/chunks/markdown.js +1 -1
- package/dist/chunks/monaco-importer.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/setup-monaco.js +1 -1
- package/dist/chunks/sql-expr-contribution.js +1 -1
- package/dist/chunks/sql-expr-defaults.js +1 -1
- package/dist/chunks/sql-expr-mode.js +1 -1
- package/dist/chunks/sql-expr-service-accessors.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/components/arcgis-arcade-coding-assistant/customElement.js +81 -78
- package/dist/components/arcgis-arcade-editor/customElement.js +1 -1
- package/dist/components/arcgis-arcade-results/customElement.js +1 -1
- package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
- package/dist/components/arcgis-code-editor/customElement.js +1 -1
- package/dist/components/arcgis-editor-variables/customElement.js +1 -1
- package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
- package/dist/docs/api.json +3 -3
- package/dist/docs/docs.json +5 -5
- package/dist/docs/web-types.json +2 -2
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/dist/monacoStyles.js +1 -1
- package/dist/utils/arcade-assistant/types.d.ts +2 -2
- package/dist/utils/monaco-importer.d.ts +0 -1
- package/dist/utils/monaco-typings.d.ts +4 -0
- package/package.json +5 -5
- package/dist/cdn/2MKLDKHG.js +0 -4
- package/dist/cdn/B2DP3PQK.js +0 -6
package/dist/cdn/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.
|
|
4
|
-
import{C as i,o as e}from"./
|
|
3
|
+
v4.34.0-next.126 */
|
|
4
|
+
import{C as i,o as e}from"./5RUZVY63.js";import"./XVAFMNJ4.js";import"./ZPRTM6IZ.js";var r=e(i,{"arcgis-arcade-coding-assistant":[()=>import("./6RKTFULC.js"),"appVersion,assistantsEnabled,closed,closePanel:,editorRef:,feedbackServiceUrl,helpBase,insertText:,layer,portalUrl,serviceUrl;destroy"],"arcgis-arcade-editor":[()=>import("./S4GRTXCU.js"),"arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,openedSidePanel:,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getEditorInstance,getScript,getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./TIMAZ23C.js"),"consoleLogs:,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./Y5QLFY32.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./P5RRW4PO.js"),"editorInstance:,editorOptions:,language,modelId:,value;getEditorInstance,getValue,insertSnippet,insertText,setFocus,setValue"],"arcgis-editor-variables":[()=>import("./HSAI26CX.js"),"closed,loading,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./XYQIVAQQ.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./CJ4ZNOMR.js"),"hideSideBar,profile:,script"],"arcgis-sql-expression-fields":[()=>import("./AENCWWMC.js"),"loading,modelId"]});r({resourcesUrl:import.meta.url});var o=new CSSStyleSheet();var ___=new CSSStyleSheet();___.replaceSync(`@layer{/*!-----------------------------------------------------------
|
|
5
5
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6
6
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
7
7
|
* Released under the MIT license
|
|
@@ -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.
|
|
7
|
+
v4.34.0-next.126 */
|
|
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.
|
|
4
|
+
v4.34.0-next.126 */
|
|
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.
|
|
12
|
+
v4.34.0-next.126 */
|
|
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.
|
|
3
|
+
v4.34.0-next.126 */
|
|
4
4
|
async function a() {
|
|
5
5
|
return (await e()).getArcadeDiagnosticService();
|
|
6
6
|
}
|
package/dist/chunks/editor.js
CHANGED
|
@@ -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.
|
|
4
|
+
v4.34.0-next.126 */
|
|
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
|
package/dist/chunks/fields.js
CHANGED
|
@@ -14,7 +14,7 @@ import { filterApiLibraryForContext as le } from "@arcgis/languages-api-utils";
|
|
|
14
14
|
import { Emitter as $, Uri as A } 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.
|
|
17
|
+
v4.34.0-next.126 */
|
|
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
|
}
|
package/dist/chunks/markdown.js
CHANGED
|
@@ -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.
|
|
7
|
+
v4.34.0-next.126 */
|
|
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.
|
|
9
|
+
v4.34.0-next.126 */
|
|
10
10
|
function $(e, n, l, i) {
|
|
11
11
|
if (!n)
|
|
12
12
|
return [];
|
package/dist/chunks/runtime.js
CHANGED
|
@@ -3,7 +3,7 @@ import { makeRuntime as e } from "@arcgis/lumina";
|
|
|
3
3
|
import { trackAccess as s, createObservable as r, createTrackingTarget as a, runTracked as c } from "@arcgis/core/applications/Components/reactiveUtils.js";
|
|
4
4
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
5
5
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
6
|
-
v4.34.0-next.
|
|
6
|
+
v4.34.0-next.126 */
|
|
7
7
|
const t = e({ defaultAssetPath: "https://jsdev.arcgis.com/next/coding-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: d, setAssetPath: i } = t;
|
|
8
8
|
t.t = s;
|
|
9
9
|
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.
|
|
4
|
+
v4.34.0-next.126 */
|
|
5
5
|
function p() {
|
|
6
6
|
return !!window.MonacoEnvironment?.getWorkerUrl;
|
|
7
7
|
}
|
|
@@ -9,7 +9,7 @@ import { a as n } from "./sql-expr-defaults.js";
|
|
|
9
9
|
import { g as m } from "./sql-expr-service-accessors.js";
|
|
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.
|
|
12
|
+
v4.34.0-next.126 */
|
|
13
13
|
const s = /* @__PURE__ */ new Set();
|
|
14
14
|
function g(e, o) {
|
|
15
15
|
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.
|
|
7
|
+
v4.34.0-next.126 */
|
|
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 {
|
|
@@ -9,7 +9,7 @@ import { debounce as N } from "@arcgis/toolkit/function";
|
|
|
9
9
|
import { g as f } from "./sql-expr-service-accessors.js";
|
|
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.
|
|
12
|
+
v4.34.0-next.126 */
|
|
13
13
|
let h = new _();
|
|
14
14
|
class k {
|
|
15
15
|
constructor(e) {
|
package/dist/chunks/useT9n.js
CHANGED
|
@@ -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.
|
|
5
|
+
v4.34.0-next.126 */
|
|
6
6
|
const s = o(t);
|
|
7
7
|
export {
|
|
8
8
|
s as u
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { c as O } from "../../chunks/runtime.js";
|
|
2
|
-
import { nothing as w, LitElement as
|
|
3
|
-
import { ref as
|
|
2
|
+
import { nothing as w, LitElement as V } from "@arcgis/lumina";
|
|
3
|
+
import { ref as H, createRef as L } from "lit/directives/ref.js";
|
|
4
4
|
import B from "@arcgis/core/identity/IdentityManager.js";
|
|
5
5
|
import { u as j } from "../../chunks/useT9n.js";
|
|
6
6
|
import { b as I } from "../../chunks/arcade-defaults.js";
|
|
7
|
-
import { css as W, html as
|
|
7
|
+
import { css as W, html as r } from "lit";
|
|
8
8
|
import T from "@arcgis/core/request.js";
|
|
9
9
|
import { e as Q, a as G } from "../../chunks/monaco-importer.js";
|
|
10
10
|
import { repeat as q } from "lit/directives/repeat.js";
|
|
@@ -12,21 +12,22 @@ import "@arcgis/toolkit/function";
|
|
|
12
12
|
import { generateGuid as J } from "@arcgis/toolkit/string";
|
|
13
13
|
import { unsafeHTML as $ } from "lit/directives/unsafe-html.js";
|
|
14
14
|
import K from "@arcgis/core/layers/FeatureLayer.js";
|
|
15
|
-
import Y from "@arcgis/core/
|
|
16
|
-
import
|
|
15
|
+
import Y from "@arcgis/core/config.js";
|
|
16
|
+
import X from "@arcgis/core/Graphic.js";
|
|
17
|
+
import { b as Z } from "../../chunks/language-defaults-base.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.
|
|
20
|
-
const
|
|
20
|
+
v4.34.0-next.126 */
|
|
21
|
+
const ee = 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)}.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-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-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
22
|
class y extends Error {
|
|
22
23
|
constructor({
|
|
23
24
|
message: e,
|
|
24
25
|
code: t,
|
|
25
26
|
subCode: o,
|
|
26
|
-
details:
|
|
27
|
+
details: c,
|
|
27
28
|
source: n
|
|
28
29
|
}) {
|
|
29
|
-
super(e), this.name = "ArcadeAssistantError", this.code = t, this.subCode = o, this.details =
|
|
30
|
+
super(e), this.name = "ArcadeAssistantError", this.code = t, this.subCode = o, this.details = c, this.source = n;
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
function E(i) {
|
|
@@ -42,10 +43,10 @@ function E(i) {
|
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
|
-
async function
|
|
46
|
-
const { baseUrl: e, skillId: t, message: o, authToken:
|
|
46
|
+
async function te(i) {
|
|
47
|
+
const { baseUrl: e, skillId: t, message: o, authToken: c, previousConversationId: n, context: p } = i, d = t ? `${e}/skills/${t}/chat` : `${e}/chat`, s = [], h = {
|
|
47
48
|
message: o,
|
|
48
|
-
context:
|
|
49
|
+
context: p
|
|
49
50
|
};
|
|
50
51
|
n && (h.conversation_id = n);
|
|
51
52
|
let a;
|
|
@@ -54,7 +55,7 @@ async function ee(i) {
|
|
|
54
55
|
method: "post",
|
|
55
56
|
headers: {
|
|
56
57
|
"Content-Type": "application/json",
|
|
57
|
-
token:
|
|
58
|
+
token: c
|
|
58
59
|
},
|
|
59
60
|
body: JSON.stringify(h),
|
|
60
61
|
responseType: "json"
|
|
@@ -65,21 +66,21 @@ async function ee(i) {
|
|
|
65
66
|
}
|
|
66
67
|
const l = a.data;
|
|
67
68
|
s.push(l);
|
|
68
|
-
const
|
|
69
|
+
const u = l.conversationId, F = l.inquiryId;
|
|
69
70
|
let A = l.sequenceNumber;
|
|
70
71
|
async function D() {
|
|
71
72
|
let f = 0;
|
|
72
73
|
const b = 25;
|
|
73
74
|
for (; f < b; ) {
|
|
74
75
|
await new Promise((v) => setTimeout(v, 1e3));
|
|
75
|
-
const k =
|
|
76
|
+
const k = ie(u, A, F);
|
|
76
77
|
let g;
|
|
77
78
|
try {
|
|
78
79
|
g = await T(d, {
|
|
79
80
|
method: "post",
|
|
80
81
|
headers: {
|
|
81
82
|
"Content-Type": "application/json",
|
|
82
|
-
token:
|
|
83
|
+
token: c
|
|
83
84
|
},
|
|
84
85
|
body: JSON.stringify(k),
|
|
85
86
|
responseType: "json"
|
|
@@ -124,77 +125,77 @@ async function ee(i) {
|
|
|
124
125
|
)
|
|
125
126
|
]), s;
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
+
function ie(i, e, t) {
|
|
128
129
|
return {
|
|
129
130
|
conversationId: i,
|
|
130
131
|
inquiryId: t,
|
|
131
132
|
ackSequenceNumber: e
|
|
132
133
|
};
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
+
function oe(i) {
|
|
135
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;
|
|
136
137
|
}
|
|
137
|
-
const
|
|
138
|
-
const e = i.value.length, t = 72, o = 180,
|
|
138
|
+
const ae = (i) => {
|
|
139
|
+
const e = i.value.length, t = 72, o = 180, c = i.offsetWidth, p = Math.max(1, Math.floor(c / 8)), d = Math.ceil(e / p), s = t + (d - 2) * 24;
|
|
139
140
|
i.style.setProperty("--calcite-text-area-min-height", `${Math.min(s, o)}px`);
|
|
140
141
|
};
|
|
141
|
-
function
|
|
142
|
-
return
|
|
142
|
+
function se({ messages: i }) {
|
|
143
|
+
return r`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${i.beta ?? "Beta"}>${i.beta ?? "Beta"}</calcite-chip>`;
|
|
143
144
|
}
|
|
144
|
-
function
|
|
145
|
-
return
|
|
145
|
+
function ce({ popoverContent: i }) {
|
|
146
|
+
return r`<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>`;
|
|
146
147
|
}
|
|
147
148
|
function U({ errorMessage: i, slot: e }) {
|
|
148
|
-
return
|
|
149
|
+
return r`<div class="error-display"><calcite-input-message id=error-message status=invalid icon=exclamation-mark-triangle scale=m slot=${e ?? w}>${i}</calcite-input-message></div>`;
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
-
return
|
|
151
|
+
function re({ active: i, setActive: e, messages: t }) {
|
|
152
|
+
return r`<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>`;
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
-
return i ?
|
|
154
|
+
function ne({ context: i, messages: e }) {
|
|
155
|
+
return i ? r`<div class="gaps">${i.profileName && r`<calcite-popover auto-close placement=top .label=${(e.profilecontextlabel ?? "Profile context: {profileName}").replace("{profileName}", i.profileName)} reference-element=profile-context-button class="context-popover"><p>${(e.profilecontextlabel ?? "Profile context: {profileName}").replace("{profileName}", i.profileName)}</p></calcite-popover><calcite-button round kind=neutral icon-start=map-information id=profile-context-button></calcite-button>` || ""}${i.layerName && r`<calcite-popover auto-close placement=top .label=${(e.layercontextlabel ?? "Layer context: {layerName}").replace("{layerName}", i.layerName)} reference-element=layer-context-button class="context-popover"><p>${(e.layercontextlabel ?? "Layer context: {layerName}").replace("{layerName}", i.layerName)}</p></calcite-popover><calcite-button round kind=neutral icon-start=layers id=layer-context-button></calcite-button>` || ""}</div>` : null;
|
|
155
156
|
}
|
|
156
|
-
function
|
|
157
|
-
return
|
|
158
|
-
|
|
159
|
-
}} ${
|
|
157
|
+
function le({ isDisabled: i, isReadOnly: e, setQuestion: t, setIsViewingResult: o, textAreaRef: c, question: n, errorMessage: p, setErrorMessage: d, submitQuestion: s, messages: h, mode: a, context: l }) {
|
|
158
|
+
return r`<div class="text-area-wrapper"><calcite-text-area resize=vertical .readOnly=${i || e} class="styled-text-area" .placeholder=${h.askaquestion ?? `Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${n} @calciteTextAreaInput=${(u) => {
|
|
159
|
+
ae(u.target), t(u.target.value);
|
|
160
|
+
}} ${H(c)}><div class="submission-actions-wrapper" slot=footer-start>${p && U({ errorMessage: p, slot: "footer-start" }) || ""}<div class="submission-actions">${ne({ context: l, messages: h })}<div class="align-inline-end gaps"><calcite-button round kind=neutral .hidden=${a !== "refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${i} @click=${async () => {
|
|
160
161
|
o(!1), t("");
|
|
161
162
|
}}>${h.startover ?? "Start Over"}</calcite-button><calcite-button round icon-end=effects appearance=solid .loading=${i} .disabled=${i} @click=${async () => {
|
|
162
163
|
d(n ? "" : h.enteraprompt ?? "Please enter a prompt"), await s();
|
|
163
164
|
}}>${a === "prompt" ? h.ask ?? "Generate" : h.refine ?? "Refine"}</calcite-button></div></div></div></calcite-text-area></div>`;
|
|
164
165
|
}
|
|
165
|
-
const
|
|
166
|
-
function
|
|
167
|
-
return t.active ?
|
|
166
|
+
const de = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-statement", pe = "https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement";
|
|
167
|
+
function ue({ setOpen: i, messages: e, feedback: t, setFeedback: o, onSubmit: c }) {
|
|
168
|
+
return t.active ? r`<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=${() => o({ ...t, value: "good" })}></calcite-segmented-control-item><calcite-segmented-control-item icon-start=thumbs-down .checked=${t.value === "bad"} @click=${() => o({ ...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=${(n) => o({ ...t, text: n.target.value })}></calcite-text-area></calcite-label><calcite-label layout=inline scale=s><calcite-checkbox scale=l .checked=${t.termsAccepted} @calciteCheckboxChange=${(n) => {
|
|
168
169
|
o({ ...t, termsAccepted: n.target.checked });
|
|
169
|
-
}}></calcite-checkbox><span>${$((e.agreement ?? "I agree to the {EsriPrivacyStatement} (and {Supplement}).").replace("{EsriPrivacyStatement}", `<calcite-link href=${
|
|
170
|
+
}}></calcite-checkbox><span>${$((e.agreement ?? "I agree to the {EsriPrivacyStatement} (and {Supplement}).").replace("{EsriPrivacyStatement}", `<calcite-link href=${de} target="_blank">${e.esriprivacystatement ?? "Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}", `<calcite-link href=${pe} target="_blank">${e.supplement ?? "Supplement"}</calcite-link>`))}</span></calcite-label></div><calcite-button slot=footer width=full @click=${c} .disabled=${!t.termsAccepted || t.submitting} .loading=${t.submitting}>${e.submitfeedback ?? "Submit Feedback"}</calcite-button></calcite-panel></calcite-sheet>` : null;
|
|
170
171
|
}
|
|
171
|
-
function R({ assistantsEnabled: i, messages: e, slot: t, assistantHelpUrl: o, helpTopicUrl:
|
|
172
|
-
return
|
|
172
|
+
function R({ assistantsEnabled: i, messages: e, slot: t, assistantHelpUrl: o, helpTopicUrl: c }) {
|
|
173
|
+
return r`<calcite-block .label=${e.assistantinformation ?? "Assistant information"} slot=${t ?? w} expanded class="info-block"><calcite-chip .label=${e.new ?? "New"} kind=brand>${e.new ?? "New"}</calcite-chip><h1 class="info-heading">${e.introducing ?? "Introducing Arcade Assistant (beta)"}</h1><p>${e.capabilities ?? "The assistant uses artificial intelligence to generate Arcade expressions."}</p>${i ? r`<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>${$((e.seedocumentation ?? "Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}", `<calcite-link href=${c} target="_blank">${e.documentation ?? "documentation"}</calcite-link>`))}</p>` : r`<p>${$(e.useofassistant?.replace("{aiassistants}", `<strong>${e.aiassistants ?? "Ai Assistants"}</strong>`))}<calcite-link .href=${o} target=_blank icon-end=launch-2>${e.configureassistants ?? "Configure Assistants"}</calcite-link></p>`}</calcite-block>`;
|
|
173
174
|
}
|
|
174
|
-
function
|
|
175
|
-
return
|
|
175
|
+
function he({ messages: i, onProceed: e, onExit: t, helpTopicUrl: o }) {
|
|
176
|
+
return r`<calcite-dialog close-disabled placement=top .heading=${i.welcome ?? "Welcome to the new assistant experience"} slot=dialogs open width-scale=m id=welcome-dialog><h3 class="unstyled-h3">${i.beforeyougetstarted ?? "Before you get started be aware:"}</h3><ul><li>${i.maybeincorrect ?? "AI generated code may occasionally be incorrect or biased. Review carefully."}</li><li>${$((i.pleasereadhelp ?? "Read the Arcade Assistant (beta) {helpTopic} to get started and learn details on security, privacy and limitations.").replace("{helpTopic}", `<calcite-link href=${o} target="_blank">${i.helptopic ?? "help topic"}</calcite-link>`))}</li></ul><calcite-button id=welcome-proceed slot=footer-end @click=${e}>${i.proceed ?? "Proceed"}</calcite-button><calcite-button id=welcome-decline slot=footer-start @click=${t} kind=neutral>${i.exit ?? "Exit"}</calcite-button></calcite-dialog>`;
|
|
176
177
|
}
|
|
177
|
-
function
|
|
178
|
-
return
|
|
178
|
+
function me({ messages: i, suggestions: e, onSuggestionClick: t }) {
|
|
179
|
+
return r`<calcite-block .heading=${i.promptsuggestions} expanded collapsible id=suggestion-block><calcite-chip-group class="suggestions" .label=${i.promptsuggestions ?? "Prompt Suggestions"}>${q(e, (o) => o, (o) => r`<calcite-button round appearance=outline-fill kind=neutral .label=${i.promptsuggestion} class="suggestion-button" @click=${() => t?.(o)}>${o}</calcite-button>`)}</calcite-chip-group></calcite-block>`;
|
|
179
180
|
}
|
|
180
|
-
function N({ hidden: i = !1, expanded: e = !1, messages: t, cards: o, heading:
|
|
181
|
+
function N({ hidden: i = !1, expanded: e = !1, messages: t, cards: o, heading: c, collapsible: n = !1, showEffectsIcon: p = !1, onCopyCode: d, standalone: s }) {
|
|
181
182
|
const h = t.addtoeditor ?? "Add to editor";
|
|
182
|
-
return
|
|
183
|
-
const
|
|
183
|
+
return r`<calcite-block .hidden=${i} id=result-block .heading=${c ?? t.besteffort ?? "Here is the assistant's best effort"} .expanded=${e} .collapsible=${n}>${p && r`<calcite-chip .label=${t.assistantresponses ?? "Assistant responses"} slot=content-start icon=effects scale=m class="suggestion-chips"></calcite-chip>` || ""}<calcite-card-group .label=${t.assistantresponses ?? "Assistant responses"}>${q(o, (a) => a.conversationId, (a) => r`<calcite-card><div slot=heading><div class="prior-prompt"><span>${a.priorPrompt}</span><calcite-action icon=duplicate scale=s slot=actions-end class="copy-prompt-button" text .id=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} @click=${(l) => {
|
|
184
|
+
const u = l.currentTarget;
|
|
184
185
|
navigator.clipboard.writeText(a.priorPrompt).then(() => {
|
|
185
|
-
|
|
186
|
+
u.setAttribute("data-copied", "true"), setTimeout(() => u.removeAttribute("data-copied"), 1500);
|
|
186
187
|
});
|
|
187
|
-
}}></calcite-action><calcite-popover .referenceElement=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-feedback" .label=${t.copiedsuccessfully ?? "copied successfully"} open trigger-disabled><span>${t.copiedsuccessfully ?? "copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-tooltip">${t.copyprompttoclipboard ?? "Copy prompt to clipboard"}</calcite-tooltip></div>${a.message && s &&
|
|
188
|
-
const
|
|
189
|
-
return
|
|
188
|
+
}}></calcite-action><calcite-popover .referenceElement=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-feedback" .label=${t.copiedsuccessfully ?? "copied successfully"} open trigger-disabled><span>${t.copiedsuccessfully ?? "copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-prompt-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-tooltip">${t.copyprompttoclipboard ?? "Copy prompt to clipboard"}</calcite-tooltip></div>${a.message && s && r`<div class="response-error-container">${U({ errorMessage: a.message })}</div>` || ""}</div><div><div class="code-response-wrapper"><div class="positioned-code-content"><calcite-chip-group .label=${t.responsecontext ?? "Response Context"} scale=s>${a.message && !s && r`<calcite-tooltip .referenceElement=${`response-chip-${a.conversationId}-error`} placement=top-start overlay-positioning=fixed>${a.message}</calcite-tooltip><calcite-chip .id=${`response-chip-${a.conversationId}-error`} .label=${t.error ?? "Error"} scale=s appearance=outline icon=exclamation-mark-triangle-f class="response-error-chip"></calcite-chip>` || ""}${a.chips?.map((l) => {
|
|
189
|
+
const u = J();
|
|
190
|
+
return r`${l.tooltip && r`<calcite-tooltip .referenceElement=${`response-chip-${l.conversationId}-${u}`} placement=top-start overlay-positioning=fixed>${l.tooltip}</calcite-tooltip>` || ""}<calcite-chip .label=${l.label} .scale=${l.scale ?? "s"} .appearance=${l.appearance ?? "outline"} .icon=${l.icon} .id=${`response-chip-${l.conversationId}-${u}`}>${l.label}</calcite-chip>`;
|
|
190
191
|
})}</calcite-chip-group></div><details class="collapsible-code" open><summary>Code response</summary><code>${a.code}</code></details></div></div><div slot=footer-start class="feedback-actions"><calcite-button primary-text=${h ?? w} class="add-to-editor-button" @click=${() => a.onAddToEditor("add")} overlay-positioning=fixed scale=s icon-start=plus round>${t.addtoeditor ?? "Add to editor"}</calcite-button><calcite-button round icon-start=file-code kind=neutral scale=s @click=${() => a.onAddToEditor("replace")} class="response-secondary-action-button" .id=${`replace-${a.conversationId}-${s ? "standalone" : "list"}`}></calcite-button><calcite-tooltip .referenceElement=${`replace-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start><span>${t.replaceineditor ?? "Replace all code in editor"}</span></calcite-tooltip><calcite-button round icon-start=copy-to-clipboard kind=neutral scale=s @click=${(l) => {
|
|
191
|
-
const
|
|
192
|
+
const u = l.currentTarget;
|
|
192
193
|
d(a.code).then(() => {
|
|
193
|
-
|
|
194
|
+
u.setAttribute("data-copied", "true"), setTimeout(() => u.removeAttribute("data-copied"), 1500);
|
|
194
195
|
});
|
|
195
196
|
}} class="response-secondary-action-button" .id=${`copy-response-${a.conversationId}-${s ? "standalone" : "list"}`}></calcite-button><calcite-popover .referenceElement=${`copy-response-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-feedback" .label=${t.copiedsuccessfully ?? "copied successfully"} open trigger-disabled><span>${t.copiedsuccessfully ?? "copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-response-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start class="copy-tooltip">${t.copytoclipboard ?? "Copy code to clipboard"}</calcite-tooltip></div><div slot=footer-end class="feedback-actions"><calcite-action .text=${t.thumbsup ?? "Thumbs up"} scale=s icon=thumbs-up @click=${a.onThumbsUp} .id=${`thumbs-up-${a.conversationId}-${s ? "standalone" : "list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-up-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start><span>${t.helpful ?? "Helpful"}</span></calcite-tooltip><calcite-action .text=${t.thumbsdown ?? "Thumbs down"} scale=s icon=thumbs-down @click=${a.onThumbsDown} .id=${`thumbs-down-${a.conversationId}-${s ? "standalone" : "list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-down-${a.conversationId}-${s ? "standalone" : "list"}`} placement=top-start><span>${t.unhelpful ?? "Unhelpful"}</span></calcite-tooltip></div></calcite-card>`)}</calcite-card-group></calcite-block>`;
|
|
196
197
|
}
|
|
197
|
-
const
|
|
198
|
+
const fe = "arcade_generation", be = "ArcadeCodeRequest", x = "visualization", ge = "ArcadeAssistant", ve = [
|
|
198
199
|
"your_comments",
|
|
199
200
|
"user_evaluation",
|
|
200
201
|
"question",
|
|
@@ -206,9 +207,9 @@ const me = "arcade_generation", fe = "ArcadeCodeRequest", x = "visualization", b
|
|
|
206
207
|
"extras"
|
|
207
208
|
];
|
|
208
209
|
let M = [], P = !0;
|
|
209
|
-
class
|
|
210
|
+
class ye extends V {
|
|
210
211
|
constructor() {
|
|
211
|
-
super(...arguments), this.textAreaRef =
|
|
212
|
+
super(...arguments), this.textAreaRef = L(), this.messages = j(), this._feedbackService = void 0, this.handleFeedbackButton = (e, t) => {
|
|
212
213
|
this.feedback = { active: !0, value: e, item: t, termsAccepted: !1, text: "", submitting: !1 };
|
|
213
214
|
}, this.handleFeedbackSheetClose = () => {
|
|
214
215
|
this.feedback = {
|
|
@@ -223,7 +224,9 @@ class ve extends H {
|
|
|
223
224
|
this.handleFeedbackSheetClose();
|
|
224
225
|
return;
|
|
225
226
|
}
|
|
226
|
-
const t = this.getModel(), o = t ? await this.getProfileAndMetadata(t.uri) : void 0,
|
|
227
|
+
const t = this.getModel(), o = t ? await this.getProfileAndMetadata(t.uri) : void 0, c = Y.applicationName;
|
|
228
|
+
!c && !this.appVersion && console.warn("Arcade Assistant: esriConfig.applicationName is not set. Consider setting it to help identify the application version in feedback.");
|
|
229
|
+
const n = {
|
|
227
230
|
user_evaluation: this.feedback.value,
|
|
228
231
|
your_comments: this.feedback.text || void 0,
|
|
229
232
|
question: this.feedback.item?.question ?? "",
|
|
@@ -235,17 +238,17 @@ class ve extends H {
|
|
|
235
238
|
*/
|
|
236
239
|
answer: encodeURIComponent(this.feedback.item?.formattedScript ?? ""),
|
|
237
240
|
useragent: navigator.userAgent,
|
|
238
|
-
_source:
|
|
239
|
-
version: this.appVersion
|
|
241
|
+
_source: ge,
|
|
242
|
+
version: this.appVersion || c || "NOT_SET",
|
|
240
243
|
context: o ? JSON.stringify(o) : "",
|
|
241
244
|
extras: o?.profileName ?? "",
|
|
242
245
|
conversation_id: this.feedback.item?.conversationId ?? "",
|
|
243
246
|
privacy_statement: this.feedback.termsAccepted ? "I_agree" : ""
|
|
244
247
|
};
|
|
245
248
|
try {
|
|
246
|
-
await e.applyEdits({ addFeatures: [new
|
|
247
|
-
} catch (
|
|
248
|
-
console.error("Error submitting feedback:",
|
|
249
|
+
await e.applyEdits({ addFeatures: [new X({ attributes: n })] });
|
|
250
|
+
} catch (p) {
|
|
251
|
+
console.error("Error submitting feedback:", p);
|
|
249
252
|
}
|
|
250
253
|
this.handleFeedbackSheetClose();
|
|
251
254
|
}, this.handleClose = (e) => {
|
|
@@ -262,7 +265,7 @@ class ve extends H {
|
|
|
262
265
|
this.properties = { isViewingResult: 16, confirmationActive: 16, isSubmitting: 16, errorMessage: 16, question: 16, history: 16, feedback: 16, splashActive: 16, context: 16, historyCards: 16, closePanel: 0, insertText: 0, helpBase: 1, assistantsEnabled: 5, layer: [1, { type: Object }], portalUrl: 1, serviceUrl: 1, closed: 7, editorRef: 0, feedbackServiceUrl: 1, appVersion: 1 };
|
|
263
266
|
}
|
|
264
267
|
static {
|
|
265
|
-
this.styles =
|
|
268
|
+
this.styles = ee;
|
|
266
269
|
}
|
|
267
270
|
get disclaimerComment() {
|
|
268
271
|
return `// ${this.messages.disclaimercomment}
|
|
@@ -349,7 +352,7 @@ class ve extends H {
|
|
|
349
352
|
return;
|
|
350
353
|
const e = new K({ url: this.feedbackServiceUrl });
|
|
351
354
|
await e.load();
|
|
352
|
-
const t =
|
|
355
|
+
const t = ve.filter((o) => !e.fields.some((c) => c.name === o));
|
|
353
356
|
if (t.length > 0) {
|
|
354
357
|
console.error(`Missing the following fields in feedback service: ${t.join(", ")}. Feedback will not be logged.`);
|
|
355
358
|
return;
|
|
@@ -366,16 +369,16 @@ class ve extends H {
|
|
|
366
369
|
const e = await this.getToken(), t = this.getModel();
|
|
367
370
|
if (!t)
|
|
368
371
|
return;
|
|
369
|
-
const { profileName: o, metadata:
|
|
372
|
+
const { profileName: o, metadata: c, layerName: n } = await this.getProfileAndMetadata(t.uri), d = (await te({
|
|
370
373
|
baseUrl: this.serviceUrl,
|
|
371
|
-
skillId:
|
|
374
|
+
skillId: fe,
|
|
372
375
|
message: this.question,
|
|
373
376
|
authToken: e,
|
|
374
377
|
context: {
|
|
375
|
-
kind:
|
|
378
|
+
kind: be,
|
|
376
379
|
context: {
|
|
377
380
|
profile_name: o,
|
|
378
|
-
metadata:
|
|
381
|
+
metadata: c
|
|
379
382
|
}
|
|
380
383
|
}
|
|
381
384
|
})).find((s) => s.context?.kind === "ArcadeCodeResponse");
|
|
@@ -395,7 +398,7 @@ class ve extends H {
|
|
|
395
398
|
...this.history
|
|
396
399
|
], this.isViewingResult = !0, this.errorMessage = void 0);
|
|
397
400
|
} catch (e) {
|
|
398
|
-
e instanceof Error && e.name === "ArcadeAssistantError" ? this.errorMessage =
|
|
401
|
+
e instanceof Error && e.name === "ArcadeAssistantError" ? this.errorMessage = oe(e) || this.messages.erroroccurred || "An error occurred." : this.errorMessage = this.messages.erroroccurred || "An error occurred.", console.error("Error in Arcade Assistant:", e);
|
|
399
402
|
} finally {
|
|
400
403
|
this.isSubmitting = !1;
|
|
401
404
|
}
|
|
@@ -409,15 +412,15 @@ class ve extends H {
|
|
|
409
412
|
let t = x;
|
|
410
413
|
const o = I.getEditorProfileForModel(e);
|
|
411
414
|
o?.loaded || await o?.loadSource();
|
|
412
|
-
const
|
|
413
|
-
|
|
415
|
+
const c = this.editorRef.profile;
|
|
416
|
+
c && "id" in c && (t = c.id);
|
|
414
417
|
const n = o?.definition?.variables?.find((s) => s.type === "feature");
|
|
415
|
-
let
|
|
416
|
-
return n?.definition && "fields" in n.definition && (
|
|
418
|
+
let p = [], d;
|
|
419
|
+
return n?.definition && "fields" in n.definition && (p = n.definition.fields.map((s) => ({
|
|
417
420
|
name: s.name,
|
|
418
421
|
type: s.type,
|
|
419
422
|
alias: s.alias
|
|
420
|
-
})),
|
|
423
|
+
})), Z(n?.definition) && (d = n.definition.title)), { profileName: t, metadata: p, layerName: d };
|
|
421
424
|
}
|
|
422
425
|
onCopyCode(e) {
|
|
423
426
|
const t = e ? `${this.disclaimerComment}
|
|
@@ -425,9 +428,9 @@ ${e}` : "";
|
|
|
425
428
|
return navigator.clipboard.writeText(t);
|
|
426
429
|
}
|
|
427
430
|
render() {
|
|
428
|
-
return this.closed ? null : this.assistantsEnabled ?
|
|
431
|
+
return this.closed ? null : this.assistantsEnabled ? r`<calcite-flow><calcite-flow-item closable heading-level=2 .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.splashActive && r`<calcite-scrim></calcite-scrim>` || ""}${se({ messages: this.messages })}${ce({ popoverContent: R({ assistantsEnabled: this.assistantsEnabled, messages: this.messages, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.usingTheAssitantDocUrl }) })}<calcite-shell class="unstyled-shell">${this.splashActive && he({ messages: this.messages, onProceed: () => {
|
|
429
432
|
this.splashActive = !1;
|
|
430
|
-
}, helpTopicUrl: this.assistantOverviewDocUrl, onExit: (e) => this.closePanel && this.closePanel(e) }) || ""}${
|
|
433
|
+
}, helpTopicUrl: this.assistantOverviewDocUrl, onExit: (e) => this.closePanel && this.closePanel(e) }) || ""}${re({ active: this.confirmationActive, setActive: (e) => this.confirmationActive = e, messages: this.messages })}${le({ 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: this.messages, context: this.context })}<calcite-block-group label="interactive blocks">${!this.isViewingResult && !this.isSubmitting && me({ messages: this.messages, suggestions: [this.messages.prompsuggestion1 ?? "", this.messages.prompsuggestion2 ?? ""], onSuggestionClick: this.onSuggestionClick }) || ""}<calcite-block .hidden=${!this.isSubmitting} .heading=${this.messages.generatingresponse ?? "Generating response..."}></calcite-block>${N({
|
|
431
434
|
expanded: this.isViewingResult,
|
|
432
435
|
messages: this.messages,
|
|
433
436
|
collapsible: !0,
|
|
@@ -452,10 +455,10 @@ ${e}` : "";
|
|
|
452
455
|
heading: this.messages.recentprompts ?? "Recent prompts",
|
|
453
456
|
hidden: this.isSubmitting || this.history.length === 0,
|
|
454
457
|
onCopyCode: this.onCopyCode.bind(this)
|
|
455
|
-
})}</calcite-block-group>${this.feedback.active ?
|
|
458
|
+
})}</calcite-block-group>${this.feedback.active ? ue({ setOpen: this.handleFeedbackSheetClose, messages: this.messages, onSubmit: this.handleFeedbackSubmit, feedback: this.feedback, setFeedback: this.setFeedbackState.bind(this) }) : null}</calcite-shell></calcite-flow-item></calcite-flow>` : r`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable heading-level=2 .heading=${this.messages.arcadeassistant ?? "Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${R({ slot: "content-top", messages: this.messages, assistantsEnabled: this.assistantsEnabled, assistantHelpUrl: this.assistantHelpUrl, helpTopicUrl: this.usingTheAssitantDocUrl })}</calcite-flow-item></calcite-flow>`;
|
|
456
459
|
}
|
|
457
460
|
}
|
|
458
|
-
O("arcgis-arcade-coding-assistant",
|
|
461
|
+
O("arcgis-arcade-coding-assistant", ye);
|
|
459
462
|
export {
|
|
460
|
-
|
|
463
|
+
ye as ArcgisArcadeCodingAssistant
|
|
461
464
|
};
|