/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as r}from"tslib";import e from"../../../../Graphic.js";import t from"../../../../core/Accessor.js";import{initial as i}from"../../../../core/reactiveUtils.js";import{property as s,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as o}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../layers/GraphicsLayer.js";import l from"../../../../symbols/SimpleFillSymbol.js";let h=class extends t{constructor(r){super(r),this._emptyFillSymbol=new l({color:null,outline:null}),this._graphicsLayer=new p({listMode:"hide",internal:!0}),this._updatingHandles=new o}initialize(){this.view.map?.add(this._graphicsLayer),this._updatingHandles.add(()=>({geometry:this.measurementViewData.analysis.geometry}),({geometry:r})=>{if(!r)return void this._graphicsLayer.graphics.destroyAll();const t=this._graphicsLayer.graphics.at(0);t?t.geometry=r:(this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.add(new e({geometry:r,symbol:this._emptyFillSymbol})))},i)}destroy(){this._emptyFillSymbol.destroy(),this._graphicsLayer.removeFromParent(),this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.destroy(),this._updatingHandles.destroy()}get graphic(){return this._graphicsLayer.graphics.at(0)}get graphicsLayer(){return this._graphicsLayer}get updating(){return!this._graphicsLayer.loaded||this._updatingHandles.updating}};r([s()],h.prototype,"graphic",null),r([s()],h.prototype,"graphicsLayer",null),r([s()],h.prototype,"measurementViewData",void 0),r([s()],h.prototype,"updating",null),r([s()],h.prototype,"view",void 0),h=r([a("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementManipulatorVisualization")],h);export{h as AreaMeasurementManipulatorVisualization};
