// 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:{"esri/tasks/datareviewer/DashboardTask":function(){define("dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/Deferred dojo/has ./_DRSBaseTask ./DashboardResult ./ReviewerFilters ../../kernel ../../request".split(" "),function(q,p,r,v,w,u,x,e,k,f){q=q(u,{declaredClass:"esri.tasks.datareviewer.DashboardTask",constructor:function(a){this.onGetDashboardResultsComplete=r.hitch(this,this.onGetDashboardResultsComplete);this.onGetDashboardFieldNamesComplete=r.hitch(this,this.onGetDashboardFieldNamesComplete)},
getDashboardResults:function(a,b){var t=this._successHandler,h=this._errorHandler,g=this._appendQueryParams,c=new v;null===b||void 0===b?(a=this._url+"/Dashboard/reviewerResultsBy/"+a,b={f:"json"}):(a=this._url+"/Dashboard/reviewerResultsBy/"+a+"/filter",b={f:"json",filtersArray:b.toJSON()});a=g(a);f({callbackParamName:"callback",url:a,content:b}).then(r.hitch(this,function(d,l){if(void 0!==d.error)l=Error(),l.message=d.error.message,l.code=d.error.code,h(l,c);else try{if(void 0===d.dashboardResults)h(null,
c);else{var m=new x;p.forEach(d.dashboardResults,function(y,z){m.fieldValues.push(y.fieldValue);m.counts.push(y.count)});m.fieldName=d.fieldName;var n=new e;n.createFromJsonObject(d);m.filters=n;t({dashboardResult:m},"onGetDashboardResultsComplete",c)}}catch(y){h(y,c)}}),function(d,l){h(d,c)});return c},getDashboardFieldNames:function(){var a=this._successHandler,b=this._errorHandler,t=this._appendQueryParams,h=this._url+"/Dashboard";h=t(h);var g=new v;f({callbackParamName:"callback",url:h,content:{f:"json"}}).then(r.hitch(this,
function(c,d){if(void 0!==c.error)d=Error(),d.message=c.error.message,d.code=c.error.code,b(d,g);else try{var l=[];p.forEach(c.reviewerResultsBy,function(m,n){l.push(m.name)});a({fieldNames:l},"onGetDashboardFieldNamesComplete",g)}catch(m){b(m,g)}}),function(c,d){b(c,g)});return g},onGetDashboardResultsComplete:function(a){},onGetDashboardFieldNamesComplete:function(a){}});w("extend-esri")&&r.setObject("tasks.datareviewer.DashboardTask",q,k);return q})},"esri/tasks/datareviewer/_DRSBaseTask":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/Deferred dojo/has ../../request ../../urlUtils ../../kernel ../Task ./ReviewerSession".split(" "),
function(q,p,r,v,w,u,x,e,k,f){q=q(k,{declaredClass:"esri.tasks.datareviewer.DRSBaseTask",_url:null,_queryParams:null,_reviewerMapServerUrl:null,constructor:function(a){"/"==a[a.length-1]&&(a=a.slice(0,-1));a=x.urlToObject(a);this._url=a.path;this._queryParams=a.query;a=this._url.toLowerCase().lastIndexOf("/exts/");0<a&&(this._reviewerMapServerUrl=this._url.substring(0,a));this._successHandler=p.hitch(this,this._successHandler);this._errorHandler=p.hitch(this,this._errorHandler);this._appendQueryParams=
p.hitch(this,this._appendQueryParams);this.onError=p.hitch(this,this.onError)},_appendQueryParams:function(a){if(this._queryParams)for(var b in this._queryParams)a=x.urlToObject(a).query?a+("\x26"+b+"\x3d"+this._queryParams[b]):a+("?"+b+"\x3d"+this._queryParams[b]);return a},_successHandler:function(a,b,t){b&&this[b].apply(this,[a]);t&&t.resolve(a)},_errorHandler:function(a,b){null===a&&(a=Error("Unexpected response received from server"),a.code=500);this.onError(a);b&&b.reject(a)},getReviewerMapServerUrl:function(){var a=
null;if(a=this._reviewerMapServerUrl){if(this._queryParams)for(var b in this._queryParams)a=x.urlToObject(a).query?a+("\x26"+b+"\x3d"+this._queryParams[b]):a+("?"+b+"\x3d"+this._queryParams[b]);return a}return null},getLifecycleStatusStrings:function(){var a=this._successHandler,b=this._errorHandler,t=this._appendQueryParams,h=this._url+"/Utilities/getLifecycleStatusStrings";h=t(h);var g=new v;u({callbackParamName:"callback",url:h,content:{f:"json"}}).then(p.hitch(this,function(c,d){if(void 0!==c.error)d=
Error(),d.message=c.error.message,d.code=c.error.code,b(d,g);else try{var l=c.lifecycleStatusString;if(void 0===l)b(null,g);else{var m=[];r.forEach(l,function(n,y){m[n.descriptionCode]=n.descriptionString});a({lifecycleStatusStrings:m},"onGetLifecycleStatusStringsComplete",g)}}catch(n){b(n,g)}}),function(c,d){b(c,g)});return g},createReviewerSession:function(a,b){var t=this._successHandler,h=this._errorHandler,g=this._appendQueryParams,c=this._url+"/Utilities/createReviewerSession";c=g(c);var d=new v;
u({callbackParamName:"callback",url:c,content:{sessionName:a,sessionProperties:b.toJsonSessionOptions(),f:"json"}}).then(p.hitch(this,function(l,m){if(void 0!==l.error)m=Error(),m.message=l.error.message,m.code=l.error.code,h(m,d);else try{if(void 0===l.sessionAttributes)h(null,d);else{var n=l.sessionAttributes,y=new f(n.sessionId,n.sessionName,n.userName,n.versionName);t({reviewerSession:y},"onCreateReviewerSessionComplete",d)}}catch(z){h(z,d)}}),function(l,m){h(l,d)});return d},getReviewerSessions:function(){var a=
this._successHandler,b=this._errorHandler,t=this._appendQueryParams,h=this._url+"/Utilities/getReviewerSessions";h=t(h);var g=new v;u({callbackParamName:"callback",url:h,content:{f:"json"}}).then(p.hitch(this,function(c,d){if(void 0!==c.error)d=Error(),d.message=c.error.message,d.code=c.error.code,b(d,g);else try{var l=c.sessionAttributes;if(void 0===l)b(null,g);else{var m=[];r.forEach(l,function(n,y){m[y]=new f(n.sessionId,n.sessionName,n.userName,n.versionName)});a({reviewerSessions:m},"onGetReviewerSessionsComplete",
g)}}catch(n){b(n,g)}}),function(c,d){b(c,g)});return g},getCustomFieldNames:function(){var a=this._successHandler,b=this._errorHandler,t="BATCHJOBCHECKGROUP CHECKTITLE FEATUREOBJECTCLASS LIFECYCLEPHASE LIFECYCLESTATUS SESSIONID SEVERITY SUBTYPE".split(" "),h=this._appendQueryParams,g=this._url+"/Dashboard";g=h(g);var c=new v;u({callbackParamName:"callback",url:g,content:{f:"json"}}).then(p.hitch(this,function(d,l){if(void 0!==d.error)l=Error(),l.message=d.error.message,l.code=d.error.code,b(l,c);
else try{var m=[];void 0===d.reviewerResultsBy&&b(null,c);r.forEach(d.reviewerResultsBy,function(n,y){-1===t.indexOf(n.name)&&m.push(n.name)});a({customFieldNames:m},"onGetCustomFieldNamesComplete",c)}catch(n){b(n,c)}}),function(d,l){b(d,c)});return c},onGetLifecycleStatusStringsComplete:function(a){},onGetReviewerSessionsComplete:function(a){},onCreateReviewerSessionComplete:function(a){},onGetCustomFieldNamesComplete:function(a){},onError:function(a){}});w("extend-esri")&&p.setObject("tasks.datareviewer.DRSBaseTask",
q,e);return q})},"esri/tasks/datareviewer/ReviewerSession":function(){define(["dojo/_base/declare","dojo/has","dojo/_base/lang","../../kernel"],function(q,p,r,v){q=q(null,{declaredClass:"esri.tasks.datareviewer.ReviewerSession",sessionId:NaN,sessionName:"",userName:"",versionName:"",constructor:function(w,u,x,e){this.sessionId=w;this.sessionName=u;this.userName=x;void 0!==e&&(this.versionName=e)},toString:function(){return isNaN(this.sessionId)?null:"Session "+this.sessionId+" : "+this.sessionName}});
p("extend-esri")&&r.setObject("tasks.datareviewer.ReviewerSession",q,v);return q})},"esri/tasks/datareviewer/DashboardResult":function(){define(["dojo/_base/declare","dojo/has","dojo/_base/lang","../../kernel"],function(q,p,r,v){q=q(null,{declaredClass:"esri.tasks.datareviewer.DashboardResult",fieldName:null,fieldValues:null,counts:null,filters:null,constructor:function(){this.fieldName="";this.fieldValues=[];this.counts=[]},getCount:function(w){if(0<this.fieldValues.length&&0<this.counts.length&&
this.fieldValues.length===this.counts.length)for(var u=0;u<this.fieldValues.length;u++)if(this.fieldValues[u]===w)return this.counts[u];return 0}});p("extend-esri")&&r.setObject("tasks.datareviewer.DashboardResult",q,v);return q})},"esri/tasks/datareviewer/ReviewerFilters":function(){define("dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/json ../../geometry/Polygon dojo/has ../../kernel".split(" "),function(q,p,r,v,w,u,x){q=q(null,{declaredClass:"esri.tasks.datareviewer.ReviewerFilters",
constructor:function(){this.singleAttributeFilters=[];this.listAttributeFilters=[];this.rangeAttributeFilters=[];this.spatialFilters=[]},addAttributeFilter:function(e,k){var f={};f.fieldName=e;r.isArray(k)?1<k.length?(f.fieldValue=k,this.listAttributeFilters.push(f)):(f.fieldValue=k[0],this.singleAttributeFilters.push(f)):(f.fieldValue=k,this.singleAttributeFilters.push(f))},addRangeFilter:function(e,k,f){var a={},b={};b.minFieldValue=k;b.maxFieldValue=f;a.fieldName=e;a.fieldValue=b;this.rangeAttributeFilters.push(a)},
addSpatialFilter:function(e){var k={};e&&"rings"in e&&"spatialReference"in e&&(k.rings=e.rings,k.spatialReference=e.spatialReference,this.spatialFilters.push(k))},toJSON:function(){var e=[];null!==this.singleAttributeFilters&&0<this.singleAttributeFilters.length&&e.push({singleAttributeFilter:this.singleAttributeFilters});null!==this.listAttributeFilters&&0<this.listAttributeFilters.length&&e.push({listAttributeFilter:this.listAttributeFilters});null!==this.rangeAttributeFilters&&0<this.rangeAttributeFilters.length&&
e.push({rangeAttributeFilter:this.rangeAttributeFilters});null!==this.spatialFilters&&0<this.spatialFilters.length&&e.push({spatialFilter:this.spatialFilters});return 0===e.length?"":v.stringify({filtersArray:e})},getCount:function(){var e=0;null!==this.singleAttributeFilters&&0<this.singleAttributeFilters.length&&(e+=this.singleAttributeFilters.length);null!==this.listAttributeFilters&&0<this.listAttributeFilters.length&&(e+=this.listAttributeFilters.length);null!==this.rangeAttributeFilters&&0<
this.rangeAttributeFilters.length&&(e+=this.rangeAttributeFilters.length);null!==this.spatialFilters&&0<this.spatialFilters.length&&(e+=this.spatialFilters.length);return e},addReviewerFilters:function(e){if(!e)return 0;var k=0;p.forEach(e.singleAttributeFilters,function(f){this.addAttributeFilter(f.fieldName,f.fieldValue);k++});p.forEach(e.listAttributeFilters,function(f){this.addAttributeFilter(f.fieldName,f.fieldValue);k++});p.forEach(e.rangeAttributeFilters,function(f){this.addRangeFilter(f.fieldName,
f.minValue,f.maxValue);k++});p.forEach(e.spatialFilters,function(f){this.addSpatialFilter(f);k++});return k},createFromJsonObject:function(e){e&&e.filters&&r.isArray(e.filters)&&p.forEach(e.filters,r.hitch(this,function(k){"spatialFilter"in k?p.forEach(k.spatialFilter,r.hitch(this,function(f){this.addSpatialFilter(new w(f))})):"singleAttributeFilter"in k?p.forEach(k.singleAttributeFilter,r.hitch(this,function(f){this.addAttributeFilter(f.fieldName,f.fieldValue)})):"listAttributeFilter"in k?p.forEach(k.listAttributeFilter,
r.hitch(this,function(f){this.addAttributeFilter(f.fieldName,f.fieldValue)})):"rangeAttributeFilter"in k&&p.forEach(k.rangeAttributeFilter,r.hitch(this,function(f){this.addRangeFilter(f.fieldName,f.minValue,f.maxValue)}))}))}});u("extend-esri")&&r.setObject("tasks.datareviewer.ReviewerFilters",q,x);return q})},"widgets/ReviewerDashboard/setting/_build-generate_module":function(){define(["dojo/text!./Setting.html","dojo/text!./css/style.css","dojo/i18n!./nls/strings"],function(){})},"url:widgets/ReviewerDashboard/setting/Setting.html":'\x3cdiv style\x3d"width:100%;"\x3e\r\n  \x3ctable  data-dojo-attach-point\x3d"geoFilterSettingsTable" class\x3d"setting-table input-table jimu-leading-padding05 jimu-align-leading" cellspacing\x3d"0"\x3e\r\n    \x3ctbody\x3e\r\n      \x3ctr\x3e\r\n        \x3ctd class\x3d"first"\x3e${nls.drsSOEURL}\x3c/td\x3e\r\n        \x3ctd class\x3d"second" colspan\x3d"2"\x3e\r\n\r\n        \x3ctable cellpadding\x3d"0" cellspacing\x3d"0" style\x3d"width:100%;border-collapse:collapse;"\x3e\r\n            \x3ctbody\x3e\r\n              \x3ctr\x3e\r\n                \x3ctd style\x3d"width:auto;"\x3e\r\n                  \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/ValidationTextBox" required\x3d"true" \r\n                  data-dojo-attach-point\x3d"drsSOEURL" style\x3d"width:100%;"/\x3e\r\n                \x3c/td\x3e\r\n                \x3ctd style\x3d"width:80px;"\x3e\r\n                 \x3cdiv data-dojo-attach-event\x3d"onclick:_onBtnSetSourceClicked" class\x3d"jimu-btn  jimu-float-trailing" style\x3d"padding:0px 15px !important;"\x3e${nls.setSource}\x3c/div\x3e       \r\n                \x3c/td\x3e\r\n              \x3c/tr\x3e\r\n            \x3c/tbody\x3e\r\n          \x3c/table\x3e\r\n          \x3c/td\x3e\r\n      \x3c/tr\x3e\r\n       \x3ctr\x3e\r\n        \x3ctd class\x3d"first"\x3e${nls.chartSection}\x3c/td\x3e\r\n        \x3ctd class\x3d"second" colspan\x3d"2"\x3e\r\n          \x3cinput data-dojo-type\x3d"dijit/form/NumberTextBox" required\x3d"true" \r\n          data-dojo-attach-point\x3d"chartDataSections" data-dojo-props\x3d\'style:{width:"50px"},constraints:{min:1,max:10,places:0},\r\n          invalidMessage:"Please enter a numeric value.",\r\n          rangeMessage:"Please enter values between 1 and 10."\'/\x3e\r\n        \x3c/td\x3e\r\n      \x3c/tr\x3e\r\n      \x3ctr\x3e\r\n      \x3ctd class\x3d"first"\x3e${nls.selectByGeography}\x3c/td\x3e\r\n      \x3ctd\x3e\x3cinput style\x3d"margin-left: 8px;" data-dojo-attach-point\x3d"includeGeoFilter" name\x3d"includeGeoFilter" data-dojo-type\x3d"dijit/form/CheckBox" /\x3e\x3c/td\x3e\r\n\r\n      \x3c/tr\x3e\r\n       \x3cdiv data-dojo-attach-point\x3d"geoFilterSettings" \x3e\r\n      \x3ctr class\x3d\'dynamicRow\'\x3e\r\n        \x3ctd class\x3d"first"\x3e${nls.selectMapUrl}\x3c/td\x3e\r\n        \x3ctd class\x3d"second"  colspan\x3d"2"\x3e\r\n          \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/ValidationTextBox"\r\n          data-dojo-attach-point\x3d"selectMapUrl" style\x3d"width:100%;" /\x3e\r\n        \x3c/td\x3e\r\n       \r\n      \x3c/tr\x3e\r\n      \x3ctr class\x3d\'dynamicRow\'\x3e\r\n        \x3ctd class\x3d"first"\x3e${nls.selectUrl}\x3c/td\x3e\r\n        \x3ctd class\x3d"second"  colspan\x3d"2"\x3e\r\n          \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/ValidationTextBox" required\x3d"true"\r\n          data-dojo-attach-point\x3d"selectUrl" style\x3d"width:100%;" /\x3e\r\n        \x3c/td\x3e\r\n      \r\n      \x3c/tr\x3e\r\n      \r\n      \x3ctr class\x3d\'dynamicRow\'\x3e\r\n        \x3ctd class\x3d"first"\x3e${nls.geometryServiceURL}\x3c/td\x3e\r\n        \x3ctd class\x3d"second"  colspan\x3d"2"\x3e\r\n         \x3cinput type\x3d"text" data-dojo-type\x3d"dijit/form/ValidationTextBox"\r\n          data-dojo-attach-point\x3d"geometryServiceURL" style\x3d"width:100%;" /\x3e\r\n        \x3c/td\x3e\r\n       \r\n      \x3c/tr\x3e\r\n      \x3c/div\x3e\r\n      \x3ctr\x3e \r\n        \x3ctd colspan\x3d"2"\x3e\r\n         \x3cdiv data-dojo-attach-point\x3d"dashboardFieldNameInfos"\x3e\x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"dashboardFieldNameInfosError" style\x3d"display:none; padding: 5px;"\x3e\x3c/div\x3e\r\n    \r\n        \x3c/td\x3e\r\n         \r\n        \x3c/tr\x3e\r\n\r\n    \x3c/tbody\x3e\r\n  \x3c/table\x3e\r\n \x3c/div\x3e\r\n',
"url:widgets/ReviewerDashboard/setting/css/style.css":".drs-widget-dashboard-setting{margin:0; padding:0; font-size:15px;}.drs-widget-dashboard-setting .setting-table \x3e thead \x3e tr \x3e th,.drs-widget-dashboard-setting .setting-table \x3e tbody \x3e tr \x3e td{height:40px; line-height:40px; vertical-align:middle;}.drs-widget-dashboard-setting .input-table \x3e tbody \x3e tr \x3e .first{width:24%;}.drs-widget-dashboard-setting .input-table \x3e tbody \x3e tr \x3e .second{width:74%;}.drs-widget-dashboard-setting .input-table \x3e tbody \x3e tr \x3e .third{width:35px;}",
"*now":function(q){q(['dojo/i18n!*preload*widgets/ReviewerDashboard/setting/nls/Setting*["ar","bs","ca","cs","da","de","en","el","es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","nb","nl","pl","pt-br","pt-pt","ro","ru","sk","sl","sr","sv","th","tr","zh-cn","uk","vi","zh-hk","zh-tw","ROOT"]'])},"*noref":1}});
define("dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/query dojo/on jimu/dijit/Message dijit/_WidgetsInTemplateMixin jimu/BaseWidgetSetting jimu/dijit/SimpleTable esri/tasks/datareviewer/DashboardTask dijit/form/ValidationTextBox dijit/form/RadioButton dijit/form/NumberTextBox".split(" "),function(q,p,r,v,w,u,x,e,k,f){return q([e,x],{baseClass:"drs-widget-dashboard-setting",startup:function(){this.inherited(arguments);this.setConfig(this.config);this.own(w(this.includeGeoFilter,"change",
r.hitch(this,this._setFilterVisibility)))},setConfig:function(a){this.config=a;a.drsSOEURL&&this.drsSOEURL.set("value",a.drsSOEURL);a.numberChartSections&&this.chartDataSections.set("value",a.numberChartSections);"true"===a.includeGeographicFilter?this.includeGeoFilter.set("checked",!0):(this.includeGeoFilter.set("checked",!1),this.showHideDynamicRows(!1,this.geoFilterSettingsTable));a.selectUrl&&this.selectUrl.set("value",a.selectUrl);a.selectMapUrl&&this.selectMapUrl.set("value",a.selectMapUrl);
a.geometryServiceURL&&this.geometryServiceURL.set("value",a.geometryServiceURL);this.displayFieldsTable=new k({fields:[{name:"isDefault",title:this.nls.defaultColumn,type:"radio",width:"100px"},{name:"isVisible",title:this.nls.visibleColumn,type:"checkbox","class":"update",width:"100px"},{name:"dashboardFieldName",title:this.nls.fieldNameColumn,type:"text",width:"300px"},{name:"alias",title:this.nls.aliasColumn,type:"text",editable:"true",width:"300px"}],selectable:!1});this.displayFieldsTable.placeAt(this.dashboardFieldNameInfos);
this.displayFieldsTable.startup();this.getDashboardFieldInfos(a.drsSOEURL,a.dashboardFieldNames)},getDashboardFieldInfos:function(a,b){(new f(a)).getDashboardFieldNames().then(r.hitch(this,function(t){t.fieldNames.push("LIFECYCLEPHASE");for(var h=0;h<t.fieldNames.length;h++){var g=t.fieldNames[h];if("batchjobcheckgroup"!==g.toLowerCase()){for(var c="",d="",l="",m,n=0;n<b.length;n++)if(b[n].dashboardFieldName===t.fieldNames[h]){m=b[n];break}null!==m&&void 0!==m?(c=m.isDefault,d=m.isVisible,l=m.alias):
0===b.length&&"severity"===g.toLowerCase()&&(c=!0);this.displayFieldsTable.addRow({isDefault:""===c?!1:c,isVisible:""===d?!0:d,dashboardFieldName:g,alias:""===l?g:l})}}}))},_onBtnSetSourceClicked:function(){this.displayFieldsTable.clear();this.getDashboardFieldInfos(this.drsSOEURL.value,[])},getConfig:function(){this.config.drsSOEURL=this.drsSOEURL.value;this.config.numberChartSections=this.chartDataSections.value;this.config.includeGeographicFilter=this.includeGeoFilter.checked?"true":"false";this.config.selectUrl=
this.selectUrl.value;this.config.selectMapUrl=this.selectMapUrl.value;this.config.geometryServiceURL=this.geometryServiceURL.value;var a=this.displayFieldsTable.getData();this.config.dashboardFieldNames=[];for(var b=[],t=a.length,h=0;h<t;h++){var g={};g.dashboardFieldName=a[h].dashboardFieldName;g.alias=a[h].alias;g.isVisible=a[h].isVisible;g.isDefault=a[h].isDefault;b.push(g)}if(0===p.filter(b,function(c){return!0===c.isVisible}).length)return new u({message:this.nls.selectFieldWarning}),!1;a=p.filter(b,
function(c){return!0===c.isDefault});if(null===a||0===a.length)return new u({message:this.nls.includeDefaultFieldName}),!1;if(0<a.length&&!1===a[0].isVisible)return new u({message:this.nls.defaultFieldNotVisible}),!1;this.config.dashboardFieldNames=b;return this.config},_setFilterVisibility:function(a){var b=v(this.geoFilterSettings);a?(b.style({display:"block"}),this.showHideDynamicRows(!0,this.geoFilterSettingsTable)):this.showHideDynamicRows(!1,this.geoFilterSettingsTable)},showHideDynamicRows:function(a,
b){b=v(".dynamicRow",b);if(void 0!==b&&null!==b&&0<b.length)for(var t=0;t<b.length;t++)b[t].style.display=a?"":"none"}})});