// 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/CostAnalysis/setting/StatisticsSettings.html":'\x3cdiv class\x3d"esriCTTabNode"\x3e\r\n    \x3cdiv class\x3d"esriCTTabContainer row"\x3e\r\n        \x3cdiv\x3e\r\n            \x3c!--Add New Statistics button--\x3e\r\n            \x3cdiv class\x3d"esriCTStatisticsContainer" data-dojo-attach-point\x3d"btnAddStatisticsNodeWrapper"\x3e\r\n                \x3cdiv data-dojo-attach-point\x3d"btnAddStatisticsNode" class\x3d"esriCTBtnStatisticsAddSection"\x3e\r\n                    \x3cspan class\x3d"esriCTBtnAddStatisticsIcon"\x3e\x3c/span\x3e\r\n                    \x3cspan class\x3d"esriCTBtnStatisticsAddLabel"\x3e ${nls.statisticsSettings.addStatisticsLabel}\x3c/span\x3e\r\n                \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTAddLayerTableNode" data-dojo-attach-point\x3d"statisticsLayerTableNode"\x3e\x3c/div\x3e\r\n            \x3cdiv class\x3d"esriCTHidden esriCTNoEditableLayersAvailable" data-dojo-attach-point\x3d"noEditableLayersAvailable"\x3e\r\n                ${nls.costingInfo.noEditableLayersAvailable}\r\n            \x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"additionalProjectCostWrapper"\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3c!--Add/delete/reorder buttons--\x3e\r\n    \x3cdiv class\x3d"esriCTStatisticsButtonParentDiv"\x3e\r\n        \x3cdiv class\x3d"esriCTAddStatisticsIcon esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnAddNode"\r\n            title\x3d"${nls.statisticsSettings.addNewStatisticsText}" tabindex\x3d"0" role\x3d"button"\r\n            aria-label\x3d"${nls.statisticsSettings.addNewStatisticsText}"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTDeleteStatisticsIcon esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnCrossNode"\r\n            title\x3d"${nls.statisticsSettings.deleteStatisticsText}" tabindex\x3d"-1" role\x3d"button"\r\n            aria-label\x3d"${nls.statisticsSettings.deleteStatisticsText}"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTStatisticsUpIcon esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnUpNode"\r\n            title\x3d"${nls.statisticsSettings.moveStatisticsUpText}" tabindex\x3d"-1" role\x3d"button"\r\n            aria-label\x3d"${nls.statisticsSettings.moveStatisticsUpText}"\x3e\x3c/div\x3e\r\n        \x3cdiv class\x3d"esriCTStatisticsDownIcon esriCTStatisticsButtons" data-dojo-attach-point\x3d"btnDownNode"\r\n            title\x3d"${nls.statisticsSettings.moveStatisticsDownText}" tabindex\x3d"-1" role\x3d"button"\r\n            aria-label\x3d"${nls.statisticsSettings.moveStatisticsDownText}"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare jimu/BaseWidget jimu/dijit/SimpleTable dojo/on dojo/_base/array dojo/query dojo/dom-construct jimu/dijit/formSelect dijit/form/ValidationTextBox dijit/_WidgetsInTemplateMixin dojo/text!./StatisticsSettings.html dojo/_base/lang dojo/store/Memory dojo/dom-class dijit/registry dojo/_base/html dojo/dom-style ./ProjectCost dojo/keys dojo/dom-attr dijit/focus jimu/utils dojo/_base/event".split(" "),function(A,B,C,h,l,g,u,w,D,E,F,f,v,e,r,x,t,G,m,n,y,z,q){return A([B,E],{templateString:F,
baseClass:"jimu-widget-cost-analysis-statistics-settings",_layerNameStore:null,_commonStatisticsStoreOption:null,_polygonStatisticsStoreOption:null,_polylineStatisticsStoreOption:null,_pointLayerStatisticsStore:null,_polygonLayerStatisticsStore:null,_polylineLayerStatisticsStore:null,_layerFieldStore:{},_shapeFields:"shape_length shape_area shape__length shape__area shape.len shape.area".split(" "),_editableConfiguredLayers:[],constructor:function(a){f.mixin(this,a)},postMixInProperties:function(){this.nls.common=
{};f.mixin(this.nls.common,window.jimuNls.common)},postCreate:function(){this._polylineLayerStatisticsStore=this._polygonLayerStatisticsStore=this._pointLayerStatisticsStore=this._polylineStatisticsStoreOption=this._polygonStatisticsStoreOption=this._commonStatisticsStoreOption=this._layerNameStore=null;this._layerFieldStore={};this._editableConfiguredLayers=[];this.inherited(arguments);this._init();this._handleClickEvent();this.showActionButtonsInColumn&&this._createProjectCostTable()},_createProjectCostTable:function(){this.additionalProjectCostObj=
new G({nls:this.nls,map:this.map,config:this.config},u.create("div",{},this.additionalProjectCostWrapper));this.additionalProjectCostObj.startup()},_handleClickEvent:function(){this._addButtonClick();this._crossButtonClick();this._upButtonClick();this._downButtonClick()},_init:function(){for(var a in this.config.layerSettings)this.config.layerSettings[a].editable&&this._editableConfiguredLayers.push(this.config.layerSettings[a].id);this._createStatisticsStoreOptions();this._createStatisticsTable();
this._layerNameStore||this._createLayerNameStore();this._attachNodeEvents();this._setConfig();this._displayAddStatisticsButtonOrLabel();this._handleActionButtonVisibility();0===this._editableConfiguredLayers.length&&(e.remove(this.noEditableLayersAvailable,"esriCTHidden"),e.add(this.btnAddStatisticsNodeWrapper,"esriCTHidden"),e.add(this.statisticsLayerTableNode,"esriCTHidden"),e.add(this.additionalProjectCostWrapper,"esriCTHidden"))},_displayAddStatisticsButtonOrLabel:function(){this.showActionButtonsInColumn?
e.remove(this.btnAddStatisticsNodeWrapper,"esriCTHidden"):e.add(this.btnAddStatisticsNodeWrapper,"esriCTHidden")},_setConfig:function(){this.config&&this.config.statisticsSettings&&0<this.config.statisticsSettings.length&&l.forEach(this.config.statisticsSettings,f.hitch(this,function(a){this._addLayerRow(a)}))},getConfig:function(){var a=this._statisticsLayerTable.getRows();var b=[];l.forEach(a,f.hitch(this,function(c){b.push({id:c.layerNameDropDown.getValue(),type:c.statisticsTypeDropdown.getValue(),
field:c.layerFieldDropdown.getValue(),label:c.statisticsLabelTextBox.getValue()})}));this.additionalProjectCostObj&&this.additionalProjectCostObj.getConfig();return b},_createStatisticsStoreOptions:function(){this._commonStatisticsStoreOption=[{name:this.nls.statisticsType.averageLabel,value:"avg"},{name:this.nls.statisticsType.countLabel,value:"count"},{name:this.nls.statisticsType.maxLabel,value:"max"},{name:this.nls.statisticsType.minLabel,value:"min"},{name:this.nls.statisticsType.summationLabel,
value:"sum"}];this._polygonStatisticsStoreOption=[{name:this.nls.statisticsType.areaLabel,value:"area"}];this._polylineStatisticsStoreOption=[{name:this.nls.statisticsType.lengthLabel,value:"length"}]},_attachNodeEvents:function(){0===this._layerNameStore.data.length?(e.remove(this.noEditableLayersAvailable,"esriCTHidden"),e.add(this.btnAddStatisticsNodeWrapper,"esriCTHidden"),e.add(this.statisticsLayerTableNode,"esriCTHidden")):(e.add(this.noEditableLayersAvailable,"esriCTHidden"),e.remove(this.btnAddStatisticsNodeWrapper,
"esriCTHidden"),e.remove(this.statisticsLayerTableNode,"esriCTHidden"));this.own(h(this.btnAddStatisticsNode,"click",f.hitch(this,function(){this._layerNameStore.data.length&&(this._addStatisticsBtnClicked(),this.resetAddNewStatisticsDropdown())})));this.own(h(this.btnAddStatisticsNode,"keydown",f.hitch(this,function(a){if(a.keyCode===m.ENTER||a.keyCode===m.SPACE)q.stop(a),this._layerNameStore.data.length&&(this._addStatisticsBtnClicked(),this.resetAddNewStatisticsDropdown())})))},_createStatisticsTable:function(){this._statisticsLayerTable=
new C({fields:[{name:"editable",title:this.nls.statisticsSettings.selectDeselectAllTitle,type:"checkbox",editable:!1,width:this.showActionButtonsInRow?"16px":"0%",hidden:!this.showActionButtonsInRow},{name:"field",title:this.nls.common.layer,type:"empty",editable:!1,width:"30%"},{name:"field",title:this.nls.common.type,type:"empty",editable:!0,width:this.showActionButtonsInRow?"19%":"18%"},{name:"field",title:this.nls.statisticsSettings.fieldNameTitle,type:"empty",editable:!1,width:"22%"},{name:"field",
title:this.nls.statisticsSettings.statisticsTitle,type:"empty",editable:!1,width:this.showActionButtonsInRow?"55px":"20%"},{name:"actions",title:this.nls.common.actions,width:"10%",type:"actions",actions:["up","down","delete"],hidden:!this.showActionButtonsInColumn}],selectable:!1});this._statisticsLayerTable.placeAt(this.statisticsLayerTableNode);this._statisticsLayerTable.startup();var a=g(".esriCTAddLayerTableNode th .label")[0];var b=g(".esriCTAddLayerTableNode th .jimu-checkbox")[0];g(".esriCTAddLayerTableNode tr .jimu-checkbox");
b&&e.add(b,"esriCTStatisticsHeaderCheckBox");a&&e.add(a,"esriCTHidden")},_addButtonClick:function(){!0===this.showActionButtonsInRow?(e.remove(this.btnAddNode,"esriCTHidden"),this.own(h(this.btnAddNode,"click",f.hitch(this,function(){this._addStatisticsButtonClickEvent()}))),this.own(h(this.btnAddNode,"keydown",f.hitch(this,function(a){if(a.keyCode===m.ENTER||a.keyCode===m.SPACE)q.stop(a),this._addStatisticsButtonClickEvent()})))):e.add(this.btnAddNode,"esriCTHidden")},_addStatisticsButtonClickEvent:function(){if(this._layerNameStore.data.length&&
(this._addStatisticsBtnClicked(),this._handleActionButtonVisibility(),this.resetAddNewStatisticsDropdown(),this.widgetDomNode)){var a=this._statisticsLayerTable.getRows();0<=a.length&&(a=g(".jimu-checkbox",a[a.length-1])[0],y.focus(a))}},_crossButtonClick:function(){e.remove(this.btnCrossNode,"esriCTHidden");this.own(h(this.btnCrossNode,"click",f.hitch(this,this._deleteLayerRow)));this.own(h(this.btnCrossNode,"keydown",f.hitch(this,function(a){if(a.keyCode===m.ENTER||a.keyCode===m.SPACE)q.stop(a),
this._deleteLayerRow()})))},_upButtonClick:function(){e.remove(this.btnUpNode,"esriCTHidden");this.own(h(this.btnUpNode,"click",f.hitch(this,function(){this._upButtonClickEvent()})));this.own(h(this.btnUpNode,"keydown",f.hitch(this,function(a){if(a.keyCode===m.ENTER||a.keyCode===m.SPACE)q.stop(a),this._upButtonClickEvent()})))},_upButtonClickEvent:function(){var a;if(!e.contains(this.btnUpNode,"esriCTStatisticsUpIconDisable")){var b=this._statisticsLayerTable.getRows();var c=this._statisticsLayerTable.getData();
l.forEach(c,f.hitch(this,function(d,k){d.editable&&(a=b[k])}));this._statisticsLayerTable.onBeforeRowUp(a)&&(c=l.indexOf(b,a),0<c&&(c=b[c-1]))&&(x.place(a,c,"before"),this._statisticsLayerTable.updateUI(),this._statisticsLayerTable.emit("row-up",a))}},_downButtonClick:function(){e.remove(this.btnDownNode,"esriCTHidden");this.own(h(this.btnDownNode,"click",f.hitch(this,function(){this._downButtonClickEvent()})));this.own(h(this.btnDownNode,"keydown",f.hitch(this,function(a){if(a.keyCode===m.ENTER||
a.keyCode===m.SPACE)q.stop(a),this._downButtonClickEvent()})))},_downButtonClickEvent:function(){var a;if(!e.contains(this.btnDownNode,"esriCTStatisticsDownIconDisable")){var b=this._statisticsLayerTable.getRows();var c=this._statisticsLayerTable.getData();l.forEach(c,f.hitch(this,function(d,k){d.editable&&(a=b[k])}));this._statisticsLayerTable.onBeforeRowDown(a)&&(c=l.indexOf(b,a),c<b.length-1&&(c=b[c+1]))&&(x.place(a,c,"after"),this._statisticsLayerTable.updateUI(),this._statisticsLayerTable.emit("row-down",
a))}},_deleteLayerRow:function(){var a=this._statisticsLayerTable.getRows(),b=this._statisticsLayerTable.getData();l.forEach(b,f.hitch(this,function(c,d){c.editable&&this._statisticsLayerTable.deleteRow(a[d])}));0===this._statisticsLayerTable.getRows().length&&(b=g("th .checkbox")[0],e.contains(b,"checked")&&e.remove(b,"checked"));this._handleActionButtonVisibility()},_checkEditCapabilities:function(a){var b;return(b=a&&a.capabilities?a.capabilities:null)&&-1!==b.indexOf("Delete")&&-1!==b.indexOf("Create")&&
-1!==b.indexOf("Update")&&a.globalIdField?!0:!1},_addStatisticsBtnClicked:function(){this._addLayerRow();var a=g(".simple-table-title .jimu-checkbox",this.domNode)[0];h(r.byNode(a),"change",f.hitch(this,function(){setTimeout(f.hitch(this,function(){this._handleActionButtonVisibility()}),0)}))},_handleActionButtonVisibility:function(){var a,b=0;var c=this._statisticsLayerTable.getRows();var d=g(".simple-table-title .jimu-checkbox",this.domNode)[0];d=r.byNode(d);l.some(this._statisticsLayerTable.getRows(),
f.hitch(this,function(k){a=g(".jimu-checkbox",k)[0];r.byNode(a).checked&&b++}));0===b?(e.replace(this.btnCrossNode,"esriCTDeleteStatisticsIconDisable","esriCTDeleteStatisticsIcon"),n.set(this.btnCrossNode,"tabindex","-1")):(e.replace(this.btnCrossNode,"esriCTDeleteStatisticsIcon","esriCTDeleteStatisticsIconDisable"),n.set(this.btnCrossNode,"tabindex","0"));c&&1===b?(e.replace(this.btnUpNode,"esriCTStatisticsUpIcon","esriCTStatisticsUpIconDisable"),e.replace(this.btnDownNode,"esriCTStatisticsDownIcon",
"esriCTStatisticsDownIconDisable"),n.set(this.btnUpNode,"tabindex","0"),n.set(this.btnDownNode,"tabindex","0")):(e.replace(this.btnUpNode,"esriCTStatisticsUpIconDisable","esriCTStatisticsUpIcon"),e.replace(this.btnDownNode,"esriCTStatisticsDownIconDisable","esriCTStatisticsDownIcon"),n.set(this.btnUpNode,"tabindex","-1"),n.set(this.btnDownNode,"tabindex","-1"));0===c.length?(d.set("status",!1),e.add(d.domNode,"jimu-state-disabled"),n.set(d.domNode,"tabindex","-1"),this.widgetDomNode&&(y.focus(this.btnAddNode),
z.initFirstFocusNode(this.widgetDomNode,this.btnAddNode))):(d.set("status",!0),e.remove(d.domNode,"jimu-state-disabled"),n.set(d.domNode,"tabindex","0"),this.widgetDomNode&&z.initFirstFocusNode(this.widgetDomNode,d.domNode))},_addLayerRow:function(a){var b=this._statisticsLayerTable.addRow({});var c=g(".simple-table-cell",b.tr);var d=g(".simple-table-cell .jimu-checkbox",b.tr)[0];n.set(d,"aria-label",this.nls.statisticsSettings.layerCheckbox);c&&(d&&h(r.byNode(d),"change",f.hitch(this,function(){this._handleActionButtonVisibility()})),
b=b.tr,this._addLayerNameDropdown(c[1],b,a),this._addStatisticsDropdown(c[2],b,a),this._addLayerFieldDropdown(c[3],b,a),this._addStatisticsLabelTextBox(c[4],b,a))},_onLayerNameChange:function(a,b,c){if(this._layerNameStore.data.length){var d=this._layerNameStore.data[this._layerNameStore.index[a]].geometryType;d=this._getStatisticsTypeStore(d);b.statisticsTypeDropdown.setStore(d);c&&c.type&&b.statisticsTypeDropdown.set("value",c.type);c=b.statisticsTypeDropdown.getValue();a=this._layerNameStore.data[this._layerNameStore.index[a]].value;
this._layerFieldStore[a]||this._createFieldStore(a);b.layerFieldDropdown.setStore(this._layerFieldStore[a]);b.layerFieldDropdown.reset();this._onStatisticsTypeChange(c,b)}},_onStatisticsTypeChange:function(a,b,c){"count"===a||"length"===a||"area"===a?e.add(b.layerFieldDropdown.domNode,"esriCTHidden"):(e.remove(b.layerFieldDropdown.domNode,"esriCTHidden"),c&&c.field&&b.layerFieldDropdown.set("value",c.field));this._resetStatisticsTypeWidth(b)},_addLayerNameDropdown:function(a,b,c){a=u.create("div",
{"class":"esriCTDropDownContainer"},a);b.layerNameDropDown=new w({name:"layerSelect",store:this._layerNameStore,labelAttr:"name","class":"esriCTLayerNameDropdown"},a);c&&c.id&&b.layerNameDropDown.set("value",c.id);this.own(h(b.layerNameDropDown,"click",f.hitch(this,function(){this._resetLayerNameWidth(b)})));this.own(h(b.layerNameDropDown,"keydown",f.hitch(this,function(d){if(d.keyCode===m.ENTER||d.keyCode===m.SPACE)q.stop(d),this._resetLayerNameWidth(b)})));this.own(h(b.layerNameDropDown,"change",
f.hitch(this,function(d){n.set(b.layerNameDropDown,"aria-label",this.nls.common.layer+" "+b.layerNameDropDown._getSelectedOptionsAttr().label);this._resetLayerNameWidth(b);this._onLayerNameChange(d,b,c)})));b.layerNameDropDown.startup();n.set(b.layerNameDropDown,"aria-label",this.nls.common.layer+" "+b.layerNameDropDown._getSelectedOptionsAttr().label)},_createLayerNameStore:function(){var a=[];var b=[];a=[this.config.projectSettings.costingGeometryLayer||"",this.config.projectSettings.projectLayer||
"",this.config.projectSettings.pointLayerCentroid||""];if(this.config.layerSettings.length&&this._editableConfiguredLayers.length){var c=this.config.layerSettings;l.forEach(c,f.hitch(this,function(d){a.push(d.id);var k=this._getFeatureLayerGeometryType(d.id);d.editable&&k&&b.push({name:d.title,value:d.id,geometryType:k})}))}this._layerNameStore=new v({idProperty:"value",data:b});b.length&&this._updateLayerNameOptions()},_updateLayerNameOptions:function(){var a;var b=g(".esriCTLayerNameDropdown",this.domNode);
l.forEach(b,f.hitch(this,function(c){a=r.byNode(c).get("value");r.byNode(c).set("store",this._layerNameStore);r.byNode(c).set("value",a)}));0===this._editableConfiguredLayers.length?(e.remove(this.noEditableLayersAvailable,"esriCTHidden"),e.add(this.btnAddStatisticsNodeWrapper,"esriCTHidden"),e.add(this.statisticsLayerTableNode,"esriCTHidden"),e.add(this.additionalProjectCostWrapper,"esriCTHidden")):(e.add(this.noEditableLayersAvailable,"esriCTHidden"),e.remove(this.btnAddStatisticsNodeWrapper,"esriCTHidden"),
e.remove(this.statisticsLayerTableNode,"esriCTHidden"),e.remove(this.additionalProjectCostWrapper,"esriCTHidden"))},_getFeatureLayerGeometryType:function(a){var b=l.filter(this.map.webMapResponse.itemInfo.itemData.operationalLayers,f.hitch(this,function(c){return a===c.id}));return b.length&&b[0].layerObject?b[0].layerObject.geometryType:null},_createStatisticsTypeStore:function(){this._pointLayerStatisticsStore||this._polygonLayerStatisticsStore||this._polylineLayerStatisticsStore||(this._createPointGeometryStatisticsStore(),
this._createPolygonGeometryStatisticsStore(),this._createPolylineGeometryStatisticsStore())},_getStatisticsTypeStore:function(a){switch(a){case "esriGeometryPolygon":return this._polygonLayerStatisticsStore;case "esriGeometryPolyline":return this._polylineLayerStatisticsStore;case "esriGeometryPoint":return this._pointLayerStatisticsStore}},_addStatisticsDropdown:function(a,b,c){a=u.create("div",{"class":"esriCTDropDownContainer"},a);this._createStatisticsTypeStore();var d=b.layerNameDropDown._getSelectedOptionsAttr().item.geometryType;
d=this._getStatisticsTypeStore(d);b.statisticsTypeDropdown=new w({name:"statisticsTypeSelect",store:d,labelAttr:"name","class":"esriCTStatisticsTypeDropdown"},a);this.own(h(b.statisticsTypeDropdown,"click",f.hitch(this,function(){this._resetStatisticsTypeWidth(b)})));this.own(h(b.statisticsTypeDropdown,"keydown",f.hitch(this,function(k){if(k.keyCode===m.ENTER||k.keyCode===m.SPACE)q.stop(k),this._resetStatisticsTypeWidth(b)})));this.own(h(b.statisticsTypeDropdown,"change",f.hitch(this,function(k){this._resetStatisticsTypeWidth(b);
this._onStatisticsTypeChange(k,b,c);n.set(b.statisticsTypeDropdown,"aria-label","type "+b.statisticsTypeDropdown._getSelectedOptionsAttr().label)})));n.set(b.statisticsTypeDropdown,"aria-label","Type "+b.statisticsTypeDropdown._getSelectedOptionsAttr().label);b.statisticsTypeDropdown.startup()},_createPointGeometryStatisticsStore:function(){this._pointLayerStatisticsStore=new v({idProperty:"value",data:this._commonStatisticsStoreOption})},_createPolygonGeometryStatisticsStore:function(){this._polygonLayerStatisticsStore=
new v({idProperty:"value",data:this._commonStatisticsStoreOption.concat(this._polygonStatisticsStoreOption)})},_createPolylineGeometryStatisticsStore:function(){this._polylineLayerStatisticsStore=new v({idProperty:"value",data:this._commonStatisticsStoreOption.concat(this._polylineStatisticsStoreOption)})},_createFieldStore:function(a){var b=[];var c=["esriFieldTypeDouble","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSmallFloat"];this._layerFieldStore[a]||(l.forEach(this.map._layers[a].fields,
f.hitch(this,function(d){-1<c.indexOf(d.type)&&-1===this._shapeFields.indexOf(d.name.toLowerCase())&&b.push({name:d.alias||d.name,value:d.name})})),0===b.length&&b.push({name:"\x26nbsp",value:null}),this._layerFieldStore[a]=new v({idProperty:"value",data:b}))},_addLayerFieldDropdown:function(a,b){a=u.create("div",{"class":"esriCTDropDownContainer"},a);var c=b.layerNameDropDown._getSelectedOptionsAttr().value;this._createFieldStore(c);b.layerFieldDropdown=new w({name:"layerFieldDropdown",store:this._layerFieldStore[c],
labelAttr:"name","class":"esriCTStatisticsFieldDropdown"},a);this.own(h(b.layerFieldDropdown,"click",f.hitch(this,function(){this._resetLayerFieldWidth(b)})));this.own(h(b.layerFieldDropdown,"keydown",f.hitch(this,function(d){if(d.keyCode===m.ENTER||d.keyCode===m.SPACE)q.stop(d),this._resetLayerFieldWidth(b)})));this.own(h(b.layerFieldDropdown,"change",f.hitch(this,function(){this._resetLayerFieldWidth(b);n.set(b.layerFieldDropdown,"aria-label",this.nls.statisticsSettings.fieldNameTitle+" "+b.layerFieldDropdown.value)})));
b.layerFieldDropdown.startup();a=b.statisticsTypeDropdown.getValue();this._onStatisticsTypeChange(a,b);n.set(b.layerFieldDropdown,"aria-label",this.nls.statisticsSettings.fieldNameTitle+" "+b.layerFieldDropdown.value)},_addStatisticsLabelTextBox:function(a,b,c){a=u.create("div",{"class":"esriCTTextBoxContainer"},a);b.statisticsLabelTextBox=new D({"class":"esriCTLayerLabelTextBox"},a);c&&c.label&&b.statisticsLabelTextBox.set("value",c.label);b.statisticsLabelTextBox.startup();n.set(b.statisticsLabelTextBox,
"aria-label",this.nls.statisticsSettings.statisticsTitle+" "+b.statisticsLabelTextBox.get("value"))},_updateStatisticsTable:function(a){var b,c;a.layerId&&(a.editable?b=a.layerId:c=a.layerId);c&&(a=this._statisticsLayerTable.getRows(),l.forEach(a,f.hitch(this,function(d){d.layerNameDropDown&&d.layerNameDropDown.get("value")===c&&this._statisticsLayerTable.deleteRow(d)})),this._layerNameStore.remove(c),a=this._editableConfiguredLayers.indexOf(c),-1!==a&&this._editableConfiguredLayers.splice(a,1));
b&&""!==b&&(a=this.layerInfosObj.getLayerInfoById(b))&&a.layerObject&&(a=a.layerObject,this._layerNameStore.put({name:a.name,value:b,geometryType:a.geometryType}),this._editableConfiguredLayers.push(b));this._updateLayerNameOptions()},resetAddNewStatisticsDropdown:function(){var a,b,c,d,k;if(a=g(".simple-table-field.field",this._statisticsLayerTable.domNode))a[0]&&(b=t.getComputedStyle(a[0])),a[1]&&(c=t.getComputedStyle(a[1])),a[2]&&(d=t.getComputedStyle(a[2]));a=g(".esriCTLayerNameDropdown",this._statisticsLayerTable.domNode);
l.forEach(a,f.hitch(this,function(p){(p=g(".dijitReset.dijitInline.dijitSelectLabel.dijitValidationTextBoxLabel",p))&&p[0]&&(k=this.showActionButtonsInColumn?59:30,p[0].style.width=parseInt(b.width,10)-k+"px")}));a=g(".esriCTStatisticsTypeDropdown",this._statisticsLayerTable.domNode);l.forEach(a,f.hitch(this,function(p){(p=g(".dijitReset.dijitInline.dijitSelectLabel.dijitValidationTextBoxLabel",p))&&p[0]&&(k=this.showActionButtonsInColumn?59:30,p[0].style.width=parseInt(c.width,10)-k+"px")}));a=g(".esriCTStatisticsFieldDropdown",
this._statisticsLayerTable.domNode);l.forEach(a,f.hitch(this,function(p){(p=g(".dijitReset.dijitInline.dijitSelectLabel.dijitValidationTextBoxLabel",p))&&p[0]&&(k=this.showActionButtonsInColumn?59:30,p[0].style.width=parseInt(d.width,10)-k+"px")}))},_resetLayerNameWidth:function(a){var b,c;(b=g(".simple-table-field.field",this._statisticsLayerTable.domNode))&&b[0]&&(c=t.getComputedStyle(b[0]));a=g(".dijitReset.dijitInline.dijitSelectLabel.dijitValidationTextBoxLabel",a.layerNameDropDown.domNode);
b=this.showActionButtonsInColumn?59:30;a&&a[0]&&(a[0].style.width=parseInt(c.width,10)-b+"px")},_resetStatisticsTypeWidth:function(a){var b,c;(c=g(".simple-table-field.field",this._statisticsLayerTable.domNode))&&c[1]&&(b=t.getComputedStyle(c[1]));a=g(".dijitReset.dijitInline.dijitSelectLabel.dijitValidationTextBoxLabel",a.statisticsTypeDropdown.domNode);c=this.showActionButtonsInColumn?59:30;a&&a[0]&&(a[0].style.width=parseInt(b.width,10)-c+"px")},_resetLayerFieldWidth:function(a){var b,c;(b=g(".simple-table-field.field",
this._statisticsLayerTable.domNode))&&b[2]&&(c=t.getComputedStyle(b[2]));a=g(".dijitReset.dijitInline.dijitSelectLabel.dijitValidationTextBoxLabel",a.layerFieldDropdown.domNode);b=this.showActionButtonsInColumn?59:30;a&&a[0]&&(a[0].style.width=parseInt(c.width,10)-b+"px")}})});