/* COPYRIGHT Esri - https://js.arcgis.com/5.1.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 o,readVertexBeforeOffset as i,readByNumber as s,readDistance as l,makeFeatureFromGroupPart as n,readCount as p}from"./support/builderUtils.js";import{modeBasedOffset 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,xyTolerance:b,associationFeaturesByTemplate:x}){if(!c(g))return;const T=g,{builderConfig:B}=d,F=o(B),P=i(B),S=s(B);let Z=S?p(B):0,k=S?0:l(B,!1);const z=t(T.spatialReference),C=P||0===F?T:a(T,F,y,b);if(null===C||!c(C))return;const E=f(C);if(S){if(Z<=1)return;if(k=E/(Z+1),k<=0)return}else{if(k<0)return;if(Z=Math.floor(E/k),0===Z)return}let M=k,R=0;for(;R<Z;){let t=null;if(t=P?C.hasZ?m(C,M,F,z,b):u(C,M,F,b):C.hasZ?e(C,M,z):r(C,M),t&&n({templatePart:d,shape:t,edits:j,relationships:U,mode:y,associationFeaturesByTemplate:x},`ES${R.toString()}`),"digitizing"===y&&j.length>h)break;M+=k,R++}}const g=!1;export{d as execute,g as isAsync};
