@arcgis/coding-components 5.2.0-next.89 → 5.2.0-next.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/cdn/{6YLBGWGQ.js → 263QWQRJ.js} +1 -1
  2. package/dist/cdn/{222K52F2.js → 3AAE55DK.js} +1 -1
  3. package/dist/cdn/{JCRL537Q.js → 4RQ6CTEX.js} +1 -1
  4. package/dist/cdn/{YQANUDOU.js → 5A6ECP7V.js} +1 -1
  5. package/dist/cdn/{BPPFZDPH.js → 5HFC5HJR.js} +1 -1
  6. package/dist/cdn/{HRNMXKFZ.js → 5K6QWS7J.js} +1 -1
  7. package/dist/cdn/{RG7XCMPX.js → 5XL4FHZ6.js} +1 -1
  8. package/dist/cdn/{5MCVDNVO.js → 6EPN2GQ3.js} +1 -1
  9. package/dist/cdn/{P46WA3YD.js → 6UXWS2RY.js} +1 -1
  10. package/dist/cdn/{JSZLCNQX.js → AAVDZTYV.js} +1 -1
  11. package/dist/cdn/{K7IVZ3HP.js → ADG6PXX4.js} +1 -1
  12. package/dist/cdn/{CMZI6WXP.js → AFJMXI5B.js} +1 -1
  13. package/dist/cdn/{MIIHORYJ.js → APBUDRIM.js} +1 -1
  14. package/dist/cdn/{3LKMIPIC.js → BBERXRDY.js} +1 -1
  15. package/dist/cdn/{4OW3EH74.js → CHVBKAT5.js} +1 -1
  16. package/dist/cdn/{KN6J22WW.js → CPX3K3UL.js} +1 -1
  17. package/dist/cdn/{NIQPQNFL.js → CQQVSACB.js} +1 -1
  18. package/dist/cdn/{MDSRERH4.js → CVQAVENI.js} +1 -1
  19. package/dist/cdn/{NNZO447D.js → H7XVWT2F.js} +1 -1
  20. package/dist/cdn/{SKBHZ7VS.js → J4VBP7HA.js} +1 -1
  21. package/dist/cdn/{PEPAASB7.js → JHACGQHF.js} +1 -1
  22. package/dist/cdn/{SSVSZDRA.js → L7OEI4ZV.js} +1 -1
  23. package/dist/cdn/{X5VVKX7Q.js → LY5JOQB7.js} +1 -1
  24. package/dist/cdn/{A77A54OM.js → PM4JFKBG.js} +2 -2
  25. package/dist/cdn/{OLMW3NCS.js → RQZK3XV2.js} +1 -1
  26. package/dist/cdn/{P6UAZRSN.js → SWPINDTI.js} +1 -1
  27. package/dist/cdn/{VQB7J2LU.js → USPKD4I2.js} +1 -1
  28. package/dist/cdn/{A6DSTEHL.js → WXA37GUM.js} +1 -1
  29. package/dist/cdn/index.js +1 -1
  30. package/dist/docs/api.json +1 -1
  31. package/dist/docs/docs.json +1 -1
  32. package/dist/docs/web-types.json +1 -1
  33. package/package.json +6 -6
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./STN3LSQR.js";import{a as _}from"./OLMW3NCS.js";import"./SSVSZDRA.js";import{c as u,e as p}from"./BHSILWSL.js";import"./J4I4EROF.js";import{G as f,H as g,L as b,h as d,j as i,n as o,r as m}from"./A77A54OM.js";import{a as h}from"./BFPEJYVB.js";import"./H6RQVSYM.js";export default $arcgis.t(([{C:r,D:n,E:v,F:w}])=>{var $=d`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-list-item-group{background-color:var(--calcite-color-foreground-2);word-break:break-word}.container{block-size:100%;display:grid;grid-template-rows:auto 1fr;overflow:hidden}.scrollable{min-block-size:0;overflow:auto}}`;function R(l){l.key==="Enter"&&l.stopPropagation()}var c=class extends g{constructor(){super(...arguments),this._beforeBack=async()=>{this.removeLastPanelRenderer(),this._filterValue=""},this.messages=_(),this._filterValue="",this._flowItemRenderers=[],this._rootPresentation="profile",this._mutationCounter=1,this.loading=!1,this.closed=!1,this.hideDescriptions=!1,this.arcgisInternalClosePanel=o({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=o({bubbles:!1})}static{this.properties={_filterValue:16,_flowItemRenderers:16,_rootPresentation:16,_mutationCounter:16,loading:5,modelId:1,closed:5,variable:0,heading:1,hideDescriptions:5,messageOverrides:0}}static{this.styles=$}load(){this._variableChanged()}willUpdate(e){e.has("modelId")&&(this._flowItemRenderers=[]),e.has("variable")&&this._variableChanged()}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}_variableChanged(){if(!this.variable||r(this.variable)){this._rootPresentation="profile";return}this._rootPresentation=this.variable.type==="featureSet"?"featureSetRoot":"collectionRoot"}addPanelRenderer(e){this._flowItemRenderers=[...this._flowItemRenderers,e]}removeLastPanelRenderer(){this._flowItemRenderers=this._flowItemRenderers.slice(0,-1)}_isRootPresentation(e){return this._rootPresentation===e}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{p(u(e.querySelector("calcite-flow-item:last-child")??e,"calcite-input"))}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_updateFilterValue(e){this._filterValue=e.currentTarget.value}_emitClose(){this.arcgisInternalClosePanel.emit()}_backToTop(){this._flowItemRenderers=[]}_emitItemSelected(e,t){if(t.nonInteractive)return;let s=e;(!s.key||s.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(t.snippet))}_showCollectionPanel(e,t){e.stopPropagation(),this.addPanelRenderer(s=>this.renderCollectionBasedVariable(t,!1,s))}_getHeadingForCollection(e,t=!1){if(!e)return"";if(t){if(this.heading)return this.heading;if(r(this.variable))return this.variable.definition?.label??this.messages.profilevariables??"Profile variables";if(this._isRootPresentation("featureSetRoot"))return this.messages.fields??"Fields";if(this._isRootPresentation("collectionRoot"))return this.messages.tables??"Tables"}return(n(e)||w(e))&&(this._isRootPresentation("featureSetRoot")||this._isRootPresentation("collectionRoot"))?this.messages.fields??"Fields":this.messages.profilevariables??"Profile variables"}_getDescriptionForCollection(e){return e?n(e)&&this._isRootPresentation("featureSetRoot")?e.variables[0]?.getLabel()??"":v(e)&&this._isRootPresentation("collectionRoot")?e.datastoreInfo?.name??e.getDescription()??"":e.breadcrumb:""}_getItemLabel(e){return e.getLabel()}_getItemDescription(e){return this.hideDescriptions?"":e.getDescription()}renderCollectionBasedVariable(e,t=!1,s=!1){if(!e)return null;let a=this.loading;return!a&&!e.loaded&&(e.loadSource().then(()=>setTimeout(()=>{this._mutationCounter+=1})).catch(()=>{h("error",this,"Error loading collection"),a=!1}),a=!0),i`<calcite-flow-item heading-level=2 .heading=${this._getHeadingForCollection(e,t)} .description=${this._getDescriptionForCollection(e)} .beforeBack=${this._beforeBack} closable @calciteFlowItemClose=${this._emitClose} .selected=${s}><calcite-action slot=header-actions-end .text=${this.messages.backtotop??""} scale=m .hidden=${t||this._isRootPresentation("featureSetRoot")} icon=chevrons-left icon-flip-rtl @click=${this._backToTop}></calcite-action><div class="container"><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m .label=${this.messages.filterthevariablesbyname??""} name=variable-filter></calcite-input><div class="scrollable">${a?i`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??""}></calcite-loader>`:i`<calcite-list .label=${this.messages.profilevariables??"Profile variables"}>${this.renderEditorVariables(e)}</calcite-list>`}</div></div></calcite-flow-item>`}renderEditorVariables(e){let t=m(this._filterValue),s=e.variables.filter(a=>a.passFilter(t));return s.length?s.map(a=>this.renderEditorVariable(a)):i`<div class="notice-container">${this.messages.noitems}</div>`}renderEditorVariable(e){return e.type==="group"?this._isRootPresentation("featureSetRoot")&&e.isHeader?i`<calcite-list-item-group .heading=${this._getItemLabel(e)}></calcite-list-item-group>`:this._isRootPresentation("featureSetRoot")&&e._label?.code==="fields"?this.renderEditorVariables(e):i`<calcite-list-item-group .heading=${this._getItemLabel(e)}>${this.renderEditorVariables(e)}</calcite-list-item-group>`:i`<calcite-list-item .label=${this._getItemLabel(e)} .description=${this._getItemDescription(e)} @calciteListItemSelect=${t=>this._emitItemSelected(t,e)} @keydown=${t=>this._emitItemSelected(t,e)}>${e.isCollection?i`<calcite-action slot=actions-end .text=${this.messages.expand??""} scale=s icon=chevron-right icon-flip-rtl @click=${t=>this._showCollectionPanel(t,e)} @keydown=${R}></calcite-action>`:null}${e.icon?i`<calcite-icon .icon=${e.icon} scale=s slot=content-start></calcite-icon>`:null}</calcite-list-item>`}render(){return this.closed?null:this.loading&&!this.variable?i`<calcite-flow><calcite-flow-item heading-level=2 .heading=${this.heading??this.messages.profilevariables} closable @calciteFlowItemClose=${this._emitClose}><calcite-loader scale=s type=indeterminate .label=${this.messages.loading??""}></calcite-loader></calcite-flow-item></calcite-flow>`:!this.loading&&(!this.variable||this.variable?.loaded&&!this.variable?.variables.length)?i`<calcite-flow><calcite-flow-item heading-level=2 .heading=${this.heading??this.messages.profilevariables} closable @calciteFlowItemClose=${this._emitClose}><div class="notice-container">${this.messages.profileempty}</div></calcite-flow-item></calcite-flow>`:i`<calcite-flow ${f(this.flowFocusHandler)}>${this.renderCollectionBasedVariable(this.variable,!0,this._flowItemRenderers.length===0)}${this._flowItemRenderers.map((e,t,s)=>e(t===s.length-1))}</calcite-flow>`}};b("arcgis-editor-variables",c);return c},a)
2
+ import a from"./STN3LSQR.js";import{a as _}from"./RQZK3XV2.js";import"./L7OEI4ZV.js";import{c as u,e as p}from"./BHSILWSL.js";import"./J4I4EROF.js";import{G as f,H as g,L as b,h as d,j as i,n as o,r as m}from"./PM4JFKBG.js";import{a as h}from"./BFPEJYVB.js";import"./H6RQVSYM.js";export default $arcgis.t(([{C:r,D:n,E:v,F:w}])=>{var $=d`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-list-item-group{background-color:var(--calcite-color-foreground-2);word-break:break-word}.container{block-size:100%;display:grid;grid-template-rows:auto 1fr;overflow:hidden}.scrollable{min-block-size:0;overflow:auto}}`;function R(l){l.key==="Enter"&&l.stopPropagation()}var c=class extends g{constructor(){super(...arguments),this._beforeBack=async()=>{this.removeLastPanelRenderer(),this._filterValue=""},this.messages=_(),this._filterValue="",this._flowItemRenderers=[],this._rootPresentation="profile",this._mutationCounter=1,this.loading=!1,this.closed=!1,this.hideDescriptions=!1,this.arcgisInternalClosePanel=o({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=o({bubbles:!1})}static{this.properties={_filterValue:16,_flowItemRenderers:16,_rootPresentation:16,_mutationCounter:16,loading:5,modelId:1,closed:5,variable:0,heading:1,hideDescriptions:5,messageOverrides:0}}static{this.styles=$}load(){this._variableChanged()}willUpdate(e){e.has("modelId")&&(this._flowItemRenderers=[]),e.has("variable")&&this._variableChanged()}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}_variableChanged(){if(!this.variable||r(this.variable)){this._rootPresentation="profile";return}this._rootPresentation=this.variable.type==="featureSet"?"featureSetRoot":"collectionRoot"}addPanelRenderer(e){this._flowItemRenderers=[...this._flowItemRenderers,e]}removeLastPanelRenderer(){this._flowItemRenderers=this._flowItemRenderers.slice(0,-1)}_isRootPresentation(e){return this._rootPresentation===e}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{p(u(e.querySelector("calcite-flow-item:last-child")??e,"calcite-input"))}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_updateFilterValue(e){this._filterValue=e.currentTarget.value}_emitClose(){this.arcgisInternalClosePanel.emit()}_backToTop(){this._flowItemRenderers=[]}_emitItemSelected(e,t){if(t.nonInteractive)return;let s=e;(!s.key||s.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(t.snippet))}_showCollectionPanel(e,t){e.stopPropagation(),this.addPanelRenderer(s=>this.renderCollectionBasedVariable(t,!1,s))}_getHeadingForCollection(e,t=!1){if(!e)return"";if(t){if(this.heading)return this.heading;if(r(this.variable))return this.variable.definition?.label??this.messages.profilevariables??"Profile variables";if(this._isRootPresentation("featureSetRoot"))return this.messages.fields??"Fields";if(this._isRootPresentation("collectionRoot"))return this.messages.tables??"Tables"}return(n(e)||w(e))&&(this._isRootPresentation("featureSetRoot")||this._isRootPresentation("collectionRoot"))?this.messages.fields??"Fields":this.messages.profilevariables??"Profile variables"}_getDescriptionForCollection(e){return e?n(e)&&this._isRootPresentation("featureSetRoot")?e.variables[0]?.getLabel()??"":v(e)&&this._isRootPresentation("collectionRoot")?e.datastoreInfo?.name??e.getDescription()??"":e.breadcrumb:""}_getItemLabel(e){return e.getLabel()}_getItemDescription(e){return this.hideDescriptions?"":e.getDescription()}renderCollectionBasedVariable(e,t=!1,s=!1){if(!e)return null;let a=this.loading;return!a&&!e.loaded&&(e.loadSource().then(()=>setTimeout(()=>{this._mutationCounter+=1})).catch(()=>{h("error",this,"Error loading collection"),a=!1}),a=!0),i`<calcite-flow-item heading-level=2 .heading=${this._getHeadingForCollection(e,t)} .description=${this._getDescriptionForCollection(e)} .beforeBack=${this._beforeBack} closable @calciteFlowItemClose=${this._emitClose} .selected=${s}><calcite-action slot=header-actions-end .text=${this.messages.backtotop??""} scale=m .hidden=${t||this._isRootPresentation("featureSetRoot")} icon=chevrons-left icon-flip-rtl @click=${this._backToTop}></calcite-action><div class="container"><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m .label=${this.messages.filterthevariablesbyname??""} name=variable-filter></calcite-input><div class="scrollable">${a?i`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??""}></calcite-loader>`:i`<calcite-list .label=${this.messages.profilevariables??"Profile variables"}>${this.renderEditorVariables(e)}</calcite-list>`}</div></div></calcite-flow-item>`}renderEditorVariables(e){let t=m(this._filterValue),s=e.variables.filter(a=>a.passFilter(t));return s.length?s.map(a=>this.renderEditorVariable(a)):i`<div class="notice-container">${this.messages.noitems}</div>`}renderEditorVariable(e){return e.type==="group"?this._isRootPresentation("featureSetRoot")&&e.isHeader?i`<calcite-list-item-group .heading=${this._getItemLabel(e)}></calcite-list-item-group>`:this._isRootPresentation("featureSetRoot")&&e._label?.code==="fields"?this.renderEditorVariables(e):i`<calcite-list-item-group .heading=${this._getItemLabel(e)}>${this.renderEditorVariables(e)}</calcite-list-item-group>`:i`<calcite-list-item .label=${this._getItemLabel(e)} .description=${this._getItemDescription(e)} @calciteListItemSelect=${t=>this._emitItemSelected(t,e)} @keydown=${t=>this._emitItemSelected(t,e)}>${e.isCollection?i`<calcite-action slot=actions-end .text=${this.messages.expand??""} scale=s icon=chevron-right icon-flip-rtl @click=${t=>this._showCollectionPanel(t,e)} @keydown=${R}></calcite-action>`:null}${e.icon?i`<calcite-icon .icon=${e.icon} scale=s slot=content-start></calcite-icon>`:null}</calcite-list-item>`}render(){return this.closed?null:this.loading&&!this.variable?i`<calcite-flow><calcite-flow-item heading-level=2 .heading=${this.heading??this.messages.profilevariables} closable @calciteFlowItemClose=${this._emitClose}><calcite-loader scale=s type=indeterminate .label=${this.messages.loading??""}></calcite-loader></calcite-flow-item></calcite-flow>`:!this.loading&&(!this.variable||this.variable?.loaded&&!this.variable?.variables.length)?i`<calcite-flow><calcite-flow-item heading-level=2 .heading=${this.heading??this.messages.profilevariables} closable @calciteFlowItemClose=${this._emitClose}><div class="notice-container">${this.messages.profileempty}</div></calcite-flow-item></calcite-flow>`:i`<calcite-flow ${f(this.flowFocusHandler)}>${this.renderCollectionBasedVariable(this.variable,!0,this._flowItemRenderers.length===0)}${this._flowItemRenderers.map((e,t,s)=>e(t===s.length-1))}</calcite-flow>`}};b("arcgis-editor-variables",c);return c},a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as O,c as u,d as k}from"./O5VTBJWD.js";import i from"./X5VVKX7Q.js";import h from"./YQANUDOU.js";import"./5HKDO4SX.js";import e from"./O5LFPM4K.js";import d from"./3LKMIPIC.js";import c from"./KN6J22WW.js";import"./SKBHZ7VS.js";import a from"./STN3LSQR.js";import"./MZMKV7FA.js";import{a as E}from"./SSVSZDRA.js";import{b as T,d as w}from"./BHSILWSL.js";import{a as S}from"./J4I4EROF.js";import"./BZWB7A55.js";import{a as C}from"./XEK22IDA.js";import{a as N}from"./CMRUQ3BN.js";import"./UFF53OEH.js";import"./NHREAORV.js";import{H as v,L as b,M as y,h as g,i as f,j as n}from"./A77A54OM.js";import{b as _}from"./BFPEJYVB.js";import"./DSQ2DQQL.js";import"./H6RQVSYM.js";export default $arcgis.t(([,,,{a:L},,{b:c,d:m}])=>{var x=Symbol(),l=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,e)=>{this.o=t,this.h=e})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,e,s){this.p=0,this.i=0,(this._=t).addController(this);let i=typeof e=="object"?e:{task:e,args:s};this.v=i.task,this.j=i.args,this.m=i.argsEqual??M,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){this.autoRun===!0&&this.S()}hostUpdated(){this.autoRun==="afterUpdate"&&this.S()}T(){if(this.j===void 0)return;let t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){let t=this.T(),e=this.O;this.O=t,t===e||t===void 0||e!==void 0&&this.m(e,t)||await this.run(t)}async run(t){let e,s;t??=this.T(),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let i=++this.p;this.q=new AbortController;let r=!1;try{e=await this.v(t,{signal:this.q.signal})}catch(d){r=!0,s=d}if(this.p===i){if(e===x)this.i=0;else{if(r===!1){try{this.k?.(e)}catch{}this.i=2,this.o?.(e)}else{try{this.A?.(s)}catch{}this.i=3,this.h?.(s)}this.u=e,this.l=s}this._.requestUpdate()}}abort(t){this.i===1&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}},M=(h,t)=>h===t||h.length===t.length&&h.every(((e,s)=>!f(e,t[s])));var $=g`:host{display:block}.arcgis-code-viewer-container{display:flex;align-items:stretch;background-color:var(--calcite-color-foreground-2)}.arcgis-code-viewer__gutter{display:flex;min-width:var(--calcite-spacing-md);padding:0 var(--calcite-spacing-xs) 0 var(--calcite-spacing-sm);border-inline-end:1px solid var(--calcite-color-border-3);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size--2);font-family:var(--calcite-font-family-code);user-select:none;justify-items:center;font-variant-numeric:tabular-nums}.arcgis-code-viewer__line-number{display:flex;align-items:center}pre.arcgis-code-viewer{display:flex;direction:ltr;overflow-x:auto;margin:0;padding:var(--calcite-spacing-sm);white-space:pre-line;code{font-size:var(--calcite-font-size--2);font-family:var(--calcite-font-family-code)}}:host([round]){.arcgis-code-viewer-container{border-radius:var(--calcite-corner-radius-round)}}`,p=class extends v{constructor(){super(...arguments),this._monacoEditor=E(N),this.#e=Promise.withResolvers(),this.#t="",this._slotContentObservers=[],this._onDefaultSlotChange=async t=>{S(t)||(this._codeFromSlot="");let e=t.target instanceof HTMLSlotElement?t.target:null,s=e?this._computeSlotText(e):"";e&&this._observeAssignedSlotNodes(e),s!==this._codeFromSlot&&(this._codeFromSlot=s),this.#e.resolve()},this._colorizeTask=new l(this,{task:async([t,e],{signal:s})=>{if(await this.#e.promise,s.aborted)return this.#t;if(await c(e),s.aborted)return this.#t;let i=await O(t,e);return s.aborted?this.#t:(this.#t=i,i)},args:()=>[this._codeFromSlot,this.language]}),this._codeFromSlot="",this.language="arcade",this.round=!1,this.lineNumbers="off"}static{this.properties={_codeFromSlot:16,language:1,round:7,lineNumbers:1}}static{this.styles=$}#e;#t;async load(){L(y("./assets")),await m(this.language),await c(this.language),this._applyColorizeStyles(u()),this.manager.onLifecycle(()=>(this._themeObserver=T(this.el,["class"],()=>this.updateTheme()),this._themeChangedListener=k(()=>{this._applyColorizeStyles(u())}),this.updateTheme(),()=>{this._themeObserver?.(),this._themeObserver=void 0,this._themeChangedListener?.dispose(),this._themeChangedListener=void 0}))}loaded(){this.el.hasChildNodes()||this.#e.resolve()}willUpdate(t){t.has("language")&&m(this.language).then(()=>c(this.language)).catch(_(this))}disconnectedCallback(){super.disconnectedCallback(),this._disposeSlotObservers()}_disposeSlotObservers(){this._slotContentObservers.length&&(this._slotContentObservers.forEach(t=>t.disconnect()),this._slotContentObservers=[])}_observeAssignedSlotNodes(t){this._disposeSlotObservers();let e=t.assignedNodes({flatten:!0});if(!e.length)return;let s=new Set;for(let o of e)o.nodeType===Node.ELEMENT_NODE?s.add(o):o.nodeType===Node.TEXT_NODE&&o.parentElement&&s.add(o.parentElement);let i={characterData:!0,childList:!0,subtree:!0},r=C(()=>{let o=this._computeSlotText(t);o!==this._codeFromSlot&&(this._codeFromSlot=o)},100),d=o=>{if(o.some(a=>a.type==="childList")){let a=this._computeSlotText(t);a!==this._codeFromSlot&&(this._codeFromSlot=a);return}r()};s.forEach(o=>{let a=new MutationObserver(d);a.observe(o,i),this._slotContentObservers.push(a)})}_computeSlotText(t){let e=t.assignedNodes({flatten:!0}).filter(s=>s.nodeType!==Node.COMMENT_NODE);if(this.language==="html"&&e.length){let s=e.find(r=>r.nodeType===Node.ELEMENT_NODE&&r.tagName==="TEMPLATE");if(s)return(s.innerHTML??"").trim();let i=e.map(r=>r.nodeType===Node.ELEMENT_NODE?r.outerHTML:r.nodeType===Node.TEXT_NODE?r.textContent??"":"").join("").trim();return i}return e.map(s=>s.textContent??"").join("").trim()}updateTheme(){let t=w(this.el)==="light"?"vs":"vs-dark";t!==this._currentTheme&&(this._currentTheme=t,this._monacoEditor.setTheme(t))}_applyColorizeStyles(t){if(!this._colorizeSheet){this._colorizeSheet=new CSSStyleSheet;let e=this.renderRoot;e.adoptedStyleSheets=[...e.adoptedStyleSheets,this._colorizeSheet]}this._colorizeSheet.replaceSync(t)}_showLineNumbers(){return typeof this.lineNumbers=="function"||this.lineNumbers==="on"}_getLineNumberLabel(t){return typeof this.lineNumbers=="function"?this.lineNumbers(t):`${t}`}_getRenderedLineNumbers(){if(!this._showLineNumbers())return[];let t=Math.max(this._codeFromSlot.split(/\r\n|\r|\n/u).length,1);return Array.from({length:t},(e,s)=>this._getLineNumberLabel(s+1))}render(){let t=this._getRenderedLineNumbers();return n`<div class=${`arcgis-code-viewer-container${t.length?" arcgis-code-viewer-container--with-line-numbers":""}`}><slot @slotchange=${this._onDefaultSlotChange} style="display:none" aria-hidden=true></slot>${t.length?n`<div class="arcgis-code-viewer__gutter" aria-hidden=true>${t.map(e=>n`<span class="arcgis-code-viewer__line-number">${e}</span>`)}</div>`:null}<pre class="arcgis-code-viewer" aria-label=${`${this.language} code snippet`}>${this._colorizeTask.render({error:()=>null,pending:()=>n`<code class=${`language-${this.language}`}></code>`,complete:e=>n`<code class=${`language-${this.language}`} .innerHTML=${e??""}></code>`})}</pre></div>`}};b("arcgis-code-viewer",p);return p},a,c,d,e,h,i)
2
+ import{a as O,c as u,d as k}from"./O5VTBJWD.js";import i from"./LY5JOQB7.js";import h from"./5A6ECP7V.js";import"./5HKDO4SX.js";import e from"./O5LFPM4K.js";import d from"./BBERXRDY.js";import c from"./CPX3K3UL.js";import"./J4VBP7HA.js";import a from"./STN3LSQR.js";import"./MZMKV7FA.js";import{a as E}from"./L7OEI4ZV.js";import{b as T,d as w}from"./BHSILWSL.js";import{a as S}from"./J4I4EROF.js";import"./BZWB7A55.js";import{a as C}from"./XEK22IDA.js";import{a as N}from"./CMRUQ3BN.js";import"./UFF53OEH.js";import"./NHREAORV.js";import{H as v,L as b,M as y,h as g,i as f,j as n}from"./PM4JFKBG.js";import{b as _}from"./BFPEJYVB.js";import"./DSQ2DQQL.js";import"./H6RQVSYM.js";export default $arcgis.t(([,,,{a:L},,{b:c,d:m}])=>{var x=Symbol(),l=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,e)=>{this.o=t,this.h=e})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,e,s){this.p=0,this.i=0,(this._=t).addController(this);let i=typeof e=="object"?e:{task:e,args:s};this.v=i.task,this.j=i.args,this.m=i.argsEqual??M,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){this.autoRun===!0&&this.S()}hostUpdated(){this.autoRun==="afterUpdate"&&this.S()}T(){if(this.j===void 0)return;let t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){let t=this.T(),e=this.O;this.O=t,t===e||t===void 0||e!==void 0&&this.m(e,t)||await this.run(t)}async run(t){let e,s;t??=this.T(),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let i=++this.p;this.q=new AbortController;let r=!1;try{e=await this.v(t,{signal:this.q.signal})}catch(d){r=!0,s=d}if(this.p===i){if(e===x)this.i=0;else{if(r===!1){try{this.k?.(e)}catch{}this.i=2,this.o?.(e)}else{try{this.A?.(s)}catch{}this.i=3,this.h?.(s)}this.u=e,this.l=s}this._.requestUpdate()}}abort(t){this.i===1&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}},M=(h,t)=>h===t||h.length===t.length&&h.every(((e,s)=>!f(e,t[s])));var $=g`:host{display:block}.arcgis-code-viewer-container{display:flex;align-items:stretch;background-color:var(--calcite-color-foreground-2)}.arcgis-code-viewer__gutter{display:flex;min-width:var(--calcite-spacing-md);padding:0 var(--calcite-spacing-xs) 0 var(--calcite-spacing-sm);border-inline-end:1px solid var(--calcite-color-border-3);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size--2);font-family:var(--calcite-font-family-code);user-select:none;justify-items:center;font-variant-numeric:tabular-nums}.arcgis-code-viewer__line-number{display:flex;align-items:center}pre.arcgis-code-viewer{display:flex;direction:ltr;overflow-x:auto;margin:0;padding:var(--calcite-spacing-sm);white-space:pre-line;code{font-size:var(--calcite-font-size--2);font-family:var(--calcite-font-family-code)}}:host([round]){.arcgis-code-viewer-container{border-radius:var(--calcite-corner-radius-round)}}`,p=class extends v{constructor(){super(...arguments),this._monacoEditor=E(N),this.#e=Promise.withResolvers(),this.#t="",this._slotContentObservers=[],this._onDefaultSlotChange=async t=>{S(t)||(this._codeFromSlot="");let e=t.target instanceof HTMLSlotElement?t.target:null,s=e?this._computeSlotText(e):"";e&&this._observeAssignedSlotNodes(e),s!==this._codeFromSlot&&(this._codeFromSlot=s),this.#e.resolve()},this._colorizeTask=new l(this,{task:async([t,e],{signal:s})=>{if(await this.#e.promise,s.aborted)return this.#t;if(await c(e),s.aborted)return this.#t;let i=await O(t,e);return s.aborted?this.#t:(this.#t=i,i)},args:()=>[this._codeFromSlot,this.language]}),this._codeFromSlot="",this.language="arcade",this.round=!1,this.lineNumbers="off"}static{this.properties={_codeFromSlot:16,language:1,round:7,lineNumbers:1}}static{this.styles=$}#e;#t;async load(){L(y("./assets")),await m(this.language),await c(this.language),this._applyColorizeStyles(u()),this.manager.onLifecycle(()=>(this._themeObserver=T(this.el,["class"],()=>this.updateTheme()),this._themeChangedListener=k(()=>{this._applyColorizeStyles(u())}),this.updateTheme(),()=>{this._themeObserver?.(),this._themeObserver=void 0,this._themeChangedListener?.dispose(),this._themeChangedListener=void 0}))}loaded(){this.el.hasChildNodes()||this.#e.resolve()}willUpdate(t){t.has("language")&&m(this.language).then(()=>c(this.language)).catch(_(this))}disconnectedCallback(){super.disconnectedCallback(),this._disposeSlotObservers()}_disposeSlotObservers(){this._slotContentObservers.length&&(this._slotContentObservers.forEach(t=>t.disconnect()),this._slotContentObservers=[])}_observeAssignedSlotNodes(t){this._disposeSlotObservers();let e=t.assignedNodes({flatten:!0});if(!e.length)return;let s=new Set;for(let o of e)o.nodeType===Node.ELEMENT_NODE?s.add(o):o.nodeType===Node.TEXT_NODE&&o.parentElement&&s.add(o.parentElement);let i={characterData:!0,childList:!0,subtree:!0},r=C(()=>{let o=this._computeSlotText(t);o!==this._codeFromSlot&&(this._codeFromSlot=o)},100),d=o=>{if(o.some(a=>a.type==="childList")){let a=this._computeSlotText(t);a!==this._codeFromSlot&&(this._codeFromSlot=a);return}r()};s.forEach(o=>{let a=new MutationObserver(d);a.observe(o,i),this._slotContentObservers.push(a)})}_computeSlotText(t){let e=t.assignedNodes({flatten:!0}).filter(s=>s.nodeType!==Node.COMMENT_NODE);if(this.language==="html"&&e.length){let s=e.find(r=>r.nodeType===Node.ELEMENT_NODE&&r.tagName==="TEMPLATE");if(s)return(s.innerHTML??"").trim();let i=e.map(r=>r.nodeType===Node.ELEMENT_NODE?r.outerHTML:r.nodeType===Node.TEXT_NODE?r.textContent??"":"").join("").trim();return i}return e.map(s=>s.textContent??"").join("").trim()}updateTheme(){let t=w(this.el)==="light"?"vs":"vs-dark";t!==this._currentTheme&&(this._currentTheme=t,this._monacoEditor.setTheme(t))}_applyColorizeStyles(t){if(!this._colorizeSheet){this._colorizeSheet=new CSSStyleSheet;let e=this.renderRoot;e.adoptedStyleSheets=[...e.adoptedStyleSheets,this._colorizeSheet]}this._colorizeSheet.replaceSync(t)}_showLineNumbers(){return typeof this.lineNumbers=="function"||this.lineNumbers==="on"}_getLineNumberLabel(t){return typeof this.lineNumbers=="function"?this.lineNumbers(t):`${t}`}_getRenderedLineNumbers(){if(!this._showLineNumbers())return[];let t=Math.max(this._codeFromSlot.split(/\r\n|\r|\n/u).length,1);return Array.from({length:t},(e,s)=>this._getLineNumberLabel(s+1))}render(){let t=this._getRenderedLineNumbers();return n`<div class=${`arcgis-code-viewer-container${t.length?" arcgis-code-viewer-container--with-line-numbers":""}`}><slot @slotchange=${this._onDefaultSlotChange} style="display:none" aria-hidden=true></slot>${t.length?n`<div class="arcgis-code-viewer__gutter" aria-hidden=true>${t.map(e=>n`<span class="arcgis-code-viewer__line-number">${e}</span>`)}</div>`:null}<pre class="arcgis-code-viewer" aria-label=${`${this.language} code snippet`}>${this._colorizeTask.render({error:()=>null,pending:()=>n`<code class=${`language-${this.language}`}></code>`,complete:e=>n`<code class=${`language-${this.language}`} .innerHTML=${e??""}></code>`})}</pre></div>`}};b("arcgis-code-viewer",p);return p},a,c,d,e,h,i)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./YQANUDOU.js";import{a as I}from"./XEK22IDA.js";import{a as h}from"./CMRUQ3BN.js";import{b as l}from"./BFPEJYVB.js";import{ll as T,xl as u}from"./DSQ2DQQL.js";export default $arcgis.t(([{a:g,b:f}])=>{var m=Promise.withResolvers(),p=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker())}dispose(){this._configChangeListener.dispose(),this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,m=Promise.withResolvers()),this._client=null}static async waitForWorker(){return await m.promise}async _getClientProxy(){let e=await h();if(!this._client){let{languageId:t}=this._defaults,o=window.MonacoEnvironment?.getWorker;if(!o)throw new Error("MonacoEnvironment.getWorker is not configured. Call setupMonacoEnvironment(...) before creating SQL Expression workers.");this._worker=e.createWebWorker({worker:o("SqlExprWorker",t),host:this._defaults.workerHost}),m.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let t=await this._getClientProxy();return await this._worker?.withSyncedResources(e),t}},L=["AND","AS","BOTH","CASE","CAST","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","DATE","DAY","DOY","DOW","ELSE","END","ESCAPE","FALSE","FLOAT","FOR","FROM","HOUR","IN","INT","INTEGER","INTERVAL","LEADING","LIKE","MINUTE","MONTH","POSITION","REAL","SECOND","SMALLINT","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRIM","TRUE","VARCHAR","WEEK","WHEN","WITH","YEAR","ZONE"],M=["AND","BETWEEN","LIKE","NOT","OR","IS","NULL"],b=["CAST","EXTRACT","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","ABS","ACOS","ASIN","ATAN","CEILING","COS","FLOOR","LOG","LOG10","MOD","NULLIF","POWER","ROUND","SIGN","SIN","TAN","TRUNCATE","CHAR_LENGTH","COALESCE","CONCAT","LOWER","POSITION","SUBSTRING","TRIM","UPPER"],O={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},D={defaultToken:"",tokenPostfix:".arcgis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:L,operators:M,builtinFunctions:b,builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}},_=class{constructor(e,t){this._worker=e,this._defaults=t}async provideCompletionItems(e,t){try{let o=await this._worker(e.uri),r=e.getWordUntilPosition(t),n={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:r.startColumn,endColumn:r.endColumn},c=this._defaults.getApiContextForModel(e.uri);return await o.doComplete(e.uri.toString(),n,t,c)}catch(o){return l("SqlExprCompletionProvider")(o),{suggestions:[]}}}},k=class{constructor(e,t,{defaults:o,diagnosticService:r}){this._languageId=e,this._worker=t,this._disposables=[],this._modelListeners=new Map,this._diagnosticsService=r,this._defaults=o,h().then(n=>{let c=i=>{let s=i.getLanguageId();if(s!==this._languageId)return;let d=I(()=>{this._doValidate(i,s).catch(R=>{throw R})}),S=i.onDidChangeContent(d),A=i.onDidChangeAttached(d);this._modelListeners.set(i.uri.toString(),[S,A]),this._doValidate(i,s).catch(l("SqlExprDiagnosticsAdapter"))},E=i=>{let s=i.uri.toString();n.setModelMarkers(i,this._languageId,[]);let d=this._modelListeners.get(s);if(d){for(;d.length;)d.pop()?.dispose();this._modelListeners.delete(s)}};this._disposables.push(n.onDidCreateModel(c)),this._disposables.push(n.onWillDisposeModel(i=>E(i))),this._disposables.push(n.onDidChangeModelLanguage(i=>{E(i.model),c(i.model)})),this._disposables.push(o.onDidChange(()=>{n.getModels().forEach(i=>{i.getLanguageId()===this._languageId&&(E(i),c(i))})})),this._disposables.push(o.onModelContextDidChange(i=>{n.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&s.uri.toString()===i&&this._doValidate(s,this._languageId).catch(l("SqlExprDiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(i=>i.forEach(s=>s.dispose())),this._modelListeners.clear()}}),n.getModels().forEach(c)})}async _doValidate(e,t){let o=await h();if(e.isAttachedToEditor())try{let r=await this._worker(e.uri),n=this._defaults.getApiContextForModel(e.uri),c=await r.doValidation(e.uri.toString(),n);this._diagnosticsService.fireDiagnosticsChange(e.uri,c),o.setModelMarkers(e,t,c)}catch(r){l("SqlExprDiagnosticsAdapter")(r)}}},w;async function Z(...a){return await p.waitForWorker(),await new Promise((e,t)=>{if(!w){t(new Error("sql expression worker not registered!"));return}e(w(...a))})}var C=class{constructor(){this._onDiagnosticsChange=new T}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}},N=new C;async function K(){return await f(),N}function X(a){let e=new p(a),t=async(...r)=>await e.getLanguageServiceWorker(...r);w=t,u.setMonarchTokensProvider(g.languageId,D),u.setLanguageConfiguration(g.languageId,O);let o=new _(t,g);u.registerCompletionItemProvider(g.languageId,o),new k(a.languageId,t,{defaults:a,diagnosticService:N})}return{a:Z,b:K,c:X}},a)
2
+ import a from"./5A6ECP7V.js";import{a as I}from"./XEK22IDA.js";import{a as h}from"./CMRUQ3BN.js";import{b as l}from"./BFPEJYVB.js";import{ll as T,xl as u}from"./DSQ2DQQL.js";export default $arcgis.t(([{a:g,b:f}])=>{var m=Promise.withResolvers(),p=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker())}dispose(){this._configChangeListener.dispose(),this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,m=Promise.withResolvers()),this._client=null}static async waitForWorker(){return await m.promise}async _getClientProxy(){let e=await h();if(!this._client){let{languageId:t}=this._defaults,o=window.MonacoEnvironment?.getWorker;if(!o)throw new Error("MonacoEnvironment.getWorker is not configured. Call setupMonacoEnvironment(...) before creating SQL Expression workers.");this._worker=e.createWebWorker({worker:o("SqlExprWorker",t),host:this._defaults.workerHost}),m.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let t=await this._getClientProxy();return await this._worker?.withSyncedResources(e),t}},L=["AND","AS","BOTH","CASE","CAST","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","DATE","DAY","DOY","DOW","ELSE","END","ESCAPE","FALSE","FLOAT","FOR","FROM","HOUR","IN","INT","INTEGER","INTERVAL","LEADING","LIKE","MINUTE","MONTH","POSITION","REAL","SECOND","SMALLINT","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRIM","TRUE","VARCHAR","WEEK","WHEN","WITH","YEAR","ZONE"],M=["AND","BETWEEN","LIKE","NOT","OR","IS","NULL"],b=["CAST","EXTRACT","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","ABS","ACOS","ASIN","ATAN","CEILING","COS","FLOOR","LOG","LOG10","MOD","NULLIF","POWER","ROUND","SIGN","SIN","TAN","TRUNCATE","CHAR_LENGTH","COALESCE","CONCAT","LOWER","POSITION","SUBSTRING","TRIM","UPPER"],O={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},D={defaultToken:"",tokenPostfix:".arcgis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:L,operators:M,builtinFunctions:b,builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}},_=class{constructor(e,t){this._worker=e,this._defaults=t}async provideCompletionItems(e,t){try{let o=await this._worker(e.uri),r=e.getWordUntilPosition(t),n={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:r.startColumn,endColumn:r.endColumn},c=this._defaults.getApiContextForModel(e.uri);return await o.doComplete(e.uri.toString(),n,t,c)}catch(o){return l("SqlExprCompletionProvider")(o),{suggestions:[]}}}},k=class{constructor(e,t,{defaults:o,diagnosticService:r}){this._languageId=e,this._worker=t,this._disposables=[],this._modelListeners=new Map,this._diagnosticsService=r,this._defaults=o,h().then(n=>{let c=i=>{let s=i.getLanguageId();if(s!==this._languageId)return;let d=I(()=>{this._doValidate(i,s).catch(R=>{throw R})}),S=i.onDidChangeContent(d),A=i.onDidChangeAttached(d);this._modelListeners.set(i.uri.toString(),[S,A]),this._doValidate(i,s).catch(l("SqlExprDiagnosticsAdapter"))},E=i=>{let s=i.uri.toString();n.setModelMarkers(i,this._languageId,[]);let d=this._modelListeners.get(s);if(d){for(;d.length;)d.pop()?.dispose();this._modelListeners.delete(s)}};this._disposables.push(n.onDidCreateModel(c)),this._disposables.push(n.onWillDisposeModel(i=>E(i))),this._disposables.push(n.onDidChangeModelLanguage(i=>{E(i.model),c(i.model)})),this._disposables.push(o.onDidChange(()=>{n.getModels().forEach(i=>{i.getLanguageId()===this._languageId&&(E(i),c(i))})})),this._disposables.push(o.onModelContextDidChange(i=>{n.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&s.uri.toString()===i&&this._doValidate(s,this._languageId).catch(l("SqlExprDiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(i=>i.forEach(s=>s.dispose())),this._modelListeners.clear()}}),n.getModels().forEach(c)})}async _doValidate(e,t){let o=await h();if(e.isAttachedToEditor())try{let r=await this._worker(e.uri),n=this._defaults.getApiContextForModel(e.uri),c=await r.doValidation(e.uri.toString(),n);this._diagnosticsService.fireDiagnosticsChange(e.uri,c),o.setModelMarkers(e,t,c)}catch(r){l("SqlExprDiagnosticsAdapter")(r)}}},w;async function Z(...a){return await p.waitForWorker(),await new Promise((e,t)=>{if(!w){t(new Error("sql expression worker not registered!"));return}e(w(...a))})}var C=class{constructor(){this._onDiagnosticsChange=new T}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}},N=new C;async function K(){return await f(),N}function X(a){let e=new p(a),t=async(...r)=>await e.getLanguageServiceWorker(...r);w=t,u.setMonarchTokensProvider(g.languageId,D),u.setLanguageConfiguration(g.languageId,O);let o=new _(t,g);u.registerCompletionItemProvider(g.languageId,o),new k(a.languageId,t,{defaults:a,diagnosticService:N})}return{a:Z,b:K,c:X}},a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import c from"./KN6J22WW.js";import a from"./STN3LSQR.js";import{j as f}from"./BHSILWSL.js";import{b as y,c as h,d as b}from"./BZWB7A55.js";import{M as u}from"./A77A54OM.js";export default $arcgis.t(([{i:m,n:l},{l:g,o:F,p:w}])=>{var T={allowAllRootBinaryOperators:!1,requiresPredicateRootNode:!1},M={"field-calculation":T,"where-clause":{allowAllRootBinaryOperators:!0,requiresPredicateRootNode:!0,allowGeometryFields:!0}};function I(i){return i&&i in M?M[i]:void 0}var L=i=>{let r=i.variables[0],t=r?.type==="featureSet"?_(r):void 0,{apiVersion:e,bundles:a,hiddenApiItems:o}=i.toEditorProfileDefinition();return{apiVersion:e,bundles:a,variables:t?[t]:[],hiddenApiItems:o?.map(s=>s.toLowerCase())}};function _(i){let{name:r}=i,t=i.getDescription(),{definition:e}=i.toProfileVariableDefinition(),a={label:r,detail:r,insertText:r,insertTextMode:b.asIs,insertTextFormat:h.PlainText,kind:y.Field},o={name:r,description:t,type:"dictionary",properties:[],completion:a};if(!e||!("fields"in e))return o;let[s,n]=g(e.fields,t,{includeAliases:!1,supportGeometryFields:!0});return o.properties=s,a.documentation={kind:"markdown",value:n},o}var v=[{name:"$layer",type:"featureSet",description:"The layer being calculated."}],q={"field-calculation":{id:"field-calculation",variables:v},"where-clause":{id:"where-clause",variables:v}};function E(i){return q[i]??null}function S(i){if(!l(i))return;let r=E(i.id);if(!r)return;let t={variables:[],hiddenApiItems:i.hiddenApiItems?.map(e=>e.toLowerCase())};return r.variables.forEach(e=>{if(i.disabledVariables?.includes(e.name))return;let a=i.definitions[e.name];if(e.type==="featureSet")return m(a)?t.variables.push({...e,type:e.type,definition:a}):void 0;throw Error(`sdkVariable type not supported (yet) type: ${e.type}`)}),t}var A="arcgis-sql-expression",p=class extends w{constructor(){super(A,{apiPath:"./assets/sql-language/api",apiPrefix:"sql-api.t9n."}),this._languageId=A,this._layerMap=new Map}updateFeatureLayerForModel(r,t){let e=this._getApiKey(r);this._layerMap.set(e,t)}getFeatureLayerForModel(r){let t=this._getApiKey(r);return this._layerMap.get(t)}async setProfileForModel(r,t,e={locale:"en"}){let a=l(t)?I(t.id):void 0;l(t)&&(t=S(t));let o=await f(e.locale,u("./assets/editor-profile/t9n"),"messages.");if(!o)throw new Error(`Failed to load the language bundle for ${e.locale}`);this.disposeForModel(r);let s=this._getApiKey(r),n=new F(t,o,e.locale,a);this._modelToProfileMap.set(s,n);let x=L(n);this.updateApiContextForModel(r,{locale:e.locale,profile:x,...a?{profilePolicy:a}:{}});let c=t?.variables?.find(P=>P.name==="$layer");c&&this.updateFeatureLayerForModel(r,c.definition)}},d=new p,K={setProfileForModel:d.setProfileForModel.bind(d),getApiLibraryForModel:d.getApiLibraryForModel.bind(d)};async function B(){return await import("./A6DSTEHL.js").then(m=>m.default)}return{a:d,b:B}},a,c)
2
+ import c from"./CPX3K3UL.js";import a from"./STN3LSQR.js";import{j as f}from"./BHSILWSL.js";import{b as y,c as h,d as b}from"./BZWB7A55.js";import{M as u}from"./PM4JFKBG.js";export default $arcgis.t(([{i:m,n:l},{l:g,o:F,p:w}])=>{var T={allowAllRootBinaryOperators:!1,requiresPredicateRootNode:!1},M={"field-calculation":T,"where-clause":{allowAllRootBinaryOperators:!0,requiresPredicateRootNode:!0,allowGeometryFields:!0}};function I(i){return i&&i in M?M[i]:void 0}var L=i=>{let r=i.variables[0],t=r?.type==="featureSet"?_(r):void 0,{apiVersion:e,bundles:a,hiddenApiItems:o}=i.toEditorProfileDefinition();return{apiVersion:e,bundles:a,variables:t?[t]:[],hiddenApiItems:o?.map(s=>s.toLowerCase())}};function _(i){let{name:r}=i,t=i.getDescription(),{definition:e}=i.toProfileVariableDefinition(),a={label:r,detail:r,insertText:r,insertTextMode:b.asIs,insertTextFormat:h.PlainText,kind:y.Field},o={name:r,description:t,type:"dictionary",properties:[],completion:a};if(!e||!("fields"in e))return o;let[s,n]=g(e.fields,t,{includeAliases:!1,supportGeometryFields:!0});return o.properties=s,a.documentation={kind:"markdown",value:n},o}var v=[{name:"$layer",type:"featureSet",description:"The layer being calculated."}],q={"field-calculation":{id:"field-calculation",variables:v},"where-clause":{id:"where-clause",variables:v}};function E(i){return q[i]??null}function S(i){if(!l(i))return;let r=E(i.id);if(!r)return;let t={variables:[],hiddenApiItems:i.hiddenApiItems?.map(e=>e.toLowerCase())};return r.variables.forEach(e=>{if(i.disabledVariables?.includes(e.name))return;let a=i.definitions[e.name];if(e.type==="featureSet")return m(a)?t.variables.push({...e,type:e.type,definition:a}):void 0;throw Error(`sdkVariable type not supported (yet) type: ${e.type}`)}),t}var A="arcgis-sql-expression",p=class extends w{constructor(){super(A,{apiPath:"./assets/sql-language/api",apiPrefix:"sql-api.t9n."}),this._languageId=A,this._layerMap=new Map}updateFeatureLayerForModel(r,t){let e=this._getApiKey(r);this._layerMap.set(e,t)}getFeatureLayerForModel(r){let t=this._getApiKey(r);return this._layerMap.get(t)}async setProfileForModel(r,t,e={locale:"en"}){let a=l(t)?I(t.id):void 0;l(t)&&(t=S(t));let o=await f(e.locale,u("./assets/editor-profile/t9n"),"messages.");if(!o)throw new Error(`Failed to load the language bundle for ${e.locale}`);this.disposeForModel(r);let s=this._getApiKey(r),n=new F(t,o,e.locale,a);this._modelToProfileMap.set(s,n);let x=L(n);this.updateApiContextForModel(r,{locale:e.locale,profile:x,...a?{profilePolicy:a}:{}});let c=t?.variables?.find(P=>P.name==="$layer");c&&this.updateFeatureLayerForModel(r,c.definition)}},d=new p,K={setProfileForModel:d.setProfileForModel.bind(d),getApiLibraryForModel:d.getApiLibraryForModel.bind(d)};async function B(){return await import("./WXA37GUM.js").then(m=>m.default)}return{a:d,b:B}},a,c)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as g}from"./J4I4EROF.js";import{F as n,G as l,H as b,L as p,h as u,j as m}from"./A77A54OM.js";import"./BFPEJYVB.js";import"./H6RQVSYM.js";var z=u`:host{--internal-border: var(--arcgis-coding-components-border, 1px solid var(--calcite-color-border-3));--internal-background-color: var(--arcgis-coding-components-background-color, var(--calcite-color-foreground-1));--internal-side-action-bar-max-w: var(--arcgis-coding-components-side-action-bar-max-w, 25%);--internal-code-editor-side-panel-w: var(--arcgis-coding-components-code-editor-side-panel-w, 600px);--internal-code-editor-side-panel-max-w: var(--arcgis-coding-components-code-editor-side-panel-max-w, 45%);--internal-code-editor-results-panel-max-h: var(--arcgis-coding-components-code-editor-results-panel-max-h, 50%);--internal-code-editor-results-panel-h: var(--arcgis-coding-components-code-editor-results-panel-h, 50%);--internal-code-editor-results-panel-bottom-drawer-controls-h: 0px;display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--internal-border);box-sizing:border-box;background-color:var(--internal-background-color);height:100%;.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.bottom-drawer{display:flex;flex:0 0 auto;flex-direction:column;overflow:hidden;position:relative;box-sizing:border-box;min-height:0}.bottom-drawer-resize-handle{display:none;position:absolute;inset-inline:0;inset-block-start:0;align-items:center;justify-content:center;block-size:var(--calcite-size-fixed-sm-plus);cursor:ns-resize;touch-action:none;user-select:none;z-index:var(--calcite-z-index-header);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);outline:none}.bottom-drawer-resize-handle-bar{display:flex;align-items:center;justify-content:center;inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);transition:box-shadow .12s ease,color .12s ease,background-color .12s ease}.bottom-drawer-resize-handle-bar calcite-icon{color:inherit}}:host(:state(results-has-content)) .bottom-drawer{padding-block-start:var(--calcite-size-fixed-sm-plus);height:calc(var(--internal-code-editor-results-panel-h) + var(--internal-code-editor-results-panel-bottom-drawer-controls-h));max-height:calc(var(--internal-code-editor-results-panel-max-h) + var(--internal-code-editor-results-panel-bottom-drawer-controls-h))}:host(:state(results-has-content)) .bottom-drawer-resize-handle{display:flex}:host(:state(results-has-content)) .bottom-drawer-resize-handle:focus .bottom-drawer-resize-handle-bar{box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host(:state(results-has-content)) .bottom-drawer-resize-handle:hover .bottom-drawer-resize-handle-bar,:host(:state(results-has-content)) .bottom-drawer-resize-handle .bottom-drawer-resize-handle-bar,:host(:state(is-resizing)) .bottom-drawer-resize-handle-bar{color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-text-1));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-color-foreground-3))}:host(:state(results-has-content)) slot[name=bottom-action-bar]::slotted(*){border-top:0}slot[name=top-action-bar]{flex:0 0 auto}slot[name=top-action-bar]::slotted(*){border-bottom:var(--internal-border)}slot[name=bottom-action-bar]{flex:0 0 auto}slot[name=bottom-action-bar]::slotted(*){border-top:var(--internal-border)}slot[name=side-panel]::slotted(*){max-width:var(--internal-code-editor-side-panel-max-w);width:var(--internal-code-editor-side-panel-w);border-inline-start:var(--internal-border);box-sizing:border-box;flex:1 0 auto}slot[name=side-panel]::slotted(.hidden){display:none}slot[name=editor]::slotted(*){flex:auto;min-height:0}slot[name=results-panel]{display:flex;flex:1 1 auto;overflow:hidden;min-height:0}slot[name=results-panel]::slotted(*){border-top:var(--internal-border);box-sizing:border-box;flex:1 1 auto;min-height:0}slot[name=side-action-bar]::slotted(*){max-width:var(--internal-side-action-bar-max-w);border-inline-start:var(--internal-border)}`,P=10,k=25,v=100,x="results-has-content",f="is-resizing",C="--arcgis-coding-components-code-editor-results-panel-max-h",s="--internal-code-editor-results-panel-h",a="--internal-code-editor-results-panel-max-h",i="--internal-code-editor-results-panel-bottom-drawer-controls-h",c=class extends b{static{this.styles=[z]}#e=void 0;#t=!1;#a=!1;#n=n();#h=n();#l=n();#r;#u(e){this.#e===e.pointerId&&this.#o()}#v=e=>{this.#e===e.pointerId&&this.#o()};load(){this.manager.onLifecycle(()=>(this.#r=new ResizeObserver(()=>{this.#t&&this.#i()}),this.updateComplete.then(()=>this.#g()),()=>{this.#o(),this.#r?.disconnect(),this.#r=void 0}))}#x(){this.#t&&this.#i(),this.#g()}#f(e){e.button!==0||!this.#t||(e.preventDefault(),e.currentTarget instanceof HTMLElement&&(e.currentTarget.focus(),e.currentTarget.setPointerCapture(e.pointerId)),this.#e=e.pointerId,this.#a=!0,this.elementInternals.states.add(f),this.#m(e))}#y(e){if(!this.#t)return;this.#i();let t=this.#k(e);t!=null&&(e.preventDefault(),e.stopPropagation(),this.#a=!0,this.#c(t))}#w(e){if(!e.target)return;let t=g(e);if(this.#t=t,t){this.elementInternals.states.add(x),this.#i();return}this.#o(),this.#a||this.#$(),this.elementInternals.states.delete(x)}#o(){let e=this.#e;if(!e)return;this.#e=void 0;let t=this.#h.value;t?.hasPointerCapture(e)&&t.releasePointerCapture(e),this.elementInternals.states.delete(f)}#m(e){if(this.#e!==e.pointerId)return;let t=this.#s(),r=this.el.getBoundingClientRect().bottom-e.clientY-t;this.#c(r,t)}#z(){let e=Number.parseFloat(this.el.style.getPropertyValue(s));if(Number.isFinite(e))return e;let t=Number.parseFloat(getComputedStyle(this.#n.value??this.el).height);return Number.isFinite(t)?Math.max(0,t-this.#s()):v}#b(){return this.el.querySelector(':scope > [slot="bottom-action-bar"]')}#s(){let e=this.#b()?.getBoundingClientRect().height??0,t=this.#l.value?.getBoundingClientRect().height??0;return e+t}#p(){return getComputedStyle(this.el).getPropertyValue(C).trim()||null}#d(e,t){t?this.el.style.setProperty(e,t):this.el.style.removeProperty(e)}#P(e){let t=this.#p();if(!t)return null;let r=Number.parseFloat(t);if(t.endsWith("px")&&Number.isFinite(r))return r;if(t.endsWith("%")&&Number.isFinite(r))return this.el.getBoundingClientRect().height*r/100;let o=this.#n.value;if(!o)return null;let d=this.el.style.getPropertyValue(i),y=this.el.style.getPropertyValue(s),w=this.el.style.getPropertyValue(a);this.el.style.setProperty(i,`${e}px`),this.el.style.setProperty(s,`${this.el.getBoundingClientRect().height}px`),this.el.style.setProperty(a,t);let h=Number.parseFloat(getComputedStyle(o).height);return this.#d(i,d),this.#d(s,y),this.#d(a,w),Number.isFinite(h)?Math.max(0,h-e):null}#g(){let e=this.#r;if(!e)return;e.disconnect(),e.observe(this.el);let t=this.#l.value;t&&e.observe(t);let r=this.#b();r&&e.observe(r)}#k(e){let t=e.shiftKey?k:P,r=this.#z();switch(e.key){case"ArrowUp":return r+t;case"ArrowDown":return r-t;default:return}}#C(e,t){let r=Math.max(0,this.el.getBoundingClientRect().height-t),o=this.#P(t),d=o==null?r:Math.min(r,o);return Math.min(Math.max(e,v),d)}#c(e,t=this.#s()){let r=this.#C(e,t),o=this.#p();this.el.style.setProperty(i,`${t}px`),this.el.style.setProperty(s,`${r}px`),this.el.style.setProperty(a,o??`calc(100% - ${t}px)`)}#$(){this.el.style.removeProperty(i),this.el.style.removeProperty(s),this.el.style.removeProperty(a)}#i(){let e=this.#s(),t=Number.parseFloat(this.el.style.getPropertyValue(s));return Number.isFinite(t)?this.#c(t,e):this.el.style.setProperty(i,`${e}px`),e}render(){return m`<slot name=top-action-bar></slot><div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><slot name=editor></slot><div class="bottom-drawer" ${l(this.#n)}><div aria-label="Resize results panel" aria-orientation=horizontal class="bottom-drawer-resize-handle" role=separator tabindex=0 @pointercancel=${this.#u} @pointerdown=${this.#f} @pointermove=${this.#m} @pointerup=${this.#u} @lostpointercapture=${this.#v} @keydown=${this.#y} ${l(this.#h)}><div class="bottom-drawer-resize-handle-bar" ${l(this.#l)}><calcite-icon icon=drag-resize-vertical scale=s></calcite-icon></div></div><slot name=bottom-action-bar @slotchange=${this.#x}></slot><slot name=results-panel @slotchange=${this.#w}></slot></div></div><slot name=side-panel></slot><slot name=side-action-bar></slot></div>`}};p("arcgis-code-editor-shell",c);export{c as CodeEditorShell};
2
+ import{a as g}from"./J4I4EROF.js";import{F as n,G as l,H as b,L as p,h as u,j as m}from"./PM4JFKBG.js";import"./BFPEJYVB.js";import"./H6RQVSYM.js";var z=u`:host{--internal-border: var(--arcgis-coding-components-border, 1px solid var(--calcite-color-border-3));--internal-background-color: var(--arcgis-coding-components-background-color, var(--calcite-color-foreground-1));--internal-side-action-bar-max-w: var(--arcgis-coding-components-side-action-bar-max-w, 25%);--internal-code-editor-side-panel-w: var(--arcgis-coding-components-code-editor-side-panel-w, 600px);--internal-code-editor-side-panel-max-w: var(--arcgis-coding-components-code-editor-side-panel-max-w, 45%);--internal-code-editor-results-panel-max-h: var(--arcgis-coding-components-code-editor-results-panel-max-h, 50%);--internal-code-editor-results-panel-h: var(--arcgis-coding-components-code-editor-results-panel-h, 50%);--internal-code-editor-results-panel-bottom-drawer-controls-h: 0px;display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--internal-border);box-sizing:border-box;background-color:var(--internal-background-color);height:100%;.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.bottom-drawer{display:flex;flex:0 0 auto;flex-direction:column;overflow:hidden;position:relative;box-sizing:border-box;min-height:0}.bottom-drawer-resize-handle{display:none;position:absolute;inset-inline:0;inset-block-start:0;align-items:center;justify-content:center;block-size:var(--calcite-size-fixed-sm-plus);cursor:ns-resize;touch-action:none;user-select:none;z-index:var(--calcite-z-index-header);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);outline:none}.bottom-drawer-resize-handle-bar{display:flex;align-items:center;justify-content:center;inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);transition:box-shadow .12s ease,color .12s ease,background-color .12s ease}.bottom-drawer-resize-handle-bar calcite-icon{color:inherit}}:host(:state(results-has-content)) .bottom-drawer{padding-block-start:var(--calcite-size-fixed-sm-plus);height:calc(var(--internal-code-editor-results-panel-h) + var(--internal-code-editor-results-panel-bottom-drawer-controls-h));max-height:calc(var(--internal-code-editor-results-panel-max-h) + var(--internal-code-editor-results-panel-bottom-drawer-controls-h))}:host(:state(results-has-content)) .bottom-drawer-resize-handle{display:flex}:host(:state(results-has-content)) .bottom-drawer-resize-handle:focus .bottom-drawer-resize-handle-bar{box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host(:state(results-has-content)) .bottom-drawer-resize-handle:hover .bottom-drawer-resize-handle-bar,:host(:state(results-has-content)) .bottom-drawer-resize-handle .bottom-drawer-resize-handle-bar,:host(:state(is-resizing)) .bottom-drawer-resize-handle-bar{color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-text-1));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-color-foreground-3))}:host(:state(results-has-content)) slot[name=bottom-action-bar]::slotted(*){border-top:0}slot[name=top-action-bar]{flex:0 0 auto}slot[name=top-action-bar]::slotted(*){border-bottom:var(--internal-border)}slot[name=bottom-action-bar]{flex:0 0 auto}slot[name=bottom-action-bar]::slotted(*){border-top:var(--internal-border)}slot[name=side-panel]::slotted(*){max-width:var(--internal-code-editor-side-panel-max-w);width:var(--internal-code-editor-side-panel-w);border-inline-start:var(--internal-border);box-sizing:border-box;flex:1 0 auto}slot[name=side-panel]::slotted(.hidden){display:none}slot[name=editor]::slotted(*){flex:auto;min-height:0}slot[name=results-panel]{display:flex;flex:1 1 auto;overflow:hidden;min-height:0}slot[name=results-panel]::slotted(*){border-top:var(--internal-border);box-sizing:border-box;flex:1 1 auto;min-height:0}slot[name=side-action-bar]::slotted(*){max-width:var(--internal-side-action-bar-max-w);border-inline-start:var(--internal-border)}`,P=10,k=25,v=100,x="results-has-content",f="is-resizing",C="--arcgis-coding-components-code-editor-results-panel-max-h",s="--internal-code-editor-results-panel-h",a="--internal-code-editor-results-panel-max-h",i="--internal-code-editor-results-panel-bottom-drawer-controls-h",c=class extends b{static{this.styles=[z]}#e=void 0;#t=!1;#a=!1;#n=n();#h=n();#l=n();#r;#u(e){this.#e===e.pointerId&&this.#o()}#v=e=>{this.#e===e.pointerId&&this.#o()};load(){this.manager.onLifecycle(()=>(this.#r=new ResizeObserver(()=>{this.#t&&this.#i()}),this.updateComplete.then(()=>this.#g()),()=>{this.#o(),this.#r?.disconnect(),this.#r=void 0}))}#x(){this.#t&&this.#i(),this.#g()}#f(e){e.button!==0||!this.#t||(e.preventDefault(),e.currentTarget instanceof HTMLElement&&(e.currentTarget.focus(),e.currentTarget.setPointerCapture(e.pointerId)),this.#e=e.pointerId,this.#a=!0,this.elementInternals.states.add(f),this.#m(e))}#y(e){if(!this.#t)return;this.#i();let t=this.#k(e);t!=null&&(e.preventDefault(),e.stopPropagation(),this.#a=!0,this.#c(t))}#w(e){if(!e.target)return;let t=g(e);if(this.#t=t,t){this.elementInternals.states.add(x),this.#i();return}this.#o(),this.#a||this.#$(),this.elementInternals.states.delete(x)}#o(){let e=this.#e;if(!e)return;this.#e=void 0;let t=this.#h.value;t?.hasPointerCapture(e)&&t.releasePointerCapture(e),this.elementInternals.states.delete(f)}#m(e){if(this.#e!==e.pointerId)return;let t=this.#s(),r=this.el.getBoundingClientRect().bottom-e.clientY-t;this.#c(r,t)}#z(){let e=Number.parseFloat(this.el.style.getPropertyValue(s));if(Number.isFinite(e))return e;let t=Number.parseFloat(getComputedStyle(this.#n.value??this.el).height);return Number.isFinite(t)?Math.max(0,t-this.#s()):v}#b(){return this.el.querySelector(':scope > [slot="bottom-action-bar"]')}#s(){let e=this.#b()?.getBoundingClientRect().height??0,t=this.#l.value?.getBoundingClientRect().height??0;return e+t}#p(){return getComputedStyle(this.el).getPropertyValue(C).trim()||null}#d(e,t){t?this.el.style.setProperty(e,t):this.el.style.removeProperty(e)}#P(e){let t=this.#p();if(!t)return null;let r=Number.parseFloat(t);if(t.endsWith("px")&&Number.isFinite(r))return r;if(t.endsWith("%")&&Number.isFinite(r))return this.el.getBoundingClientRect().height*r/100;let o=this.#n.value;if(!o)return null;let d=this.el.style.getPropertyValue(i),y=this.el.style.getPropertyValue(s),w=this.el.style.getPropertyValue(a);this.el.style.setProperty(i,`${e}px`),this.el.style.setProperty(s,`${this.el.getBoundingClientRect().height}px`),this.el.style.setProperty(a,t);let h=Number.parseFloat(getComputedStyle(o).height);return this.#d(i,d),this.#d(s,y),this.#d(a,w),Number.isFinite(h)?Math.max(0,h-e):null}#g(){let e=this.#r;if(!e)return;e.disconnect(),e.observe(this.el);let t=this.#l.value;t&&e.observe(t);let r=this.#b();r&&e.observe(r)}#k(e){let t=e.shiftKey?k:P,r=this.#z();switch(e.key){case"ArrowUp":return r+t;case"ArrowDown":return r-t;default:return}}#C(e,t){let r=Math.max(0,this.el.getBoundingClientRect().height-t),o=this.#P(t),d=o==null?r:Math.min(r,o);return Math.min(Math.max(e,v),d)}#c(e,t=this.#s()){let r=this.#C(e,t),o=this.#p();this.el.style.setProperty(i,`${t}px`),this.el.style.setProperty(s,`${r}px`),this.el.style.setProperty(a,o??`calc(100% - ${t}px)`)}#$(){this.el.style.removeProperty(i),this.el.style.removeProperty(s),this.el.style.removeProperty(a)}#i(){let e=this.#s(),t=Number.parseFloat(this.el.style.getPropertyValue(s));return Number.isFinite(t)?this.#c(t,e):this.el.style.setProperty(i,`${e}px`),e}render(){return m`<slot name=top-action-bar></slot><div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><slot name=editor></slot><div class="bottom-drawer" ${l(this.#n)}><div aria-label="Resize results panel" aria-orientation=horizontal class="bottom-drawer-resize-handle" role=separator tabindex=0 @pointercancel=${this.#u} @pointerdown=${this.#f} @pointermove=${this.#m} @pointerup=${this.#u} @lostpointercapture=${this.#v} @keydown=${this.#y} ${l(this.#h)}><div class="bottom-drawer-resize-handle-bar" ${l(this.#l)}><calcite-icon icon=drag-resize-vertical scale=s></calcite-icon></div></div><slot name=bottom-action-bar @slotchange=${this.#x}></slot><slot name=results-panel @slotchange=${this.#w}></slot></div></div><slot name=side-panel></slot><slot name=side-action-bar></slot></div>`}};p("arcgis-code-editor-shell",c);export{c as CodeEditorShell};
@@ -1,3 +1,3 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{b as x}from"./43C5J4GE.js";import e from"./K7IVZ3HP.js";import c from"./KN6J22WW.js";import{c as v}from"./SKBHZ7VS.js";import a from"./STN3LSQR.js";import"./MZMKV7FA.js";import{a as S}from"./OLMW3NCS.js";import"./SSVSZDRA.js";import"./BHSILWSL.js";import"./J4I4EROF.js";import"./BZWB7A55.js";import"./XEK22IDA.js";import"./CMRUQ3BN.js";import"./UFF53OEH.js";import"./NHREAORV.js";import{F as _,G as b,H as u,I as f,L as E,h as g,j as o,n as d,t as m}from"./A77A54OM.js";import{b as r}from"./BFPEJYVB.js";import"./DSQ2DQQL.js";import"./H6RQVSYM.js";export default $arcgis.t(([{E:n},{c:c},{a:$,b:y,c:I,d:P}])=>{var B=g`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`,h=class extends u{constructor(){super(...arguments),this._codeEditorElt=_(),this._disposables=[],this._modelId=m(),this.messages=S(),this._preparing=!1,this._resolvedLanguage=c,this.sideActionBarExpanded=!1,this.script="",this.hideSideBar=!1,this.openedSidePanel="none",this.arcgisDiagnosticsChange=d({bubbles:!1}),this.arcgisScriptChange=d({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=[B]}get editorInstance(){return this._codeEditorElt.value?.editorInstance}async setFocus(){await this._codeEditorElt.value?.setFocus()}async load(){await this._updateDataModelDeps().catch(r(this))}willUpdate(e){e.has("profile")&&this._updateDataModelDeps().catch(r(this))}async loaded(){let e=x();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();P().forEach(e=>e.disposeForModel(this._modelId))}async _updateDataModelDeps(){this._preparing=!0;try{let e=await $(this.profile);e!==this._resolvedLanguage&&(I(this._resolvedLanguage)?.disposeForModel(this._modelId),this._resolvedLanguage=e);let t=y(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=c}finally{this._preparing=!1}}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_toggleSidePanel(e){this.openedSidePanel=this.openedSidePanel===e?"none":e}_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(r(this));return}await t.loadSource();let a,p=t.fieldInfos.filter(i=>i.type==="geometry"&&!a?(a=i.name,!0):i.type!=="geometry").map(i=>i.name).filter(Boolean),C=`select ${p.length?p.join(", "):"*"} from ${t.snippet}`,s=this._codeEditorElt.value?.editorInstance;v(s,C,"replace",""),s?.getAction("editor.action.formatDocument")?.run();let l=s?.getModel();if(l){let i=l.getLineCount(),L=l.getLineMaxColumn(i);s?.setPosition({lineNumber:i,column:L})}}_getTablesVariable(){return this._editorProfile?.variables.find(n)}_getSelectedTableVariable(e){let t=this._getTablesVariable();if(n(t))return t.tableVariables.find(a=>a.snippet===e)}render(){let e=this._getTablesVariable(),t=String(this.messages.placeholderexample??"Example: {sqlQueryExample}").replace("{sqlQueryExample}","select field1, field2 from db.dataset"),a=`${this.messages.placeholder??"Start filtering data using SQL query syntax"}
2
+ import{b as x}from"./43C5J4GE.js";import e from"./ADG6PXX4.js";import c from"./CPX3K3UL.js";import{c as v}from"./J4VBP7HA.js";import a from"./STN3LSQR.js";import"./MZMKV7FA.js";import{a as S}from"./RQZK3XV2.js";import"./L7OEI4ZV.js";import"./BHSILWSL.js";import"./J4I4EROF.js";import"./BZWB7A55.js";import"./XEK22IDA.js";import"./CMRUQ3BN.js";import"./UFF53OEH.js";import"./NHREAORV.js";import{F as _,G as b,H as u,I as f,L as E,h as g,j as o,n as d,t as m}from"./PM4JFKBG.js";import{b as r}from"./BFPEJYVB.js";import"./DSQ2DQQL.js";import"./H6RQVSYM.js";export default $arcgis.t(([{E:n},{c:c},{a:$,b:y,c:I,d:P}])=>{var B=g`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`,h=class extends u{constructor(){super(...arguments),this._codeEditorElt=_(),this._disposables=[],this._modelId=m(),this.messages=S(),this._preparing=!1,this._resolvedLanguage=c,this.sideActionBarExpanded=!1,this.script="",this.hideSideBar=!1,this.openedSidePanel="none",this.arcgisDiagnosticsChange=d({bubbles:!1}),this.arcgisScriptChange=d({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=[B]}get editorInstance(){return this._codeEditorElt.value?.editorInstance}async setFocus(){await this._codeEditorElt.value?.setFocus()}async load(){await this._updateDataModelDeps().catch(r(this))}willUpdate(e){e.has("profile")&&this._updateDataModelDeps().catch(r(this))}async loaded(){let e=x();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();P().forEach(e=>e.disposeForModel(this._modelId))}async _updateDataModelDeps(){this._preparing=!0;try{let e=await $(this.profile);e!==this._resolvedLanguage&&(I(this._resolvedLanguage)?.disposeForModel(this._modelId),this._resolvedLanguage=e);let t=y(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=c}finally{this._preparing=!1}}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_toggleSidePanel(e){this.openedSidePanel=this.openedSidePanel===e?"none":e}_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(r(this));return}await t.loadSource();let a,p=t.fieldInfos.filter(i=>i.type==="geometry"&&!a?(a=i.name,!0):i.type!=="geometry").map(i=>i.name).filter(Boolean),C=`select ${p.length?p.join(", "):"*"} from ${t.snippet}`,s=this._codeEditorElt.value?.editorInstance;v(s,C,"replace",""),s?.getAction("editor.action.formatDocument")?.run();let l=s?.getModel();if(l){let i=l.getLineCount(),L=l.getLineMaxColumn(i);s?.setPosition({lineNumber:i,column:L})}}_getTablesVariable(){return this._editorProfile?.variables.find(n)}_getSelectedTableVariable(e){let t=this._getTablesVariable();if(n(t))return t.tableVariables.find(a=>a.snippet===e)}render(){let e=this._getTablesVariable(),t=String(this.messages.placeholderexample??"Example: {sqlQueryExample}").replace("{sqlQueryExample}","select field1, field2 from db.dataset"),a=`${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:a,...this.editorOptions}} ${b(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=${f(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>`}};E("arcgis-sql-layer-editor",h);return h},a,c,e)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import f from"./NNZO447D.js";import e from"./5MCVDNVO.js";import"./5HKDO4SX.js";import b from"./2WB7S5TQ.js";import{a as d}from"./OLMW3NCS.js";import"./SSVSZDRA.js";import{b as n,d as u}from"./BHSILWSL.js";import"./J4I4EROF.js";import{H as o,L as c,h as l,j as a}from"./A77A54OM.js";import"./BFPEJYVB.js";import"./H6RQVSYM.js";export default $arcgis.t(([,{a:s,h:r,i:p,j:m},{c:h,f:g,g:f,h:b,i:v}])=>{var T=l`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);--calcite-block-padding: var(--calcite-spacing-sm);overflow:auto;calcite-flow{height:100%}.disabled-state-text{font-size:var(--calcite-font-size-sm);color:var(--calcite-color-text-3);font-style:italic;display:block;margin:var(--calcite-spacing-md)}[class*=result-value-]{line-height:1.25rem}}`;function x(t,e){return h(t)||b(t)||f(t)||g(t)?e??"Output":t.arcadeType}var i=class extends o{constructor(){super(...arguments),this.messages=d()}static{this.properties={debuggerStore:0,result:0,outputTitle:1}}static{this.styles=[T,m,p()]}load(){this.manager.onLifecycle(()=>{let e=n(this.el,["class"],this.updateTheme.bind(this));return this.updateTheme(),()=>e()})}willUpdate(e){e.has("result")&&this.result&&this.debuggerStore?.lazyTreeState.reset()}updateTheme(){u(this.el)==="dark"?this.elementInternals.states.add(r):this.elementInternals.states.delete(r)}render(){if(!this.result)return a`<span class="disabled-state-text">${this.messages.nooutput??"No output available."}</span>`;let e=this.debuggerStore?.lazyTreeState;return e?a`<calcite-tree .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect} .lines=${s.lines} .selectionMode=${s.selectionMode}>${v({expanded:!0,name:x(this.result,this.outputTitle),value:this.result,messages:this.messages,path:this.result.arcadeType,lazyTreeState:e})}</calcite-tree>`:a`<span class="disabled-state-text">${this.messages.nooutput??"No output available."}</span>`}};c("arcgis-arcade-debugger-output",i);return i},b,e,f)
2
+ import f from"./H7XVWT2F.js";import e from"./6EPN2GQ3.js";import"./5HKDO4SX.js";import b from"./2WB7S5TQ.js";import{a as d}from"./RQZK3XV2.js";import"./L7OEI4ZV.js";import{b as n,d as u}from"./BHSILWSL.js";import"./J4I4EROF.js";import{H as o,L as c,h as l,j as a}from"./PM4JFKBG.js";import"./BFPEJYVB.js";import"./H6RQVSYM.js";export default $arcgis.t(([,{a:s,h:r,i:p,j:m},{c:h,f:g,g:f,h:b,i:v}])=>{var T=l`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);--calcite-block-padding: var(--calcite-spacing-sm);overflow:auto;calcite-flow{height:100%}.disabled-state-text{font-size:var(--calcite-font-size-sm);color:var(--calcite-color-text-3);font-style:italic;display:block;margin:var(--calcite-spacing-md)}[class*=result-value-]{line-height:1.25rem}}`;function x(t,e){return h(t)||b(t)||f(t)||g(t)?e??"Output":t.arcadeType}var i=class extends o{constructor(){super(...arguments),this.messages=d()}static{this.properties={debuggerStore:0,result:0,outputTitle:1}}static{this.styles=[T,m,p()]}load(){this.manager.onLifecycle(()=>{let e=n(this.el,["class"],this.updateTheme.bind(this));return this.updateTheme(),()=>e()})}willUpdate(e){e.has("result")&&this.result&&this.debuggerStore?.lazyTreeState.reset()}updateTheme(){u(this.el)==="dark"?this.elementInternals.states.add(r):this.elementInternals.states.delete(r)}render(){if(!this.result)return a`<span class="disabled-state-text">${this.messages.nooutput??"No output available."}</span>`;let e=this.debuggerStore?.lazyTreeState;return e?a`<calcite-tree .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect} .lines=${s.lines} .selectionMode=${s.selectionMode}>${v({expanded:!0,name:x(this.result,this.outputTitle),value:this.result,messages:this.messages,path:this.result.arcadeType,lazyTreeState:e})}</calcite-tree>`:a`<span class="disabled-state-text">${this.messages.nooutput??"No output available."}</span>`}};c("arcgis-arcade-debugger-output",i);return i},b,e,f)
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as u}from"./5HKDO4SX.js";import a from"./2WB7S5TQ.js";import{a as o}from"./BHSILWSL.js";import{I as i,J as v,g as p,h as n,j as t,p as d,q as r}from"./A77A54OM.js";export default $arcgis.t(([{e:m,f:y,g:b}])=>{var s={lines:!0,selectionMode:"none",scale:"s",oncalciteTreeSelect:e=>e.currentTarget.selectedItems.forEach(a=>a.selected=!1)},g="tree-item-metadata",f=({name:e,isMetadata:a=!1})=>t`<bdi class=${i(o("dictionary-property",a&&g))}>${e}</bdi><bdi class=${i(o(a&&g))}>:&nbsp;</bdi>`,M=({obj:e,subtree:a})=>t`<calcite-tree slot=${"children"} .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item class="string-value">${JSON.stringify(e,void 0,2)}</calcite-tree-item></calcite-tree>`,N=({value:e,subtree:a=!1})=>t`<calcite-tree slot=${(a?"children":void 0)??v} .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item><div class="tree-item-label">${f({name:"type"})}<bdi>${d(e.type)}</bdi></div></calcite-tree-item><calcite-tree-item><div class="tree-item-label">${f({name:"value"})}<span class="string-value">${JSON.stringify(e,void 0,2)}</span></div></calcite-tree-item></calcite-tree>`,D=({type:e,value:a})=>{switch(e){case"unknown":case"Unknown":return t`<span class="constant-value">${e}</span>`;case"null":case"Null":return t`<span class="constant-value">null</span>`;case"text":case"String":case"Text":return t`<span class="string-value">${r(a)}</span>`;case"number":case"Number":return t`<span class="number-value">${a}</span>`;case"boolean":case"Boolean":return t`<span class="constant-value">${a}</span>`;case"date":case"Date":return t`<span class="date-value">${a}</span>`;case"dateOnly":case"DateOnly":return t`<span class="string-value">${r(a)}</span>`;case"time":case"Time":return t`<span class="string-value">${r(a)}</span>`;case"":return t`<span class="string-value">null</span>`;default:return null}},h=["boolean","date","dateOnly","null","number","text","time","unknown","Boolean","Date","DateOnly","Null","Number","Text","Time","Unknown","String",""],E=e=>h.includes(e.type);function j(e){switch(e.type){case"null":case"unknown":return{type:e.type,value:e.type};case"number":return{type:e.type,value:String(e.value)};case"boolean":return{type:e.type,value:String(e.value)};case"text":return{type:e.type,value:e.value};case"date":return{type:e.type,value:m(e)};case"dateOnly":return{type:e.type,value:y(e)};case"time":return{type:e.type,value:b(e)}}}var S="calcite-mode-dark";function C(){let e=`:host {
2
+ import{a as u}from"./5HKDO4SX.js";import a from"./2WB7S5TQ.js";import{a as o}from"./BHSILWSL.js";import{I as i,J as v,g as p,h as n,j as t,p as d,q as r}from"./PM4JFKBG.js";export default $arcgis.t(([{e:m,f:y,g:b}])=>{var s={lines:!0,selectionMode:"none",scale:"s",oncalciteTreeSelect:e=>e.currentTarget.selectedItems.forEach(a=>a.selected=!1)},g="tree-item-metadata",f=({name:e,isMetadata:a=!1})=>t`<bdi class=${i(o("dictionary-property",a&&g))}>${e}</bdi><bdi class=${i(o(a&&g))}>:&nbsp;</bdi>`,M=({obj:e,subtree:a})=>t`<calcite-tree slot=${"children"} .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item class="string-value">${JSON.stringify(e,void 0,2)}</calcite-tree-item></calcite-tree>`,N=({value:e,subtree:a=!1})=>t`<calcite-tree slot=${(a?"children":void 0)??v} .lines=${s.lines} .selectionMode=${s.selectionMode} .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect}><calcite-tree-item><div class="tree-item-label">${f({name:"type"})}<bdi>${d(e.type)}</bdi></div></calcite-tree-item><calcite-tree-item><div class="tree-item-label">${f({name:"value"})}<span class="string-value">${JSON.stringify(e,void 0,2)}</span></div></calcite-tree-item></calcite-tree>`,D=({type:e,value:a})=>{switch(e){case"unknown":case"Unknown":return t`<span class="constant-value">${e}</span>`;case"null":case"Null":return t`<span class="constant-value">null</span>`;case"text":case"String":case"Text":return t`<span class="string-value">${r(a)}</span>`;case"number":case"Number":return t`<span class="number-value">${a}</span>`;case"boolean":case"Boolean":return t`<span class="constant-value">${a}</span>`;case"date":case"Date":return t`<span class="date-value">${a}</span>`;case"dateOnly":case"DateOnly":return t`<span class="string-value">${r(a)}</span>`;case"time":case"Time":return t`<span class="string-value">${r(a)}</span>`;case"":return t`<span class="string-value">null</span>`;default:return null}},h=["boolean","date","dateOnly","null","number","text","time","unknown","Boolean","Date","DateOnly","Null","Number","Text","Time","Unknown","String",""],E=e=>h.includes(e.type);function j(e){switch(e.type){case"null":case"unknown":return{type:e.type,value:e.type};case"number":return{type:e.type,value:String(e.value)};case"boolean":return{type:e.type,value:String(e.value)};case"text":return{type:e.type,value:e.value};case"date":return{type:e.type,value:m(e)};case"dateOnly":return{type:e.type,value:y(e)};case"time":return{type:e.type,value:b(e)}}}var S="calcite-mode-dark";function C(){let e=`:host {
3
3
  `,a=u["light-theme"];Object.entries(a).forEach(([c,l])=>{e+=` --arcgis-editor-${c}: ${l};
4
4
  `}),e+=`}
5
5
  `,e+=`:host(:state(${S})),
@@ -1,4 +1,4 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as N}from"./P6UAZRSN.js";import c from"./3LKMIPIC.js";import b from"./KN6J22WW.js";import{c as ae,d as se}from"./SKBHZ7VS.js";import a from"./STN3LSQR.js";import{d as oe}from"./MZMKV7FA.js";import{a as te}from"./OLMW3NCS.js";import"./SSVSZDRA.js";import"./BHSILWSL.js";import"./J4I4EROF.js";import"./BZWB7A55.js";import"./XEK22IDA.js";import"./CMRUQ3BN.js";import"./UFF53OEH.js";import"./NHREAORV.js";import{F as W,G as K,H as X,I as Z,J as M,L as ee,h as Q,j as d,k as j,l as V,t as H,x as G,y as J,z as Y}from"./A77A54OM.js";import{a as w}from"./BFPEJYVB.js";import"./DSQ2DQQL.js";import"./H6RQVSYM.js";export default $arcgis.t(([xe,ne,Se,re,ce,{getDeclaredVoxelMembers:Te,getDeclaredPixelMembers:Ae},Ce,{property:b,subclass:Ie},{G:q,w:ie,x:F},,P])=>{var C=class extends Y{constructor(e){if(super(e),this.it=V,e.type!==G.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===V||e==null)return this._t=void 0,this.it=e;if(e===j)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};C.directiveName="unsafeHTML",C.resultType=1;var I=J(C);var Me=Q`:host(:not([closed])){container-type:size;--calcite-block-border-color: var(--calcite-color-transparent);box-sizing:border-box;.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}@container (max-width: 380px){.hidden-below-380{display:none}}@container (min-width: 380px){.hidden-above-380{display:none}}.gaps{display:flex;gap:.25rem}.align-inline-end{margin-inline-start:auto}.context-popover p{padding:0 .5rem;font-size:var(--calcite-font-size-sm)}.feedback-content{padding:var(--calcite-spacing-sm);display:flex;flex-direction:column;max-height:75cqb;overflow-y:auto;>*{margin-block-end:.5rem}>*:last-child,.terms-label{margin-block-end:0}calcite-text-area{--calcite-text-area-min-height: 4rem}calcite-notice{margin-block-start:0}}.feedback-sheet{--calcite-sheet-height: auto;--calcite-sheet-max-height: 100%;--calcite-sheet-min-height: auto}.feedback-footer{display:flex;justify-content:flex-end;gap:.5rem;width:100%}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-dialog{--calcite-dialog-content-space: initial;--calcite-dialog-size-y: initial}calcite-sheet{--calcite-sheet-scrim-background: rgba(200, 200, 200, .5)}calcite-list-item calcite-button{margin-inline-end:.25rem}calcite-flow-item calcite-shell calcite-notice{margin-block:1rem}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;flex-direction:column}calcite-text-area{height:auto;overflow:hidden;--calcite-font-weight-normal: 500;font-weight:500;line-height:1.2}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}.contained-popover-or-tooltip{--calcite-popover-max-size-x: 100%;--calcite-tooltip-max-size-x: 100%}.info-heading{font-size:var(--calcite-font-size-0);color:var(--calcite-color-text-1);margin:0}.info-heading-row{display:flex;align-items:center;gap:var(--calcite-spacing-sm);flex-wrap:wrap}.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)}.suggestions{display:flex;flex-direction:row;gap:var(--calcite-spacing-xs);flex-wrap:wrap}.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=heading] 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}.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)}.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}.contained{max-width:100%;max-height:100%;max-width:100cqi;max-height:75cqb;overflow-y:auto}.submission-notice{--calcite-notice-border-color: transparent;margin-block:0;width:100%;--calcite-font-size-relative-base: var(--calcite-font-size--2)}.border-block-end{border-block-end:1px solid var(--calcite-color-border-3)}.round-top{border-radius:var(--calcite-corner-radius-round) var(--calcite-corner-radius-round) 0 0}}:host([closed]){display:none}`,$=class extends Error{constructor({message:e,code:t,subCode:a,details:o,source:n}){super(e),this.name="ArcadeAssistantError",this.code=t,this.subCode=a,this.details=o,this.source=n}};function le(i){if(!i)return;let e=i.indexOf('{"error":');if(e!==-1)try{let t=i.slice(e),a=JSON.parse(t);if(a&&typeof a=="object"&&a.error)return a.error}catch{return}}async function Ee(i){let{baseUrl:e,skillId:t,message:a,authToken:o,previousConversationId:n,context:r}=i,p=t?`${e}/skills/${t}/chat`:`${e}/chat`,c=[],s={message:a,context:r};n&&(s.conversation_id=n);let u;try{u=await ne(p,{method:"post",headers:{"Content-Type":"application/json",token:o},body:JSON.stringify(s),responseType:"json"})}catch(f){let v=f,x=v.details?.rawResponse||v.message||String(f),T=le(x);throw T?new $(T):f}let l=u.data;c.push(l);let h=l.conversationId,S=l.inquiryId,k=l.sequenceNumber;async function E(){let f=0,v=100;for(;f<v;){await new Promise(A=>setTimeout(A,1e3));let x=Re(h,k,S),T;try{T=await ne(p,{method:"post",headers:{"Content-Type":"application/json",token:o},body:JSON.stringify(x),responseType:"json"})}catch(A){let L=A,ke=L.details?.rawResponse||L.message||String(A),B=le(ke);throw B?new $(B):A}let y=T.data;if(y.context?.kind==="ArcgisErrorAsContext"&&y.context.error)throw new $({message:y.context.error.message||"ArcGIS Assistant error",code:y.context.error.code,subCode:y.context.error.subCode,details:y.context.error.details,source:"polling-response"});if(c.push(y),k=y.sequenceNumber,f++,!y.hasMore)break}if(f===v)throw new $({message:"Request timed out",code:"TIMEOUT",source:"polling"})}let R=120*1e3;return await Promise.race([E(),new Promise((f,v)=>setTimeout(()=>v(new $({message:"Request timed out",code:"TIMEOUT",source:"hard-timeout"})),R))]),c}function Re(i,e,t){return{conversationId:i,inquiryId:t,ackSequenceNumber:e}}function Ve(i){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"?"Request timed out. Try again by re-asking the same question or rephrasing it.":i.message}var Fe=({notices:i})=>i.length?d`<div class="border-block-end">${N(i,e=>e.id??e.title,e=>d`<calcite-notice class="submission-notice" .icon=${e.icon} .kind=${e.kind} scale=s open .closable=${e.closable} @calciteNoticeClose=${()=>e.onClose?.()}><div slot=title>${e.title}</div>${e.message&&d`<div slot=message>${e.message}</div>`||""}${e.actionLinkMessage&&e.onAction&&d`<calcite-link slot=link @click=${()=>e.onAction?.()}>${e.actionLinkMessage}</calcite-link>`||""}</calcite-notice>`)}</div>`:null,qe=i=>{let e=i.value.length,t=72,a=180,o=i.offsetWidth,n=Math.max(1,Math.floor(o/8)),r=Math.ceil(e/n),p=t+(r-2)*24;i.style.setProperty("--calcite-text-area-min-height",`${Math.min(p,a)}px`)},Pe=({promptValidationMessage:i,errorMessage:e,contextTooBig:t,contextReducedNoticeDismissed:a,setContextReducedNoticeDismissed:o,setErrorMessage:n,messages:r})=>{let p=[];if(i&&p.push({id:"prompt-validation",kind:"danger",icon:"exclamation-mark-triangle",title:i,closable:!0}),e&&p.push({id:"assistant-error",kind:"danger",icon:"exclamation-mark-triangle",title:e,closable:!0,onClose:()=>n(void 0)}),t&&!a){let c=r.contextreduced??"Context reduced",s=r.contextreducedmessage??"The editor profile is too large for the assistant. It has been reduced in the assistant in order to ensure a successful request.";p.push({id:"context-reduced",kind:"warning",icon:"exclamation-mark-triangle",title:c,message:s,closable:!0,onClose:()=>o(!0)})}return p};function Ne({messages:i}){return d`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${i.beta??"Beta"}>${i.beta??"Beta"}</calcite-chip>`}function _e({popoverContent:i,messages:e}){return d`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-popover reference-element=legal-disclaimer .label=${e.legaldisclaimer??"Legal disclaimer"} placement=bottom auto-close focus-trap-disabled><div class="contained">${i}</div></calcite-popover>`}function De({errorMessage:i,slot:e}){return d`<div class="error-display"><calcite-input-message id=error-message status=invalid icon=exclamation-mark-triangle scale=m slot=${e??M}>${i}</calcite-input-message></div>`}function Ue({active:i,setActive:e,messages:t}){return d`<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>`}function Oe({context:i,messages:e}){return i?d`<div class="gaps">${i.profileId&&d`<calcite-popover auto-close placement=top .label=${(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",i.profileId)} reference-element=profile-context-button class="context-popover contained-popover-or-tooltip"><p>${(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",i.profileId)}</p></calcite-popover><calcite-button round kind=neutral icon-start=map-information id=profile-context-button scale=s></calcite-button>`||""}</div>`:null}function ze({isDisabled:i,isReadOnly:e,setQuestion:t,setIsViewingResult:a,textAreaRef:o,question:n,errorMessage:r,setErrorMessage:p,promptValidationMessage:c,setPromptValidationMessage:s,submitQuestion:u,messages:l,mode:h,assistantRef:S,context:k,contextReducedNoticeDismissed:E,setContextReducedNoticeDismissed:R}){let f=k?.contextTooLarge??!1,v=Pe({promptValidationMessage:c,errorMessage:r,contextTooBig:f,contextReducedNoticeDismissed:E,setContextReducedNoticeDismissed:R,setErrorMessage:p,messages:l});return d`<div class="text-area-wrapper">${Fe({notices:v})}<calcite-text-area scale=s resize=vertical .readOnly=${i||e} class=${Z(v.length?"submission-text-area":"submission-text-area round-top")} .placeholder=${l.askaquestion??`Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${n} @calciteTextAreaInput=${x=>{qe(x.target),t(x.target.value)}} ${K(o)}><div class="submission-actions-wrapper" slot=footer-start><div class="submission-actions">${k&&Oe({context:k,messages:l})||""}<div class="align-inline-end gaps"><calcite-button round kind=neutral .hidden=${h!=="refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid scale=s .disabled=${i} @click=${async()=>{a(!1),t("")}} .label=${l.startover??"Start Over"} class="hidden-above-380" id=small-start-over-button></calcite-button><calcite-tooltip reference-element=small-start-over-button placement=top-start class="hidden-above-380">${l.startover??"Start Over"}</calcite-tooltip><calcite-button round kind=neutral .hidden=${h!=="refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${i} @click=${async()=>{a(!1),t("")}} class="hidden-below-380" scale=s>${l.startover??"Start Over"}</calcite-button><calcite-button round scale=s icon-end=effects appearance=solid .loading=${i} .disabled=${i} @click=${async()=>{if(p(""),!n){s(l.enteraprompt??"Please enter a prompt");return}s(void 0),await u()}} class="hidden-below-380">${h==="prompt"?l.ask??"Generate":l.refine??"Refine"}</calcite-button><calcite-button round scale=s icon-end=effects appearance=solid .loading=${i} .disabled=${i} id=small-submit-button @click=${async()=>{if(p(""),!n){s(l.enteraprompt??"Please enter a prompt");return}s(void 0),await u()}} class="hidden-above-380" .label=${h==="prompt"?l.ask??"Generate":l.refine??"Refine"}></calcite-button><calcite-tooltip reference-element=small-submit-button placement=top-start class="hidden-above-380">${h==="prompt"?l.ask??"Generate":l.refine??"Refine"}</calcite-tooltip></div></div></div></calcite-text-area></div>`}var Le="https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement",Be="https://www.esri.com/en-us/privacy/privacy-statements";function Qe({setOpen:i,messages:e,feedback:t,learnMoreUrl:a,setFeedback:o,onSubmit:n}){return t.active?d`<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.submitfeedback??"Submit feedback to Esri"} scale=s><div class="feedback-content"><calcite-text-area scale=s resize=vertical .value=${t.text} @calciteTextAreaInput=${r=>o({...t,text:r.target.value})} .disabled=${t.submitting} .placeholder=${e.donotincludepersonalinfo??"Do not include personal or sensitive information"} rows=3></calcite-text-area><calcite-label layout=inline scale=s class="terms-label"><calcite-checkbox scale=l .checked=${t.termsAccepted} @calciteCheckboxChange=${r=>{o({...t,termsAccepted:r.target.checked})}} .disabled=${t.submitting}></calcite-checkbox><span>${I((e.agreement??"I agree to the {EsriPrivacyStatement} (and {Supplement}).").replace("{EsriPrivacyStatement}",`<calcite-link href=${Be} target="_blank">${e.esriprivacystatement??"Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}",`<calcite-link href=${Le} target="_blank">${e.supplement??"Supplement"}</calcite-link>`))}</span></calcite-label><calcite-notice scale=s open closable><span slot=message>${I((e.feedbackhelps??"Your feedback will be used to improve Esri products and services. {LearnMore} about how this data is used.").replace("{LearnMore}",`<calcite-link href=${a} target="_blank">${e.learnmore??"Learn more"}</calcite-link>`))}</span></calcite-notice></div><div slot=footer class="feedback-footer"><calcite-button kind=neutral appearance=outline @click=${()=>i(!1)} .disabled=${t.submitting}>${e.cancel??"Cancel"}</calcite-button><calcite-button @click=${n} .disabled=${!t.termsAccepted||t.submitting} .loading=${t.submitting} data-testid=submit-feedback-button>${e.submit??"Submit"}</calcite-button></div></calcite-panel></calcite-sheet>`:null}function de({promptingEnabled:i,messages:e,slot:t,helpTopicUrl:a}){return d`<calcite-block .label=${e.assistantinformation??"Assistant information"} slot=${t??M} expanded class="info-block" scale=s><div class="info-heading-row"><h1 class="info-heading">${e.introducing??"Introducing Arcade Assistant (beta)"}</h1><calcite-chip .label=${e.new??"New"} kind=brand scale=s>${e.new??"New"}</calcite-chip></div>${i?d`<p>${e.capabilities??"The assistant uses artificial intelligence to generate Arcade expressions."}</p><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>${I((e.seedocumentation??"Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}",`<calcite-link href=${a} target="_blank">${e.documentation??"documentation"}</calcite-link>`))}</p>`:d`<p>${e.useofassistant??"The assistant uses artificial intelligence to generate Arcade expressions. To enable Arcade Assistant (beta), the following must be true:"}</p><ul><li>${e.enabledinorg??"AI assistants are enabled in the organization settings"}</li><li>${e.enabledbetaapps??"Beta apps and capabilities are not blocked"}</li><li>${e.enabledroleprivilege??"Your role privilege allows you to use AI assistants"}</li></ul>`}</calcite-block>`}function je({messages:i,onProceed:e,onExit:t,helpTopicUrl:a}){return d`<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((i.pleasereadhelp??"Read the Arcade Assistant (beta) {helpTopic} to get started and learn details on security, privacy and limitations.").replace("{helpTopic}",`<calcite-link href=${a} 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>`}function He({messages:i,suggestions:e,onSuggestionClick:t}){return d`<calcite-block .heading=${i.promptsuggestions} expanded collapsible id=suggestion-block scale=s><div class="suggestions">${e.map(a=>d`<calcite-button round scale=s appearance=outline-fill kind=neutral .label=${i.promptsuggestion} class="suggestion-button" @click=${()=>t?.(a)}>${a}</calcite-button>`)}</div></calcite-block>`}var pe=200;function ue({hidden:i=!1,expanded:e=!1,messages:t,cards:a,heading:o,collapsible:n=!1,showEffectsIcon:r=!1,onCopyCode:p,standalone:c}){return d`<calcite-block .hidden=${i} id=result-block .heading=${o??t.besteffort??"Here is the assistant's best effort"} .expanded=${e} .collapsible=${n}>${r&&d`<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"}>${N(a,s=>s.conversationId,s=>d`<calcite-card><div slot=heading><div class="prior-prompt"><span>${s.priorPrompt.length>pe?`${s.priorPrompt.slice(0,pe)}...`:s.priorPrompt}</span><calcite-action icon=duplicate scale=s slot=actions-end class="copy-prompt-button" text .id=${`copy-prompt-${s.conversationId}-${c?"standalone":"list"}`} @click=${u=>{let l=u.currentTarget;navigator.clipboard.writeText(s.priorPrompt).then(()=>{l.setAttribute("data-copied","true"),setTimeout(()=>l.removeAttribute("data-copied"),1500)})}}></calcite-action><calcite-popover .referenceElement=${`copy-prompt-${s.conversationId}-${c?"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-${s.conversationId}-${c?"standalone":"list"}`} placement=top-start class="copy-tooltip">${t.copyprompttoclipboard??"Copy prompt to clipboard"}</calcite-tooltip></div>${s.message&&c&&d`<div class="response-error-container">${De({errorMessage:s.message})}</div>`||""}</div><div><div class="code-response-wrapper"><div class="positioned-code-content"><calcite-chip-group .label=${t.responsecontext??"Response Context"} scale=s>${s.message&&!c&&d`<calcite-tooltip .referenceElement=${`response-chip-${s.conversationId}-error`} placement=top-start>${s.message}</calcite-tooltip><calcite-chip .id=${`response-chip-${s.conversationId}-error`} .label=${t.error??"Error"} scale=s appearance=outline icon=exclamation-mark-triangle-f class="response-error-chip"></calcite-chip>`||""}${Ge({card:s,messages:t})}</calcite-chip-group></div><details class="collapsible-code" open><summary>Code response</summary><arcgis-code-viewer language=arcade round>${s.code}</arcgis-code-viewer></details></div></div><div slot=footer-start class="feedback-actions"><calcite-button class="add-to-editor-button hidden-above-380" @click=${()=>s.onAddToEditor("add")} scale=s icon-start=plus round .label=${t.addtoeditor??"Add to editor"} .id=${`add-to-editor-button-${s.conversationId}-${c?"standalone":"list"}`}></calcite-button><calcite-tooltip class="hidden-above-380" .referenceElement=${`add-to-editor-button-${s.conversationId}-${c?"standalone":"list"}`} placement=top-start>${t.addtoeditor??"Add to editor"}</calcite-tooltip><calcite-button class="add-to-editor-button hidden-below-380" @click=${()=>s.onAddToEditor("add")} 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=${()=>s.onAddToEditor("replace")} class="response-secondary-action-button" .id=${`replace-${s.conversationId}-${c?"standalone":"list"}`}></calcite-button><calcite-tooltip .referenceElement=${`replace-${s.conversationId}-${c?"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=${u=>{let l=u.currentTarget;p(s.code).then(()=>{l.setAttribute("data-copied","true"),setTimeout(()=>l.removeAttribute("data-copied"),1500)})}} class="response-secondary-action-button" .id=${`copy-response-${s.conversationId}-${c?"standalone":"list"}`}></calcite-button><calcite-popover .referenceElement=${`copy-response-${s.conversationId}-${c?"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-${s.conversationId}-${c?"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=${s.onThumbsUp} .id=${`thumbs-up-${s.conversationId}-${c?"standalone":"list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-up-${s.conversationId}-${c?"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=${s.onThumbsDown} .id=${`thumbs-down-${s.conversationId}-${c?"standalone":"list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-down-${s.conversationId}-${c?"standalone":"list"}`} placement=top-start><span>${t.unhelpful??"Unhelpful"}</span></calcite-tooltip></div></calcite-card>`)}</calcite-card-group></calcite-block>`}var Ge=({card:i,messages:e})=>{let t=H(),a=`response-chip-profile-${i.conversationId}-${t}`,o=(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",i.profileId);return d`<calcite-tooltip .referenceElement=${a} placement=top-start class="contained-popover-or-tooltip">${o}</calcite-tooltip><calcite-chip .label=${i.profileId} scale=s appearance=outline icon=map-information id=${a??M}>${i.profileId}</calcite-chip>`},me=i=>i.type==="featureSet";function we(i){return i&&i!=="dataCatalogDatastore"?i:void 0}var _=i=>{if(!ie(i))return[];let e=[];return i.relationships?.forEach(t=>{e.push(t.toJSON())}),e},D=i=>i.length>0?{relationships:i}:{},Je=i=>oe(i).map(e=>({alias:e.alias,name:e.name,type:e.type,...e.domain?{domain:e.domain}:{}})),U=i=>i?{fields:Je(i)}:{fields:[]};async function he(i){let e=await i.loadSource(),t=F(e)&&e.isTable,a=_(e);return{name:i.name,type:"featureSet",isTable:t,...U(e?.fields),...D(a)}}async function $e(i){switch(i.type){case"feature":{let t=await i.loadSource(),a=_(t);return{name:i.name,type:i.type,...U(t?.fields),...D(a)}}case"featureSet":{let t=await i.loadSource(),a=F(t)&&t.isTable;return{name:i.name,type:"featureSet",...a?{isTable:a}:{},...U(t?.fields),...D(_(t))}}case"featureSetCollection":{let t=await i.loadSource(),a=t?.layers.filter(me)??[],o=t?.tables.filter(me)??[],n=await Promise.all(a.map(he)),r=await Promise.all(o.map(he));return{name:i.name,type:"featureSetCollection",layers:n,tables:r}}case"dictionary":{let t=await Promise.all(i.dictionaryVariables.filter(q).map($e));return{name:i.name,type:"dictionary",attributes:t}}case"pixel":{let t=await i.loadSource();if(!t)return{name:i.name,type:"pixel"};let a=await Ae(t);return{name:i.name,type:"pixel",members:a.map(ge)}}case"voxel":{let t=await i.loadSource();if(!t)return{name:i.name,type:"voxel"};let a=await Te(t);return{name:i.name,type:"voxel",members:a.map(ge)}}case"array":let e=we(i.elementType.type);return{name:i.name,type:"array",...e?{elementType:e}:{}};case"number":case"text":case"boolean":case"date":case"knowledgeGraph":case"dateOnly":case"geometry":case"time":return{name:i.name,type:i.type}}}function ge(i){if(i.type==="array"){let e=we(i.elementType.type);return{name:i.name,type:"array",...e?{elementType:e}:{}}}return{name:i.name,type:i.type}}async function Ye(i){return{variables:await Promise.all(i.variables.filter(q).map($e))}}var We=1e5;function Ke(i){let e=new TextEncoder().encode(i).length;return Math.ceil(e/3.5)}function O(i){return Ke(JSON.stringify(i))}function Xe(i){let e=a=>({name:a.name,type:a.type,...a.isTable?{isTable:a.isTable}:{},...a.relationships?{relationships:a.relationships}:{}}),t=a=>{switch(a.type){case"feature":case"featureSet":case"knowledgeGraph":return{name:a.name,type:a.type,..."isTable"in a&&a.isTable?{isTable:a.isTable}:{},..."relationships"in a?{relationships:a.relationships}:{}};case"featureSetCollection":return{name:a.name,type:"featureSetCollection",layers:a.layers.map(e),tables:a.tables.map(e)};case"dictionary":return{name:a.name,type:"dictionary",attributes:a.attributes.map(t)};case"pixel":case"voxel":return{name:a.name,type:a.type};case"array":return{name:a.name,type:"array",...a.elementType?{elementType:a.elementType}:{}};default:return a}};return{variables:i.variables.map(t)}}function Ze(i){let e=i.variables,t=e.length,a=e.find(n=>n.name==="$feature")??e.find(n=>n.type==="feature")??e[0],o=a?[a]:[];return{context:{variables:o},wasReduced:t!==o.length,reducedToVariableName:a?.name}}function et(i){return O(i)>We}var tt=Object.defineProperty,it=Object.getOwnPropertyDescriptor,g=(i,e,t,a)=>{for(var o=a>1?void 0:a?it(e,t):e,n=i.length-1,r;n>=0;n--)(r=i[n])&&(o=(a?r(e,t,o):r(o))||o);return a&&o&&tt(e,t,o),o},m=class extends Ce{constructor(i){super(i),this.viewMode="prompt",this.confirmationActive=!1,this.contextReducedNoticeDismissed=!1,this.splashActive=!0,this.isSubmitting=!1,this.question="",this.history=[],this.feedback={active:!1}}};g([b()],m.prototype,"viewMode",2);g([b()],m.prototype,"confirmationActive",2);g([b()],m.prototype,"contextReducedNoticeDismissed",2);g([b()],m.prototype,"splashActive",2);g([b()],m.prototype,"isSubmitting",2);g([b()],m.prototype,"errorMessage",2);g([b()],m.prototype,"promptValidationMessage",2);g([b()],m.prototype,"question",2);g([b()],m.prototype,"history",2);g([b()],m.prototype,"feedback",2);g([b()],m.prototype,"context",2);m=g([Ie("ArcadeAssistantViewState")],m);var at="arcade_generation",st="ArcadeCodeRequest",be="visualization",fe="ArcadeAssistant",ot=["your_comments","user_evaluation","question","answer","useragent","_source","version","context","extras","conversation_id","privacy_statement"],ve=[],ye=!0,z=class extends X{constructor(){super(...arguments),this.textAreaRef=W(),this.messages=te(),this._feedbackService=void 0,this.viewState=new m,this.handleFeedbackButton=(e,t)=>{this.updateViewState({feedback:{active:!0,value:e,item:t,termsAccepted:!1,text:"",submitting:!1}})},this.handleFeedbackSheetClose=()=>{this.updateViewState({feedback:{active:!1}})},this.handleFeedbackSubmit=async()=>{if(!this.viewState.feedback.active)return;this.updateViewState({feedback:{...this.viewState.feedback,submitting:!0}});let e=await this.ensureFeedbackService();if(!e){this.handleFeedbackSheetClose();return}let t=!1,a;if(this.viewState.feedback.item.isCurrentResult&&this.viewState.viewMode==="result"){let h=this.viewState.context??await this.getProfileAndMetadata(this.getModel()?.uri??""),S=this.viewState.feedback.item.contextSnapshot;a={...h,editor_code:S?.editor_code??"",diagnostics:S?.diagnostics},t=!0}else a=this.viewState.feedback.item.contextSnapshot;let o=re.applicationName;!o&&!this.appVersion&&w("warn",this,"esriConfig.applicationName is not set. Consider setting it to help identify the application version in feedback.");let{value:n,text:r,termsAccepted:p,item:{question:c,formattedScript:s,conversationId:u}}=this.viewState.feedback,l={user_evaluation:n,your_comments:r||void 0,question:c??"",answer:this.encodeForFeedback(s),useragent:navigator.userAgent,_source:fe,version:this.appVersion||o||"NOT_SET",context:a?JSON.stringify({...a,editor_code:this.encodeForFeedback(a.editor_code),isSnapshot:!t}):"",extras:a?.profileId??"",conversation_id:u??"",privacy_statement:p?"I_agree":""};try{await e.applyEdits({addFeatures:[new ce({attributes:l})]})}catch(h){w("error",this,"Error submitting feedback.",{detail:{error:h}})}this.handleFeedbackSheetClose()},this.handleClose=e=>{this.closed=!0,this.closePanel?.(e)},this.setQuestionState=e=>{this.updateViewState({question:e,promptValidationMessage:void 0})},this.setFeedbackState=e=>{this.updateViewState({feedback:e})},this.onSuggestionClick=e=>{this.textAreaRef.value&&(this.textAreaRef.value.value=e,this.textAreaRef.value.setFocus(),this.setQuestionState(e))},this.helpBase="",this.promptingEnabled=!1,this.closed=!1,this.disableQuestionAnswerLogging=!1}static{this.properties={closePanel:0,insertText:0,helpBase:1,promptingEnabled:5,portalUrl:1,serviceUrl:1,closed:7,editorRef:0,feedbackServiceUrl:1,appVersion:1,diagnostics:0,disableQuestionAnswerLogging:5}}static{this.styles=Me}get disclaimerComment(){return`// ${this.messages.disclaimercomment}
2
+ import{a as N}from"./SWPINDTI.js";import c from"./BBERXRDY.js";import b from"./CPX3K3UL.js";import{c as ae,d as se}from"./J4VBP7HA.js";import a from"./STN3LSQR.js";import{d as oe}from"./MZMKV7FA.js";import{a as te}from"./RQZK3XV2.js";import"./L7OEI4ZV.js";import"./BHSILWSL.js";import"./J4I4EROF.js";import"./BZWB7A55.js";import"./XEK22IDA.js";import"./CMRUQ3BN.js";import"./UFF53OEH.js";import"./NHREAORV.js";import{F as W,G as K,H as X,I as Z,J as M,L as ee,h as Q,j as d,k as j,l as V,t as H,x as G,y as J,z as Y}from"./PM4JFKBG.js";import{a as w}from"./BFPEJYVB.js";import"./DSQ2DQQL.js";import"./H6RQVSYM.js";export default $arcgis.t(([xe,ne,Se,re,ce,{getDeclaredVoxelMembers:Te,getDeclaredPixelMembers:Ae},Ce,{property:b,subclass:Ie},{G:q,w:ie,x:F},,P])=>{var C=class extends Y{constructor(e){if(super(e),this.it=V,e.type!==G.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===V||e==null)return this._t=void 0,this.it=e;if(e===j)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};C.directiveName="unsafeHTML",C.resultType=1;var I=J(C);var Me=Q`:host(:not([closed])){container-type:size;--calcite-block-border-color: var(--calcite-color-transparent);box-sizing:border-box;.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}@container (max-width: 380px){.hidden-below-380{display:none}}@container (min-width: 380px){.hidden-above-380{display:none}}.gaps{display:flex;gap:.25rem}.align-inline-end{margin-inline-start:auto}.context-popover p{padding:0 .5rem;font-size:var(--calcite-font-size-sm)}.feedback-content{padding:var(--calcite-spacing-sm);display:flex;flex-direction:column;max-height:75cqb;overflow-y:auto;>*{margin-block-end:.5rem}>*:last-child,.terms-label{margin-block-end:0}calcite-text-area{--calcite-text-area-min-height: 4rem}calcite-notice{margin-block-start:0}}.feedback-sheet{--calcite-sheet-height: auto;--calcite-sheet-max-height: 100%;--calcite-sheet-min-height: auto}.feedback-footer{display:flex;justify-content:flex-end;gap:.5rem;width:100%}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-dialog{--calcite-dialog-content-space: initial;--calcite-dialog-size-y: initial}calcite-sheet{--calcite-sheet-scrim-background: rgba(200, 200, 200, .5)}calcite-list-item calcite-button{margin-inline-end:.25rem}calcite-flow-item calcite-shell calcite-notice{margin-block:1rem}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;flex-direction:column}calcite-text-area{height:auto;overflow:hidden;--calcite-font-weight-normal: 500;font-weight:500;line-height:1.2}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}.contained-popover-or-tooltip{--calcite-popover-max-size-x: 100%;--calcite-tooltip-max-size-x: 100%}.info-heading{font-size:var(--calcite-font-size-0);color:var(--calcite-color-text-1);margin:0}.info-heading-row{display:flex;align-items:center;gap:var(--calcite-spacing-sm);flex-wrap:wrap}.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)}.suggestions{display:flex;flex-direction:row;gap:var(--calcite-spacing-xs);flex-wrap:wrap}.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=heading] 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}.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)}.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}.contained{max-width:100%;max-height:100%;max-width:100cqi;max-height:75cqb;overflow-y:auto}.submission-notice{--calcite-notice-border-color: transparent;margin-block:0;width:100%;--calcite-font-size-relative-base: var(--calcite-font-size--2)}.border-block-end{border-block-end:1px solid var(--calcite-color-border-3)}.round-top{border-radius:var(--calcite-corner-radius-round) var(--calcite-corner-radius-round) 0 0}}:host([closed]){display:none}`,$=class extends Error{constructor({message:e,code:t,subCode:a,details:o,source:n}){super(e),this.name="ArcadeAssistantError",this.code=t,this.subCode=a,this.details=o,this.source=n}};function le(i){if(!i)return;let e=i.indexOf('{"error":');if(e!==-1)try{let t=i.slice(e),a=JSON.parse(t);if(a&&typeof a=="object"&&a.error)return a.error}catch{return}}async function Ee(i){let{baseUrl:e,skillId:t,message:a,authToken:o,previousConversationId:n,context:r}=i,p=t?`${e}/skills/${t}/chat`:`${e}/chat`,c=[],s={message:a,context:r};n&&(s.conversation_id=n);let u;try{u=await ne(p,{method:"post",headers:{"Content-Type":"application/json",token:o},body:JSON.stringify(s),responseType:"json"})}catch(f){let v=f,x=v.details?.rawResponse||v.message||String(f),T=le(x);throw T?new $(T):f}let l=u.data;c.push(l);let h=l.conversationId,S=l.inquiryId,k=l.sequenceNumber;async function E(){let f=0,v=100;for(;f<v;){await new Promise(A=>setTimeout(A,1e3));let x=Re(h,k,S),T;try{T=await ne(p,{method:"post",headers:{"Content-Type":"application/json",token:o},body:JSON.stringify(x),responseType:"json"})}catch(A){let L=A,ke=L.details?.rawResponse||L.message||String(A),B=le(ke);throw B?new $(B):A}let y=T.data;if(y.context?.kind==="ArcgisErrorAsContext"&&y.context.error)throw new $({message:y.context.error.message||"ArcGIS Assistant error",code:y.context.error.code,subCode:y.context.error.subCode,details:y.context.error.details,source:"polling-response"});if(c.push(y),k=y.sequenceNumber,f++,!y.hasMore)break}if(f===v)throw new $({message:"Request timed out",code:"TIMEOUT",source:"polling"})}let R=120*1e3;return await Promise.race([E(),new Promise((f,v)=>setTimeout(()=>v(new $({message:"Request timed out",code:"TIMEOUT",source:"hard-timeout"})),R))]),c}function Re(i,e,t){return{conversationId:i,inquiryId:t,ackSequenceNumber:e}}function Ve(i){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"?"Request timed out. Try again by re-asking the same question or rephrasing it.":i.message}var Fe=({notices:i})=>i.length?d`<div class="border-block-end">${N(i,e=>e.id??e.title,e=>d`<calcite-notice class="submission-notice" .icon=${e.icon} .kind=${e.kind} scale=s open .closable=${e.closable} @calciteNoticeClose=${()=>e.onClose?.()}><div slot=title>${e.title}</div>${e.message&&d`<div slot=message>${e.message}</div>`||""}${e.actionLinkMessage&&e.onAction&&d`<calcite-link slot=link @click=${()=>e.onAction?.()}>${e.actionLinkMessage}</calcite-link>`||""}</calcite-notice>`)}</div>`:null,qe=i=>{let e=i.value.length,t=72,a=180,o=i.offsetWidth,n=Math.max(1,Math.floor(o/8)),r=Math.ceil(e/n),p=t+(r-2)*24;i.style.setProperty("--calcite-text-area-min-height",`${Math.min(p,a)}px`)},Pe=({promptValidationMessage:i,errorMessage:e,contextTooBig:t,contextReducedNoticeDismissed:a,setContextReducedNoticeDismissed:o,setErrorMessage:n,messages:r})=>{let p=[];if(i&&p.push({id:"prompt-validation",kind:"danger",icon:"exclamation-mark-triangle",title:i,closable:!0}),e&&p.push({id:"assistant-error",kind:"danger",icon:"exclamation-mark-triangle",title:e,closable:!0,onClose:()=>n(void 0)}),t&&!a){let c=r.contextreduced??"Context reduced",s=r.contextreducedmessage??"The editor profile is too large for the assistant. It has been reduced in the assistant in order to ensure a successful request.";p.push({id:"context-reduced",kind:"warning",icon:"exclamation-mark-triangle",title:c,message:s,closable:!0,onClose:()=>o(!0)})}return p};function Ne({messages:i}){return d`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${i.beta??"Beta"}>${i.beta??"Beta"}</calcite-chip>`}function _e({popoverContent:i,messages:e}){return d`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-popover reference-element=legal-disclaimer .label=${e.legaldisclaimer??"Legal disclaimer"} placement=bottom auto-close focus-trap-disabled><div class="contained">${i}</div></calcite-popover>`}function De({errorMessage:i,slot:e}){return d`<div class="error-display"><calcite-input-message id=error-message status=invalid icon=exclamation-mark-triangle scale=m slot=${e??M}>${i}</calcite-input-message></div>`}function Ue({active:i,setActive:e,messages:t}){return d`<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>`}function Oe({context:i,messages:e}){return i?d`<div class="gaps">${i.profileId&&d`<calcite-popover auto-close placement=top .label=${(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",i.profileId)} reference-element=profile-context-button class="context-popover contained-popover-or-tooltip"><p>${(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",i.profileId)}</p></calcite-popover><calcite-button round kind=neutral icon-start=map-information id=profile-context-button scale=s></calcite-button>`||""}</div>`:null}function ze({isDisabled:i,isReadOnly:e,setQuestion:t,setIsViewingResult:a,textAreaRef:o,question:n,errorMessage:r,setErrorMessage:p,promptValidationMessage:c,setPromptValidationMessage:s,submitQuestion:u,messages:l,mode:h,assistantRef:S,context:k,contextReducedNoticeDismissed:E,setContextReducedNoticeDismissed:R}){let f=k?.contextTooLarge??!1,v=Pe({promptValidationMessage:c,errorMessage:r,contextTooBig:f,contextReducedNoticeDismissed:E,setContextReducedNoticeDismissed:R,setErrorMessage:p,messages:l});return d`<div class="text-area-wrapper">${Fe({notices:v})}<calcite-text-area scale=s resize=vertical .readOnly=${i||e} class=${Z(v.length?"submission-text-area":"submission-text-area round-top")} .placeholder=${l.askaquestion??`Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${n} @calciteTextAreaInput=${x=>{qe(x.target),t(x.target.value)}} ${K(o)}><div class="submission-actions-wrapper" slot=footer-start><div class="submission-actions">${k&&Oe({context:k,messages:l})||""}<div class="align-inline-end gaps"><calcite-button round kind=neutral .hidden=${h!=="refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid scale=s .disabled=${i} @click=${async()=>{a(!1),t("")}} .label=${l.startover??"Start Over"} class="hidden-above-380" id=small-start-over-button></calcite-button><calcite-tooltip reference-element=small-start-over-button placement=top-start class="hidden-above-380">${l.startover??"Start Over"}</calcite-tooltip><calcite-button round kind=neutral .hidden=${h!=="refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${i} @click=${async()=>{a(!1),t("")}} class="hidden-below-380" scale=s>${l.startover??"Start Over"}</calcite-button><calcite-button round scale=s icon-end=effects appearance=solid .loading=${i} .disabled=${i} @click=${async()=>{if(p(""),!n){s(l.enteraprompt??"Please enter a prompt");return}s(void 0),await u()}} class="hidden-below-380">${h==="prompt"?l.ask??"Generate":l.refine??"Refine"}</calcite-button><calcite-button round scale=s icon-end=effects appearance=solid .loading=${i} .disabled=${i} id=small-submit-button @click=${async()=>{if(p(""),!n){s(l.enteraprompt??"Please enter a prompt");return}s(void 0),await u()}} class="hidden-above-380" .label=${h==="prompt"?l.ask??"Generate":l.refine??"Refine"}></calcite-button><calcite-tooltip reference-element=small-submit-button placement=top-start class="hidden-above-380">${h==="prompt"?l.ask??"Generate":l.refine??"Refine"}</calcite-tooltip></div></div></div></calcite-text-area></div>`}var Le="https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement",Be="https://www.esri.com/en-us/privacy/privacy-statements";function Qe({setOpen:i,messages:e,feedback:t,learnMoreUrl:a,setFeedback:o,onSubmit:n}){return t.active?d`<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.submitfeedback??"Submit feedback to Esri"} scale=s><div class="feedback-content"><calcite-text-area scale=s resize=vertical .value=${t.text} @calciteTextAreaInput=${r=>o({...t,text:r.target.value})} .disabled=${t.submitting} .placeholder=${e.donotincludepersonalinfo??"Do not include personal or sensitive information"} rows=3></calcite-text-area><calcite-label layout=inline scale=s class="terms-label"><calcite-checkbox scale=l .checked=${t.termsAccepted} @calciteCheckboxChange=${r=>{o({...t,termsAccepted:r.target.checked})}} .disabled=${t.submitting}></calcite-checkbox><span>${I((e.agreement??"I agree to the {EsriPrivacyStatement} (and {Supplement}).").replace("{EsriPrivacyStatement}",`<calcite-link href=${Be} target="_blank">${e.esriprivacystatement??"Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}",`<calcite-link href=${Le} target="_blank">${e.supplement??"Supplement"}</calcite-link>`))}</span></calcite-label><calcite-notice scale=s open closable><span slot=message>${I((e.feedbackhelps??"Your feedback will be used to improve Esri products and services. {LearnMore} about how this data is used.").replace("{LearnMore}",`<calcite-link href=${a} target="_blank">${e.learnmore??"Learn more"}</calcite-link>`))}</span></calcite-notice></div><div slot=footer class="feedback-footer"><calcite-button kind=neutral appearance=outline @click=${()=>i(!1)} .disabled=${t.submitting}>${e.cancel??"Cancel"}</calcite-button><calcite-button @click=${n} .disabled=${!t.termsAccepted||t.submitting} .loading=${t.submitting} data-testid=submit-feedback-button>${e.submit??"Submit"}</calcite-button></div></calcite-panel></calcite-sheet>`:null}function de({promptingEnabled:i,messages:e,slot:t,helpTopicUrl:a}){return d`<calcite-block .label=${e.assistantinformation??"Assistant information"} slot=${t??M} expanded class="info-block" scale=s><div class="info-heading-row"><h1 class="info-heading">${e.introducing??"Introducing Arcade Assistant (beta)"}</h1><calcite-chip .label=${e.new??"New"} kind=brand scale=s>${e.new??"New"}</calcite-chip></div>${i?d`<p>${e.capabilities??"The assistant uses artificial intelligence to generate Arcade expressions."}</p><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>${I((e.seedocumentation??"Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}",`<calcite-link href=${a} target="_blank">${e.documentation??"documentation"}</calcite-link>`))}</p>`:d`<p>${e.useofassistant??"The assistant uses artificial intelligence to generate Arcade expressions. To enable Arcade Assistant (beta), the following must be true:"}</p><ul><li>${e.enabledinorg??"AI assistants are enabled in the organization settings"}</li><li>${e.enabledbetaapps??"Beta apps and capabilities are not blocked"}</li><li>${e.enabledroleprivilege??"Your role privilege allows you to use AI assistants"}</li></ul>`}</calcite-block>`}function je({messages:i,onProceed:e,onExit:t,helpTopicUrl:a}){return d`<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((i.pleasereadhelp??"Read the Arcade Assistant (beta) {helpTopic} to get started and learn details on security, privacy and limitations.").replace("{helpTopic}",`<calcite-link href=${a} 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>`}function He({messages:i,suggestions:e,onSuggestionClick:t}){return d`<calcite-block .heading=${i.promptsuggestions} expanded collapsible id=suggestion-block scale=s><div class="suggestions">${e.map(a=>d`<calcite-button round scale=s appearance=outline-fill kind=neutral .label=${i.promptsuggestion} class="suggestion-button" @click=${()=>t?.(a)}>${a}</calcite-button>`)}</div></calcite-block>`}var pe=200;function ue({hidden:i=!1,expanded:e=!1,messages:t,cards:a,heading:o,collapsible:n=!1,showEffectsIcon:r=!1,onCopyCode:p,standalone:c}){return d`<calcite-block .hidden=${i} id=result-block .heading=${o??t.besteffort??"Here is the assistant's best effort"} .expanded=${e} .collapsible=${n}>${r&&d`<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"}>${N(a,s=>s.conversationId,s=>d`<calcite-card><div slot=heading><div class="prior-prompt"><span>${s.priorPrompt.length>pe?`${s.priorPrompt.slice(0,pe)}...`:s.priorPrompt}</span><calcite-action icon=duplicate scale=s slot=actions-end class="copy-prompt-button" text .id=${`copy-prompt-${s.conversationId}-${c?"standalone":"list"}`} @click=${u=>{let l=u.currentTarget;navigator.clipboard.writeText(s.priorPrompt).then(()=>{l.setAttribute("data-copied","true"),setTimeout(()=>l.removeAttribute("data-copied"),1500)})}}></calcite-action><calcite-popover .referenceElement=${`copy-prompt-${s.conversationId}-${c?"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-${s.conversationId}-${c?"standalone":"list"}`} placement=top-start class="copy-tooltip">${t.copyprompttoclipboard??"Copy prompt to clipboard"}</calcite-tooltip></div>${s.message&&c&&d`<div class="response-error-container">${De({errorMessage:s.message})}</div>`||""}</div><div><div class="code-response-wrapper"><div class="positioned-code-content"><calcite-chip-group .label=${t.responsecontext??"Response Context"} scale=s>${s.message&&!c&&d`<calcite-tooltip .referenceElement=${`response-chip-${s.conversationId}-error`} placement=top-start>${s.message}</calcite-tooltip><calcite-chip .id=${`response-chip-${s.conversationId}-error`} .label=${t.error??"Error"} scale=s appearance=outline icon=exclamation-mark-triangle-f class="response-error-chip"></calcite-chip>`||""}${Ge({card:s,messages:t})}</calcite-chip-group></div><details class="collapsible-code" open><summary>Code response</summary><arcgis-code-viewer language=arcade round>${s.code}</arcgis-code-viewer></details></div></div><div slot=footer-start class="feedback-actions"><calcite-button class="add-to-editor-button hidden-above-380" @click=${()=>s.onAddToEditor("add")} scale=s icon-start=plus round .label=${t.addtoeditor??"Add to editor"} .id=${`add-to-editor-button-${s.conversationId}-${c?"standalone":"list"}`}></calcite-button><calcite-tooltip class="hidden-above-380" .referenceElement=${`add-to-editor-button-${s.conversationId}-${c?"standalone":"list"}`} placement=top-start>${t.addtoeditor??"Add to editor"}</calcite-tooltip><calcite-button class="add-to-editor-button hidden-below-380" @click=${()=>s.onAddToEditor("add")} 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=${()=>s.onAddToEditor("replace")} class="response-secondary-action-button" .id=${`replace-${s.conversationId}-${c?"standalone":"list"}`}></calcite-button><calcite-tooltip .referenceElement=${`replace-${s.conversationId}-${c?"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=${u=>{let l=u.currentTarget;p(s.code).then(()=>{l.setAttribute("data-copied","true"),setTimeout(()=>l.removeAttribute("data-copied"),1500)})}} class="response-secondary-action-button" .id=${`copy-response-${s.conversationId}-${c?"standalone":"list"}`}></calcite-button><calcite-popover .referenceElement=${`copy-response-${s.conversationId}-${c?"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-${s.conversationId}-${c?"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=${s.onThumbsUp} .id=${`thumbs-up-${s.conversationId}-${c?"standalone":"list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-up-${s.conversationId}-${c?"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=${s.onThumbsDown} .id=${`thumbs-down-${s.conversationId}-${c?"standalone":"list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-down-${s.conversationId}-${c?"standalone":"list"}`} placement=top-start><span>${t.unhelpful??"Unhelpful"}</span></calcite-tooltip></div></calcite-card>`)}</calcite-card-group></calcite-block>`}var Ge=({card:i,messages:e})=>{let t=H(),a=`response-chip-profile-${i.conversationId}-${t}`,o=(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",i.profileId);return d`<calcite-tooltip .referenceElement=${a} placement=top-start class="contained-popover-or-tooltip">${o}</calcite-tooltip><calcite-chip .label=${i.profileId} scale=s appearance=outline icon=map-information id=${a??M}>${i.profileId}</calcite-chip>`},me=i=>i.type==="featureSet";function we(i){return i&&i!=="dataCatalogDatastore"?i:void 0}var _=i=>{if(!ie(i))return[];let e=[];return i.relationships?.forEach(t=>{e.push(t.toJSON())}),e},D=i=>i.length>0?{relationships:i}:{},Je=i=>oe(i).map(e=>({alias:e.alias,name:e.name,type:e.type,...e.domain?{domain:e.domain}:{}})),U=i=>i?{fields:Je(i)}:{fields:[]};async function he(i){let e=await i.loadSource(),t=F(e)&&e.isTable,a=_(e);return{name:i.name,type:"featureSet",isTable:t,...U(e?.fields),...D(a)}}async function $e(i){switch(i.type){case"feature":{let t=await i.loadSource(),a=_(t);return{name:i.name,type:i.type,...U(t?.fields),...D(a)}}case"featureSet":{let t=await i.loadSource(),a=F(t)&&t.isTable;return{name:i.name,type:"featureSet",...a?{isTable:a}:{},...U(t?.fields),...D(_(t))}}case"featureSetCollection":{let t=await i.loadSource(),a=t?.layers.filter(me)??[],o=t?.tables.filter(me)??[],n=await Promise.all(a.map(he)),r=await Promise.all(o.map(he));return{name:i.name,type:"featureSetCollection",layers:n,tables:r}}case"dictionary":{let t=await Promise.all(i.dictionaryVariables.filter(q).map($e));return{name:i.name,type:"dictionary",attributes:t}}case"pixel":{let t=await i.loadSource();if(!t)return{name:i.name,type:"pixel"};let a=await Ae(t);return{name:i.name,type:"pixel",members:a.map(ge)}}case"voxel":{let t=await i.loadSource();if(!t)return{name:i.name,type:"voxel"};let a=await Te(t);return{name:i.name,type:"voxel",members:a.map(ge)}}case"array":let e=we(i.elementType.type);return{name:i.name,type:"array",...e?{elementType:e}:{}};case"number":case"text":case"boolean":case"date":case"knowledgeGraph":case"dateOnly":case"geometry":case"time":return{name:i.name,type:i.type}}}function ge(i){if(i.type==="array"){let e=we(i.elementType.type);return{name:i.name,type:"array",...e?{elementType:e}:{}}}return{name:i.name,type:i.type}}async function Ye(i){return{variables:await Promise.all(i.variables.filter(q).map($e))}}var We=1e5;function Ke(i){let e=new TextEncoder().encode(i).length;return Math.ceil(e/3.5)}function O(i){return Ke(JSON.stringify(i))}function Xe(i){let e=a=>({name:a.name,type:a.type,...a.isTable?{isTable:a.isTable}:{},...a.relationships?{relationships:a.relationships}:{}}),t=a=>{switch(a.type){case"feature":case"featureSet":case"knowledgeGraph":return{name:a.name,type:a.type,..."isTable"in a&&a.isTable?{isTable:a.isTable}:{},..."relationships"in a?{relationships:a.relationships}:{}};case"featureSetCollection":return{name:a.name,type:"featureSetCollection",layers:a.layers.map(e),tables:a.tables.map(e)};case"dictionary":return{name:a.name,type:"dictionary",attributes:a.attributes.map(t)};case"pixel":case"voxel":return{name:a.name,type:a.type};case"array":return{name:a.name,type:"array",...a.elementType?{elementType:a.elementType}:{}};default:return a}};return{variables:i.variables.map(t)}}function Ze(i){let e=i.variables,t=e.length,a=e.find(n=>n.name==="$feature")??e.find(n=>n.type==="feature")??e[0],o=a?[a]:[];return{context:{variables:o},wasReduced:t!==o.length,reducedToVariableName:a?.name}}function et(i){return O(i)>We}var tt=Object.defineProperty,it=Object.getOwnPropertyDescriptor,g=(i,e,t,a)=>{for(var o=a>1?void 0:a?it(e,t):e,n=i.length-1,r;n>=0;n--)(r=i[n])&&(o=(a?r(e,t,o):r(o))||o);return a&&o&&tt(e,t,o),o},m=class extends Ce{constructor(i){super(i),this.viewMode="prompt",this.confirmationActive=!1,this.contextReducedNoticeDismissed=!1,this.splashActive=!0,this.isSubmitting=!1,this.question="",this.history=[],this.feedback={active:!1}}};g([b()],m.prototype,"viewMode",2);g([b()],m.prototype,"confirmationActive",2);g([b()],m.prototype,"contextReducedNoticeDismissed",2);g([b()],m.prototype,"splashActive",2);g([b()],m.prototype,"isSubmitting",2);g([b()],m.prototype,"errorMessage",2);g([b()],m.prototype,"promptValidationMessage",2);g([b()],m.prototype,"question",2);g([b()],m.prototype,"history",2);g([b()],m.prototype,"feedback",2);g([b()],m.prototype,"context",2);m=g([Ie("ArcadeAssistantViewState")],m);var at="arcade_generation",st="ArcadeCodeRequest",be="visualization",fe="ArcadeAssistant",ot=["your_comments","user_evaluation","question","answer","useragent","_source","version","context","extras","conversation_id","privacy_statement"],ve=[],ye=!0,z=class extends X{constructor(){super(...arguments),this.textAreaRef=W(),this.messages=te(),this._feedbackService=void 0,this.viewState=new m,this.handleFeedbackButton=(e,t)=>{this.updateViewState({feedback:{active:!0,value:e,item:t,termsAccepted:!1,text:"",submitting:!1}})},this.handleFeedbackSheetClose=()=>{this.updateViewState({feedback:{active:!1}})},this.handleFeedbackSubmit=async()=>{if(!this.viewState.feedback.active)return;this.updateViewState({feedback:{...this.viewState.feedback,submitting:!0}});let e=await this.ensureFeedbackService();if(!e){this.handleFeedbackSheetClose();return}let t=!1,a;if(this.viewState.feedback.item.isCurrentResult&&this.viewState.viewMode==="result"){let h=this.viewState.context??await this.getProfileAndMetadata(this.getModel()?.uri??""),S=this.viewState.feedback.item.contextSnapshot;a={...h,editor_code:S?.editor_code??"",diagnostics:S?.diagnostics},t=!0}else a=this.viewState.feedback.item.contextSnapshot;let o=re.applicationName;!o&&!this.appVersion&&w("warn",this,"esriConfig.applicationName is not set. Consider setting it to help identify the application version in feedback.");let{value:n,text:r,termsAccepted:p,item:{question:c,formattedScript:s,conversationId:u}}=this.viewState.feedback,l={user_evaluation:n,your_comments:r||void 0,question:c??"",answer:this.encodeForFeedback(s),useragent:navigator.userAgent,_source:fe,version:this.appVersion||o||"NOT_SET",context:a?JSON.stringify({...a,editor_code:this.encodeForFeedback(a.editor_code),isSnapshot:!t}):"",extras:a?.profileId??"",conversation_id:u??"",privacy_statement:p?"I_agree":""};try{await e.applyEdits({addFeatures:[new ce({attributes:l})]})}catch(h){w("error",this,"Error submitting feedback.",{detail:{error:h}})}this.handleFeedbackSheetClose()},this.handleClose=e=>{this.closed=!0,this.closePanel?.(e)},this.setQuestionState=e=>{this.updateViewState({question:e,promptValidationMessage:void 0})},this.setFeedbackState=e=>{this.updateViewState({feedback:e})},this.onSuggestionClick=e=>{this.textAreaRef.value&&(this.textAreaRef.value.value=e,this.textAreaRef.value.setFocus(),this.setQuestionState(e))},this.helpBase="",this.promptingEnabled=!1,this.closed=!1,this.disableQuestionAnswerLogging=!1}static{this.properties={closePanel:0,insertText:0,helpBase:1,promptingEnabled:5,portalUrl:1,serviceUrl:1,closed:7,editorRef:0,feedbackServiceUrl:1,appVersion:1,diagnostics:0,disableQuestionAnswerLogging:5}}static{this.styles=Me}get disclaimerComment(){return`// ${this.messages.disclaimercomment}
3
3
  // ${this.messages.disclaimerpt2??"AI-generated content may be inaccurate. Review before using."}`}get assistantOverviewDocUrl(){return`${this.helpBase??"https://doc.arcgis.com/en/arcgis-online/"}create-maps/understand-arcade-assistant.htm`}get usingTheAssitantDocUrl(){return`${this.helpBase??"https://doc.arcgis.com/en/arcgis-online/"}create-maps/understand-arcade-assistant.htm`}async openPrompt(e){if(this.closed=!1,!this.promptingEnabled)return;e&&this.updateViewState({question:e,viewMode:"prompt"});let t=this.textAreaRef.value;t&&t.setFocus()}async destroy(){}connectedCallback(){super.connectedCallback(),this.updateViewState({history:ve,splashActive:ye})}loaded(){let e=async()=>{let t=this.getModel();if(!t){this.updateViewState({context:void 0});return}let a=await this.getProfileAndMetadata(t.uri);this.updateViewState({context:a,contextReducedNoticeDismissed:a.contextTooLarge?!1:this.viewState.contextReducedNoticeDismissed})};this.manager.onLifecycle(()=>{e();let t=P.onModelContextDidChange(async()=>{e().catch(a=>{w("error",this,"Error setting context.",{detail:{error:a}})})});return{remove:()=>{t.dispose()}}})}disconnectedCallback(){super.disconnectedCallback(),ve=this.viewState.history,ye=this.viewState.splashActive,this.copySuccessTimer&&(clearTimeout(this.copySuccessTimer),this.copySuccessTimer=void 0)}createFeedbackContextSnapshot(e){let t=Xe(e.metadata);return{...e,metadata:t,estimatedTokens:O(t)}}withEditorState(e,t){return{...e,editor_code:t?.getValue()??this.getModel()?.getValue()??"",diagnostics:this.diagnostics}}encodeForFeedback(e){return encodeURIComponent(e??"")}updateViewState(e){this.viewState.set(e)}getHistoryCards(){return this.viewState.history.reduce((e,t)=>(!t.script||(e.push({priorPrompt:t.question,code:t.formattedScript||t.error||"",profileId:t.profile??be,onAddToEditor:a=>{ae(this.editorRef.editorInstance,t.formattedScript??"",a,this.disclaimerComment)},onThumbsUp:()=>this.handleFeedbackButton("good",t),onThumbsDown:()=>this.handleFeedbackButton("bad",t),conversationId:t.conversationId??"",message:t.message}),this.viewState.viewMode),e),[])}async ensureFeedbackService(){if(this._feedbackService)return this._feedbackService;if(!this.feedbackServiceUrl)return;let e=new Se({url:this.feedbackServiceUrl});await e.load();let t=ot.filter(a=>!e.fields.some(o=>o.name===a));if(t.length>0){w("error",this,`Missing the following fields in feedback service: ${t.join(", ")}. Feedback will not be logged.`);return}return this._feedbackService=e,e}async logInteractionToFeedbackService(e){if(this.disableQuestionAnswerLogging||!e.question)return;let t;try{t=await this.ensureFeedbackService()}catch(r){w("error",this,"Error initializing feedback service for interaction logging.",{detail:{error:r}});return}if(!t)return;let a=re.applicationName,o=e.contextSnapshot,n={question:e.question,answer:this.encodeForFeedback(e.answer),useragent:navigator.userAgent,_source:fe,version:this.appVersion||a||"NOT_SET",context:o?JSON.stringify({...o,isSnapshot:!0}):"",extras:o?.profileId??"",conversation_id:e.conversationId??"",privacy_statement:""};try{await t.applyEdits({addFeatures:[new ce({attributes:n})]})}catch(r){w("error",this,"Error logging arcade assistant question/answer interaction.",{detail:{error:r}})}}getModel(){return this.editorRef.editorInstance?.getModel()}async submitQuestion(){if(!this.viewState.question)return;let e=this.viewState.question;this.updateViewState({isSubmitting:!0,errorMessage:void 0});let t,a;try{let o=this.getModel();if(!o||!this.serviceUrl)return;let n=this.viewState.context??await this.getProfileAndMetadata(o.uri),r=this.withEditorState(n,o);t=this.createFeedbackContextSnapshot(r);let p=await this.getToken(),c=await Ee({baseUrl:this.serviceUrl,skillId:at,message:e,authToken:p,context:{kind:st,context:{profile_id:r.profileId,metadata:[r.metadata],editor_code:r.editor_code,...r.diagnostics?.length?{diagnostics:r.diagnostics}:{}}}});a=c?.[0]?.conversationId;let s=c.find(u=>u.context?.kind==="ArcadeCodeResponse");if(!s){await this.logInteractionToFeedbackService({question:e,answer:"No ArcadeCodeResponse returned.",contextSnapshot:t,conversationId:a});return}if(s.context?.kind==="ArcadeCodeResponse"){let u=this.createFeedbackContextSnapshot(r),l=se(s?.context?.arcadeCode?.code??"");this.updateViewState({history:[{script:s?.context?.arcadeCode?.code,formattedScript:l,error:void 0,question:e,profile:n.profileId,conversationId:s.conversationId,isCurrentResult:!0,contextSnapshot:u,...s.message?{message:s.message}:{}},...this.viewState.history.map(h=>({...h,isCurrentResult:!1}))],viewMode:"result",errorMessage:void 0}),await this.logInteractionToFeedbackService({question:e,answer:l,contextSnapshot:t,conversationId:s.conversationId})}}catch(o){let n=o instanceof Error&&o.name==="ArcadeAssistantError"?Ve(o)||this.messages.erroroccurred||"An error occurred.":this.messages.erroroccurred||"An error occurred.";this.updateViewState({errorMessage:n}),await this.logInteractionToFeedbackService({question:e,answer:n,contextSnapshot:t,conversationId:a}),w("error",this,"Error submitting question",{detail:{error:o}})}finally{this.updateViewState({isSubmitting:!1})}}async getToken(){let{token:e}=await xe.getCredential(this.portalUrl);return e}async getProfileAndMetadata(e){let t=be,a=P.getEditorProfileForModel(e);a?.loaded||await a?.loadSource();let o=this.editorRef.profile;o&&"id"in o&&(t=o.id);let n=a?await Ye(a):{variables:[]},r=et(n),p=r?Ze(n):void 0,c=p?p.context:n,s=O(c);return{profileId:t,metadata:c,contextTooLarge:r,reducedToVariableName:p?.reducedToVariableName,estimatedTokens:s}}onCopyCode(e){let t=e?`${this.disclaimerComment}
4
4
  ${e}`:"";return navigator.clipboard.writeText(t)}render(){if(this.closed)return null;let e=this.viewState.viewMode==="result",t=this.getHistoryCards();return this.promptingEnabled?d`<calcite-flow><calcite-flow-item closable heading-level=2 .heading=${this.messages.arcadeassistant??"Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.viewState.splashActive&&d`<calcite-scrim></calcite-scrim>`||""}${Ne({messages:this.messages})}${_e({messages:this.messages,popoverContent:de({promptingEnabled:this.promptingEnabled,messages:this.messages,helpTopicUrl:this.usingTheAssitantDocUrl})})}<calcite-shell class="unstyled-shell">${this.viewState.splashActive&&je({messages:this.messages,onProceed:()=>{this.updateViewState({splashActive:!1})},helpTopicUrl:this.assistantOverviewDocUrl,onExit:a=>this.closePanel?.(a)})||""}${Ue({active:this.viewState.confirmationActive,setActive:a=>this.updateViewState({confirmationActive:a}),messages:this.messages})}${ze({isDisabled:this.viewState.isSubmitting,isReadOnly:!1,setQuestion:this.setQuestionState,setIsViewingResult:a=>this.updateViewState({viewMode:a?"result":"prompt"}),mode:e?"refine":"prompt",textAreaRef:this.textAreaRef,question:this.viewState.question,errorMessage:this.viewState.errorMessage,setErrorMessage:a=>this.updateViewState({errorMessage:a}),promptValidationMessage:this.viewState.promptValidationMessage,setPromptValidationMessage:a=>this.updateViewState({promptValidationMessage:a}),submitQuestion:this.submitQuestion.bind(this),assistantRef:this.el,messages:this.messages,context:this.viewState.context,contextReducedNoticeDismissed:this.viewState.contextReducedNoticeDismissed,setContextReducedNoticeDismissed:a=>this.updateViewState({contextReducedNoticeDismissed:a})})}<calcite-block-group .label=${this.messages.interactiveblocks??"interactive blocks"}>${!e&&!this.viewState.isSubmitting&&He({messages:this.messages,suggestions:[this.messages.prompsuggestion1??"",this.messages.prompsuggestion2??""],onSuggestionClick:this.onSuggestionClick})||""}<calcite-block .hidden=${!this.viewState.isSubmitting} .heading=${this.messages.generatingresponse??"Generating response..."}></calcite-block>${ue({expanded:e,messages:this.messages,collapsible:!0,showEffectsIcon:!0,cards:t.length?[t[0]]:[],heading:this.messages.besteffort??"Here's the assistant's best effort",hidden:this.viewState.isSubmitting||!e,onCopyCode:this.onCopyCode.bind(this),standalone:!0})}${ue({expanded:!e,messages:this.messages,collapsible:!0,cards:e?t.slice(1):t,heading:this.messages.recentprompts??"Recent prompts",hidden:this.viewState.isSubmitting||this.viewState.history.length===0,onCopyCode:this.onCopyCode.bind(this)})}</calcite-block-group>${this.viewState.feedback.active?Qe({setOpen:this.handleFeedbackSheetClose,messages:this.messages,onSubmit:this.handleFeedbackSubmit,feedback:this.viewState.feedback,setFeedback:this.setFeedbackState,learnMoreUrl:this.assistantOverviewDocUrl}):null}</calcite-shell></calcite-flow-item></calcite-flow>`:d`<calcite-flow><calcite-flow-item .selected=${!e} closable heading-level=2 .heading=${this.messages.arcadeassistant??"Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${de({slot:"content-top",messages:this.messages,promptingEnabled:this.promptingEnabled,helpTopicUrl:this.usingTheAssitantDocUrl})}</calcite-flow-item></calcite-flow>`}};ee("arcgis-arcade-coding-assistant",z);return z},"identity/IdentityManager","request","layers/FeatureLayer","config","Graphic","applications/Components/arcadeEditorUtils","core/Accessor","core/accessorSupport/decorators",a,b,c)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as n}from"./4L2GLNTS.js";import{a as g}from"./SKBHZ7VS.js";import{a as f}from"./OLMW3NCS.js";import"./SSVSZDRA.js";import{e as p,f as u}from"./BHSILWSL.js";import"./J4I4EROF.js";import"./BZWB7A55.js";import{G as a,H as m,L as h,h as d,j as l,n as c,s as o}from"./A77A54OM.js";import"./BFPEJYVB.js";import"./H6RQVSYM.js";var b=d`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}.container{block-size:100%;display:grid;grid-template-rows:auto 1fr;overflow:hidden}.scrollable{min-block-size:0;overflow:auto}}`,r=class extends m{constructor(){super(...arguments),this.messages=f(),this._unselectItem=async()=>{this._selectedApiItem=void 0},this._filterValue="",this.languageId="arcade",this.hideDocumentationActions=!1,this.loading=!1,this.closed=!1,this.arcgisInternalClosePanel=c({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=c({bubbles:!1,composed:!1})}static{this.properties={_filterValue:16,_selectedApiItem:16,languageId:1,apiLibrary:0,hideDocumentationActions:5,loading:5,closed:5}}static{this.styles=b}willUpdate(e){if(e.has("apiLibrary")){if(!this._selectedApiItem)return;for(let i of this.apiLibrary??[])for(let t of i.items)if(t.name===this._selectedApiItem.name){this._selectedApiItem=t;return}this._selectedApiItem=void 0}}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{u(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_emitItemSelected(e,i){if(!i)return;let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(i.completion.insertText??""))}_emitClose(){this.arcgisInternalClosePanel.emit()}_emitItemSelectedAndClose(e,i){let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(i.completion.insertText??""))}_selectItem(e,i){e.stopPropagation(),this._selectedApiItem=i}_updateFilterValue(e){this._filterValue=e.currentTarget.value??""}_elementToMarkdown(e){e!==void 0&&(e.innerHTML=n(this._selectedApiItem.examples))}renderApiCategory(e){let i=g(e.items,"name",this._filterValue);return i.length?l`<calcite-list-item-group .heading=${e.title}>${i.map(t=>l`<calcite-list-item .label=${o(t.completion.detail)} @calciteListItemSelect=${s=>this._emitItemSelected(s,t)} @keydown=${s=>this._emitItemSelected(s,t)}><calcite-action slot=actions-end .text=${this.messages.expand??""} icon=chevron-right icon-flip-rtl scale=s @click=${s=>this._selectItem(s,t)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>`:null}renderApiItemFlowItem(){let e=this._selectedApiItem;return e?l`<calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions?null:l`<calcite-button width=half slot=footer appearance=outline kind=brand scale=s .href=${e.link} target=Help icon-start=information>${this.messages.moreinformation}</calcite-button>`}<calcite-button .width=${this.hideDocumentationActions?"full":"half"} slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${i=>this._emitItemSelectedAndClose(i,e)} ${a(p)}>${this.messages.insert}</calcite-button><calcite-block expanded .heading=${o(e.completion.detail)}><div .innerHTML=${n(e.completion.documentation)??""}></div>${e.examples?l`<div ${a(this._elementToMarkdown)}></div>`:null}</calcite-block></calcite-flow-item>`:null}render(){if(this.closed)return null;let e=(this.apiLibrary??[]).map(t=>this.renderApiCategory(t)),i=e.every(t=>!t);return l`<calcite-flow ${a(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><div class="container"><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} scale=m></calcite-input><div class="scrollable">${this.loading?l`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"}></calcite-loader>`:l`<calcite-list .label=${this.messages.api??"API"}>${i?l`<div class="notice-container">${this.messages.noitems}</div>`:e}</calcite-list>`}</div></div></calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`}};h("arcgis-language-api-panel",r);export{r as ArcgisLanguageApiPanel};
2
+ import{a as n}from"./4L2GLNTS.js";import{a as g}from"./J4VBP7HA.js";import{a as f}from"./RQZK3XV2.js";import"./L7OEI4ZV.js";import{e as p,f as u}from"./BHSILWSL.js";import"./J4I4EROF.js";import"./BZWB7A55.js";import{G as a,H as m,L as h,h as d,j as l,n as c,s as o}from"./PM4JFKBG.js";import"./BFPEJYVB.js";import"./H6RQVSYM.js";var b=d`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}.container{block-size:100%;display:grid;grid-template-rows:auto 1fr;overflow:hidden}.scrollable{min-block-size:0;overflow:auto}}`,r=class extends m{constructor(){super(...arguments),this.messages=f(),this._unselectItem=async()=>{this._selectedApiItem=void 0},this._filterValue="",this.languageId="arcade",this.hideDocumentationActions=!1,this.loading=!1,this.closed=!1,this.arcgisInternalClosePanel=c({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=c({bubbles:!1,composed:!1})}static{this.properties={_filterValue:16,_selectedApiItem:16,languageId:1,apiLibrary:0,hideDocumentationActions:5,loading:5,closed:5}}static{this.styles=b}willUpdate(e){if(e.has("apiLibrary")){if(!this._selectedApiItem)return;for(let i of this.apiLibrary??[])for(let t of i.items)if(t.name===this._selectedApiItem.name){this._selectedApiItem=t;return}this._selectedApiItem=void 0}}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{u(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_emitItemSelected(e,i){if(!i)return;let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(i.completion.insertText??""))}_emitClose(){this.arcgisInternalClosePanel.emit()}_emitItemSelectedAndClose(e,i){let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(i.completion.insertText??""))}_selectItem(e,i){e.stopPropagation(),this._selectedApiItem=i}_updateFilterValue(e){this._filterValue=e.currentTarget.value??""}_elementToMarkdown(e){e!==void 0&&(e.innerHTML=n(this._selectedApiItem.examples))}renderApiCategory(e){let i=g(e.items,"name",this._filterValue);return i.length?l`<calcite-list-item-group .heading=${e.title}>${i.map(t=>l`<calcite-list-item .label=${o(t.completion.detail)} @calciteListItemSelect=${s=>this._emitItemSelected(s,t)} @keydown=${s=>this._emitItemSelected(s,t)}><calcite-action slot=actions-end .text=${this.messages.expand??""} icon=chevron-right icon-flip-rtl scale=s @click=${s=>this._selectItem(s,t)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>`:null}renderApiItemFlowItem(){let e=this._selectedApiItem;return e?l`<calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions?null:l`<calcite-button width=half slot=footer appearance=outline kind=brand scale=s .href=${e.link} target=Help icon-start=information>${this.messages.moreinformation}</calcite-button>`}<calcite-button .width=${this.hideDocumentationActions?"full":"half"} slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${i=>this._emitItemSelectedAndClose(i,e)} ${a(p)}>${this.messages.insert}</calcite-button><calcite-block expanded .heading=${o(e.completion.detail)}><div .innerHTML=${n(e.completion.documentation)??""}></div>${e.examples?l`<div ${a(this._elementToMarkdown)}></div>`:null}</calcite-block></calcite-flow-item>`:null}render(){if(this.closed)return null;let e=(this.apiLibrary??[]).map(t=>this.renderApiCategory(t)),i=e.every(t=>!t);return l`<calcite-flow ${a(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><div class="container"><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} scale=m></calcite-input><div class="scrollable">${this.loading?l`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"}></calcite-loader>`:l`<calcite-list .label=${this.messages.api??"API"}>${i?l`<div class="notice-container">${this.messages.noitems}</div>`:e}</calcite-list>`}</div></div></calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`}};h("arcgis-language-api-panel",r);export{r as ArcgisLanguageApiPanel};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./KN6J22WW.js";import a from"./STN3LSQR.js";import{j as q}from"./BHSILWSL.js";import{M as P}from"./A77A54OM.js";export default $arcgis.t(([B,{substitute:E},{B:F},{a:T,d:C,e:N,f:b,g:g,h:$,i:x,j:L,n:_,o:D,p:A}])=>{function w(t,e,a){return t?.[e]??a}function h(t,e,a,n){return E(w(t,e,a),n)}function K(t,e){return w(t,e?"nullable":"notnull",e?"nullable":"not nullable")}function j(t,e){return w(t,e?"yes":"no",e?"yes":"no")}function v(t){for(let e of t){if(e instanceof _)return e;if(e.isCollection&&"variables"in e){let a=v(e.variables.filter(n=>n.type!=="group"));if(a)return a}}}function V(t,e){return`${t}:${e}`}function z(t){if(t){for(let e of t)if(e.type==="dataCatalogDatastore")return e.definition}}async function U(t){let e=new B({url:t.portal.url});return await e.load(),new T({itemId:t.id,serviceUrl:t.serviceUrl,portal:e})}async function k(t){return F(t)?await U(t):t}function H(t,e,a,n){let o=`**${t}**`;return e.type&&(o+=`
2
+ import b from"./CPX3K3UL.js";import a from"./STN3LSQR.js";import{j as q}from"./BHSILWSL.js";import{M as P}from"./PM4JFKBG.js";export default $arcgis.t(([B,{substitute:E},{B:F},{a:T,d:C,e:N,f:b,g:g,h:$,i:x,j:L,n:_,o:D,p:A}])=>{function w(t,e,a){return t?.[e]??a}function h(t,e,a,n){return E(w(t,e,a),n)}function K(t,e){return w(t,e?"nullable":"notnull",e?"nullable":"not nullable")}function j(t,e){return w(t,e?"yes":"no",e?"yes":"no")}function v(t){for(let e of t){if(e instanceof _)return e;if(e.isCollection&&"variables"in e){let a=v(e.variables.filter(n=>n.type!=="group"));if(a)return a}}}function V(t,e){return`${t}:${e}`}function z(t){if(t){for(let e of t)if(e.type==="dataCatalogDatastore")return e.definition}}async function U(t){let e=new B({url:t.portal.url});return await e.load(),new T({itemId:t.id,serviceUrl:t.serviceUrl,portal:e})}async function k(t){return F(t)?await U(t):t}function H(t,e,a,n){let o=`**${t}**`;return e.type&&(o+=`
3
3
  ${e.type}`),a&&(o+=`
4
4
  ${h(n,"datastoreformat","Datastore: {datastoreName}",{datastoreName:a})}`),{value:o}}function W(t,e,a){let n=`**${t.name}**`;return t.serverType&&(n+=`
5
5
  ${t.serverType}`),n+=`
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"./5MCVDNVO.js";import{d as S}from"./MZMKV7FA.js";import d from"./2WB7S5TQ.js";import{j as a,p as c,v as b}from"./A77A54OM.js";export default $arcgis.t(([{b:u,c:g,d:m},{b:d,c:f,d:M,e:v,f:k,g:y}])=>{var l={lines:!0,selectionMode:"none",scale:"s",oncalciteTreeSelect:e=>e.currentTarget.selectedItems.forEach(t=>t.selected=!1)},$={onClick:e=>{let t=e.currentTarget;t.expanded=!t.expanded}},R=({arcadeResult:e,t9nStrings:t})=>{let s=e.value??[],n=Math.max(s.length-u,0);return a`<bdi>${`${c(e.type)}(${s.length??0})`}</bdi>${n>0?a`<span>&nbsp;${b(t.showingfirstitemsformat,{count:u.toString()})}</span>`:null}`},T=({value:e,subtree:t,t9nStrings:s})=>{let n=e.geometry?.();return a`<calcite-tree slot=${"children"} .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${e.keys().map(r=>{let i=m(e.field(r));return e.arcadeDeclaredClass==="esri.arcade.Feature"&&i.type==="geometry"?null:p({arcadeResult:i,name:r,t9nStrings:s})})}${n?p({arcadeResult:{type:"geometry",value:n},name:"geometry",t9nStrings:s}):null}</calcite-tree>`},G=({arcadeResult:e,t9nStrings:t})=>a`<div class="value-type"><bdi>${c(e.type)}:</bdi>${e.features.length>=g?a`<span>&nbsp;${b(t.showingfirstitemsformat,{count:g.toString()})}</span>`:null}</div>`,C=({items:e,subtree:t,arrayLength:s=e.length,t9nStrings:n})=>a`<calcite-tree slot=${"children"} .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${e.map((r,i)=>{let o=m(r);return p({arcadeResult:o,name:i,expanded:!t,t9nStrings:n})})}${p({arcadeResult:{type:"number",value:s},name:"length",isMetadata:!0,t9nStrings:n})}</calcite-tree>`,p=({arcadeResult:e,name:t,isMetadata:s=!1,expanded:n,t9nStrings:r})=>{switch(e.type){case"null":case"unknown":case"text":case"number":case"date":case"dateOnly":case"time":case"boolean":let{type:i,value:o}=y(e);return a`<calcite-tree-item><div class="tree-item-label">${d({name:t,isMetadata:s})}${v({type:i,value:o})}</div></calcite-tree-item>`;case"array":{let h=e.value??[],x=h.slice(0,u);return a`<calcite-tree-item .expanded=${n} @click=${$.onClick}><div class="tree-item-label">${d({name:t,isMetadata:s})}${R({arcadeResult:e,t9nStrings:r})}</div>${C({items:x,arrayLength:h.length,subtree:!0,t9nStrings:r})}</calcite-tree-item>`}case"geometry":return a`<calcite-tree-item .expanded=${n} @click=${$.onClick}><div class="tree-item-label">${d({name:t,isMetadata:s})}<bdi>${c(e.type)}</bdi></div>${M({value:e.value,subtree:!0})}</calcite-tree-item>`;case"attachment":return a`<calcite-tree-item .expanded=${n} @click=${$.onClick}><div class="tree-item-label">${d({name:t,isMetadata:s})}<bdi>${c(e.type)}</bdi></div>${f({obj:e.value.castAsJson(),subtree:!0})}</calcite-tree-item>`;case"feature":case"dictionary":case"portal":return a`<calcite-tree-item .expanded=${n} @click=${$.onClick}><div class="tree-item-label">${d({name:t,isMetadata:s})}<bdi>${c(e.type)}</bdi></div>${T({value:e.value,subtree:!0,t9nStrings:r})}</calcite-tree-item>`;default:return null}},I=({arcadeResult:e})=>{let t=S(e.value.fields);return a`<div class="table-scroll"><table><thead><tr>${t.map(s=>a`<th>${s.name}</th>`)}</tr></thead><tbody>${e.features.map(s=>a`<tr>${t.map(n=>{let r=m(s.field(n.name));if(!k(r))return a`<td></td>`;try{let{type:i,value:o}=y(r);return a`<td>${v({type:i,value:o})}</td>`}catch{return a`<td></td>`}})}</tr>`)}</tbody></table></div>`};return{a:l,b:R,c:T,d:G,e:C,f:I}},d,e)
2
+ import e from"./6EPN2GQ3.js";import{d as S}from"./MZMKV7FA.js";import d from"./2WB7S5TQ.js";import{j as a,p as c,v as b}from"./PM4JFKBG.js";export default $arcgis.t(([{b:u,c:g,d:m},{b:d,c:f,d:M,e:v,f:k,g:y}])=>{var l={lines:!0,selectionMode:"none",scale:"s",oncalciteTreeSelect:e=>e.currentTarget.selectedItems.forEach(t=>t.selected=!1)},$={onClick:e=>{let t=e.currentTarget;t.expanded=!t.expanded}},R=({arcadeResult:e,t9nStrings:t})=>{let s=e.value??[],n=Math.max(s.length-u,0);return a`<bdi>${`${c(e.type)}(${s.length??0})`}</bdi>${n>0?a`<span>&nbsp;${b(t.showingfirstitemsformat,{count:u.toString()})}</span>`:null}`},T=({value:e,subtree:t,t9nStrings:s})=>{let n=e.geometry?.();return a`<calcite-tree slot=${"children"} .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${e.keys().map(r=>{let i=m(e.field(r));return e.arcadeDeclaredClass==="esri.arcade.Feature"&&i.type==="geometry"?null:p({arcadeResult:i,name:r,t9nStrings:s})})}${n?p({arcadeResult:{type:"geometry",value:n},name:"geometry",t9nStrings:s}):null}</calcite-tree>`},G=({arcadeResult:e,t9nStrings:t})=>a`<div class="value-type"><bdi>${c(e.type)}:</bdi>${e.features.length>=g?a`<span>&nbsp;${b(t.showingfirstitemsformat,{count:g.toString()})}</span>`:null}</div>`,C=({items:e,subtree:t,arrayLength:s=e.length,t9nStrings:n})=>a`<calcite-tree slot=${"children"} .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${e.map((r,i)=>{let o=m(r);return p({arcadeResult:o,name:i,expanded:!t,t9nStrings:n})})}${p({arcadeResult:{type:"number",value:s},name:"length",isMetadata:!0,t9nStrings:n})}</calcite-tree>`,p=({arcadeResult:e,name:t,isMetadata:s=!1,expanded:n,t9nStrings:r})=>{switch(e.type){case"null":case"unknown":case"text":case"number":case"date":case"dateOnly":case"time":case"boolean":let{type:i,value:o}=y(e);return a`<calcite-tree-item><div class="tree-item-label">${d({name:t,isMetadata:s})}${v({type:i,value:o})}</div></calcite-tree-item>`;case"array":{let h=e.value??[],x=h.slice(0,u);return a`<calcite-tree-item .expanded=${n} @click=${$.onClick}><div class="tree-item-label">${d({name:t,isMetadata:s})}${R({arcadeResult:e,t9nStrings:r})}</div>${C({items:x,arrayLength:h.length,subtree:!0,t9nStrings:r})}</calcite-tree-item>`}case"geometry":return a`<calcite-tree-item .expanded=${n} @click=${$.onClick}><div class="tree-item-label">${d({name:t,isMetadata:s})}<bdi>${c(e.type)}</bdi></div>${M({value:e.value,subtree:!0})}</calcite-tree-item>`;case"attachment":return a`<calcite-tree-item .expanded=${n} @click=${$.onClick}><div class="tree-item-label">${d({name:t,isMetadata:s})}<bdi>${c(e.type)}</bdi></div>${f({obj:e.value.castAsJson(),subtree:!0})}</calcite-tree-item>`;case"feature":case"dictionary":case"portal":return a`<calcite-tree-item .expanded=${n} @click=${$.onClick}><div class="tree-item-label">${d({name:t,isMetadata:s})}<bdi>${c(e.type)}</bdi></div>${T({value:e.value,subtree:!0,t9nStrings:r})}</calcite-tree-item>`;default:return null}},I=({arcadeResult:e})=>{let t=S(e.value.fields);return a`<div class="table-scroll"><table><thead><tr>${t.map(s=>a`<th>${s.name}</th>`)}</tr></thead><tbody>${e.features.map(s=>a`<tr>${t.map(n=>{let r=m(s.field(n.name));if(!k(r))return a`<td></td>`;try{let{type:i,value:o}=y(r);return a`<td>${v({type:i,value:o})}</td>`}catch{return a`<td></td>`}})}</tr>`)}</tbody></table></div>`};return{a:l,b:R,c:T,d:G,e:C,f:I}},d,e)