import{validation}from"../../Validation.js";import{inline,schedulePromiseCancellation,addToPath,post}from"./tools.js";import{isArcGisApiVersion3x}from"./ArcGisApiVersion.js";class AddFeatures{execute(e,i){var s=validation.urlOrLayer(e,isArcGisApiVersion3x),s=addToPath(s,"applyEdits"),t=validation.string("gdbVersion",e.gdbVersion),a=validation.number("timeout",e.timeout),t={adds:validation.array("features",e.features,validation.never),gdbVersion:t},a=post(s,t,a,i.cancellationToken.signal);schedulePromiseCancellation(i,a);const r=this;return inline(a,function(e){r.onApplyEditsComplete(e);var i=e.addResults&&e.addResults.every(e=>e.success);return{results:e.addResults,success:i}})}onApplyEditsComplete(e){}}AddFeatures.action="gcx:wf:arcgis::AddFeatures",AddFeatures.suite="gcx:wf:builtin";export{AddFeatures};