/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{getHeightUnitCorrectionFactor as t}from"../../../geometry/coordUtils.js";import{pointAlongLineWithZ as e,pointAlongLine as r}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 a}from"./support/offsetUtils.js";import{computedTotalLength as f,pointAlongLineWithZAndOffset as m,pointAlongLineAndOffset as u}from"./support/shapeUtils.js";import{isPolyline as c,maxDigitizingDisplayEdits as h}from"../support/executorUtils.js";function d({templatePart:d,shape:g,edits:j,relationships:U,mode:y,associationFeaturesByTemplate:b}){if(!c(g))return;const x=g,{builderConfig:B}=d,F=i(B),P=o(B),S=s(B);let T=S?n(B):0,Z=S?0:l(B,!1);const k=t(x.spatialReference),z=P||0===F?x:a(x,F);if(null===z||!c(z))return;const C=f(z);if(S){if(T<=1)return;if(Z=C/(T+1),Z<=0)return}else{if(Z<0)return;if(T=Math.floor(C/Z),0===T)return}let E=Z,M=0;for(;M<T;){let t=null;if(t=P?z.hasZ?m(z,E,F,k):u(z,E,F):z.hasZ?e(z,E,k):r(z,E),t&&p({templatePart:d,shape:t,edits:j,relationships:U,mode:y,associationFeaturesByTemplate:b},`ES${M.toString()}`),"digitizing"===y&&j.length>h)break;E+=Z,M++}}const g=!1;export{d as execute,g as isAsync};
