/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../core/maybe","../../../../core/quantityUtils","../../../../chunks/vec3f64","../../../support/automaticAreaMeasurementUtils","../../../support/automaticLengthMeasurementUtils","../../../support/euclideanAreaMeasurementUtils"],(function(e,t,n,a,r,u,o){"use strict";function i(e,r){var o,i,s;const c=e=>u.autoLengthByElevationMode(e,r),h=(e,t,n)=>u.autoDirectDistanceByElevationMode(e,t,n,r),p=c(e),g=null!=(o=null==(i=e.paths[0])?void 0:i[(null==(s=e.paths[0])?void 0:s.length)-1])?o:null,{hasZ:d,spatialReference:f}=e,m=g?a.fromValues(g[0],g[1],d?g[2]:0):null;return e=>{if(t.isNone(e)||t.isNone(p)||t.isNone(m))return p;l[0]=e.x,l[1]=e.y,l[2]=d?e.z:0;const a=h(m,l,f);return t.isNone(a)?p:n.createLength(p.value+a.value,p.unit)}}function s(e,n){const a=o.createEuclideanPlanarAreaCache(),u=e=>r.autoAreaByDrapedStatus(e,n,a);return n=>{if(t.isNone(n)||e.rings.length<1||e.rings[0].length<2)return u(e);const a=e.clone();return a.rings[0].push([n.x,n.y]),u(a)}}const l=a.create();e.computeAreaWithStagedVertex=s,e.computeLengthWithStagedVertex=i,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
