/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{fromValues as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeDehydratedPoint as t,setDehydratedPointFromValues as e}from"../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as o,getConvertedElevationFromVector as r,getConvertedElevationFromXYZ as u,absoluteHeightElevationInfo as i}from"../../../support/elevationInfoUtils.js";function l(n,t,e){return f(n,t,e)}function f(t=0,e=0,o=0){return n(t,e,o)}function c(n){return n}function s(n){return n}function a(t,e,o){return c(n(t,e,o))}function d(n){const[t,e,o]=n;return n.length>3?[t,e,o,n[3]]:[t,e,o]}function p(n){return n[3]=1|((n.length>3?n[3]:void 0)??0),n}function v(n){return Boolean(1&((n.length>3?n[3]:void 0)??0))}function m(n,t,{coordinateHelper:e,elevationInfo:o},r){return n?h(e.vectorToDehydratedPoint(n,x),t,o,r):null}function h(n,t,e,r=f()){return r[0]=n.x,r[1]=n.y,r[2]=n.z??0,null==t||("2d"===t.type?r[2]=0:r[2]=o(t,n,e,i)??0),r}function y(n,e){return t(n[0],n[1],n[2],e)}function g(n,t,o){return e(n,t[0],t[1],t[2],o),n}function I(n,o,{z:u,m:l},f,c){const{spatialReference:s,elevationInfo:a}=f;let d;if(null==u&&null==l)d=void 0;else if(null==o||"2d"===o.type)d=u??void 0;else{d=r(o,n,s,i,a)??0}const[p,v]=n;return c?e(c,p,v,d,s):c=t(p,v,d,s),null!=l&&(c.m=l,c.hasM=!0),c}function j(n,t,e,o,r=f()){const[l,c]=n;return r[0]=l,r[1]=c,n.length>3&&(r[3]=n[3]??0),"3d"!==e?.type?(r[2]=t.value,r):(r[2]=u(e,l,c,t.value,o,t.elevationInfo,i)??0,r)}const x=t(0,0,0,null);export{s as asVec2,d as clone,l as create,y as createDehydratedPoint,f as createWritable,m as fromAnyMapPoint,h as fromPoint,a as fromValues,c as fromVec3,v as isTarget,p as markAsTarget,g as setDehydratedPoint,I as toElevationAlignedDehydratedPoint,j as withSelfSnappingZ};
