/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import{a as v}from"./CJ3EZE7U.js";import"./C5KDPY7R.js";import"./YM4U4HSN.js";import{a as h}from"./IADXB53D.js";import{a as g}from"./BM4VSEDV.js";import{b as p}from"./HVT2WBVC.js";import"./UBPOT5V3.js";import"./ISFTCFSJ.js";import{G as o,I as d,J as l,K as c,h as s,i as t,q as r}from"./FFF5HUPM.js";import"./EXBEKVP5.js";var _=s`:host{display:block;--instant-apps-interactive-legend-heading-font-size: 1rem;--instant-apps-interactive-legend-heading-font-weight: normal;--instant-apps-interactive-legend-secondary-color: var( --calcite-color-text-1 );--instant-apps-interactive-legend-ui-padding: 15px 10px}:host .esri-widget__heading{overflow:hidden}:host .esri-widget__heading{margin:0;overflow-x:hidden}:host .esri-widget__heading{display:inline-block;font-size:var(--instant-apps-interactive-legend-heading-font-size)}:host .esri-widget__heading{font-weight:var(--instant-apps-interactive-legend-heading-font-weight)}:host header{display:flex;text-align:left;padding:var(--instant-apps-interactive-legend-ui-padding);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}:host header h3{margin-bottom:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;line-height:normal;color:var(--instant-apps-interactive-legend-secondary-color)}:host header .instant-apps-interactive-legend__heading-text--group-item{-webkit-line-clamp:2;line-clamp:2}:host header span{width:100%;font-size:var(--instant-apps-interactive-legend-total-feature-count-font-size);color:var(--instant-apps-interactive-legend-secondary-color)}:host header .instant-apps-interactive-legend__header-action-container{display:flex;align-items:center}:host .esri-widget__heading header{padding:var(--instant-apps-interactive-legend-ui-padding)}:host .esri-widget--panel{margin:0}:host(.calcite-mode-dark) .instant-apps-interactive-legend__header{background-color:#242424;color:var(--calcite-color-text-1)}:host(.calcite-mode-light) .instant-apps-interactive-legend__header{background-color:#fff;color:var(--calcite-color-text-1)}`,e={label:"esri-legend__service-label",header:"esri-widget__heading",interactiveLegendHeader:"instant-apps-interactive-legend__header",headerActionContainer:"instant-apps-interactive-legend__header-action-container"},a=class extends o{constructor(){super(...arguments),this._messages=g({name:"instant-apps-interactive-legend",blocking:!0}),this.isChild=!1,this.expanded=!0,this.groupLayerCaptionElementExpandUpdated=r()}static{this.properties={legendvm:0,featureCount:5,activeLayerInfo:0,isChild:5,expanded:5}}static{this.styles=_}toggleExpanded(){return()=>{this.expanded=!this.expanded,this.groupLayerCaptionElementExpandUpdated.emit(this.expanded)}}render(){let m=v(this.activeLayerInfo),{expanded:n}=this,i=n?this._messages.collapse:this._messages.expand,f=this.isChild?" instant-apps-interactive-legend__heading-text--group-item":"";return t`<header class=${`${e.interactiveLegendHeader} ${h(this.el)}`} style=${l({borderLeft:"1px solid var(--calcite-color-border-3)"})}><span><span class=${d(e.headerActionContainer)}><calcite-action @click=${this.toggleExpanded()} .icon=${n?"chevron-down":"chevron-up"} appearance=transparent .text=${i} .label=${i} scale=s></calcite-action><h3 class=${`${e.header} ${e.label}${f}`} title=${this.activeLayerInfo?.title??""??c}>${this.activeLayerInfo?.title}</h3></span>${this.featureCount&&m?t`<instant-apps-interactive-legend-count .activeLayerInfo=${this.activeLayerInfo} show-total .legendvm=${this.legendvm}></instant-apps-interactive-legend-count>`:null}</span></header>`}};p("instant-apps-interactive-legend-group-legend-element-caption",a);export{a as InstantAppsInteractiveLegendGroupLegendElementCaption};
