/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import f from"./UZ6A3XQC.js";import"./DPJE33GY.js";import{a as b}from"./QN4OORAR.js";import e from"./KFUE7LVT.js";import"./UG7LOBJE.js";import c from"./AD6GOUND.js";import"./4B3QBH5T.js";import"./FUPYXGG6.js";import"./KUVOINJC.js";import"./NKG4FLLR.js";import{A as a,F as d,g as l,h as o,m as u,x as h,y as g,z as p}from"./RPU6VCJ4.js";import"./OR4HXHSY.js";export default $arcgis.t(([,,{g:f,h:v,i:r,j:m}])=>{var s={container:"container",label:"label",numberInput:"number-input"},x=l`.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)}.container{width:var(--arcgis-charts-config-calcite-block-width, var(--arcgis-charts-config-calcite-block-default-width));height:var(--arcgis-charts-config-calcite-block-height, var(--arcgis-charts-config-calcite-block-default-height));margin-top:.5rem}.container>.number-input{margin-bottom:.5rem;display:flex}.container>.number-input>div{width:100%}.label{display:flex;margin-bottom:.5rem;justify-content:space-between}`,c=class extends p{constructor(){super(...arguments),this._messages=b(),this.decimalPlacesInputElement=h(),this.arcgisChartsConfigNumberFormatChange=u()}static{this.properties={messageOverrides:0,numberFormat:0}}static{this.styles=x}onDecimalPlacesChange(){let t=this.decimalPlacesInputElement.value?.value,i=Math.floor(Number(t)),n=i===Number(t)&&i>=0;if(t!==void 0&&n&&f(t,this.decimalPlacesInputElement.value?.min,this.decimalPlacesInputElement.value?.max)){let F=Number.parseInt(t),e={minimumFractionDigits:this.numberFormat?.minimumFractionDigits,maximumFractionDigits:F};e.maximumFractionDigits!==void 0&&e.minimumFractionDigits!==void 0&&e.minimumFractionDigits>e.maximumFractionDigits&&(e.minimumFractionDigits=e.maximumFractionDigits);let C=this.getUpdatedNumberFormat(e);this.arcgisChartsConfigNumberFormatChange.emit(C),this.decimalPlacesInputElement.value&&r({inputElement:this.decimalPlacesInputElement.value,status:m.IDLE})}else this.decimalPlacesInputElement.value&&r({inputElement:this.decimalPlacesInputElement.value,status:m.INVALID})}onShowThousandsSeparatorChange(t){let i=t.target.checked,n=this.getUpdatedNumberFormat({useGrouping:i});this.arcgisChartsConfigNumberFormatChange.emit(n)}getUpdatedNumberFormat(t){return{...this.numberFormat,...t}}render(){return o`<div class=${a(s.container)}><calcite-label class=${a(s.label)}>${this._messages.decimalPlaces}<calcite-input type=number class=${a(s.numberInput)} min=0 max=20 step=1 .value=${v(this.numberFormat?.maximumFractionDigits,2)} @calciteInputInput=${this.onDecimalPlacesChange} ${g(this.decimalPlacesInputElement)}></calcite-input></calcite-label><calcite-label layout=inline-space-between class=${a(s.label)}>${this._messages.showThousandSeparators}<calcite-switch name=useGrouping .checked=${!!(this.numberFormat?.useGrouping??!0)} @calciteSwitchChange=${this.onShowThousandsSeparatorChange}></calcite-switch></calcite-label></div>`}};d("arcgis-charts-config-number-format",c);return c},c,e,f)