@arcgis/coding-components 5.2.0-next.4 → 5.2.0-next.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/cdn/{4G3EYLJY.js → 2YYB74Y3.js} +1 -1
  2. package/dist/cdn/{WWVPYM5B.js → 4HJRS4I7.js} +1 -1
  3. package/dist/cdn/DOCWTXKZ.js +12 -0
  4. package/dist/cdn/HBKQDGYR.js +2 -0
  5. package/dist/cdn/{QW7OA32G.js → HDEGIRFB.js} +1 -1
  6. package/dist/cdn/{HRM2JUGO.js → HQPGLNWP.js} +1 -1
  7. package/dist/cdn/I3XXIRZX.js +2 -0
  8. package/dist/cdn/ID5LCA7T.js +2 -0
  9. package/dist/cdn/{LUJKYDO7.js → IL7DUQH7.js} +1 -1
  10. package/dist/cdn/JEBRK3DP.js +2 -0
  11. package/dist/cdn/MZMKV7FA.js +2 -0
  12. package/dist/cdn/{IETP57KJ.js → NKDL6NEF.js} +1 -1
  13. package/dist/cdn/NL736YG3.js +6 -0
  14. package/dist/cdn/{3CHKFCKR.js → SFHJYB2X.js} +1 -1
  15. package/dist/cdn/{O3PQD5N5.js → SYW5WY2N.js} +1 -1
  16. package/dist/cdn/{CA3GVMWI.js → UDPKHTMC.js} +1 -1
  17. package/dist/cdn/UQRZDUGL.js +2 -0
  18. package/dist/cdn/{QGBZYXBS.js → XMXK333I.js} +1 -1
  19. package/dist/cdn/{QUR4WECO.js → XWUEYP6T.js} +1 -1
  20. package/dist/cdn/assets/arcade-language/api/arcade-api.t9n.en.json +1 -1
  21. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ar.json +1 -1
  22. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.bg.json +1 -1
  23. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.bs.json +1 -1
  24. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ca.json +1 -1
  25. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.cs.json +1 -1
  26. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.da.json +1 -1
  27. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.de.json +1 -1
  28. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.el.json +1 -1
  29. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.es.json +1 -1
  30. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.et.json +1 -1
  31. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.fi.json +1 -1
  32. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.fr.json +1 -1
  33. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.he.json +1 -1
  34. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.hr.json +1 -1
  35. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.hu.json +1 -1
  36. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.id.json +1 -1
  37. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.it.json +1 -1
  38. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ja.json +1 -1
  39. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ko.json +1 -1
  40. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.lt.json +1 -1
  41. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.lv.json +1 -1
  42. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.nl.json +1 -1
  43. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.no.json +1 -1
  44. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.pl.json +1 -1
  45. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.pt-BR.json +1 -1
  46. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.pt-PT.json +1 -1
  47. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ro.json +1 -1
  48. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ru.json +1 -1
  49. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.sk.json +1 -1
  50. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.sl.json +1 -1
  51. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.sr.json +1 -1
  52. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.sv.json +1 -1
  53. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.th.json +1 -1
  54. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.tr.json +1 -1
  55. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.uk.json +1 -1
  56. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.vi.json +1 -1
  57. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.zh-CN.json +1 -1
  58. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.zh-HK.json +1 -1
  59. package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.zh-TW.json +1 -1
  60. package/dist/cdn/assets/code-editor/sql-expr.worker.js +2 -2
  61. package/dist/cdn/index.js +1 -1
  62. package/dist/chunks/arcade-defaults.js +56 -54
  63. package/dist/chunks/fields.js +18 -14
  64. package/dist/chunks/language-defaults-base.js +230 -221
  65. package/dist/chunks/sql-expr-defaults.js +63 -59
  66. package/dist/components/arcgis-arcade-debugger-console/customElement.js +6 -6
  67. package/dist/components/arcgis-arcade-editor/customElement.d.ts +38 -3
  68. package/dist/components/arcgis-arcade-editor/customElement.js +147 -151
  69. package/dist/components/arcgis-code-editor-shell/customElement.js +5 -5
  70. package/dist/components/arcgis-editor-variables/customElement.js +12 -6
  71. package/dist/components/arcgis-sql-expression-editor/customElement.d.ts +11 -0
  72. package/dist/components/arcgis-sql-expression-editor/customElement.js +5 -5
  73. package/dist/docs/api.json +1 -1
  74. package/dist/docs/docs.json +1 -1
  75. package/dist/docs/vscode.html-custom-data.json +1 -1
  76. package/dist/docs/web-types.json +1 -1
  77. package/dist/loader.js +2 -2
  78. package/dist/types/lumina.d.ts +1 -1
  79. package/dist/types/preact.d.ts +1 -1
  80. package/dist/types/react.d.ts +1 -1
  81. package/dist/types/stencil.d.ts +1 -1
  82. package/package.json +6 -6
  83. package/dist/cdn/4N67XYKO.js +0 -2
  84. package/dist/cdn/B5A6XU2C.js +0 -2
  85. package/dist/cdn/CQTJWVFM.js +0 -6
  86. package/dist/cdn/G5IXPOCO.js +0 -2
  87. package/dist/cdn/RMVHO2AH.js +0 -12
  88. package/dist/cdn/RO6RHW6I.js +0 -2
  89. package/dist/cdn/TWEJITWD.js +0 -2
  90. package/dist/cdn/ZTCCL565.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import j from"./3CHKFCKR.js";import i from"./72E5GBWN.js";import"./5HKDO4SX.js";import"./ZTCCL565.js";import h from"./2WB7S5TQ.js";import{a as x}from"./2WVAYBDV.js";import"./CC4XBW6V.js";import"./TQDN6SR5.js";import{c as b,e as $}from"./XSKI5PRU.js";import"./ECNI2A4K.js";import{E as c,F as o,G as v,H as r,K as f,h as g,j as e,n as d,p as s,u as a}from"./XU7YAUUX.js";import"./VGOFAQ7A.js";import"./H6RQVSYM.js";export default $arcgis.t(([{b:R},{c:y,d:w,e:u,g:P,h:m,i:k,j:S},{a:l,b:T,c:C,d:L,e:M,f:I}])=>{var _=g`: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;min-height:0}.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{display:flex;flex-direction:column;min-height:0;.table-scroll{overflow:auto;flex:1 1 auto;min-height:0;max-width:100%;background-color:var(--calcite-color-foreground-1)}table{min-width:max-content;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}}}`,n={onClick:p=>{let t=p.currentTarget;t.expanded=!t.expanded}},h=class extends v{constructor(){super(...arguments),this.messages=x(),this.outputRef=c(),this.consoleRef=c(),this.logRef=c(),this.openedResultPanel="output",this.hideHeader=!1,this.arcgisInternalClosePanel=d({bubbles:!1,composed:!1}),this.arcgisInternalOpenedResultPanelChange=d({bubbles:!1,composed:!1})}static{this.properties={consoleLogs:0,loading:5,openedResultPanel:3,result:0,hideHeader:5}}static{this.styles=[_,k(),S]}load(){this.manager.onLifecycle(()=>{let t=b(this.el,["class"],this.updateTheme.bind(this));return this.updateTheme(),()=>t()})}loaded(){this.hideHeader||this.openedResultPanel&&(this.openedResultPanel==="output"&&this.outputRef.value?this.outputRef.value.setFocus():this.openedResultPanel==="console"&&this.consoleRef.value?this.consoleRef.value.setFocus():this.openedResultPanel==="log"&&this.logRef.value&&this.logRef.value.setFocus())}updateResultPanel(t){this.openedResultPanel=t,this.arcgisInternalOpenedResultPanelChange.emit()}_switchResultPanel(t){let i=t.currentTarget.dataset.panelName;i&&this.updateResultPanel(i)}_emitClose(){this.arcgisInternalClosePanel.emit()}updateTheme(){$(this.el)==="dark"?this.elementInternals.states.add(m):this.elementInternals.states.delete(m)}renderConsolePanel(){return this.openedResultPanel!=="console"?null:this.loading&&!this.consoleLogs?.length?e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"loading"}></calcite-loader>`:e`<div class="console-logs-container ltr-container">${this.consoleLogs?.length?this.consoleLogs.map(t=>e`<p>${t}</p>`):e`<p>${this.messages.consolemessage}</p>`}</div>`}renderLogPanel(){if(this.openedResultPanel!=="log")return null;if(this.loading)return e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"loading"}></calcite-loader>`;let t=this.result?.type==="error"?"color-error":"color-success";return e`<calcite-list .label=${this.messages.results??"Results"}>${this.result?e`<calcite-list-item .label=${a(this.messages.lastexecutionformat,{timeStamp:new Intl.DateTimeFormat(this.messages._t9nLocale,{dateStyle:"medium",timeStyle:"medium"}).format(this.result.timeStamp)})}><calcite-icon slot=content-start icon=information scale=s class=${r(t)}></calcite-icon></calcite-list-item><calcite-list-item .label=${a(this.messages.compilationtimeformat,{time:new Intl.NumberFormat(this.messages._t9nLocale,{style:"unit",unit:"millisecond",maximumFractionDigits:2}).format(this.result.compilationTime??0)})}><calcite-icon slot=content-start icon=information scale=s class=${r(t)}></calcite-icon></calcite-list-item><calcite-list-item .label=${a(this.messages.executiontimeformat,{time:new Intl.NumberFormat(this.messages._t9nLocale,{style:"unit",unit:"millisecond",maximumFractionDigits:2}).format(this.result.executionTime??0)})}><calcite-icon slot=content-start icon=information scale=s class=${r(t)}></calcite-icon></calcite-list-item>`:e`<calcite-list-item .label=${this.messages.runscriptmessage}><calcite-icon slot=content-start icon=information scale=s class="color-info"></calcite-icon></calcite-list-item>`}</calcite-list>`}renderOutputPanel(){if(this.openedResultPanel!=="output")return null;if(this.loading)return e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"loading"}></calcite-loader>`;switch(this.result?.type){case"error":return e`<div class="result-value-simple flex-adjustable">${a(this.messages.executionerrorformat??"",{message:this.result.value})}</div>`;case"null":case"unknown":return e`<div class="result-value-simple ltr-container">${u({type:this.result.type,value:s(this.result.type)})}</div>`;case"text":case"number":case"date":case"dateOnly":case"time":case"boolean":{let{type:t,value:i}=P(this.result);return e`<div class="result-value-simple ltr-container"><span class="value-type">${s(this.result.type)}:&nbsp;</span>${u({type:t,value:i})}</div>`}case"array":{let t=(this.result.value??[]).slice(0,R);return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}><calcite-tree-item expanded @click=${n.onClick}><div class="tree-item-label">${T({arcadeResult:this.result,t9nStrings:this.messages})}</div>${M({items:t,subtree:!0,t9nStrings:this.messages})}</calcite-tree-item></calcite-tree></div>`}case"geometry":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}><calcite-tree-item expanded @click=${n.onClick}><div class="tree-item-label">${s(this.result.type)}</div>${w({value:this.result.value,subtree:!0})}</calcite-tree-item></calcite-tree></div>`;case"attachment":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}><calcite-tree-item expanded @click=${n.onClick}><div class="tree-item-label">${s(this.result.type)}</div>${y({obj:this.result.value.castAsJson(),subtree:!0})}</calcite-tree-item></calcite-tree></div>`;case"feature":case"dictionary":case"portal":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}><calcite-tree-item expanded @click=${n.onClick}><div class="tree-item-label">${s(this.result.type)}</div>${C({value:this.result.value,subtree:!0,t9nStrings:this.messages})}</calcite-tree-item></calcite-tree></div>`;case"featureSet":return e`<div class="result-value-table ltr-container">${L({arcadeResult:this.result,t9nStrings:this.messages})}${I({arcadeResult:this.result})}</div>`;case"knowledgeGraph":return e`<div class="result-value-simple ltr-container"><span class="value-type">${s(this.result.type)}:&nbsp;</span><span class="string-value">${this.result.value.url}</span></div>`;default:return e`<div class="result-value-simple flex-adjustable ltr-container">${this.messages.runscriptmessage}</div>`}}render(){return e`${this.hideHeader?null:e`<header class="flex-row"><calcite-action-bar class="flex-adjustable" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .active=${this.openedResultPanel==="output"} .text=${this.messages.output??""} text-enabled scale=s icon=list-show-all icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=output ${o(this.outputRef)}></calcite-action><calcite-action .active=${this.openedResultPanel==="console"} .text=${this.messages.console??""} text-enabled scale=s icon=console icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=console ${o(this.consoleRef)}></calcite-action><calcite-action .active=${this.openedResultPanel==="log"} .text=${this.messages.log??""} text-enabled scale=s icon=list icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=log ${o(this.logRef)}></calcite-action></calcite-action-group></calcite-action-bar><calcite-action scale=s icon=x .text=${this.messages.close??""} @click=${this._emitClose}></calcite-action></header>`}<article class="flex-adjustable">${this.loading?e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"}></calcite-loader>`:e`<div class="flex-column y-scrollable-container">${this.renderOutputPanel()}${this.renderConsolePanel()}${this.renderLogPanel()}</div>`}</article>`}};f("arcgis-arcade-results",h);return h},h,i,j)
2
+ import j from"./SFHJYB2X.js";import i from"./72E5GBWN.js";import"./5HKDO4SX.js";import"./MZMKV7FA.js";import h from"./2WB7S5TQ.js";import{a as x}from"./2WVAYBDV.js";import"./CC4XBW6V.js";import"./TQDN6SR5.js";import{c as b,e as $}from"./XSKI5PRU.js";import"./ECNI2A4K.js";import{E as c,F as o,G as v,H as r,K as f,h as g,j as e,n as d,p as s,u as a}from"./XU7YAUUX.js";import"./VGOFAQ7A.js";import"./H6RQVSYM.js";export default $arcgis.t(([{b:R},{c:y,d:w,e:u,g:P,h:m,i:k,j:S},{a:l,b:T,c:C,d:L,e:M,f:I}])=>{var _=g`: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;min-height:0}.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{display:flex;flex-direction:column;min-height:0;.table-scroll{overflow:auto;flex:1 1 auto;min-height:0;max-width:100%;background-color:var(--calcite-color-foreground-1)}table{min-width:max-content;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}}}`,n={onClick:p=>{let t=p.currentTarget;t.expanded=!t.expanded}},h=class extends v{constructor(){super(...arguments),this.messages=x(),this.outputRef=c(),this.consoleRef=c(),this.logRef=c(),this.openedResultPanel="output",this.hideHeader=!1,this.arcgisInternalClosePanel=d({bubbles:!1,composed:!1}),this.arcgisInternalOpenedResultPanelChange=d({bubbles:!1,composed:!1})}static{this.properties={consoleLogs:0,loading:5,openedResultPanel:3,result:0,hideHeader:5}}static{this.styles=[_,k(),S]}load(){this.manager.onLifecycle(()=>{let t=b(this.el,["class"],this.updateTheme.bind(this));return this.updateTheme(),()=>t()})}loaded(){this.hideHeader||this.openedResultPanel&&(this.openedResultPanel==="output"&&this.outputRef.value?this.outputRef.value.setFocus():this.openedResultPanel==="console"&&this.consoleRef.value?this.consoleRef.value.setFocus():this.openedResultPanel==="log"&&this.logRef.value&&this.logRef.value.setFocus())}updateResultPanel(t){this.openedResultPanel=t,this.arcgisInternalOpenedResultPanelChange.emit()}_switchResultPanel(t){let i=t.currentTarget.dataset.panelName;i&&this.updateResultPanel(i)}_emitClose(){this.arcgisInternalClosePanel.emit()}updateTheme(){$(this.el)==="dark"?this.elementInternals.states.add(m):this.elementInternals.states.delete(m)}renderConsolePanel(){return this.openedResultPanel!=="console"?null:this.loading&&!this.consoleLogs?.length?e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"loading"}></calcite-loader>`:e`<div class="console-logs-container ltr-container">${this.consoleLogs?.length?this.consoleLogs.map(t=>e`<p>${t}</p>`):e`<p>${this.messages.consolemessage}</p>`}</div>`}renderLogPanel(){if(this.openedResultPanel!=="log")return null;if(this.loading)return e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"loading"}></calcite-loader>`;let t=this.result?.type==="error"?"color-error":"color-success";return e`<calcite-list .label=${this.messages.results??"Results"}>${this.result?e`<calcite-list-item .label=${a(this.messages.lastexecutionformat,{timeStamp:new Intl.DateTimeFormat(this.messages._t9nLocale,{dateStyle:"medium",timeStyle:"medium"}).format(this.result.timeStamp)})}><calcite-icon slot=content-start icon=information scale=s class=${r(t)}></calcite-icon></calcite-list-item><calcite-list-item .label=${a(this.messages.compilationtimeformat,{time:new Intl.NumberFormat(this.messages._t9nLocale,{style:"unit",unit:"millisecond",maximumFractionDigits:2}).format(this.result.compilationTime??0)})}><calcite-icon slot=content-start icon=information scale=s class=${r(t)}></calcite-icon></calcite-list-item><calcite-list-item .label=${a(this.messages.executiontimeformat,{time:new Intl.NumberFormat(this.messages._t9nLocale,{style:"unit",unit:"millisecond",maximumFractionDigits:2}).format(this.result.executionTime??0)})}><calcite-icon slot=content-start icon=information scale=s class=${r(t)}></calcite-icon></calcite-list-item>`:e`<calcite-list-item .label=${this.messages.runscriptmessage}><calcite-icon slot=content-start icon=information scale=s class="color-info"></calcite-icon></calcite-list-item>`}</calcite-list>`}renderOutputPanel(){if(this.openedResultPanel!=="output")return null;if(this.loading)return e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"loading"}></calcite-loader>`;switch(this.result?.type){case"error":return e`<div class="result-value-simple flex-adjustable">${a(this.messages.executionerrorformat??"",{message:this.result.value})}</div>`;case"null":case"unknown":return e`<div class="result-value-simple ltr-container">${u({type:this.result.type,value:s(this.result.type)})}</div>`;case"text":case"number":case"date":case"dateOnly":case"time":case"boolean":{let{type:t,value:i}=P(this.result);return e`<div class="result-value-simple ltr-container"><span class="value-type">${s(this.result.type)}:&nbsp;</span>${u({type:t,value:i})}</div>`}case"array":{let t=(this.result.value??[]).slice(0,R);return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}><calcite-tree-item expanded @click=${n.onClick}><div class="tree-item-label">${T({arcadeResult:this.result,t9nStrings:this.messages})}</div>${M({items:t,subtree:!0,t9nStrings:this.messages})}</calcite-tree-item></calcite-tree></div>`}case"geometry":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}><calcite-tree-item expanded @click=${n.onClick}><div class="tree-item-label">${s(this.result.type)}</div>${w({value:this.result.value,subtree:!0})}</calcite-tree-item></calcite-tree></div>`;case"attachment":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}><calcite-tree-item expanded @click=${n.onClick}><div class="tree-item-label">${s(this.result.type)}</div>${y({obj:this.result.value.castAsJson(),subtree:!0})}</calcite-tree-item></calcite-tree></div>`;case"feature":case"dictionary":case"portal":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}><calcite-tree-item expanded @click=${n.onClick}><div class="tree-item-label">${s(this.result.type)}</div>${C({value:this.result.value,subtree:!0,t9nStrings:this.messages})}</calcite-tree-item></calcite-tree></div>`;case"featureSet":return e`<div class="result-value-table ltr-container">${L({arcadeResult:this.result,t9nStrings:this.messages})}${I({arcadeResult:this.result})}</div>`;case"knowledgeGraph":return e`<div class="result-value-simple ltr-container"><span class="value-type">${s(this.result.type)}:&nbsp;</span><span class="string-value">${this.result.value.url}</span></div>`;default:return e`<div class="result-value-simple flex-adjustable ltr-container">${this.messages.runscriptmessage}</div>`}}render(){return e`${this.hideHeader?null:e`<header class="flex-row"><calcite-action-bar class="flex-adjustable" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .active=${this.openedResultPanel==="output"} .text=${this.messages.output??""} text-enabled scale=s icon=list-show-all icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=output ${o(this.outputRef)}></calcite-action><calcite-action .active=${this.openedResultPanel==="console"} .text=${this.messages.console??""} text-enabled scale=s icon=console icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=console ${o(this.consoleRef)}></calcite-action><calcite-action .active=${this.openedResultPanel==="log"} .text=${this.messages.log??""} text-enabled scale=s icon=list icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=log ${o(this.logRef)}></calcite-action></calcite-action-group></calcite-action-bar><calcite-action scale=s icon=x .text=${this.messages.close??""} @click=${this._emitClose}></calcite-action></header>`}<article class="flex-adjustable">${this.loading?e`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"}></calcite-loader>`:e`<div class="flex-column y-scrollable-container">${this.renderOutputPanel()}${this.renderConsolePanel()}${this.renderLogPanel()}</div>`}</article>`}};f("arcgis-arcade-results",h);return h},h,i,j)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as O,c as u,d as k}from"./5A4VZ22T.js";import i from"./IETP57KJ.js";import h from"./RO6RHW6I.js";import e from"./Q2EZ6DGG.js";import d from"./CQTJWVFM.js";import c from"./RMVHO2AH.js";import a from"./STN3LSQR.js";import"./3PBQ47BB.js";import"./OLNYBWUC.js";import{a as N}from"./P37AQWGL.js";import"./5HKDO4SX.js";import"./ZTCCL565.js";import{a as E}from"./CC4XBW6V.js";import"./TQDN6SR5.js";import{a as S,c as T,e as w}from"./XSKI5PRU.js";import{a as C}from"./ECNI2A4K.js";import"./XRUKVCVF.js";import{G as v,K as b,L as y,h as g,i as f,j as n}from"./XU7YAUUX.js";import{b as _}from"./VGOFAQ7A.js";import"./257WOXQH.js";import"./R2XZZWNP.js";import"./QTLHVR4Y.js";import"./TEXAGKBD.js";import"./H6RQVSYM.js";export default $arcgis.t(([,,,{a:L},,{b:c,d:m}])=>{var x=Symbol(),l=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,e)=>{this.o=t,this.h=e})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,e,s){this.p=0,this.i=0,(this._=t).addController(this);let i=typeof e=="object"?e:{task:e,args:s};this.v=i.task,this.j=i.args,this.m=i.argsEqual??M,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){this.autoRun===!0&&this.S()}hostUpdated(){this.autoRun==="afterUpdate"&&this.S()}T(){if(this.j===void 0)return;let t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){let t=this.T(),e=this.O;this.O=t,t===e||t===void 0||e!==void 0&&this.m(e,t)||await this.run(t)}async run(t){let e,s;t??=this.T(),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let i=++this.p;this.q=new AbortController;let r=!1;try{e=await this.v(t,{signal:this.q.signal})}catch(d){r=!0,s=d}if(this.p===i){if(e===x)this.i=0;else{if(r===!1){try{this.k?.(e)}catch{}this.i=2,this.o?.(e)}else{try{this.A?.(s)}catch{}this.i=3,this.h?.(s)}this.u=e,this.l=s}this._.requestUpdate()}}abort(t){this.i===1&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}},M=(h,t)=>h===t||h.length===t.length&&h.every(((e,s)=>!f(e,t[s])));var $=g`:host{display:block}.arcgis-code-viewer-container{display:flex;align-items:stretch;background-color:var(--calcite-color-foreground-2)}.arcgis-code-viewer__gutter{display:flex;min-width:var(--calcite-spacing-md);padding:0 var(--calcite-spacing-xs) 0 var(--calcite-spacing-sm);border-inline-end:1px solid var(--calcite-color-border-3);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size--2);font-family:var(--calcite-font-family-code);user-select:none;justify-items:center;font-variant-numeric:tabular-nums}.arcgis-code-viewer__line-number{display:flex;align-items:center}pre.arcgis-code-viewer{display:flex;direction:ltr;overflow-x:auto;margin:0;padding:var(--calcite-spacing-sm);white-space:pre-line;code{font-size:var(--calcite-font-size--2);font-family:var(--calcite-font-family-code)}}:host([round]){.arcgis-code-viewer-container{border-radius:var(--calcite-corner-radius-round)}}`,p=class extends v{constructor(){super(...arguments),this._monacoEditor=E(N),this.#e=Promise.withResolvers(),this.#t="",this._slotContentObservers=[],this._onDefaultSlotChange=async t=>{S(t)||(this._codeFromSlot="");let e=t.target instanceof HTMLSlotElement?t.target:null,s=e?this._computeSlotText(e):"";e&&this._observeAssignedSlotNodes(e),s!==this._codeFromSlot&&(this._codeFromSlot=s),this.#e.resolve()},this._colorizeTask=new l(this,{task:async([t,e],{signal:s})=>{if(await this.#e.promise,s.aborted)return this.#t;if(await c(e),s.aborted)return this.#t;let i=await O(t,e);return s.aborted?this.#t:(this.#t=i,i)},args:()=>[this._codeFromSlot,this.language]}),this._codeFromSlot="",this.language="arcade",this.round=!1,this.lineNumbers="off"}static{this.properties={_codeFromSlot:16,language:1,round:7,lineNumbers:1}}static{this.styles=$}#e;#t;async load(){L(y("./assets")),await m(this.language),await c(this.language),this._applyColorizeStyles(u()),this.manager.onLifecycle(()=>(this._themeObserver=T(this.el,["class"],()=>this.updateTheme()),this._themeChangedListener=k(()=>{this._applyColorizeStyles(u())}),this.updateTheme(),()=>{this._themeObserver?.(),this._themeObserver=void 0,this._themeChangedListener?.dispose(),this._themeChangedListener=void 0}))}loaded(){this.el.hasChildNodes()||this.#e.resolve()}willUpdate(t){t.has("language")&&m(this.language).then(()=>c(this.language)).catch(_(this))}disconnectedCallback(){super.disconnectedCallback(),this._disposeSlotObservers()}_disposeSlotObservers(){this._slotContentObservers.length&&(this._slotContentObservers.forEach(t=>t.disconnect()),this._slotContentObservers=[])}_observeAssignedSlotNodes(t){this._disposeSlotObservers();let e=t.assignedNodes({flatten:!0});if(!e.length)return;let s=new Set;for(let o of e)o.nodeType===Node.ELEMENT_NODE?s.add(o):o.nodeType===Node.TEXT_NODE&&o.parentElement&&s.add(o.parentElement);let i={characterData:!0,childList:!0,subtree:!0},r=C(()=>{let o=this._computeSlotText(t);o!==this._codeFromSlot&&(this._codeFromSlot=o)},100),d=o=>{if(o.some(a=>a.type==="childList")){let a=this._computeSlotText(t);a!==this._codeFromSlot&&(this._codeFromSlot=a);return}r()};s.forEach(o=>{let a=new MutationObserver(d);a.observe(o,i),this._slotContentObservers.push(a)})}_computeSlotText(t){let e=t.assignedNodes({flatten:!0}).filter(s=>s.nodeType!==Node.COMMENT_NODE);if(this.language==="html"&&e.length){let s=e.find(r=>r.nodeType===Node.ELEMENT_NODE&&r.tagName==="TEMPLATE");if(s)return(s.innerHTML??"").trim();let i=e.map(r=>r.nodeType===Node.ELEMENT_NODE?r.outerHTML:r.nodeType===Node.TEXT_NODE?r.textContent??"":"").join("").trim();return i}return e.map(s=>s.textContent??"").join("").trim()}updateTheme(){let t=w(this.el)==="light"?"vs":"vs-dark";t!==this._currentTheme&&(this._currentTheme=t,this._monacoEditor.setTheme(t))}_applyColorizeStyles(t){if(!this._colorizeSheet){this._colorizeSheet=new CSSStyleSheet;let e=this.renderRoot;e.adoptedStyleSheets=[...e.adoptedStyleSheets,this._colorizeSheet]}this._colorizeSheet.replaceSync(t)}_showLineNumbers(){return typeof this.lineNumbers=="function"||this.lineNumbers==="on"}_getLineNumberLabel(t){return typeof this.lineNumbers=="function"?this.lineNumbers(t):`${t}`}_getRenderedLineNumbers(){if(!this._showLineNumbers())return[];let t=Math.max(this._codeFromSlot.split(/\r\n|\r|\n/u).length,1);return Array.from({length:t},(e,s)=>this._getLineNumberLabel(s+1))}render(){let t=this._getRenderedLineNumbers();return n`<div class=${`arcgis-code-viewer-container${t.length?" arcgis-code-viewer-container--with-line-numbers":""}`}><slot @slotchange=${this._onDefaultSlotChange} style="display:none" aria-hidden=true></slot>${t.length?n`<div class="arcgis-code-viewer__gutter" aria-hidden=true>${t.map(e=>n`<span class="arcgis-code-viewer__line-number">${e}</span>`)}</div>`:null}<pre class="arcgis-code-viewer" aria-label=${`${this.language} code snippet`}>${this._colorizeTask.render({error:()=>null,pending:()=>n`<code class=${`language-${this.language}`}></code>`,complete:e=>n`<code class=${`language-${this.language}`} .innerHTML=${e??""}></code>`})}</pre></div>`}};b("arcgis-code-viewer",p);return p},a,c,d,e,h,i)
2
+ import{a as O,c as u,d as k}from"./5A4VZ22T.js";import i from"./NKDL6NEF.js";import h from"./UQRZDUGL.js";import e from"./Q2EZ6DGG.js";import d from"./NL736YG3.js";import c from"./DOCWTXKZ.js";import a from"./STN3LSQR.js";import"./3PBQ47BB.js";import"./OLNYBWUC.js";import{a as N}from"./P37AQWGL.js";import"./5HKDO4SX.js";import"./MZMKV7FA.js";import{a as E}from"./CC4XBW6V.js";import"./TQDN6SR5.js";import{a as S,c as T,e as w}from"./XSKI5PRU.js";import{a as C}from"./ECNI2A4K.js";import"./XRUKVCVF.js";import{G as v,K as b,L as y,h as g,i as f,j as n}from"./XU7YAUUX.js";import{b as _}from"./VGOFAQ7A.js";import"./257WOXQH.js";import"./R2XZZWNP.js";import"./QTLHVR4Y.js";import"./TEXAGKBD.js";import"./H6RQVSYM.js";export default $arcgis.t(([,,,{a:L},,{b:c,d:m}])=>{var x=Symbol(),l=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,e)=>{this.o=t,this.h=e})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,e,s){this.p=0,this.i=0,(this._=t).addController(this);let i=typeof e=="object"?e:{task:e,args:s};this.v=i.task,this.j=i.args,this.m=i.argsEqual??M,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){this.autoRun===!0&&this.S()}hostUpdated(){this.autoRun==="afterUpdate"&&this.S()}T(){if(this.j===void 0)return;let t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){let t=this.T(),e=this.O;this.O=t,t===e||t===void 0||e!==void 0&&this.m(e,t)||await this.run(t)}async run(t){let e,s;t??=this.T(),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let i=++this.p;this.q=new AbortController;let r=!1;try{e=await this.v(t,{signal:this.q.signal})}catch(d){r=!0,s=d}if(this.p===i){if(e===x)this.i=0;else{if(r===!1){try{this.k?.(e)}catch{}this.i=2,this.o?.(e)}else{try{this.A?.(s)}catch{}this.i=3,this.h?.(s)}this.u=e,this.l=s}this._.requestUpdate()}}abort(t){this.i===1&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}},M=(h,t)=>h===t||h.length===t.length&&h.every(((e,s)=>!f(e,t[s])));var $=g`:host{display:block}.arcgis-code-viewer-container{display:flex;align-items:stretch;background-color:var(--calcite-color-foreground-2)}.arcgis-code-viewer__gutter{display:flex;min-width:var(--calcite-spacing-md);padding:0 var(--calcite-spacing-xs) 0 var(--calcite-spacing-sm);border-inline-end:1px solid var(--calcite-color-border-3);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size--2);font-family:var(--calcite-font-family-code);user-select:none;justify-items:center;font-variant-numeric:tabular-nums}.arcgis-code-viewer__line-number{display:flex;align-items:center}pre.arcgis-code-viewer{display:flex;direction:ltr;overflow-x:auto;margin:0;padding:var(--calcite-spacing-sm);white-space:pre-line;code{font-size:var(--calcite-font-size--2);font-family:var(--calcite-font-family-code)}}:host([round]){.arcgis-code-viewer-container{border-radius:var(--calcite-corner-radius-round)}}`,p=class extends v{constructor(){super(...arguments),this._monacoEditor=E(N),this.#e=Promise.withResolvers(),this.#t="",this._slotContentObservers=[],this._onDefaultSlotChange=async t=>{S(t)||(this._codeFromSlot="");let e=t.target instanceof HTMLSlotElement?t.target:null,s=e?this._computeSlotText(e):"";e&&this._observeAssignedSlotNodes(e),s!==this._codeFromSlot&&(this._codeFromSlot=s),this.#e.resolve()},this._colorizeTask=new l(this,{task:async([t,e],{signal:s})=>{if(await this.#e.promise,s.aborted)return this.#t;if(await c(e),s.aborted)return this.#t;let i=await O(t,e);return s.aborted?this.#t:(this.#t=i,i)},args:()=>[this._codeFromSlot,this.language]}),this._codeFromSlot="",this.language="arcade",this.round=!1,this.lineNumbers="off"}static{this.properties={_codeFromSlot:16,language:1,round:7,lineNumbers:1}}static{this.styles=$}#e;#t;async load(){L(y("./assets")),await m(this.language),await c(this.language),this._applyColorizeStyles(u()),this.manager.onLifecycle(()=>(this._themeObserver=T(this.el,["class"],()=>this.updateTheme()),this._themeChangedListener=k(()=>{this._applyColorizeStyles(u())}),this.updateTheme(),()=>{this._themeObserver?.(),this._themeObserver=void 0,this._themeChangedListener?.dispose(),this._themeChangedListener=void 0}))}loaded(){this.el.hasChildNodes()||this.#e.resolve()}willUpdate(t){t.has("language")&&m(this.language).then(()=>c(this.language)).catch(_(this))}disconnectedCallback(){super.disconnectedCallback(),this._disposeSlotObservers()}_disposeSlotObservers(){this._slotContentObservers.length&&(this._slotContentObservers.forEach(t=>t.disconnect()),this._slotContentObservers=[])}_observeAssignedSlotNodes(t){this._disposeSlotObservers();let e=t.assignedNodes({flatten:!0});if(!e.length)return;let s=new Set;for(let o of e)o.nodeType===Node.ELEMENT_NODE?s.add(o):o.nodeType===Node.TEXT_NODE&&o.parentElement&&s.add(o.parentElement);let i={characterData:!0,childList:!0,subtree:!0},r=C(()=>{let o=this._computeSlotText(t);o!==this._codeFromSlot&&(this._codeFromSlot=o)},100),d=o=>{if(o.some(a=>a.type==="childList")){let a=this._computeSlotText(t);a!==this._codeFromSlot&&(this._codeFromSlot=a);return}r()};s.forEach(o=>{let a=new MutationObserver(d);a.observe(o,i),this._slotContentObservers.push(a)})}_computeSlotText(t){let e=t.assignedNodes({flatten:!0}).filter(s=>s.nodeType!==Node.COMMENT_NODE);if(this.language==="html"&&e.length){let s=e.find(r=>r.nodeType===Node.ELEMENT_NODE&&r.tagName==="TEMPLATE");if(s)return(s.innerHTML??"").trim();let i=e.map(r=>r.nodeType===Node.ELEMENT_NODE?r.outerHTML:r.nodeType===Node.TEXT_NODE?r.textContent??"":"").join("").trim();return i}return e.map(s=>s.textContent??"").join("").trim()}updateTheme(){let t=w(this.el)==="light"?"vs":"vs-dark";t!==this._currentTheme&&(this._currentTheme=t,this._monacoEditor.setTheme(t))}_applyColorizeStyles(t){if(!this._colorizeSheet){this._colorizeSheet=new CSSStyleSheet;let e=this.renderRoot;e.adoptedStyleSheets=[...e.adoptedStyleSheets,this._colorizeSheet]}this._colorizeSheet.replaceSync(t)}_showLineNumbers(){return typeof this.lineNumbers=="function"||this.lineNumbers==="on"}_getLineNumberLabel(t){return typeof this.lineNumbers=="function"?this.lineNumbers(t):`${t}`}_getRenderedLineNumbers(){if(!this._showLineNumbers())return[];let t=Math.max(this._codeFromSlot.split(/\r\n|\r|\n/u).length,1);return Array.from({length:t},(e,s)=>this._getLineNumberLabel(s+1))}render(){let t=this._getRenderedLineNumbers();return n`<div class=${`arcgis-code-viewer-container${t.length?" arcgis-code-viewer-container--with-line-numbers":""}`}><slot @slotchange=${this._onDefaultSlotChange} style="display:none" aria-hidden=true></slot>${t.length?n`<div class="arcgis-code-viewer__gutter" aria-hidden=true>${t.map(e=>n`<span class="arcgis-code-viewer__line-number">${e}</span>`)}</div>`:null}<pre class="arcgis-code-viewer" aria-label=${`${this.language} code snippet`}>${this._colorizeTask.render({error:()=>null,pending:()=>n`<code class=${`language-${this.language}`}></code>`,complete:e=>n`<code class=${`language-${this.language}`} .innerHTML=${e??""}></code>`})}</pre></div>`}};b("arcgis-code-viewer",p);return p},a,c,d,e,h,i)
@@ -0,0 +1,12 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./STN3LSQR.js";import{b as Se}from"./3PBQ47BB.js";import{b as M,c as $,d as V,e as De}from"./OLNYBWUC.js";import{a as ve}from"./P37AQWGL.js";import{a as R,b as Fe,c as k,d as g,e as w}from"./MZMKV7FA.js";import{d as oe}from"./TQDN6SR5.js";import{L as ae,s as se,u as A}from"./XU7YAUUX.js";import{a as h}from"./VGOFAQ7A.js";import{Qk as W,Zk as z}from"./TEXAGKBD.js";export default $arcgis.t(([Le,Ae,Ue,H,{getDeclaredVoxelMembers:Ne,getDeclaredPixelMembers:qe},Oe,Ge,{A:O,B:b,F:ge,H:G,I:we,a:U,b:ne,c:le,d:pe,e:ce,k:N,l:x,m:he,o:u,p:ue,q:de,r:P,s:q,t:y,u:fe,v:_e,w:me,y:ye,z:be}])=>{var D=s=>s!==void 0,_=s=>s!==null;function Re(s){switch(s){case"esriFieldTypeOID":return"oid";case"esriFieldTypeSmallInteger":return"small-integer";case"esriFieldTypeInteger":return"integer";case"esriFieldTypeBigInteger":return"big-integer";case"esriFieldTypeSingle":return"single";case"esriFieldTypeDouble":return"double";case"esriFieldTypeDate":return"date";case"esriFieldTypeDateOnly":return"date-only";case"esriFieldTypeTimeOnly":return"time-only";case"esriFieldTypeTimestampOffset":return"timestamp-offset";case"esriFieldTypeGUID":return"guid";case"esriFieldTypeGlobalID":return"global-id";case"esriFieldTypeString":return"string";case"esriFieldTypeGeometry":return"geometry";case"esriFieldTypeBlob":return"blob";case"esriFieldTypeRaster":return"raster";case"esriFieldTypeXML":return"xml";default:return"string"}}function ke(s){return{fields:s.fields.map(e=>({name:e.name,type:Re(e.type),serverType:e.type,nullable:e.nullable}))}}function Ce(s){return typeof s?.query=="object"&&s.query?s.query:{}}var K=class{constructor(e){this.itemId=e.itemId,this.portal=e.portal,this.serviceUrl=e.serviceUrl,this._requestOptions=e.requestOptions}fetchInfo(e){return this.portal.request(this._datastoreUrl,this._createRequestOptions(e))}async fetchDatasets(e){return(await this.portal.request(B(this._datastoreUrl,"datasets"),this._createRequestOptions(e))).datasets}async fetchTableDescription(e,t){if(!e)throw new Oe("portal:invalid-parameter",'The "tableName" parameter must be provided.');let i=await this.portal.request(B(this._datastoreUrl,"tableDescription"),{...this._createRequestOptions(t),query:{...Ce(this._requestOptions),...Ce(t),tableName:e}});return ke(i)}get _datastoreUrl(){return B(this.serviceUrl,"datastores",encodeURIComponent(this.itemId))}_createRequestOptions(e){return{...this._requestOptions,...e}}};function B(s,...e){let t=s.replaceAll(/\/+$/gu,""),i=e.filter(r=>!!r).map(r=>r.replaceAll(/^\/+|\/+$/gu,""));return[t,...i].join("/")}var We={id:"ansi",keywords:[],functions:[],operators:[],specialChars:{likeWildcardAny:"%",likeWildcardOne:"_",identifierQuote:{start:'"',end:'"'},escapeKey:{start:null,end:null},escapeClause:{keyword:"ESCAPE",suffix:null}}},Ie=new Map,ze={ansi:async()=>await Promise.resolve(We),bigquery:async()=>(await import("./XG3S7JQW.js")).bigqueryDialect,postgres:async()=>(await import("./U2T7AGOO.js")).postgresDialect,sqlServer:async()=>(await import("./UZD32YRD.js")).sqlServerDialect};async function Be(s){let e=Ie.get(s);if(e)return await e;let t=ze[s]();return Ie.set(s,t),await t}var He=["SELECT","FROM","WHERE","GROUP","BY","HAVING","ORDER","LIMIT","DISTINCT","AS","JOIN","LEFT","RIGHT","FULL","INNER","OUTER","CROSS","ON","USING","AND","OR","NOT","IN","IS","LIKE","BETWEEN","NULL","TRUE","FALSE","ASC","DESC"],Ke=["<=",">=","<>","!=","=","<",">","+","-","*","/","%","||"],je=(s,e={})=>{let t=new Set(e.baseKeywords??He);for(let r of s.keywords)t.add(r.toUpperCase());let i=new Set(e.baseOperators??Ke);for(let r of s.operators)i.add(r);return{keywords:Array.from(t),functions:s.functions,operators:Array.from(i),specialChars:s.specialChars}},S={sqlServer:"sql-layer-sql-server",postgres:"sql-layer-postgres",bigquery:"sql-layer-bigquery"},Te=S.postgres,Qe={[S.sqlServer]:"sqlServer",[S.postgres]:"postgres",[S.bigquery]:"bigquery"};function Je(s){return Qe[s]}async function Ze(s){return je(await Be(Je(s)))}var Xe=/^[A-Za-z_][A-Za-z0-9_$]*$/u;function Ye(s){return s==="esriDBMS_PostgreSQL"?Te:s==="esriDBMS_SQLServer"?S.sqlServer:Te}function xt(s){return s.trim().toLowerCase()}function et(s){return s.specialChars.identifierQuote}function tt(s,e){let t=s.trim();return t?Xe.test(t)?e.keywords.includes(t.toUpperCase()):!0:!1}function Ve(s,e){let t=s.trim();if(!t||!tt(t,e))return t;let i=et(e),r=t.replaceAll(i.end,`${i.end}${i.end}`);return`${i.start}${r}${i.end}`}function it(s,e){return s.split(".").map(t=>Ve(t,e)).join(".")}function Pt(s){return s.split(".").at(-1)??s}function rt(s){return Ze(Ye(s))}async function st(s,e){let t=new H({url:`${s.url}/${e.relatedTableId}`});return await t.load(),t}function te(s){return(e,t)=>{if(e.type==="oid")return-1;if(t.type==="oid")return 1;if(y(s)){if(e.name===s.subtypeField)return-1;if(t.name===s.subtypeField)return 1}if(P(s)){if(e.name===s.typeIdField)return-1;if(t.name===s.typeIdField)return 1}return e.name.localeCompare(t.name,"en",{sensitivity:"base"})}}function xe(s,e){return s?.every(t=>t.domains?.[e.name]?.type==="inherited")??!1}var at=/^[a-z_$][a-z0-9_$]*$/giu;function ie(s,e=!0){return s.match(at)?`${e?".":""}${s}`:`["${s}"]`}function Ee(s,e){return s?`${s}${ie(e)}`:e}function Pe(s){return _e(s)?s.portalItem:null}function ot(s,e){return e?s?.nullable??"nullable":s?.notnull??"not nullable"}function Mt(s,e,t){let{includeAliases:i=!1,supportGeometryFields:r=!1}=t??{},a=e,n=[],f=[];return g(s,{supportGeometry:r}).forEach(o=>{a&&(a+=`
3
+
4
+ `),a+=`**${o.name}** (${o.alias})
5
+ ${o.type}`,o.description&&(a+=`
6
+ '${o.description}`);let c=k(o,{supportGeometryFields:r}),T=ie(o.name,!1),m=w(o);if(n.push({name:o.name,description:m,type:c,completion:{label:o.name,detail:m,insertText:T,insertTextMode:V.asIs,insertTextFormat:$.PlainText,kind:M.Field}}),i){if(!o.alias||o.alias.toLowerCase()===o.name.toLowerCase())return;let re=`**${o.alias}**
7
+ ${o.type}`;o.description&&(re+=`
8
+ '${o.description}`),f.push({name:o.alias,description:o.name,type:c,completion:{label:o.alias,detail:o.name,insertText:T,insertTextMode:V.asIs,insertTextFormat:$.PlainText,kind:M.Field,documentation:{kind:"markdown",value:re}}})}}),[[...n,...f],a]}function $t(s,e){let t=e,i=[];return s.forEach(r=>{t&&(t+=`
9
+
10
+ `),t+=`**${r.name}**
11
+ ${r.type}`,r.name&&(t+=`
12
+ '${r.name}`),i.push({name:r.name,description:r.name,type:"array",completion:{label:r.name,detail:r.name,insertText:ie(r.name,!1),insertTextMode:V.asIs,insertTextFormat:$.PlainText,kind:M.Field}})}),[i,t]}var E=class{constructor(e,t,i){this._profile=e,this._label=t,this.description=i,this.filterDescription=!1}getLabel(){return this._label==null?"":typeof this._label=="string"?se(this._label):A(this._profile?.intlStrings[this._label.code],this._label.formatValues)}getDescription(){return this.description==null?"":typeof this.description=="string"?this.description:A(this._profile?.intlStrings[this.description.code],this.description.formatValues)}passFilter(e){return!e||e.test(this.getLabel())?!0:this.filterDescription&&e.test(this.getDescription())}},F=class extends E{constructor(e){super(e.profile,e.label,e.description??e.declaration?.description),this.declaration=e.declaration??{},this.name=e.declaration?.name??"",this.snippet=e.snippet??"",this.nonInteractive=e.nonInteractive??!1,this.filterDescription=e.filterDescription??!1,this.icon=e.icon}},l=class extends F{constructor(e){super(e),this.type="text",this.isCollection=!1,this.type=e.declaration?.type??"text"}getDescription(){return this.description==null?this._profile?.intlStrings[this.type.toLowerCase()]??"":super.getDescription()}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration}}},j=class extends F{constructor(e){super(e),this.type="array",this.isCollection=!1,this.elementType=e.declaration?.elementType??{type:"number",name:"number"}}getDescription(){return this.description==null?this._profile?.intlStrings[this.type.toLowerCase()]??"":super.getDescription()}toProfileVariableDefinition(){return{type:this.type,elementType:this.elementType,name:"",...this.declaration}}},d=class extends F{constructor(e,t){super(t),this.owner=e,this.isCollection=!0,this._loaded=!0,this.variables=[]}get breadcrumb(){if(this.owner){let e=this.owner.breadcrumb;return e?`${e} / ${this.name}`:this.name}return this.name}get loaded(){return this._loaded}get informationUrl(){return null}get informationType(){return""}},p=class extends E{constructor(e,t,i=[],r=!1){super(e,t),this.variables=i,this.isHeader=r,this.type="group",this.isCollection=!0}passFilter(){return!0}},v=class s extends d{constructor(e,t){super(e,t),this.type="dictionary",this.dictionaryVariables=[],this.loadPropertyDeclarations(t.declaration?.properties),this.snippet&&this.dictionaryVariables.length&&(this.variables=[new p(this._profile,this.snippet,this.dictionaryVariables)])}async loadSource(){}loadPropertyDeclarations(e){this.dictionaryVariables=this.createVariableInstances(e),this.variables=this.dictionaryVariables}createVariableInstances(e){if(!Array.isArray(e))return[];let t=[];return e.forEach(i=>{let r=this.createVariableInstance(i);r&&t.push(r)}),t}createVariableInstance(e){let t=Ee(this.snippet,e.name);switch(e.type){case"number":case"text":case"boolean":case"date":case"dateOnly":case"time":case"geometry":case"knowledgeGraph":return new l({profile:this._profile,declaration:e,label:t,snippet:t});case"pixel":return new Z(this,{profile:this._profile,declaration:e,label:t,snippet:t});case"voxel":return new J(this,{profile:this._profile,declaration:e,label:t,snippet:t});case"feature":return new Q(this,{profile:this._profile,declaration:e,label:t,snippet:t});case"featureSet":return new I(this,{profile:this._profile,declaration:e,label:t,snippet:t},[new l({profile:this._profile,label:t,description:"",snippet:t})]);case"featureSetCollection":return new X(this,{profile:this._profile,declaration:e,label:t,snippet:t});case"dictionary":return new s(this,{profile:this._profile,declaration:e,label:t,snippet:t});case"array":return new j({profile:this._profile,declaration:e,label:t,snippet:t});case"dataCatalogDatastore":return new Y(this,{profile:this._profile,declaration:e,label:t,snippet:t});default:return h("error","Editor profile","Invalid profile variable",{detail:{declaration:e}}),null}}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,properties:this.dictionaryVariables.map(e=>e.toProfileVariableDefinition())}}},L=class extends d{constructor(e,t,i){super(e,t),this.relationshipsProperties=i,this._source=null,this._loaded=!1,this._definition=t.declaration?.definition}get title(){return u(this._source)?this._source.title??"":""}get url(){return ue(this._source)?this._source.url??"":""}get informationUrl(){return!this.loaded||!this.url?null:de(this._source)?`${this.url}/${this._source.layerId}`:this.url}get informationType(){return this._profile?.intlStrings.layer??"layer"}async loadSource(){return _(this._loadPromise)&&D(this._loadPromise)?await this._loadPromise:(this._loadPromise=this._loadSource(),await this._loadPromise)}_getValueSnippet(e){return["feature","voxel","pixel"].includes(this.type)?Ee(this.snippet,e.name):e.name}_getSubtypeOrDomainNameSnippet(e){return this.type!=="feature"?null:y(this._source)&&e.name===this._source.subtypeField?`SubtypeName(${this.snippet})`:`DomainName(${this.snippet}, "${e.name}")`}_getFieldProperty(e,t){let i=this._getDomainDictionary(e);if(i)return i;let r=this._getValueSnippet(e);return new l({profile:this._profile,label:r,description:w(e),snippet:r,icon:R(e,t),filterDescription:!0})}_getMemberProperty(e){let t=this._getValueSnippet(e);return new l({profile:this._profile,label:t,description:e.name,snippet:t,icon:Fe(e),filterDescription:!0})}_getDomainDictionary(e){return q(this._source)?y(this._source)&&this._source.subtypeField?this._getSubtypeDomainDictionary(e):P(this._source)&&this._source.typeIdField?this._getFeatureTypeDomainDictionary(e):this._getFieldDomainDictionary(e):null}_getSubtypeDomainDictionary(e){if(!y(this._source))return null;if(!fe(this._source))return e.name===this._source.subtypeField?null:this._getFieldDomainDictionary(e);if(e.name===this._source.subtypeField){let r=this._createDomainDictionary(e);return r.icon="subtype",r.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.subtypes,e)),r}if(xe(this._source.subtypes,e))return this._getFieldDomainDictionary(e);let t=this._getDomainValuesGroup(this._source.subtypes,e);if(!t)return null;let i=this._createDomainDictionary(e);return i.variables.push(t),i}_getFeatureTypeDomainDictionary(e){if(!P(this._source))return null;if(e.name===this._source.typeIdField){let r=this._createDomainDictionary(e);return r.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.types,e)),r}if(xe(this._source.types,e))return this._getFieldDomainDictionary(e);let t=this._getDomainValuesGroup(this._source.types,e);if(!t)return null;let i=this._createDomainDictionary(e);return i.variables.push(t),i}_getFieldDomainDictionary(e){if(!q(this._source))return null;let t=this._source.getFieldDomain(e.name);if(!x(t))return null;let i=this._getCodedValueDomainGroup(t,{code:"domainvalues"}),r=this._createDomainDictionary(e);return r.variables.push(i),r}_getTypeOrSubtypeDomainGroup(e,t){if(x(t.domain))return this._getCodedValueDomainGroup(t.domain,{code:"subtypes"});let i=e?.map(r=>{let a=N(r)?r.code:r.id;return new l({profile:this._profile,label:`${a}`,description:r.name,snippet:`"${a}"`})})??[];return new p(this._profile,{code:"subtypes"},i)}_getCodedValueDomainGroup(e,t){let i=e.codedValues.map(r=>new l({profile:this._profile,label:`${r.code}`,description:r.name,snippet:`"${r.code}"`,filterDescription:!0}));return new p(this._profile,t,i)}_getDomainValuesGroup(e,t){let i=[];return!e||e.length===0||(e.forEach(r=>{let a=r.domains?.[t.name];if(!a||he(a)||!x(a))return;let n=w(t),f=this._getCodedValueDomainGroup(a,{code:"domainvaluesfortypeformat",formatValues:{fieldName:n,typeName:r.name}}),o=N(r)?r.code:r.id,c=`${o}`,T=`"${o}""`,m=new v(this,{profile:this._profile,label:c,snippet:T,description:r.name,declaration:{name:n}});m.variables=[f],i.push(m)}),!i.length)?null:new p(this._profile,{code:"domainvaluesbysubtypes"},i)}_createDomainDictionary(e){let t=this._getValueSnippet(e),i=w(e),r=new v(this,{profile:this._profile,label:t,description:i,snippet:t,icon:"form-dropdown",declaration:{name:e.name}}),a=new p(this._profile,i,[new l({profile:this._profile,label:t,description:"",snippet:t})]);r.variables=[a];let n=this._getSubtypeOrDomainNameSnippet(e);return n&&a.variables.push(new l({profile:this._profile,label:n,description:"",snippet:n})),r}async _getRelationshipsProperty(){if(!this.relationshipsProperties?.exposeRelationships||!this._profile?.supportFeatureSetFunctions)return null;let e=this._source;if(!me(e))return null;let t=new p(this._profile,{code:"relationships"}),i=await Promise.all(e.relationships?.map(async r=>{let a=await st(e,r);if(!U(a)||r.relatedTableId===this.relationshipsProperties?.sourceTableId)return null;let n=`FeatureSetByRelationshipName(${this.snippet}, "${r.name}")`;return new I(this,{profile:this._profile,declaration:{definition:a},label:a.title,description:"",nonInteractive:!0},[new l({profile:this._profile,label:n,description:"",snippet:n})],{exposeRelationships:!0,sourceTableId:e.layerId})})??[]);return t.variables=i.filter(_),t.variables.length?t:null}},C=class extends L{constructor(e,t,i,r={exposeRelationships:!0}){super(e,t,r),this.type=i}get title(){return u(this._source)?this._source.title??"":{code:this.type}}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration}}},Q=class extends C{constructor(e,t){super(e,t,"feature",{exposeRelationships:!0}),this.type="feature"}async _loadSource(){if(this.loaded)return this._source;try{if(this._source=await G(this._definition),!this._source)throw new Error("Invalid definition");let e=u(this._source)?this._source.title??"":"";this.variables.push(new p(this._profile,e,[new l({profile:this._profile,label:this.snippet,description:"",snippet:this.snippet})]));let t=new p(this._profile,{code:"values"});if(this.variables.push(t),ye(this._source)){let a=`Geometry(${this.snippet})`,n=new l({profile:this._profile,declaration:{name:a},label:a,description:"Geometry",snippet:a,icon:"shapes",filterDescription:!0});t.variables.push(n)}let i=this._source;g(this._source.fields).map(a=>i.fields.find(n=>n.name===a.name)).sort(te(i)).forEach(a=>{t.variables.push(this._getFieldProperty(a))});let r=await this._getRelationshipsProperty();r&&this.variables.push(r)}catch(e){h("error","FeatureVariable","Error with definition",{detail:{error:e,definition:this._definition}}),this._source=null}finally{this._loaded=!0}return this._source}},J=class extends C{constructor(e,t){super(e,t,"voxel",{exposeRelationships:!1}),this.type="voxel",this._source=null}async _loadSource(){if(this.loaded)return this._source;try{if(!be(this._definition))throw new Error("Invalid definition - not a VoxelLayer");if(await this._definition.load(),this._source=this._definition,!this._source)throw new Error("Invalid definition");let e=u(this._source)?this._source.title??"":"";this.variables.push(new p(this._profile,e,[new l({profile:this._profile,label:this.snippet,description:"",snippet:this.snippet})]));let t=new p(this._profile,{code:"values"});this.variables.push(t);let i=await Ne(this._source),r=this._source;g(this._source.fields).map(a=>r.fields.find(n=>n.name===a.name)).sort(te(r)).forEach(a=>{t.variables.push(this._getFieldProperty(a,i))})}catch(e){h("error",this.type,"Error with definition",{detail:{error:e,definition:this._definition}}),this._source=null}finally{this._loaded=!0}return this._source}},Z=class extends C{constructor(e,t){super(e,t,"pixel",{exposeRelationships:!1}),this.type="pixel",this._source=null}async _loadSource(){if(this.loaded)return this._source;try{if(!O(this._definition))throw new Error("Invalid definition - not an ImageryLayer");if(await this._definition.load(),this._source=this._definition,!this._source)throw new Error("Invalid definition");let e=u(this._source)?this._source.title??"":"";this.variables.push(new p(this._profile,e,[new l({profile:this._profile,label:this.snippet,description:"",snippet:this.snippet})]));let t=new p(this._profile,{code:"values"});if(this.variables.push(t),!O(this._source))throw new Error("Invalid definition - not an ImageryLayer");(await qe(this._source)).forEach(i=>{t.variables.push(this._getMemberProperty(i))})}catch(e){h("error",this.type,"Error with definition",{detail:{error:e,definition:this._definition}}),this._source=null}finally{this._loaded=!0}return this._source}},I=class extends L{constructor(e,t,i=[],r){super(e,t,r),this.featureSetSnippets=i,this.type="featureSet"}get title(){return u(this._source)?this._source.title??"":{code:"featureset"}}async _loadSource(){if(this.loaded)return this._source;try{if(this._source=await G(this._definition),!this._source)throw new Error("Invalid definition");this.variables.push(new p(this._profile,this.title,this.featureSetSnippets,!0));let e=new p(this._profile,{code:"fields"});this.variables.push(e);let t=this._profile?.policy,i=t&&"allowGeometryFields"in t?t.allowGeometryFields??!1:!1;e.variables=g(this._source.fields,{supportGeometry:i}).sort(te(this._source)).map(a=>this._getFieldProperty(a));let r=await this._getRelationshipsProperty();r&&this.variables.push(r)}catch(e){h("error",this.type,"Error with definition",{detail:{error:e,definition:this._definition}}),this._source=null}finally{this._loaded=!0}return this._source}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,definition:this._definition}}},X=class extends d{constructor(e,t){super(e,t),this.type="featureSetCollection",this._featureSetCollections=null,this._loaded=!1,this._definition=t.declaration?.definition}get informationUrl(){return!this.loaded||!this._featureSetCollections?null:typeof this._featureSetCollections.source!="string"?Se(Pe(this._featureSetCollections.source)):null}get informationType(){if(!this.loaded||!this._featureSetCollections)return"";if(typeof this._featureSetCollections.source=="string")return this._profile?.intlStrings.featureservice??"featureservice";switch(this._featureSetCollections.source.declaredClass){case"esri.WebMap":return this._profile?.intlStrings.webmap??"webmap";case"esri.WebScene":return this._profile?.intlStrings.webscene??"webscene";default:return this._profile?.intlStrings.map??"map"}}async loadSource(){return _(this._loadPromise)&&D(this._loadPromise)?await this._loadPromise:(this._loadPromise=this._loadSource(),await this._loadPromise)}async _loadSource(){if(this.loaded)return this._featureSetCollections;try{if(this._featureSetCollections=await this._featureSetCollectionsFromDefinition(),!this._featureSetCollections)throw new Error("Invalid definition");let e=typeof this._featureSetCollections.source=="string"?{code:this._featureSetCollections.source.endsWith("FeatureServer")?"featureservice":"mapservice"}:{code:"webmapformat",formatValues:{webMapTitle:Pe(this._featureSetCollections.source)?.title||"Untitled map"}},t=new p(this._profile,e,[new l({profile:this._profile,label:this.snippet,description:"",snippet:this.snippet})]),i=new p(this._profile,{code:"layers"},this._featureSetCollections.layers),r=new p(this._profile,{code:"tables"},this._featureSetCollections.tables);this.variables.push(t,i,r)}catch(e){h("error",this.type,"Error with definition",{detail:{error:e,definition:this._definition}}),this._featureSetCollections=null}finally{this._loaded=!0}return this._featureSetCollections}async _featureSetCollectionsFromDefinition(){return this._definition?ne(this._definition)?await this._featureSetCollectionFromMap(this._definition):ce(this._definition)?await this._featureSetCollectionFromUrl(this._definition.url):pe(this._definition)?await this._featureSetCollectionFromPortalItem(this._definition.portalItem):null:null}async _featureSetCollectionFromMap(e){le(e)&&await e.loadAll(),await Promise.all(e.allTables.map(async r=>await r.load()));let t=this._profile?.policy,i=t&&"filterFsCollectionLayersFromMap"in t&&t.filterFsCollectionLayersFromMap?t.filterFsCollectionLayersFromMap:()=>!0;return{layers:this._convertWebMapLayersToVariables(e.allLayers.filter(i)),tables:this._convertWebMapLayersToVariables(e.allTables),source:e}}async _featureSetCollectionFromPortalItem(e){let t=new Le(e);switch(await t.load(),t.type){case"Web Map":{let i=new Ae({portalItem:t});return await this._featureSetCollectionFromMap(i)}case"Web Scene":{let i=new Ue({portalItem:t});return await this._featureSetCollectionFromMap(i)}case"Feature Service":return await this._featureSetCollectionFromUrl(t.url);default:return h("error",this.type,"Unsupported portal item",{detail:{definition:e}}),null}}async _featureSetCollectionFromUrl(e){let t=e?.replace(/\/featureserver\/[0-9]*/iu,"/FeatureServer");if(t=t?.replace(/\/mapserver\/[0-9]*/iu,"/MapServer"),t=t?.split("?")[0],!t)return null;let i=await we(t),r=Promise.all(i.layers.map(async o=>{let c=new H({url:`${t}/${o.id}`});return await c.load(),this._createFeatureSetVariable(c)})),a=Promise.all(i.tables.map(async o=>{let c=new H({url:`${t}/${o.id}`});return await c.load(),this._createFeatureSetVariable(c)})),[n,f]=await Promise.all([r,a]);return{layers:n,tables:f,source:t}}_convertWebMapLayersToVariables(e){let t=[];return e.toArray().reverse().forEach(i=>{if(U(i)){t.push(this._createFeatureSetVariable(i,!0));return}}),t}_createFeatureSetVariable(e,t=!1){return new I(this,{profile:this._profile,declaration:{name:e.title??"",definition:e},label:t?e.title:e.sourceJSON.name??e.title,description:"",nonInteractive:!0},this._makeFeatureSetSnippets(e,t))}_makeFeatureSetSnippets(e,t=!1){if(!this._profile?.supportFeatureSetFunctions)return[];if(t){let i=`FeatureSetById(${this.snippet}, "${e.id}")`,r=`FeatureSetByName(${this.snippet}, "${e.title}")`;return[new l({profile:this._profile,label:i,description:"",snippet:i}),new l({profile:this._profile,label:r,description:"",snippet:r})]}else{let i=`FeatureSetById(${this.snippet}, "${e.layerId}")`;return[new l({profile:this._profile,label:i,description:"",snippet:i})]}}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,definition:this._definition}}},Y=class extends d{constructor(e,t){super(e,t),this.type="dataCatalogDatastore",this._catalogDatastore=null,this._datastore=null,this._loaded=!1,this._definition=t.declaration?.definition}_serializeDefinitionFromInstance(e){return{id:e.itemId??"",serviceUrl:e.serviceUrl??"",portal:{url:e.portal?.url??""}}}_getSerializedDefinition(){let e=this.declaration.definition;if(e)return b(e)?e:this._serializeDefinitionFromInstance(e);if(b(this._definition))return this._definition;if(this._catalogDatastore)return this._serializeDefinitionFromInstance(this._catalogDatastore);if(this._definition)return this._serializeDefinitionFromInstance(this._definition)}async loadSource(){return _(this._loadPromise)&&D(this._loadPromise)?await this._loadPromise:(this._loadPromise=this._loadSource(),await this._loadPromise)}async _loadSource(){if(this.loaded)return this._datastore;try{if(!this._definition)throw new Error("No definition provided");b(this._definition)?this._catalogDatastore=await this._dataCatalogDatastoreFromDefinition(this._definition):this._catalogDatastore=this._definition;let e=this._catalogDatastore;if(!e)throw new Error("Invalid definition");let t=await e.fetchInfo();this._datastoreInfo=t;let i=await e.fetchDatasets(),r=await rt(t.databasePlatform),a=i.map(n=>new ee(this,{profile:this._profile,declaration:{name:n.name},label:n.name,description:n.type,snippet:it(n.name,r)},e,n,r));this.variables=a,this._datastore={tables:a,source:b(this._definition)?this._definition:e,info:t}}catch(e){h("error",this.type,"Error with definition",{detail:{error:e,definition:this._definition}}),this._datastore=null}finally{this._loaded=!0}return this._datastore}get datastoreInfo(){return this._datastoreInfo}get tableVariables(){return this.variables.filter(ge)}async _dataCatalogDatastoreFromDefinition(e){let t=new Ge({url:e.portal.url});return await t.load(),new K({itemId:e.id,serviceUrl:e.serviceUrl,portal:t})}toProfileVariableDefinition(){let e=this.declaration,t=this._getSerializedDefinition();return{type:this.type,name:"",...e,...t?{definition:t}:{}}}},ee=class extends d{constructor(e,t,i,r,a){super(e,t),this._catalogDatastore=i,this.datasetInfo=r,this._dialectSpec=a,this.type="dictionary",this._fieldInfos=[],this._loaded=!1}get fieldInfos(){return this._fieldInfos}async loadSource(){return _(this._loadPromise)&&D(this._loadPromise)?await this._loadPromise:(this._loadPromise=this._loadFields(),await this._loadPromise)}async _loadFields(){if(this.loaded)return this._fieldInfos;try{let e=await this._catalogDatastore.fetchTableDescription(this.datasetInfo.name);this._fieldInfos=e.fields,this.variables=this._fieldInfos.map(t=>{let i={name:t.name,alias:t.name,type:t.type};return new l({profile:this._profile,declaration:{type:k(i,{supportGeometryFields:!0})},label:t.name,description:[t.serverType,ot(this._profile?.intlStrings,t.nullable)].filter(Boolean).join(" | "),snippet:Ve(t.name,this._dialectSpec),icon:R(i),filterDescription:!0})})}catch(e){h("error","DataCatalogDatastoreTableVariable","Error loading dataset",{detail:{error:e,dataset:this.datasetInfo}}),this._fieldInfos=[]}finally{this._loaded=!0}return this._fieldInfos}toProfileVariableDefinition(){return{type:"dictionary",name:this.datasetInfo.name,description:this.datasetInfo.type}}},Me=class extends v{constructor(e,t,i="en",r={}){super(void 0,{profile:null,declaration:{properties:[]}}),this.definition=e,this.intlStrings=t,this.locale=i,this.policy=r,this.variables=[],this._profile=this,this.loadPropertyDeclarations(e?.variables)}get supportFeatureSetFunctions(){return this.definition?.bundles?.includes("data-access")??!1}toEditorProfileDefinition(){return{...this.definition,variables:this.dictionaryVariables.map(e=>e.toProfileVariableDefinition())}}},nt={locale:"en"},$e=class{constructor(e,t){this.languageId=e,this._apiConfig=t,this._onDidChange=new W,this._modelToProfileMap=new Map,this._modelToApiContextMap=new Map,this._localeToApiLibraryPromiseMap=new Map,this._onModelContextDidChange=new W,this._onDidModelContextChangeTimeout=-1,ve().then(i=>{i.onWillDisposeModel(r=>{this.disposeForModel(r.uri)})})}_fireModelContextDidChange(e){this._onDidModelContextChangeTimeout===-1&&(this._onDidModelContextChangeTimeout=window.setTimeout(()=>{this._onDidModelContextChangeTimeout=-1,this._onModelContextDidChange.fire(e)},0))}_getApiKey(e){return z.isUri(e)||(e=z.parse(e)),e.toString()}getWorkerHostExtension(){}get onDidChange(){return this._onDidChange.event}disposeForModel(e){let t=this._getApiKey(e);this._modelToProfileMap.delete(t),this._modelToApiContextMap.delete(t)&&this._fireModelContextDidChange(t)}getEditorProfileForModel(e){return this._modelToProfileMap.get(this._getApiKey(e))}getApiContextForModel(e){return this._modelToApiContextMap.get(this._getApiKey(e))??nt}updateApiContextForModel(e,t){let i=this._getApiKey(e),r=this._modelToApiContextMap.get(i)??{};this._modelToApiContextMap.set(i,{...r,...t}),this._fireModelContextDidChange(i)}get onModelContextDidChange(){return this._onModelContextDidChange.event}async getApiLibraryForModel(e){let t=this.getApiContextForModel(e),i=this.getApiLibrary(t.locale??"en");return(await De(i,t)).categories}get workerHost(){if(!this._workerHost){let e=Object.assign({getApiLibrary:async t=>await this.getApiLibrary(t),getLanguageId:()=>this.languageId},this.getWorkerHostExtension());this._workerHost=e}return this._workerHost}async fetchApiLibrary(e){try{let{apiPath:t,apiPrefix:i}=this._apiConfig,r=ae(`${t}/${i}${e}.json`),a=await fetch(r);return a.ok?await a.json():[]}catch{return[]}}async getApiLibrary(e){let t=oe(e);return this._localeToApiLibraryPromiseMap.has(t)||this._localeToApiLibraryPromiseMap.set(t,this.fetchApiLibrary(t)),await this._localeToApiLibraryPromiseMap.get(t)??[]}};return{a:K,b:S,c:Te,d:Je,e:Ze,f:Ye,g:xt,h:Ve,i:it,j:Pt,k:ie,l:Mt,m:$t,n:Y,o:Me,p:$e}},"portal/PortalItem","WebMap","WebScene","layers/FeatureLayer","applications/Components/arcadeEditorUtils","core/Error","portal/Portal",a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as v}from"./XSKI5PRU.js";import{E as l,F as d,G as p,K as g,h as m,j as b}from"./XU7YAUUX.js";import"./VGOFAQ7A.js";import"./H6RQVSYM.js";var z=m`:host{--internal-border: var(--arcgis-coding-components-border, 1px solid var(--calcite-color-border-3));--internal-background-color: var(--arcgis-coding-components-background-color, var(--calcite-color-foreground-1));--internal-side-action-bar-max-w: var(--arcgis-coding-components-side-action-bar-max-w, 25%);--internal-code-editor-side-panel-w: var(--arcgis-coding-components-code-editor-side-panel-w, 600px);--internal-code-editor-side-panel-max-w: var(--arcgis-coding-components-code-editor-side-panel-max-w, 45%);--internal-code-editor-results-panel-max-h: var(--arcgis-coding-components-code-editor-results-panel-max-h, 50%);--internal-code-editor-results-panel-h: var(--arcgis-coding-components-code-editor-results-panel-h, 50%);--internal-code-editor-results-panel-bottom-drawer-controls-h: 0px;display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--internal-border);box-sizing:border-box;background-color:var(--internal-background-color);height:100%;.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.bottom-drawer{display:flex;flex:0 0 auto;flex-direction:column;overflow:hidden;position:relative;box-sizing:border-box;min-height:0}.bottom-drawer-resize-handle{display:none;position:absolute;inset-inline:0;inset-block-start:0;align-items:center;justify-content:center;block-size:var(--calcite-size-fixed-sm-plus);cursor:ns-resize;touch-action:none;user-select:none;z-index:var(--calcite-z-index-header);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);outline:none}.bottom-drawer-resize-handle-bar{display:flex;align-items:center;justify-content:center;inline-size:100%;block-size:var(--calcite-size-fixed-sm-plus);color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);border-block-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);transition:box-shadow .12s ease,color .12s ease,background-color .12s ease}.bottom-drawer-resize-handle-bar calcite-icon{color:inherit}}:host(:state(results-has-content)) .bottom-drawer{padding-block-start:var(--calcite-size-fixed-sm-plus);height:calc(var(--internal-code-editor-results-panel-h) + var(--internal-code-editor-results-panel-bottom-drawer-controls-h));max-height:calc(var(--internal-code-editor-results-panel-max-h) + var(--internal-code-editor-results-panel-bottom-drawer-controls-h))}:host(:state(results-has-content)) .bottom-drawer-resize-handle{display:flex}:host(:state(results-has-content)) .bottom-drawer-resize-handle:focus .bottom-drawer-resize-handle-bar{box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host(:state(results-has-content)) .bottom-drawer-resize-handle:hover .bottom-drawer-resize-handle-bar,:host(:state(results-has-content)) .bottom-drawer-resize-handle .bottom-drawer-resize-handle-bar,:host(:state(is-resizing)) .bottom-drawer-resize-handle-bar{color:var(--calcite-shell-panel-resize-icon-color, var(--calcite-color-text-1));background-color:var(--calcite-shell-panel-resize-background-color, var(--calcite-color-foreground-3))}:host(:state(results-has-content)) slot[name=bottom-action-bar]::slotted(*){border-top:0}slot[name=top-action-bar]{flex:0 0 auto}slot[name=top-action-bar]::slotted(*){border-bottom:var(--internal-border)}slot[name=bottom-action-bar]{flex:0 0 auto}slot[name=bottom-action-bar]::slotted(*){border-top:var(--internal-border)}slot[name=side-panel]::slotted(*){max-width:var(--internal-code-editor-side-panel-max-w);width:var(--internal-code-editor-side-panel-w);border-inline-start:var(--internal-border);box-sizing:border-box;flex:1 0 auto}slot[name=side-panel]::slotted(.hidden){display:none}slot[name=editor]::slotted(*){flex:auto;min-height:0}slot[name=results-panel]{display:flex;flex:1 1 auto;overflow:hidden;min-height:0}slot[name=results-panel]::slotted(*){border-top:var(--internal-border);box-sizing:border-box;flex:1 1 auto;min-height:0}slot[name=side-action-bar]::slotted(*){max-width:var(--internal-side-action-bar-max-w);border-inline-start:var(--internal-border)}`,P=10,k=25,x=100,i="results-has-content",f="is-resizing",$="--arcgis-coding-components-code-editor-results-panel-max-h",s="--internal-code-editor-results-panel-h",n="--internal-code-editor-results-panel-max-h",a="--internal-code-editor-results-panel-bottom-drawer-controls-h",h=class extends p{static{this.styles=[z]}#e=void 0;#i=!1;#a=l();#c=l();#n=l();#t;#h(e){this.#e===e.pointerId&&this.#r()}#g=e=>{this.#e===e.pointerId&&this.#r()};load(){this.manager.onLifecycle(()=>(this.#t=new ResizeObserver(()=>{this.elementInternals.states.has(i)&&this.#s()}),this.updateComplete.then(()=>this.#p()),()=>{this.#r(),this.#t?.disconnect(),this.#t=void 0}))}#v(){this.elementInternals.states.has(i)&&this.#s(),this.#p()}#x(e){e.button!==0||!this.elementInternals.states.has(i)||(e.preventDefault(),e.currentTarget instanceof HTMLElement&&(e.currentTarget.focus(),e.currentTarget.setPointerCapture(e.pointerId)),this.#e=e.pointerId,this.#i=!0,this.elementInternals.states.add(f),this.#u(e))}#f(e){if(!this.elementInternals.states.has(i))return;this.#s();let t=this.#P(e);t!=null&&(e.preventDefault(),e.stopPropagation(),this.#i=!0,this.#d(t))}#y(e){if(!e.target)return;let t=v(e);t||(this.#r(),this.#i||this.#$()),t?(this.elementInternals.states.add(i),this.#s()):this.elementInternals.states.delete(i)}#r(){let e=this.#e;if(!e)return;this.#e=void 0;let t=this.#c.value;t?.hasPointerCapture(e)&&t.releasePointerCapture(e),this.elementInternals.states.delete(f)}#u(e){if(this.#e!==e.pointerId)return;let t=this.#o(),r=this.el.getBoundingClientRect().bottom-e.clientY-t;this.#d(r,t)}#w(){let e=Number.parseFloat(this.el.style.getPropertyValue(s));if(Number.isFinite(e))return e;let t=Number.parseFloat(getComputedStyle(this.#a.value??this.el).height);return Number.isFinite(t)?Math.max(0,t-this.#o()):x}#m(){return this.el.querySelector(':scope > [slot="bottom-action-bar"]')}#o(){let e=this.#m()?.getBoundingClientRect().height??0,t=this.#n.value?.getBoundingClientRect().height??0;return e+t}#b(){return getComputedStyle(this.el).getPropertyValue($).trim()||null}#l(e,t){t?this.el.style.setProperty(e,t):this.el.style.removeProperty(e)}#z(e){let t=this.#b();if(!t)return null;let r=Number.parseFloat(t);if(t.endsWith("px")&&Number.isFinite(r))return r;if(t.endsWith("%")&&Number.isFinite(r))return this.el.getBoundingClientRect().height*r/100;let o=this.#a.value;if(!o)return null;let c=this.el.style.getPropertyValue(a),y=this.el.style.getPropertyValue(s),w=this.el.style.getPropertyValue(n);this.el.style.setProperty(a,`${e}px`),this.el.style.setProperty(s,`${this.el.getBoundingClientRect().height}px`),this.el.style.setProperty(n,t);let u=Number.parseFloat(getComputedStyle(o).height);return this.#l(a,c),this.#l(s,y),this.#l(n,w),Number.isFinite(u)?Math.max(0,u-e):null}#p(){let e=this.#t;if(!e)return;e.disconnect(),e.observe(this.el);let t=this.#n.value;t&&e.observe(t);let r=this.#m();r&&e.observe(r)}#P(e){let t=e.shiftKey?k:P,r=this.#w();switch(e.key){case"ArrowUp":return r+t;case"ArrowDown":return r-t;default:return}}#k(e,t){let r=Math.max(0,this.el.getBoundingClientRect().height-t),o=this.#z(t),c=o==null?r:Math.min(r,o);return Math.min(Math.max(e,x),c)}#d(e,t=this.#o()){let r=this.#k(e,t),o=this.#b();this.el.style.setProperty(a,`${t}px`),this.el.style.setProperty(s,`${r}px`),this.el.style.setProperty(n,o??`calc(100% - ${t}px)`)}#$(){this.el.style.removeProperty(a),this.el.style.removeProperty(s),this.el.style.removeProperty(n)}#s(){let e=this.#o(),t=Number.parseFloat(this.el.style.getPropertyValue(s));return Number.isFinite(t)?this.#d(t,e):this.el.style.setProperty(a,`${e}px`),e}render(){return b`<slot name=top-action-bar></slot><div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><slot name=editor></slot><div class="bottom-drawer" ${d(this.#a)}><div aria-label="Resize results panel" aria-orientation=horizontal class="bottom-drawer-resize-handle" role=separator tabindex=0 @pointercancel=${this.#h} @pointerdown=${this.#x} @pointermove=${this.#u} @pointerup=${this.#h} @lostpointercapture=${this.#g} @keydown=${this.#f} ${d(this.#c)}><div class="bottom-drawer-resize-handle-bar" ${d(this.#n)}><calcite-icon icon=drag-resize-vertical scale=s></calcite-icon></div></div><slot name=bottom-action-bar @slotchange=${this.#v}></slot><slot name=results-panel @slotchange=${this.#y}></slot></div></div><slot name=side-panel></slot><slot name=side-action-bar></slot></div>`}};g("arcgis-code-editor-shell",h);export{h as CodeEditorShell};