// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/dijit/analysis/GPWidgetViewModel","dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has dojo/json dojo/Stateful ./customgp/utils ../../kernel ../../lang".split(" "),function(b,c,d,e,k,f,g,h,l){b=b([f],{declaredClass:"esri.dijit.analysis.GPWidgetViewModel",constructor:function(a){this.watch("taskUrl",c.hitch(this,this.fetchTaskInfo))},_taskUrlSetter:function(a){this.taskUrl=a},_taskInfoSetter:function(a){this.taskInfo=a},_serverInfoSetter:function(a){this.serverInfo=a},_inputParamsSetter:function(a){this.inputParams=
a},_outputParamsSetter:function(a){this.outputParams=a},_nameSetter:function(a){this.name=a},_titleSetter:function(a){this.title=a},_mapSetter:function(a){this.map=a},_analysisLayersSetter:function(a){this.analysisLayers=a},_portalUrlSetter:function(a){this.portalUrl=a},_helpUrlSetter:function(a){this.helpUrl=a},_useResultMapServerSetter:function(a){this.useResultMapServer=a},fetchTaskInfo:function(){this.taskUrl&&g.getServiceDescription(this.taskUrl).then(c.hitch(this,function(a){this.set("taskInfo",
a);this.set("serverInfo",a.serverInfo);this.set("title",a.displayName);this.set("name",this.taskUrl.substring(this.taskUrl.indexOf("GPServer/")+9));this.set("helpUrl",a.helpUrl);this.set("useResultMapServer",a.useResultMapServer);var b=[],c=[];d.forEach(a.parameters,function(a){a.label=a.displayName;delete a.displayName;"esriGPParameterDirectionInput"===a.direction?b.push(a):c.push(a);delete a.direction;a.visible=!0;a.required="esriGPParameterTypeRequired"===a.parameterType?!0:!1;delete a.parameterType;
"GPFeatureRecordSetLayer"===a.dataType&&(a.analysisLayers=this.analysisLayers,a.featureSetMode="layers")},this);this.set("gp",this.taskUrl);this.set("inputParams",b);this.set("outputParams",c)}),c.hitch(this,function(a){console.log("Error fetching GP Task",a)}))}});e("extend-esri")&&c.setObject("dijit.analysis.GPWidgetViewModel",b,h);return b});