text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See http://js.arcgis.com/3.15/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.
  
  //>>built
  require({cache:{"url:widgets/SmartEditor/setting/FieldValidation.html":'\x3cdiv\x3e\r\n    \x3cdiv class\x3d"settingsDesc" data-dojo-attach-point\x3d"validationDesc"\x3e${nls.actionPage.description}\x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"validationTable"\x3e\x3c/div\x3e\r\n\x3c/div\x3e'}});
  define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/on dojo/dom-construct dojo/query dojo/json dojox/html/entities dojo/text!./FieldValidation.html dijit/_TemplatedMixin jimu/BaseWidgetSetting jimu/dijit/SimpleTable jimu/dijit/Popup ./FilterPage".split(" "),function(m,d,f,g,h,n,k,p,q,r,t,u,l,v){return m([t,r],{baseClass:"jimu-widget-smartEditor-rule-table",templateString:q,_resourceInfo:null,_url:null,_fieldName:null,_fieldValidations:null,_layerId:null,_fieldsPopUp:null,postCreate:function(){this.inherited(arguments);
  this._fieldsPopUp=null;this._initActionsTable();this._setActionsTable()},getSettings:function(){return this._fieldValidations},_getConfigActionOrder:function(){var a=[];return void 0!==this._fieldValidations&&null!==this._fieldValidations&&this._fieldValidations.hasOwnProperty(this._fieldName)&&(f.forEach(this._fieldValidations[this._fieldName],function(b){a.push(b.actionName)}),null!==a&&0!==a.length)?a:["Hide","Required","Disabled"]},_getConfigAction:function(a){var b=null;void 0!==this._fieldValidations&&
  null!==this._fieldValidations&&this._fieldValidations.hasOwnProperty(this._fieldName)&&f.some(this._fieldValidations[this._fieldName],function(c){return c.actionName===a?(b=c,!0):!1});return b},_nlsActionToConfig:function(a){switch(a){case this.nls.actionPage.actions.hide:return"Hide";case this.nls.actionPage.actions.disabled:return"Disabled";case this.nls.actionPage.actions.required:return"Required";default:return a}},popupActionsPage:function(){this._fieldsPopUp&&(this._fieldsPopUp.close(),this._fieldsPopUp=
  null);this._fieldsPopUp=new l({titleLabel:this.popupTitle,width:920,maxHeight:600,autoHeight:!0,content:this,buttons:[{label:this.nls.ok,onClick:d.hitch(this,function(){var a=this._validationTable.getRows();if(void 0===this._fieldValidations||null===this._fieldValidations)this._fieldValidations={};this._fieldValidations[this._fieldName]=[];f.forEach(a,function(b){var c=this._validationTable.getRowData(b);b={};b.actionName=this._nlsActionToConfig(c.label);b.submitWhenHidden=c.submitWhenHidden;void 0!==
  c.expression&&null!==c.expression&&""!==c.expression&&""!==c.filter&&(c=k.parse(p.decode(c.filter)),b.expression=c.expr,b.filter=c);this._fieldValidations[this._fieldName].push(b)},this);this._fieldsPopUp.close()})},{label:this.nls.cancel,classNames:["jimu-btn jimu-btn-vacation"],onClick:d.hitch(this,function(){this._fieldsPopUp.close()})}],onClose:d.hitch(this,function(){})})},_initActionsTable:function(){this._validationTable=new u({fields:[{name:"label",title:this.nls.actionPage.actionsSettingsTable.rule,
  type:"text",width:"15%","class":"rule"},{name:"expression",title:this.nls.actionPage.actionsSettingsTable.expression,type:"text",width:"55%","class":"expression"},{name:"groupName",title:this.nls.actionPage.actionsSettingsTable.groupName,type:"text",width:"20%","class":"expression"},{name:"submitWhenHidden",title:"submitWhenHidden",type:"checkbox",hidden:!0},{name:"filter",title:"filter",type:"text",hidden:!0},{name:"actions",title:this.nls.actionPage.actionsSettingsTable.actions,type:"actions",actions:["up",
  "down","edit"],width:"10%","class":"actions"}],selectable:!1,style:{height:"300px",maxHeight:"300px"}});this._validationTable.onBeforeRowEdit=d.hitch(this,function(a){var b=this._validationTable.getRowData(a);if(b.groupName){var c=h.create("div");h.create("div",{innerHTML:this.nls.actionPage.editOptionsPopup.expression,className:"settingsDesc"},c);h.create("div",{innerHTML:this.nls.actionPage.editOptionsPopup.editGroupHint,className:"editGroupHint"},c);var e=new l({titleLabel:this.nls.actionPage.editOptionsPopup.popupTitle,
  width:500,maxHeight:445,autoHeight:!0,content:c,"class":this.baseClass,buttons:[{label:this.nls.actionPage.editOptionsPopup.editGroupButton,onClick:d.hitch(this,function(){this._editGroup(b.groupName);e.close()})},{label:this.nls.actionPage.editOptionsPopup.editIndependentlyButton,onClick:d.hitch(this,function(){this._validationTable._onActionsEdit(a);e.close()})}]})}else this._validationTable._onActionsEdit(a)});this.own(g(this._validationTable,"row-edit",d.hitch(this,function(a){var b=this._validationTable.getRowData(a);
  b.groupName&&(b={groupName:b.groupName,layerId:this._layerId,fieldName:this._fieldName,action:this._nlsActionToConfig(b.label)},this.removeFromGroup(b),this._validationTable.editRow(a,{groupName:null}))})));this._validationTable.placeAt(this.validationTable);this._validationTable.startup();n("th.simple-table-field",this._validationTable.domNode).forEach(function(a){switch(void 0===a.innerText||""===a.innerText?"":a.innerText.replace(/(\r\n|\n|\r)/gm,"")){case this.nls.actionPage.actionsSettingsTable.rule:a.title=
  this.nls.actionPage.actionsSettingsTable.ruleTip;break;case this.nls.actionPage.actionsSettingsTable.expression:a.title=this.nls.actionPage.actionsSettingsTable.expressionTip;break;case this.nls.actionPage.actionsSettingsTable.actions:a.title=this.nls.actionPage.actionsSettingsTable.actionsTip;break;case this.nls.actionPage.actionsSettingsTable.groupName:a.title=this.nls.actionPage.actionsSettingsTable.groupNameTip}},this);this.own(g(this._validationTable,"actions-edit",d.hitch(this,this._onEditFieldInfoClick)));
  this.own(g(this._validationTable,"actions-delete",d.hitch(this,this._onDeleteFieldInfoClick)))},_onDeleteFieldInfoClick:function(a){this._removeFilter(a)},_onEditFieldInfoClick:function(a){this._showFilter(a)},_setActionsTable:function(){var a=this._getConfigActionOrder();f.forEach(a,function(b){var c=this._getConfigAction(b),e=b;switch(b){case "Hide":this.nls.actionPage.hasOwnProperty("actions")&&this.nls.actionPage.actions.hasOwnProperty("hide")&&(e=this.nls.actionPage.actions.hide);break;case "Required":this.nls.actionPage.hasOwnProperty("actions")&&
  this.nls.actionPage.actions.hasOwnProperty("required")&&(e=this.nls.actionPage.actions.required);break;case "Disabled":this.nls.actionPage.hasOwnProperty("actions")&&this.nls.actionPage.actions.hasOwnProperty("disabled")&&(e=this.nls.actionPage.actions.disabled);break;default:e=b}b={label:e,expression:null};void 0!==c&&null!==c&&(c.hasOwnProperty("filter")&&void 0!==c.filter&&null!==c.filter&&(c.filter.smartActionGroupName&&(b.groupName=c.filter.smartActionGroupName),b.filter=k.stringify(c.filter),
  b.expression=c.filter.expr),c.hasOwnProperty("expression")&&(b.expression=c.expression),c.hasOwnProperty("submitWhenHidden")&&(b.submitWhenHidden=c.submitWhenHidden));this._validationTable.addRow(b)},this)},_removeFilter:function(a){this._validationTable.editRow(a,{expression:"",filter:null,submitWhenHidden:!1})},_showFilter:function(a){this._filterPage&&this._filterPage.destroy();this._filterPage=new v({nls:this.nls,_resourceInfo:this._resourceInfo,_url:this._url,_layerId:this._layerId,_validationTable:this._validationTable});
  this._filterPage.popup(a)},_editGroup:function(a){if(this._smartActionsTable){var b=this._smartActionsTable.getRows();f.some(b,function(c){if(this._smartActionsTable.getRowData(c).name===a)return this._fieldsPopUp.close(),this.onGroupEditingStart(),this._smartActionsTable._onActionsEdit(c),!0},this)}},onGroupEditingStart:function(){},removeFromGroup:function(a){}})});