/*
 COPYRIGHT 2009 ESRI

 TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
 Unpublished material - all rights reserved under the
 Copyright Laws of the United States and applicable international
 laws, treaties, and conventions.

 For additional information, contact:
 Environmental Systems Research Institute, Inc.
 Attn: Contracts and Legal Services Department
 380 New York Street
 Redlands, California, 92373
 USA

 email: contracts@esri.com
 */

window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","esri.tasks.servicearea"],["require","esri.tasks._task"],["require","esri.tasks.na"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["esri.tasks.servicearea"]){_4._hasResource["esri.tasks.servicearea"]=true;_4.provide("esri.tasks.servicearea");_4.require("esri.tasks._task");_4.require("esri.tasks.na");_4.declare("esri.tasks.ServiceAreaTask",esri.tasks._Task,{constructor:function(_7){this._url.path+="/solveServiceArea";this._handler=_4.hitch(this,this._handler);},__msigns:[{n:"solve",c:3,a:[{i:0,p:["facilities.features","pointBarriers.features","polylineBarriers.features","polygonBarriers.features"]}],e:2}],_handler:function(_8,io,_9,_a,_b){try{var _c=new esri.tasks.ServiceAreaSolveResult(_8);this._successHandler([_c],"onSolveComplete",_9,_b);}catch(err){this._errorHandler(err,_a,_b);}},solve:function(_d,_e,_f,_10){var _11=_10.assembly,_12=this._encode(_4.mixin({},this._url.query,{f:"json"},_d.toJson(_11&&_11[0]))),_13=this._handler,_14=this._errorHandler;return esri.request({url:this._url.path,content:_12,callbackParamName:"callback",load:function(r,i){_13(r,i,_e,_f,_10.dfd);},error:function(r){_14(r,_f,_10.dfd);}});},onSolveComplete:function(){}});esri._createWrappers("esri.tasks.ServiceAreaTask");_4.declare("esri.tasks.ServiceAreaParameters",null,{accumulateAttributes:null,attributeParameterValues:null,defaultBreaks:null,excludeSourcesFromPolygons:null,facilities:null,impedanceAttribute:null,mergeSimilarPolygonRanges:false,outputGeometryPrecision:null,outputGeometryPrecisionUnits:null,outputLines:null,outputPolygons:null,outSpatialReference:null,overlapLines:false,overlapPolygons:false,pointBarriers:null,polygonBarriers:null,polylineBarriers:null,restrictionAttributes:null,restrictUTurns:null,returnFacilities:false,returnPointBarriers:false,returnPolylgonBarriers:false,returnPolylineBarriers:false,splitLinesAtBreaks:false,splitPolygonsAtBreaks:false,travelDirection:null,trimOuterPolygon:false,trimPolygonDistance:null,trimPolygonDistanceUnits:null,useHierarchy:null,timeOfDay:null,toJson:function(_15){var _16={returnFacilities:this.returnFacilities,returnBarriers:this.returnPointBarriers,returnPolygonBarriers:this.returnPolygonBarriers,returnPolylineBarriers:this.returnPolylineBarriers,mergeSimilarPolygonRanges:this.mergeSimilarPolygonRanges,overlapLines:this.overlapLines,overlapPolygons:this.overlapPolygons,splitLinesAtBreaks:this.splitLinesAtBreaks,splitPolygonsAtBreaks:this.splitPolygonsAtBreaks,trimOuterPolygon:this.trimOuterPolygon,accumulateAttributeNames:this.accumulateAttributes?this.accumulateAttributes.join(","):null,attributeParameterValues:this.attributeParameterValues&&_4.toJson(this.attributeParameterValues),defaultBreaks:this.defaultBreaks?this.defaultBreaks.join(","):null,excludeSourcesFromPolygons:this.excludeSourcesFromPolygons?this.excludeSourcesFromPolygons.join(","):null,impedanceAttributeName:this.impedanceAttribute,outputGeometryPrecision:this.outputGeometryPrecision,outputGeometryPrecisionUnits:this.outputGeometryPrecisionUnits,outputLines:this.outputLines,outputPolygons:this.outputPolygons,outSR:this.outSpatialReference?(this.outSpatialReference.wkid||_4.toJson(this.outSpatialReference.toJson())):null,restrictionAttributeNames:this.restrictionAttributes?this.restrictionAttributes.join(","):null,restrictUTurns:this.restrictUTurns,travelDirection:this.travelDirection,trimPolygonDistance:this.trimPolygonDistance,trimPolygonDistanceUnits:this.trimPolygonDistanceUnits,useHierarchy:this.useHierarchy,timeOfDay:this.timeOfDay&&this.timeOfDay.getTime()};var _17=this.facilities;if(_17 instanceof esri.tasks.FeatureSet&&_17.features.length>0){_16.facilities=_4.toJson({type:"features",features:esri._encodeGraphics(_17.features,_15&&_15["facilities.features"])});}else{if(_17 instanceof esri.tasks.DataLayer){_16.facilities=_17;}}var _18=function(_19,_1a){if(!_19){return null;}if(_19 instanceof esri.tasks.FeatureSet){if(_19.features.length>0){return _4.toJson({type:"features",features:esri._encodeGraphics(_19.features,_15&&_15[_1a])});}else{return null;}}else{if(_19 instanceof esri.tasks.DataLayer){return _19;}}return _4.toJson(_19);};_16.barriers=_18(this.pointBarriers,"pointBarriers.features");_16.polygonBarriers=_18(this.polygonBarriers,"polygonBarriers.features");_16.polylineBarriers=_18(this.polylineBarriers,"polylineBarriers.features");return esri.filter(_16,function(_1b){if(_1b!==null){return true;}});}});_4.declare("esri.tasks.ServiceAreaSolveResult",null,{constructor:function(_1c){if(_1c.saPolygons){this.serviceAreaPolygons=this._graphicsFromJson(_1c.saPolygons);}if(_1c.saPolylines){this.serviceAreaPolylines=this._graphicsFromJson(_1c.saPolylines);}if(_1c.facilities){this.facilities=this._graphicsFromJson(_1c.facilities);}if(_1c.barriers){this.pointBarriers=this._graphicsFromJson(_1c.barriers);}if(_1c.polylineBarriers){this.polylineBarriers=this._graphicsFromJson(_1c.polylineBarriers);}if(_1c.polygonBarriers){this.polygonBarriers=this._graphicsFromJson(_1c.polygonBarriers);}if(_1c.messages){this.messages=_4.map(_1c.messages,function(_1d,i){return new esri.tasks.NAMessage(_1d);});}},serviceAreaPolygons:null,serviceAreaPolylines:null,facilities:null,pointBarriers:null,polylineBarriers:null,polygonBarriers:null,messages:null,_graphicsFromJson:function(_1e){var sr=new esri.SpatialReference(_1e.spatialReference);var _1f=_1e.features;return _4.map(_1f,function(_20,i){var _21=new esri.Graphic(_20);_21.geometry.setSpatialReference(sr);return _21;});}});}}};});