/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import e from"./UZ6A3XQC.js";import"./DPJE33GY.js";import{a as S}from"./QN4OORAR.js";import d from"./KFUE7LVT.js";import"./UG7LOBJE.js";import b from"./AD6GOUND.js";import{B as u,w as t}from"./4B3QBH5T.js";import"./FUPYXGG6.js";import"./KUVOINJC.js";import"./NKG4FLLR.js";import{A as l,C as n,F as g,g as m,h as s,m as a,x as o,y as c,z as y}from"./RPU6VCJ4.js";import"./OR4HXHSY.js";export default $arcgis.t(([,,{g:w,h:f,i:r,j:h}])=>{var d={sizeSection:"size-section",dropdownText:"dropdown-text",colorPickerContainer:"color-picker-container"},v=m`.hide{visibility:hidden}.am5-html-container{z-index:101!important}.am5-layer-1000{z-index:1000!important}.am5-layer-30{z-index:100!important}.show{display:block}.notifyPanel{flex:0 1 auto}.disable-interactions{pointer-events:none}.dim-text{color:var(--arcgis-charts-dim-text)}:host{overflow-y:auto}:host arcgis-charts-config-colors{padding:var(--arcgis-charts-panel-padding);padding-bottom:1rem}:host .size-section{padding:1rem;display:flex}:host .size-section calcite-label{flex:1 1 0px;width:0}:host .size-section calcite-label .dropdown-text{max-width:75px;overflow:hidden;white-space:normal;text-overflow:ellipsis;cursor:pointer}:host .color-picker-container{display:flex}:host .color-picker-container calcite-label{flex:1 1 0px;width:0}:host .color-picker-container calcite-label .dropdown-text{max-width:75px;overflow:hidden;white-space:normal;text-overflow:ellipsis;cursor:pointer}`,p=class extends y{constructor(){super(...arguments),this._messages=S(),this.lineWidthInputElement=o(),this.lineStyleDropdownElement=o(),this.lineStyle={type:u.SLS},this.arcgisChartsConfigLineStyleChange=a(),this.arcgisChartsConfigLineStyleClose=a()}static{this.properties={messageOverrides:0,lineStyle:0,header:1,open:5,enableClose:5,usePanel:5}}static{this.styles=v}closePanel(e){e.target.closed&&this.enableClose===!0&&(this.open=!1,this.arcgisChartsConfigLineStyleClose.emit())}colorChange(e){this.lineStyle.color=e.detail,this.emitLineStyleEvent()}lineStyleChange(){let e=this.lineStyleDropdownElement.value?.selectedItems[0].accessKey;this.lineStyle.style!==e&&(this.lineStyle.style=e,this.lineStyle={...this.lineStyle},this.emitLineStyleEvent())}selectedLineStyle(){let e,i;switch(this.lineStyle?.style){case t.Dot:e="line-dotted",i=this._messages.dot??"";break;case t.Dash:e="line-dashed",i=this._messages.dash??"";break;case t.Solid:default:e="line-solid",i=this._messages.solid??"";break}return{icon:e,style:i}}widthChange(){let e=this.lineWidthInputElement.value?.value;e!==void 0&&w(e,this.lineWidthInputElement.value?.min,this.lineWidthInputElement.value?.max)?(this.lineStyle.width=Number.parseInt(e),this.emitLineStyleEvent(),this.lineWidthInputElement.value&&r({inputElement:this.lineWidthInputElement.value,status:h.IDLE})):this.lineWidthInputElement.value&&r({inputElement:this.lineWidthInputElement.value,status:h.INVALID})}emitLineStyleEvent(){Number.isNaN(Number.parseInt(this.lineStyle?.color?.[0]?.toString()??""))&&(this.lineStyle.color=void 0),this.arcgisChartsConfigLineStyleChange.emit(this.lineStyle)}render(){let e=[s`<div class=${l(d.sizeSection)}><calcite-label>${this._messages.style}<calcite-dropdown @calciteDropdownSelect=${this.lineStyleChange} ${c(this.lineStyleDropdownElement)}><calcite-button .iconEnd=${this.selectedLineStyle().icon} slot=trigger kind=neutral appearance=outline-fill scale=m><label class=${l(d.dropdownText)}>${this.selectedLineStyle().style}</label></calcite-button><calcite-dropdown-group><calcite-dropdown-item icon-end=line-solid .selected=${this.lineStyle?.style===t.Solid} accesskey=${t.Solid??n}>${this._messages.solid}</calcite-dropdown-item><calcite-dropdown-item icon-end=line-dotted .selected=${this.lineStyle?.style===t.Dot} accesskey=${t.Dot??n}>${this._messages.dot}</calcite-dropdown-item><calcite-dropdown-item icon-end=line-dashed .selected=${this.lineStyle?.style===t.Dash} accesskey=${t.Dash??n}>${this._messages.dash}</calcite-dropdown-item></calcite-dropdown-group></calcite-dropdown></calcite-label><calcite-label>${this._messages.width}<calcite-input type=number min=1 step=any .value=${f(this.lineStyle?.width)} @calciteInputInput=${this.widthChange} ${c(this.lineWidthInputElement)}></calcite-input></calcite-label></div>`,s`<div class=${l(d.colorPickerContainer)}><arcgis-charts-config-colors .rgba=${this.lineStyle?.color??void 0} @arcgisColorSelect=${this.colorChange}></arcgis-charts-config-colors></div>`];return this.usePanel!==!1?s`<calcite-panel .heading=${this.header??this._messages.header} .closed=${this.open===!1} .closable=${this.enableClose} @calcitePanelClose=${this.closePanel}>${e}</calcite-panel>`:e}};g("arcgis-charts-config-line-style",p);return p},b,d,e)