@arcgis/coding-components 5.0.1 → 5.0.3

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.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{a as n}from"./TEE6HIYN.js";import{a as f}from"./W2JMP5SF.js";import"./OT7KTREL.js";import{a as g}from"./YBVT4QY4.js";import"./3YF4QLXU.js";import{d as p,e as u}from"./NMIFSDFV.js";import{E as a,F as d,J as h,h as m,j as s,n as c,r as o}from"./6U7HXYYK.js";import"./RXOG5OZ7.js";import"./ALDX5YZO.js";var b=m`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}}`,r=class extends d{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?s`<calcite-list-item-group .heading=${e.title}>${i.map(t=>s`<calcite-list-item .label=${o(t.completion.detail)} @calciteListItemSelect=${l=>this._emitItemSelected(l,t)} @keydown=${l=>this._emitItemSelected(l,t)}><calcite-action slot=actions-end .text=${this.messages.expand??""} icon=chevron-right icon-flip-rtl scale=s @click=${l=>this._selectItem(l,t)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>`:null}renderApiItemFlowItem(){let e=this._selectedApiItem;return e?s`<calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions?null:s`<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?s`<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 s`<calcite-flow ${a(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input>${this.loading?s`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"}></calcite-loader>`:s`<calcite-list .label=${this.messages.api??"API"}>${i?s`<div class="notice-container">${this.messages.noitems}</div>`:e}</calcite-list>`}</calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`}};h("arcgis-language-api-panel",r);export{r as ArcgisLanguageApiPanel};
2
+ import{a as n}from"./TEE6HIYN.js";import{a as f}from"./ASHNQ3IP.js";import"./X6QPPSDX.js";import{a as g}from"./XPCVJY3A.js";import"./3YF4QLXU.js";import{d as p,e as u}from"./NMIFSDFV.js";import{E as a,F as d,J as h,h as m,j as s,n as c,r as o}from"./7GDBSWXQ.js";import"./RXOG5OZ7.js";import"./ALDX5YZO.js";var b=m`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}}`,r=class extends d{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?s`<calcite-list-item-group .heading=${e.title}>${i.map(t=>s`<calcite-list-item .label=${o(t.completion.detail)} @calciteListItemSelect=${l=>this._emitItemSelected(l,t)} @keydown=${l=>this._emitItemSelected(l,t)}><calcite-action slot=actions-end .text=${this.messages.expand??""} icon=chevron-right icon-flip-rtl scale=s @click=${l=>this._selectItem(l,t)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>`:null}renderApiItemFlowItem(){let e=this._selectedApiItem;return e?s`<calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions?null:s`<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?s`<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 s`<calcite-flow ${a(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input>${this.loading?s`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"}></calcite-loader>`:s`<calcite-list .label=${this.messages.api??"API"}>${i?s`<div class="notice-container">${this.messages.noitems}</div>`:e}</calcite-list>`}</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.0/LICENSE.txt */
2
- import{a as X,b as Y,c as Z,d as f,e as y}from"./72CKSOAE.js";import{b as Q}from"./YBVT4QY4.js";import{a as ee}from"./EMCHMKAC.js";import{b as S,c as v,d as F,e as J}from"./3YF4QLXU.js";import{i as H}from"./NMIFSDFV.js";import{K as z,r as B,t as $}from"./6U7HXYYK.js";import{a as u}from"./RXOG5OZ7.js";import{Qk as A,Zk as L}from"./YCOWKBW5.js";export default $arcgis.t(([T,me,be,ge,we,{getDeclaredVoxelMembers:Ce,getDeclaredPixelMembers:De}])=>{var j=t=>t!==void 0,x=t=>t!==null;function pe(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&t.declaredClass.startsWith("esri.layers.")&&M(t)&&"queryFeatures"in t&&typeof t.queryFeatures=="function"}function ce(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&(t.declaredClass==="esri.Map"||t.declaredClass==="esri.WebMap"||t.declaredClass==="esri.WebScene")}function Se(t){return!!t&&typeof t=="object"&&"loadAll"in t&&typeof t.loadAll=="function"}function ue(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function he(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function M(t){return!!t&&typeof t=="object"&&"fields"in t&&Array.isArray(t.fields)}function V(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function ve(t){return V(t)&&/\/(?:featureserver|mapserver)(?:\/|$)/iu.test(t.url??"")}function de(t){return V(t)||M(t)||he(t)}function rt(t){return de(t)&&"type"in t&&t.type==="voxel"}function st(t){return de(t)&&"type"in t&&(t.type==="imagery"||t.type==="imagery-tile")}function nt(t){return V(t)||M(t)||he(t)}function ot(t){return ue(t)||ce(t)||ve(t)}function te(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.Subtype"}function E(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.CodedValueDomain"}function Fe(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.InheritedDomain"}function at(t){return!!t&&typeof t=="object"&&"id"in t&&typeof t.id=="string"&&"definitions"in t&&typeof t.definitions=="object"&&!Array.isArray(t.definitions)}function d(t){return!!t&&typeof t=="object"&&"title"in t&&typeof t.title=="string"}function xe(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function fe(t){return!!t&&typeof t=="object"&&"layerId"in t&&typeof t.layerId=="number"}function N(t){return!!t&&typeof t=="object"&&"typeIdField"in t&&"types"in t}function ie(t){return!!t&&typeof t=="object"&&"getFieldDomain"in t&&typeof t.getFieldDomain=="function"}function _(t){return!!t&&typeof t=="object"&&"subtypeField"in t}function Te(t){return _(t)&&"subtypes"in t}function Ie(t){return!!t&&typeof t=="object"&&"portalItem"in t}function Pe(t){return fe(t)&&"relationships"in t&&"url"in t&&Array.isArray(t.relationships)&&typeof t.url=="string"}function Me(t){return!!t&&typeof t=="object"&&"isTable"in t&&typeof t.isTable=="boolean"}function Ve(t){if(t&&typeof t=="object"){if(Me(t))return t.isTable||"type"in t&&t.type==="table";if("geometryType"in t)return t.geometryType===""||t.geometryType==="esriGeometryNull"||t.geometryType===null}return!1}function $e(t){return!Ve(t)}function Ae(t){return!!t&&typeof t=="object"&&"load"in t&&typeof t.load=="function"}function Le(t){return!!t&&typeof t=="object"&&"type"in t&&t.type==="voxel"}function re(t){return!!t&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&["imagery","imagery-tile"].includes(t.type)}async function ye(t){if(!t)return null;let e;return M(t)?e=t:e=new T(t),Ae(e)&&await e.load(),e}async function je(t){t+="/layers";let e=await me(t,{responseType:"json",query:{f:"json"}}),i=t.endsWith("MapServer/layers")?"data":"query",r=se(e.data?.layers,i),s=se(e.data?.tables,i);return{layers:r,tables:s}}function se(t,e){return t?t.filter(i=>{switch(i.type){case"Feature Layer":case"Oriented Imagery Layer":case"Catalog Layer":case"Table":return(i.capabilities?i.capabilities.toLowerCase().split(",").map(r=>r.trim()):[]).includes(e);default:return!1}}):[]}async function Ee(t,e){let i=new T({url:`${t.url}/${e.relatedTableId}`});return await i.load(),i}function O(t){return(e,i)=>{if(e.type==="oid")return-1;if(i.type==="oid")return 1;if(_(t)){if(e.name===t.subtypeField)return-1;if(i.name===t.subtypeField)return 1}if(N(t)){if(e.name===t.typeIdField)return-1;if(i.name===t.typeIdField)return 1}return e.name.localeCompare(i.name,"en",{sensitivity:"base"})}}function ne(t,e){return t?.every(i=>i.domains?.[e.name]?.type==="inherited")??!1}var Ne=/^[a-z_$][a-z0-9_$]*$/giu;function K(t,e=!0){return t.match(Ne)?`${e?".":""}${t}`:`["${t}"]`}function _e(t,e){return t?`${t}${K(e)}`:e}function oe(t){return Ie(t)?t.portalItem:null}function lt(t,e,i=!1){let r=e,s=[],o=[];return f(t).forEach(n=>{r&&(r+=`
2
+ import{a as X,b as Y,c as Z,d as f,e as y}from"./72CKSOAE.js";import{b as Q}from"./XPCVJY3A.js";import{a as ee}from"./EMCHMKAC.js";import{b as S,c as v,d as F,e as J}from"./3YF4QLXU.js";import{i as H}from"./NMIFSDFV.js";import{K as z,r as B,t as $}from"./7GDBSWXQ.js";import{a as u}from"./RXOG5OZ7.js";import{Qk as A,Zk as L}from"./YCOWKBW5.js";export default $arcgis.t(([T,me,be,ge,we,{getDeclaredVoxelMembers:Ce,getDeclaredPixelMembers:De}])=>{var j=t=>t!==void 0,x=t=>t!==null;function pe(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&t.declaredClass.startsWith("esri.layers.")&&M(t)&&"queryFeatures"in t&&typeof t.queryFeatures=="function"}function ce(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&(t.declaredClass==="esri.Map"||t.declaredClass==="esri.WebMap"||t.declaredClass==="esri.WebScene")}function Se(t){return!!t&&typeof t=="object"&&"loadAll"in t&&typeof t.loadAll=="function"}function ue(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function he(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function M(t){return!!t&&typeof t=="object"&&"fields"in t&&Array.isArray(t.fields)}function V(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function ve(t){return V(t)&&/\/(?:featureserver|mapserver)(?:\/|$)/iu.test(t.url??"")}function de(t){return V(t)||M(t)||he(t)}function rt(t){return de(t)&&"type"in t&&t.type==="voxel"}function st(t){return de(t)&&"type"in t&&(t.type==="imagery"||t.type==="imagery-tile")}function nt(t){return V(t)||M(t)||he(t)}function ot(t){return ue(t)||ce(t)||ve(t)}function te(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.Subtype"}function E(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.CodedValueDomain"}function Fe(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.InheritedDomain"}function at(t){return!!t&&typeof t=="object"&&"id"in t&&typeof t.id=="string"&&"definitions"in t&&typeof t.definitions=="object"&&!Array.isArray(t.definitions)}function d(t){return!!t&&typeof t=="object"&&"title"in t&&typeof t.title=="string"}function xe(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function fe(t){return!!t&&typeof t=="object"&&"layerId"in t&&typeof t.layerId=="number"}function N(t){return!!t&&typeof t=="object"&&"typeIdField"in t&&"types"in t}function ie(t){return!!t&&typeof t=="object"&&"getFieldDomain"in t&&typeof t.getFieldDomain=="function"}function _(t){return!!t&&typeof t=="object"&&"subtypeField"in t}function Te(t){return _(t)&&"subtypes"in t}function Ie(t){return!!t&&typeof t=="object"&&"portalItem"in t}function Pe(t){return fe(t)&&"relationships"in t&&"url"in t&&Array.isArray(t.relationships)&&typeof t.url=="string"}function Me(t){return!!t&&typeof t=="object"&&"isTable"in t&&typeof t.isTable=="boolean"}function Ve(t){if(t&&typeof t=="object"){if(Me(t))return t.isTable||"type"in t&&t.type==="table";if("geometryType"in t)return t.geometryType===""||t.geometryType==="esriGeometryNull"||t.geometryType===null}return!1}function $e(t){return!Ve(t)}function Ae(t){return!!t&&typeof t=="object"&&"load"in t&&typeof t.load=="function"}function Le(t){return!!t&&typeof t=="object"&&"type"in t&&t.type==="voxel"}function re(t){return!!t&&typeof t=="object"&&"type"in t&&typeof t.type=="string"&&["imagery","imagery-tile"].includes(t.type)}async function ye(t){if(!t)return null;let e;return M(t)?e=t:e=new T(t),Ae(e)&&await e.load(),e}async function je(t){t+="/layers";let e=await me(t,{responseType:"json",query:{f:"json"}}),i=t.endsWith("MapServer/layers")?"data":"query",r=se(e.data?.layers,i),s=se(e.data?.tables,i);return{layers:r,tables:s}}function se(t,e){return t?t.filter(i=>{switch(i.type){case"Feature Layer":case"Oriented Imagery Layer":case"Catalog Layer":case"Table":return(i.capabilities?i.capabilities.toLowerCase().split(",").map(r=>r.trim()):[]).includes(e);default:return!1}}):[]}async function Ee(t,e){let i=new T({url:`${t.url}/${e.relatedTableId}`});return await i.load(),i}function O(t){return(e,i)=>{if(e.type==="oid")return-1;if(i.type==="oid")return 1;if(_(t)){if(e.name===t.subtypeField)return-1;if(i.name===t.subtypeField)return 1}if(N(t)){if(e.name===t.typeIdField)return-1;if(i.name===t.typeIdField)return 1}return e.name.localeCompare(i.name,"en",{sensitivity:"base"})}}function ne(t,e){return t?.every(i=>i.domains?.[e.name]?.type==="inherited")??!1}var Ne=/^[a-z_$][a-z0-9_$]*$/giu;function K(t,e=!0){return t.match(Ne)?`${e?".":""}${t}`:`["${t}"]`}function _e(t,e){return t?`${t}${K(e)}`:e}function oe(t){return Ie(t)?t.portalItem:null}function lt(t,e,i=!1){let r=e,s=[],o=[];return f(t).forEach(n=>{r&&(r+=`
3
3
 
4
4
  `),r+=`**${n.name}** (${n.alias})
5
5
  ${n.type}`,n.description&&(r+=`
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import a from"./A4GVNJO4.js";import{a as S}from"./4HCNI2HA.js";import{a as O}from"./W2JMP5SF.js";import"./72K7GT6K.js";import"./OT7KTREL.js";import{d as F}from"./72CKSOAE.js";import{b as C,c as L}from"./NMIFSDFV.js";import{D as m,E as p,F as T,G as g,H as y,J as M,g as P,h as b,j as t,n as x,p as d,t as r}from"./6U7HXYYK.js";import"./RXOG5OZ7.js";import"./ALDX5YZO.js";export default $arcgis.t(([{b:o,c:R,d:h,e:I,f:_,g:j}])=>{var J=b`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}.ltr-container{direction:ltr}calcite-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.color-info{color:var(--calcite-color-status-info)}.color-error{color:var(--calcite-color-status-danger)}.color-success{color:var(--calcite-color-status-success)}[class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-md)}.console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-md);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}.result-value-table{table{display:block;max-width:fit-content;overflow-x:auto;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}}.tree-item-label,.number-value,.string-value,.boolean-value{font-family:var(--calcite-code-family)}.tree-item-label,.value-type{color:var(--calcite-color-text-2);font-weight:var(--calcite-font-weight-normal)}.dictionary-property{color:var(--arcgis-editor-identifier)}.number-value{color:var(--arcgis-editor-number)}.string-value{color:var(--arcgis-editor-string);white-space:pre-wrap}.constant-value{color:var(--arcgis-editor-constant)}.date-value{color:var(--arcgis-editor-date)}}`,l={lines:!0,selectionMode:"none",scale:"s",oncalciteTreeSelect:e=>e.currentTarget.selectedItems.forEach(a=>a.selected=!1)},v={onClick:e=>{let a=e.currentTarget;a.expanded=!a.expanded}},n=({name:e})=>t`<span class="dictionary-property">${e}</span><span>:&nbsp;</span>`,D=({value:e,subtree:a=!1})=>t`<calcite-tree slot=${(a?"children":void 0)??y} .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}><calcite-tree-item class="string-value">${JSON.stringify(e.castAsJson(),void 0,2)}</calcite-tree-item></calcite-tree>`,z=({value:e,subtree:a=!1})=>t`<calcite-tree slot=${(a?"children":void 0)??y} .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}><calcite-tree-item><div class="tree-item-label">${n({name:"type"})}${e.type}</div></calcite-tree-item><calcite-tree-item><div class="tree-item-label">${n({name:"value"})}<span class="string-value">${JSON.stringify(e,void 0,2)}</span></div></calcite-tree-item></calcite-tree>`,f=({arcadeResult:e})=>{switch(e.type){case"unknown":case"null":return t`<span class="constant-value">${e.type}</span>`;case"text":return t`<span class="string-value">${d(e.value)}</span>`;case"number":return t`<span class="number-value">${e.value.toString()}</span>`;case"boolean":return t`<span class="constant-value">${e.value.toString()}</span>`;case"date":return t`<span class="date-value">${I(e)}</span>`;case"dateOnly":return t`<span class="string-value">${d(_(e))}</span>`;case"time":return t`<span class="string-value">${d(j(e))}</span>`;default:return null}},N=({arcadeResult:e,t9nStrings:a})=>{let s=e.value??[],i=Math.max(s.length-o,0);return t`<span>${`${e.type}(${s.length??0})`}</span>${i>0?t`<span>&nbsp;${r(a.showingfirstitemsformat,{count:o.toString()})}</span>`:null}`},E=({value:e,subtree:a,t9nStrings:s})=>{let i=e.geometry?.();return t`<calcite-tree slot=${"children"} .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${e.keys().map(c=>{let u=h(e.field(c));return e.arcadeDeclaredClass==="esri.arcade.Feature"&&u.type==="geometry"?null:k({arcadeResult:u,name:c,t9nStrings:s})})}${i?k({arcadeResult:{type:"geometry",value:i},name:"geometry",t9nStrings:s}):null}</calcite-tree>`},G=({arcadeResult:e,t9nStrings:a})=>t`<div class="value-type"><span>${e.type}:</span>${e.features.length>=R?t`<span>&nbsp;${r(a.showingfirstitemsformat,{count:R.toString()})}</span>`:null}</div>`,A=({items:e,subtree:a,t9nStrings:s})=>t`<calcite-tree slot=${"children"} .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${e.map((i,c)=>{let u=h(i);return k({arcadeResult:u,name:c,expanded:!a,t9nStrings:s})})}</calcite-tree>`,k=({arcadeResult:e,name:a,expanded:s,t9nStrings:i})=>{switch(e.type){case"null":case"unknown":case"text":case"number":case"date":case"dateOnly":case"time":case"boolean":return t`<calcite-tree-item><div class="tree-item-label">${n({name:a})}${f({arcadeResult:e})}</div></calcite-tree-item>`;case"array":{let c=(e.value??[]).slice(0,o);return t`<calcite-tree-item .expanded=${s} @click=${v.onClick}><div class="tree-item-label">${n({name:a})}${N({arcadeResult:e,t9nStrings:i})}</div>${A({items:c,subtree:!0,t9nStrings:i})}</calcite-tree-item>`}case"geometry":return t`<calcite-tree-item .expanded=${s} @click=${v.onClick}><div class="tree-item-label">${n({name:a})}<span>${e.type}</span></div>${z({value:e.value,subtree:!0})}</calcite-tree-item>`;case"attachment":return t`<calcite-tree-item .expanded=${s} @click=${v.onClick}><div class="tree-item-label">${n({name:a})}<span>${e.type}</span></div>${D({value:e.value,subtree:!0})}</calcite-tree-item>`;case"feature":case"dictionary":case"portal":return t`<calcite-tree-item .expanded=${s} @click=${v.onClick}><div class="tree-item-label">${n({name:a})}<span>${e.type}</span></div>${E({value:e.value,subtree:!0,t9nStrings:i})}</calcite-tree-item>`;default:return null}},V=({arcadeResult:e})=>{let a=F(e.value.fields);return t`<table><thead><tr>${a.map(s=>t`<th>${s.name}</th>`)}</tr></thead><tbody>${e.features.map(s=>t`<tr>${a.map(i=>{try{let c=h(s.field(i.name));return t`<td>${f({arcadeResult:c})}</td>`}catch{return t`<td></td>`}})}</tr>`)}</tbody></table>`};function q(){let e=`:host {
2
+ import a from"./A4GVNJO4.js";import{a as S}from"./4HCNI2HA.js";import{a as O}from"./ASHNQ3IP.js";import"./72K7GT6K.js";import"./X6QPPSDX.js";import{d as F}from"./72CKSOAE.js";import{b as C,c as L}from"./NMIFSDFV.js";import{D as m,E as p,F as T,G as g,H as y,J as M,g as P,h as b,j as t,n as x,p as d,t as r}from"./7GDBSWXQ.js";import"./RXOG5OZ7.js";import"./ALDX5YZO.js";export default $arcgis.t(([{b:o,c:R,d:h,e:I,f:_,g:j}])=>{var J=b`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}.ltr-container{direction:ltr}calcite-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.color-info{color:var(--calcite-color-status-info)}.color-error{color:var(--calcite-color-status-danger)}.color-success{color:var(--calcite-color-status-success)}[class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-md)}.console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-md);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}.result-value-table{table{display:block;max-width:fit-content;overflow-x:auto;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}}.tree-item-label,.number-value,.string-value,.boolean-value{font-family:var(--calcite-code-family)}.tree-item-label,.value-type{color:var(--calcite-color-text-2);font-weight:var(--calcite-font-weight-normal)}.dictionary-property{color:var(--arcgis-editor-identifier)}.number-value{color:var(--arcgis-editor-number)}.string-value{color:var(--arcgis-editor-string);white-space:pre-wrap}.constant-value{color:var(--arcgis-editor-constant)}.date-value{color:var(--arcgis-editor-date)}}`,l={lines:!0,selectionMode:"none",scale:"s",oncalciteTreeSelect:e=>e.currentTarget.selectedItems.forEach(a=>a.selected=!1)},v={onClick:e=>{let a=e.currentTarget;a.expanded=!a.expanded}},n=({name:e})=>t`<span class="dictionary-property">${e}</span><span>:&nbsp;</span>`,D=({value:e,subtree:a=!1})=>t`<calcite-tree slot=${(a?"children":void 0)??y} .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}><calcite-tree-item class="string-value">${JSON.stringify(e.castAsJson(),void 0,2)}</calcite-tree-item></calcite-tree>`,z=({value:e,subtree:a=!1})=>t`<calcite-tree slot=${(a?"children":void 0)??y} .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}><calcite-tree-item><div class="tree-item-label">${n({name:"type"})}${e.type}</div></calcite-tree-item><calcite-tree-item><div class="tree-item-label">${n({name:"value"})}<span class="string-value">${JSON.stringify(e,void 0,2)}</span></div></calcite-tree-item></calcite-tree>`,f=({arcadeResult:e})=>{switch(e.type){case"unknown":case"null":return t`<span class="constant-value">${e.type}</span>`;case"text":return t`<span class="string-value">${d(e.value)}</span>`;case"number":return t`<span class="number-value">${e.value.toString()}</span>`;case"boolean":return t`<span class="constant-value">${e.value.toString()}</span>`;case"date":return t`<span class="date-value">${I(e)}</span>`;case"dateOnly":return t`<span class="string-value">${d(_(e))}</span>`;case"time":return t`<span class="string-value">${d(j(e))}</span>`;default:return null}},N=({arcadeResult:e,t9nStrings:a})=>{let s=e.value??[],i=Math.max(s.length-o,0);return t`<span>${`${e.type}(${s.length??0})`}</span>${i>0?t`<span>&nbsp;${r(a.showingfirstitemsformat,{count:o.toString()})}</span>`:null}`},E=({value:e,subtree:a,t9nStrings:s})=>{let i=e.geometry?.();return t`<calcite-tree slot=${"children"} .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${e.keys().map(c=>{let u=h(e.field(c));return e.arcadeDeclaredClass==="esri.arcade.Feature"&&u.type==="geometry"?null:k({arcadeResult:u,name:c,t9nStrings:s})})}${i?k({arcadeResult:{type:"geometry",value:i},name:"geometry",t9nStrings:s}):null}</calcite-tree>`},G=({arcadeResult:e,t9nStrings:a})=>t`<div class="value-type"><span>${e.type}:</span>${e.features.length>=R?t`<span>&nbsp;${r(a.showingfirstitemsformat,{count:R.toString()})}</span>`:null}</div>`,A=({items:e,subtree:a,t9nStrings:s})=>t`<calcite-tree slot=${"children"} .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${e.map((i,c)=>{let u=h(i);return k({arcadeResult:u,name:c,expanded:!a,t9nStrings:s})})}</calcite-tree>`,k=({arcadeResult:e,name:a,expanded:s,t9nStrings:i})=>{switch(e.type){case"null":case"unknown":case"text":case"number":case"date":case"dateOnly":case"time":case"boolean":return t`<calcite-tree-item><div class="tree-item-label">${n({name:a})}${f({arcadeResult:e})}</div></calcite-tree-item>`;case"array":{let c=(e.value??[]).slice(0,o);return t`<calcite-tree-item .expanded=${s} @click=${v.onClick}><div class="tree-item-label">${n({name:a})}${N({arcadeResult:e,t9nStrings:i})}</div>${A({items:c,subtree:!0,t9nStrings:i})}</calcite-tree-item>`}case"geometry":return t`<calcite-tree-item .expanded=${s} @click=${v.onClick}><div class="tree-item-label">${n({name:a})}<span>${e.type}</span></div>${z({value:e.value,subtree:!0})}</calcite-tree-item>`;case"attachment":return t`<calcite-tree-item .expanded=${s} @click=${v.onClick}><div class="tree-item-label">${n({name:a})}<span>${e.type}</span></div>${D({value:e.value,subtree:!0})}</calcite-tree-item>`;case"feature":case"dictionary":case"portal":return t`<calcite-tree-item .expanded=${s} @click=${v.onClick}><div class="tree-item-label">${n({name:a})}<span>${e.type}</span></div>${E({value:e.value,subtree:!0,t9nStrings:i})}</calcite-tree-item>`;default:return null}},V=({arcadeResult:e})=>{let a=F(e.value.fields);return t`<table><thead><tr>${a.map(s=>t`<th>${s.name}</th>`)}</tr></thead><tbody>${e.features.map(s=>t`<tr>${a.map(i=>{try{let c=h(s.field(i.name));return t`<td>${f({arcadeResult:c})}</td>`}catch{return t`<td></td>`}})}</tr>`)}</tbody></table>`};function q(){let e=`:host {
3
3
  `,a=S["light-theme"];Object.entries(a).forEach(([i,c])=>{e+=` --arcgis-editor-${i}: ${c};
4
4
  `}),e+=`}
5
5
  `,e+=`:host([calcite-mode-dark]) {
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
+ import c from"./EMAIRRWT.js";import b from"./5NF53HUD.js";import"./72K7GT6K.js";import a from"./IUHZTBRV.js";import"./72CKSOAE.js";import"./XPCVJY3A.js";import"./EMCHMKAC.js";import"./3YF4QLXU.js";import"./NMIFSDFV.js";import"./VVVV256M.js";import"./7GDBSWXQ.js";import"./RXOG5OZ7.js";import"./E26VIEON.js";import"./CVNYRL2K.js";import"./NXRT3FAY.js";import"./YCOWKBW5.js";import"./ALDX5YZO.js";export default $arcgis.t(([,,{a:a,b:b,c:c}])=>{return{getSqlExprDiagnosticService:b,getSqlExprWorker:a,setupMode:c}},a,b,c)
@@ -1,4 +1,4 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{a as oe}from"./W2JMP5SF.js";import"./72K7GT6K.js";import b from"./EIS6WOZZ.js";import"./OT7KTREL.js";import a from"./IUTESHGR.js";import{d as ce}from"./72CKSOAE.js";import{c as ne,d as re}from"./YBVT4QY4.js";import"./EMCHMKAC.js";import"./3YF4QLXU.js";import"./NMIFSDFV.js";import"./VVVV256M.js";import{A as X,B as Z,C as D,D as ee,E as te,F as ae,G as se,H as _,J as ie,h as W,j as p,k as P,l as U,s as K,v as q,w as N,x as F,y as I,z as S}from"./6U7HXYYK.js";import{a as k}from"./RXOG5OZ7.js";import"./E26VIEON.js";import"./CVNYRL2K.js";import"./NXRT3FAY.js";import"./YCOWKBW5.js";import"./ALDX5YZO.js";export default $arcgis.t(([Ce,pe,Ie,ue,me,{getDeclaredVoxelMembers:Me,getDeclaredPixelMembers:Ee},Re,{property:w,subclass:Ve},{g:le,h:O},z])=>{var de=(a,e,t)=>{let s=new Map;for(let i=e;i<=t;i++)s.set(a[i],i);return s},L=N(class extends F{constructor(a){if(super(a),a.type!==q.CHILD)throw Error("repeat() can only be used in text expressions")}dt(a,e,t){let s;t===void 0?t=e:e!==void 0&&(s=e);let i=[],n=[],l=0;for(let d of a)i[l]=s?s(d,l):l,n[l]=t(d,l),l++;return{values:n,keys:i}}render(a,e,t){return this.dt(a,e,t).values}update(a,[e,t,s]){let i=Z(a),{values:n,keys:l}=this.dt(e,t,s);if(!Array.isArray(i))return this.ut=l,n;let d=this.ut??=[],r=[],o,g,c=0,u=i.length-1,m=0,h=n.length-1;for(;c<=u&&m<=h;)if(i[c]===null)c++;else if(i[u]===null)u--;else if(d[c]===l[m])r[m]=S(i[c],n[m]),c++,m++;else if(d[u]===l[h])r[h]=S(i[u],n[h]),u--,h--;else if(d[c]===l[h])r[h]=S(i[c],n[h]),I(a,r[h+1],i[c]),c++,h--;else if(d[u]===l[m])r[m]=S(i[u],n[m]),I(a,i[c],i[u]),u--,m++;else if(o===void 0&&(o=de(l,m,h),g=de(d,c,u)),o.has(d[c]))if(o.has(d[u])){let f=g.get(l[m]),T=f!==void 0?i[f]:null;if(T===null){let v=I(a,i[c]);S(v,n[m]),r[m]=v}else r[m]=S(T,n[m]),I(a,i[c],T),i[f]=null;m++}else D(i[u]),u--;else D(i[c]),c++;for(;m<=h;){let f=I(a,r[h+1]);S(f,n[m]),r[m++]=f}for(;c<=u;){let f=i[c++];f!==null&&D(f)}return this.ut=l,X(a,r),P}});var R=class extends F{constructor(e){if(super(e),this.it=U,e.type!==q.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===U||e==null)return this._t=void 0,this.it=e;if(e===P)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:[]}}};R.directiveName="unsafeHTML",R.resultType=1;var V=N(R);var Pe=W`: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-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}`,A=class extends Error{constructor({message:e,code:t,subCode:s,details:i,source:n}){super(e),this.name="ArcadeAssistantError",this.code=t,this.subCode=s,this.details=i,this.source=n}};function he(a){if(!a)return;let e=a.indexOf('{"error":');if(e!==-1)try{let t=a.slice(e),s=JSON.parse(t);if(s&&typeof s=="object"&&s.error)return s.error}catch{return}}async function qe(a){let{baseUrl:e,skillId:t,message:s,authToken:i,previousConversationId:n,context:l}=a,d=t?`${e}/skills/${t}/chat`:`${e}/chat`,r=[],o={message:s,context:l};n&&(o.conversation_id=n);let g;try{g=await pe(d,{method:"post",headers:{"Content-Type":"application/json",token:i},body:JSON.stringify(o),responseType:"json"})}catch(v){let $=v,C=$.details?.rawResponse||$.message||String(v),M=he(C);throw M?new A(M):v}let c=g.data;r.push(c);let u=c.conversationId,m=c.inquiryId,h=c.sequenceNumber;async function f(){let v=0,$=100;for(;v<$;){await new Promise(E=>setTimeout(E,1e3));let C=Ne(u,h,m),M;try{M=await pe(d,{method:"post",headers:{"Content-Type":"application/json",token:i},body:JSON.stringify(C),responseType:"json"})}catch(E){let J=E,Ae=J.details?.rawResponse||J.message||String(E),Y=he(Ae);throw Y?new A(Y):E}let x=M.data;if(x.context?.kind==="ArcgisErrorAsContext"&&x.context.error)throw new A({message:x.context.error.message||"ArcGIS Assistant error",code:x.context.error.code,subCode:x.context.error.subCode,details:x.context.error.details,source:"polling-response"});if(r.push(x),h=x.sequenceNumber,v++,!x.hasMore)break}if(v===$)throw new A({message:"Request timed out",code:"TIMEOUT",source:"polling"})}let T=120*1e3;return await Promise.race([f(),new Promise((v,$)=>setTimeout(()=>$(new A({message:"Request timed out",code:"TIMEOUT",source:"hard-timeout"})),T))]),r}function Ne(a,e,t){return{conversationId:a,inquiryId:t,ackSequenceNumber:e}}function Fe(a){return a.message.match(/Error in prompt shield/u)?"I'm having trouble with this request. Try again by rephrasing the question.":a.code==="TIMEOUT"?"Request timed out. Try again by re-asking the same question or rephrasing it.":a.message}var De=({notices:a})=>a.length?p`<div class="border-block-end">${L(a,e=>e.id??e.title,e=>p`<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&&p`<div slot=message>${e.message}</div>`||""}${e.actionLinkMessage&&e.onAction&&p`<calcite-link slot=link @click=${()=>e.onAction?.()}>${e.actionLinkMessage}</calcite-link>`||""}</calcite-notice>`)}</div>`:null,_e=a=>{let e=a.value.length,t=72,s=180,i=a.offsetWidth,n=Math.max(1,Math.floor(i/8)),l=Math.ceil(e/n),d=t+(l-2)*24;a.style.setProperty("--calcite-text-area-min-height",`${Math.min(d,s)}px`)},Ue=({promptValidationMessage:a,errorMessage:e,contextTooBig:t,contextReducedNoticeDismissed:s,setContextReducedNoticeDismissed:i,setErrorMessage:n,messages:l})=>{let d=[];if(a&&d.push({id:"prompt-validation",kind:"danger",icon:"exclamation-mark-triangle",title:a,closable:!0}),e&&d.push({id:"assistant-error",kind:"danger",icon:"exclamation-mark-triangle",title:e,closable:!0,onClose:()=>n(void 0)}),t&&!s){let r=l.contextreduced??"Context reduced",o=l.contextreducedmessage??"The editor profile is too large for the assistant. It has been reduced in the assistant in order to ensure a successful request.";d.push({id:"context-reduced",kind:"warning",icon:"exclamation-mark-triangle",title:r,message:o,closable:!0,onClose:()=>i(!0)})}return d};function Oe({messages:a}){return p`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${a.beta??"Beta"}>${a.beta??"Beta"}</calcite-chip>`}function ze({popoverContent:a,messages:e}){return p`<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">${a}</div></calcite-popover>`}function Le({errorMessage:a,slot:e}){return p`<div class="error-display"><calcite-input-message id=error-message status=invalid icon=exclamation-mark-triangle scale=m slot=${e??_}>${a}</calcite-input-message></div>`}function Be({active:a,setActive:e,messages:t}){return p`<calcite-alert slot=alerts .open=${a} 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 je({context:a,messages:e}){return a?p`<div class="gaps">${a.profileId&&p`<calcite-popover auto-close placement=top .label=${(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",a.profileId)} reference-element=profile-context-button class="context-popover contained-popover-or-tooltip"><p>${(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",a.profileId)}</p></calcite-popover><calcite-button round kind=neutral icon-start=map-information id=profile-context-button scale=s></calcite-button>`||""}</div>`:null}function Qe({isDisabled:a,isReadOnly:e,setQuestion:t,setIsViewingResult:s,textAreaRef:i,question:n,errorMessage:l,setErrorMessage:d,promptValidationMessage:r,setPromptValidationMessage:o,submitQuestion:g,messages:c,mode:u,assistantRef:m,context:h,contextReducedNoticeDismissed:f,setContextReducedNoticeDismissed:T}){let v=h?.contextTooLarge??!1,$=Ue({promptValidationMessage:r,errorMessage:l,contextTooBig:v,contextReducedNoticeDismissed:f,setContextReducedNoticeDismissed:T,setErrorMessage:d,messages:c});return p`<div class="text-area-wrapper">${De({notices:$})}<calcite-text-area scale=s resize=vertical .readOnly=${a||e} class=${se($.length?"submission-text-area":"submission-text-area round-top")} .placeholder=${c.askaquestion??`Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${n} @calciteTextAreaInput=${C=>{_e(C.target),t(C.target.value)}} ${te(i)}><div class="submission-actions-wrapper" slot=footer-start><div class="submission-actions">${h&&je({context:h,messages:c})||""}<div class="align-inline-end gaps"><calcite-button round kind=neutral .hidden=${u!=="refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid scale=s .disabled=${a} @click=${async()=>{s(!1),t("")}} .label=${c.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">${c.startover??"Start Over"}</calcite-tooltip><calcite-button round kind=neutral .hidden=${u!=="refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${a} @click=${async()=>{s(!1),t("")}} class="hidden-below-380" scale=s>${c.startover??"Start Over"}</calcite-button><calcite-button round scale=s icon-end=effects appearance=solid .loading=${a} .disabled=${a} @click=${async()=>{if(d(""),!n){o(c.enteraprompt??"Please enter a prompt");return}o(void 0),await g()}} class="hidden-below-380">${u==="prompt"?c.ask??"Generate":c.refine??"Refine"}</calcite-button><calcite-button round scale=s icon-end=effects appearance=solid .loading=${a} .disabled=${a} id=small-submit-button @click=${async()=>{if(d(""),!n){o(c.enteraprompt??"Please enter a prompt");return}o(void 0),await g()}} class="hidden-above-380" .label=${u==="prompt"?c.ask??"Generate":c.refine??"Refine"}></calcite-button><calcite-tooltip reference-element=small-submit-button placement=top-start class="hidden-above-380">${u==="prompt"?c.ask??"Generate":c.refine??"Refine"}</calcite-tooltip></div></div></div></calcite-text-area></div>`}var He="https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement",Ge="https://www.esri.com/en-us/privacy/privacy-statements";function Je({setOpen:a,messages:e,feedback:t,learnMoreUrl:s,setFeedback:i,onSubmit:n}){return t.active?p`<calcite-sheet class="feedback-sheet" .label=${e.feedback??"Feedback"} slot=sheets display-mode=float position=block-end .open=${t.active} @calciteSheetClose=${()=>a(!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=${l=>i({...t,text:l.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=${l=>{i({...t,termsAccepted:l.target.checked})}} .disabled=${t.submitting}></calcite-checkbox><span>${V((e.agreement??"I agree to the {EsriPrivacyStatement} (and {Supplement}).").replace("{EsriPrivacyStatement}",`<calcite-link href=${Ge} target="_blank">${e.esriprivacystatement??"Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}",`<calcite-link href=${He} target="_blank">${e.supplement??"Supplement"}</calcite-link>`))}</span></calcite-label><calcite-notice scale=s open closable><span slot=message>${V((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=${s} 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=${()=>a(!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 ge({assistantsEnabled:a,messages:e,slot:t,helpTopicUrl:s}){return p`<calcite-block .label=${e.assistantinformation??"Assistant information"} slot=${t??_} 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>${a?p`<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>${V((e.seedocumentation??"Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}",`<calcite-link href=${s} target="_blank">${e.documentation??"documentation"}</calcite-link>`))}</p>`:p`<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 Ye({messages:a,onProceed:e,onExit:t,helpTopicUrl:s}){return p`<calcite-dialog close-disabled placement=top .heading=${a.welcome??"Welcome to the new assistant experience"} slot=dialogs open width-scale=m id=welcome-dialog><h3 class="unstyled-h3">${a.beforeyougetstarted??"Before you get started be aware:"}</h3><ul><li>${a.maybeincorrect??"AI generated code may occasionally be incorrect or biased. Review carefully."}</li><li>${V((a.pleasereadhelp??"Read the Arcade Assistant (beta) {helpTopic} to get started and learn details on security, privacy and limitations.").replace("{helpTopic}",`<calcite-link href=${s} target="_blank">${a.helptopic??"help topic"}</calcite-link>`))}</li></ul><calcite-button id=welcome-proceed slot=footer-end @click=${e}>${a.proceed??"Proceed"}</calcite-button><calcite-button id=welcome-decline slot=footer-start @click=${t} kind=neutral>${a.exit??"Exit"}</calcite-button></calcite-dialog>`}function We({messages:a,suggestions:e,onSuggestionClick:t}){return p`<calcite-block .heading=${a.promptsuggestions} expanded collapsible id=suggestion-block scale=s><div class="suggestions">${e.map(s=>p`<calcite-button round scale=s appearance=outline-fill kind=neutral .label=${a.promptsuggestion} class="suggestion-button" @click=${()=>t?.(s)}>${s}</calcite-button>`)}</div></calcite-block>`}var be=200;function fe({hidden:a=!1,expanded:e=!1,messages:t,cards:s,heading:i,collapsible:n=!1,showEffectsIcon:l=!1,onCopyCode:d,standalone:r}){return p`<calcite-block .hidden=${a} id=result-block .heading=${i??t.besteffort??"Here is the assistant's best effort"} .expanded=${e} .collapsible=${n}>${l&&p`<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"}>${L(s,o=>o.conversationId,o=>p`<calcite-card><div slot=heading><div class="prior-prompt"><span>${o.priorPrompt.length>be?`${o.priorPrompt.slice(0,be)}...`:o.priorPrompt}</span><calcite-action icon=duplicate scale=s slot=actions-end class="copy-prompt-button" text .id=${`copy-prompt-${o.conversationId}-${r?"standalone":"list"}`} @click=${g=>{let c=g.currentTarget;navigator.clipboard.writeText(o.priorPrompt).then(()=>{c.setAttribute("data-copied","true"),setTimeout(()=>c.removeAttribute("data-copied"),1500)})}}></calcite-action><calcite-popover .referenceElement=${`copy-prompt-${o.conversationId}-${r?"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-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start class="copy-tooltip">${t.copyprompttoclipboard??"Copy prompt to clipboard"}</calcite-tooltip></div>${o.message&&r&&p`<div class="response-error-container">${Le({errorMessage:o.message})}</div>`||""}</div><div><div class="code-response-wrapper"><div class="positioned-code-content"><calcite-chip-group .label=${t.responsecontext??"Response Context"} scale=s>${o.message&&!r&&p`<calcite-tooltip .referenceElement=${`response-chip-${o.conversationId}-error`} placement=top-start>${o.message}</calcite-tooltip><calcite-chip .id=${`response-chip-${o.conversationId}-error`} .label=${t.error??"Error"} scale=s appearance=outline icon=exclamation-mark-triangle-f class="response-error-chip"></calcite-chip>`||""}${Ke({card:o,messages:t})}</calcite-chip-group></div><details class="collapsible-code" open><summary>Code response</summary><arcgis-code-viewer language=arcade round>${o.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=${()=>o.onAddToEditor("add")} scale=s icon-start=plus round .label=${t.addtoeditor??"Add to editor"} .id=${`add-to-editor-button-${o.conversationId}-${r?"standalone":"list"}`}></calcite-button><calcite-tooltip class="hidden-above-380" .referenceElement=${`add-to-editor-button-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start>${t.addtoeditor??"Add to editor"}</calcite-tooltip><calcite-button class="add-to-editor-button hidden-below-380" @click=${()=>o.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=${()=>o.onAddToEditor("replace")} class="response-secondary-action-button" .id=${`replace-${o.conversationId}-${r?"standalone":"list"}`}></calcite-button><calcite-tooltip .referenceElement=${`replace-${o.conversationId}-${r?"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=${g=>{let c=g.currentTarget;d(o.code).then(()=>{c.setAttribute("data-copied","true"),setTimeout(()=>c.removeAttribute("data-copied"),1500)})}} class="response-secondary-action-button" .id=${`copy-response-${o.conversationId}-${r?"standalone":"list"}`}></calcite-button><calcite-popover .referenceElement=${`copy-response-${o.conversationId}-${r?"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-${o.conversationId}-${r?"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=${o.onThumbsUp} .id=${`thumbs-up-${o.conversationId}-${r?"standalone":"list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-up-${o.conversationId}-${r?"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=${o.onThumbsDown} .id=${`thumbs-down-${o.conversationId}-${r?"standalone":"list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-down-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start><span>${t.unhelpful??"Unhelpful"}</span></calcite-tooltip></div></calcite-card>`)}</calcite-card-group></calcite-block>`}var Ke=({card:a,messages:e})=>{let t=K(),s=`response-chip-profile-${a.conversationId}-${t}`,i=(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",a.profileId);return p`<calcite-tooltip .referenceElement=${s} placement=top-start class="contained-popover-or-tooltip">${i}</calcite-tooltip><calcite-chip .label=${a.profileId} scale=s appearance=outline icon=map-information id=${s??_}>${a.profileId}</calcite-chip>`},ve=a=>a.type==="featureSet",B=a=>{if(!le(a))return[];let e=[];return a.relationships?.forEach(t=>{e.push(t.toJSON())}),e},j=a=>a.length>0?{relationships:a}:{},Xe=a=>ce(a).map(e=>({alias:e.alias,name:e.name,type:e.type,...e.domain?{domain:e.domain}:{}})),Q=a=>a?{fields:Xe(a)}:{fields:[]};async function ye(a){let e=await a.loadSource(),t=O(e)&&e.isTable,s=B(e);return{name:a.name,type:"featureSet",isTable:t,...Q(e?.fields),...j(s)}}async function Te(a){switch(a.type){case"feature":{let e=await a.loadSource(),t=B(e);return{name:a.name,type:a.type,...Q(e?.fields),...j(t)}}case"featureSet":{let e=await a.loadSource(),t=O(e)&&e.isTable;return{name:a.name,type:"featureSet",...t?{isTable:t}:{},...Q(e?.fields),...j(B(e))}}case"featureSetCollection":{let e=await a.loadSource(),t=e?.layers.filter(ve)??[],s=e?.tables.filter(ve)??[],i=await Promise.all(t.map(ye)),n=await Promise.all(s.map(ye));return{name:a.name,type:"featureSetCollection",layers:i,tables:n}}case"dictionary":{let e=await Promise.all(a.dictionaryVariables.map(Te));return{name:a.name,type:"dictionary",attributes:e}}case"pixel":{let e=await a.loadSource();if(!e)return{name:a.name,type:"pixel"};let t=await Ee(e);return{name:a.name,type:"pixel",members:t.map(we)}}case"voxel":{let e=await a.loadSource();if(!e)return{name:a.name,type:"voxel"};let t=await Me(e);return{name:a.name,type:"voxel",members:t.map(we)}}case"array":return{name:a.name,type:"array",elementType:a.elementType.type};case"number":case"text":case"boolean":case"date":case"knowledgeGraph":case"dateOnly":case"geometry":case"time":return{name:a.name,type:a.type}}}function we(a){return a.type==="array"?{name:a.name,type:"array",elementType:a.elementType.type}:{name:a.name,type:a.type}}async function Ze(a){return{variables:await Promise.all(a.variables.map(Te))}}var et=1e5;function tt(a){let e=new TextEncoder().encode(a).length;return Math.ceil(e/3.5)}function H(a){return tt(JSON.stringify(a))}function at(a){let e=s=>({name:s.name,type:s.type,...s.isTable?{isTable:s.isTable}:{},...s.relationships?{relationships:s.relationships}:{}}),t=s=>{switch(s.type){case"feature":case"featureSet":case"knowledgeGraph":return{name:s.name,type:s.type,..."isTable"in s&&s.isTable?{isTable:s.isTable}:{},..."relationships"in s?{relationships:s.relationships}:{}};case"featureSetCollection":return{name:s.name,type:"featureSetCollection",layers:s.layers.map(e),tables:s.tables.map(e)};case"dictionary":return{name:s.name,type:"dictionary",attributes:s.attributes.map(t)};case"pixel":case"voxel":return{name:s.name,type:s.type};case"array":return{name:s.name,type:"array",...s.elementType?{elementType:s.elementType}:{}};default:return s}};return{variables:a.variables.map(t)}}function st(a){let e=a.variables,t=e.length,s=e.find(n=>n.name==="$feature")??e.find(n=>n.type==="feature")??e[0],i=s?[s]:[];return{context:{variables:i},wasReduced:t!==i.length,reducedToVariableName:s?.name}}function it(a){return H(a)>et}var ot=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,y=(a,e,t,s)=>{for(var i=s>1?void 0:s?nt(e,t):e,n=a.length-1,l;n>=0;n--)(l=a[n])&&(i=(s?l(e,t,i):l(i))||i);return s&&i&&ot(e,t,i),i},b=class extends Re{constructor(a){super(a),this.viewMode="prompt",this.confirmationActive=!1,this.contextReducedNoticeDismissed=!1,this.splashActive=!0,this.isSubmitting=!1,this.question="",this.history=[],this.feedback={active:!1}}};y([w()],b.prototype,"viewMode",2);y([w()],b.prototype,"confirmationActive",2);y([w()],b.prototype,"contextReducedNoticeDismissed",2);y([w()],b.prototype,"splashActive",2);y([w()],b.prototype,"isSubmitting",2);y([w()],b.prototype,"errorMessage",2);y([w()],b.prototype,"promptValidationMessage",2);y([w()],b.prototype,"question",2);y([w()],b.prototype,"history",2);y([w()],b.prototype,"feedback",2);y([w()],b.prototype,"context",2);b=y([Ve("ArcadeAssistantViewState")],b);var rt="arcade_generation",ct="ArcadeCodeRequest",$e="visualization",xe="ArcadeAssistant",lt=["your_comments","user_evaluation","question","answer","useragent","_source","version","context","extras","conversation_id","privacy_statement"],ke=[],Se=!0,G=class extends ae{constructor(){super(...arguments),this.textAreaRef=ee(),this.messages=oe(),this._feedbackService=void 0,this.viewState=new b,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=this.viewState.feedback.item.contextSnapshot,s=ue.applicationName;!s&&!this.appVersion&&k("warn",this,"esriConfig.applicationName is not set. Consider setting it to help identify the application version in feedback.");let{value:i,text:n,termsAccepted:l,item:{question:d,formattedScript:r,conversationId:o}}=this.viewState.feedback,g={user_evaluation:i,your_comments:n||void 0,question:d??"",answer:this.encodeAnswerForFeedback(r),useragent:navigator.userAgent,_source:xe,version:this.appVersion||s||"NOT_SET",context:t?JSON.stringify(t):"",extras:t?.profileId??"",conversation_id:o??"",privacy_statement:l?"I_agree":""};try{await e.applyEdits({addFeatures:[new me({attributes:g})]})}catch(c){k("error",this,"Error submitting feedback.",{detail:{error:c}})}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.assistantsEnabled=!1,this.closed=!1,this.disableQuestionAnswerLogging=!1}static{this.properties={closePanel:0,insertText:0,helpBase:1,assistantsEnabled:5,portalUrl:1,serviceUrl:1,closed:7,editorRef:0,feedbackServiceUrl:1,appVersion:1,disableQuestionAnswerLogging:5}}static{this.styles=Pe}get disclaimerComment(){return`// ${this.messages.disclaimercomment}
2
+ import{a as oe}from"./ASHNQ3IP.js";import"./72K7GT6K.js";import b from"./AEZVVRNT.js";import"./X6QPPSDX.js";import a from"./IUHZTBRV.js";import{d as ce}from"./72CKSOAE.js";import{c as ne,d as re}from"./XPCVJY3A.js";import"./EMCHMKAC.js";import"./3YF4QLXU.js";import"./NMIFSDFV.js";import"./VVVV256M.js";import{A as X,B as Z,C as D,D as ee,E as te,F as ae,G as se,H as _,J as ie,h as W,j as p,k as P,l as U,s as K,v as q,w as N,x as F,y as I,z as S}from"./7GDBSWXQ.js";import{a as k}from"./RXOG5OZ7.js";import"./E26VIEON.js";import"./CVNYRL2K.js";import"./NXRT3FAY.js";import"./YCOWKBW5.js";import"./ALDX5YZO.js";export default $arcgis.t(([Ce,pe,Ie,ue,me,{getDeclaredVoxelMembers:Me,getDeclaredPixelMembers:Ee},Re,{property:w,subclass:Ve},{g:le,h:O},z])=>{var de=(a,e,t)=>{let s=new Map;for(let i=e;i<=t;i++)s.set(a[i],i);return s},L=N(class extends F{constructor(a){if(super(a),a.type!==q.CHILD)throw Error("repeat() can only be used in text expressions")}dt(a,e,t){let s;t===void 0?t=e:e!==void 0&&(s=e);let i=[],n=[],l=0;for(let d of a)i[l]=s?s(d,l):l,n[l]=t(d,l),l++;return{values:n,keys:i}}render(a,e,t){return this.dt(a,e,t).values}update(a,[e,t,s]){let i=Z(a),{values:n,keys:l}=this.dt(e,t,s);if(!Array.isArray(i))return this.ut=l,n;let d=this.ut??=[],r=[],o,g,c=0,u=i.length-1,m=0,h=n.length-1;for(;c<=u&&m<=h;)if(i[c]===null)c++;else if(i[u]===null)u--;else if(d[c]===l[m])r[m]=S(i[c],n[m]),c++,m++;else if(d[u]===l[h])r[h]=S(i[u],n[h]),u--,h--;else if(d[c]===l[h])r[h]=S(i[c],n[h]),I(a,r[h+1],i[c]),c++,h--;else if(d[u]===l[m])r[m]=S(i[u],n[m]),I(a,i[c],i[u]),u--,m++;else if(o===void 0&&(o=de(l,m,h),g=de(d,c,u)),o.has(d[c]))if(o.has(d[u])){let f=g.get(l[m]),T=f!==void 0?i[f]:null;if(T===null){let v=I(a,i[c]);S(v,n[m]),r[m]=v}else r[m]=S(T,n[m]),I(a,i[c],T),i[f]=null;m++}else D(i[u]),u--;else D(i[c]),c++;for(;m<=h;){let f=I(a,r[h+1]);S(f,n[m]),r[m++]=f}for(;c<=u;){let f=i[c++];f!==null&&D(f)}return this.ut=l,X(a,r),P}});var R=class extends F{constructor(e){if(super(e),this.it=U,e.type!==q.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===U||e==null)return this._t=void 0,this.it=e;if(e===P)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:[]}}};R.directiveName="unsafeHTML",R.resultType=1;var V=N(R);var Pe=W`: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-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}`,A=class extends Error{constructor({message:e,code:t,subCode:s,details:i,source:n}){super(e),this.name="ArcadeAssistantError",this.code=t,this.subCode=s,this.details=i,this.source=n}};function he(a){if(!a)return;let e=a.indexOf('{"error":');if(e!==-1)try{let t=a.slice(e),s=JSON.parse(t);if(s&&typeof s=="object"&&s.error)return s.error}catch{return}}async function qe(a){let{baseUrl:e,skillId:t,message:s,authToken:i,previousConversationId:n,context:l}=a,d=t?`${e}/skills/${t}/chat`:`${e}/chat`,r=[],o={message:s,context:l};n&&(o.conversation_id=n);let g;try{g=await pe(d,{method:"post",headers:{"Content-Type":"application/json",token:i},body:JSON.stringify(o),responseType:"json"})}catch(v){let $=v,C=$.details?.rawResponse||$.message||String(v),M=he(C);throw M?new A(M):v}let c=g.data;r.push(c);let u=c.conversationId,m=c.inquiryId,h=c.sequenceNumber;async function f(){let v=0,$=100;for(;v<$;){await new Promise(E=>setTimeout(E,1e3));let C=Ne(u,h,m),M;try{M=await pe(d,{method:"post",headers:{"Content-Type":"application/json",token:i},body:JSON.stringify(C),responseType:"json"})}catch(E){let J=E,Ae=J.details?.rawResponse||J.message||String(E),Y=he(Ae);throw Y?new A(Y):E}let x=M.data;if(x.context?.kind==="ArcgisErrorAsContext"&&x.context.error)throw new A({message:x.context.error.message||"ArcGIS Assistant error",code:x.context.error.code,subCode:x.context.error.subCode,details:x.context.error.details,source:"polling-response"});if(r.push(x),h=x.sequenceNumber,v++,!x.hasMore)break}if(v===$)throw new A({message:"Request timed out",code:"TIMEOUT",source:"polling"})}let T=120*1e3;return await Promise.race([f(),new Promise((v,$)=>setTimeout(()=>$(new A({message:"Request timed out",code:"TIMEOUT",source:"hard-timeout"})),T))]),r}function Ne(a,e,t){return{conversationId:a,inquiryId:t,ackSequenceNumber:e}}function Fe(a){return a.message.match(/Error in prompt shield/u)?"I'm having trouble with this request. Try again by rephrasing the question.":a.code==="TIMEOUT"?"Request timed out. Try again by re-asking the same question or rephrasing it.":a.message}var De=({notices:a})=>a.length?p`<div class="border-block-end">${L(a,e=>e.id??e.title,e=>p`<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&&p`<div slot=message>${e.message}</div>`||""}${e.actionLinkMessage&&e.onAction&&p`<calcite-link slot=link @click=${()=>e.onAction?.()}>${e.actionLinkMessage}</calcite-link>`||""}</calcite-notice>`)}</div>`:null,_e=a=>{let e=a.value.length,t=72,s=180,i=a.offsetWidth,n=Math.max(1,Math.floor(i/8)),l=Math.ceil(e/n),d=t+(l-2)*24;a.style.setProperty("--calcite-text-area-min-height",`${Math.min(d,s)}px`)},Ue=({promptValidationMessage:a,errorMessage:e,contextTooBig:t,contextReducedNoticeDismissed:s,setContextReducedNoticeDismissed:i,setErrorMessage:n,messages:l})=>{let d=[];if(a&&d.push({id:"prompt-validation",kind:"danger",icon:"exclamation-mark-triangle",title:a,closable:!0}),e&&d.push({id:"assistant-error",kind:"danger",icon:"exclamation-mark-triangle",title:e,closable:!0,onClose:()=>n(void 0)}),t&&!s){let r=l.contextreduced??"Context reduced",o=l.contextreducedmessage??"The editor profile is too large for the assistant. It has been reduced in the assistant in order to ensure a successful request.";d.push({id:"context-reduced",kind:"warning",icon:"exclamation-mark-triangle",title:r,message:o,closable:!0,onClose:()=>i(!0)})}return d};function Oe({messages:a}){return p`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${a.beta??"Beta"}>${a.beta??"Beta"}</calcite-chip>`}function ze({popoverContent:a,messages:e}){return p`<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">${a}</div></calcite-popover>`}function Le({errorMessage:a,slot:e}){return p`<div class="error-display"><calcite-input-message id=error-message status=invalid icon=exclamation-mark-triangle scale=m slot=${e??_}>${a}</calcite-input-message></div>`}function Be({active:a,setActive:e,messages:t}){return p`<calcite-alert slot=alerts .open=${a} 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 je({context:a,messages:e}){return a?p`<div class="gaps">${a.profileId&&p`<calcite-popover auto-close placement=top .label=${(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",a.profileId)} reference-element=profile-context-button class="context-popover contained-popover-or-tooltip"><p>${(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",a.profileId)}</p></calcite-popover><calcite-button round kind=neutral icon-start=map-information id=profile-context-button scale=s></calcite-button>`||""}</div>`:null}function Qe({isDisabled:a,isReadOnly:e,setQuestion:t,setIsViewingResult:s,textAreaRef:i,question:n,errorMessage:l,setErrorMessage:d,promptValidationMessage:r,setPromptValidationMessage:o,submitQuestion:g,messages:c,mode:u,assistantRef:m,context:h,contextReducedNoticeDismissed:f,setContextReducedNoticeDismissed:T}){let v=h?.contextTooLarge??!1,$=Ue({promptValidationMessage:r,errorMessage:l,contextTooBig:v,contextReducedNoticeDismissed:f,setContextReducedNoticeDismissed:T,setErrorMessage:d,messages:c});return p`<div class="text-area-wrapper">${De({notices:$})}<calcite-text-area scale=s resize=vertical .readOnly=${a||e} class=${se($.length?"submission-text-area":"submission-text-area round-top")} .placeholder=${c.askaquestion??`Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${n} @calciteTextAreaInput=${C=>{_e(C.target),t(C.target.value)}} ${te(i)}><div class="submission-actions-wrapper" slot=footer-start><div class="submission-actions">${h&&je({context:h,messages:c})||""}<div class="align-inline-end gaps"><calcite-button round kind=neutral .hidden=${u!=="refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid scale=s .disabled=${a} @click=${async()=>{s(!1),t("")}} .label=${c.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">${c.startover??"Start Over"}</calcite-tooltip><calcite-button round kind=neutral .hidden=${u!=="refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${a} @click=${async()=>{s(!1),t("")}} class="hidden-below-380" scale=s>${c.startover??"Start Over"}</calcite-button><calcite-button round scale=s icon-end=effects appearance=solid .loading=${a} .disabled=${a} @click=${async()=>{if(d(""),!n){o(c.enteraprompt??"Please enter a prompt");return}o(void 0),await g()}} class="hidden-below-380">${u==="prompt"?c.ask??"Generate":c.refine??"Refine"}</calcite-button><calcite-button round scale=s icon-end=effects appearance=solid .loading=${a} .disabled=${a} id=small-submit-button @click=${async()=>{if(d(""),!n){o(c.enteraprompt??"Please enter a prompt");return}o(void 0),await g()}} class="hidden-above-380" .label=${u==="prompt"?c.ask??"Generate":c.refine??"Refine"}></calcite-button><calcite-tooltip reference-element=small-submit-button placement=top-start class="hidden-above-380">${u==="prompt"?c.ask??"Generate":c.refine??"Refine"}</calcite-tooltip></div></div></div></calcite-text-area></div>`}var He="https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement",Ge="https://www.esri.com/en-us/privacy/privacy-statements";function Je({setOpen:a,messages:e,feedback:t,learnMoreUrl:s,setFeedback:i,onSubmit:n}){return t.active?p`<calcite-sheet class="feedback-sheet" .label=${e.feedback??"Feedback"} slot=sheets display-mode=float position=block-end .open=${t.active} @calciteSheetClose=${()=>a(!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=${l=>i({...t,text:l.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=${l=>{i({...t,termsAccepted:l.target.checked})}} .disabled=${t.submitting}></calcite-checkbox><span>${V((e.agreement??"I agree to the {EsriPrivacyStatement} (and {Supplement}).").replace("{EsriPrivacyStatement}",`<calcite-link href=${Ge} target="_blank">${e.esriprivacystatement??"Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}",`<calcite-link href=${He} target="_blank">${e.supplement??"Supplement"}</calcite-link>`))}</span></calcite-label><calcite-notice scale=s open closable><span slot=message>${V((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=${s} 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=${()=>a(!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 ge({assistantsEnabled:a,messages:e,slot:t,helpTopicUrl:s}){return p`<calcite-block .label=${e.assistantinformation??"Assistant information"} slot=${t??_} 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>${a?p`<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>${V((e.seedocumentation??"Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}",`<calcite-link href=${s} target="_blank">${e.documentation??"documentation"}</calcite-link>`))}</p>`:p`<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 Ye({messages:a,onProceed:e,onExit:t,helpTopicUrl:s}){return p`<calcite-dialog close-disabled placement=top .heading=${a.welcome??"Welcome to the new assistant experience"} slot=dialogs open width-scale=m id=welcome-dialog><h3 class="unstyled-h3">${a.beforeyougetstarted??"Before you get started be aware:"}</h3><ul><li>${a.maybeincorrect??"AI generated code may occasionally be incorrect or biased. Review carefully."}</li><li>${V((a.pleasereadhelp??"Read the Arcade Assistant (beta) {helpTopic} to get started and learn details on security, privacy and limitations.").replace("{helpTopic}",`<calcite-link href=${s} target="_blank">${a.helptopic??"help topic"}</calcite-link>`))}</li></ul><calcite-button id=welcome-proceed slot=footer-end @click=${e}>${a.proceed??"Proceed"}</calcite-button><calcite-button id=welcome-decline slot=footer-start @click=${t} kind=neutral>${a.exit??"Exit"}</calcite-button></calcite-dialog>`}function We({messages:a,suggestions:e,onSuggestionClick:t}){return p`<calcite-block .heading=${a.promptsuggestions} expanded collapsible id=suggestion-block scale=s><div class="suggestions">${e.map(s=>p`<calcite-button round scale=s appearance=outline-fill kind=neutral .label=${a.promptsuggestion} class="suggestion-button" @click=${()=>t?.(s)}>${s}</calcite-button>`)}</div></calcite-block>`}var be=200;function fe({hidden:a=!1,expanded:e=!1,messages:t,cards:s,heading:i,collapsible:n=!1,showEffectsIcon:l=!1,onCopyCode:d,standalone:r}){return p`<calcite-block .hidden=${a} id=result-block .heading=${i??t.besteffort??"Here is the assistant's best effort"} .expanded=${e} .collapsible=${n}>${l&&p`<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"}>${L(s,o=>o.conversationId,o=>p`<calcite-card><div slot=heading><div class="prior-prompt"><span>${o.priorPrompt.length>be?`${o.priorPrompt.slice(0,be)}...`:o.priorPrompt}</span><calcite-action icon=duplicate scale=s slot=actions-end class="copy-prompt-button" text .id=${`copy-prompt-${o.conversationId}-${r?"standalone":"list"}`} @click=${g=>{let c=g.currentTarget;navigator.clipboard.writeText(o.priorPrompt).then(()=>{c.setAttribute("data-copied","true"),setTimeout(()=>c.removeAttribute("data-copied"),1500)})}}></calcite-action><calcite-popover .referenceElement=${`copy-prompt-${o.conversationId}-${r?"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-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start class="copy-tooltip">${t.copyprompttoclipboard??"Copy prompt to clipboard"}</calcite-tooltip></div>${o.message&&r&&p`<div class="response-error-container">${Le({errorMessage:o.message})}</div>`||""}</div><div><div class="code-response-wrapper"><div class="positioned-code-content"><calcite-chip-group .label=${t.responsecontext??"Response Context"} scale=s>${o.message&&!r&&p`<calcite-tooltip .referenceElement=${`response-chip-${o.conversationId}-error`} placement=top-start>${o.message}</calcite-tooltip><calcite-chip .id=${`response-chip-${o.conversationId}-error`} .label=${t.error??"Error"} scale=s appearance=outline icon=exclamation-mark-triangle-f class="response-error-chip"></calcite-chip>`||""}${Ke({card:o,messages:t})}</calcite-chip-group></div><details class="collapsible-code" open><summary>Code response</summary><arcgis-code-viewer language=arcade round>${o.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=${()=>o.onAddToEditor("add")} scale=s icon-start=plus round .label=${t.addtoeditor??"Add to editor"} .id=${`add-to-editor-button-${o.conversationId}-${r?"standalone":"list"}`}></calcite-button><calcite-tooltip class="hidden-above-380" .referenceElement=${`add-to-editor-button-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start>${t.addtoeditor??"Add to editor"}</calcite-tooltip><calcite-button class="add-to-editor-button hidden-below-380" @click=${()=>o.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=${()=>o.onAddToEditor("replace")} class="response-secondary-action-button" .id=${`replace-${o.conversationId}-${r?"standalone":"list"}`}></calcite-button><calcite-tooltip .referenceElement=${`replace-${o.conversationId}-${r?"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=${g=>{let c=g.currentTarget;d(o.code).then(()=>{c.setAttribute("data-copied","true"),setTimeout(()=>c.removeAttribute("data-copied"),1500)})}} class="response-secondary-action-button" .id=${`copy-response-${o.conversationId}-${r?"standalone":"list"}`}></calcite-button><calcite-popover .referenceElement=${`copy-response-${o.conversationId}-${r?"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-${o.conversationId}-${r?"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=${o.onThumbsUp} .id=${`thumbs-up-${o.conversationId}-${r?"standalone":"list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-up-${o.conversationId}-${r?"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=${o.onThumbsDown} .id=${`thumbs-down-${o.conversationId}-${r?"standalone":"list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-down-${o.conversationId}-${r?"standalone":"list"}`} placement=top-start><span>${t.unhelpful??"Unhelpful"}</span></calcite-tooltip></div></calcite-card>`)}</calcite-card-group></calcite-block>`}var Ke=({card:a,messages:e})=>{let t=K(),s=`response-chip-profile-${a.conversationId}-${t}`,i=(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",a.profileId);return p`<calcite-tooltip .referenceElement=${s} placement=top-start class="contained-popover-or-tooltip">${i}</calcite-tooltip><calcite-chip .label=${a.profileId} scale=s appearance=outline icon=map-information id=${s??_}>${a.profileId}</calcite-chip>`},ve=a=>a.type==="featureSet",B=a=>{if(!le(a))return[];let e=[];return a.relationships?.forEach(t=>{e.push(t.toJSON())}),e},j=a=>a.length>0?{relationships:a}:{},Xe=a=>ce(a).map(e=>({alias:e.alias,name:e.name,type:e.type,...e.domain?{domain:e.domain}:{}})),Q=a=>a?{fields:Xe(a)}:{fields:[]};async function ye(a){let e=await a.loadSource(),t=O(e)&&e.isTable,s=B(e);return{name:a.name,type:"featureSet",isTable:t,...Q(e?.fields),...j(s)}}async function Te(a){switch(a.type){case"feature":{let e=await a.loadSource(),t=B(e);return{name:a.name,type:a.type,...Q(e?.fields),...j(t)}}case"featureSet":{let e=await a.loadSource(),t=O(e)&&e.isTable;return{name:a.name,type:"featureSet",...t?{isTable:t}:{},...Q(e?.fields),...j(B(e))}}case"featureSetCollection":{let e=await a.loadSource(),t=e?.layers.filter(ve)??[],s=e?.tables.filter(ve)??[],i=await Promise.all(t.map(ye)),n=await Promise.all(s.map(ye));return{name:a.name,type:"featureSetCollection",layers:i,tables:n}}case"dictionary":{let e=await Promise.all(a.dictionaryVariables.map(Te));return{name:a.name,type:"dictionary",attributes:e}}case"pixel":{let e=await a.loadSource();if(!e)return{name:a.name,type:"pixel"};let t=await Ee(e);return{name:a.name,type:"pixel",members:t.map(we)}}case"voxel":{let e=await a.loadSource();if(!e)return{name:a.name,type:"voxel"};let t=await Me(e);return{name:a.name,type:"voxel",members:t.map(we)}}case"array":return{name:a.name,type:"array",elementType:a.elementType.type};case"number":case"text":case"boolean":case"date":case"knowledgeGraph":case"dateOnly":case"geometry":case"time":return{name:a.name,type:a.type}}}function we(a){return a.type==="array"?{name:a.name,type:"array",elementType:a.elementType.type}:{name:a.name,type:a.type}}async function Ze(a){return{variables:await Promise.all(a.variables.map(Te))}}var et=1e5;function tt(a){let e=new TextEncoder().encode(a).length;return Math.ceil(e/3.5)}function H(a){return tt(JSON.stringify(a))}function at(a){let e=s=>({name:s.name,type:s.type,...s.isTable?{isTable:s.isTable}:{},...s.relationships?{relationships:s.relationships}:{}}),t=s=>{switch(s.type){case"feature":case"featureSet":case"knowledgeGraph":return{name:s.name,type:s.type,..."isTable"in s&&s.isTable?{isTable:s.isTable}:{},..."relationships"in s?{relationships:s.relationships}:{}};case"featureSetCollection":return{name:s.name,type:"featureSetCollection",layers:s.layers.map(e),tables:s.tables.map(e)};case"dictionary":return{name:s.name,type:"dictionary",attributes:s.attributes.map(t)};case"pixel":case"voxel":return{name:s.name,type:s.type};case"array":return{name:s.name,type:"array",...s.elementType?{elementType:s.elementType}:{}};default:return s}};return{variables:a.variables.map(t)}}function st(a){let e=a.variables,t=e.length,s=e.find(n=>n.name==="$feature")??e.find(n=>n.type==="feature")??e[0],i=s?[s]:[];return{context:{variables:i},wasReduced:t!==i.length,reducedToVariableName:s?.name}}function it(a){return H(a)>et}var ot=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,y=(a,e,t,s)=>{for(var i=s>1?void 0:s?nt(e,t):e,n=a.length-1,l;n>=0;n--)(l=a[n])&&(i=(s?l(e,t,i):l(i))||i);return s&&i&&ot(e,t,i),i},b=class extends Re{constructor(a){super(a),this.viewMode="prompt",this.confirmationActive=!1,this.contextReducedNoticeDismissed=!1,this.splashActive=!0,this.isSubmitting=!1,this.question="",this.history=[],this.feedback={active:!1}}};y([w()],b.prototype,"viewMode",2);y([w()],b.prototype,"confirmationActive",2);y([w()],b.prototype,"contextReducedNoticeDismissed",2);y([w()],b.prototype,"splashActive",2);y([w()],b.prototype,"isSubmitting",2);y([w()],b.prototype,"errorMessage",2);y([w()],b.prototype,"promptValidationMessage",2);y([w()],b.prototype,"question",2);y([w()],b.prototype,"history",2);y([w()],b.prototype,"feedback",2);y([w()],b.prototype,"context",2);b=y([Ve("ArcadeAssistantViewState")],b);var rt="arcade_generation",ct="ArcadeCodeRequest",$e="visualization",xe="ArcadeAssistant",lt=["your_comments","user_evaluation","question","answer","useragent","_source","version","context","extras","conversation_id","privacy_statement"],ke=[],Se=!0,G=class extends ae{constructor(){super(...arguments),this.textAreaRef=ee(),this.messages=oe(),this._feedbackService=void 0,this.viewState=new b,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=this.viewState.feedback.item.contextSnapshot,s=ue.applicationName;!s&&!this.appVersion&&k("warn",this,"esriConfig.applicationName is not set. Consider setting it to help identify the application version in feedback.");let{value:i,text:n,termsAccepted:l,item:{question:d,formattedScript:r,conversationId:o}}=this.viewState.feedback,g={user_evaluation:i,your_comments:n||void 0,question:d??"",answer:this.encodeAnswerForFeedback(r),useragent:navigator.userAgent,_source:xe,version:this.appVersion||s||"NOT_SET",context:t?JSON.stringify(t):"",extras:t?.profileId??"",conversation_id:o??"",privacy_statement:l?"I_agree":""};try{await e.applyEdits({addFeatures:[new me({attributes:g})]})}catch(c){k("error",this,"Error submitting feedback.",{detail:{error:c}})}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.assistantsEnabled=!1,this.closed=!1,this.disableQuestionAnswerLogging=!1}static{this.properties={closePanel:0,insertText:0,helpBase:1,assistantsEnabled:5,portalUrl:1,serviceUrl:1,closed:7,editorRef:0,feedbackServiceUrl:1,appVersion:1,disableQuestionAnswerLogging:5}}static{this.styles=Pe}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 destroy(){}connectedCallback(){super.connectedCallback(),this.updateViewState({history:ke,splashActive:Se})}load(){let e=async()=>{let t=this.getModel();if(!t){this.updateViewState({context:void 0});return}let s=await this.getProfileAndMetadata(t.uri);this.updateViewState({context:s,contextReducedNoticeDismissed:s.contextTooLarge?!1:this.viewState.contextReducedNoticeDismissed})};e().catch(t=>{k("error",this,"Error setting initial context.",{detail:{error:t}})}),this.manager.onLifecycle(()=>{let t=z.onModelContextDidChange(async()=>{e().catch(s=>{k("error",this,"Error setting context.",{detail:{error:s}})})});return{remove:()=>{t.dispose()}}})}disconnectedCallback(){super.disconnectedCallback(),ke=this.viewState.history,Se=this.viewState.splashActive,this.copySuccessTimer&&(clearTimeout(this.copySuccessTimer),this.copySuccessTimer=void 0)}createFeedbackContextSnapshot(e){let t=at(e.metadata);return{...e,metadata:t,estimatedTokens:H(t)}}encodeAnswerForFeedback(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??$e,onAddToEditor:s=>{ne(this.editorRef.editorInstance,t.formattedScript??"",s,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 Ie({url:this.feedbackServiceUrl});await e.load();let t=lt.filter(s=>!e.fields.some(i=>i.name===s));if(t.length>0){k("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(l){k("error",this,"Error initializing feedback service for interaction logging.",{detail:{error:l}});return}if(!t)return;let s=ue.applicationName,i=e.contextSnapshot,n={question:e.question,answer:this.encodeAnswerForFeedback(e.answer),useragent:navigator.userAgent,_source:xe,version:this.appVersion||s||"NOT_SET",context:i?JSON.stringify(i):"",extras:i?.profileId??"",conversation_id:e.conversationId??"",privacy_statement:""};try{await t.applyEdits({addFeatures:[new me({attributes:n})]})}catch(l){k("error",this,"Error logging arcade assistant question/answer interaction.",{detail:{error:l}})}}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,s;try{let i=this.getModel();if(!i||!this.serviceUrl)return;let n=this.viewState.context??await this.getProfileAndMetadata(i.uri);t=this.createFeedbackContextSnapshot(n);let l=await this.getToken(),d=await qe({baseUrl:this.serviceUrl,skillId:rt,message:e,authToken:l,context:{kind:ct,context:{profile_id:n.profileId,metadata:[n.metadata]}}});s=d?.[0]?.conversationId;let r=d.find(o=>o.context?.kind==="ArcadeCodeResponse");if(!r){await this.logInteractionToFeedbackService({question:e,answer:"No ArcadeCodeResponse returned.",contextSnapshot:t,conversationId:s});return}if(r.context?.kind==="ArcadeCodeResponse"){let o=this.createFeedbackContextSnapshot(n),g=re(r?.context?.arcadeCode?.code??"");this.updateViewState({history:[{script:r?.context?.arcadeCode?.code,formattedScript:g,error:void 0,question:e,profile:n.profileId,conversationId:r.conversationId,contextSnapshot:o,...r.message?{message:r.message}:{}},...this.viewState.history],viewMode:"result",errorMessage:void 0}),await this.logInteractionToFeedbackService({question:e,answer:g,contextSnapshot:t,conversationId:r.conversationId})}}catch(i){let n=i instanceof Error&&i.name==="ArcadeAssistantError"?Fe(i)||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:s}),k("error",this,"Error submitting question",{detail:{error:i}})}finally{this.updateViewState({isSubmitting:!1})}}async getToken(){let{token:e}=await Ce.getCredential(this.portalUrl);return e}async getProfileAndMetadata(e){let t=$e,s=z.getEditorProfileForModel(e);s?.loaded||await s?.loadSource();let i=this.editorRef.profile;i&&"id"in i&&(t=i.id);let n=s?await Ze(s):{variables:[]},l=it(n),d=l?st(n):void 0,r=d?d.context:n,o=H(r);return{profileId:t,metadata:r,contextTooLarge:l,reducedToVariableName:d?.reducedToVariableName,estimatedTokens:o}}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.assistantsEnabled?p`<calcite-flow><calcite-flow-item closable heading-level=2 .heading=${this.messages.arcadeassistant??"Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.viewState.splashActive&&p`<calcite-scrim></calcite-scrim>`||""}${Oe({messages:this.messages})}${ze({messages:this.messages,popoverContent:ge({assistantsEnabled:this.assistantsEnabled,messages:this.messages,helpTopicUrl:this.usingTheAssitantDocUrl})})}<calcite-shell class="unstyled-shell">${this.viewState.splashActive&&Ye({messages:this.messages,onProceed:()=>{this.updateViewState({splashActive:!1})},helpTopicUrl:this.assistantOverviewDocUrl,onExit:s=>this.closePanel?.(s)})||""}${Be({active:this.viewState.confirmationActive,setActive:s=>this.updateViewState({confirmationActive:s}),messages:this.messages})}${Qe({isDisabled:this.viewState.isSubmitting,isReadOnly:!1,setQuestion:this.setQuestionState,setIsViewingResult:s=>this.updateViewState({viewMode:s?"result":"prompt"}),mode:e?"refine":"prompt",textAreaRef:this.textAreaRef,question:this.viewState.question,errorMessage:this.viewState.errorMessage,setErrorMessage:s=>this.updateViewState({errorMessage:s}),promptValidationMessage:this.viewState.promptValidationMessage,setPromptValidationMessage:s=>this.updateViewState({promptValidationMessage:s}),submitQuestion:this.submitQuestion.bind(this),assistantRef:this.el,messages:this.messages,context:this.viewState.context,contextReducedNoticeDismissed:this.viewState.contextReducedNoticeDismissed,setContextReducedNoticeDismissed:s=>this.updateViewState({contextReducedNoticeDismissed:s})})}<calcite-block-group .label=${this.messages.interactiveblocks??"interactive blocks"}>${!e&&!this.viewState.isSubmitting&&We({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>${fe({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})}${fe({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?Je({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>`:p`<calcite-flow><calcite-flow-item .selected=${!e} closable heading-level=2 .heading=${this.messages.arcadeassistant??"Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${ge({slot:"content-top",messages:this.messages,assistantsEnabled:this.assistantsEnabled,helpTopicUrl:this.usingTheAssitantDocUrl})}</calcite-flow-item></calcite-flow>`}};ie("arcgis-arcade-coding-assistant",G);return G},"identity/IdentityManager","request","layers/FeatureLayer","config","Graphic","applications/Components/arcadeEditorUtils","core/Accessor","core/accessorSupport/decorators",a,b)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{F as r,J as i,h as e,j as n}from"./6U7HXYYK.js";import"./RXOG5OZ7.js";import"./ALDX5YZO.js";var a=e`:host{--arcgis-coding-components-internal-border: var( --arcgis-coding-components-border, 1px solid var(--calcite-color-border-3) );--arcgis-coding-components-internal-background-color: var( --arcgis-coding-components-background-color, var(--calcite-color-foreground-1) );--arcgis-coding-components-internal-side-action-bar-max-w: var(--arcgis-coding-components-side-action-bar-max-w, 25%);--arcgis-coding-components-internal-code-editor-side-panel-w: var( --arcgis-coding-components-code-editor-side-panel-w, 600px );--arcgis-coding-components-internal-code-editor-side-panel-max-w: var( --arcgis-coding-components-code-editor-side-panel-max-w, 45% );--arcgis-coding-components-internal-code-editor-results-panel-max-h: var( --arcgis-coding-components-code-editor-results-panel-max-h, 50% );--arcgis-coding-components-internal-code-editor-results-panel-h: var( --arcgis-coding-components-code-editor-results-panel-h, 50% );display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-internal-border);box-sizing:border-box;background-color:var(--arcgis-coding-components-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}}slot[name=top-action-bar]::slotted(*){border-bottom:var(--arcgis-coding-components-internal-border);flex:0 0 auto}slot[name=side-panel]::slotted(*){max-width:var(--arcgis-coding-components-internal-code-editor-side-panel-max-w);width:var(--arcgis-coding-components-internal-code-editor-side-panel-w);border-inline-start:var(--arcgis-coding-components-internal-border);box-sizing:border-box;flex:1 0 auto}slot[name=side-panel]::slotted(.hidden){display:none}slot[name=editor]::slotted(*){flex:1 1 auto;overflow:hidden}slot[name=results-panel]::slotted(*){flex:0 0 var(--arcgis-coding-components-internal-code-editor-results-panel-h);overflow:hidden;border-top:var(--arcgis-coding-components-internal-border);box-sizing:border-box;max-height:var(--arcgis-coding-components-internal-code-editor-results-panel-max-h);margin-bottom:-1px}slot[name=side-action-bar]::slotted(*){max-width:var(--arcgis-coding-components-internal-side-action-bar-max-w);border-inline-start:var(--arcgis-coding-components-internal-border)}`,o=class extends r{static{this.styles=[a]}render(){return n`<slot name=top-action-bar></slot><div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><slot name=editor></slot><slot name=results-panel></slot></div><slot name=side-panel></slot><slot name=side-action-bar></slot></div>`}};i("arcgis-code-editor-shell",o);export{o as CodeEditorShell};
2
+ import{F as r,J as i,h as e,j as n}from"./7GDBSWXQ.js";import"./RXOG5OZ7.js";import"./ALDX5YZO.js";var a=e`:host{--arcgis-coding-components-internal-border: var( --arcgis-coding-components-border, 1px solid var(--calcite-color-border-3) );--arcgis-coding-components-internal-background-color: var( --arcgis-coding-components-background-color, var(--calcite-color-foreground-1) );--arcgis-coding-components-internal-side-action-bar-max-w: var(--arcgis-coding-components-side-action-bar-max-w, 25%);--arcgis-coding-components-internal-code-editor-side-panel-w: var( --arcgis-coding-components-code-editor-side-panel-w, 600px );--arcgis-coding-components-internal-code-editor-side-panel-max-w: var( --arcgis-coding-components-code-editor-side-panel-max-w, 45% );--arcgis-coding-components-internal-code-editor-results-panel-max-h: var( --arcgis-coding-components-code-editor-results-panel-max-h, 50% );--arcgis-coding-components-internal-code-editor-results-panel-h: var( --arcgis-coding-components-code-editor-results-panel-h, 50% );display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-internal-border);box-sizing:border-box;background-color:var(--arcgis-coding-components-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}}slot[name=top-action-bar]::slotted(*){border-bottom:var(--arcgis-coding-components-internal-border);flex:0 0 auto}slot[name=side-panel]::slotted(*){max-width:var(--arcgis-coding-components-internal-code-editor-side-panel-max-w);width:var(--arcgis-coding-components-internal-code-editor-side-panel-w);border-inline-start:var(--arcgis-coding-components-internal-border);box-sizing:border-box;flex:1 0 auto}slot[name=side-panel]::slotted(.hidden){display:none}slot[name=editor]::slotted(*){flex:1 1 auto;overflow:hidden}slot[name=results-panel]::slotted(*){flex:0 0 var(--arcgis-coding-components-internal-code-editor-results-panel-h);overflow:hidden;border-top:var(--arcgis-coding-components-internal-border);box-sizing:border-box;max-height:var(--arcgis-coding-components-internal-code-editor-results-panel-max-h);margin-bottom:-1px}slot[name=side-action-bar]::slotted(*){max-width:var(--arcgis-coding-components-internal-side-action-bar-max-w);border-inline-start:var(--arcgis-coding-components-internal-border)}`,o=class extends r{static{this.styles=[a]}render(){return n`<slot name=top-action-bar></slot><div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><slot name=editor></slot><slot name=results-panel></slot></div><slot name=side-panel></slot><slot name=side-action-bar></slot></div>`}};i("arcgis-code-editor-shell",o);export{o as CodeEditorShell};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{a as v}from"./TEE6HIYN.js";import{b,c as r,d as _}from"./QCU6ITJA.js";import{a as p}from"./W2JMP5SF.js";import"./OT7KTREL.js";import{a as f}from"./YBVT4QY4.js";import"./EMCHMKAC.js";import"./3YF4QLXU.js";import{d as h,e as m}from"./NMIFSDFV.js";import"./VVVV256M.js";import{E as c,F as d,J as u,h as g,j as s,l,n as a}from"./6U7HXYYK.js";import"./RXOG5OZ7.js";import"./E26VIEON.js";import"./CVNYRL2K.js";import"./NXRT3FAY.js";import"./YCOWKBW5.js";import"./ALDX5YZO.js";function S(o){return!Array.isArray(o)||!o.length?!1:Array.isArray(o[0].suggestions)}var $=g`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}code{font-family:var(--calcite-code-family)}pre{direction:ltr;overflow-x:auto;background-color:var(--calcite-color-foreground-2);padding:var(--calcite-spacing-sm);code{font-size:var(--calcite-font-size--2)}}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}}`,n=class extends d{constructor(){super(...arguments),this._beforeBack=async()=>{this._selectedSuggestion=void 0},this.messages=p(),this._colorizeStyle="",this._filterValue="",this.closed=!1,this.arcgisInternalClosePanel=a({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=a({bubbles:!1,composed:!1})}static{this.properties={_colorizeStyle:16,_filterValue:16,_selectedSuggestion:16,suggestions:0,closed:5}}static{this.styles=$}load(){this._colorizeStyle=r(),this._themeChangedListener=_(()=>this._colorizeStyle=r())}willUpdate(e){e.has("suggestions")&&this.suggestionsPropChanged()}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect(),this._themeChangedListener?.dispose()}suggestionsPropChanged(){this._selectedSuggestion=void 0}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{m(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_updateFilterValue(e){this._filterValue=e.currentTarget?.value??""}_emitItemSelected(e,t){let i=e;(!i.key||i.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(t.code))}_showSuggestionDetail(e,t){e.stopPropagation(),this._selectedSuggestion=t}_emitClose(){this.arcgisInternalClosePanel.emit()}_colorizeCode(e){e!==void 0&&b(e,this._selectedSuggestion.code,"arcade")}renderSuggestionGroups(){return this.suggestions===void 0?null:S(this.suggestions)?this.suggestions.map(e=>s`<calcite-list-item-group .heading=${e.label}>${this.renderSuggestionListItems(e.suggestions)}</calcite-list-item-group>`):this.renderSuggestionListItems(this.suggestions)}renderSuggestionListItems(e){return e=f(e,"label",this._filterValue),e.length?e.map(t=>s`<calcite-list-item .label=${t.label} .description=${t.description} @calciteListItemSelect=${i=>this._emitItemSelected(i,t)} @keydown=${i=>this._emitItemSelected(i,t)} data-item=${t??l}><calcite-action slot=actions-end .text=${this.messages.expand??""} scale=s icon=chevron-right icon-flip-rtl @click=${i=>this._showSuggestionDetail(i,t)} data-item=${t??l}></calcite-action></calcite-list-item>`):s`<div class="notice-container">${this.messages.noitems}</div>`}renderSuggestionFlowItem(){let e=this._selectedSuggestion;return e?s`<calcite-flow-item heading-level=2 .heading=${this.messages.suggestions} closable @calciteFlowItemClose=${this._emitClose} .beforeBack=${this._beforeBack} selected><calcite-button width=half slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${t=>this._emitItemSelected(t,e)} data-item=${e??l} ${c(h)}>${this.messages.insert}</calcite-button><calcite-block open .heading=${e.label} .description=${e.description}><div .innerHTML=${v(e.documentation)??""}></div><pre><code ${c(this._colorizeCode)}></code></pre></calcite-block></calcite-flow-item>`:null}render(){return this.closed?null:s`<style>${this._colorizeStyle}</style><calcite-flow ${c(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.suggestions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedSuggestion}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input><calcite-list .label=${this.messages.suggestions??"Suggestions"}>${this.renderSuggestionGroups()}</calcite-list></calcite-flow-item>${this.renderSuggestionFlowItem()}</calcite-flow>`}};u("arcgis-arcade-suggestions",n);export{n as ArcgisArcadeSuggestions};
2
+ import{a as v}from"./TEE6HIYN.js";import{b,c as r,d as _}from"./QCU6ITJA.js";import{a as p}from"./ASHNQ3IP.js";import"./X6QPPSDX.js";import{a as f}from"./XPCVJY3A.js";import"./EMCHMKAC.js";import"./3YF4QLXU.js";import{d as h,e as m}from"./NMIFSDFV.js";import"./VVVV256M.js";import{E as c,F as d,J as u,h as g,j as s,l,n as a}from"./7GDBSWXQ.js";import"./RXOG5OZ7.js";import"./E26VIEON.js";import"./CVNYRL2K.js";import"./NXRT3FAY.js";import"./YCOWKBW5.js";import"./ALDX5YZO.js";function S(o){return!Array.isArray(o)||!o.length?!1:Array.isArray(o[0].suggestions)}var $=g`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}code{font-family:var(--calcite-code-family)}pre{direction:ltr;overflow-x:auto;background-color:var(--calcite-color-foreground-2);padding:var(--calcite-spacing-sm);code{font-size:var(--calcite-font-size--2)}}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}}`,n=class extends d{constructor(){super(...arguments),this._beforeBack=async()=>{this._selectedSuggestion=void 0},this.messages=p(),this._colorizeStyle="",this._filterValue="",this.closed=!1,this.arcgisInternalClosePanel=a({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=a({bubbles:!1,composed:!1})}static{this.properties={_colorizeStyle:16,_filterValue:16,_selectedSuggestion:16,suggestions:0,closed:5}}static{this.styles=$}load(){this._colorizeStyle=r(),this._themeChangedListener=_(()=>this._colorizeStyle=r())}willUpdate(e){e.has("suggestions")&&this.suggestionsPropChanged()}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect(),this._themeChangedListener?.dispose()}suggestionsPropChanged(){this._selectedSuggestion=void 0}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{m(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_updateFilterValue(e){this._filterValue=e.currentTarget?.value??""}_emitItemSelected(e,t){let i=e;(!i.key||i.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(t.code))}_showSuggestionDetail(e,t){e.stopPropagation(),this._selectedSuggestion=t}_emitClose(){this.arcgisInternalClosePanel.emit()}_colorizeCode(e){e!==void 0&&b(e,this._selectedSuggestion.code,"arcade")}renderSuggestionGroups(){return this.suggestions===void 0?null:S(this.suggestions)?this.suggestions.map(e=>s`<calcite-list-item-group .heading=${e.label}>${this.renderSuggestionListItems(e.suggestions)}</calcite-list-item-group>`):this.renderSuggestionListItems(this.suggestions)}renderSuggestionListItems(e){return e=f(e,"label",this._filterValue),e.length?e.map(t=>s`<calcite-list-item .label=${t.label} .description=${t.description} @calciteListItemSelect=${i=>this._emitItemSelected(i,t)} @keydown=${i=>this._emitItemSelected(i,t)} data-item=${t??l}><calcite-action slot=actions-end .text=${this.messages.expand??""} scale=s icon=chevron-right icon-flip-rtl @click=${i=>this._showSuggestionDetail(i,t)} data-item=${t??l}></calcite-action></calcite-list-item>`):s`<div class="notice-container">${this.messages.noitems}</div>`}renderSuggestionFlowItem(){let e=this._selectedSuggestion;return e?s`<calcite-flow-item heading-level=2 .heading=${this.messages.suggestions} closable @calciteFlowItemClose=${this._emitClose} .beforeBack=${this._beforeBack} selected><calcite-button width=half slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${t=>this._emitItemSelected(t,e)} data-item=${e??l} ${c(h)}>${this.messages.insert}</calcite-button><calcite-block open .heading=${e.label} .description=${e.description}><div .innerHTML=${v(e.documentation)??""}></div><pre><code ${c(this._colorizeCode)}></code></pre></calcite-block></calcite-flow-item>`:null}render(){return this.closed?null:s`<style>${this._colorizeStyle}</style><calcite-flow ${c(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.suggestions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedSuggestion}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input><calcite-list .label=${this.messages.suggestions??"Suggestions"}>${this.renderSuggestionGroups()}</calcite-list></calcite-flow-item>${this.renderSuggestionFlowItem()}</calcite-flow>`}};u("arcgis-arcade-suggestions",n);export{n as ArcgisArcadeSuggestions};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import e from"./A4GVNJO4.js";import d from"./NYQRFR77.js";import{a as L}from"./W2JMP5SF.js";import c from"./EIS6WOZZ.js";import"./OT7KTREL.js";import a from"./IUTESHGR.js";import"./72CKSOAE.js";import"./YBVT4QY4.js";import"./EMCHMKAC.js";import"./3YF4QLXU.js";import"./NMIFSDFV.js";import"./VVVV256M.js";import{D as C,E as D,F as I,G as r,J as B,K as k,h as w,j as s,l as $,n as b,s as y}from"./6U7HXYYK.js";import{a as R,b as o}from"./RXOG5OZ7.js";import"./E26VIEON.js";import"./CVNYRL2K.js";import"./NXRT3FAY.js";import{Rk as M}from"./YCOWKBW5.js";import"./ALDX5YZO.js";export default $arcgis.t(([O,,l,{a:U,b:F},{a:T,h:S}])=>{var z=w`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}.main-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}`,N="https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0",a=(i,e)=>R(i,"Arcade Assistant",e),H=i=>{let{aiAssistantsEnabled:e}=i;return e===void 0?(a("warn","`areAiAssistantsEnabled` is not defined in the organizations settings."),!1):e},V=i=>!(!i||!("id"in i)),G=async i=>(await O.getCredential(i,{oAuthPopupConfirmation:!1})).token,q=async i=>{try{return!!await O.checkSignInStatus(i)}catch{return a("warn","User is not signed in."),!1}};async function Q({portalUrl:i,profile:e}){if(!V(e))return a("warn","Addon initialization failed. Reason: unsupported profile."),{shouldRender:!1};let t=i.replace(/\/sharing\/rest(\/.*)?$/iu,"").replace(/\/$/u,"");if(!await q(t))return{shouldRender:!1};let n=await G(i),c=`${t}/sharing/rest/portals/self?f=json&token=${n}`,h=`${t}/sharing/rest/portals/self/settings?f=json&token=${n}`,p=`${t}/sharing/rest/portals/self/signinSettings?f=json&token=${n}`,u=await Promise.allSettled([fetch(c,{credentials:"include"}).then(d=>d.json()),fetch(h,{credentials:"include"}).then(d=>d.json()),fetch(p,{credentials:"include"}).then(d=>d.json())]),[g,_,m]=u,f=g.status==="fulfilled"?g.value:(a("warn",`Failed to fetch selfUrl. Reason: ${g.reason}.`),{}),v=_.status==="fulfilled"?_.value:(a("warn",`Failed to fetch settingsUrl. Reason: ${_.reason}.`),{}),j=m.status==="fulfilled"?m.value:(a("warn",`Failed to fetch signinSettingsUrl. Reason: ${m.reason}.`),{}),x=f.helpBase||"";if(!v)return a("warn","Settings response is not available."),{shouldRender:!1};let A=H(v);j.blockBetaApps===!0&&(a("warn","Arcade Assistant is blocked by the organization settings. To enable it, do not block beta apps in the organization settings."),A=!1),f?.user?.privileges?.includes("portal:user:useAIAssistants")||(a("warn","User does not have the required privileges to use AI Assistants."),A=!1);let E=f?.helperServices?.aiAssistantServices?.url;return E?{shouldRender:!0,serviceUrl:E,helpBase:x,assistantsEnabled:A,feedbackServiceUrl:N}:{shouldRender:!0,assistantsEnabled:!1,helpBase:x,feedbackServiceUrl:N}}var P=class extends I{constructor(){super(...arguments),this._codeEditorElt=C(),this._componentReadyDefer=Promise.withResolvers(),this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this.messages=L(),this._modelId=y(),this._openArcadeHelp=()=>void window.open(T,"Arcade Help"),this._toggleSidePanel=e=>{if(!e.target)return;let t=e.target?.dataset.panelName??"none";this.openedSidePanel=t===this.openedSidePanel?"none":t,this.openedSidePanel==="none"&&this._codeEditorElt.value?.setFocus().catch(o(this))},this._consoleLogs=[],this._executingScript=!1,this._preparingArcade=!1,this._resultPanel="output",this._showExecutionPanel=!1,this._arcadeAssistantRemoteState={shouldRender:!1},this.hideDocumentationActions=!1,this.hideSideBar=!1,this.openedSidePanel="none",this.script="",this.sideActionBarExpanded=!1,this.arcgisDiagnosticsChange=b({bubbles:!1}),this.arcgisScriptChange=b({bubbles:!1})}static{this.properties={_apiLibrary:16,_consoleLogs:16,_editorProfile:16,_executingScript:16,_executionResult:16,_preparingArcade:16,_resultPanel:16,_showExecutionPanel:16,_arcadeAssistantRemoteState:16,editorInstance:32,editorOptions:0,hideDocumentationActions:5,hideSideBar:5,openedSidePanel:3,profile:0,script:1,sideActionBarExpanded:7,snippets:0,suggestions:0,testData:0,customPanels:0,arcadeAssistant:0}}static{this.styles=[z]}get editorInstance(){return this._codeEditorElt.value?.editorInstance}async getTestResult(){if(!this.testData)return{type:"error",value:"Missing test data",error:null};let e=await this._editorProfilePromise;if(!e)return{type:"error",value:"Missing editor profile",error:null};await this._componentReadyDefer.promise;let t=this._codeEditorElt.value?.value;return await S(e.definition,t,this.testData)}async setFocus(){await this._componentReadyDefer.promise,await this._codeEditorElt.value?.setFocus()}async load(){let e=k("./assets");U(e),await this._updateDataModelDeps(),await this._updateArcadeAssistantRemoteState()}willUpdate(e){(e.has("messages")||e.has("profile"))&&this.hasUpdated&&this._updateDataModelDeps(),e.has("testData")&&this._testDataChanged(),e.has("snippets")&&l.updateApiContextForModel(this._modelId,{snippets:this.snippets}),e.has("arcadeAssistant")&&this._updateArcadeAssistantRemoteState()}async loaded(){this._componentReadyDefer.resolve(),await this._updateApiLibrary();let e=await F();this._disposables.push(e.onDiagnosticsChange(t=>!this._preparingArcade&&this.arcgisDiagnosticsChange.emit(t.diagnostics))),this.testData&&this._addExecuteScriptAction()}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}_testDataChanged(){!this.testData&&this._executeScriptAction&&(this._disposeSafely(this._executeScriptAction),this._executeScriptAction=void 0),this.testData&&!this._executeScriptAction&&this._addExecuteScriptAction(),this._showExecutionPanel&&this._executeScript().catch(o(this))}async _updateEditorProfile(){this._preparingArcade=!0;try{await l.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale,snippets:this.snippets}),this._editorProfile=l.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._editorProfilePromise=Promise.resolve(this._editorProfile),this._preparingArcade=!1}}async _updateApiLibrary(){this._apiLibrary=await l.getApiLibraryForModel(this._modelId)}async _executeScript(){let e=this.testData;if(!this._codeEditorElt.value||!e)return;let t=await this._editorProfilePromise;if(!t){this._executionResult={type:"error",value:"Missing editor profile",error:null};return}this._showExecutionPanel=!0,this._executingScript=!0,this._consoleLogs=[],setTimeout(()=>void(async()=>{let n=this._codeEditorElt.value?.value;this._executionResult=await S(t.definition,n,e,c=>setTimeout(()=>this._consoleLogs=[...this._consoleLogs,c],0)),this._executingScript=!1})(),0)}_toggleShowExecutionPanel(){this._showExecutionPanel=!this._showExecutionPanel}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_onCodeEditorValueChange(e){e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)}_insertAsSnippet(e){this._codeEditorElt.value?.insertSnippet(e.detail).catch(o(this))}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(o(this))}_onResultPanelChange(e){let t=e.currentTarget;this._resultPanel=t.openedResultPanel}_onExecutionPanelClose(){this._showExecutionPanel=!1}_addExecuteScriptAction(){let e=this.editorInstance?.addAction({id:"run-script",label:"Run Arcade Expression",keybindings:[M.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this.testData&&this._executeScript().catch(o(this))}});e&&(this._executeScriptAction=e,this._disposables.push(e))}_disposeSafely(e){let t=this._disposables.indexOf(e);t!==-1&&this._disposables.splice(t,1),e.dispose()}async _updateArcadeAssistantRemoteState(){this.arcadeAssistant&&(this._arcadeAssistantRemoteState=await Q({...this.arcadeAssistant,profile:this.profile}))}renderMainActionBar(){return this.testData?s`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled slot=top-action-bar><calcite-action-group scale=s><calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${()=>void this._executeScript().catch(o(this))}></calcite-action>${this._executionResult?s`<calcite-action .text=${this.messages.lastresults??""} .active=${this._showExecutionPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>`:null}</calcite-action-group></calcite-action-bar>`:null}renderMainPanel(){return s`<arcgis-code-editor slot=editor .editorOptions=${this.editorOptions} .language=${l.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${D(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:t,icon:n,active:c,panelName:h,iconFlipRtl:p=!1,onClick:u=this._toggleSidePanel}){return s`<calcite-action id=${e??$} .text=${t} .textEnabled=${this.sideActionBarExpanded} .icon=${n} .active=${c} @click=${u} data-panel-name=${h??$} .iconFlipRtl=${p}></calcite-action>${!this.sideActionBarExpanded&&s`<calcite-tooltip .referenceElement=${e}><span>${t}</span></calcite-tooltip>`||""}`}renderSideActionBar(){return this.hideSideBar?null:s`<calcite-action-bar slot=side-action-bar class="side-action-bar" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({id:"profile-variables-action",label:this.messages.profilevariables??"",icon:"profile-variables",active:this.openedSidePanel==="variables",panelName:"variables"})}${this.renderAction({id:"function-action",label:this.messages.constantsandfunctions??"",icon:"function",active:this.openedSidePanel==="api",panelName:"api"})}${this.suggestions?.length?this.renderAction({id:"suggestions-action",label:this.messages.suggestions??"",icon:"lightbulb",active:this.openedSidePanel==="suggestions",panelName:"suggestions"}):null}${this._arcadeAssistantRemoteState.shouldRender&&this.renderAction({id:"arcade-assistant-action",label:this.messages.arcadeassistant??"Arcade assistant",icon:"effects",active:this.openedSidePanel==="arcade-assistant",panelName:"arcade-assistant"})||""}${this.customPanels?.map(e=>e.enabled===!1?null:this.renderAction({id:e.id,label:e.name,icon:e.icon,active:this.openedSidePanel===e.id,panelName:e.id}))}${this.hideDocumentationActions?null:this.renderAction({id:"developer-website-action",label:this.messages.help??"",icon:"question",active:!1,panelName:"none",iconFlipRtl:this.messages._lang==="ar",onClick:this._openArcadeHelp})}</calcite-action-group></calcite-action-bar>`}renderSidePanel(){if(this.hideSideBar)return null;let{openedSidePanel:e}=this;return s`<arcgis-language-api-panel slot=side-panel class=${r(e==="api"?"":"hidden")} .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${this._toggleSidePanel} data-panel-name=none .closed=${e!=="api"}></arcgis-language-api-panel><arcgis-editor-variables slot=side-panel class=${r(e==="variables"?"":"hidden")} .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._toggleSidePanel} data-panel-name=none .variable=${this._editorProfile} .closed=${e!=="variables"}></arcgis-editor-variables>${this.suggestions?.length&&s`<arcgis-arcade-suggestions slot=side-panel class=${r(e==="suggestions"?"":"hidden")} .closed=${e!=="suggestions"} .suggestions=${this.suggestions} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._toggleSidePanel} data-panel-name=none></arcgis-arcade-suggestions>`||""}${this.arcadeAssistant&&this._arcadeAssistantRemoteState.shouldRender&&s`<arcgis-arcade-coding-assistant slot=side-panel class=${r(e==="arcade-assistant"?"":"hidden")} .closed=${e!=="arcade-assistant"} .insertText=${this._insertText.bind(this)} .closePanel=${this._toggleSidePanel} .portalUrl=${this.arcadeAssistant.portalUrl} .serviceUrl=${"serviceUrl"in this._arcadeAssistantRemoteState?this._arcadeAssistantRemoteState.serviceUrl:void 0} .helpBase=${this._arcadeAssistantRemoteState.helpBase} .assistantsEnabled=${this._arcadeAssistantRemoteState.assistantsEnabled} .feedbackServiceUrl=${this._arcadeAssistantRemoteState.feedbackServiceUrl} .editorRef=${this.el} .appVersion=${this.arcadeAssistant.appVersion} .disableQuestionAnswerLogging=${this.arcadeAssistant.disableQuestionAnswerLogging}></arcgis-arcade-coding-assistant>`||""}${this.customPanels?.map(t=>s`<calcite-flow slot=side-panel class=${r(e===t.id?"":"hidden")}>${t?.useFlows?t.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==t.id,editorRef:this.el}):s`<calcite-flow-item .heading=${t.name} heading-level=2 closable .closed=${e!==t.id} @calciteFlowItemClose=${this._toggleSidePanel} .description=${t.description}>${t.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==t.id,editorRef:this.el})}</calcite-flow-item>`}</calcite-flow>`)}`}renderResultsPanel(){return this._showExecutionPanel?s`<arcgis-arcade-results slot=results-panel .openedResultPanel=${this._resultPanel} .loading=${this._executingScript} .result=${this._executionResult} .consoleLogs=${this._consoleLogs} @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange} @arcgisInternalClosePanel=${this._onExecutionPanelClose}></arcgis-arcade-results>`:null}render(){return s`<arcgis-code-editor-shell>${this.renderMainActionBar()}${this.renderMainPanel()}${this.renderResultsPanel()}${this.renderSidePanel()}${this.renderSideActionBar()}</arcgis-code-editor-shell>`}};B("arcgis-arcade-editor",P);return P},"identity/IdentityManager",a,c,d,e)
2
+ import e from"./A4GVNJO4.js";import d from"./NYQRFR77.js";import{a as L}from"./ASHNQ3IP.js";import c from"./AEZVVRNT.js";import"./X6QPPSDX.js";import a from"./IUHZTBRV.js";import"./72CKSOAE.js";import"./XPCVJY3A.js";import"./EMCHMKAC.js";import"./3YF4QLXU.js";import"./NMIFSDFV.js";import"./VVVV256M.js";import{D as C,E as D,F as I,G as r,J as B,K as k,h as w,j as s,l as $,n as b,s as y}from"./7GDBSWXQ.js";import{a as R,b as o}from"./RXOG5OZ7.js";import"./E26VIEON.js";import"./CVNYRL2K.js";import"./NXRT3FAY.js";import{Rk as M}from"./YCOWKBW5.js";import"./ALDX5YZO.js";export default $arcgis.t(([O,,l,{a:U,b:F},{a:T,h:S}])=>{var z=w`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}.main-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}`,N="https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0",a=(i,e)=>R(i,"Arcade Assistant",e),H=i=>{let{aiAssistantsEnabled:e}=i;return e===void 0?(a("warn","`areAiAssistantsEnabled` is not defined in the organizations settings."),!1):e},V=i=>!(!i||!("id"in i)),G=async i=>(await O.getCredential(i,{oAuthPopupConfirmation:!1})).token,q=async i=>{try{return!!await O.checkSignInStatus(i)}catch{return a("warn","User is not signed in."),!1}};async function Q({portalUrl:i,profile:e}){if(!V(e))return a("warn","Addon initialization failed. Reason: unsupported profile."),{shouldRender:!1};let t=i.replace(/\/sharing\/rest(\/.*)?$/iu,"").replace(/\/$/u,"");if(!await q(t))return{shouldRender:!1};let n=await G(i),c=`${t}/sharing/rest/portals/self?f=json&token=${n}`,h=`${t}/sharing/rest/portals/self/settings?f=json&token=${n}`,p=`${t}/sharing/rest/portals/self/signinSettings?f=json&token=${n}`,u=await Promise.allSettled([fetch(c,{credentials:"include"}).then(d=>d.json()),fetch(h,{credentials:"include"}).then(d=>d.json()),fetch(p,{credentials:"include"}).then(d=>d.json())]),[g,_,m]=u,f=g.status==="fulfilled"?g.value:(a("warn",`Failed to fetch selfUrl. Reason: ${g.reason}.`),{}),v=_.status==="fulfilled"?_.value:(a("warn",`Failed to fetch settingsUrl. Reason: ${_.reason}.`),{}),j=m.status==="fulfilled"?m.value:(a("warn",`Failed to fetch signinSettingsUrl. Reason: ${m.reason}.`),{}),x=f.helpBase||"";if(!v)return a("warn","Settings response is not available."),{shouldRender:!1};let A=H(v);j.blockBetaApps===!0&&(a("warn","Arcade Assistant is blocked by the organization settings. To enable it, do not block beta apps in the organization settings."),A=!1),f?.user?.privileges?.includes("portal:user:useAIAssistants")||(a("warn","User does not have the required privileges to use AI Assistants."),A=!1);let E=f?.helperServices?.aiAssistantServices?.url;return E?{shouldRender:!0,serviceUrl:E,helpBase:x,assistantsEnabled:A,feedbackServiceUrl:N}:{shouldRender:!0,assistantsEnabled:!1,helpBase:x,feedbackServiceUrl:N}}var P=class extends I{constructor(){super(...arguments),this._codeEditorElt=C(),this._componentReadyDefer=Promise.withResolvers(),this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this.messages=L(),this._modelId=y(),this._openArcadeHelp=()=>void window.open(T,"Arcade Help"),this._toggleSidePanel=e=>{if(!e.target)return;let t=e.target?.dataset.panelName??"none";this.openedSidePanel=t===this.openedSidePanel?"none":t,this.openedSidePanel==="none"&&this._codeEditorElt.value?.setFocus().catch(o(this))},this._consoleLogs=[],this._executingScript=!1,this._preparingArcade=!1,this._resultPanel="output",this._showExecutionPanel=!1,this._arcadeAssistantRemoteState={shouldRender:!1},this.hideDocumentationActions=!1,this.hideSideBar=!1,this.openedSidePanel="none",this.script="",this.sideActionBarExpanded=!1,this.arcgisDiagnosticsChange=b({bubbles:!1}),this.arcgisScriptChange=b({bubbles:!1})}static{this.properties={_apiLibrary:16,_consoleLogs:16,_editorProfile:16,_executingScript:16,_executionResult:16,_preparingArcade:16,_resultPanel:16,_showExecutionPanel:16,_arcadeAssistantRemoteState:16,editorInstance:32,editorOptions:0,hideDocumentationActions:5,hideSideBar:5,openedSidePanel:3,profile:0,script:1,sideActionBarExpanded:7,snippets:0,suggestions:0,testData:0,customPanels:0,arcadeAssistant:0}}static{this.styles=[z]}get editorInstance(){return this._codeEditorElt.value?.editorInstance}async getTestResult(){if(!this.testData)return{type:"error",value:"Missing test data",error:null};let e=await this._editorProfilePromise;if(!e)return{type:"error",value:"Missing editor profile",error:null};await this._componentReadyDefer.promise;let t=this._codeEditorElt.value?.value;return await S(e.definition,t,this.testData)}async setFocus(){await this._componentReadyDefer.promise,await this._codeEditorElt.value?.setFocus()}async load(){let e=k("./assets");U(e),await this._updateDataModelDeps(),await this._updateArcadeAssistantRemoteState()}willUpdate(e){(e.has("messages")||e.has("profile"))&&this.hasUpdated&&this._updateDataModelDeps(),e.has("testData")&&this._testDataChanged(),e.has("snippets")&&l.updateApiContextForModel(this._modelId,{snippets:this.snippets}),e.has("arcadeAssistant")&&this._updateArcadeAssistantRemoteState()}async loaded(){this._componentReadyDefer.resolve(),await this._updateApiLibrary();let e=await F();this._disposables.push(e.onDiagnosticsChange(t=>!this._preparingArcade&&this.arcgisDiagnosticsChange.emit(t.diagnostics))),this.testData&&this._addExecuteScriptAction()}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}_testDataChanged(){!this.testData&&this._executeScriptAction&&(this._disposeSafely(this._executeScriptAction),this._executeScriptAction=void 0),this.testData&&!this._executeScriptAction&&this._addExecuteScriptAction(),this._showExecutionPanel&&this._executeScript().catch(o(this))}async _updateEditorProfile(){this._preparingArcade=!0;try{await l.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale,snippets:this.snippets}),this._editorProfile=l.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._editorProfilePromise=Promise.resolve(this._editorProfile),this._preparingArcade=!1}}async _updateApiLibrary(){this._apiLibrary=await l.getApiLibraryForModel(this._modelId)}async _executeScript(){let e=this.testData;if(!this._codeEditorElt.value||!e)return;let t=await this._editorProfilePromise;if(!t){this._executionResult={type:"error",value:"Missing editor profile",error:null};return}this._showExecutionPanel=!0,this._executingScript=!0,this._consoleLogs=[],setTimeout(()=>void(async()=>{let n=this._codeEditorElt.value?.value;this._executionResult=await S(t.definition,n,e,c=>setTimeout(()=>this._consoleLogs=[...this._consoleLogs,c],0)),this._executingScript=!1})(),0)}_toggleShowExecutionPanel(){this._showExecutionPanel=!this._showExecutionPanel}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_onCodeEditorValueChange(e){e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)}_insertAsSnippet(e){this._codeEditorElt.value?.insertSnippet(e.detail).catch(o(this))}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(o(this))}_onResultPanelChange(e){let t=e.currentTarget;this._resultPanel=t.openedResultPanel}_onExecutionPanelClose(){this._showExecutionPanel=!1}_addExecuteScriptAction(){let e=this.editorInstance?.addAction({id:"run-script",label:"Run Arcade Expression",keybindings:[M.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this.testData&&this._executeScript().catch(o(this))}});e&&(this._executeScriptAction=e,this._disposables.push(e))}_disposeSafely(e){let t=this._disposables.indexOf(e);t!==-1&&this._disposables.splice(t,1),e.dispose()}async _updateArcadeAssistantRemoteState(){this.arcadeAssistant&&(this._arcadeAssistantRemoteState=await Q({...this.arcadeAssistant,profile:this.profile}))}renderMainActionBar(){return this.testData?s`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled slot=top-action-bar><calcite-action-group scale=s><calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${()=>void this._executeScript().catch(o(this))}></calcite-action>${this._executionResult?s`<calcite-action .text=${this.messages.lastresults??""} .active=${this._showExecutionPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>`:null}</calcite-action-group></calcite-action-bar>`:null}renderMainPanel(){return s`<arcgis-code-editor slot=editor .editorOptions=${this.editorOptions} .language=${l.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${D(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:t,icon:n,active:c,panelName:h,iconFlipRtl:p=!1,onClick:u=this._toggleSidePanel}){return s`<calcite-action id=${e??$} .text=${t} .textEnabled=${this.sideActionBarExpanded} .icon=${n} .active=${c} @click=${u} data-panel-name=${h??$} .iconFlipRtl=${p}></calcite-action>${!this.sideActionBarExpanded&&s`<calcite-tooltip .referenceElement=${e}><span>${t}</span></calcite-tooltip>`||""}`}renderSideActionBar(){return this.hideSideBar?null:s`<calcite-action-bar slot=side-action-bar class="side-action-bar" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({id:"profile-variables-action",label:this.messages.profilevariables??"",icon:"profile-variables",active:this.openedSidePanel==="variables",panelName:"variables"})}${this.renderAction({id:"function-action",label:this.messages.constantsandfunctions??"",icon:"function",active:this.openedSidePanel==="api",panelName:"api"})}${this.suggestions?.length?this.renderAction({id:"suggestions-action",label:this.messages.suggestions??"",icon:"lightbulb",active:this.openedSidePanel==="suggestions",panelName:"suggestions"}):null}${this._arcadeAssistantRemoteState.shouldRender&&this.renderAction({id:"arcade-assistant-action",label:this.messages.arcadeassistant??"Arcade assistant",icon:"effects",active:this.openedSidePanel==="arcade-assistant",panelName:"arcade-assistant"})||""}${this.customPanels?.map(e=>e.enabled===!1?null:this.renderAction({id:e.id,label:e.name,icon:e.icon,active:this.openedSidePanel===e.id,panelName:e.id}))}${this.hideDocumentationActions?null:this.renderAction({id:"developer-website-action",label:this.messages.help??"",icon:"question",active:!1,panelName:"none",iconFlipRtl:this.messages._lang==="ar",onClick:this._openArcadeHelp})}</calcite-action-group></calcite-action-bar>`}renderSidePanel(){if(this.hideSideBar)return null;let{openedSidePanel:e}=this;return s`<arcgis-language-api-panel slot=side-panel class=${r(e==="api"?"":"hidden")} .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${this._toggleSidePanel} data-panel-name=none .closed=${e!=="api"}></arcgis-language-api-panel><arcgis-editor-variables slot=side-panel class=${r(e==="variables"?"":"hidden")} .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._toggleSidePanel} data-panel-name=none .variable=${this._editorProfile} .closed=${e!=="variables"}></arcgis-editor-variables>${this.suggestions?.length&&s`<arcgis-arcade-suggestions slot=side-panel class=${r(e==="suggestions"?"":"hidden")} .closed=${e!=="suggestions"} .suggestions=${this.suggestions} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._toggleSidePanel} data-panel-name=none></arcgis-arcade-suggestions>`||""}${this.arcadeAssistant&&this._arcadeAssistantRemoteState.shouldRender&&s`<arcgis-arcade-coding-assistant slot=side-panel class=${r(e==="arcade-assistant"?"":"hidden")} .closed=${e!=="arcade-assistant"} .insertText=${this._insertText.bind(this)} .closePanel=${this._toggleSidePanel} .portalUrl=${this.arcadeAssistant.portalUrl} .serviceUrl=${"serviceUrl"in this._arcadeAssistantRemoteState?this._arcadeAssistantRemoteState.serviceUrl:void 0} .helpBase=${this._arcadeAssistantRemoteState.helpBase} .assistantsEnabled=${this._arcadeAssistantRemoteState.assistantsEnabled} .feedbackServiceUrl=${this._arcadeAssistantRemoteState.feedbackServiceUrl} .editorRef=${this.el} .appVersion=${this.arcadeAssistant.appVersion} .disableQuestionAnswerLogging=${this.arcadeAssistant.disableQuestionAnswerLogging}></arcgis-arcade-coding-assistant>`||""}${this.customPanels?.map(t=>s`<calcite-flow slot=side-panel class=${r(e===t.id?"":"hidden")}>${t?.useFlows?t.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==t.id,editorRef:this.el}):s`<calcite-flow-item .heading=${t.name} heading-level=2 closable .closed=${e!==t.id} @calciteFlowItemClose=${this._toggleSidePanel} .description=${t.description}>${t.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==t.id,editorRef:this.el})}</calcite-flow-item>`}</calcite-flow>`)}`}renderResultsPanel(){return this._showExecutionPanel?s`<arcgis-arcade-results slot=results-panel .openedResultPanel=${this._resultPanel} .loading=${this._executingScript} .result=${this._executionResult} .consoleLogs=${this._consoleLogs} @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange} @arcgisInternalClosePanel=${this._onExecutionPanelClose}></arcgis-arcade-results>`:null}render(){return s`<arcgis-code-editor-shell>${this.renderMainActionBar()}${this.renderMainPanel()}${this.renderResultsPanel()}${this.renderSidePanel()}${this.renderSideActionBar()}</arcgis-code-editor-shell>`}};B("arcgis-arcade-editor",P);return P},"identity/IdentityManager",a,c,d,e)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import f from"./ZNCDS24C.js";import b from"./T7FHSGLE.js";import{a as _}from"./W2JMP5SF.js";import"./72K7GT6K.js";import"./OT7KTREL.js";import a from"./IUTESHGR.js";import"./72CKSOAE.js";import"./YBVT4QY4.js";import"./EMCHMKAC.js";import"./3YF4QLXU.js";import"./NMIFSDFV.js";import"./VVVV256M.js";import{D as l,E as h,F as p,G as r,J as g,h as c,j as e,n as o,s as d}from"./6U7HXYYK.js";import{b as s}from"./RXOG5OZ7.js";import"./E26VIEON.js";import"./CVNYRL2K.js";import"./NXRT3FAY.js";import"./YCOWKBW5.js";import"./ALDX5YZO.js";export default $arcgis.t(([,{a:a},{b:f}])=>{var m=c`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`,n=class extends p{constructor(){super(...arguments),this._codeEditorElt=l(),this._disposables=[],this.messages=_(),this._modelId=d(),this._preparing=!1,this.sideActionBarExpanded=!1,this.script="",this.hideSideBar=!1,this.arcgisDiagnosticsChange=o({bubbles:!1}),this.arcgisScriptChange=o({bubbles:!1})}static{this.properties={_activeAction:16,_apiLibrary:16,_editorProfile:16,_preparing:16,sideActionBarExpanded:16,profile:0,script:1,hideSideBar:5}}static{this.styles=[m]}async setFocus(){await this._codeEditorElt.value?.setFocus()}async load(){await this._updateEditorProfile().catch(s(this))}willUpdate(i){(i.has("messages")||i.has("profile"))&&this._updateDataModelDeps()}async loaded(){let i=await f();this._disposables.push(i.onDiagnosticsChange(t=>!this._preparing&&this.arcgisDiagnosticsChange.emit(t.diagnostics)))}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}async _updateEditorProfile(){this._preparing=!0;try{await a.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale}),this._editorProfile=a.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._preparing=!1}}_setActiveAction(i){if(this._activeAction===i){this._activeAction=void 0;return}this._activeAction=i}_handleActionClick(i){let t=i.target;this._setActiveAction(t.dataset.panelName)}_insertAsSnippet(i){this._codeEditorElt.value?.insertSnippet(i.detail).catch(s(this))}_insertAsText(i){this._codeEditorElt.value?.insertText(i.detail.replaceAll('"',"'")).catch(s(this))}async _updateApiLibrary(){this._apiLibrary=await a.getApiLibraryForModel(this._modelId)}_onCodeEditorValueChange(i){i.stopPropagation(),this.script=i.detail,this.arcgisScriptChange.emit(i.detail)}_getFeatureSetVariable(){let i,t=a.getEditorProfileForModel(this._modelId);return t?.variables?.length&&t?.variables?.[0]?.type!=="featureSet"?s(this)("Encountered unexpected editor profile"):i=t?.variables?.[0],i}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}render(){let i=this._getFeatureSetVariable();return e`<arcgis-code-editor-shell><arcgis-code-editor slot=editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script??""} @arcgisValueChange=${this._onCodeEditorValueChange} ${h(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar&&i&&e`<arcgis-editor-variables slot=side-panel .variable=${i} .closed=${this._activeAction!=="fields"} class=${r(this._activeAction==="fields"?"":"hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${()=>this._setActiveAction(void 0)} data-panel-name=none></arcgis-editor-variables>`||""}${!this.hideSideBar&&e`<arcgis-language-api-panel slot=side-panel class=${r(this._activeAction==="functions"?"":"hidden")} .closed=${this._activeAction!=="functions"} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${()=>this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions .languageId=${a.languageId}></arcgis-language-api-panel>`||""}${!this.hideSideBar&&e`<calcite-action-bar slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}>${i&&e`<calcite-action id=fields-action .text=${this.messages.fields??"Fields"} icon=profile-variables .active=${this._activeAction==="fields"} data-panel-name=fields @click=${this._handleActionClick}></calcite-action>`||""}${i&&!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=fields-action><span>${this.messages.fields??"Fields"}</span></calcite-tooltip>`||""}<calcite-action id=functions-action .text=${this.messages.functions??"Functions"} icon=function .active=${this._activeAction==="functions"} data-panel-name=functions @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions??"Functions"}</span></calcite-tooltip>`||""}</calcite-action-bar>`||""}</arcgis-code-editor-shell>`}};g("arcgis-sql-expression-editor",n);return n},a,b,f)
2
+ import f from"./EMAIRRWT.js";import b from"./5NF53HUD.js";import{a as _}from"./ASHNQ3IP.js";import"./72K7GT6K.js";import"./X6QPPSDX.js";import a from"./IUHZTBRV.js";import"./72CKSOAE.js";import"./XPCVJY3A.js";import"./EMCHMKAC.js";import"./3YF4QLXU.js";import"./NMIFSDFV.js";import"./VVVV256M.js";import{D as l,E as h,F as p,G as r,J as g,h as c,j as e,n as o,s as d}from"./7GDBSWXQ.js";import{b as s}from"./RXOG5OZ7.js";import"./E26VIEON.js";import"./CVNYRL2K.js";import"./NXRT3FAY.js";import"./YCOWKBW5.js";import"./ALDX5YZO.js";export default $arcgis.t(([,{a:a},{b:f}])=>{var m=c`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`,n=class extends p{constructor(){super(...arguments),this._codeEditorElt=l(),this._disposables=[],this.messages=_(),this._modelId=d(),this._preparing=!1,this.sideActionBarExpanded=!1,this.script="",this.hideSideBar=!1,this.arcgisDiagnosticsChange=o({bubbles:!1}),this.arcgisScriptChange=o({bubbles:!1})}static{this.properties={_activeAction:16,_apiLibrary:16,_editorProfile:16,_preparing:16,sideActionBarExpanded:16,profile:0,script:1,hideSideBar:5}}static{this.styles=[m]}async setFocus(){await this._codeEditorElt.value?.setFocus()}async load(){await this._updateEditorProfile().catch(s(this))}willUpdate(i){(i.has("messages")||i.has("profile"))&&this._updateDataModelDeps()}async loaded(){let i=await f();this._disposables.push(i.onDiagnosticsChange(t=>!this._preparing&&this.arcgisDiagnosticsChange.emit(t.diagnostics)))}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}async _updateEditorProfile(){this._preparing=!0;try{await a.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale}),this._editorProfile=a.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._preparing=!1}}_setActiveAction(i){if(this._activeAction===i){this._activeAction=void 0;return}this._activeAction=i}_handleActionClick(i){let t=i.target;this._setActiveAction(t.dataset.panelName)}_insertAsSnippet(i){this._codeEditorElt.value?.insertSnippet(i.detail).catch(s(this))}_insertAsText(i){this._codeEditorElt.value?.insertText(i.detail.replaceAll('"',"'")).catch(s(this))}async _updateApiLibrary(){this._apiLibrary=await a.getApiLibraryForModel(this._modelId)}_onCodeEditorValueChange(i){i.stopPropagation(),this.script=i.detail,this.arcgisScriptChange.emit(i.detail)}_getFeatureSetVariable(){let i,t=a.getEditorProfileForModel(this._modelId);return t?.variables?.length&&t?.variables?.[0]?.type!=="featureSet"?s(this)("Encountered unexpected editor profile"):i=t?.variables?.[0],i}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}render(){let i=this._getFeatureSetVariable();return e`<arcgis-code-editor-shell><arcgis-code-editor slot=editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script??""} @arcgisValueChange=${this._onCodeEditorValueChange} ${h(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar&&i&&e`<arcgis-editor-variables slot=side-panel .variable=${i} .closed=${this._activeAction!=="fields"} class=${r(this._activeAction==="fields"?"":"hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${()=>this._setActiveAction(void 0)} data-panel-name=none></arcgis-editor-variables>`||""}${!this.hideSideBar&&e`<arcgis-language-api-panel slot=side-panel class=${r(this._activeAction==="functions"?"":"hidden")} .closed=${this._activeAction!=="functions"} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${()=>this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions .languageId=${a.languageId}></arcgis-language-api-panel>`||""}${!this.hideSideBar&&e`<calcite-action-bar slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}>${i&&e`<calcite-action id=fields-action .text=${this.messages.fields??"Fields"} icon=profile-variables .active=${this._activeAction==="fields"} data-panel-name=fields @click=${this._handleActionClick}></calcite-action>`||""}${i&&!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=fields-action><span>${this.messages.fields??"Fields"}</span></calcite-tooltip>`||""}<calcite-action id=functions-action .text=${this.messages.functions??"Functions"} icon=function .active=${this._activeAction==="functions"} data-panel-name=functions @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions??"Functions"}</span></calcite-tooltip>`||""}</calcite-action-bar>`||""}</arcgis-code-editor-shell>`}};g("arcgis-sql-expression-editor",n);return n},a,b,f)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{h as P,j as O}from"./NMIFSDFV.js";import{a as y,b,c as h,d as u,e as x,f as E,m as f,o as C}from"./6U7HXYYK.js";var w=e=>(...n)=>{let t=u(),o=new e(...n),s=o.exports;h(t.at(-1));let r=o.component.manager;r.W(o,s),o.watchExports(r.W.bind(r,o)),x(o);let a=[o.component,...t].reverse();return f(a,i=>i===void 0?void 0:N(o,i,s),s)},N=(e,{host:n,key:t,isReactive:o},s)=>{let r=n,a=r[t]!==e.exports,i=r[t]!==s,c=s!==e.exports;if(a&&!i&&c&&(r[t]=e.exports),n===e.component){if(o){let p=e.component.manager;i&&p.W(e,r[t]),e.onUpdate(m=>{if(m.has(t)){let g=r[t];g!==e.exports&&p.W(e,g)}})}e.O=o?void 0:t}let d=e.component.constructor.elementProperties.get(t)?.readOnly;e.watchExports(()=>{r[t]!==e.exports&&(d?E(()=>{r[t]=e.exports}):r[t]=e.exports)})};var L=e=>D(void 0,e);var v=class extends C{constructor(n,t){super(n);let o=this.exports;try{b(this.component);let s=t(this.component,this),r=this.exports!==o;if(y(s)){r||this.setProvisionalExports(s);let a=s.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!r||s!==void 0)&&(this.exports=s),queueMicrotask(()=>super.catchUpLifecycle())}catch(s){this.P.reject(s)}}catchUpLifecycle(){}},D=w(v);var G=L;var $=e=>(n={})=>L((t,o)=>{let s=P(t.el),r={_lang:s.lang,_t9nLocale:s.t9nLocale,_loading:!0},a=t;o.onLifecycle(()=>O(t.el,()=>e("./assets"),({t9nLocale:c,t9nStrings:l,lang:d})=>{let p={...l,_lang:d,_t9nLocale:c,_loading:!1};o.exports=p;let m=l.componentLabel;typeof m=="string"&&"label"in t&&t.label==null&&(t.label??=m),i(a.messageOverrides)},n.name));let i=c=>{let l=o.exports,d=l._original??l,p=_(d,c);c&&(p._original=d),o.exports=p};return"messageOverrides"in a&&o.onUpdate(c=>{c.has("messageOverrides")&&i(a.messageOverrides)}),n.blocking?(o.setProvisionalExports(r,!1),o.ready):r}),_=(e,n)=>{if(!n)return e;let t={...e};return Object.entries(n).forEach(([o,s])=>{e[o]!==void 0&&(typeof s=="object"?t[o]=_(e[o],s):t[o]=s??e[o])}),t};export{G as a,$ as b};
2
+ import{h as P,j as O}from"./NMIFSDFV.js";import{a as y,b,c as h,d as u,e as x,f as E,m as f,o as C}from"./7GDBSWXQ.js";var w=e=>(...n)=>{let t=u(),o=new e(...n),s=o.exports;h(t.at(-1));let r=o.component.manager;r.W(o,s),o.watchExports(r.W.bind(r,o)),x(o);let a=[o.component,...t].reverse();return f(a,i=>i===void 0?void 0:N(o,i,s),s)},N=(e,{host:n,key:t,isReactive:o},s)=>{let r=n,a=r[t]!==e.exports,i=r[t]!==s,c=s!==e.exports;if(a&&!i&&c&&(r[t]=e.exports),n===e.component){if(o){let p=e.component.manager;i&&p.W(e,r[t]),e.onUpdate(m=>{if(m.has(t)){let g=r[t];g!==e.exports&&p.W(e,g)}})}e.O=o?void 0:t}let d=e.component.constructor.elementProperties.get(t)?.readOnly;e.watchExports(()=>{r[t]!==e.exports&&(d?E(()=>{r[t]=e.exports}):r[t]=e.exports)})};var L=e=>D(void 0,e);var v=class extends C{constructor(n,t){super(n);let o=this.exports;try{b(this.component);let s=t(this.component,this),r=this.exports!==o;if(y(s)){r||this.setProvisionalExports(s);let a=s.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!r||s!==void 0)&&(this.exports=s),queueMicrotask(()=>super.catchUpLifecycle())}catch(s){this.P.reject(s)}}catchUpLifecycle(){}},D=w(v);var G=L;var $=e=>(n={})=>L((t,o)=>{let s=P(t.el),r={_lang:s.lang,_t9nLocale:s.t9nLocale,_loading:!0},a=t;o.onLifecycle(()=>O(t.el,()=>e("./assets"),({t9nLocale:c,t9nStrings:l,lang:d})=>{let p={...l,_lang:d,_t9nLocale:c,_loading:!1};o.exports=p;let m=l.componentLabel;typeof m=="string"&&"label"in t&&t.label==null&&(t.label??=m),i(a.messageOverrides)},n.name));let i=c=>{let l=o.exports,d=l._original??l,p=_(d,c);c&&(p._original=d),o.exports=p};return"messageOverrides"in a&&o.onUpdate(c=>{c.has("messageOverrides")&&i(a.messageOverrides)}),n.blocking?(o.setProvisionalExports(r,!1),o.ready):r}),_=(e,n)=>{if(!n)return e;let t={...e};return Object.entries(n).forEach(([o,s])=>{e[o]!==void 0&&(typeof s=="object"?t[o]=_(e[o],s):t[o]=s??e[o])}),t};export{G as a,$ as b};
@@ -1,4 +1,4 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{f as d}from"./3YF4QLXU.js";import{q as c}from"./6U7HXYYK.js";function L(t,r,m,u){if(!r)return[];let e=Array.isArray(r)?r:[r];if(!e.length)return[];let l=c(m);return t.filter(o=>e.some(a=>l.test(String(o[a]??""))))}function N(t){return t?`${t.portal.url}/home/item.html?id=${t.id}`:""}function C(t,r,m="add",u){if(!t)return;let e=t.getSelection(),l=e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),o=[],a=t.getValue()??"";if(m==="replace"){let i=`${u}
2
+ import{f as d}from"./3YF4QLXU.js";import{q as c}from"./7GDBSWXQ.js";function L(t,r,m,u){if(!r)return[];let e=Array.isArray(r)?r:[r];if(!e.length)return[];let l=c(m);return t.filter(o=>e.some(a=>l.test(String(o[a]??""))))}function N(t){return t?`${t.portal.url}/home/item.html?id=${t.id}`:""}function C(t,r,m="add",u){if(!t)return;let e=t.getSelection(),l=e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),o=[],a=t.getValue()??"";if(m==="replace"){let i=`${u}
3
3
  ${r}`,s=t.getModel(),n=s?.getLineCount()??1,f=s?.getLineMaxColumn(n)??1;o=[{range:{startLineNumber:1,startColumn:1,endLineNumber:n,endColumn:f},text:i}]}else{let i=l?{startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn}:(()=>{let n=t.getPosition();return{startLineNumber:n?.lineNumber??1,startColumn:n?.column??1,endLineNumber:n?.lineNumber??1,endColumn:n?.column??1}})(),s=!1;if(u){let n=u.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");s=!new RegExp(`^\\s*${n}\\s*$`,"mu").test(a)}s&&o.push({range:{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1},text:`${u}
4
4
  `}),o.push({range:i,text:r})}try{t.pushUndoStop(),t.executeEdits("insertText",o),t.pushUndoStop(),t.focus()}catch(i){console.error("Failed to edit model:",i)}}function g(t){try{return d(t)}catch{return t}}export{L as a,N as b,C as c,g as d};
@@ -18245,7 +18245,7 @@ function se(t, e, r, n) {
18245
18245
  const cr = { apiKey: void 0, apiKeys: { scopes: [] }, applicationName: "", applicationUrl: globalThis.location?.href, assetsPath: "", fontsUrl: "https://static.arcgis.com/fonts", geometryServiceUrl: "https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer", geoRSSServiceUrl: "https://utility.arcgis.com/sharing/rss", kmlServiceUrl: "https://utility.arcgis.com/sharing/kml", userPrivilegesApplied: !0, portalUrl: "https://www.arcgis.com", respectPrefersReducedMotion: !0, routeServiceUrl: "https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World", workers: { loaderConfig: { has: {}, paths: {}, map: {}, packages: [] } }, request: { crossOriginNoCorsDomains: null, httpsDomains: ["arcgis.com", "arcgisonline.com", "esrikr.com", "premiumservices.blackbridge.com", "esripremium.accuweather.com", "gbm.digitalglobe.com", "firstlook.digitalglobe.com", "msi.digitalglobe.com"], interceptors: [], internalInterceptors: [], maxUrlLength: 2e3, priority: "high", proxyRules: [], proxyUrl: null, timeout: 62e3, trustedServers: [], useIdentity: !0 }, log: { interceptors: [], level: null } };
18246
18246
  if (globalThis.esriConfig && (Y4(cr, globalThis.esriConfig, !0), delete cr.has), !cr.assetsPath) {
18247
18247
  {
18248
- const t = "5.0.1";
18248
+ const t = "5.0.3";
18249
18249
  cr.assetsPath = `https://js.arcgis.com/${t}/@arcgis/core/assets`;
18250
18250
  }
18251
18251
  cr.defaultAssetsPath = cr.assetsPath;
package/dist/cdn/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{I as s,u as e}from"./6U7HXYYK.js";import"./RXOG5OZ7.js";import"./ALDX5YZO.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./THHEGBKT.js"),"appVersion,assistantsEnabled,closed,closePanel:,disableQuestionAnswerLogging,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,serviceUrl;destroy"],"arcgis-arcade-editor":[()=>import("./LD7DURDC.js"),"arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./KDGZSV4O.js"),"calciteModeDark,consoleLogs:,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./6WIFXREU.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./2QPIHRFJ.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./Z56K7QEJ.js")],"arcgis-code-viewer":[()=>import("./2JK6AL22.js"),"language,round"],"arcgis-editor-variables":[()=>import("./OLYB6UKA.js"),"closed,loading,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./Y22RYIEX.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./RC7PZDYD.js"),"hideSideBar,messages:,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,s)
2
+ import{I as s,u as e}from"./7GDBSWXQ.js";import"./RXOG5OZ7.js";import"./ALDX5YZO.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./KJQGH7SU.js"),"appVersion,assistantsEnabled,closed,closePanel:,disableQuestionAnswerLogging,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,serviceUrl;destroy"],"arcgis-arcade-editor":[()=>import("./NQW6FYM2.js"),"arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./J2GWTHFG.js"),"calciteModeDark,consoleLogs:,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./MZZXWSGW.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./HUHLRK6Q.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./MZDCQDLA.js")],"arcgis-code-viewer":[()=>import("./BW43HUEN.js"),"language,round"],"arcgis-editor-variables":[()=>import("./5QDI2OLQ.js"),"closed,loading,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./HWIV6BSW.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./UPXS4WP7.js"),"hideSideBar,messages:,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,s)
@@ -2,7 +2,7 @@
2
2
  import "../cdn/main.css";
3
3
  import { makeRuntime as e } from "@arcgis/lumina";
4
4
  import { trackAccess as s, createObservable as r, createTrackingTarget as a, runTracked as c } from "@arcgis/core/applications/Components/reactiveUtils.js";
5
- const t = e({ defaultAssetPath: "https://js.arcgis.com/5.0.1/coding-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: i, setAssetPath: d } = t;
5
+ const t = e({ defaultAssetPath: "https://js.arcgis.com/5.0.3/coding-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: i, setAssetPath: d } = t;
6
6
  t.t = s;
7
7
  t.o = r;
8
8
  t.c = a;