/*
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 t}from"tslib";import e from"../../../core/Accessor.js";import{property as r,subclass as o}from"../../../core/accessorSupport/decorators.js";import i from"../../../geometry/Point.js";import{normalizeDegrees as n,getRelativeAngleBetweenPoints as s}from"./imageNavigationUtils.js";const l=["towards","right","backwards","left"];let a=class extends e{constructor(t){super(t),this.attributes=null,this.backwards=null,this.geometry=null,this.left=null,this.right=null,this.towards=null}get currentHeading(){return this._get("currentHeading")??0}set currentHeading(t){const e=n(t);this._set("currentHeading",e)}get currentPitch(){return this._get("currentPitch")??0}set currentPitch(t){const e=n(t);this._set("currentPitch",e)}get heading(){return this.attributes.cameraHeading}get id(){return this.attributes.objectId}get pitch(){return this.attributes.cameraPitch}get roll(){return this.attributes.cameraRoll??0}getDistanceTo(t){return this.geometry.distance(t.geometry)}getDirectionTo(t){if(!t)return null;const{geometry:{x:e,y:r},currentHeading:o}=this,{geometry:{x:i,y:a}}=t,u=s(e,r,i,a),c=n(u-o),d=Math.floor((c+45)/90)%4;return l[d]}reset(){this.towards=null,this.backwards=null,this.left=null,this.right=null}};t([r()],a.prototype,"attributes",void 0),t([r()],a.prototype,"backwards",void 0),t([r()],a.prototype,"currentHeading",null),t([r()],a.prototype,"currentPitch",null),t([r({type:i})],a.prototype,"geometry",void 0),t([r({readOnly:!0})],a.prototype,"heading",null),t([r({readOnly:!0})],a.prototype,"id",null),t([r()],a.prototype,"left",void 0),t([r({readOnly:!0})],a.prototype,"pitch",null),t([r()],a.prototype,"right",void 0),t([r({readOnly:!0})],a.prototype,"roll",null),t([r()],a.prototype,"towards",void 0),a=t([o("esri.widgets.OrientedImageryViewer.components.NavigationNode")],a);const u=a;export{u as default};
