UNPKG

@arcgis/coding-components

Version:
2 lines 2.07 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */ import f from"./46XKQEJM.js";import e from"./HC4YO4ZY.js";import"./HPZZVB4X.js";import b from"./GLJQQLP2.js";import{a as d}from"./KBTQTCIT.js";import"./PHPFOWGJ.js";import"./GS2ISVXJ.js";import{c as n,e as u}from"./6G5URSC7.js";import{G as o,K as c,h as l,j as a}from"./2FGVSLMQ.js";import"./Y3KOWWO5.js";import"./3TTFCHAA.js";export default $arcgis.t(([,{a:s,h:r,i:p,j:m},{c:h,f:g,g:f,h:b,i:v}])=>{var T=l`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);--calcite-block-padding: var(--calcite-spacing-sm);overflow:auto;calcite-flow{height:100%}.disabled-state-text{font-size:var(--calcite-font-size-sm);color:var(--calcite-color-text-3);font-style:italic;display:block;margin:var(--calcite-spacing-md)}[class*=result-value-]{line-height:1.25rem}}`;function x(t,e){return h(t)||b(t)||f(t)||g(t)?e??"Output":t.arcadeType}var i=class extends o{constructor(){super(...arguments),this.messages=d()}static{this.properties={debuggerStore:0,result:0,outputTitle:1}}static{this.styles=[T,m,p()]}load(){this.manager.onLifecycle(()=>{let e=n(this.el,["class"],this.updateTheme.bind(this));return this.updateTheme(),()=>e()})}willUpdate(e){e.has("result")&&this.result&&this.debuggerStore?.lazyTreeState.reset()}updateTheme(){u(this.el)==="dark"?this.elementInternals.states.add(r):this.elementInternals.states.delete(r)}render(){if(!this.result)return a`<span class="disabled-state-text">${this.messages.nooutput??"No output available."}</span>`;let e=this.debuggerStore?.lazyTreeState;return e?a`<calcite-tree .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect} .lines=${s.lines} .selectionMode=${s.selectionMode}>${v({expanded:!0,name:x(this.result,this.outputTitle),value:this.result,messages:this.messages,path:this.result.arcadeType,lazyTreeState:e})}</calcite-tree>`:a`<span class="disabled-state-text">${this.messages.nooutput??"No output available."}</span>`}};c("arcgis-arcade-debugger-output",i);return i},b,e,f)