/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{exactEquals as e}from"../../core/libs/gl-matrix-2/math/vec3.js";import r from"../Point.js";import n from"./MeshGeoreferencedVertexSpace.js";import i from"./MeshLocalVertexSpace.js";function o(e){return null==e.origin}function t(e){return null!=e.origin}function c(e){return t(e.vertexSpace)}function u(e,n){if(!t(e))return null;const[i,o,c]=e.origin;return new r({x:i,y:o,z:c,spatialReference:n})}function l(e,r){const{x:o,y:t,z:c,spatialReference:u}=e,l=[o,t,c??0];return"local"===(r?.vertexSpace??f(u))?new i({origin:l}):new n({origin:l})}function f(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}function a(r,n){return r.type===n.type&&(r.origin===n.origin||null!=r.origin&&null!=n.origin&&e(r.origin,n.origin))}export{o as isAbsoluteVertexSpace,c as isMeshWithRelativeVertexSpace,t as isRelativeVertexSpace,l as selectVertexSpace,a as vertexSpaceEquals,u as vertexSpaceOriginToPoint};
