/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{getHeightUnitCorrectionFactor as t}from"../../../geometry/coordUtils.js";import{pointAlongLineWithZ as r,pointAlongLine as e}from"../../../geometry/lineUtils.js";import{readOffsetDistance as i,readVertexBeforeOffset as o,readByNumber as s,readDistance as l,makeFeatureFromGroupPart as p,readCount as n}from"./support/builderUtils.js";import{offset as f}from"./support/offsetUtils.js";import{computedTotalLength as m,pointAlongLineWithZAndOffset as u,pointAlongLineAndOffset as a}from"./support/shapeUtils.js";import{isPolyline as h,maxDigitizingDisplayEdits as c}from"../support/executorUtils.js";function d({templatePart:d,shape:g,edits:j,relationships:U,mode:b}){if(!h(g))return;const x=g,{builderConfig:y}=d,P=i(y),S=o(y),Z=s(y);let k=Z?n(y):0,z=Z?0:l(y,!1);const C=t(x.spatialReference),E=S||0===P?x:f(x,P);if(null===E||!h(E))return;const M=m(E);if(Z){if(k<=1)return;if(z=M/(k+1),z<=0)return}else{if(z<0)return;if(k=Math.floor(M/z),0===k)return}let R=z,$=0;for(;$<k;){let t=null;if(t=S?E.hasZ?u(E,R,P,C):a(E,R,P):E.hasZ?r(E,R,C):e(E,R),t&&p({templatePart:d,shape:t,edits:j,relationships:U,mode:b},`ES${$.toString()}`),"digitizing"===b&&j.length>c)break;R+=z,$++}}const g=!1;export{d as execute,g as isAsync};
