// 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:{"widgets/Edit/setting/EditFields":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/text!./EditFields.html dijit/_TemplatedMixin jimu/BaseWidgetSetting jimu/dijit/SimpleTable jimu/dijit/Popup".split(" "),function(t,r,u,w,v,e,m,h){return t([e,v],{baseClass:"jimu-widget-edit-setting-fields",templateString:w,_layerInfo:null,postCreate:function(){this.inherited(arguments);this.nls=r.mixin(this.nls,window.jimuNls.common);this._initFieldsTable();this._setFiedsTabele(this._layerInfo.fieldInfos)},
popupEditPage:function(){var b=new h({titleLabel:this.nls.configureFields,width:700,maxHeight:600,autoHeight:!0,content:this,buttons:[{label:this.nls.ok,onClick:r.hitch(this,function(){this._resetFieldInfos();b.close()})},{label:this.nls.cancel,classNames:["jimu-btn-vacation"],onClick:r.hitch(this,function(){b.close()})}],onClose:r.hitch(this,function(){})})},_initFieldsTable:function(){this._fieldsTable=new m({fields:[{name:"visible",title:this.nls.display,type:"checkbox","class":"display",width:"15%"},
{name:"isEditable",title:this.nls.edit,type:"checkbox","class":"editable",width:"12%"},{name:"fieldName",title:this.nls.editpageName,type:"text",width:"26%"},{name:"label",title:this.nls.editpageAlias,type:"text",editable:!0,width:"34%"},{name:"actions",title:this.nls.actions,type:"actions",actions:["up","down"],"class":"actions",width:"13%"}],selectable:!1,style:{height:"300px",maxHeight:"300px"}});this._fieldsTable.placeAt(this.fieldsTable);this._fieldsTable.startup()},_setFiedsTabele:function(b){u.forEach(b,
function(g){this._fieldsTable.addRow({fieldName:g.fieldName,isEditable:g.isEditable,label:g.label,visible:g.visible})},this);setTimeout(r.hitch(this,function(){u.forEach(this._fieldsTable.fields,function(g){"visible"===g.name?g.onChange=r.hitch(this,this._onDisplayFieldChanged):"isEditable"===g.name&&(g.onChange=r.hitch(this,this._onIsEditableFieldChanged))},this)}),300)},_onDisplayFieldChanged:function(b){var g=this._fieldsTable.getRowData(b);!g.visible&&g.isEditable&&(g.isEditable=!1,this._fieldsTable.editRow(b,
g))},_onIsEditableFieldChanged:function(b){var g=this._fieldsTable.getRowData(b);g.isEditable&&!g.visible&&(g.visible=!0,this._fieldsTable.editRow(b,g))},_resetFieldInfos:function(){var b=[],g=this._fieldsTable.getData();u.forEach(g,function(p){b.push({fieldName:p.fieldName,label:p.label,isEditable:p.isEditable,visible:p.visible})});this._layerInfo.fieldInfos=b}})})},"widgets/Edit/utils":function(){define(["dojo/_base/lang","dojo/_base/array","jimu/utils"],function(t,r,u){function w(e,m){var h=null;
e&&e.fields&&r.some(e.fields,function(b){if(b.name.toLowerCase()===m.toLowerCase())return h=b,!0});return h}function v(e,m,h){var b=null;if(e&&e.attributes)for(var g in e.attributes)if(e.attributes.hasOwnProperty(g)&&"function"!==typeof e.attributes[g]&&g.toLowerCase()===m.toLowerCase()){b=h?e.attributes[g]=h:e.attributes[g];break}return b}return{getFieldInfosFromWebmap:function(e,m){var h=null;(e=m.getLayerInfoByTopLayerId(e))&&(e=e.getPopupInfo())&&e.fieldInfos&&(h=t.clone(e.fieldInfos));h&&r.forEach(h,
function(b){b.format&&b.format.dateFormat&&(b.format.dateFormat.toLowerCase&&0>b.format.dateFormat.toLowerCase().indexOf("time")?b.format.time=!1:b.format.time=!0)});return h},getEditCapabilities:function(e,m,h){var b={};h=e.getEditCapabilities(h);b.canCreate=h.canCreate;b.canDelete=h.canDelete;b.canUpdateGeometry=e.allowGeometryUpdates;m&&(b.canCreate=m.allowCreate&&b.canCreate,b.canDelete=m.allowDelete&&b.canDelete,b.canUpdateGeometry=!m.disableGeometryUpdate&&b.canUpdateGeometry);return b},getLocaleDateTime:function(e){return u.localizeDate(new Date(e),
{fullYear:!0,formatLength:"medium"})},getAttrByFieldKey:function(e,m){return v(e,m)},setAttrByFieldKey:function(e,m,h){return v(e,m,h)},ignoreCaseToGetFieldKey:function(e,m){var h=null;if(e=w(e,m))h=e.name;return h},ignoreCaseToGetFieldObject:function(e,m){return w(e,m)}}})},"widgets/Edit/setting/_build-generate_module":function(){define(["dojo/text!./Setting.html","dojo/text!./css/style.css","dojo/i18n!./nls/strings"],function(){})},"url:widgets/Edit/setting/EditFields.html":'\x3cdiv\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"fieldsTable"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/Edit/setting/Setting.html":'\x3cdiv style\x3d"width:100%;"\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"firstPageDiv"\x3e\r\n    \x3cdiv class\x3d"general-settings-title"\x3e${nls.generalSettings}\x3c/div\x3e\r\n    \x3ctable class\x3d"setting-table input-table" cellspacing\x3d"0"\x3e\r\n      \x3ctbody\x3e\r\n        \x3ctr\x3e\r\n            \x3ctd class\x3d"second"\x3e\r\n                \x3cdiv class\x3d"checkbox-wrap-div" style\x3d""\x3e\r\n                    \x3cdiv data-dojo-attach-point\x3d"useFilterEdit"\r\n                           data-dojo-type\x3d"jimu/dijit/CheckBox" /\x3e\r\n                \x3c/div\x3e\r\n            \x3c/td\x3e\r\n            \x3ctd class\x3d"first jimu-trailing-padding1"\x3e${nls.useFilterEdit}\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"second"\x3e\r\n            \x3cdiv class\x3d"checkbox-wrap-div" style\x3d""\x3e\r\n              \x3cdiv data-dojo-attach-point\x3d"toolbarVisible" \r\n              data-dojo-attach-event\x3d"change:_onToolbarSelected"\r\n              data-dojo-type\x3d"jimu/dijit/CheckBox"/\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"first jimu-trailing-padding1"\x3e${nls.toolbarVisible}\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr class\x3d"toolbar-options-tr" data-dojo-attach-point\x3d"toolbarOptionsTr"\x3e\r\n          \x3ctd class\x3d"second toolbar-options-td" data-dojo-attach-point\x3d"toolbarOptionsLabel"\x3e\x3c/td\x3e\r\n          \x3ctd class\x3d"second jimu-leading-padding1  toolbar-options-td" data-dojo-attach-point\x3d"toolbarOptionsTd"\x3e\r\n            \x3cdiv class\x3d"check-box-div toolbar-option" style\x3d"position: relative"\x3e\r\n              \x3cdiv class\x3d"toolbar-options-coverage" data-dojo-attach-point\x3d"toolbarOptionsCoverage"\x3e\x3c/div\x3e\r\n              \x3cdiv data-dojo-attach-point\x3d"mergeVisible" \r\n                data-dojo-type\x3d"jimu/dijit/CheckBox"\x3e \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cspan class\x3d"toolbar-option"\x3e${nls.mergeVisible}\x3c/span\x3e\r\n\r\n            \x3cdiv class\x3d"check-box-div toolbar-option"\x3e\r\n              \x3cdiv data-dojo-attach-point\x3d"cutVisible" \r\n                data-dojo-type\x3d"jimu/dijit/CheckBox"\x3e \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cspan class\x3d"toolbar-option" \x3e${nls.cutVisible}\x3c/span\x3e\r\n\r\n            \x3cdiv class\x3d"check-box-div toolbar-option"\x3e\r\n              \x3cdiv data-dojo-attach-point\x3d"reshapeVisible" \r\n                data-dojo-type\x3d"jimu/dijit/CheckBox"\x3e \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cspan class\x3d"toolbar-option" \x3e${nls.reshapeVisible}\x3c/span\x3e\r\n\r\n             \x3cdiv class\x3d"check-box-div toolbar-option"\x3e\r\n              \x3cdiv data-dojo-attach-point\x3d"enableUndoRedo" \r\n                data-dojo-type\x3d"jimu/dijit/CheckBox"\x3e \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cspan class\x3d"toolbar-option" \x3e${nls.enableUndoRedo}\x3c/span\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd\x3e\x3cdiv style\x3d"height: 40px;"\x3e\x3c/div\x3e\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"second"\x3e\r\n            \x3cdiv class\x3d"checkbox-wrap-div" style\x3d""\x3e\r\n              \x3cdiv data-dojo-attach-point\x3d"usingSaveButton" \r\n                data-dojo-type\x3d"jimu/dijit/CheckBox"\x3e \x3c/div\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"first jimu-trailing-padding1"\x3e${nls.usingSaveButton}\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"second"\x3e\r\n            \x3cdiv class\x3d"" style\x3d"checkbox-wrap-div"\x3e\r\n              \x3cdiv data-dojo-attach-point\x3d"autoApplyEditWhenGeometryIsMoved" \r\n                data-dojo-type\x3d"jimu/dijit/CheckBox"\x3e \x3c/div\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"first jimu-trailing-padding1"\x3e${nls.autoApplyEditWhenGeometryIsMoved}\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n      \x3c/tbody\x3e\r\n    \x3c/table\x3e\r\n    \x3ctable class\x3d"setting-table input-table" cellspacing\x3d"0"\x3e\r\n      \x3ctbody\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"first jimu-trailing-padding1"\x3e${nls.snappingTolerance}\x3c/td\x3e\r\n          \x3ctd class\x3d"second jimu-leading-padding1"\x3e\r\n            \x3cdiv class\x3d"" style\x3d"checkbox-wrap-div"\x3e\r\n              \x3cinput data-dojo-attach-point\x3d"snappingTolerance" \r\n              data-dojo-type\x3d"dijit/form/NumberSpinner"\r\n              data-dojo-props\x3d"smallDelta:5, constraints:{min:0,max:1000,places:0}"\r\n              name\x3d"snappingTolerance"\r\n              /\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"first jimu-trailing-padding1"\x3e${nls.popupTolerance}\x3c/td\x3e\r\n          \x3ctd class\x3d"second jimu-leading-padding1"\x3e\r\n            \x3cdiv class\x3d"checkbox-wrap-div" style\x3d""\x3e\r\n              \x3cinput data-dojo-attach-point\x3d"popupTolerance" \r\n              data-dojo-type\x3d"dijit/form/NumberSpinner"\r\n              data-dojo-props\x3d"smallDelta:5, constraints:{min:0,max:1000,places:0}"\r\n              name\x3d"popupTolerance"\r\n              /\x3e\r\n            \x3c/div\x3e\r\n          \x3c/td\x3e\r\n        \x3c/tr\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"first jimu-trailing-padding1"\x3e${nls.stickyMoveTolerance}\x3c/td\x3e\r\n          \x3ctd class\x3d"second jimu-leading-padding1"\x3e\r\n            \x3cdiv class\x3d"checkbox-wrap-div" style\x3d""\x3e\r\n              \x3cinput data-dojo-attach-point\x3d"stickyMoveTolerance" \r\n              data-dojo-type\x3d"dijit/form/NumberSpinner"\r\n              data-dojo-props\x3d"smallDelta:5, constraints:{min:0,max:2000,places:0}"\r\n              name\x3d"stickyMoveTolerance"\r\n              /\x3e\r\n            \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    \x3cdiv class\x3d"editalbe-layers-setting-title"\x3e${nls.editableLayersSetting}\x3c/div\x3e\r\n    \x3cdiv class\x3d"custom-setting-radio-part"\x3e\r\n      \x3cdiv class\x3d"custom-setting-radio"  data-dojo-attach-point\x3d"webmapRadioBoxDom"\x3e\r\n        \x3cinput data-dojo-attach-point\x3d"webmapRadio" data-dojo-type\x3d"dijit/form/RadioButton" name\x3d"layersSetting" id\x3d"webmap-radio" type\x3d"radio" class\x3d"jimu-radio-btn"/\x3e\r\n        \x3clabel data-dojo-attach-point\x3d"webmapLabel" for\x3d"webmap-radio"\x3e${nls.honorTheWebMapSetting}\x3clabel\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"custom-setting-radio"\x3e\r\n        \x3cinput data-dojo-attach-point\x3d"customRadio" data-dojo-type\x3d"dijit/form/RadioButton" name\x3d"layersSetting" id\x3d"custom-radio" type\x3d"radio" class\x3d"jimu-radio-btn"/\x3e\r\n        \x3clabel data-dojo-attach-point\x3d"customLabel" for\x3d"custom-radio"\x3e${nls.customSettings}\x3c/label\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"layers-settings-part" data-dojo-attach-point\x3d"layersSettingPart"\x3e\r\n      \x3cdiv class\x3d"layerInfos-table" data-dojo-attach-point\x3d"layerInfosTable"\x3e\x3c/div\x3e\r\n      \x3cdiv class\x3d"tableInfos-loading" data-dojo-attach-point\x3d"tableInfosLoading"\x3e\x3c/div\x3e\r\n      \x3cdiv class\x3d"tableInfos-table" data-dojo-attach-point\x3d"tableInfosTable"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:widgets/Edit/setting/css/style.css":'.jimu-widget-edit-setting{margin:0; padding:0; font-size:15px;}.jimu-widget-edit-setting .editable{width: 100px;}.jimu-widget-edit-setting .edit-fields{width: 100px;}.jimu-widget-edit-setting .update{width: 200px;}.jimu-widget-edit-setting .general-settings-title {font-size: 14px; font-family: "Avenir Heavy";}.jimu-widget-edit-setting .setting-table {margin-left: 20px;}.jimu-rtl .jimu-widget-edit-setting .setting-table {margin-right: 20px; margin-left: auto;}.jimu-widget-edit-setting .setting-table \x3e thead \x3e tr \x3e th,.jimu-widget-edit-setting .setting-table \x3e tbody \x3e tr \x3e td{}.jimu-rtl .jimu-widget-edit-setting .setting-table input{text-align: left;}.jimu-widget-edit-setting .input-table \x3e tbody \x3e tr \x3e .first{width:auto; min-width: 160px; text-align: left; line-height: 18px; padding: 10px 0 10px 0;}.jimu-rtl .jimu-widget-edit-setting .input-table \x3e tbody \x3e tr \x3e .first{text-align: right; padding: 10px 0 10px 10px;}.jimu-widget-edit-setting .input-table \x3e tbody \x3e tr \x3e .second{width: auto; padding-right: 10px;}.jimu-rtl .jimu-widget-edit-setting .input-table \x3e tbody \x3e tr \x3e .second{padding-left: 10px; padding-right: 0;}.jimu-widget-edit-setting .input-table \x3e tbody \x3e tr \x3e .second \x3e span{padding-left: 2px; padding-right: 30px; vertical-align: 2px;}.jimu-trl .jimu-widget-edit-setting .input-table \x3e tbody \x3e tr \x3e .second \x3e span{padding-left: 20px; padding-right: 5px;}.jimu-widget-edit-setting .input-table .checkbox-wrap-div{}.jimu-widget-edit-setting .input-table .check-box-div {margin-top: 2px;}.jimu-widget-edit-setting .input-table .toolbar-option {display: inline-block;}.jimu-widget-edit-setting .dijitArrowButtonContainer{width: 17px;}.jimu-widget-edit-setting .dijitSelect{height: 30px; width: 100%;}.jimu-widget-edit-setting .toolbar-options-tr {position: relative;}.jimu-widget-edit-setting .toolbar-options-tr.disable {opacity: 0.4;}.jimu-widget-edit-setting .toolbar-options-coverage{position: absolute; width: 600px; height: 40px; z-index: 1;}.jimu-widget-edit-setting .dijitTextBoxFocused{border-color: #406b9b !important; box-shadow: 0 0 0;}.jimu-widget-edit-setting .editalbe-layers-setting-title{font-size: 14px; font-family: "Avenir Heavy"; margin-top: 10px;}.jimu-widget-edit-setting .custom-setting-radio-part{margin-left: 20px;}.jimu-rtl .jimu-widget-edit-setting .custom-setting-radio-part{margin-right: 20px; margin-left: auto;}.jimu-widget-edit-setting .custom-setting-radio-part .custom-setting-radio{margin:10px 0 10px 0;}.jimu-widget-edit-setting .layers-settings-part{margin-left: 20px;}.jimu-widget-edit-setting .layers-settings-part.disable{display: none;}.jimu-widget-edit-setting .tableInfos-loading{top: 65px; position: relative;}.jimu-widget-edit-setting .tableInfos-table{display: none; margin-top: 30px; margin-bottom: 5px; position: relative;}',
"*now":function(t){t(['dojo/i18n!*preload*widgets/Edit/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/mouse dijit/_WidgetsInTemplateMixin jimu/BaseWidgetSetting jimu/dijit/SimpleTable jimu/LayerInfos/LayerInfos jimu/dijit/LoadingIndicator dojo/_base/lang dojo/_base/html dojo/on dojo/_base/array dojo/promise/all dijit/popup dijit/TooltipDialog jimu/utils ./EditFields ../utils dijit/form/NumberSpinner dijit/form/RadioButton".split(" "),function(t,r,u,w,v,e,m,h,b,g,p,B,A,C,D,E,z){return t([w,u],{baseClass:"jimu-widget-edit-setting",_jimuLayerInfos:null,_layersTable:null,
_tablesTable:null,_editableLayerInfos:null,_editableTableInfos:null,_tooltipTimeout:1E3,startup:function(){this.inherited(arguments);e.getInstance(this.map,this.map.itemInfo).then(h.hitch(this,function(a){this._jimuLayerInfos=a;this._init();this.setConfig()}))},_init:function(){this._initToolbar();this._initCustomSettingRadio();this._initLayersTable();this._initTablesTable()},_initToolbar:function(){this.useFilterEdit.setValue(this.config.editor.useFilterEdit);this.toolbarVisible.setValue(this.config.editor.toolbarVisible);
this.enableUndoRedo.setValue(this.config.editor.enableUndoRedo);this.mergeVisible.setValue(this.config.editor.toolbarOptions.mergeVisible);this.cutVisible.setValue(this.config.editor.toolbarOptions.cutVisible);this.reshapeVisible.setValue(this.config.editor.toolbarOptions.reshapeVisible);this.usingSaveButton.setValue(this.config.editor.usingSaveButton);this.autoApplyEditWhenGeometryIsMoved.setValue(this.config.editor.autoApplyEditWhenGeometryIsMoved);this.snappingTolerance.set("value",void 0===this.config.editor.snappingTolerance?
15:this.config.editor.snappingTolerance);this.popupTolerance.set("value",void 0===this.config.editor.popupTolerance?5:this.config.editor.popupTolerance);this.stickyMoveTolerance.set("value",void 0===this.config.editor.stickyMoveTolerance?0:this.config.editor.stickyMoveTolerance)},_initCustomSettingRadio:function(){this.config.editor.honorSettingOfWebmap?this.webmapRadio.set("checked",!0):this.config.editor.layerInfos&&0===this.config.editor.layerInfos.length&&this.config.editor.tableInfos&&0===this.config.editor.tableInfos.length?
this.webmapRadio.set("checked",!0):this.customRadio.set("checked",!0);this._controlCustomSettingRadio();this.own(g(this.webmapRadio,"click",h.hitch(this,this._onRadioClicke)));this.own(g(this.customRadio,"click",h.hitch(this,this._onRadioClicke)));this._initTooltipDialog()},_initTooltipDialog:function(){var a=b.create("div",{innerHTML:D.sanitizeHTML('\x3cdiv class\x3d"title"\x3e'+this.nls.honorTheWebMapSettingTip1+'\x3c/div\x3e\x3cdiv class\x3d"item new-selection-item"\x3e- '+this.nls.honorTheWebMapSettingTip2+
'\x3c/div\x3e\x3cdiv class\x3d"item add-selection-item"\x3e- '+this.nls.honorTheWebMapSettingTip3+'\x3c/div\x3e\x3cdiv class\x3d"item remove-selection-item"\x3e- '+this.nls.honorTheWebMapSettingTip4+"\x3c/div\x3e"),"class":"dialog-content"});this.tooltipDialog1=new C({content:a});b.addClass(this.tooltipDialog1.domNode,"jimu-multiple-layers-featureset-chooser-tooltipdialog");this.own(g(this.webmapRadioBoxDom,"mousemove",h.hitch(this,function(c){this._tooltipDialogClientX1=c.clientX})));this.own(g(this.webmapRadioBoxDom,
r.enter,h.hitch(this,function(){clearTimeout(this._tooltipDialogTimeoutId1);this._tooltipDialogTimeoutId1=-1;this._tooltipDialogTimeoutId1=setTimeout(h.hitch(this,function(){this.tooltipDialog1&&(A.open({parent:this.getParent(),popup:this.tooltipDialog1,around:this.webmapRadioBoxDom,position:["below"]}),0<=this._tooltipDialogClientX1&&(this.tooltipDialog1.domNode.parentNode.style.left=this._tooltipDialogClientX1+"px"))}),this._tooltipTimeout)})));this.own(g(this.webmapRadioBoxDom,r.leave,h.hitch(this,
function(){clearTimeout(this._tooltipDialogTimeoutId1);this._tooltipDialogTimeoutId1=-1;this._hideTooltipDialog(this.tooltipDialog1)})))},_hideTooltipDialog:function(a){a&&A.close(a)},_initLayersTable:function(){this._layersTable=new v({fields:[{name:"edit",title:this.nls.edit,type:"checkbox","class":"editable"},{name:"label",title:this.nls.label,type:"text"},{name:"allowCreateCheckBox",title:window.jimuNls.common.add,type:"checkbox","class":"update",width:"100px"},{name:"allowDeleteCheckBox",title:window.jimuNls.common.deleteText,
type:"checkbox","class":"update",width:"100px"},{name:"allowGeometryUpdateCheckBox",title:window.jimuNls.common.updateGeometry,type:"checkbox","class":"update",width:"160px"},{name:"actions",title:this.nls.fields,type:"actions","class":"edit-fields",actions:["edit"]}],selectable:!1});this._layersTable.placeAt(this.layerInfosTable);this._layersTable.startup();this.own(g(this._layersTable,"actions-edit",h.hitch(this,this._onEditFieldInfoClick,this._layersTable)))},_initTablesTable:function(){this._tablesTable=
new v({fields:[{name:"edit",title:this.nls.edit,type:"checkbox","class":"editable"},{name:"label",title:window.jimuNls.common.table,type:"text"},{name:"allowCreateCheckBox",title:window.jimuNls.common.add,type:"checkbox","class":"update",width:"100px"},{name:"allowDeleteCheckBox",title:window.jimuNls.common.deleteText,type:"checkbox","class":"update",width:"100px"},{name:"placeholder",title:"",type:"text","class":"update",width:"160px"},{name:"actions",title:this.nls.fields,type:"actions","class":"edit-fields",
actions:["edit"]}],selectable:!1});this._tablesTable.placeAt(this.tableInfosTable);this._tablesTable.startup();this.own(g(this._tablesTable,"actions-edit",h.hitch(this,this._onEditFieldInfoClick,this._tablesTable)))},setConfig:function(){this._editableLayerInfos=this._getEditableLayerInfos();this._setTable(this._editableLayerInfos,this._layersTable);var a=(new m({hidden:!1})).placeAt(this.tableInfosLoading);this._getEditableTableInfos().then(h.hitch(this,function(c){a.destroy();this._editableTableInfos=
c;0<this._editableTableInfos.length&&(this._setTable(c,this._tablesTable),b.setStyle(this.tableInfosTable,"display","block"))}))},_getEditableTableInfos:function(){var a=[],c=[],d=[],k=this._jimuLayerInfos.getTableInfoArray(),f=[];p.forEach(this._editableLayerInfos,function(l){(l=this._jimuLayerInfos._findTopLayerInfoById(l.featureLayer.id))&&d.push(l)},this);p.forEach(d.concat(k),function(l){a.push(l.getRelatedTableInfoArray())},this);return B(a).then(h.hitch(this,function(l){p.forEach(l,function(q){f=
f.concat(q)},this);p.forEach(k,function(q){var n=q.layerObject,x=q.getCapabilitiesOfWebMap(),y=p.some(f,function(F){return q.id===F.id},this);x=x&&-1===x.toLowerCase().indexOf("editing")?!1:!0;"Table"===n.type&&n.url&&n.isEditable&&n.isEditable()&&x&&y&&((y=this._getLayerInfoFromConfiguration(n))||(y=this._getDefaultLayerInfo(n)),c.push(y))},this);return c}))},_getEditableLayerInfos:function(){for(var a=[],c=this.map.graphicsLayerIds.length-1;0<=c;c--){var d=this.map.getLayer(this.map.graphicsLayerIds[c]);
if("Feature Layer"===d.type&&d.url&&d.isEditable&&d.isEditable()){var k=this._getLayerInfoFromConfiguration(d);k||(k=this._getDefaultLayerInfo(d));a.push(k)}}return a},_getLayerInfoFromConfiguration:function(a){var c=null,d=this.config.editor.layerInfos?this.config.editor.layerInfos:[];if((d=d.concat(this.config.editor.tableInfos?this.config.editor.tableInfos:[]))&&0<d.length){for(var k=0;k<d.length;k++)if(d[k].featureLayer&&d[k].featureLayer.id===a.id){c=d[k];break}c&&(c.fieldInfos=this._getSimpleFieldInfos(a,
c),c._editFlag=!0)}return c},_getDefaultLayerInfo:function(a){var c=this.config.editor.layerInfos&&this.config.editor.tableInfos?this.config.editor.layerInfos.concat(this.config.editor.tableInfos):null;return{featureLayer:{id:a.id},disableGeometryUpdate:!1,allowCreate:!0,allowDelete:!0,fieldInfos:this._getSimpleFieldInfos(a),_editFlag:c&&0===c.length?!0:!1}},_setTable:function(a,c){p.forEach(a,function(d){var k=this._jimuLayerInfos.getLayerOrTableInfoById(d.featureLayer.id),f=z.getEditCapabilities(k.layerObject);
c.addRow({label:k.title,edit:d._editFlag,allowCreateCheckBox:f.canCreate?d.allowCreate:null,allowDeleteCheckBox:f.canDelete?d.allowDelete:null,allowGeometryUpdateCheckBox:f.canUpdateGeometry?!d.disableGeometryUpdate:null}).tr._layerInfo=d},this)},_getDefaultSimpleFieldInfos:function(a){for(var c=[],d,k,f=0;f<a.fields.length;f++)d=a.fields[f].editable?!0:null,k="globalid"!==a.fields[f].name.toLowerCase()&&a.fields[f].name!==a.objectIdField||a.fields[f].editable?!0:!1,c.push({fieldName:a.fields[f].name,
label:a.fields[f].alias||a.fields[f].name,isEditable:d,visible:k||d?!0:!1});return c},_getWebmapSimpleFieldInfos:function(a){var c,d,k=[],f=z.getFieldInfosFromWebmap(a.id,this._jimuLayerInfos);f?(p.forEach(f,function(l){z.ignoreCaseToGetFieldKey(a,l.fieldName)&&(c=l.isEditable,d=l.visible,k.push({fieldName:l.fieldName,label:l.label,isEditable:c,visible:d||c?!0:!1}))}),0===k.length&&(k=null)):k=null;return k},_getSimpleFieldInfos:function(a,c){var d=[],k=this._getDefaultSimpleFieldInfos(a),f=this._getWebmapSimpleFieldInfos(a);
var l=f?f:k;c&&c.fieldInfos?(p.forEach(c.fieldInfos,function(q){if(void 0===q.visible)if(f)for(var n=0;n<f.length;n++)q.fieldName===f[n].fieldName&&(q.visible=f[n].visible||f[n].isEditable);else q.visible=!0;for(n=0;n<l.length;n++)if(q.fieldName===l[n].fieldName){d.push(q);l[n]._exit=!0;break}}),p.forEach(l,function(q){q._exit||d.push(q)})):d=l;return d},_onEditFieldInfoClick:function(a,c){(a=a.getRowData(c))&&a.edit&&(new E({nls:this.nls,_layerInfo:c._layerInfo})).popupEditPage()},_onToolbarSelected:function(){this.toolbarVisible.checked?
(b.removeClass(this.toolbarOptionsTr,"disable"),b.setStyle(this.toolbarOptionsCoverage,"display","none")):(b.addClass(this.toolbarOptionsTr,"disable"),b.setStyle(this.toolbarOptionsCoverage,"display","block"))},_resetToolbarConfig:function(){this.config.editor.useFilterEdit=this.useFilterEdit.checked;this.config.editor.toolbarVisible=this.toolbarVisible.checked;this.config.editor.enableUndoRedo=this.enableUndoRedo.checked;this.config.editor.toolbarOptions.mergeVisible=this.mergeVisible.checked;this.config.editor.toolbarOptions.cutVisible=
this.cutVisible.checked;this.config.editor.toolbarOptions.reshapeVisible=this.reshapeVisible.checked;this.config.editor.usingSaveButton=this.usingSaveButton.checked;this.config.editor.autoApplyEditWhenGeometryIsMoved=this.autoApplyEditWhenGeometryIsMoved.checked;this.config.editor.snappingTolerance=this.snappingTolerance.value;this.config.editor.popupTolerance=this.popupTolerance.value;this.config.editor.stickyMoveTolerance=this.stickyMoveTolerance.value},_resetCustomSettingConfig:function(){this.config.editor.honorSettingOfWebmap=
this.webmapRadio.get("checked")?!0:!1},_getCheckedLayerOrTableInfos:function(a,c){var d=[],k=c.getData();p.forEach(a,function(f,l){f._editFlag=k[l].edit;null!==k[l].allowCreateCheckBox&&(f.allowCreate=k[l].allowCreateCheckBox);null!==k[l].allowDeleteCheckBox&&(f.allowDelete=k[l].allowDeleteCheckBox);null!==k[l].allowGeometryUpdateCheckBox&&(f.disableGeometryUpdate=!k[l].allowGeometryUpdateCheckBox);f._editFlag&&(delete f._editFlag,d.push(f))});return d},getConfig:function(){this._resetToolbarConfig();
this._resetCustomSettingConfig();var a=this._getCheckedLayerOrTableInfos(this._editableLayerInfos,this._layersTable);0===a.length?delete this.config.editor.layerInfos:this.config.editor.layerInfos=a;a=this._getCheckedLayerOrTableInfos(this._editableTableInfos,this._tablesTable);0===a.length?delete this.config.editor.tableInfos:this.config.editor.tableInfos=a;return this.config},_controlCustomSettingRadio:function(){this.webmapRadio.get("checked")?b.addClass(this.layersSettingPart,"disable"):this.customRadio.get("checked")&&
b.removeClass(this.layersSettingPart,"disable")},_onRadioClicke:function(){this._controlCustomSettingRadio()}})});