text: // COPYRIGHT © 2018 Esri
  //
  // All rights reserved under the copyright laws of the United States
  // and applicable international laws, treaties, and conventions.
  //
  // This material is licensed for use under the Esri Master License
  // Agreement (MLA), and is bound by the terms of that agreement.
  // You may redistribute and use this code without modification,
  // provided you adhere to the terms of the MLA and include this
  // copyright notice.
  //
  // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english
  //
  // For additional information, contact:
  // Environmental Systems Research Institute, Inc.
  // Attn: Contracts and Legal Services Department
  // 380 New York Street
  // Redlands, California, USA 92373
  // USA
  //
  // email: contracts@esri.com
  //
  // See http://js.arcgis.com/4.10/esri/copyright.txt for details.
  
  define(["../../core/Accessor","../../core/kebabDictionary","../../core/lang","../../geometry/support/graphicsUtils"],function(e,t,r,i){var s=t({esriNAOutputLineNone:"none",esriNAOutputLineStraight:"straight",esriNAOutputLineTrueShape:"true-shape",esriNAOutputLineTrueShapeWithMeasure:"true-shape-with-measure"}),l=t({esriNAOutputPolygonNone:"none",esriNAOutputPolygonSimplified:"simplified",esriNAOutputPolygonDetailed:"detailed"}),a=t({esriNFSBAllowBacktrack:"allow-backtrack",esriNFSBAtDeadEndsOnly:"at-dead-ends-only",esriNFSBNoBacktrack:"no-backtrack",esriNFSBAtDeadEndsAndIntersections:"at-dead-ends-and-intersections"}),n=t({esriNATravelDirectionFromFacility:"from-facility",esriNATravelDirectionToFacility:"to-facility"}),o=t({esriCentimeters:"centimeters",esriDecimalDegrees:"decimal-degrees",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriPoints:"points",esriYards:"yards"});return e.createSubclass({declaredClass:"esri.tasks.support.ServiceAreaParameters",properties:{accumulateAttributes:null,attributeParameterValues:null,defaultBreaks:null,doNotLocateOnRestrictedElements:!0,excludeSourcesFromPolygons:null,facilities:null,impedanceAttribute:null,mergeSimilarPolygonRanges:!1,outputGeometryPrecision:null,outputGeometryPrecisionUnits:null,outputLines:null,outputPolygons:null,outSpatialReference:null,overlapLines:!1,overlapPolygons:!1,pointBarriers:null,polygonBarriers:null,polylineBarriers:null,restrictionAttributes:null,restrictUTurns:null,returnFacilities:!1,returnPointBarriers:!1,returnPolygonBarriers:!1,returnPolylineBarriers:!1,splitLinesAtBreaks:!1,splitPolygonsAtBreaks:!1,travelDirection:null,trimOuterPolygon:!1,trimPolygonDistance:null,trimPolygonDistanceUnits:null,useHierarchy:null,timeOfDay:null,travelMode:null},toJSON:function(e){var t={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&&JSON.stringify(this.attributeParameterValues),defaultBreaks:this.defaultBreaks?this.defaultBreaks.join(","):null,excludeSourcesFromPolygons:this.excludeSourcesFromPolygons?this.excludeSourcesFromPolygons.join(","):null,impedanceAttributeName:this.impedanceAttribute,outputGeometryPrecision:this.outputGeometryPrecision,outputGeometryPrecisionUnits:o.toJSON(this.outputGeometryPrecisionUnits),outputLines:s.toJSON(this.outputLines),outputPolygons:l.toJSON(this.outputPolygons),outSR:this.outSpatialReference?this.outSpatialReference.wkid||JSON.stringify(this.outSpatialReference.toJSON()):null,restrictionAttributeNames:this.restrictionAttributes?this.restrictionAttributes.join(","):null,restrictUTurns:a.toJSON(this.restrictUTurns),travelDirection:n.toJSON(this.travelDirection),trimPolygonDistance:this.trimPolygonDistance,trimPolygonDistanceUnits:this.trimPolygonDistanceUnits,useHierarchy:this.useHierarchy,timeOfDay:this.timeOfDay&&this.timeOfDay.getTime(),travelMode:this.travelMode&&JSON.stringify(this.travelMode)},u=this.facilities;"esri.tasks.support.FeatureSet"===u.declaredClass&&u.features.length>0?t.facilities=JSON.stringify({type:"features",features:i._encodeGraphics(u.features,e&&e["facilities.features"]),doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements}):"esri.tasks.support.DataLayer"===u.declaredClass?t.facilities=u:"esri.tasks.support.DataFile"===u.declaredClass&&(t.facilities=JSON.stringify({type:"features",url:u.url,doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements}));var c=function(t,r){return t?"esri.tasks.support.FeatureSet"===t.declaredClass?t.features.length>0?JSON.stringify({type:"features",features:i._encodeGraphics(t.features,e&&e[r])}):null:"esri.tasks.support.DataLayer"===t.declaredClass?t:"esri.tasks.support.DataFile"===t.declaredClass?JSON.stringify({type:"features",url:t.url}):JSON.stringify(t):null};return this.pointBarriers&&(t.barriers=c(this.pointBarriers,"pointBarriers.features")),this.polygonBarriers&&(t.polygonBarriers=c(this.polygonBarriers,"polygonBarriers.features")),this.polylineBarriers&&(t.polylineBarriers=c(this.polylineBarriers,"polylineBarriers.features")),r.filter(t,function(e){if(null!==e)return!0})}})});