/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as e}from"tslib";import t from"../analysis/DirectLineMeasurementAnalysis.js";import{deprecateWidget as i}from"../core/deprecate.js";import s from"../core/Logger.js";import{ignoreAbortErrors as o}from"../core/promiseUtils.js";import{property as r,subclass as n}from"../core/accessorSupport/decorators.js";import l from"./Widget.js";import a from"./DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js";import{globalCss as u}from"./support/globalCss.js";import{MeasurementWidgetContent as p}from"./support/MeasurementWidgetContent.js";import{messageBundle as m,tsx as c}from"./support/widget.js";const v="esri-direct-line-measurement-3d",d={base:v,newMeasurementButton:`${v}__clear-button`};let g=class extends l{constructor(e,t){super(e,t),this.messages=null,this.messagesCommon=null,this.viewModel=new a({suppressDeprecationWarning:!0}),i(s.getLogger(this),"Direct Line Measurement 3D","arcgis-direct-line-measurement-3d",{version:"4.33"})}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get icon(){return"measure-line"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}render(){const{messages:e,messagesCommon:t,unit:i,unitOptions:s,viewModel:r}=this,{active:n,measurement:l,state:a,supported:m}=r;return c("div",{"aria-label":this.messages.widgetLabel,class:this.classes(d.base,u.widget,u.panel),key:this,role:"presentation"},this.visible?c(p,{active:n,measurementItems:[{key:"direct",title:e.direct,value:w(l?.directDistance)},{key:"horizontal",title:e.horizontal,value:w(l?.horizontalDistance)},{key:"vertical",title:e.vertical,value:w(l?.verticalDistance)}],messages:{...e,notApplicable:t?.notApplicable},newMeasurementButtonClass:d.newMeasurementButton,state:a,supported:m,unit:i,unitOptions:s,onNewMeasurementClick:()=>{o(this.viewModel.start())},onUnitChange:e=>{this.unit=e}}):null)}};function w(e){return"available"===e?.state?e.text:null}e([r()],g.prototype,"view",null),e([r()],g.prototype,"visible",null),e([r()],g.prototype,"active",null),e([r({type:t,nonNullable:!0})],g.prototype,"analysis",null),e([r()],g.prototype,"icon",null),e([r()],g.prototype,"label",null),e([r(),m("esri/widgets/DirectLineMeasurement3D/t9n/DirectLineMeasurement3D")],g.prototype,"messages",void 0),e([r(),m("esri/t9n/common")],g.prototype,"messagesCommon",void 0),e([r()],g.prototype,"uiStrings",void 0),e([r({type:a})],g.prototype,"viewModel",void 0),e([r()],g.prototype,"unitOptions",null),e([r()],g.prototype,"unit",null),g=e([n("esri.widgets.DirectLineMeasurement3D")],g);const h=g;export{h as default};
