/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{getMetersPerVerticalUnitForSR as o}from"../../core/units.js";import{isSphericalPCPF as n}from"../ellipsoidUtils.js";import{equals as t}from"./spatialReferenceUtils.js";import{getEndpoint as e}from"./curves/curveUtils.js";function r(o,n,t){const e=i(n,t);if(1!==e)switch(o){case"point":case"esriGeometryPoint":return o=>s(o,e);case"polyline":case"esriGeometryPolyline":return o=>c(o,e);case"polygon":case"esriGeometryPolygon":return o=>f(o,e);case"multipoint":case"esriGeometryMultipoint":return o=>l(o,e);case"extent":case"esriGeometryEnvelope":return o=>u(o,e);default:return}}function i(e,r){if(null==e||null==r||t(e,r)||n(e)||n(r))return 1;return o(e)/o(r)}function s(o,n){null!=o?.z&&(o.z*=n)}function f(o,n){if(o){if(o.curveRings)for(const t of o.curveRings)for(const o of t){const t=e(o);t.length>2&&(t[2]*=n)}if(o.rings)for(const t of o.rings)for(const o of t)o.length>2&&(o[2]*=n)}}function c(o,n){if(o){if(o.curvePaths)for(const t of o.curvePaths)for(const o of t){const t=e(o);t.length>2&&(t[2]*=n)}if(o.paths)for(const t of o.paths)for(const o of t)o.length>2&&(o[2]*=n)}}function l(o,n){if(o)for(const t of o.points)t.length>2&&(t[2]*=n)}function u(o,n){o&&null!=o.zmin&&null!=o.zmax&&(o.zmin*=n,o.zmax*=n)}export{r as getGeometryZScaler,i as zScale};
