/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import{a as p}from"./IADXB53D.js";import{b as o}from"./HVT2WBVC.js";import{E as s,F as r,G as n,I as l,J as d,h as a,i}from"./FFF5HUPM.js";import"./EXBEKVP5.js";var c=a`:host{display:block}:host .esri-legend__service{padding:0}:host .esri-legend__layer-body,:host .esri-legend__layer,:host .esri-legend__layer-table,:host .esri-legend__group-layer-child,:host .esri-legend__layer-child-table{margin:0;overflow:hidden}:host .hide{display:none}`,e={service:"esri-legend__service",groupLayerChild:"esri-legend__group-layer-child",layer:"esri-legend__layer"},t=class extends n{constructor(){super(),this.layerCaption=s(),this.expanded=!0,this.listenOn(window,"layerCaptionElementExpandUpdated",this.layerCaptionElementExpandUpdatedEmitted)}static{this.properties={expanded:16,legendvm:0,featureCount:5,activeLayerInfo:0,isChild:5}}static{this.styles=c}load(){new MutationObserver(()=>{this.requestUpdate()}).observe(this.el,{attributes:!0})}layerCaptionElementExpandUpdatedEmitted(){this.layerCaption.value&&(this.expanded=this.layerCaption.value.expanded)}render(){let h=this.activeLayerInfo.parent?` ${e.groupLayerChild}`:"";return i`<div style=${d({borderLeft:"1px solid var(--calcite-color-border-3)"})} class=${`${e.service}${h}`} tabindex=0><instant-apps-interactive-legend-layer-element-caption .legendvm=${this.legendvm} .featureCount=${this.featureCount} .activeLayerInfo=${this.activeLayerInfo} .isChild=${!!this.isChild} class=${l(p(this.el))} ${r(this.layerCaption)}></instant-apps-interactive-legend-layer-element-caption><div .id=${`${this.activeLayerInfo?.layer?.id}-legend-layer`} class=${`${e.layer}${this.expanded?" show":" hide"}`}><slot name=content></slot></div></div>`}};o("instant-apps-interactive-legend-layer-element",t);export{t as InstantAppsInteractiveLegendLayerElement};
