/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import{destroyHandle as a}from"../../../../../core/handleUtils.js";import{watch as s,sync as r}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as i}from"../../../../../core/accessorSupport/decorators.js";import{MeasurementData as n}from"./MeasurementData.js";const l={maxRelativeErrorCoplanar:.005,maxRelativeErrorAlmostCoplanar:.01,verticalAngleThreshold:80};let p=class extends e{get updating(){return this.analysisViewData.measurementData?.updating??!1}constructor(t){super(t)}initialize(){const{view:t}=this,e=new n({view:t,fittingSettings:l});this.analysisViewData.measurementData=e;const o=()=>this._update(e);this.addHandles([this.analysisViewData.path.on("change",o),s(()=>{const{stagedPoint:t,mode:e}=this.analysisViewData;return[t,e]},o,r),a(e)]),o()}_update(t){const{analysisViewData:e}=this;t.update(e.path,e.stagedPoint,e.mode)}};t([o({constructOnly:!0})],p.prototype,"view",void 0),t([o({constructOnly:!0})],p.prototype,"analysis",void 0),t([o({constructOnly:!0})],p.prototype,"analysisViewData",void 0),t([o()],p.prototype,"updating",null),p=t([i("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementController")],p);export{p as AreaMeasurementController};
