/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{getMetersPerVerticalUnitForSR as e}from"../../../core/units.js";import{equals as n}from"../../../geometry/support/spatialReferenceUtils.js";import{getEndpoint as s}from"../../../geometry/support/curves/curveUtils.js";function o(e,n,s){if(null==e.hasM||e.hasZ)for(const o of n)for(const e of o)e.length>2&&(e[2]*=s)}function t(e,n,o){if(null==e.hasM||e.hasZ)for(const t of n)for(const e of t){const n=s(e);n.length>2&&(n[2]*=o)}}function i(n,s,o){if(!n&&!s||!o)return;const t=e(o);f(n,o,t),f(s,o,t)}function f(e,n,s){if(e)for(const o of e)r(o.geometry,n,s)}function r(s,i,f){if(!s?.spatialReference||n(s.spatialReference,i))return;const r=e(s.spatialReference)/f;if(1!==r)if("x"in s)null!=s.z&&(s.z*=r);else if("curveRings"in s)t(s,s.curveRings,r);else if("curvePaths"in s)t(s,s.curvePaths,r);else if("rings"in s)o(s,s.rings,r);else if("paths"in s)o(s,s.paths,r);else if("points"in s&&(null==s.hasM||s.hasZ))for(const e of s.points)e.length>2&&(e[2]*=r)}export{i as unapplyEditsZUnitScaling};
