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