/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
v4.34.7 */
import{a as h}from"./B7UYEEQJ.js";import"./SRDD32D4.js";import"./IMJMO6DB.js";import{H as o,I as u,J as d,P as g,a as c,b as t,s as r}from"./RNRMSLW5.js";import"./G6QKOIC3.js";var m=c`:host{max-height:calc(100vh - 150px);min-height:300px}.results-heading{display:flex;flex-direction:column;padding:var(--calcite-spacing-md);gap:var(--calcite-spacing-xs)}.results-heading .results-heading-title{font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size-1)}.results-heading .results-heading-subtitle{font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3)}.no-results-landing{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:var(--calcite-spacing-xl);gap:var(--calcite-spacing-md)}.no-results-landing calcite-icon{margin-bottom:var(--calcite-spacing-sm);--calcite-icon-color: var(--calcite-color-text-3)}.no-results-landing .no-results-heading{font-size:var(--calcite-font-size-2)}.no-results-landing .no-results-description{color:var(--calcite-color-text-3)}`,n=class extends d{constructor(){super(...arguments),this._resultFeatureListRef=o(),this._messages=h({blocking:!0}),this._clearSelectedResultType=()=>this._selectedResultType=void 0,this.layers=[],this.arcgisSelectedResultTypeChange=r(),this._renderResultListItems=s=>{let{_messages:e}=this,{elements:i,globalFunctionResults:l}=s,a=[];return i&&i.length>0&&a.push(this._renderResultListItem(i.length,e.headings.features,e.labels.numFeatures,()=>this._selectedResultType="features")),l&&l.length>0&&a.push(this._renderResultListItem(l.length,e.headings.functions,e.labels.numFunctions,()=>{})),a},this._renderResultListItem=(s,e,i,l)=>t`<calcite-list-item .label=${e} @calciteListItemSelect=${l}><calcite-chip .label=${i} scale=s slot=content-end>${s}</calcite-chip><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item>`}static{this.properties={_selectedResultType:16,layers:0,messageOverrides:0,selectedResultType:32,traceConfigTitle:1,traceResult:0,utilityNetwork:0}}static{this.styles=m}get selectedResultType(){return this._selectedResultType}willUpdate(s){s.has("_selectedResultType")&&this.arcgisSelectedResultTypeChange.emit(),s.has("traceResult")&&this._clearSelectedResultType()}render(){let{_messages:s,traceResult:e}=this;if(e){if(!e.elements?.length&&!e.globalFunctionResults?.length)return t`<div>${this._renderTraceResultsHeading()}${this._renderNoResultsLanding()}</div>`}else return t`<div>${this._renderTraceResultsHeading()}${this._renderNoTraceLanding()}</div>`;let{elements:i,globalFunctionResults:l}=e,a=i&&i.length>0&&(!l||l.length===0);return t`<calcite-flow>${a?null:t`<calcite-flow-item .selected=${this.selectedResultType===void 0}>${this._renderTraceResultsHeading()}<calcite-list .label=${s.headings.traceResultsGeneric}>${this._renderResultListItems(e)}</calcite-list></calcite-flow-item>`}${a||this.selectedResultType==="features"?t`<calcite-flow-item .heading=${s.headings.features} .description=${s.headings.totalFeatures.replace("{number}",e.elements.length.toString())} selected @calciteFlowItemBack=${this._clearSelectedResultType}><arcgis-utility-network-result-feature-list .elements=${e.elements} .layers=${this.layers} .utilityNetwork=${this.utilityNetwork} ${u(this._resultFeatureListRef)}></arcgis-utility-network-result-feature-list></calcite-flow-item>`:null}</calcite-flow>`}_renderTraceResultsHeading(){return t`<div class="results-heading"><div class="results-heading-title">${this._messages.headings.traceResultsGeneric}</div>${this.traceConfigTitle?t`<div class="results-heading-subtitle">${this.traceConfigTitle}</div>`:null}</div>`}_renderNoResultsLanding(){return t`<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${this._messages.noResultsHeading}</div><div class="no-results-description">${this._messages.noResultsDescription}</div></div>`}_renderNoTraceLanding(){return t`<div class="no-results-landing"><calcite-icon icon=utility-network-trace scale=l></calcite-icon><div class="no-results-heading">${this._messages.noTraceConfigHeading}</div><div class="no-results-description">${this._messages.noTraceConfigDescription}</div></div>`}};g("arcgis-utility-network-trace-results",n);export{n as ArcgisUtilityNetworkTraceResults};
