/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{create as r}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import o from"../../Extent.js";import{canProjectWithoutEngine as t}from"../../projectionUtils.js";import{getSphericalPCPF as e}from"../../spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as i}from"../../projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as n}from"../../projection/projectBuffer.js";import{toCorners as m,toExtent as s,fromBuffer as a}from"../aaBoundingBox.js";import{newDoubleArray as f}from"../DoubleArray.js";import{isRelativeVertexSpace as p}from"../meshVertexSpaceUtils.js";import{a as c,t as j}from"../../../chunks/vec3.js";function l(r){const{spatialReference:f,vertexSpace:l,untransformedBounds:d}=r,g=m(d,u);if(p(l)&&r.transform&&c(g,g,r.transform.localMatrix),"georeferenced"===l.type){const r=l.origin;return r&&j(g,g,r),s(a(g),f)}const y=e(f),B=l.origin;if(!t(y,f)){const[r,t,e]=B;return new o({xmin:r,ymin:t,zmin:e,xmax:r,ymax:t,zmax:e,spatialReference:f})}return i(f,B,x,y),c(g,g,x),n(g,y,0,g,f,0),s(a(g),f)}const x=r(),u=f(24);export{l as computeMeshExtent};
