/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as t}from"tslib";import i from"../../../core/Collection.js";import"../../../core/has.js";import{abortMaybe as s,destroyMaybe as e}from"../../../core/maybe.js";import{property as o,subclass as r}from"../../../core/accessorSupport/decorators.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import n from"./AnalysisView3D.js";import{LineOfSightController as l}from"./LineOfSight/LineOfSightController.js";import{LineOfSightTool as p}from"./LineOfSight/LineOfSightTool.js";import{LineOfSightVisualization as u}from"./LineOfSight/LineOfSightVisualization.js";import{connectAnalysisViewToTool as y,removeAnalysisViewTool as h,startPlaceOperation as c}from"../../analysis/analysisViewUtils.js";let d=class extends n{constructor(t){super(t),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new i,this.cursorTarget=null,this.editable=!0,this.elevationAlignedObserver=null,this.observerEngineLocation=a(),this.userOperation=null}initialize(){const t=this.view,i=this.analysis;this._analysisController=new l({analysis:i,analysisViewData:this,view:t}),this._analysisVisualization=new u({analysis:i,analysisViewData:this,view:t,isDecoration:!this.parent}),this.addHandles([this._analysisController.on("result-changed",t=>{t.target!==this.cursorTarget&&this.emit("result-changed",t)}),y(this,p)])}destroy(){h(this),this.userOperation=s(this.userOperation),this._analysisController=e(this._analysisController),this._analysisVisualization=e(this._analysisVisualization)}get visible(){return super.visible}set visible(t){super.visible=t}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get results(){return this.computations.map(t=>t.result)}get priority(){return this._analysisController.priority}set priority(t){this._analysisController.priority=t}get updating(){return null!=this._analysisController&&this._analysisController.updating||null!=this._analysisVisualization&&this._analysisVisualization.updating}place(t){return c(this,{placementOptions:t})}getResultForTarget(t){return this.computations.find(i=>i.target===t)?.result}get testInfo(){}};t([o({readOnly:!0})],d.prototype,"type",void 0),t([o({constructOnly:!0,nonNullable:!0})],d.prototype,"analysis",void 0),t([o()],d.prototype,"tool",void 0),t([o({readOnly:!0})],d.prototype,"results",null),t([o()],d.prototype,"priority",null),t([o()],d.prototype,"computations",void 0),t([o()],d.prototype,"cursorTarget",void 0),t([o()],d.prototype,"editable",void 0),t([o()],d.prototype,"elevationAlignedObserver",void 0),t([o()],d.prototype,"observerEngineLocation",void 0),t([o()],d.prototype,"updating",null),t([o()],d.prototype,"userOperation",void 0),t([o()],d.prototype,"_analysisController",void 0),t([o()],d.prototype,"_analysisVisualization",void 0),d=t([r("esri.views.3d.analysis.LineOfSightAnalysisView3D")],d);const g=d;export{g as default};
