define(["require","exports","tslib","./esriDelegate!esri/tasks/support/ServiceAreaParameters","../../Validation","./tools","./MapProvider","../../Hooks","esri/tasks/ServiceAreaTask"],function(i,e,t,a,n,s,r,o,l){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),l=t.__importDefault(l);u.prototype.execute=function(i,e,t){var r=n.validation.string("url",i.url,n.validation.never),o=new a.ServiceAreaParameters;o.facilities=n.validation.exists("facilities",i.facilities),o.accumulateAttributes=n.validation.array("accumulateAttributes",i.accumulateAttributes),o.attributeParameterValues=n.validation.exists("attributeParameterValues",i.attributeParameterValues,void 0),o.defaultBreaks=n.validation.exists("defaultBreaks",i.defaultBreaks,void 0),o.doNotLocateOnRestrictedElements=n.validation.boolean("doNotLocateOnRestrictedElements",i.doNotLocateOnRestrictedElements,void 0),o.excludeSourcesFromPolygons=n.validation.exists("excludeSourcesFromPolygons",i.excludeSourcesFromPolygons,void 0),o.impedanceAttribute=n.validation.string("impedanceAttribute",i.impedanceAttribute,void 0),o.impedanceAttribute||(o.impedanceAttribute=n.validation.string("impedenceAttribute",i.impedenceAttribute,void 0)),o.mergeSimilarPolygonRanges=n.validation.boolean("mergeSimilarPolygonRanges",i.mergeSimilarPolygonRanges,void 0),o.outputGeometryPrecision=n.validation.number("outputGeometryPrecision",i.outputGeometryPrecision,void 0),o.outputGeometryPrecisionUnits=n.validation.string("outputGeometryPrecisionUnits",i.outputGeometryPrecisionUnits,void 0),o.outputLines=n.validation.string("outputLines",i.outputLines,void 0),o.outputPolygons=n.validation.string("outputPolygons",i.outputPolygons,void 0),o.overlapLines=n.validation.boolean("overlapLines",i.overlapLines,void 0),o.overlapPolygons=n.validation.boolean("overlapPolygons",i.overlapPolygons,void 0),o.pointBarriers=n.validation.exists("pointBarriers",i.pointBarriers,void 0),o.polygonBarriers=n.validation.exists("polygonBarriers",i.polygonBarriers,void 0),o.polylineBarriers=n.validation.exists("polylineBarriers",i.polylineBarriers,void 0),o.restrictionAttributes=n.validation.exists("restrictionAttributes",i.restrictionAttributes,void 0),o.restrictUTurns=n.validation.string("restrictUTurns",i.restrictUTurns,void 0),o.returnFacilities=n.validation.boolean("returnFacilities",i.returnFacilities,void 0),o.returnPointBarriers=n.validation.boolean("returnPointBarriers",i.returnPointBarriers,void 0),o.returnPolygonBarriers=n.validation.boolean("returnPolygonBarriers",i.returnPolygonBarriers,void 0),o.returnPolylineBarriers=n.validation.boolean("returnPolylineBarriers",i.returnPolylineBarriers,void 0),o.splitLinesAtBreaks=n.validation.boolean("splitLinesAtBreaks",i.splitLinesAtBreaks,void 0),o.splitPolygonsAtBreaks=n.validation.boolean("splitPolygonsAtBreaks",i.splitPolygonsAtBreaks,void 0),o.timeOfDay=n.validation.exists("timeOfDay",i.timeOfDay,void 0),o.travelDirection=n.validation.string("travelDirection",i.travelDirection,void 0),o.trimOuterPolygon=n.validation.boolean("trimOuterPolygon",i.trimOuterPolygon,void 0),o.trimPolygonDistance=n.validation.number("trimPolygonDistance",i.trimPolygonDistance,void 0),o.trimPolygonDistanceUnits=n.validation.string("trimPolygonDistanceUnits",i.trimPolygonDistanceUnits,void 0),o.useHierarchy=n.validation.boolean("useHierarchy",i.useHierarchy,void 0);i=n.validation.exists("outSpatialReference",i.outSpatialReference,void 0);o.outSpatialReference=t.getOutSR(i);i=new l.default(r),r=s.isAbortable(e.cancellationToken)?{signal:e.cancellationToken.signal}:void 0,r=i.solve(o,r);return s.schedulePromiseCancellation(e,r),s.inline(r,function(i){return{facilities:i.facilities,messages:i.messages,pointBarriers:i.pointBarriers,polygonBarriers:i.polygonBarriers,polylineBarriers:i.polylineBarriers,serviceAreaPolygons:i.serviceAreaPolygons,serviceAreaPolylines:i.serviceAreaPolylines}})},u.action="gcx:wf:arcgis::ServiceAreaTask",u.suite="gcx:wf:builtin",r=t.__decorate([o.activate(r.MapProvider)],u);function u(){}e.ServiceAreaTask=r});