// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
require({cache:{"url:widgets/Geoprocessing/setting/SettingDetail.html":'\x3cdiv\x3e\r\n\t\x3cdiv class\x3d"nav-pane jimu-float-leading" data-dojo-attach-point\x3d"navPaneNode"\x3e\x3c/div\x3e\r\n\t\x3cdiv class\x3d"setting-pane jimu-float-trailing" data-dojo-attach-point\x3d"settingPaneNode" style\x3d"display:none"\x3e\x3c/div\x3e\r\n\x3c/div\x3e\r\n'}});
define("dojo/_base/declare dojo/_base/lang dojo/_base/html dojo/_base/array dojo/on dojo/query dojo/Deferred dojo/text!./SettingDetail.html dijit/_WidgetBase dijit/_TemplatedMixin dijit/TitlePane jimu/dijit/ViewStack jimu/dijit/LoadingIndicator jimu/dijit/Message ./ParamSetting ./ParamNodeList ./LayerOrder ./Options ../utils".split(" "),function(m,d,e,k,f,l,n,p,q,r,t,u,v,w,x,y,z,A,g){return m([q,r],{baseClass:"jimu-widget-setting-gp-detail",templateString:p,postCreate:function(){this.inherited(arguments);
this.paramSetting=new x({map:this.map,nls:this.nls});this.layerOrder=new z({nls:this.nls});this.options=new A({nls:this.nls});this.own(f(this.options,"result-map-service",d.hitch(this,function(a){this._outputInResultMap(a)})));this.viewStack=new u({viewType:"dijit",views:[this.paramSetting,this.layerOrder,this.options]},this.settingPaneNode);this.loadingCover=new v({hidden:!0});this.loadingCover.placeAt(this.domNode);this.loadingCover.startup()},startup:function(){this.inherited(arguments);this.viewStack.startup()},
setConfig:function(a){a=d.clone(a);this.hasInputParam=!0;this.config&&this.config.taskUrl===a.taskUrl?(this.config=a,"serverInfo"in a&&(!this.config.serverInfo.hasResultMapServer||this.config.serverInfo.resultMapServerName)?this._initNavPane():(this.loadingCover.show(),g.getServiceDescription(this.config.taskUrl).then(d.hitch(this,function(c){this.loadingCover.hide();this.config.serverInfo=c.serverInfo;this._initNavPane()})))):(this.config=a,this.loadingCover.show(),g.getServiceDescription(this.config.taskUrl).then(d.hitch(this,
function(c){this.loadingCover.hide();this._changeTaskInfoToConfig(c);this._initNavPane()})))},getConfig:function(){if(!this.config.taskUrl)return new w({message:this.nls.serviceURLPlaceholder}),!1;this.paramSetting.param&&this.paramSetting.acceptValue();this.layerOrder.acceptValue();this.options.acceptValue();this.config.inputParams=this.inputParamNodes.getConfig();this.config.outputParams=this.outputParamNodes.getConfig();return this.config},_changeTaskInfoToConfig:function(a){var c=this.config.taskUrl;
this.config=a;this.config.taskUrl=c;this.config.isSynchronous="esriExecutionTypeSynchronous"===this.config.executionType?!0:!1;delete this.config.executionType;this.config.inputParams=[];this.config.outputParams=[];k.forEach(a.parameters,function(b){b.label=b.displayName;delete b.displayName;"esriGPParameterDirectionInput"===b.direction?this.config.inputParams.push(b):this.config.outputParams.push(b);delete b.direction;b.visible=!0;b.required="esriGPParameterTypeRequired"===b.parameterType?!0:!1;
delete b.parameterType;"GPFeatureRecordSetLayer"===b.dataType?b.featureSetMode="layers":"GPRecordSet"===b.dataType&&(b.recordSetMode="table")},this);this.config.shareResults=g.allowShareResult(this.config);delete this.config.parameters},_initNavPane:function(){e.empty(this.navPaneNode);this._createParamsSection("input").then(d.hitch(this,function(){return this._createParamsSection("output")})).then(d.hitch(this,function(){this._createLayerOrderNode();this._createOptionsNode();this.layerOrder.setConfig(this.config);
this.options.setConfig(this.config);this.paramSetting.setConfig(this.config);this.inputParamNodes&&0<this.inputParamNodes.getSize()?this.inputParamNodes.selectDefault():this.outputParamNodes&&0<this.outputParamNodes.getSize()&&this.outputParamNodes.selectDefault()}))},_onParamChange:function(a,c){l(".jimu-state-active",this.domNode).removeClass("jimu-state-active");"input"===c?this._clearParamSelection("output"):this._clearParamSelection("input");this.paramSetting.param&&this.paramSetting.acceptValue();
this.layerOrder.acceptValue();this.options.acceptValue();"none"===e.getStyle(this.viewStack.domNode,"display")&&e.setStyle(this.viewStack.domNode,"display","");this.viewStack.switchView(this.paramSetting);this.paramSetting.setParam(a,c)},_setActiveLinkNode:function(a){l(".jimu-state-active",this.domNode).removeClass("jimu-state-active");this._clearParamSelection();e.addClass(a,"jimu-state-active")},_createParamsSection:function(a){var c=new n,b="input"===a?this.config.inputParams:this.config.outputParams;
if("output"===a&&this.config.serverInfo.resultMapServerName&&!k.some(b,function(h){return"MapServiceLayer"===h.dataType}))return g.getResultMapLayers(this.config.taskUrl,this.config.serverInfo.resultMapServerName).then(d.hitch(this,function(h){b.push({name:this.config.serverInfo.resultMapServerName,label:this.config.serverInfo.resultMapServerName,tooltip:this.config.serverInfo.resultMapServerName,dataType:"MapServiceLayer",layerNames:h,visible:!0,required:""});this._doCreateParamsSection(b,a);c.resolve()})),
c;this._doCreateParamsSection(b,a);c.resolve();return c},_doCreateParamsSection:function(a,c){a=new y({params:a,nls:this.nls,direction:c,useResultMapServer:this.config.useResultMapServer});this.own(f(a,"select-param",d.hitch(this,this._onParamChange)));"input"===c?this.inputParamNodes=a:this.outputParamNodes=a;(new t({title:this.nls[c],content:a.domNode,open:0<this.inputParamNodes.getSize()?"input"===c:"output"===c})).placeAt(this.navPaneNode)},_createLayerOrderNode:function(){var a=e.create("div",
{"class":"link-action-node nav-pane-node layer-order-node",innerHTML:this.nls.layerOrder},this.navPaneNode);this.own(f(a,"click",d.hitch(this,function(){this.options.acceptValue();this.paramSetting.param&&this.paramSetting.acceptValue();this._setActiveLinkNode(a);this.layerOrder.setConfig(this.config);this.viewStack.switchView(this.layerOrder)})))},_createOptionsNode:function(){var a=e.create("div",{"class":"link-action-node nav-pane-node options-node",innerHTML:this.nls.options},this.navPaneNode);
this.own(f(a,"click",d.hitch(this,function(){this.paramSetting.param&&this.paramSetting.acceptValue();this.layerOrder.acceptValue();this._setActiveLinkNode(a);this.viewStack.switchView(this.options)})))},_clearParamSelection:function(a){("input"===a||"undefined"===typeof a)&&this.inputParamNodes&&0<this.inputParamNodes.getSize()&&this.inputParamNodes.clearSelection();("output"===a||"undefined"===typeof a)&&this.outputParamNodes&&0<this.outputParamNodes.getSize()&&this.outputParamNodes.clearSelection()},
_outputInResultMap:function(a){!0===a?this.outputParamNodes.hideOutputInResultMap():this.outputParamNodes.showOutputInResultMap()}})});