/*
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{createScalar as e}from"../../../../core/quantity.js";import{property as i,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{getLongitudeLatitude as s}from"../../../../geometry/support/pointUtils.js";import{makeLongitudeField as l,makeLatitudeField as a,makeXField as r,makeYField as n,makeElevationField as u}from"../fields/fields.js";import{createGeographicCoordinate as c}from"../fields/parsingAndFormattingUtils.js";import{elevationFromPoint as h}from"../../../support/euclideanLengthMeasurementUtils.js";import{supportsGeodesicMeasurement as p}from"../../../support/geodesicMeasurementUtils.js";const g=g=>{const d=g;let m=class extends d{constructor(){super(...arguments),this.longitude=l(),this.latitude=a(),this.x=r(),this.y=n(),this.elevation=u(),this.geographic=!1}get effectiveX(){return this.geographic?this.longitude:this.x}get effectiveY(){return this.geographic?this.latitude:this.y}get key(){return{longitude:this.longitude.actual,latitude:this.latitude.actual,x:this.x.actual,y:this.y.actual,elevation:this.elevation.actual,geographic:this.geographic}}setLocationFromPoint(t,i=t?.spatialReference){if(this.geographic=!!i&&p(i),null==t)return this._setActualLonLat(null,null),void this._setActualXY(null,null);if(this.geographic){const e=s(t,f);this._setActualLonLat(c(e?.[0]),c(e?.[1]))}else this._setActualXY(e(t.x),e(t.y))}setElevationFromPoint(t,e){const{elevation:i}=this;i.actual=h(t),i.visible=e.hasZ,i.readOnly=!1,i.showAsZ=!0}_setActualLonLat(t,e){this.longitude.actual=t,this.latitude.actual=e}_setActualXY(t,e){this.x.actual=t,this.y.actual=e}};return t([i()],m.prototype,"geographic",void 0),t([i()],m.prototype,"effectiveX",null),t([i()],m.prototype,"effectiveY",null),t([i()],m.prototype,"key",null),m=t([o("esri.views.interactive.tooltip.infos.TooltipInfoWithCoordinates")],m),m},f=[0,0];export{g as TooltipInfoWithCoordinates};
