define(["require","exports","tslib","./esriDelegate!esri/tasks/support/DistanceParameters","../../Validation","./tools","esri/tasks/GeometryService"],function(e,i,t,a,o,s,r){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),r=t.__importDefault(r);n.prototype.execute=function(e,i){var t=o.validation.string("url",e.url,o.validation.never),n=new a.DistanceParameters;n.geometry1=o.validation.exists("geometry1",e.geometry1),n.geometry2=o.validation.exists("geometry2",e.geometry2),n.distanceUnit=s.toEsriUnit(e.unit),n.geodesic=o.validation.boolean("geodesic",e.geodesic,!1);e=new r.default(t),t=s.isAbortable(i.cancellationToken)?{signal:i.cancellationToken.signal}:void 0,t=e.distance(n,t);return s.schedulePromiseCancellation(i,t),s.inline(t,function(e){return{distance:e}})},n.action="gcx:wf:arcgis::DistanceServiceTask",n.suite="gcx:wf:builtin",t=n;function n(){}i.DistanceServiceTask=t});