/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{createTask as r}from"../../../core/asyncUtils.js";import o from"../../../core/Collection.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{watch as s,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../core/accessorSupport/decorators.js";import{updateDirectionalNodesGeneric as p}from"./imageNavigationUtils.js";let a=class extends t{constructor(e){super(e),this._compileTask=null,this.currentNode=null,this.currentBestFeature=null,this.nodes=new o}initialize(){this.addHandles(s(()=>({nodes:this.nodes,currenNode:this.currentNode,length:this.nodes.length,currentHeading:this.currentNode?.currentHeading,currentPitch:this.currentNode?.currentPitch}),()=>{this._compileTask?.abort(),this._compileTask=r(async e=>{i(e),this.compile()})},n))}get state(){const e=this._compileTask;return e?e.finished?e.error?"error":"compiled":"compiling":"ready"}compile(){const{currentNode:e,nodes:t}=this;e&&t.length&&(e.reset(),p(e,t))}};e([c()],a.prototype,"_compileTask",void 0),e([c()],a.prototype,"currentNode",void 0),e([c()],a.prototype,"currentBestFeature",void 0),e([c()],a.prototype,"nodes",void 0),e([c()],a.prototype,"state",null),a=e([l("esri.widgets.OrientedImageryViewer.components.NavigationUIPanoramicViewModel")],a);const d=a;export{d as default};
