@arcgis/coding-components 5.1.0-next.95 → 5.1.0-next.97
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/cdn/GHTOL7NB.js +2 -0
- package/dist/cdn/{55EKVOZS.js → GVMVHGSK.js} +1 -1
- package/dist/cdn/PPV6RAZ3.js +2 -0
- package/dist/cdn/WP6BSOSW.js +2 -0
- package/dist/cdn/assets/arcade-debugger-console/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +1 -1
- package/dist/cdn/assets/code-editor/sql-layer.worker.js +619 -602
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-arcade-debugger-console/customElement.js +85 -69
- package/dist/components/arcgis-arcade-editor/customElement.js +15 -17
- package/dist/components/arcgis-code-editor/customElement.js +88 -97
- package/dist/components/arcgis-sql-layer-editor/customElement.js +2 -2
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/cdn/AEHKSYEZ.js +0 -2
- package/dist/cdn/E3VATROF.js +0 -2
- package/dist/cdn/XN56YGFQ.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{b as I}from"./JLF32ABD.js";import e from"./TCLNQ7Z6.js";import d from"./GZ6HZKQZ.js";import c from"./ZHZFKZA7.js";import{c as E}from"./P7I5ATMN.js";import"./G56LJGLK.js";import"./ER2MKLVA.js";import"./MP6Z45SA.js";import"./IFNCCZ7O.js";import{a as u}from"./SB3MM5EM.js";import"./KCU2C44H.js";import"./GS2ISVXJ.js";import"./6G5URSC7.js";import"./6C52UOYL.js";import{E as g,F as m,G as _,H as b,K as f,h as p,j as o,n as r,t as h}from"./REL6OK2I.js";import{b as a}from"./Y3KOWWO5.js";import"./B3UMUBOI.js";import"./CF3TERM3.js";import"./Z5ZZ36DQ.js";import"./LLPQEURF.js";import"./3TTFCHAA.js";export default $arcgis.t(([,,,,,,,{E:l},{c:d},{a:S,b:v,c:$,d:y}])=>{var x=p`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`,n=class extends _{constructor(){super(...arguments),this._codeEditorElt=g(),this._disposables=[],this._modelId=h(),this.messages=u(),this._preparing=!1,this._resolvedLanguage=d,this.sideActionBarExpanded=!1,this.script="",this.hideSideBar=!1,this.openedSidePanel="none",this.arcgisDiagnosticsChange=r({bubbles:!1}),this.arcgisScriptChange=r({bubbles:!1})}static{this.properties={_editorProfile:16,_preparing:16,_resolvedLanguage:16,sideActionBarExpanded:16,profile:0,script:1,hideSideBar:5,messageOverrides:0,openedSidePanel:3,editorOptions:0,editorInstance:32}}static{this.styles=[x]}get editorInstance(){return this._codeEditorElt.value?.editorInstance}async setFocus(){await this._codeEditorElt.value?.setFocus()}async load(){await this._updateDataModelDeps().catch(a(this))}willUpdate(e){e.has("profile")&&this._updateDataModelDeps().catch(a(this))}async loaded(){let e=I();this._disposables.push(e.onDiagnosticsChange(t=>{t.uri.toString()===this._modelId&&!this._preparing&&this.arcgisDiagnosticsChange.emit(t.diagnostics)}))}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose();y().forEach(e=>e.disposeForModel(this._modelId))}async _updateDataModelDeps(){this._preparing=!0;try{let e=await S(this.profile);e!==this._resolvedLanguage&&($(this._resolvedLanguage)?.disposeForModel(this._modelId),this._resolvedLanguage=e);let t=v(this._resolvedLanguage);await t.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale}),this._editorProfile=t.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0,this._resolvedLanguage=d}finally{this._preparing=!1}}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_toggleSidePanel(e){this.openedSidePanel=this.openedSidePanel===e?"none":e,this.openedSidePanel==="none"&&this._codeEditorElt.value?.setFocus().catch(a(this))}_onCodeEditorValueChange(e){e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)}async _onItemSelected(e){e.stopPropagation();let t=this._getSelectedTableVariable(e.detail);if(!t){this._codeEditorElt.value?.insertText(e.detail).catch(a(this));return}await t.loadSource();let i,c=t.fieldInfos.filter(s=>s.type==="geometry"&&!i?(i=s.name,!0):s.type!=="geometry").map(s=>s.name).filter(Boolean),P=`select ${c.length?c.join(", "):"*"} from ${t.snippet}
|
|
2
|
+
import{b as I}from"./JLF32ABD.js";import e from"./TCLNQ7Z6.js";import d from"./GZ6HZKQZ.js";import c from"./ZHZFKZA7.js";import{c as E}from"./P7I5ATMN.js";import"./G56LJGLK.js";import"./ER2MKLVA.js";import"./MP6Z45SA.js";import"./IFNCCZ7O.js";import{a as u}from"./SB3MM5EM.js";import"./KCU2C44H.js";import"./GS2ISVXJ.js";import"./6G5URSC7.js";import"./6C52UOYL.js";import{E as g,F as m,G as _,H as b,K as f,h as p,j as o,n as r,t as h}from"./REL6OK2I.js";import{b as a}from"./Y3KOWWO5.js";import"./B3UMUBOI.js";import"./CF3TERM3.js";import"./Z5ZZ36DQ.js";import"./LLPQEURF.js";import"./3TTFCHAA.js";export default $arcgis.t(([,,,,,,,{E:l},{c:d},{a:S,b:v,c:$,d:y}])=>{var x=p`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`,n=class extends _{constructor(){super(...arguments),this._codeEditorElt=g(),this._disposables=[],this._modelId=h(),this.messages=u(),this._preparing=!1,this._resolvedLanguage=d,this.sideActionBarExpanded=!1,this.script="",this.hideSideBar=!1,this.openedSidePanel="none",this.arcgisDiagnosticsChange=r({bubbles:!1}),this.arcgisScriptChange=r({bubbles:!1})}static{this.properties={_editorProfile:16,_preparing:16,_resolvedLanguage:16,sideActionBarExpanded:16,profile:0,script:1,hideSideBar:5,messageOverrides:0,openedSidePanel:3,editorOptions:0,editorInstance:32}}static{this.styles=[x]}get editorInstance(){return this._codeEditorElt.value?.editorInstance}async setFocus(){await this._codeEditorElt.value?.setFocus()}async load(){await this._updateDataModelDeps().catch(a(this))}willUpdate(e){e.has("profile")&&this._updateDataModelDeps().catch(a(this))}async loaded(){let e=I();this._disposables.push(e.onDiagnosticsChange(t=>{t.uri.toString()===this._modelId&&!this._preparing&&this.arcgisDiagnosticsChange.emit(t.diagnostics)}))}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose();y().forEach(e=>e.disposeForModel(this._modelId))}async _updateDataModelDeps(){this._preparing=!0;try{let e=await S(this.profile);e!==this._resolvedLanguage&&($(this._resolvedLanguage)?.disposeForModel(this._modelId),this._resolvedLanguage=e);let t=v(this._resolvedLanguage);await t.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale}),this._editorProfile=t.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0,this._resolvedLanguage=d}finally{this._preparing=!1}}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_toggleSidePanel(e){this.openedSidePanel=this.openedSidePanel===e?"none":e,this.openedSidePanel==="none"&&this._codeEditorElt.value?.setFocus().catch(a(this))}_onCodeEditorValueChange(e){e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)}async _onItemSelected(e){e.stopPropagation();let t=this._getSelectedTableVariable(e.detail);if(!t){this._codeEditorElt.value?.insertText(e.detail).catch(a(this));return}await t.loadSource();let i,c=t.fieldInfos.filter(s=>s.type==="geometry"&&!i?(i=s.name,!0):s.type!=="geometry").map(s=>s.name).filter(Boolean),P=`select ${c.length?c.join(", "):"*"} from ${t.snippet}`;E(this._codeEditorElt.value?.editorInstance,P,"replace","")}_getTablesVariable(){return this._editorProfile?.variables.find(l)}_getSelectedTableVariable(e){let t=this._getTablesVariable();if(l(t))return t.tableVariables.find(i=>i.snippet===e)}render(){let e=this._getTablesVariable(),t=String(this.messages.placeholderexample??"Example: {sqlQueryExample}").replace("{sqlQueryExample}","select field1, field2 from db.dataset"),i=`${this.messages.placeholder??"Start filtering data using SQL query syntax"}
|
|
3
3
|
${t}`;return o`<arcgis-code-editor-shell><arcgis-code-editor slot=editor .language=${this._resolvedLanguage} .modelId=${this._modelId} .value=${this.script??""} @arcgisValueChange=${this._onCodeEditorValueChange} .editorOptions=${{placeholder:i,...this.editorOptions}} ${m(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar&&o`<arcgis-editor-variables slot=side-panel .variable=${e} .heading=${this.messages.tables??"Tables"} .messageOverrides=${{profileempty:this.messages.profileempty}} .closed=${this.openedSidePanel!=="variables"} class=${b(this.openedSidePanel==="variables"?"":"hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._onItemSelected} @arcgisInternalClosePanel=${()=>{this.openedSidePanel="none"}} data-panel-name=none></arcgis-editor-variables><calcite-action-bar slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action id=tables-action .text=${this.messages.tables??"Tables"} icon=table .active=${this.openedSidePanel==="variables"} data-panel-name=variables @click=${()=>this._toggleSidePanel("variables")}></calcite-action>${!this.sideActionBarExpanded&&o`<calcite-tooltip reference-element=tables-action><span>${this.messages.tables??"Tables"}</span></calcite-tooltip>`||""}</calcite-action-bar>`||""}</arcgis-code-editor-shell>`}};f("arcgis-sql-layer-editor",n);return n},"portal/PortalItem","WebMap","WebScene","layers/FeatureLayer","applications/Components/arcadeEditorUtils","core/Error","portal/Portal",c,d,e)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as b}from"./64X4ILDM.js";import h from"./YE7HDVYS.js";import e from"./4B64NBIM.js";import{a as E}from"./ER2MKLVA.js";import d from"./7Z4V2ZOD.js";import c from"./TNA5F36E.js";import"./HPZZVB4X.js";import"./MP6Z45SA.js";import"./IFNCCZ7O.js";import a from"./GLJQQLP2.js";import{a as T}from"./SB3MM5EM.js";import{a as y}from"./KCU2C44H.js";import"./GS2ISVXJ.js";import{c as S,e as k}from"./6G5URSC7.js";import"./6C52UOYL.js";import{G as w,H as x,I as g,K as $,h as u,j as r,t as f}from"./REL6OK2I.js";import"./Y3KOWWO5.js";import"./B3UMUBOI.js";import"./CF3TERM3.js";import"./Z5ZZ36DQ.js";import{Zk as P}from"./LLPQEURF.js";import"./3TTFCHAA.js";export default $arcgis.t(([,{h:m,i:L,j:M},{a:l},{a:p},{a:z,b:C,c:h,d:A,e:B,f:I,g:N,h:F,i:D}])=>{var V=u`:host{--calcite-block-padding: var(--calcite-spacing-sm);--breakpoints-popover-max-height: min(14rem, 20vh);display:block;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);overflow:hidden;height:100%;.console-shell,.tabs-container,calcite-tabs{height:100%}.tabs-container{flex:1 1 auto;min-height:0;overflow:hidden}.console-shell,calcite-tabs{display:flex;flex-direction:column;min-height:0}.console-shell{container-type:size;container-name:debugger-console}calcite-tab-nav{--calcite-size-2xl: var(--calcite-space-md);justify-content:flex-start;padding-inline:var(--calcite-spacing-sm)}calcite-tab-title{font-size:var(--calcite-font-size-sm)}calcite-tab{--calcite-tab-content-block-padding: 0;--calcite-tab-content-space-y: 0;display:flex;flex-direction:column;min-height:0}calcite-tab:not([selected]){display:none}.disabled-state-text{font-size:var(--calcite-font-size-sm);color:var(--calcite-color-text-3);font-style:italic;text-align:center;display:block;padding:var(--calcite-spacing-md)}.breakpoint-header{display:flex;align-items:flex-start;gap:var(--calcite-spacing-sm);padding:var(--calcite-spacing-sm);border-bottom:1px solid var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.load-action{--calcite-action-background-color: var(--calcite-color-foreground-2);--calcite-internal-action-height: 1.25rem;--calcite-internal-action-padding-block: 0;--calcite-internal-action-padding-inline: var(--calcite-spacing-xs);margin-block:var(--calcite-spacing-xxs)}.breakpoint-code-viewer{margin-block:0;width:100%}.tab-panel{display:flex;flex:1 1 auto;min-height:0;overflow:hidden}.tab-panel>*{flex:1 1 auto;min-height:0}.tab-panel>calcite-tree{margin-inline-end:var(--calcite-space-sm)}.preview-panel{display:flex;flex:1 1 auto;min-height:0}.preview-empty-state{display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:var(--calcite-spacing-md)}.preview-table-shell{display:flex;flex-direction:column;flex:1 1 auto;width:100%;min-height:0;overflow:hidden}.preview-table-summary{padding:var(--calcite-spacing-sm);border-bottom:1px solid var(--calcite-color-border-3);color:var(--calcite-color-text-2);font-family:var(--calcite-code-family);background-color:var(--calcite-color-foreground-1)}.table-scroll{overflow:auto;flex:1 1 auto;min-height:0;max-width:100%;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-sm)}table{min-width:max-content;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)}}.breakpoints-popover{--calcite-popover-max-size-x: min(22rem, 68vw)}.breakpoints-popover-content{max-block-size:var(--breakpoints-popover-max-height);overflow:hidden}.breakpoints-list{display:flex;flex-direction:column;gap:var(--calcite-spacing-xs);padding:var(--calcite-spacing-xs);min-width:min(18rem,58vw);max-block-size:var(--breakpoints-popover-max-height);overflow:auto}.breakpoints-popover .breakpoint-code-viewer{--calcite-font-size--2: var(--calcite-font-size--3);--calcite-spacing-md: var(--calcite-spacing-sm);--calcite-spacing-sm: var(--calcite-spacing-xs);--calcite-spacing-xs: var(--calcite-spacing-xxs)}.breakpoint-list-item{border:1px solid var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sharp);background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-xxs)}.breakpoint-list-item--current{border-color:var(--calcite-color-brand)}.breakpoint-list-item-meta{color:var(--calcite-color-text-2);font-size:var(--calcite-font-size-xs);margin-bottom:var(--calcite-spacing-xxs)}}`,v=class extends w{constructor(){super(...arguments),this.messages=T(),this._monacoEditor=y(E),this._breakpointPopoverId=`arcade-debugger-console-breakpoints-${f()}`,this.modelId=""}static{this.properties={debuggerStore:0,modelId:1}}static{this.styles=[V,M,L()]}get breakpoints(){return this.debuggerStore?.debuggerBreakpoints??[]}get previewTabsState(){return this.debuggerStore.previewTabsState}get lazyTreeState(){return this.debuggerStore?.lazyTreeState}get executionProgramState(){return this.debuggerStore?.executionState?.result}load(){this.manager.onLifecycle(()=>{let e=S(this.el,["class"],this.updateTheme.bind(this));return this.updateTheme(),()=>e()})}getContentAtLine(e){if(!this.modelId)return"";let t=this._monacoEditor.getModel(P.parse(this.modelId));return t?t.getLineContent(e):""}updateTheme(){k(this.el)==="dark"?this.elementInternals.states.add(m):this.elementInternals.states.delete(m)}getBreakpointCode(e){return e==null?this.messages.nocontent??"No content":this.getContentAtLine(e)||(this.messages.nocontent??"No content")}getPreviewLoadErrorMessage(){return this.messages.previewloaderror??"Unable to load preview."}getBreakpointPositionText(e){return(this.messages.breakpointposition??"{position} of {count}"??"{position} of {count}").replace("{position}",String(e)).replace("{count}",String(this.breakpoints.length))}findCollectionItemByPreviewSegment(e,t){if(t.startsWith("name:")){let i=t.slice(5);return e.find(a=>a.name===i)?.featureSet}if(t.startsWith("id:")){let i=t.slice(3);return e.find(a=>String(a.id)===i)?.featureSet}}getExpandedDebuggerMap(e){if(e==null||!h(e))return null;let t=e.expand();return Array.isArray(t)?null:t}getPreviewRows(e){return e.map(t=>this.getExpandedDebuggerMap(t)||new Map)}getExpandedDebuggerChild(e,t){if(!e||!h(e))return;let i=e.expand();if(Array.isArray(i)){let a=Number(t);return!Number.isInteger(a)||String(a)!==t?void 0:i[a]}return i.get(t)}async resolvePreviewValueFromSegments(e,t){if(!t.length)return e;if(!e)return;let[i,...a]=t,o;if(N(e)){let s=await e.load();o=this.findCollectionItemByPreviewSegment(s,i)}else o=this.getExpandedDebuggerChild(e,i);return await this.resolvePreviewValueFromSegments(o,a)}getScope(e,t){switch(t){case"profile":return e.profile;case"globals":return e.globals;case"locals":return e.locals}}async resolvePreviewValue(e){let t=this.executionProgramState;if(!t)return;let i=C(e);if(!i)return;let{scopeName:a,rootName:o,pathSegments:s}=i,c=this.getScope(t,a);if(c)return await this.resolvePreviewValueFromSegments(c.get(o),s)}async loadPreview({label:e,sourcePath:t,value:i}){let a=this.previewTabsState,{snapshot:o}=a.startLoad(e,t),s=i;if(s==null)try{s=await this.resolvePreviewValue(t)}catch{a.setError(o,this.getPreviewLoadErrorMessage());return}if(s==null||!I(s)||typeof s.querySample!="function"||typeof s.schema!="function"){a.setUnavailable(o,this.messages.previewunavailable??"This preview is no longer available in the current paused state.");return}try{let{fields:c,features:d}=await s.querySample(),n=this.getPreviewRows(d);a.setLoaded(o,c,n)}catch{a.setError(o,this.getPreviewLoadErrorMessage())}}activateTab(e){if(e===p){this.previewTabsState.selectScope();return}this.previewTabsState.selectTab(e);let t=this.previewTabsState.getTab(e);t?.invalidated&&this.loadPreview({label:t.label,sourcePath:t.sourcePath})}closePreviewTab(e){e.closed=!1,this.previewTabsState.closeTab(e.tab)}scrollToSelectedBreakpoint(e){let t=e.currentTarget;requestAnimationFrame(()=>{t?.querySelector(".breakpoint-list-item--current")?.scrollIntoView({block:"center"})})}sortScopeEntries(e){return e.sort(([t],[i])=>t.localeCompare(i))}renderPreviewLabel(e){return r`<bdi>${e}</bdi>`}renderPreviewCell(e){return e?B(e)||A(e)?D({value:e}):r`<span class="xs"></span>`:r`<span class="xs"></span>`}renderScopeEntryForScope(e,t,i){let[a,o]=i,s=`${t}.${a}`,c=this.lazyTreeState;return c?F({name:a,value:o,messages:this.messages,path:`${e}.${a}`,lazyTreeState:c,previewLabel:s,previewSourcePath:z(e,a),previewLoading:this.previewTabsState.isTabLoading(s),onLoadPreview:d=>{this.loadPreview(d)}}):null}renderBreakpointPopover(e){return this.breakpoints.length?r`<calcite-popover .referenceElement=${this._breakpointPopoverId} placement=bottom-end scale=s auto-close focus-trap-disabled @calcitePopoverOpen=${t=>this.scrollToSelectedBreakpoint(t)} .label=${this.messages.breakpoints??"Breakpoints"} class="breakpoints-popover" .heading=${this.messages.breakpoints??"Breakpoints"} heading-level=2><div class="breakpoints-popover-content"><div class="breakpoints-list">${this.breakpoints.map((t,i)=>r`<div class=${x(t.line===e?"breakpoint-list-item breakpoint-list-item--current":"breakpoint-list-item")}><div class="breakpoint-list-item-meta"><bdi>${this.getBreakpointPositionText(i+1)}</bdi></div><arcgis-code-viewer language=arcade class="breakpoint-code-viewer" .lineNumbers=${a=>String(a+t.line-1)}>${this.getBreakpointCode(t.line)}</arcgis-code-viewer></div>`)}</div></div></calcite-popover>`:null}renderScopePanel(){let e=this.executionProgramState,t=this.sortScopeEntries(Array.from(e?.profile??[])),i=this.sortScopeEntries(Array.from(e?.globals??[])),a=e?.locals?this.sortScopeEntries(Array.from(e?.locals??[])):void 0,o=!!e?.locals,s=a&&a.length>0,c=t.length>0,d=i.length>0;return e?r`<calcite-tree .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect} .lines=${l.lines} .selectionMode=${l.selectionMode}><calcite-tree-item expanded .disabled=${!s}>${this.messages.local??"Local"}<calcite-tree slot=children .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${o?s?a.map(n=>this.renderScopeEntryForScope("locals",this.messages.local??"Local",n)):r`<span><i>${this.messages.empty??"Empty"}</i></span>`:r`<span><i>${this.messages.nolocalscope??"No local scope"}</i></span>`}</calcite-tree></calcite-tree-item><calcite-tree-item expanded .disabled=${!d}>${this.messages.global??"Global"}<calcite-tree slot=children .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${d?i.map(n=>this.renderScopeEntryForScope("globals",this.messages.global??"Global",n)):r`<span><i>${this.messages.empty??"Empty"}</i></span>`}</calcite-tree></calcite-tree-item><calcite-tree-item expanded .disabled=${!c}>${this.messages.profile??"Profile"}<calcite-tree slot=children .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${c?t.map(n=>this.renderScopeEntryForScope("profile",this.messages.profile??"Profile",n)):r`<span><i>${this.messages.empty??"Empty"}</i></span>`}</calcite-tree></calcite-tree-item></calcite-tree>`:this.debuggerStore?.isExecuting?r`<div class="preview-empty-state"><calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"} .text=${this.messages.loading??"Loading"}></calcite-loader></div>`:r`<span class="disabled-state-text">${this.messages.notpaused??"Not paused"}</span>`}renderPreviewPanel(e){switch(e.status){case"loading":return r`<div class="preview-empty-state"><calcite-loader scale=s type=indeterminate .label=${this.messages.loadingpreview??"Loading preview"} .text=${this.messages.loadingpreview??"Loading preview"}></calcite-loader></div>`;case"unavailable":case"error":return r`<span class="disabled-state-text">${e.message}</span>`;case"loaded":let{fields:t,label:i,rows:a}=e;return!a.length||!t.length?r`<span class="disabled-state-text">${this.messages.nopreviewrows??"No preview rows available."}</span>`:r`<div class="preview-table-shell"><div class="preview-table-summary">${this.renderPreviewLabel(i)}</div><div class="table-scroll"><table><thead><tr>${t.map(o=>r`<th><bdi>${o}</bdi></th>`)}</tr></thead><tbody>${a.map(o=>r`<tr>${t.map(s=>r`<td>${this.renderPreviewCell(o.get(s))}</td>`)}</tr>`)}</tbody></table></div></div>`;default:return r`<span class="disabled-state-text">${this.messages.nopreviewloaded??"Select a FeatureSet variable and load a preview."}</span>`}}renderTabs(){let e=this.previewTabsState.activeTabId;return r`<calcite-tabs><calcite-tab-nav slot=title-group><calcite-tab-title .tab=${p} .selected=${e===p} @calciteTabsActivate=${t=>this.activateTab(t.target.tab)}>${this.messages.scope??"Scope"}</calcite-tab-title>${b(this.previewTabsState.tabs,t=>`title-${t.id}`,t=>r`<calcite-tab-title .tab=${t.id} title=${t.label??g} closable .selected=${e===t.id} @calciteTabsActivate=${i=>this.activateTab(i.target.tab)} @calciteTabsClose=${i=>this.closePreviewTab(i.target)}><bdi>${t.title}</bdi></calcite-tab-title>`)}</calcite-tab-nav><calcite-tab .tab=${p} .selected=${e===p}><div class="tab-panel">${this.renderScopePanel()}</div></calcite-tab>${b(this.previewTabsState.tabs,t=>`panel-${t.id}`,t=>r`<calcite-tab .tab=${t.id} .selected=${e===t.id}><div class="tab-panel preview-panel">${this.renderPreviewPanel(t)}</div></calcite-tab>`)}</calcite-tabs>`}render(){let{line:e}=this.debuggerStore?.executionState??{},t=this.breakpoints.find(a=>a.line===e),i=this.breakpoints.findIndex(a=>a.line===e);return r`<div class="console-shell"><div class="breakpoint-header"><arcgis-code-viewer language=arcade class="breakpoint-code-viewer" .lineNumbers=${a=>String(a+(t?.line??e??1)-1)}>${this.getBreakpointCode(t?.line??this.breakpoints[0]?.line??e??1)}</arcgis-code-viewer>${this.breakpoints.length?r`<calcite-action id=${this._breakpointPopoverId??g} scale=s .text=${this.getBreakpointPositionText(i>=0?i+1:1)} text-enabled icon=chevron-down></calcite-action>`:null}${this.renderBreakpointPopover(t?.line??e)}</div><div class="tabs-container">${this.renderTabs()}</div></div>`}};$("arcgis-arcade-debugger-console",v);return v},a,c,d,e,h)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import f from"./NOHSS7JG.js";import e from"./GPIFJKPY.js";import d from"./GZ6HZKQZ.js";import c from"./ZHZFKZA7.js";import{e as J}from"./P7I5ATMN.js";import b from"./4B64NBIM.js";import"./G56LJGLK.js";import{a as ee}from"./ER2MKLVA.js";import"./IFNCCZ7O.js";import a from"./GLJQQLP2.js";import{a as Y}from"./SB3MM5EM.js";import{a as K}from"./KCU2C44H.js";import"./GS2ISVXJ.js";import"./6G5URSC7.js";import"./6C52UOYL.js";import{E as V,F as H,G as Q,H as x,K as W,L as X,h as j,j as l,l as I,n as L,t as G}from"./REL6OK2I.js";import{a as q,b as u}from"./Y3KOWWO5.js";import"./B3UMUBOI.js";import"./CF3TERM3.js";import"./Z5ZZ36DQ.js";import{Rk as Z,Uk as T}from"./LLPQEURF.js";import"./3TTFCHAA.js";export default $arcgis.t(([ne,{watch:F},m,{property:o,subclass:S},{a:te,h:y,i:B},{b:M},,,P,{a:se,b:ie}])=>{var ce=j`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}.main-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group 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)}}.bottom-action-bar.is-collapsed{border-bottom:0}`,ae="https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0",p=(t,e)=>q(t,"Arcade Assistant",e),le=t=>{let{aiAssistantsEnabled:e}=t;return e===void 0?(p("warn","`areAiAssistantsEnabled` is not defined in the organizations settings."),!1):e},de=t=>!(!t||!("id"in t)),ue=async t=>(await ne.getCredential(t,{oAuthPopupConfirmation:!1})).token,he=async t=>{try{return!!await ne.checkSignInStatus(t)}catch{return p("warn","User is not signed in."),!1}};async function ge({portalUrl:t,profile:e}){if(!de(e))return p("warn","Addon initialization failed. Reason: unsupported profile."),{shouldRender:!1};let s=t.replace(/\/sharing\/rest(\/.*)?$/iu,"").replace(/\/$/u,"");if(!await he(s))return{shouldRender:!1};let i=await ue(t),a=`${s}/sharing/rest/portals/self?f=json&token=${i}`,r=`${s}/sharing/rest/portals/self/settings?f=json&token=${i}`,n=`${s}/sharing/rest/portals/self/signinSettings?f=json&token=${i}`,d=await Promise.allSettled([fetch(a,{credentials:"include"}).then($=>$.json()),fetch(r,{credentials:"include"}).then($=>$.json()),fetch(n,{credentials:"include"}).then($=>$.json())]),[f,R,C]=d,A=f.status==="fulfilled"?f.value:(p("warn",`Failed to fetch selfUrl. Reason: ${f.reason}.`),{}),O=R.status==="fulfilled"?R.value:(p("warn",`Failed to fetch settingsUrl. Reason: ${R.reason}.`),{}),re=C.status==="fulfilled"?C.value:(p("warn",`Failed to fetch signinSettingsUrl. Reason: ${C.reason}.`),{});if(A.isPortal)return{shouldRender:!1};let U=A.helpBase||"";if(!O)return p("warn","Settings response is not available."),{shouldRender:!1};let k=le(O);re.blockBetaApps===!0&&(p("warn","Arcade Assistant is blocked by the organization settings. To enable it, do not block beta apps in the organization settings."),k=!1),A?.user?.privileges?.includes("portal:user:useAIAssistants")||(p("warn","User does not have the required privileges to use AI Assistants."),k=!1);let z=A?.helperServices?.aiAssistantServices?.url;return z?{shouldRender:!0,serviceUrl:z,helpBase:U,assistantsEnabled:k,feedbackServiceUrl:ae}:{shouldRender:!0,assistantsEnabled:!1,helpBase:U,feedbackServiceUrl:ae}}var pe=Object.defineProperty,be=Object.getOwnPropertyDescriptor,_=(t,e,s,i)=>{for(var a=i>1?void 0:i?be(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(a=(i?n(e,s,a):n(a))||a);return i&&a&&pe(e,s,a),a},oe=100,h=class extends m{constructor(t){super(t),this.collectionItems=[],this.errorMessage="",this.expanded=!1,this.requestId=0,this.status="idle",this.visibleChildCount=oe}};_([o()],h.prototype,"collectionItems",2);_([o()],h.prototype,"errorMessage",2);_([o()],h.prototype,"expanded",2);_([o()],h.prototype,"requestId",2);_([o()],h.prototype,"schemaValue",2);_([o()],h.prototype,"status",2);_([o()],h.prototype,"visibleChildCount",2);h=_([S("ArcadeDebuggerLazyTreeNodeState")],h);var w=class extends m{constructor(t){super(t),this.generation=0,this.nodes=new Map}reset(){this.generation+=1,this.destroyNodes()}ensureNode(t,e=!1,s){let i=this.nodes.get(t);if(i)return i;let a=new h;return a.expanded=e,this.nodes.set(t,a),e&&s&&this.loadNode(t,s),a}setExpanded(t,e,s){let i=this.ensureNode(t,e,s);if(i.expanded===e){e&&s&&this.loadNode(t,s);return}i.expanded=e,e&&s&&this.loadNode(t,s)}showMore(t,e){let s=this.ensureNode(t);s.visibleChildCount>=e||(s.visibleChildCount=Math.min(e,s.visibleChildCount+oe))}loadNode(t,e){switch(e.kind){case"collection":this.runLoad(t,e.load,(s,i)=>{s.collectionItems=i});return;case"schema":this.runLoad(t,e.load,(s,i)=>{s.schemaValue=i});return}}runLoad(t,e,s){let i=this.nodes.get(t);if(!i||i.status==="loading"||i.status==="loaded")return;let a=this.generation,r=i.requestId+1;i.requestId=r,i.status="loading",i.errorMessage="",i.schemaValue=void 0,i.collectionItems=[],e().then(n=>{let d=this.nodes.get(t);!d||this.generation!==a||d.requestId!==r||(s(d,n),d.status="loaded")}).catch(()=>{let n=this.nodes.get(t);!n||this.generation!==a||n.requestId!==r||(n.status="error")})}destroyNodes(){for(let t of this.nodes.values())t.destroy();this.nodes.clear()}};w=_([S("ArcadeDebuggerLazyTreeState")],w);var _e=Object.defineProperty,me=Object.getOwnPropertyDescriptor,c=(t,e,s,i)=>{for(var a=i>1?void 0:i?me(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(a=(i?n(e,s,a):n(a))||a);return i&&a&&_e(e,s,a),a},b=class extends m{constructor(t){super(t),this.phase="idle",this.sessionId=0,this.consoleLogs=[],this.hasExecuted=!1}get isExecuting(){return this.phase==="running"||this.phase==="debug-running"||this.phase==="debug-paused"}get isDebugging(){return this.phase==="debug-running"||this.phase==="debug-paused"}get isPaused(){return this.phase==="debug-paused"}get runResult(){return this.result?.resultType==="run"?this.result.result:void 0}get debugResult(){return this.result?.resultType==="debug"?this.result.result:void 0}addConsoleLog(t){this.consoleLogs=[...this.consoleLogs,t]}};c([o()],b.prototype,"phase",2);c([o()],b.prototype,"mode",2);c([o()],b.prototype,"sessionId",2);c([o()],b.prototype,"result",2);c([o()],b.prototype,"consoleLogs",2);c([o()],b.prototype,"hasExecuted",2);b=c([S("ArcadeDebuggerExecutionModel")],b);var E=class extends m{constructor(t){super(t),this.breakpoints=[]}setBreakpoints(t){this.breakpoints=Array.from(new Set(t)).sort((e,s)=>e-s)}toggleBreakpoint(t){let e=new Set(this.breakpoints);e.has(t)?e.delete(t):e.add(t),this.setBreakpoints(e)}clearBreakpoints(){this.breakpoints=[]}};c([o()],E.prototype,"breakpoints",2);E=c([S("ArcadeDebuggerSessionModel")],E);var v=class extends m{constructor(t){super(t),this.openedPanel="output",this.showPanel=!1}};c([o()],v.prototype,"openedPanel",2);c([o()],v.prototype,"showPanel",2);v=c([S("ArcadeDebuggerUiModel")],v);var D=class extends m{constructor(t){super(t)}get line(){return this.pausedState?.line}clearPausedState(){this.lastPausedState=this.pausedState,this.pausedState=void 0}reset(){this.pausedState=void 0,this.lastPausedState=void 0}setPausedState(t){this.pausedState=t,this.lastPausedState=t}};c([o()],D.prototype,"pausedState",2);c([o()],D.prototype,"lastPausedState",2);D=c([S("ArcadeDebuggerPausedFrameModel")],D);var g=class extends m{constructor(t){super(t),this.execution=new b,this.lazyTreeState=new w,this.pausedFrame=new D,this.previewTabsState=new M,this.session=new E,this.ui=new v}get breakpoints(){return this.session.breakpoints}get debuggerBreakpoints(){return this.session.breakpoints.map(t=>({line:t}))}get consoleLogs(){return this.execution.consoleLogs}get debug(){if(!(!this.pausedFrame.pausedState&&!this.pausedFrame.lastPausedState))return{pausedState:this.pausedFrame.pausedState,lastPausedState:this.pausedFrame.lastPausedState}}get debugResult(){return this.execution.debugResult}get debuggerLine(){return this.pausedFrame.pausedState?.line}get executionState(){return this.pausedFrame.pausedState}get hasExecuted(){return this.execution.hasExecuted}get isDebugging(){return this.execution.isDebugging}get isExecuting(){return this.execution.isExecuting}get isPaused(){return this.execution.isPaused}get mode(){return this.execution.mode}get openedPanel(){return this.ui.openedPanel}get outputRenderer(){if(this.execution.result)return this.execution.result.resultType==="debug"?"debugger":"legacy"}get phase(){return this.execution.phase}get result(){return this.execution.result}get runResult(){return this.execution.runResult}get sessionId(){return this.execution.sessionId}get showPanel(){return this.ui.showPanel}addConsoleLog(t){this.execution.addConsoleLog(t)}clearBreakpoints(){this.session.clearBreakpoints()}clearForMissingTestData(){this.stopDebug({hidePanel:!0}),this.execution.hasExecuted=!1,this.execution.result=void 0}closePanel(){this.ui.showPanel=!1}completeDebug(t){this.execution.mode="debug",this.execution.result={resultType:"debug",result:t},this.execution.phase="completed",this.ui.openedPanel="output",this.pausedFrame.reset(),this.resetTransientDebuggerState()}completeRun(t){this.execution.mode="run",this.execution.result={resultType:"run",result:t},this.execution.phase="completed",this.pausedFrame.reset(),this.resetTransientDebuggerState()}continueDebug(){let t=this.pausedFrame.pausedState?.continue;t&&(this.execution.phase="debug-running",this.pausedFrame.clearPausedState(),t.resolve())}disableDebugger(){this.stopDebug({hidePanel:!0}),this.clearBreakpoints()}fail(t){this.completeRun(t)}pauseDebug(t){let e=this.pausedFrame.pausedState??this.pausedFrame.lastPausedState;this.syncPausedState(e,t),this.pausedFrame.setPausedState(t),this.execution.phase="debug-paused"}reset(){this.execution.phase="idle",this.execution.mode=void 0,this.execution.result=void 0,this.execution.consoleLogs=[],this.execution.hasExecuted=!1,this.execution.sessionId=0,this.ui.openedPanel="output",this.ui.showPanel=!1,this.pausedFrame.reset(),this.session.clearBreakpoints(),this.replaceTransientDebuggerState()}resetDebug(){this.stopDebug({hidePanel:!1}),this.execution.result=void 0,this.execution.consoleLogs=[],this.ui.openedPanel="debug-console"}disconnect(){this.stopDebug({hidePanel:!0})}setBreakpoints(t){this.session.setBreakpoints(t)}setPanel(t){this.execution.hasExecuted&&(this.ui.openedPanel=t,this.ui.showPanel=!0)}startDebug(){return this.execution.mode="debug",this.execution.phase="debug-running",this.execution.hasExecuted=!0,this.execution.result=void 0,this.execution.consoleLogs=[],this.ui.openedPanel="debug-console",this.ui.showPanel=!0,this.execution.sessionId+=1,this.pausedFrame.reset(),this.replaceTransientDebuggerState(),this.execution.sessionId}startRun(){return this.execution.mode="run",this.execution.phase="running",this.execution.hasExecuted=!0,this.execution.result=void 0,this.execution.consoleLogs=[],this.ui.openedPanel="output",this.ui.showPanel=!0,this.execution.sessionId+=1,this.pausedFrame.reset(),this.replaceTransientDebuggerState(),this.execution.sessionId}stopDebug({hidePanel:t=!0,invalidateSession:e=!0}={}){let s=this.pausedFrame.pausedState?.continue;e&&(this.execution.sessionId+=1),this.execution.phase=this.execution.hasExecuted?"completed":"idle",this.pausedFrame.reset(),this.resetTransientDebuggerState(),t&&(this.ui.showPanel=!1),this.ui.openedPanel==="debug-console"&&(this.ui.openedPanel="output"),s?.resolve()}syncPausedState(t,e){this.lazyTreeState.reset(),t&&e&&t!==e&&this.previewTabsState.invalidateAll(),this.pausedLine=e?.line}toggleBreakpoint(t){this.session.toggleBreakpoint(t)}togglePanel(t){if(this.execution.hasExecuted){if(t==null){this.ui.showPanel=!this.ui.showPanel;return}if(this.ui.openedPanel===t&&this.ui.showPanel){this.ui.showPanel=!1;return}this.setPanel(t)}}resetTransientDebuggerState(){this.pausedLine=void 0,this.lazyTreeState.reset(),this.previewTabsState.clear()}replaceTransientDebuggerState(){this.pausedLine=void 0,this.lazyTreeState=new w,this.previewTabsState=new M}};c([o()],g.prototype,"execution",2);c([o()],g.prototype,"lazyTreeState",2);c([o()],g.prototype,"pausedLine",2);c([o()],g.prototype,"pausedFrame",2);c([o()],g.prototype,"previewTabsState",2);c([o()],g.prototype,"session",2);c([o()],g.prototype,"ui",2);g=c([S("ArcadeDebuggerStore")],g);var Se={glyphMargin:!0,lineNumbersMinChars:1},N=class extends Q{constructor(){super(...arguments),this._codeEditorElt=V(),this._componentReadyDefer=Promise.withResolvers(),this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this._debuggerState=new g,this.messages=Y(),this._modelId=G(),this._openArcadeHelp=()=>{window.open(te,"Arcade Help")},this._decorations=void 0,this._monacoEditor=K(ee),this._editorOptions={},this._toggleSidePanel=e=>{e.currentTarget instanceof HTMLElement&&this._setOpenedSidePanel(e.currentTarget.dataset.panelName??"none")},this._closeSidePanel=()=>{this._setOpenedSidePanel("none")},this._updateBreakpointsDecorations=()=>{let e=this.editorInstance;if(!e)return;let s=this._debuggerState.breakpoints.map(i=>({range:new T(i,1,i,1),options:{isWholeLine:!0,glyphMarginClassName:"arcgis-code-editor__breakpoint-glyph"}}));this._decorations?.clear(),this._decorations=e.createDecorationsCollection(s)},this._clearDebuggerDecorations=()=>{this._decorations?.clear(),this._decorations=void 0,this._debuggerPausedLineDecoration?.clear(),this._debuggerPausedLineDecoration=void 0},this._debuggerPausedLineDecoration=void 0,this._preparingArcade=!1,this._arcadeAssistantRemoteState={shouldRender:!1},this.enableDebugger=!1,this.hideDocumentationActions=!1,this.hideSideBar=!1,this.openedSidePanel="none",this.script="",this.sideActionBarExpanded=!1,this.arcgisDiagnosticsChange=L({bubbles:!1}),this.arcgisScriptChange=L({bubbles:!1})}static{this.properties={_apiLibrary:16,_editorProfile:16,_preparingArcade:16,_arcadeAssistantRemoteState:16,editorInstance:32,editorOptions:0,enableDebugger:5,hideDocumentationActions:5,hideSideBar:5,messageOverrides:0,openedSidePanel:3,profile:0,script:1,sideActionBarExpanded:7,snippets:0,suggestions:0,testData:0,customPanels:0,arcadeAssistant:0}}static{this.styles=[ce]}get _usesBottomExecutionDrawer(){return this.enableDebugger&&!!this.testData}get editorInstance(){return this._codeEditorElt.value?.editorInstance}get editorOptions(){return{...Se,...this._editorOptions}}set editorOptions(e){this._editorOptions=e??{}}async getTestResult(){if(!this.testData)return{type:"error",value:"Missing test data",error:null};let e=await this._editorProfilePromise;if(!e)return{type:"error",value:"Missing editor profile",error:null};await this._componentReadyDefer.promise;let s=this._codeEditorElt.value?.value,i=await B(e.definition,s,this.testData,{mode:"run"});return y(i)?i:{type:"error",value:"Unexpected debug result",error:null}}async setFocus(){await this._componentReadyDefer.promise,await this._codeEditorElt.value?.setFocus()}async load(){let e=X("./assets");se(e),await this._updateDataModelDeps(),await this._updateArcadeAssistantRemoteState(),this.manager.onLifecycle(()=>(this.hasUpdated&&this._connectMonacoCustomizations().catch(u(this)),()=>{for(;this._disposables.length;)this._disposables.pop()?.dispose();this._connectMonacoCustomizationsPromise=void 0,this._executeScriptAction=void 0,this._clearDebuggerDecorations(),this._debuggerState.disconnect()}))}willUpdate(e){(e.has("messages")||e.has("profile"))&&this._updateDataModelDeps(),e.has("testData")&&this._testDataChanged(),e.has("enableDebugger")&&!this.enableDebugger&&this._debuggerState.disableDebugger(),e.has("snippets")&&P.updateApiContextForModel(this._modelId,{snippets:this.snippets}),e.has("arcadeAssistant")&&this._updateArcadeAssistantRemoteState()}async loaded(){await this._connectMonacoCustomizations(),this._componentReadyDefer.resolve(),await this._codeEditorElt.value?.setFocus()}_setOpenedSidePanel(e){this.openedSidePanel=e===this.openedSidePanel?"none":e}async _connectMonacoCustomizations(){if(this._connectMonacoCustomizationsPromise)return await this._connectMonacoCustomizationsPromise;this._connectMonacoCustomizationsPromise=(async()=>{if(!this.isConnected)return;let e=await ie();this._disposables.push(e.onDiagnosticsChange(d=>!this._preparingArcade&&this.arcgisDiagnosticsChange.emit(d.diagnostics))),this.testData&&!this._executeScriptAction&&this._addExecuteScriptAction();let s=F(()=>this._debuggerState.breakpoints,()=>this._updateBreakpointsDecorations(),{sync:!0}),i=F(()=>this._debuggerState.debuggerLine,()=>this._updateDebuggerPausedLineDecoration(),{sync:!0}),a=F(()=>this._debuggerState.consoleLogs.length,()=>this.requestUpdate(),{sync:!0});this._disposables.push({dispose:()=>s.remove()},{dispose:()=>i.remove()},{dispose:()=>a.remove()});let r=this.editorInstance?.onMouseDown(d=>this._onEditorMouseDown(d));r&&this._disposables.push(r);let n=this.editorInstance?.onDidChangeModelContent(d=>this._onEditorModelContentChange(d));n&&this._disposables.push(n),this._updateBreakpointsDecorations(),this._updateDebuggerPausedLineDecoration()})();try{await this._connectMonacoCustomizationsPromise}finally{this._connectMonacoCustomizationsPromise=void 0}}_onEditorMouseDown(e){if(!this.enableDebugger||![this._monacoEditor.MouseTargetType.GUTTER_GLYPH_MARGIN,this._monacoEditor.MouseTargetType.GUTTER_LINE_NUMBERS,this._monacoEditor.MouseTargetType.GUTTER_LINE_DECORATIONS].includes(e.target.type))return;let s=e.target.position?.lineNumber;s&&this._debuggerState.toggleBreakpoint(s)}_onEditorModelContentChange(e){if(!this.enableDebugger||!this._debuggerState.breakpoints.length||e.isFlush)return;let s=J(this._debuggerState.breakpoints,e.changes);s.length===this._debuggerState.breakpoints.length&&s.every((i,a)=>i===this._debuggerState.breakpoints[a])||this._debuggerState.setBreakpoints(s)}_updateDebuggerPausedLineDecoration(){let e=this.editorInstance;if(!e)return;this._debuggerPausedLineDecoration?.clear();let s=this._debuggerState.debuggerLine;s!=null?this._debuggerPausedLineDecoration=e.createDecorationsCollection([{range:new T(s,1,s,1),options:{isWholeLine:!0,className:"arcgis-code-editor__debugger-paused-line",glyphMarginClassName:"arcgis-code-editor__debugger-paused-glyph",marginClassName:"arcgis-code-editor__debugger-paused-line arcgis-code-editor__debugger-paused-margin"}}]):this._debuggerPausedLineDecoration=void 0}_continueDebugSession(){this._debuggerState.continueDebug()}_stopDebugSession({hideExecutionPanel:e=!0}={}){this._debuggerState.stopDebug({hidePanel:e})}_resetDebugSession(){this._debuggerState.resetDebug(),this._executeScript("debug").catch(u(this))}async _handleDebugPause(e,s,i){if(!this._debuggerState.isDebugging||e!==this._debuggerState.sessionId)return;let a=Promise.withResolvers();return this._debuggerState.pauseDebug({line:s.line,result:i,continue:a}),await a.promise}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}_testDataChanged(){!this.testData&&this._executeScriptAction&&(this._disposeSafely(this._executeScriptAction),this._executeScriptAction=void 0),this.testData&&!this._executeScriptAction&&this._addExecuteScriptAction(),!this.testData&&this.enableDebugger&&this._debuggerState.clearForMissingTestData(),this._debuggerState.showPanel&&this._executeScript("run").catch(u(this))}async _updateEditorProfile(){this._preparingArcade=!0;try{await P.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale,snippets:this.snippets}),this._editorProfile=P.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._editorProfilePromise=Promise.resolve(this._editorProfile),this._preparingArcade=!1}}async _updateApiLibrary(){this._apiLibrary=await P.getApiLibraryForModel(this._modelId)}_setExecutionPanel(e){this._debuggerState.togglePanel(e)}async _executeScript(e){let s=this.testData;if(!this._codeEditorElt.value||!s)return;let i=e==="debug"?this._debuggerState.startDebug():this._debuggerState.startRun(),a=await this._editorProfilePromise;if(!a){this._debuggerState.fail({type:"error",value:"Missing editor profile",error:null});return}setTimeout(()=>{(async()=>{let r=this._codeEditorElt.value?.value,n={mode:e,console:f=>this._debuggerState.addConsoleLog(f),breakpoints:e==="debug"?this._debuggerState.debuggerBreakpoints:void 0};e==="debug"&&(n.onDebugPause=this._handleDebugPause.bind(this,i));let d=await B(a.definition,r,s,n);if(i===this._debuggerState.sessionId){if(e==="debug"){if(y(d)){this._debuggerState.fail(d);return}this._debuggerState.completeDebug(d);return}y(d)?this._debuggerState.completeRun(d):this._debuggerState.fail({type:"error",value:"Unexpected debug result",error:null})}})()},0)}_toggleShowExecutionPanel(){this._debuggerState.togglePanel()}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_onCodeEditorValueChange(e){e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)}_insertAsSnippet(e){this._codeEditorElt.value?.insertSnippet(e.detail).catch(u(this))}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(u(this))}_onResultPanelChange(e){let s=e.currentTarget;this._debuggerState.setPanel(s.openedResultPanel)}_onExecutionPanelClose(){this._debuggerState.closePanel()}_addExecuteScriptAction(){let e=this.editorInstance?.addAction({id:"run-script",label:"Run Arcade Expression",keybindings:[Z.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this.testData&&this._executeScript("run").catch(u(this))}});e&&(this._executeScriptAction=e,this._disposables.push(e))}_disposeSafely(e){let s=this._disposables.indexOf(e);s!==-1&&this._disposables.splice(s,1),e.dispose()}async _updateArcadeAssistantRemoteState(){this.arcadeAssistant&&(this._arcadeAssistantRemoteState=await ge({...this.arcadeAssistant,profile:this.profile}))}renderMainActionBar(){return this.enableDebugger||!this.testData?null:l`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled slot=top-action-bar><calcite-action-group scale=s><calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${()=>{this._executeScript("run").catch(u(this))}}></calcite-action>${this._debuggerState.result?l`<calcite-action .text=${this.messages.lastresults??""} .active=${this._debuggerState.showPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>`:null}</calcite-action-group></calcite-action-bar>`}renderMainPanel(){return l`<arcgis-code-editor slot=editor .editorOptions=${this.editorOptions} .language=${P.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${H(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:s,icon:i,active:a,panelName:r,iconFlipRtl:n=!1,onClick:d=this._toggleSidePanel}){return l`<calcite-action id=${e??I} .text=${s} .textEnabled=${this.sideActionBarExpanded} .icon=${i} .active=${a} @click=${d} data-panel-name=${r??I} .iconFlipRtl=${n}></calcite-action>${!this.sideActionBarExpanded&&l`<calcite-tooltip .referenceElement=${e}><span>${s}</span></calcite-tooltip>`||""}`}renderSideActionBar(){return this.hideSideBar?null:l`<calcite-action-bar slot=side-action-bar class="side-action-bar" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({id:"profile-variables-action",label:this.messages.profilevariables??"",icon:"profile-variables",active:this.openedSidePanel==="variables",panelName:"variables"})}${this.renderAction({id:"function-action",label:this.messages.constantsandfunctions??"",icon:"function",active:this.openedSidePanel==="api",panelName:"api"})}${this.suggestions?.length?this.renderAction({id:"suggestions-action",label:this.messages.suggestions??"",icon:"lightbulb",active:this.openedSidePanel==="suggestions",panelName:"suggestions"}):null}${this._arcadeAssistantRemoteState.shouldRender&&this.renderAction({id:"arcade-assistant-action",label:this.messages.arcadeassistant??"Arcade assistant",icon:"effects",active:this.openedSidePanel==="arcade-assistant",panelName:"arcade-assistant"})||""}${this.customPanels?.map(e=>e.enabled===!1?null:this.renderAction({id:e.id,label:e.name,icon:e.icon,active:this.openedSidePanel===e.id,panelName:e.id}))}${this.hideDocumentationActions?null:this.renderAction({id:"developer-website-action",label:this.messages.help??"",icon:"question",active:!1,panelName:"none",iconFlipRtl:this.messages._lang==="ar",onClick:this._openArcadeHelp})}</calcite-action-group></calcite-action-bar>`}renderSidePanel(){if(this.hideSideBar)return null;let{openedSidePanel:e}=this;return l`<arcgis-language-api-panel slot=side-panel class=${x(e==="api"?"":"hidden")} .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none .closed=${e!=="api"}></arcgis-language-api-panel><arcgis-editor-variables slot=side-panel class=${x(e==="variables"?"":"hidden")} .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none .variable=${this._editorProfile} .closed=${e!=="variables"} .messageOverrides=${{profileempty:this.messages.profileempty}}></arcgis-editor-variables>${this.suggestions?.length&&l`<arcgis-arcade-suggestions slot=side-panel class=${x(e==="suggestions"?"":"hidden")} .closed=${e!=="suggestions"} .suggestions=${this.suggestions} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none></arcgis-arcade-suggestions>`||""}${this.arcadeAssistant&&this._arcadeAssistantRemoteState.shouldRender&&l`<arcgis-arcade-coding-assistant slot=side-panel class=${x(e==="arcade-assistant"?"":"hidden")} .closed=${e!=="arcade-assistant"} .insertText=${this._insertText.bind(this)} .closePanel=${this._closeSidePanel} .portalUrl=${this.arcadeAssistant.portalUrl} .serviceUrl=${"serviceUrl"in this._arcadeAssistantRemoteState?this._arcadeAssistantRemoteState.serviceUrl:void 0} .helpBase=${this._arcadeAssistantRemoteState.helpBase} .assistantsEnabled=${this._arcadeAssistantRemoteState.assistantsEnabled} .feedbackServiceUrl=${this._arcadeAssistantRemoteState.feedbackServiceUrl} .editorRef=${this.el} .appVersion=${this.arcadeAssistant.appVersion} .disableQuestionAnswerLogging=${this.arcadeAssistant.disableQuestionAnswerLogging}></arcgis-arcade-coding-assistant>`||""}${this.customPanels?.map(s=>l`<calcite-flow slot=side-panel class=${x(e===s.id?"":"hidden")}>${s?.useFlows?s.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==s.id,editorRef:this.el}):l`<calcite-flow-item .heading=${s.name} heading-level=2 closable .closed=${e!==s.id} @calciteFlowItemClose=${this._toggleSidePanel} .description=${s.description}>${s.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==s.id,editorRef:this.el})}</calcite-flow-item>`}</calcite-flow>`)}`}renderResultsPanel(){if(this._usesBottomExecutionDrawer)return this.renderBottomExecutionBody();if(!this._debuggerState.showPanel)return null;let e=this._debuggerState.openedPanel==="debug-console"?"output":this._debuggerState.openedPanel;return l`<arcgis-arcade-results slot=results-panel .openedResultPanel=${e} .loading=${this._debuggerState.isExecuting} .result=${this._debuggerState.runResult} .consoleLogs=${this._debuggerState.consoleLogs} @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange} @arcgisInternalClosePanel=${this._onExecutionPanelClose}></arcgis-arcade-results>`}renderBottomExecutionBody(){let{showPanel:e,openedPanel:s,debugResult:i,isExecuting:a,mode:r}=this._debuggerState;return e?s==="debug-console"?l`<arcgis-arcade-debugger-console slot=results-panel .modelId=${this._modelId} .debuggerStore=${this._debuggerState}></arcgis-arcade-debugger-console>`:s==="output"&&r==="debug"?l`<arcgis-arcade-debugger-output slot=results-panel .debuggerStore=${this._debuggerState} .result=${i}></arcgis-arcade-debugger-output>`:l`<arcgis-arcade-results slot=results-panel class="bottom-results" .openedResultPanel=${s} .loading=${s==="console"&&this._debuggerState.isPaused?!1:a} .result=${this._debuggerState.runResult} .consoleLogs=${this._debuggerState.consoleLogs} hide-header @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange}></arcgis-arcade-results>`:null}renderBottomActionBar(){if(!this._usesBottomExecutionDrawer)return null;let{showPanel:e,hasExecuted:s,openedPanel:i,isDebugging:a,isPaused:r,isExecuting:n}=this._debuggerState;return l`<calcite-action-bar slot=bottom-action-bar class=${`main-action-bar bottom-action-bar ${e?"":"is-collapsed"}`} layout=horizontal scale=s expand-disabled><calcite-action-group scale=s>${a?l`<calcite-action .text=${this.messages.continue??"Continue"} icon=forward scale=s .disabled=${!r} @click=${this._continueDebugSession}></calcite-action><calcite-action .text=${this.messages.reset??"Reset"} icon=reset scale=s @click=${this._resetDebugSession}></calcite-action><calcite-action .text=${this.messages.stop??"Stop"} icon=circle-stop scale=s @click=${()=>this._stopDebugSession()}></calcite-action>`:l`<calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade||n} @click=${()=>{this._executeScript("run").catch(u(this))}}></calcite-action><calcite-action .text=${this.messages.runanddebug??"Run and Debug"} text-enabled icon=debug-script scale=s .loading=${this._preparingArcade||n} @click=${()=>{this._executeScript("debug").catch(u(this))}}></calcite-action>`}</calcite-action-group>${s?l`<calcite-action-group scale=s><calcite-action .active=${i==="output"&&e} .text=${this.messages.output??"Output"} text-enabled scale=s icon=list-show-all icon-flip-rtl @click=${()=>this._setExecutionPanel("output")}></calcite-action><calcite-action .active=${i==="console"&&e} .text=${this.messages.console??"Console"} text-enabled scale=s icon=console icon-flip-rtl @click=${()=>this._setExecutionPanel("console")}></calcite-action><calcite-action .active=${i==="log"&&e} .text=${this.messages.log??"Log"} text-enabled scale=s icon=list icon-flip-rtl @click=${()=>this._setExecutionPanel("log")}></calcite-action><calcite-action .active=${i==="debug-console"&&e} .text=${this.messages.debugconsole??"Debug Console"} text-enabled scale=s icon=debug-script icon-flip-rtl .disabled=${this._debuggerState.mode!=="debug"} @click=${()=>this._setExecutionPanel("debug-console")}></calcite-action></calcite-action-group>`:null}${e?l`<calcite-action-group scale=s><calcite-action .text=${this.messages.close??"Close"} scale=s icon=x icon-flip-rtl @click=${this._onExecutionPanelClose}></calcite-action></calcite-action-group>`:null}</calcite-action-bar>`}render(){return l`<arcgis-code-editor-shell>${this.renderMainActionBar()}${this.renderMainPanel()}${this.renderBottomActionBar()}${this.renderResultsPanel()}${this.renderSidePanel()}${this.renderSideActionBar()}</arcgis-code-editor-shell>`}};W("arcgis-arcade-editor",N);return N},"identity/IdentityManager","core/reactiveUtils","core/Accessor","core/accessorSupport/decorators",a,b,c,d,e,f)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"breakpoints":"Breakpoints","breakpointposition":"{position} of {count}","nocontent":"No content","scope":"Scope","notpaused":"Not paused","global":"Global","local":"Local","nolocalscope":"No local scope","loadpreview":"Load preview","loading":"Loading","loaderror":"Unable to load data.","nopreviewloaded":"Select a FeatureSet variable in the Scope tab and choose 'Load preview' to inspect sample rows.","loadingpreview":"Loading preview","nopreviewrows":"No preview rows available.","previewloaderror":"Unable to load preview.","previewunavailable":"This preview is no longer available in the current paused state.","showmore":"Show more","uninitialized":"uninitialized"}
|
|
1
|
+
{"breakpoints":"Breakpoints","breakpointposition":"{position} of {count}","nocontent":"No content","scope":"Scope","notpaused":"Not paused","profile":"Profile","global":"Global","local":"Local","nolocalscope":"No local scope","empty":"Empty","loadpreview":"Load preview","loading":"Loading","loaderror":"Unable to load data.","nopreviewloaded":"Select a FeatureSet variable in the Scope tab and choose 'Load preview' to inspect sample rows.","loadingpreview":"Loading preview","nopreviewrows":"No preview rows available.","previewloaderror":"Unable to load preview.","previewunavailable":"This preview is no longer available in the current paused state.","showmore":"Show more","uninitialized":"uninitialized"}
|
|
@@ -18248,7 +18248,7 @@ function se(t, e, r, n) {
|
|
|
18248
18248
|
const cr = { apiKey: void 0, apiKeys: { scopes: [] }, applicationName: "", applicationUrl: globalThis.location?.href, assetsPath: "", fontsUrl: "https://static.arcgis.com/fonts", geometryServiceUrl: "https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer", geoRSSServiceUrl: "https://utility.arcgis.com/sharing/rss", kmlServiceUrl: "https://utility.arcgis.com/sharing/kml", userPrivilegesApplied: !0, portalUrl: "https://www.arcgis.com", respectPrefersReducedMotion: !0, routeServiceUrl: "https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World", workers: { loaderConfig: { has: {}, paths: {}, map: {}, packages: [] } }, request: { crossOriginNoCorsDomains: null, httpsDomains: ["arcgis.com", "arcgisonline.com", "esrikr.com", "premiumservices.blackbridge.com", "esripremium.accuweather.com", "gbm.digitalglobe.com", "firstlook.digitalglobe.com", "msi.digitalglobe.com"], interceptors: [], internalInterceptors: [], maxUrlLength: 2e3, priority: "high", proxyRules: [], proxyUrl: null, timeout: 62e3, trustedServers: [], useIdentity: !0 }, log: { interceptors: [], level: null } };
|
|
18249
18249
|
if (globalThis.esriConfig && (H4(cr, globalThis.esriConfig, !0), delete cr.has), !cr.assetsPath) {
|
|
18250
18250
|
{
|
|
18251
|
-
const t = "5.1.0-next.
|
|
18251
|
+
const t = "5.1.0-next.94";
|
|
18252
18252
|
cr.assetsPath = `https://cdn.jsdelivr.net/npm/@arcgis/core@${t}/assets`;
|
|
18253
18253
|
}
|
|
18254
18254
|
cr.defaultAssetsPath = cr.assetsPath;
|