import SpatialReference from"@arcgis/core/geometry/SpatialReference";import{validation}from"../../Validation.js";import{inline,isAbortable,schedulePromiseCancellation}from"./tools.js";import GeometryService from"@arcgis/core/tasks/GeometryService";class ToGeoCoordinateStringServiceTask{execute(e,i){var o=validation.string("url",e.url,validation.never),n=validation.exists("spatialReference",e.spatialReference),r=validation.exists("coordinates",e.coordinates),a=validation.string("conversionType",e.conversionType);let t="object"==typeof n?n:void 0;"number"==typeof n&&(t=new SpatialReference({wkid:n})),"string"==typeof n&&(t=new SpatialReference({wkt:n}));const s={sr:t,coordinates:r,conversionType:a};null!==e.conversionMode&&void 0!==e.conversionMode&&(s.conversionMode=validation.string("conversionMode",e.conversionMode)),null!==e.numOfDigits&&void 0!==e.numOfDigits&&(s.numOfDigits=validation.number("numOfDigits",e.numOfDigits)),null!==e.rounding&&void 0!==e.rounding&&(s.rounding=validation.boolean("rounding",s.rounding)),null!==e.addSpaces&&void 0!==e.addSpaces&&(s.addSpaces=validation.boolean("addSpaces",e.addSpaces));const c=new GeometryService(o);o=isAbortable(i.cancellationToken)?{signal:i.cancellationToken.signal}:void 0,o=c.toGeoCoordinateString(s,o);return schedulePromiseCancellation(i,o),inline(o,function(e){return{strings:e}})}}ToGeoCoordinateStringServiceTask.action="gcx:wf:arcgis::ToGeoCoordinateStringServiceTask",ToGeoCoordinateStringServiceTask.suite="gcx:wf:builtin";export{ToGeoCoordinateStringServiceTask};