// 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/Query/TaskSetting":function(){define("dojo/_base/declare dijit/_WidgetBase jimu/dijit/BindLabelPropsMixin dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/Evented dojo/text!./TaskSetting.html dojo/on dojo/keys dojo/Deferred dojo/_base/lang dojo/_base/html dojo/_base/array dojo/promise/all jimu/filterUtils jimu/dijit/FilterParameters ./utils jimu/utils ./SingleQueryLoader ./SpatialFilterByDrawing jimu/dijit/SpatialFilterByFeatures esri/tasks/query esri/dijit/PopupTemplate jimu/dijit/formSelect".split(" "),
function(D,E,P,G,l,m,w,t,L,k,c,a,f,h,y,J,I,q,F,u,C,z,M){return D([E,P,G,l,m],{baseClass:"query-task-setting",templateString:w,askForValues:!1,_defaultRelationship:"SPATIAL_REL_INTERSECTS",nls:null,map:null,currentAttrs:null,layerInfosObj:null,postMixInProperties:function(){this.inherited(arguments);this.isRenderIdForAttrs=!0;this.nls.back=window.jimuNls.common.back},postCreate:function(){this.inherited(arguments);this._initSelf()},run:function(){var p=this._getCleanClonedCurrentAttrs(this.currentAttrs);
p.query.relationship=this._getRestRelationship();var H=this.getWhere(),r=this.getGeometry();h([H,r]).then(c.hitch(this,function(B){this.deactivate();p.query.where=B[0];p.query.geometry=B[1];if("function"===typeof this.onApply)this.onApply(p)}),c.hitch(this,function(B){console.error(B)}))},hideTempLayers:function(){this.spatialFilterByDrawing&&this.spatialFilterByDrawing.hideTempLayers();this.spatialFilterByFeatures&&this.spatialFilterByFeatures.hideTempLayers()},showTempLayers:function(){this.spatialFilterByDrawing&&
this.spatialFilterByDrawing.showTempLayers();this.spatialFilterByFeatures&&this.spatialFilterByFeatures.showTempLayers()},_getDrawingInfoForLayerInfo:function(p,H){var r=p.drawingInfo;(H=H.renderer&&H.renderer.toJson())&&q.isUniqueReneredByLayerObject(H,q.getUniqueRendererByLayerDefinition(p))&&(r.renderer=c.clone(H));return r},_getCleanClonedCurrentAttrs:function(p){var H=F.getCleanCurrentAttrsTemplate(),r=null,B;for(B in p)if("queryTr"!==B&&"query"!==B&&"layerObject"!==B)if(r=p[B],"relationshipPopupTemplates"===
B){for(var b in r)r[b]=new M(r[b].toJson());H[B]=r}else"layerInfo"===B&&p.layerObject&&(r.drawingInfo=this._getDrawingInfoForLayerInfo(r,p.layerObject)),H[B]=c.clone(r);H.queryTr=p.queryTr;H.query.maxRecordCount=p.query.maxRecordCount;return H},onGetQueryResponse:function(){this.deactivate();this._tryResetSpatialFilterByDrawing();this._tryResetSpatialFilterByFeatures()},getWhere:function(){var p=new k,H=this._getWhereInfo();if(1===H.status){var r=this.currentAttrs.config.webMapLayerId;if(r){var B=
null;B=I.isTable(this.currentAttrs.layerInfo)?this.layerInfosObj.getTableInfoById(r):this.layerInfosObj.getLayerInfoById(r);r="";B&&(r=B.getFilter());B=H.where;r&&(B="("+r+") AND ("+H.where+")");p.resolve(B)}else p.resolve(H.where)}else p.reject("Can't get a valid sql");return p},_getWhereInfo:function(){var p={status:0,where:""};if(this.askForValues){var H=this.filterParams.getFilterExpr();H&&"string"===typeof H?(p.status=1,p.where=H):(p.status=-1,p.where=null)}else p.status=1,p.where=this.currentAttrs.config.filter.expr;
1!==p.status||p.where||(p.where="1\x3d1");return p},_updateExecuteButtonStatus:function(){var p=this._isValidWhereToExecute()&&this._isValidGeometryToExecute()&&this._isValidLayerNameToExecute();p?a.removeClass(this.btnExecute,"disabled"):a.addClass(this.btnExecute,"disabled");return p},_isValidWhereToExecute:function(){return 0<this._getWhereInfo().status},_isValidLayerNameToExecute:function(){return this.layerNameTextBox.get("value")},_isValidGeometryToExecute:function(){var p=this.spatialTypeSelect.get("value");
if("currentMapExtent"!==p){if("drawing"===p)return!!this.spatialFilterByDrawing.getGeometryInfo().geometry;if("useFeatures"===p)return this.spatialFilterByFeatures.isValidSearchDistance()}return!0},getGeometry:function(){var p=new k,H=this.spatialTypeSelect.get("value");"currentMapExtent"===H?p.resolve(this.map.extent):"drawing"===H?(H=this.spatialFilterByDrawing.getGeometryInfo(),0>H.status?p.reject("Invalid search distance"):(0===H.status&&console.log("User doesn't draw anything"),p.resolve(H.geometry))):
"useFeatures"===H?this.spatialFilterByFeatures.getGeometryInfo().then(c.hitch(this,function(r){-2===r.status?p.reject("Invalid search distance"):(-1===r.status?console.log("User doesn't select a layer"):0===r.status&&console.log("User doesn't select any features"),p.resolve(r.geometry))}),c.hitch(this,function(r){p.reject(r)})):p.resolve(null);return p},deactivate:function(){this.spatialFilterByDrawing&&this.spatialFilterByDrawing.deactivate();this.spatialFilterByFeatures&&this.spatialFilterByFeatures.deactivate()},
clearAllGraphics:function(){this.spatialFilterByDrawing&&this.spatialFilterByDrawing.clearAllGraphics();this.spatialFilterByFeatures&&this.spatialFilterByFeatures.clearAllGraphics()},canAutoRunning:function(){return this._canAttributeFilterAutoRunning()&&this._canSpatialFilterAutoRunning()},_canAttributeFilterAutoRunning:function(){return 0<this._getWhereInfo().status&&!this.askForValues},_canSpatialFilterAutoRunning:function(){var p=this.spatialTypeSelect.getOptions()||[];return 0===p.length?!0:
1===p.length?(p=this.spatialTypeSelect.get("value"),"drawing"!==p&&"useFeatures"!==p):!1},_initSelf:function(){var p=this.currentAttrs.config,H=this.currentAttrs.layerInfo,r=this.currentAttrs.layerObject||H,B=p.name||"";B=q.sanitizeHTML(B);this.taskNameDiv.innerHTML=B;this.taskNameDiv.title=this.taskNameDiv.innerHTML;p.customResultName?this._showLayerNameContainer():this._hideLayerNameContainer();if(this.showFilterLabel){var b=this.criteiraLabel||"";b=q.sanitizeHTML(b);this.criteiraLabelDiv.innerHTML=
b;this.criteiraLabelDiv.title=this.criteiraLabelDiv.innerHTML;b=this.spatialFilterLabel||"";b=q.sanitizeHTML(b);this.spatialFilterLabelDiv.innerHTML=b;this.spatialFilterLabelDiv.title=this.spatialFilterLabelDiv.innerHTML;this._showCriteiraLabelDiv();this._showSpatialFilterLabelDiv()}else this.criteiraLabelDiv.innerHTML="",this.criteiraLabelDiv.title="",this.spatialFilterLabelDiv.innerHTML="",this.spatialFilterLabelDiv.title="",this._hideCriteiraLabelDiv(),this._hideSpatialFilterLabelDiv();this.filterParams=
new J;this.filterParams.placeAt(this.sqlDiv,"before");var n={ifDisplaySQL:!0};this.own(t(this.filterParams,"change",c.hitch(this,this._updateExecuteButtonStatus)));this.own(t(this.filterParams,"enter",c.hitch(this,this._onBtnApplyClicked)));b=c.clone(p.filter);b.wId="widgets_Query_Widget"+this.wId+"_"+this.id;this.filterParams.build(p.url,r,b,p.webMapLayerId,this.id);r=new y;b=this.currentAttrs.config.filter;this.askForValues=r.isAskForValues(b);var v=!0;r=!1;if(this.askForValues){v=!0;b.displaySQL?
this.sqlDiv.innerHTML=b.displaySQL:b.expr&&(this.sqlDiv.innerHTML=b.expr);if(b=this.filterParams.getFilterExpr(n))this.sqlDiv.innerHTML=b;this.own(t(this.filterParams,"change",c.hitch(this,function(){this.sqlDiv.innerHTML="";var d=this.filterParams.getFilterExpr(n);d&&this.currentAttrs.config.showSQL&&(this.sqlDiv.innerHTML=d)})))}else this.currentAttrs.config.showSQL?v="1\x3d1"!==b.expr:(v=!1,r="1\x3d1"===b.expr),this.sqlDiv.innerHTML=b.displaySQL?b.displaySQL:b.expr;this.currentAttrs.config.showSQL?
a.removeClass(this.sqlDiv,"not-visible"):(this.sqlDiv.innerHTML="",a.addClass(this.sqlDiv,"not-visible"));v?(a.removeClass(this.attributesSectionDiv,"not-visible"),(this.showFilterLabel&&""!==this.criteiraLabelDiv.innerHTML||this.currentAttrs.config.showSQL)&&a.setAttr(this.attributesSectionDiv,"tabindex","0")):a.addClass(this.attributesSectionDiv,"not-visible");b=this.currentAttrs.config.spatialFilter;v=null;b||(b={});I.isTable(H)&&(b={});b.currentMapExtent&&(v={value:"currentMapExtent",label:this.nls.useCurrentExtentTip},
this.spatialTypeSelect.addOption(v),b.currentMapExtent["default"]&&this.spatialTypeSelect.set("value",v.value));b.drawing&&(v={value:"drawing",label:this.nls.useDrawGraphicTip},this.spatialTypeSelect.addOption(v),b.drawing["default"]&&this.spatialTypeSelect.set("value",v.value),v=b.drawing.buffer,this.spatialFilterByDrawing=new u({drawBoxOption:{map:this.map,geoTypes:b.drawing.geometryTypes},nls:this.nls,enableBuffer:!!v,distance:c.getObject("defaultDistance",!1,v)||0,unit:c.getObject("defaultUnit",
!1,v)||""}),this.own(t(this.spatialFilterByDrawing,"change",c.hitch(this,this._updateExecuteButtonStatus))),this.spatialFilterByDrawing.placeAt(this.drawingSection));if(b.useFeatures){v={value:"useFeatures",label:this.nls.useFeaturesTip};this.spatialTypeSelect.addOption(v);b.useFeatures["default"]&&this.spatialTypeSelect.set("value",v.value);v=b.useFeatures.buffer;var K=[];p.webMapLayerId&&K.push(p.webMapLayerId);this.spatialFilterByFeatures=new C({map:this.map,nls:this.nls,enableBuffer:!!v,distance:c.getObject("defaultDistance",
!1,v)||0,unit:c.getObject("defaultUnit",!1,v)||"",showLoading:!1,ignoredFeaturelayerIds:K});this.spatialFilterByFeatures.tipNode&&a.setStyle(this.spatialFilterByFeatures.tipNode,"display","block");this.spatialFilterByFeatures.placeAt(this.featuresSection);this.own(t(this.spatialFilterByFeatures,"loading",c.hitch(this,function(){this.domNode&&this.shelter.show()})));this.own(t(this.spatialFilterByFeatures,"unloading",c.hitch(this,function(){this.domNode&&this.shelter.hide()})));this.own(t(this.spatialFilterByFeatures,
"search-distance-change",c.hitch(this,this._updateExecuteButtonStatus)));(p=b.useFeatures.relationships)&&0<p.length?f.forEach(p,c.hitch(this,function(d){this.relationshipSelect.addOption({value:d.relationship,label:d.label})})):this.relationshipSelect.addOption({value:this._defaultRelationship,label:this._defaultRelationship})}b.fullLayerExtent&&(v={value:"fullLayerExtent",label:this.nls.noSpatialLimitTip},this.spatialTypeSelect.addOption(v),b.fullLayerExtent["default"]&&this.spatialTypeSelect.set("value",
v.value));p=!0;b=this.spatialTypeSelect.getOptions()||[];0===b.length?(p=!1,this.spatialFilterTip.innerHTML=this.nls.noSpatialLimitTip):1===b.length?(p="fullLayerExtent"!==b[0].value,this.spatialFilterTip.innerHTML=b[0].label,a.addClass(this.spatialTypeSelect.domNode,"not-visible"),a.setAttr(this.spatialSectionDiv,"tabindex","0")):p=!0;I.isTable(H)&&(p=!1);p?a.removeClass(this.spatialSectionDiv,"not-visible"):a.addClass(this.spatialSectionDiv,"not-visible");this._onSpatialTypeSelectChanged();r&&!p&&
a.removeClass(this.noFilterTip,"not-visible");H=this._getBestQueryName(B);this.layerNameTextBox.set("value",H)},getQueryResultName:function(){return this.layerNameTextBox.get("value")},_getConstantRelationship:function(){var p=this._defaultRelationship;"useFeatures"===this.spatialTypeSelect.get("value")&&(p=this.relationshipSelect.get("value"));return p},_getRestRelationship:function(){var p=this._getConstantRelationship();return z[p]},_onSpatialTypeSelectChanged:function(){var p=this.spatialTypeSelect.get("value");
"drawing"===p?a.setStyle(this.drawingSection,"display","block"):(a.setStyle(this.drawingSection,"display","none"),this._tryResetSpatialFilterByDrawing());"useFeatures"===p?a.setStyle(this.featuresSection,"display","block"):(a.setStyle(this.featuresSection,"display","none"),this._tryResetSpatialFilterByFeatures());this.spatialTypeSelect.domNode.title="";p&&(p=this.spatialTypeSelect.getOptions(p))&&(this.spatialTypeSelect.domNode.title=p.label);this._updateExecuteButtonStatus()},_tryResetSpatialFilterByDrawing:function(){this.spatialFilterByDrawing&&
this.spatialFilterByDrawing.reset()},_tryResetSpatialFilterByFeatures:function(){this.spatialFilterByFeatures&&this.spatialFilterByFeatures.reset()},_onBtnParamsBackClicked:function(){this._tryResetSpatialFilterByDrawing();this._tryResetSpatialFilterByFeatures();if("function"===typeof this.onBack)this.onBack()},_onBtnParamsBackKeydown:function(p){p.keyCode!==L.ENTER&&p.keyCode!==L.SPACE||this._onBtnParamsBackClicked()},_getBestQueryName:function(p){for(var H=p=p?p+(" _"+this.nls.queryResult):p+this.nls.queryResult,
r=f.map(this.map.graphicsLayerIds,c.hitch(this,function(b){return this.map.getLayer(b).name})),B=2;0<=f.indexOf(r,H);)H=p+"_"+B,B++;return H},_onLayerNameTextChanged:function(){this._updateExecuteButtonStatus()},_onBtnApplyClicked:function(){this._updateExecuteButtonStatus()&&this.run()},_onBtnApplyKeydown:function(p){p.keyCode!==L.ENTER&&p.keyCode!==L.SPACE||this._onBtnApplyClicked()},_showLayerNameContainer:function(){a.setStyle(this.layerNameContainer,"display","block")},_hideLayerNameContainer:function(){a.setStyle(this.layerNameContainer,
"display","none")},_showCriteiraLabelDiv:function(){a.setStyle(this.criteiraLabelDiv,"display","block")},_hideCriteiraLabelDiv:function(){a.setStyle(this.criteiraLabelDiv,"display","none")},_showSpatialFilterLabelDiv:function(){a.setStyle(this.spatialFilterLabelDiv,"display","block")},_hideSpatialFilterLabelDiv:function(){a.setStyle(this.spatialFilterLabelDiv,"display","none")}})})},"widgets/Query/utils":function(){define("dojo/_base/lang dojo/_base/array dojo/_base/Deferred jimu/utils jimu/portalUrlUtils jimu/LayerInfos/LayerInfos esri/request esri/kernel esri/symbols/PictureMarkerSymbol esri/symbols/jsonUtils".split(" "),
function(D,E,P,G,l,m,w,t,L,k){return{getDefaultPopupInfo:function(c,a,f){var h={title:"",fieldInfos:[],description:null,showAttachments:!1,mediaInfos:[]};f=!!f;if(c.displayField){var y=this._getRealFieldName(c.displayField,c);h.title="{"+y+"}"}else if(y=G.getObjectIdField(c))h.title="{"+y+"}";h.showAttachments=!!c.hasAttachments;y=c=c.fields;a||(y=E.filter(c,D.hitch(this,function(J){return"esriFieldTypeGeometry"!==J.type})));a=E.map(y,D.hitch(this,function(J){J=G.getDefaultPortalFieldInfo(J);J.visible=
f;return J}));h.fieldInfos=a;return h},_getRealFieldName:function(c,a){c=c.toUpperCase();if(a.fields&&0<a.fields.length)for(var f=0;f<a.fields.length;f++)if(a.fields[f].name.toUpperCase()===c)return a.fields[f].name;return""},getPortalFieldInfosWithoutShape:function(c,a){return E.filter(a,D.hitch(this,function(f){return(f=G.getFieldInfoByFieldName(c.fields,f.fieldName))?"esriFieldTypeGeometry"!==f.type:!0}))},getPopupInfoByAttributes:function(c,a){var f=this.getDefaultPopupInfo(c,!1),h=[],y={},J;
for(J in a){h.push(J);var I=G.getFieldInfoByFieldName(c.fields,J).type;if("esriFieldTypeSingle"===I||"esriFieldTypeDouble"===I)I=a[J],null!==I&&void 0!==I&&(I=parseFloat(I),isNaN(I)||(I=I.toString().split("."),2===I.length&&(y[J]=I[1].length)))}f.fieldInfos=E.filter(f.fieldInfos,D.hitch(this,function(q){var F=q.fieldName;y.hasOwnProperty(F)&&(q.format.places=y[F]);return h.indexOf(F)}));return f},upgradePopupToPopupInfo:function(c,a){var f=this.getDefaultPopupInfo(c,!1,!1);f.title=a.title||"";f.title=
f.title.replace("${","{");if(a.fields){var h={};E.forEach(a.fields,D.hitch(this,function(y){h[y.name]=y}));E.forEach(f.fieldInfos,D.hitch(this,function(y){var J=y.fieldName,I=h[J];I&&(y.label=I.alias||y.label,y.visible=!0,"image"===I.specialType&&(J="{"+J+"}",f.mediaInfos.push({title:"",type:"image",caption:y.label,value:{sourceURL:J,linkURL:J}})))}))}return f},isImageServiceLayer:function(c){return c.url&&-1<c.url.indexOf("/ImageServer")},isTable:function(c){return"Table"===c.type},getConfigWithValidDataSource:function(c){c=
D.clone(c);var a=m.getInstanceSync();c.queries=E.filter(c.queries,D.hitch(this,function(f){return(f=f.webMapLayerId)?a.getLayerInfoById(f)?!0:!!a.getTableInfoById(f):!0}));return c},removePopupInfoUnsupportFields:function(c,a){var f=E.map(c.fields,D.hitch(this,function(h){return h.name}));a.fieldInfos&&0<a.fieldInfos.length&&(a.fieldInfos=E.filter(a.fieldInfos,D.hitch(this,function(h){return 0<=f.indexOf(h.fieldName)})))},overridePopupTemplateMethodGetAttachments:function(c,a,f){c.getAttachments=
function(h){var y=new P;try{var J=h.attributes[f],I=a+"/"+J+"/attachments";h={url:I,content:{f:"json"},callbackParamName:"callback"};var q="",F=t.id.findCredential(a);F&&F.token&&(q="?token\x3d"+F.token);w(h).then(function(u){u=u.attachmentInfos;E.forEach(u,function(C){C.url=I+"/"+C.id+q;C.objectId=J});y.resolve(u)},function(u){y.reject(u)})}catch(u){console.error(u)}return y}},isServiceSupportsOrderBy:function(c){var a=!1;c.advancedQueryCapabilities&&c.advancedQueryCapabilities.supportsOrderBy&&
(a=!0);return a},isServiceSupportsPagination:function(c){var a=!1;c.advancedQueryCapabilities&&c.advancedQueryCapabilities.supportsPagination&&(a=!0);return a},isSupportObjectIds:function(c){var a=0,f=G.getObjectIdField(c);c.currentVersion&&(a=parseFloat(c.currentVersion));return!!f&&(10<=a||c.hasOwnProperty("typeIdField"))},getQueryType:function(c){var a=-1;return a=this.isServiceSupportsOrderBy(c)&&this.isServiceSupportsPagination(c)?1:this.isSupportObjectIds(c)?2:3},getWebMapPopupInfoByUrl:function(c,
a){var f=null;a=a.replace(/\/*$/g,"");var h=l.removeProtocol(a);E.some(c.operationalLayers,D.hitch(this,function(y){if(y&&y.url){var J=l.removeProtocol(y.url.replace(/\/*$/g,""));if(y.popupInfo){if(J===h)return f=y.popupInfo,!0}else if(y.layers&&0<y.layers.length)return E.some(y.layers,D.hitch(this,function(I){return J+"/"+I.id===h?(f=y.popupInfo,!0):!1}))}return!1}));return f},getPopupInfoForRelatedLayer:function(c,a,f){(c=this.getWebMapPopupInfoByUrl(c,a))||(c=this.getDefaultPopupInfo(f,!1,!0));
!c.title&&(f=G.getObjectIdField(f))&&(c.title="{"+f+"}");return c},dynamicUpdateConfigIcon:function(c,a){a=window.location.protocol+"//"+window.location.hostname+a;c.icon&&"object"===typeof c.icon?c.icon=k.fromJson(c.icon):"string"===typeof c.icon&&(a=new L({yoffset:16,type:"picturemarkersymbol",url:c.icon?c.icon:a,width:24,height:24,size:16,xoffset:0}),c.icon=a)},tryGetLayerObject:function(c){var a=new P;if(!c)return a.resolve(),a;c=this._tryGetLayerInfo(c);if(!c)return console.error("Invalid data source"),
a.resolve(),a;c.getLayerObject().then(function(f){a.resolve(f)}.bind(this),function(f){a.reject(f)});return a},_tryGetLayerInfo:function(c){var a=m.getInstanceSync(),f=a.getLayerInfoById(c);f||(f=a.getTableInfoById(c));return f}}})},"widgets/Query/SingleQueryLoader":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/Deferred jimu/utils esri/tasks/query esri/tasks/QueryTask esri/layers/FeatureLayer".split(" "),function(D,E,P,G,l,m,w,t){function L(){return{queryTr:null,config:null,
layerInfo:null,relationshipLayerInfos:null,relationshipPopupTemplates:null,queryType:-1,query:{maxRecordCount:1E3,resultLayer:null,where:"",geometry:null,relationship:null,nextIndex:0,foundedNum:0,allCount:0,objectIds:[]}}}D=D(null,{tempResultLayer:null,map:null,currentAttrs:null,constructor:function(k,c){this.map=k;this.currentAttrs=c;0<this.currentAttrs.layerInfo.maxRecordCount&&(this.currentAttrs.query.maxRecordCount=this.currentAttrs.layerInfo.maxRecordCount)},resetCurrentAttrs:function(){this.currentAttrs=
L()},getCurrentAttrs:function(){return this.currentAttrs},executeQueryForFirstTime:function(){var k=null;k=this.currentAttrs.query.where;var c=this.currentAttrs.query.geometry;return k=1===this.currentAttrs.queryType?this.doQuery_SupportOrderByAndPagination(k,c):2===this.currentAttrs.queryType?this.doQuery_SupportObjectIds(k,c):this.doQuery_NotSupportObjectIds(k,c)},executeQueryWhenScrollToBottom:function(){var k=null;1===this.currentAttrs.queryType?k=this.onResultsScroll_SupportOrderByAndPagination():
2===this.currentAttrs.queryType&&(k=this.onResultsScroll_SupportObjectIds());return k},_isServiceSupportsOrderBy:function(k){var c=!1;k.advancedQueryCapabilities&&k.advancedQueryCapabilities.supportsOrderBy&&(c=!0);return c},_isServiceSupportsPagination:function(k){var c=!1;k.advancedQueryCapabilities&&k.advancedQueryCapabilities.supportsPagination&&(c=!0);return c},_tryLocaleNumber:function(k){var c=l.localizeNumber(k);if(null===c||void 0===c)c=k;return c},_tryLocaleDate:function(k){var c=l.localizeDate(k);
c||(c=k.toLocaleDateString());return c},_getLayerIndexByLayerUrl:function(k){var c=k.lastIndexOf("/");k=k.slice(c+1,k.length);return parseInt(k,10)},_getServiceUrlByLayerUrl:function(k){var c=k.lastIndexOf("/");return k.slice(0,c)},_isSupportObjectIds:function(k){var c=0;k.currentVersion&&(c=parseFloat(k.currentVersion));return 10<=c||k.hasOwnProperty("typeIdField")},_isImageServiceLayer:function(k){return-1<k.indexOf("/ImageServer")},_isTable:function(k){return"Table"===k.type},_getBestQueryName:function(k){for(var c=
k=k?k+(" _"+this.nls.queryResult):k+this.nls.queryResult,a=P.map(this.map.graphicsLayerIds,E.hitch(this,function(h){return this.map.getLayer(h).name})),f=2;0<=P.indexOf(a,c);)c=k+"_"+f,f++;return c},getObjectIdsForAllRelatedRecordsAction:function(){var k=new G;if(this.currentAttrs.query.objectIds&&0<this.currentAttrs.query.objectIds.length)k.resolve(this.currentAttrs.query.objectIds);else if(1===this.currentAttrs.queryType)k=this._queryIds(this.currentAttrs.query.where,this.currentAttrs.query.geometry,
this.currentAttrs.query.relationship);else if(3===this.currentAttrs.queryType){var c=this.currentAttrs.config.objectIdField,a=P.map(this.currentAttrs.query.resultLayer.graphics,E.hitch(this,function(f){return parseInt(f.attributes[c],10)}));k.resolve(a)}return k},doQuery_SupportOrderByAndPagination:function(k,c){var a=new G,f=E.hitch(this,function(y){console.error(y);a.reject(y)}),h=this.currentAttrs.query.relationship;this._queryCount(k,c,h).then(E.hitch(this,function(y){this.currentAttrs.query.allCount=
y;if(0===y)a.resolve([]);else{this.currentAttrs.query.nextIndex=0;this.currentAttrs.query.foundedNum=0;var J=this.currentAttrs.query.maxRecordCount;this._queryWithPaginationAndOrder(k,c,0,J,h).then(E.hitch(this,function(I){I=I.features;this.currentAttrs.query.nextIndex+=J;this.currentAttrs.query.foundedNum+=I.length;a.resolve(I)}),f)}}),f);return a},onResultsScroll_SupportOrderByAndPagination:function(){var k=new G,c=this.currentAttrs.query.nextIndex;if(this.currentAttrs.query.foundedNum>=this.currentAttrs.query.allCount)return k.resolve([]),
k;var a=E.hitch(this,function(h){console.error(h);k.reject(h)}),f=this.currentAttrs.query.maxRecordCount;this._queryWithPaginationAndOrder(this.currentAttrs.query.where,this.currentAttrs.query.geometry,c,f,this.currentAttrs.query.relationship).then(E.hitch(this,function(h){h=h.features;this.currentAttrs.query.nextIndex+=f;this.currentAttrs.query.foundedNum+=h.length;k.resolve(h)}),a);return k},doQuery_SupportObjectIds:function(k,c){var a=new G,f=E.hitch(this,function(y){console.error(y);a.reject(y)}),
h=this.currentAttrs.query.relationship;this._queryIds(k,c,h).then(E.hitch(this,function(y){if(y&&0<y.length){var J=this.currentAttrs.query.allCount=y.length;this.currentAttrs.query.objectIds=y;this.currentAttrs.query.nextIndex=0;this.currentAttrs.query.foundedNum=0;var I=this.currentAttrs.query.maxRecordCount,q=[];q=J>I?y.slice(0,I):y;this._queryByObjectIds(q,!0,h).then(E.hitch(this,function(F){F=F.features;this.currentAttrs.query.nextIndex+=q.length;this.currentAttrs.query.foundedNum+=F.length;a.resolve(F)}),
E.hitch(this,function(F){f(F)}))}else this.currentAttrs.query.allCount=0,a.resolve([])}),f);return a},onResultsScroll_SupportObjectIds:function(){var k=new G,c=this.currentAttrs.query.objectIds,a=this.currentAttrs.query.nextIndex;if(this.currentAttrs.query.foundedNum>=this.currentAttrs.query.allCount)k.resolve([]);else{var f=c.slice(a,a+Math.min(c.length-a,this.currentAttrs.query.maxRecordCount));if(0===f.length)k.resolve([]);else return this._queryByObjectIds(f,!0,this.currentAttrs.query.relationship).then(E.hitch(this,
function(h){h=h.features;this.currentAttrs.query.nextIndex+=f.length;this.currentAttrs.query.foundedNum+=h.length;k.resolve(h)}),E.hitch(this,function(h){k.reject(h)})),k}},doQuery_NotSupportObjectIds:function(k,c){var a=new G;this._query(k,c,!0,this.currentAttrs.query.relationship).then(E.hitch(this,function(f){f=f.features;this.currentAttrs.query.allCount=f.length;a.resolve(f)}),E.hitch(this,function(f){console.error(f);a.reject(f)}));return a},getOutputFields:function(){var k=[];P.forEach(this.currentAttrs.layerInfo.fields,
E.hitch(this,function(c){c&&c.name&&"esriFieldTypeGeometry"!==c.type&&k.push(c.name)}));return k},_getObjectIdField:function(){return this.currentAttrs.config.objectIdField},_getRequiredFieldNames:function(){var k=E.clone(this.currentAttrs.layerInfo);return(new t({layerDefinition:k,featureSet:null})).getOutFields()},_getPopupInfoFieldNames:function(){var k=[],c=[],a=P.filter(this.currentAttrs.layerInfo.fields,E.hitch(this,function(h){return"esriFieldTypeGeometry"!==h.type})),f=this.currentAttrs.config.popupInfo;
c=c.concat(this._getPlaceholderFieldNames(a,f.title));f.description?c=c.concat(this._getPlaceholderFieldNames(a,f.description)):f.fieldInfos&&0<f.fieldInfos.length&&P.forEach(f.fieldInfos,E.hitch(this,function(h){h.visible&&c.push(h.fieldName)}));f.mediaInfos&&0<f.mediaInfos.length&&P.forEach(f.mediaInfos,E.hitch(this,function(h){c=c.concat(this._getPlaceholderFieldNames(a,h.title));c=c.concat(this._getPlaceholderFieldNames(a,h.caption));if(h=h.value){var y=h.fields;y&&0<y.length&&P.forEach(y,E.hitch(this,
function(J){c.push(J)}));h.normalizeField&&c.push(h.normalizeField);h.tooltipField&&c.push(h.tooltipField);h.sourceURL&&(c=c.concat(this._getPlaceholderFieldNames(a,h.sourceURL)));h.linkURL&&(c=c.concat(this._getPlaceholderFieldNames(a,h.linkURL)))}}));P.forEach(c,E.hitch(this,function(h){0>k.indexOf(h)&&k.push(h)}));return k},_getPlaceholderFieldNames:function(k,c){var a=[];if(c){var f=[];P.forEach(k,E.hitch(this,function(h){h=h.name;0<=c.indexOf("{"+h+"}")&&f.push(h)}));P.forEach(f,E.hitch(this,
function(h){0>a.indexOf(h)&&a.push(h)}))}return a},_query:function(k,c,a,f){var h=new m;h.where=k;c&&(h.geometry=c);h.outSpatialReference=this.map.spatialReference;h.returnGeometry=!!a;h.spatialRelationship=f;h.outFields=this.getOutputFields();return(new w(this.currentAttrs.config.url)).execute(h)},_queryIds:function(k,c,a){var f=new m;f.where=k;c&&(f.geometry=c);f.returnGeometry=!1;f.spatialRelationship=a;f.outSpatialReference=this.map.spatialReference;return(new w(this.currentAttrs.config.url)).executeForIds(f)},
_queryByObjectIds:function(k,c,a){var f=new G,h=new m;h.returnGeometry=!!c;h.outSpatialReference=this.map.spatialReference;h.outFields=this.getOutputFields();h.objectIds=k;h.spatialRelationship=a;(new w(this.currentAttrs.config.url)).execute(h).then(E.hitch(this,function(y){f.resolve(y)}),E.hitch(this,function(y){if(400===y.code){var J=this._getObjectIdField(),I="",q=k.length;P.forEach(k,E.hitch(this,function(F,u){I+=J+" \x3d "+F;u!==q-1&&(I+=" OR ")}));this._query(I,null,c,a).then(E.hitch(this,function(F){f.resolve(F)}),
E.hitch(this,function(F){f.reject(F)}))}else f.reject(y)}));return f},_queryCount:function(k,c,a){var f=new m;f.where=k;c&&(f.geometry=c);f.returnGeometry=!1;f.outSpatialReference=this.map.spatialReference;f.spatialRelationship=a;return(new w(this.currentAttrs.config.url)).executeForCount(f)},_queryWithPaginationAndOrder:function(k,c,a,f,h){var y=new m;y.where=k;c&&(y.geometry=c);y.outSpatialReference=this.map.spatialReference;y.returnGeometry=!0;y.spatialRelationship=h;y.outFields=this.getOutputFields();
y.start=a;y.num=f;(k=this.currentAttrs.config.orderByFields)&&0<k.length&&(y.orderByFields=k,k=P.map(k,E.hitch(this,function(J){return J.split(" ")[0]})),P.forEach(k,E.hitch(this,function(J){0>y.outFields.indexOf(J)&&y.outFields.push(J)})));return(new w(this.currentAttrs.config.url)).execute(y)}});D.getCleanCurrentAttrsTemplate=L;return D})},"widgets/Query/SpatialFilterByDrawing":function(){define("dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/on dojo/Evented dojo/_base/html dojo/_base/lang jimu/symbolUtils jimu/dijit/DrawBox jimu/dijit/SearchDistance esri/graphic esri/symbols/jsonUtils esri/layers/GraphicsLayer esri/renderers/SimpleRenderer esri/geometry/geometryEngine".split(" "),
function(D,E,P,G,l,m,w,t,L,k,c,a,f,h,y,J){return D([E,P,G,m],{baseClass:"jimu-query-spatial-filter-drawing",templateString:'\x3cdiv\x3e\x3cdiv data-dojo-attach-point\x3d"drawBoxDiv"\x3e\x3c/div\x3e\x3cdiv style\x3d"margin-top: 15px;" data-dojo-attach-point\x3d"clearShapeCbx"data-dojo-props\x3d"checked:true" data-dojo-type\x3d"jimu/dijit/CheckBox"\x3e\x3c/div\x3e\x3cdiv class\x3d"search-distance-div" data-dojo-attach-point\x3d"searchDistanceDiv"\x3e\x3c/div\x3e\x3c/div\x3e',map:null,bufferLayer:null,
drawBoxOption:null,nls:null,enableBuffer:!0,distance:0,unit:"",postCreate:function(){this.inherited(arguments);this.clearShapeCbx.setLabel(this.nls.clearShapeTip);this.map=this.drawBoxOption.map;this.bufferLayer=new h;var I=f.fromJson({style:"esriSFSSolid",color:[79,129,189,77],type:"esriSFS",outline:{style:"esriSLSSolid",color:[54,93,141,255],width:1.5,type:"esriSLS"}}),q=new y(I);this.bufferLayer.setRenderer(q);this.map.addLayer(this.bufferLayer);this.drawBoxOption.showClear=!0;this.drawBoxOption.keepOneGraphic=
!0;this.drawBox=new k(this.drawBoxOption);this.drawBox.setPolygonSymbol(I);I=L.getGreyPinMarkerSymbol();this.drawBox.setPointSymbol(I);this.drawBox.setLineSymbol(f.fromJson({color:[79,129,189,255],width:1.5,type:"esriSLS",style:"esriSLSDash"}));this.drawBox.placeAt(this.drawBoxDiv);this.own(l(this.drawBox,"user-clear",t.hitch(this,this._onDrawBoxClear)));this.own(l(this.drawBox,"draw-end",t.hitch(this,this._onDrawEnd)));this.drawBox.btnClear?w.removeClass(this.drawBox.btnClear,"jimu-float-trailing"):
w.addClass(this.drawBox.btnClear,"jimu-float-leading");this.searchDistance=new c({distance:this.distance,unit:this.unit});this.searchDistance.placeAt(this.searchDistanceDiv);this.enableBuffer?(this.searchDistance.enable(),this.own(l(this.searchDistance,"change",t.hitch(this,this._onSearchDistanceChange)))):(this.searchDistance.disable(),w.setStyle(this.searchDistanceDiv,"display","none"))},reset:function(I){this.clearShapeCbx.getValue()&&(this.drawBox.reset(),this.clearAllGraphics());I&&(this.searchDistance.reset(),
this.searchDistance.setDistance(this.distance),this.searchDistance.setUnit(this.unit))},clearAllGraphics:function(){this.drawBox.clear();this._clearBufferLayer()},hideTempLayers:function(){this.bufferLayer&&this.bufferLayer.hide();this.drawBox&&this.drawBox.hideLayer()},showTempLayers:function(){this.bufferLayer&&this.bufferLayer.show();this.drawBox&&this.drawBox.showLayer()},deactivate:function(){this.drawBox&&this.drawBox.deactivate()},isValidSearchDistance:function(){return 0<=this._getStatusOfSearchDistance()},
getGeometryInfo:function(){var I={status:0,geometry:null},q=this._getStatusOfSearchDistance();0>q?(I.status=-1,I.geometry=null,this.searchDistance.tryShowValidationError()):0===q?(I.geometry=this._getGeometryFromDrawBox(),I.status=I.geometry?1:0):0<q&&(0<this.bufferLayer.graphics.length&&(I.geometry=this.bufferLayer.graphics[0].geometry),I.status=I.geometry?1:0);return I},_getGeometryFromDrawBox:function(){var I=null,q=this.drawBox.getFirstGraphic();q&&(I=q.geometry);return I},_getGeometryFromBufferLayer:function(){var I=
null;0<this.bufferLayer.graphics.length&&(I=this.bufferLayer.graphics[0].geometry);return I},_getStatusOfSearchDistance:function(){return this.searchDistance.getStatus()},_onSearchDistanceChange:function(){this._updateBuffer()},_onDrawBoxClear:function(){this._clearBufferLayer()},_onDrawEnd:function(){this._updateBuffer()},_clearBufferLayer:function(){this.bufferLayer&&this.bufferLayer.clear();this.emit("change")},_updateBuffer:function(){this._clearBufferLayer();if(0<this._getStatusOfSearchDistance()){var I=
this._getGeometryFromDrawBox();if(I){var q=this.searchDistance.getData();I=J.simplify(I);var F=I.spatialReference,u=null;u=F.isWebMercator()||4326===F.wkid?J.geodesicBuffer(I,q.distance,q.bufferUnit,!0):J.buffer(I,q.distance,q.bufferUnit,!0);I=new a(u);this.bufferLayer.add(I)}}this.emit("change")},destroy:function(){this.bufferLayer&&this.map.removeLayer(this.bufferLayer);this.bufferLayer=null;this.inherited(arguments)}})})},"jimu/dijit/SearchDistance":function(){define("dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./templates/SearchDistance.html dojo/Evented dojo/_base/lang jimu/utils jimu/dijit/CheckBox esri/tasks/GeometryService jimu/dijit/formSelect dijit/form/NumberTextBox".split(" "),
function(D,E,P,G,l,m,w,t,L,k){return D([E,P,G,m],{baseClass:"jimu-dijit-searchdistance",templateString:l,lastMeters:0,tip:"",distance:0,unit:"",postMixInProperties:function(){this.inherited(arguments);this.nls=w.clone(window.jimuNls.units);this.tip||(this.tip=window.jimuNls.searchDistance.applySearchDistance)},postCreate:function(){this.inherited(arguments);this.cbx=new L({label:this.tip,onChange:w.hitch(this,this._onCbxChanged)});this.cbx.placeAt(this.cbxDiv);this.reset();this.setDistance(this.distance);
this.setUnit(this.unit);this.lastMeters=this.getMeters()},enable:function(){this.cbx.check()},disable:function(){this.cbx.uncheck()},isEnabled:function(){return this.cbx.getValue()},reset:function(){this.numberTextBox.set("value",0);this.unitSelect.set("value","MILES")},getData:function(){return{status:this.getStatus(),isEnabled:this.isEnabled(),distance:this.getDistance(),unit:this.getUnit(),bufferUnit:this.getUnitToBuffer(),meters:this.getMeters()}},getStatus:function(){if(this.isEnabled()){var c=
this.getDistance();c=0<c?1:0===c?0:-1}else c=0;return c},getMeters:function(){var c=0,a=this.getStatus();if(0<a){a=this.getDistance();var f=this.getUnit();"MILES"===f?c=1609.344*a:"KILOMETERS"===f?c=1E3*a:"FEET"===f?c=.3048*a:"METERS"===f?c=a:"YARDS"===f?c=.9144*a:"NAUTICAL_MILES"===f&&(c=1852*a);c=parseFloat(c.toFixed(3))}else 0===a?c=0:0>a&&(c=-1);return c},setDistance:function(c){"number"===typeof c&&0<=c&&this.numberTextBox.set("value",c)},setUnit:function(c){c&&"string"===typeof c&&this.unitSelect.set("value",
c)},tryShowValidationError:function(){this.numberTextBox.validate()||t.showValidationErrorTipForFormDijit(this.numberTextBox)},getDistance:function(){return this.numberTextBox.validate()?this.numberTextBox.get("value"):(t.showValidationErrorTipForFormDijit(this.numberTextBox),-1)},getUnit:function(){return this.unitSelect.get("value")},getUnitToBuffer:function(){var c="";switch(this.unitSelect.get("value")){case "MILES":c=k.UNIT_STATUTE_MILE;break;case "KILOMETERS":c=k.UNIT_KILOMETER;break;case "FEET":c=
k.UNIT_FOOT;break;case "METERS":c=k.UNIT_METER;break;case "YARDS":c=k.UNIT_INTERNATIONAL_YARD;break;case "NAUTICAL_MILES":c=k.UNIT_NAUTICAL_MILE}return c},_onCbxChanged:function(){this.cbx.getValue()?(this.numberTextBox.set("disabled",!1),this.unitSelect.set("disabled",!1)):(this.numberTextBox.set("disabled",!0),this.unitSelect.set("disabled",!0));this._emitEvent()},_onNumberTextBoxChanged:function(){this._emitEvent()},_onUnitSelectChanged:function(){this._emitEvent()},_emitEvent:function(){var c=
this.getData();c.meters!==this.lastMeters&&(this.lastMeters=c.meters,this.emit("change",c))}})})},"jimu/dijit/SpatialFilterByFeatures":function(){define("dojo/_base/array dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./templates/SpatialFilterByFeatures.html dojo/on dojo/Evented dojo/Deferred dojo/_base/html dojo/_base/lang jimu/utils jimu/Query jimu/dijit/CheckBox jimu/dijit/FeaturelayerChooserFromMap jimu/dijit/LayerChooserFromMapWithDropbox jimu/dijit/SearchDistance jimu/LayerInfos/LayerInfos esri/graphic esri/tasks/query esri/symbols/jsonUtils esri/layers/GraphicsLayer esri/renderers/SimpleRenderer esri/geometry/geometryEngine jimu/dijit/FeatureSetChooserForSingleLayer".split(" "),
function(D,E,P,G,l,m,w,t,L,k,c,a,f,h,y,J,I,q,F,u,C,z,M,p,H){E=E([P,G,l,t],{baseClass:"jimu-dijit-spatial-filter-features",templateString:m,_bufferLayer:null,_defaultRelationship:"SPATIAL_REL_INTERSECTS",drawBox:null,selectionRadio:null,_selectionHandle:null,layerInfosObj:null,_layerAllFeaturesCache:null,map:null,types:null,enableBuffer:!1,distance:0,unit:"",showLoading:!1,ignoredFeaturelayerIds:null,postMixInProperties:function(){this.inherited(arguments);this.nls=window.jimuNls.spatialFilterByFeatures;
this.ignoredFeaturelayerIds||(this.ignoredFeaturelayerIds=[]);this._layerAllFeaturesCache={}},postCreate:function(){this.inherited(arguments);this.selectionRadio=new h({label:this.nls.selectedFeatures});this.selectionRadio.placeAt(this.selectionOptionDiv);this.selectionRadio.setStatus(!1);this.own(w(this.selectionRadio,"change",c.hitch(this,this._onRadioChanged)));k.setStyle(this.domNode,"position","relative");var r=C.fromJson({style:"esriSFSSolid",color:[79,129,189,77],type:"esriSFS",outline:{style:"esriSLSSolid",
color:[54,93,141,255],width:1.5,type:"esriSLS"}});r=new M(r);this._bufferLayer=new z;this._bufferLayer.setRenderer(r);this.map.addLayer(this._bufferLayer);r=new y({createMapResponse:this.map.webMapResponse,types:this.types,showLayerFromFeatureSet:!0,onlyShowVisible:!1,updateWhenLayerInfosIsShowInMapChanged:!0,ignoredFeaturelayerIds:this.ignoredFeaturelayerIds});this.layerChooserFromMapWithDropbox=new J({label:this.nls.relatedLayer,layerChooser:r});this.layerChooserFromMapWithDropbox.placeAt(this.layerSelectDiv);
this.own(w(this.layerChooserFromMapWithDropbox,"selection-change",c.hitch(this,this._onLayerChanged)));this.layerInfosObj=q.getInstanceSync();this.own(w(this.layerInfosObj,"layerInfosIsShowInMapChanged",c.hitch(this,this._onLayerInfosIsShowInMapChanged)));this.searchDistance=new I({tip:window.jimuNls.searchDistance.applySearchDistanceToFeatures,distance:this.distance,unit:this.unit});this.searchDistance.placeAt(this.searchDistanceDiv);this.enableBuffer?(this.searchDistance.enable(),this.own(w(this.searchDistance,
"change",c.hitch(this,this._onSearchDistanceChange)))):(this.searchDistance.disable(),k.setStyle(this.searchDistanceDiv,"display","none"));this._onLayerChanged()},reset:function(r){r&&(this.searchDistance.reset(),this.searchDistance.setDistance(this.distance),this.searchDistance.setUnit(this.unit));this.clearAllGraphics()},hideTempLayers:function(){this._bufferLayer&&this._bufferLayer.hide();this.drawBox&&this.drawBox.hideLayer();this.featureSetChooserForSingleLayer&&this.featureSetChooserForSingleLayer.hideMiddleFeatureLayer()},
showTempLayers:function(){this._bufferLayer&&this._bufferLayer.show();this.drawBox&&this.drawBox.showLayer();this.featureSetChooserForSingleLayer&&this.featureSetChooserForSingleLayer.showMiddleFeatureLayer()},disable:function(r){r&&this._hideAllLayers()},enable:function(){this._showAllLayers()},deactivate:function(){this.featureSetChooserForSingleLayer&&this.featureSetChooserForSingleLayer.deactivate()},clearAllGraphics:function(){this._clearBufferLayer();this.featureSetChooserForSingleLayer&&this.featureSetChooserForSingleLayer.clearAllGraphics()},
setSelectedLayer:function(r){return this.layerChooserFromMapWithDropbox.setSelectedLayer(r)},getSelectedLayer:function(){return this._getSelectedLayerInfomation().layer},checkSelectedFeaturesRadio:function(){this.selectionRadio.getValue()||this.selectionRadio.check()},uncheckSelectedFeaturesRadio:function(){this.selectionRadio.getValue()&&this.selectionRadio.uncheck()},isValidSearchDistance:function(){return 0<=this.searchDistance.getStatus()},getGeometryInfo:function(r){var B=new L,b={status:null,
geometry:null};this._updateBuffer();if(0===this._getSelectedLayerInfomation().type)return b.status=-1,B.resolve(b),B;if(0>this.searchDistance.getData().status)return b.status=-2,B.resolve(b),B;this._getFeatures(r).then(c.hitch(this,function(){b.geometry=this._updateBuffer();b.status=b.geometry?1:0;B.resolve(b)}),c.hitch(this,function(n){B.reject(n)}));return B},getFeatureSet:function(r){var B=new L,b=null,n=this._getSelectedLayerInfomation().layer;n?this._getFeatures(r).then(c.hitch(this,function(v){b=
a.getFeatureSetByLayerAndFeatures(n,v);B.resolve(b)}),c.hitch(this,function(v){B.reject(v)})):B.resolve(b);return B},_getFeatures:function(){var r=new L,B=[],b=this._getSelectedLayerInfomation(),n=b.type;0===n?r.resolve(B):this.selectionRadio.getStatus()&&this.selectionRadio.getValue()?(B=b.layer.getSelectedFeatures(),r.resolve(B)):this.featureSetChooserForSingleLayer.isLoading()?r=this.featureSetChooserForSingleLayer.getFeatures():(B=this.featureSetChooserForSingleLayer.syncGetFeatures(),0<B.length?
r.resolve(B):3===n?(B=b.layer.graphics,r.resolve(B)):r=this._getAllFeaturesFromFeaturelayer(b.layer));return r},_getAllFeaturesFromFeaturelayer:function(r){var B=new L;if(this._layerAllFeaturesCache[r.id])B.resolve(this._layerAllFeaturesCache[r.id]);else{var b=a.getFeatureLayerDefinition(r);b||(b={currentVersion:r.currentVersion,fields:c.clone(r.fields)});this.emit("loading");b=new u;b.where=r.getDefinitionExpression()||"1\x3d1";b.geometry=null;b.outSpatialReference=this.map.spatialReference;b.returnGeometry=
!0;(new f({url:r.url,query:b})).getAllFeatures().then(c.hitch(this,function(n){this.emit("unloading");n?(n=n.features||[],this._layerAllFeaturesCache[r.id]=n,B.resolve(n)):B.reject("Can't get all features from featureLayer "+r.id)}),c.hitch(this,function(n){this.emit("unloading");B.reject(n)}))}return B},_syncGetFeatures:function(){var r=[],B=this._getSelectedLayerInfomation(),b=B.type;0!==b&&(this.selectionRadio.getStatus()&&this.selectionRadio.getValue()?r=B.layer.getSelectedFeatures():(r=this.featureSetChooserForSingleLayer.syncGetFeatures(),
0===r.length&&(3===b?r=B.layer.graphics:(B=this._layerAllFeaturesCache[B.layer.id])&&(r=B))));return r},isLoading:function(){return this.featureSetChooserForSingleLayer&&this.featureSetChooserForSingleLayer.isLoading()},_onLoading:function(){this.showLoading&&this.loading.show();this.emit("loading")},_onUnloading:function(){this.loading.hide();this.emit("unloading")},_showAllLayers:function(){this._bufferLayer&&this._bufferLayer.show()},_hideAllLayers:function(){this._bufferLayer&&this._bufferLayer.hide()},
_onRadioChanged:function(){this.selectionRadio.getValue()&&this.featureSetChooserForSingleLayer&&(this.featureSetChooserForSingleLayer.deactivate(),this.featureSetChooserForSingleLayer.clearAllGraphics());this._updateBuffer()},_getSelectedLayerInfomation:function(){var r=0,B=null,b=null,n=this.layerChooserFromMapWithDropbox.getSelectedItems();0<n.length&&(B=n[0]);B&&(b=B.layerInfo.layerObject,r=b.url?0<=this.map.graphicsLayerIds.indexOf(b.id)?1:2:3);return{type:r,layerItem:B,layer:b}},_onLayerChanged:function(){this.clearAllGraphics();
this._clearSelectionHandle();this._updateSelectedFeaturesCount();this.featureSetChooserForSingleLayer&&this.featureSetChooserForSingleLayer.destroy();this.featureSetChooserForSingleLayer=null;var r=this._getSelectedLayerInfomation();0<r.type&&(this.featureSetChooserForSingleLayer=new H({map:this.map,featureLayer:r.layer,updateSelection:!1}),this._selectionHandle=w(r.layer,"selection-complete",c.hitch(this,function(){var B=this.selectionRadio.getStatus()&&this.selectionRadio.getValue();this._updateSelectedFeaturesCount();
B&&this._updateBuffer()})),this.own(w(this.featureSetChooserForSingleLayer,"user-clear",c.hitch(this,this._onUserClear))),this.own(w(this.featureSetChooserForSingleLayer,"loading",c.hitch(this,c.hitch(this,function(){this._clearBufferLayer();this._onLoading()})))),this.own(w(this.featureSetChooserForSingleLayer,"unloading",c.hitch(this,c.hitch(this,function(){this._onUnloading();this._updateBuffer()})))),this.featureSetChooserForSingleLayer.placeAt(this.featureSetChooserDiv),this.own(w(this.featureSetChooserForSingleLayer,
"draw-activate",c.hitch(this,function(){this.uncheckSelectedFeaturesRadio()}))));this._updateFeatureSetChooserForSingleLayerStatus();this._updateBuffer()},_onLayerInfosIsShowInMapChanged:function(){this._updateFeatureSetChooserForSingleLayerStatus()},_onSearchDistanceChange:function(){this._updateBuffer();this.emit("search-distance-change")},_updateFeatureSetChooserForSingleLayerStatus:function(){if(this.featureSetChooserForSingleLayer){var r=!1,B=this.featureSetChooserForSingleLayer.getFeatureLayer();
(B=this.layerInfosObj.getLayerInfoById(B.id))&&(r=B.isShowInMap());r?(this.featureSetChooserForSingleLayer.enable(),k.removeClass(this.featureSetChooserForSingleLayer.domNode,"not-visible")):(this.featureSetChooserForSingleLayer.disable(),this.featureSetChooserForSingleLayer.clearAllGraphics(),k.addClass(this.featureSetChooserForSingleLayer.domNode,"not-visible"),this._updateBuffer())}},_updateBuffer:function(){this._clearBufferLayer();var r=this.searchDistance.getData(),B=r.status,b=r.distance;r=
r.bufferUnit;if(0>B)return null;var n=this._syncGetFeatures(),v=null,K=[];D.forEach(n,c.hitch(this,function(d){d&&d.geometry&&K.push(d.geometry)}));0<K.length&&(v="polygon"===K[0].type?p.union(K):a.combineGeometries(K));return 0===B?v:v?(v=p.simplify(v),n=v.spatialReference,B=null,B=n.isWebMercator()||4326===n.wkid?p.geodesicBuffer(v,b,r,!0):p.buffer(v,b,r,!0),b=new F(B),this._bufferLayer.add(b),B):null},_onUserClear:function(){this.clearAllGraphics()},_clearBufferLayer:function(){this._bufferLayer&&
this._bufferLayer.clear()},_updateSelectedFeaturesCount:function(){this.selectionRadio.setStatus(!0);var r=this._getSelectedLayerInfomation(),B=0;r.layer&&(r=r.layer.getSelectedFeatures())&&(B=r.length);0===B?(this.selectionRadio.getValue()&&this.selectionRadio.uncheck(),this.selectionRadio.setStatus(!1),k.addClass(this.selectionOptionDiv,"not-visible")):k.removeClass(this.selectionOptionDiv,"not-visible");this.selectionRadio.setLabel(this.nls.selectedFeatures+(window.isRTL?"\x26rlm;":" ")+"("+B+
")")},_clearSelectionHandle:function(){this._selectionHandle&&this._selectionHandle.remove();this._selectionHandle=null},destroy:function(){this._bufferLayer&&this.map.removeLayer(this._bufferLayer);this._bufferLayer=null;this._clearSelectionHandle();this.inherited(arguments)}});E.NONE_SELECTED_FEATURES_NOT_DRAW_SHAPES="NONE_SELECTED_FEATURES_NOT_DRAW_SHAPES";return E})},"jimu/dijit/FeaturelayerChooserFromMap":function(){define(["dojo/_base/declare","dojo/Deferred","dojo/_base/html","dojo/_base/lang",
"./LayerChooserFromMap"],function(D,E,P,G,l){return D([l],{baseClass:"jimu-featurelayer-chooser-from-map",declaredClass:"jimu.dijit.FeaturelayerChooserFromMap",types:null,showLayerFromFeatureSet:!1,showTable:!1,onlyShowVisible:!1,ignoredFeaturelayerIds:null,mustSupportStatistics:!1,ignoreVirtualLayer:!1,postMixInProperties:function(){this.inherited(arguments);this.ignoredFeaturelayerIds||(this.ignoredFeaturelayerIds=[]);this.basicFilter=G.hitch(this,this.basicFilter);this.filter=l.createFeaturelayerFilter(this.types,
this.showLayerFromFeatureSet,this.showTable,this.mustSupportStatistics);this.ignoreVirtualLayer&&(this.filter=l.andCombineFilters([this.filter,G.hitch(this,this._ignoreVirtualLayerFilter)]))},postCreate:function(){this.inherited(arguments);P.addClass(this.domNode,"jimu-basic-layer-chooser-from-map")},_ignoreVirtualLayerFilter:function(m){return m.getLayerType().then(function(w){return!("ArcGISDynamicMapServiceLayer"===w||"ArcGISTiledMapServiceLayer"===w||"GroupLayer"===w)})},basicFilter:function(m){var w=
new E;0<=this.ignoredFeaturelayerIds.indexOf(m.id)?w.resolve(!1):this.onlyShowVisible&&"Table"!==m.getLayerType()?w.resolve(m.isShowInMap()):w.resolve(!0);return w},getHandledItem:function(m){var w=this.inherited(arguments),t=m&&m.layerInfo;t=t&&t.layerObject;w.url=t&&t.url||"";return w}})})},"jimu/dijit/LayerChooserFromMap":function(){define("dojo/on dojo/Evented dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/store/Memory dojo/Deferred dojo/store/Observable dijit/tree/ObjectStoreModel dojo/promise/all dojo/_base/lang dojo/_base/html dojo/_base/array jimu/utils jimu/dijit/_Tree jimu/LayerInfos/LayerInfos jimu/dijit/LoadingIndicator".split(" "),
function(D,E,P,G,l,m,w,t,L,k,c,a,f,h,y,J,I,q){var F=P([G,l,m,E],{templateString:'\x3cdiv style\x3d"width:100%;"\x3e\x3cdiv data-dojo-attach-point\x3d"errorTipSection" class\x3d"error-tip-section"\x3e\x3cspan class\x3d"jimu-icon jimu-icon-error"\x3e\x3c/span\x3e\x3cspan class\x3d"jimu-state-error-text" data-dojo-attach-point\x3d"errTip"\x3e${nls.noLayersTip}\x3c/span\x3e\x3c/div\x3e\x3c/div\x3e',_store:null,_id:0,_treeClass:"layer-chooser-tree",createMapResponse:null,multiple:!1,onlyShowVisible:!1,
updateWhenLayerInfosIsShowInMapChanged:!1,onlyShowWebMapLayers:!1,displayTooltipForTreeNode:!1,onlyFilterCurrentLayerWhenAddItem:!1,postMixInProperties:function(){this.nls=window.jimuNls.basicLayerChooserFromMap},postCreate:function(){this.inherited(arguments);f.addClass(this.domNode,"jimu-basic-layer-chooser-from-map");this.multiple=!!this.multiple;this.shelter=new q({hidden:!0});this.shelter.placeAt(this.domNode);this.shelter.startup();this._createTree();this.basicFilter=a.hitch(this,this.basicFilter);
this.filter=F.andCombineFilters([this.basicFilter,this.filter]);this.createMapResponse&&this.setCreateMapResponse(this.createMapResponse)},basicFilter:function(u){var C=new t;this.onlyShowVisible?C.resolve(u.isShowInMap()):C.resolve(!0);return C},filter:function(u){u=new t;u.resolve(!0);return u},getSelectedItems:function(){var u=this.tree.getSelectedItems();return h.map(u,a.hitch(this,function(C){return this.getHandledItem(C)}))},getAllItems:function(){var u=this.tree.getAllItems(),C=[];h.forEach(u,
a.hitch(this,function(z){"root"!==z.id&&(z=this.getHandledItem(z),C.push(z))}));return C},getHandledItem:function(u){return{name:u.name,layerInfo:u.layerInfo}},_isLeafItem:function(u){return u.isLeaf},setCreateMapResponse:function(u){this.createMapResponse=u;I.getInstance(this.createMapResponse.map,this.createMapResponse.itemInfo).then(a.hitch(this,function(C){this.layerInfosObj=C;this.own(D(this.layerInfosObj,"layerInfosChanged",a.hitch(this,this._onLayerInfosChanged)));this.updateWhenLayerInfosIsShowInMapChanged&&
this.own(D(this.layerInfosObj,"layerInfosIsShowInMapChanged",a.hitch(this,this._onLayerInfosIsShowInMapChanged)));this._buildTree(this.layerInfosObj)}))},_onLayerInfosChanged:function(u,C){this._buildTree(this.layerInfosObj);this.emit("update")},_onLayerInfosIsShowInMapChanged:function(u){this._buildTree(this.layerInfosObj);this.emit("update")},_buildTree:function(u){this._clear();f.setStyle(this.errorTipSection,"display","block");var C=[];this.onlyShowWebMapLayers?(C=u.getLayerInfoArrayOfWebmap(),
C=C.concat(u.getTableInfoArrayOfWebmap())):(C=u.getLayerInfoArray(),C=C.concat(u.getTableInfoArray()));0!==C.length&&(f.setStyle(this.errorTipSection,"display","none"),h.forEach(C,a.hitch(this,function(z){this._addDirectLayerInfo(z)})))},_addDirectLayerInfo:function(u){u&&u.getLayerObject().then(a.hitch(this,function(){this._addItem("root",u)}),a.hitch(this,function(C){console.error(C)}))},_clear:function(){var u=this._store.query({parent:"root"});h.forEach(u,a.hitch(this,function(C){C&&"root"!==
C.id&&this._store.remove(C.id)}))},_addItem:function(u,C){var z=null,M=C.getLayerType(),p=this.filter(C);c({layerType:M,valid:p}).then(a.hitch(this,function(H){if(H.valid){var r=a.hitch(this,function(v,K){this._id++;z={name:C.title||"",parent:u,layerInfo:C,type:H.layerType,layerClass:C.layerObject.declaredClass,id:this._id.toString(),isLeaf:v,hasChildren:K};this._store.add(z)}),B=C.getSubLayers(),b=0===B.length,n=!0;this.onlyFilterCurrentLayerWhenAddItem?(b&&(n=!1),r(b,n)):b?r(b,!1):(B=h.map(B,a.hitch(this,
function(v){return this.filter(v)})),c(B).then(a.hitch(this,function(v){(v=h.some(v,function(K){return K}))&&r(b,v)})))}}))},_getRootItem:function(){return{id:"root",name:"Map Root",type:"root",isLeaf:!1,hasChildren:!0}},_createTree:function(){var u=this._getRootItem();u=new w({data:[u],getChildren:function(C){return this.query({parent:C.id})}});this._store=new L(u);u=new k({store:this._store,query:{id:"root"},mayHaveChildren:a.hitch(this,this._mayHaveChildren)});this.tree=new J({multiple:this.multiple,
model:u,showRoot:!1,isLeafItem:a.hitch(this,this._isLeafItem),style:{width:"100%"},onOpen:a.hitch(this,function(C,z){"root"!==C.id&&this._onTreeOpen(C,z)}),onClick:a.hitch(this,function(C,z,M){this._onTreeClick(C,z,M);this.emit("tree-click",C,z,M)}),getIconStyle:a.hitch(this,function(C,z){var M=null;if(!C||"root"===C.id)return null;var p={width:"20px",height:"20px",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundImage:""},H=window.location.protocol+"//"+window.location.host+
require.toUrl("jimu");if(C=this._getIconInfo(C,z).imageName)p.backgroundImage="url("+H+"/css/images/"+C+")",M=p;return M}),getIconClass:a.hitch(this,function(C,z){return this._getIconInfo(C,z).className}),getTooltip:a.hitch(this,function(C){return this.displayTooltipForTreeNode?C.layerInfo.title:""})});f.addClass(this.tree.domNode,this._treeClass);this.tree.placeAt(this.shelter.domNode,"before")},_mayHaveChildren:function(u){return u.hasChildren},_getIconInfo:function(u,C){var z="",M="";"ArcGISDynamicMapServiceLayer"===
u.type||"ArcGISTiledMapServiceLayer"===u.type?C?(z="mapserver_open.png",M="mapservice-layer-icon open"):(z="mapserver_close.png",M="mapservice-layer-icon close"):"GroupLayer"===u.type?C?(z="group_layer2.png",M="group-layer-icon open"):(z="group_layer1.png",M="group-layer-icon close"):"FeatureLayer"===u.type?(u=y.getTypeByGeometryType(u.layerInfo.layerObject.geometryType),"point"===u?(z="point_layer1.png",M="point-layer-icon"):"polyline"===u?(z="line_layer1.png",M="line-layer-icon"):"polygon"===u&&
(z="polygon_layer1.png",M="polygon-layer-icon")):"Table"===u.type?(z="table.png",M="table-icon"):"ArcGISImageServiceLayer"===u.type||"ArcGISImageServiceVectorLayer"===u.type?(z="image_layer.png",M="iamge-layer-icon"):C?(z="mapserver_open.png",M="mapservice-layer-icon open"):(z="mapserver_close.png",M="mapservice-layer-icon close");return{imageName:z,className:M}},_onTreeOpen:function(u,C){if("root"!==u.id){var z=[];C=[];z=u.layerInfo.getSubLayers();u.checked||(this.shelter.show(),C=h.map(z,a.hitch(this,
function(M){return M.getLayerObject()})),c(C).then(a.hitch(this,function(){this.domNode&&(h.forEach(z,a.hitch(this,function(M){this._addItem(u.id,M)})),u.checked=!0,this.shelter.hide())}),a.hitch(this,function(M){console.error(M);this.shelter.hide()})))}},_onTreeClick:function(u,C,z){},destroy:function(){this.shelter&&(this.shelter.destroy(),this.shelter=null);this.tree&&this.tree.destroy();this.inherited(arguments)}});F.createFilterByLayerType=function(u){a.isArrayLike(u)||(u=[]);return function(C){var z=
new t;if(0===u.length)z.resolve(!0);else{var M=[];C.traversal(function(p){M.push(p.getLayerType())});c(M).then(function(p){for(var H=0;H<p.length;H++)for(var r=0;r<u.length;r++)if(p[H]===u[r]){z.resolve(!0);return}z.resolve(!1)},function(p){console.error(p);z.reject(p)})}return z}};F.createFeaturelayerFilter=function(u,C,z,M){var p=["point","polyline","polygon"];u&&0<u.length?(u=h.filter(u,function(H){return 0<=p.indexOf(H)}),0===u.length&&(u=p)):u=p;return function(H){var r=H.getLayerType();H=H.getLayerObject();
return c({layerType:r,layerObject:H}).then(function(B){var b=B.layerType;B=B.layerObject;if("ArcGISDynamicMapServiceLayer"===b||"ArcGISTiledMapServiceLayer"===b||"GroupLayer"===b||"FeatureCollection"===b)return!0;if("FeatureLayer"===b){b=y.getTypeByGeometryType(B.geometryType);b=0<=h.indexOf(u,b);var n=F._shouldPassStatisticsCheck(M,B);return B.url?(B=y.isFeaturelayerUrlSupportQuery(B.url,B.capabilities),b&&B&&n):C&&b}return"Table"===b?(b=y.isFeaturelayerUrlSupportQuery(B.url,B.capabilities),B=F._shouldPassStatisticsCheck(M,
B),z&&b&&B):!1})}};F.createImageServiceLayerFilter=function(u,C){return function(z){var M=z.getLayerType();z=z.getLayerObject();return c({layerType:M,layerObject:z}).then(function(p){var H=p.layerType,r=p.layerObject;return"ArcGISImageServiceLayer"===H||"ArcGISImageServiceVectorLayer"===H?u?y.isImageServiceSupportQuery(p.layerObject.capabilities)?C?F._shouldPassStatisticsCheck(C,r):!0:!1:!0:!1})}};F._shouldPassStatisticsCheck=function(u,C){return u?(u=!1,u=C.advancedQueryCapabilities?!!C.advancedQueryCapabilities.supportsStatistics:
!!C.supportsStatistics):!0};F.createQueryableLayerFilter=function(u){var C=F.createFeaturelayerFilter(["point","polyline","polygon"],!1,!0,u);u=F.createImageServiceLayerFilter(!0,u);return F.orCombineFilters([C,u])};F.andCombineFilters=function(u){return F._combineFilters(u,!0)};F.orCombineFilters=function(u){return F._combineFilters(u,!1)};F._combineFilters=function(u,C){return function(z){var M=new t,p=h.map(u,function(H){return H(z)});c(p).then(function(H){var r=!1;r=C?h.every(H,function(B){return B}):
h.some(H,function(B){return B});M.resolve(r)},function(H){console.error(H);M.reject(H)});return M}};return F})},"dijit/tree/ObjectStoreModel":function(){define("dojo/_base/array dojo/aspect dojo/_base/declare dojo/Deferred dojo/_base/lang dojo/when ../Destroyable".split(" "),function(D,E,P,G,l,m,w){return P("dijit.tree.ObjectStoreModel",w,{store:null,labelAttr:"name",labelType:"text",root:null,query:null,constructor:function(t){l.mixin(this,t);this.childrenCache={}},getRoot:function(t,L){if(this.root)t(this.root);
else{var k=this.store.query(this.query);k.then&&this.own(k);m(k,l.hitch(this,function(c){if(1!=c.length)throw Error("dijit.tree.ObjectStoreModel: root query returned "+c.length+" items, but must return exactly one");this.root=c[0];t(this.root);k.observe&&k.observe(l.hitch(this,function(a){this.onChange(a)}),!0)}),L)}},mayHaveChildren:function(){return!0},getChildren:function(t,L,k){var c=this.store.getIdentity(t);if(this.childrenCache[c])m(this.childrenCache[c],L,k);else{var a=this.childrenCache[c]=
this.store.getChildren(t);a.then&&this.own(a);a.observe&&this.own(a.observe(l.hitch(this,function(f,h,y){this.onChange(f);h!=y&&m(a,l.hitch(this,"onChildrenChange",t))}),!0));m(a,L,k)}},isItem:function(){return!0},getIdentity:function(t){return this.store.getIdentity(t)},getLabel:function(t){return t[this.labelAttr]},newItem:function(t,L,k,c){return this.store.put(t,{parent:L,before:c})},pasteItem:function(t,L,k,c,a,f){var h=new G;if(L===k&&!c&&!f)return h.resolve(!0),h;L&&!c?this.getChildren(L,l.hitch(this,
function(y){y=[].concat(y);var J=D.indexOf(y,t);y.splice(J,1);this.onChildrenChange(L,y);h.resolve(this.store.put(t,{overwrite:!0,parent:k,oldParent:L,before:f,isCopy:!1}))})):h.resolve(this.store.put(t,{overwrite:!0,parent:k,oldParent:L,before:f,isCopy:!0}));return h},onChange:function(){},onChildrenChange:function(){},onDelete:function(){}})})},"jimu/dijit/_Tree":function(){define("dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dojo/text!./templates/_TreeNode.html dojo/_base/lang dojo/_base/html dojo/_base/array dojo/_base/event dojo/query dojo/aspect dojo/on dojo/keys dojo/Evented dijit/registry dijit/Tree jimu/utils".split(" "),
function(D,E,P,G,l,m,w,t,L,k,c,a,f,h,y,J){var I=D([y._TreeNode,f],{templateString:G,declaredClass:"jimu._TreeNode",isLeaf:!1,groupId:"",postCreate:function(){this.inherited(arguments);m.addClass(this.domNode,"jimu-tree-node");this.isLeaf=!!this.isLeaf;this.groupId?(this.checkNode=m.toDom('\x3cinput type\x3d"radio" /\x3e'),this.checkNode.name=this.groupId):this.checkNode=m.toDom('\x3cinput type\x3d"checkbox" /\x3e');m.addClass(this.checkNode,"jimu-tree-check-node");m.place(this.checkNode,this.contentNode,
"first");this.own(c(this.checkNode,"click",l.hitch(this,this._onClick)));this.own(c(this.rowNode,"keydown",l.hitch(this,function(q,F){F.target=q;F.keyCode!==a.ENTER&&F.keyCode!==a.SPACE||this._onClick(F)},this.checkNode)));this.isLeaf?this.groupId?m.setStyle(this.checkNode,"display","none"):m.setStyle(this.checkNode,"display","inline"):m.setStyle(this.checkNode,"display","none");this.isLeaf?m.addClass(this.domNode,"jimu-tree-leaf-node"):m.addClass(this.domNode,"jimu-tree-not-leaf-node")},select:function(){this.isLeaf&&
(this.checkNode.checked=!0,m.addClass(this.domNode,"jimu-tree-selected-leaf-node"))},unselect:function(){this.isLeaf&&(this.checkNode.checked=!1,m.removeClass(this.domNode,"jimu-tree-selected-leaf-node"))},toggleSelect:function(){this.isLeaf&&(this.checkNode.checked?this.unselect():this.select())},_onClick:function(q){(q.target||q.srcElement)===this.checkNode?this.tree._onCheckNodeClick(this,this.checkNode.checked,q):this.tree._onClick(this,q)},_onChange:function(){this.isLeaf&&setTimeout(l.hitch(this,
function(){this.checkNode.checked?this.emit("tn-select",this):this.emit("tn-unselect",this)}),100)},destroy:function(){delete this.tree;this.inherited(arguments)}});return D([y,f],{declaredClass:"jimu._Tree",openOnClick:!0,multiple:!0,uniqueId:"",showRoot:!1,postMixInProperties:function(){this.inherited(arguments);this.uniqueId="tree_"+J.getRandomString()},postCreate:function(){this.inherited(arguments);m.addClass(this.domNode,"jimu-tree");this.own(k.before(this,"onClick",l.hitch(this,this._jimuBeforeClick)));
this.rootLoadingIndicator&&m.setStyle(this.rootLoadingIndicator,"display","none");this.dndController.singular=!0;m.setAttr(this.domNode,"tabindex",0)},removeItem:function(q){this.model.store.remove(q)},getAllItems:function(){var q=this.getAllTreeNodeWidgets();return w.map(q,l.hitch(this,function(F){var u=F.item;u.selected=F.checkNode.checked;return u}))},getSelectedItems:function(){var q=this.getAllTreeNodeWidgets();q=w.filter(q,l.hitch(this,function(F){return F.checkNode.checked}));return w.map(q,
l.hitch(this,function(F){return F.item}))},getFilteredItems:function(q){var F=this.getAllTreeNodeWidgets();F=w.map(F,l.hitch(this,function(u){var C=u.item;C.selected=u.checkNode.checked;return C}));return w.filter(F,l.hitch(this,function(u){return q(u)}))},getTreeNodeByItemId:function(q){for(var F=this._getAllTreeNodeDoms(),u=0;u<F.length;u++){var C=h.byNode(F[u]);if(C.item.id.toString()===q.toString())return C}return null},selectItem:function(q){(q=this.getTreeNodeByItemId(q))&&q.isLeaf&&this.selectNodeWidget(q)},
unselectItem:function(q){(q=this.getTreeNodeByItemId(q))&&q.isLeaf&&q.unselect()},getAllLeafTreeNodeWidgets:function(){var q=this.getAllTreeNodeWidgets();return w.filter(q,l.hitch(this,function(F){return F.isLeaf}))},getAllTreeNodeWidgets:function(){var q=this._getAllTreeNodeDoms();return w.map(q,l.hitch(this,function(F){return h.byNode(F)}))},isLeafItem:function(q){return q&&q.isLeaf},_getAllTreeNodeDoms:function(){return L(".dijitTreeNode",this.domNode)},_createTreeNode:function(q){q.isLeaf=this.isLeafItem(q.item);
this.multiple||(q.groupId=this.uniqueId);return new I(q)},_onTreeNodeSelect:function(q){this.emit("item-select",{item:q.item,treeNode:q})},_onTreeNodeUnselect:function(q){this.emit("item-unselect",{item:q.item,treeNode:q})},selectNodeWidget:function(q){this.multiple||this.unselectAllLeafNodeWidgets();q.select()},_jimuBeforeClick:function(q,F,u){F.isLeaf&&(m.hasClass(u.target||u.srcElement,"jimu-tree-check-node")||(this.multiple?F.toggleSelect():this.selectNodeWidget(F)));return arguments},_onCheckNodeClick:function(q,
F,u){!this.multiple&&F&&this.unselectAllLeafNodeWidgets();t.stop(u);this.focusNode(q);setTimeout(l.hitch(this,function(){F?this.selectNodeWidget(q):q.unselect();this.onClick(q.item,q,u)}),0)},unselectAllLeafNodeWidgets:function(){var q=this.getAllLeafTreeNodeWidgets();w.forEach(q,l.hitch(this,function(F){F.unselect()}))}})})},"dijit/Tree":function(){define("dojo/_base/array dojo/aspect dojo/cookie dojo/_base/declare dojo/Deferred dojo/promise/all dojo/dom dojo/dom-class dojo/dom-geometry dojo/dom-style dojo/errors/create dojo/fx dojo/has dojo/_base/kernel dojo/keys dojo/_base/lang dojo/on dojo/topic dojo/touch dojo/when ./a11yclick ./focus ./registry ./_base/manager ./_Widget ./_TemplatedMixin ./_Container ./_Contained ./_CssStateMixin ./_KeyNavMixin dojo/text!./templates/TreeNode.html dojo/text!./templates/Tree.html ./tree/TreeStoreModel ./tree/ForestStoreModel ./tree/_dndSelector dojo/query!css2".split(" "),
function(D,E,P,G,l,m,w,t,L,k,c,a,f,h,y,J,I,q,F,u,C,z,M,p,H,r,B,b,n,v,K,d,x,A,N){function R(e){return J.delegate(e.promise||e,{addCallback:function(g){this.then(g)},addErrback:function(g){this.otherwise(g)}})}var U=G("dijit._TreeNode",[H,r,B,b,n],{item:null,isTreeNode:!0,label:"",_setLabelAttr:function(e){this.labelNode["html"==this.labelType?"innerHTML":"innerText"in this.labelNode?"innerText":"textContent"]=e;this._set("label",e);f("dojo-bidi")&&this.applyTextDir(this.labelNode)},labelType:"text",
isExpandable:null,isExpanded:!1,state:"NotLoaded",templateString:K,baseClass:"dijitTreeNode",cssStateNodes:{rowNode:"dijitTreeRow"},_setTooltipAttr:{node:"rowNode",type:"attribute",attribute:"title"},buildRendering:function(){this.inherited(arguments);this._setExpando();this._updateItemClasses(this.item);this.isExpandable&&this.labelNode.setAttribute("aria-expanded",this.isExpanded);this.setSelected(!1)},_setIndentAttr:function(e){var g=Math.max(e,0)*this.tree._nodePixelIndent+"px";k.set(this.domNode,
"backgroundPosition",g+" 0px");k.set(this.rowNode,this.isLeftToRight()?"paddingLeft":"paddingRight",g);D.forEach(this.getChildren(),function(O){O.set("indent",e+1)});this._set("indent",e)},markProcessing:function(){this.state="Loading";this._setExpando(!0)},unmarkProcessing:function(){this._setExpando(!1)},_updateItemClasses:function(e){var g=this.tree,O=g.model;g._v10Compat&&e===O.root&&(e=null);this._applyClassAndStyle(e,"icon","Icon");this._applyClassAndStyle(e,"label","Label");this._applyClassAndStyle(e,
"row","Row");this.tree._startPaint(!0)},_applyClassAndStyle:function(e,g,O){var Q="_"+g+"Class";g+="Node";var S=this[Q];this[Q]=this.tree["get"+O+"Class"](e,this.isExpanded);t.replace(this[g],this[Q]||"",S||"");k.set(this[g],this.tree["get"+O+"Style"](e,this.isExpanded)||{})},_updateLayout:function(){var e=this.getParent();e=!e||!e.rowNode||"none"==e.rowNode.style.display;t.toggle(this.domNode,"dijitTreeIsRoot",e);t.toggle(this.domNode,"dijitTreeIsLast",!e&&!this.getNextSibling())},_setExpando:function(e){var g=
["dijitTreeExpandoLoading","dijitTreeExpandoOpened","dijitTreeExpandoClosed","dijitTreeExpandoLeaf"];e=e?0:this.isExpandable?this.isExpanded?1:2:3;t.replace(this.expandoNode,g[e],g);this.expandoNodeText.innerHTML=["*","-","+","*"][e]},expand:function(){if(this._expandDeferred)return R(this._expandDeferred);this._collapseDeferred&&(this._collapseDeferred.cancel(),delete this._collapseDeferred);this.isExpanded=!0;this.labelNode.setAttribute("aria-expanded","true");(this.tree.showRoot||this!==this.tree.rootNode)&&
this.containerNode.setAttribute("role","group");t.add(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);this==this.tree.rootNode&&this.tree.showRoot&&this.tree.domNode.setAttribute("aria-expanded","true");var e=a.wipeIn({node:this.containerNode,duration:p.defaultDuration}),g=this._expandDeferred=new l(function(){e.stop()});E.after(e,"onEnd",function(){g.resolve(!0)},!0);e.play();return R(g)},collapse:function(){if(this._collapseDeferred)return R(this._collapseDeferred);
this._expandDeferred&&(this._expandDeferred.cancel(),delete this._expandDeferred);this.isExpanded=!1;this.labelNode.setAttribute("aria-expanded","false");this==this.tree.rootNode&&this.tree.showRoot&&this.tree.domNode.setAttribute("aria-expanded","false");t.remove(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);var e=a.wipeOut({node:this.containerNode,duration:p.defaultDuration}),g=this._collapseDeferred=new l(function(){e.stop()});E.after(e,"onEnd",
function(){g.resolve(!0)},!0);e.play();return R(g)},indent:0,setChildItems:function(e){var g=this.tree,O=g.model,Q=[],S=g.focusedChild,Y=this.getChildren();D.forEach(Y,function(V){B.prototype.removeChild.call(this,V)},this);this.defer(function(){D.forEach(Y,function(V){if(!V._destroyed&&!V.getParent()){g.dndController.removeTreeNode(V);(function ea(W){var da=O.getIdentity(W.item),Z=g._itemNodesMap[da];1==Z.length?delete g._itemNodesMap[da]:(da=D.indexOf(Z,W),-1!=da&&Z.splice(da,1));D.forEach(W.getChildren(),
ea)})(V);if(g.persist){var aa=D.map(V.getTreePath(),function(W){return g.model.getIdentity(W)}).join("/"),X;for(X in g._openedNodes)X.substr(0,aa.length)==aa&&delete g._openedNodes[X];g._saveExpandedNodes()}g.lastFocusedChild&&!w.isDescendant(g.lastFocusedChild.domNode,g.domNode)&&delete g.lastFocusedChild;S&&!w.isDescendant(S.domNode,g.domNode)&&g.focus();V.destroyRecursive()}})});this.state="Loaded";e&&0<e.length?(this.isExpandable=!0,D.forEach(e,function(V){var aa=O.getIdentity(V),X=g._itemNodesMap[aa];
if(X)for(var ca=0;ca<X.length;ca++)if(X[ca]&&!X[ca].getParent()){var W=X[ca];W.set("indent",this.indent+1);break}W||(W=this.tree._createTreeNode({item:V,tree:g,isExpandable:O.mayHaveChildren(V),label:g.getLabel(V),labelType:g.model&&g.model.labelType||"text",tooltip:g.getTooltip(V),ownerDocument:g.ownerDocument,dir:g.dir,lang:g.lang,textDir:g.textDir,indent:this.indent+1}),X?X.push(W):g._itemNodesMap[aa]=[W]);this.addChild(W);(this.tree.autoExpand||this.tree._state(W))&&Q.push(g._expandNode(W))},
this),D.forEach(this.getChildren(),function(V){V._updateLayout()})):this.isExpandable=!1;this._setExpando&&this._setExpando(!1);this._updateItemClasses(this.item);e=m(Q);this.tree._startPaint(e);return R(e)},getTreePath:function(){for(var e=this,g=[];e&&e!==this.tree.rootNode;)g.unshift(e.item),e=e.getParent();g.unshift(this.tree.rootNode.item);return g},getIdentity:function(){return this.tree.model.getIdentity(this.item)},removeChild:function(e){this.inherited(arguments);var g=this.getChildren();
0==g.length&&(this.isExpandable=!1,this.collapse());D.forEach(g,function(O){O._updateLayout()})},makeExpandable:function(){this.isExpandable=!0;this._setExpando(!1)},setSelected:function(e){this.labelNode.setAttribute("aria-selected",e?"true":"false");t.toggle(this.rowNode,"dijitTreeRowSelected",e)},focus:function(){z.focus(this.focusNode)}});f("dojo-bidi")&&U.extend({_setTextDirAttr:function(e){!e||this.textDir==e&&this._created||(this._set("textDir",e),this.applyTextDir(this.labelNode),D.forEach(this.getChildren(),
function(g){g.set("textDir",e)},this))}});var T=G("dijit.Tree",[H,v,r,n],{baseClass:"dijitTree",store:null,model:null,query:null,label:"",showRoot:!0,childrenAttr:["children"],paths:[],path:[],selectedItems:null,selectedItem:null,openOnClick:!1,openOnDblClick:!1,templateString:d,persist:!1,autoExpand:!1,dndController:N,dndParams:"onDndDrop itemCreator onDndCancel checkAcceptance checkItemAcceptance dragThreshold betweenThreshold".split(" "),onDndDrop:null,itemCreator:null,onDndCancel:null,checkAcceptance:null,
checkItemAcceptance:null,dragThreshold:5,betweenThreshold:0,_nodePixelIndent:19,_publish:function(e,g){q.publish(this.id,J.mixin({tree:this,event:e},g||{}))},postMixInProperties:function(){this.tree=this;this.autoExpand&&(this.persist=!1);this._itemNodesMap={};!this.cookieName&&this.id&&(this.cookieName=this.id+"SaveStateCookie");this.expandChildrenDeferred=new l;this.pendingCommandsPromise=this.expandChildrenDeferred.promise;this.inherited(arguments)},postCreate:function(){this._initState();var e=
this;this.own(I(this.containerNode,I.selector(".dijitTreeNode",F.enter),function(Q){e._onNodeMouseEnter(M.byNode(this),Q)}),I(this.containerNode,I.selector(".dijitTreeNode",F.leave),function(Q){e._onNodeMouseLeave(M.byNode(this),Q)}),I(this.containerNode,I.selector(".dijitTreeRow",C.press),function(Q){e._onNodePress(M.getEnclosingWidget(this),Q)}),I(this.containerNode,I.selector(".dijitTreeRow",C),function(Q){e._onClick(M.getEnclosingWidget(this),Q)}),I(this.containerNode,I.selector(".dijitTreeRow",
"dblclick"),function(Q){e._onDblClick(M.getEnclosingWidget(this),Q)}));this.model||this._store2model();this.own(E.after(this.model,"onChange",J.hitch(this,"_onItemChange"),!0),E.after(this.model,"onChildrenChange",J.hitch(this,"_onItemChildrenChange"),!0),E.after(this.model,"onDelete",J.hitch(this,"_onItemDelete"),!0));this.inherited(arguments);if(this.dndController){J.isString(this.dndController)&&(this.dndController=J.getObject(this.dndController));for(var g={},O=0;O<this.dndParams.length;O++)this[this.dndParams[O]]&&
(g[this.dndParams[O]]=this[this.dndParams[O]]);this.dndController=new this.dndController(this,g)}this._load();this.onLoadDeferred=R(this.pendingCommandsPromise);this.onLoadDeferred.then(J.hitch(this,"onLoad"))},_store2model:function(){this._v10Compat=!0;h.deprecated("Tree: from version 2.0, should specify a model object rather than a store/query");var e={id:this.id+"_ForestStoreModel",store:this.store,query:this.query,childrenAttrs:this.childrenAttr};this.params.mayHaveChildren&&(e.mayHaveChildren=
J.hitch(this,"mayHaveChildren"));this.params.getItemChildren&&(e.getChildren=J.hitch(this,function(g,O,Q){this.getItemChildren(this._v10Compat&&g===this.model.root?null:g,O,Q)}));this.model=new A(e);this.showRoot=!!this.label},onLoad:function(){},_load:function(){this.model.getRoot(J.hitch(this,function(e){var g=this.rootNode=this.tree._createTreeNode({item:e,tree:this,isExpandable:!0,label:this.label||this.getLabel(e),labelType:this.model.labelType||"text",textDir:this.textDir,indent:this.showRoot?
0:-1});this.showRoot?(this.domNode.setAttribute("aria-multiselectable",!this.dndController.singular),this.rootLoadingIndicator.style.display="none"):(g.rowNode.style.display="none",this.domNode.setAttribute("role","presentation"),this.domNode.removeAttribute("aria-expanded"),this.domNode.removeAttribute("aria-multiselectable"),this["aria-label"]?(g.containerNode.setAttribute("aria-label",this["aria-label"]),this.domNode.removeAttribute("aria-label")):this["aria-labelledby"]&&(g.containerNode.setAttribute("aria-labelledby",
this["aria-labelledby"]),this.domNode.removeAttribute("aria-labelledby")),g.labelNode.setAttribute("role","presentation"),g.labelNode.removeAttribute("aria-selected"),g.containerNode.setAttribute("role","tree"),g.containerNode.setAttribute("aria-expanded","true"),g.containerNode.setAttribute("aria-multiselectable",!this.dndController.singular));this.containerNode.appendChild(g.domNode);e=this.model.getIdentity(e);this._itemNodesMap[e]?this._itemNodesMap[e].push(g):this._itemNodesMap[e]=[g];g._updateLayout();
this._expandNode(g).then(J.hitch(this,function(){this._destroyed||(this.rootLoadingIndicator.style.display="none",this.expandChildrenDeferred.resolve(!0))}))}),J.hitch(this,function(e){console.error(this,": error loading root: ",e)}))},getNodesByItem:function(e){if(!e)return[];e=J.isString(e)?e:this.model.getIdentity(e);return[].concat(this._itemNodesMap[e])},_setSelectedItemAttr:function(e){this.set("selectedItems",[e])},_setSelectedItemsAttr:function(e){var g=this;return this.pendingCommandsPromise=
this.pendingCommandsPromise.always(J.hitch(this,function(){var O=D.map(e,function(S){return!S||J.isString(S)?S:g.model.getIdentity(S)}),Q=[];D.forEach(O,function(S){Q=Q.concat(g._itemNodesMap[S]||[])});this.set("selectedNodes",Q)}))},_setPathAttr:function(e){return e.length?R(this.set("paths",[e]).then(function(g){return g[0]})):R(this.set("paths",[]).then(function(g){return g[0]}))},_setPathsAttr:function(e){function g(Q,S){var Y=Q.shift(),V=D.filter(S,function(aa){return aa.getIdentity()==Y})[0];
if(V)return Q.length?O._expandNode(V).then(function(){return g(Q,V.getChildren())}):V;throw new T.PathError("Could not expand path at "+Y);}var O=this;return R(this.pendingCommandsPromise=this.pendingCommandsPromise.always(function(){return m(D.map(e,function(Q){Q=D.map(Q,function(S){return S&&J.isObject(S)?O.model.getIdentity(S):S});if(Q.length)return g(Q,[O.rootNode]);throw new T.PathError("Empty path");}))}).then(function(Q){O.set("selectedNodes",Q);return O.paths}))},_setSelectedNodeAttr:function(e){this.set("selectedNodes",
[e])},_setSelectedNodesAttr:function(e){this.dndController.setSelection(e)},expandAll:function(){function e(O){return g._expandNode(O).then(function(){var Q=D.filter(O.getChildren()||[],function(S){return S.isExpandable});return m(D.map(Q,e))})}var g=this;return R(e(this.rootNode))},collapseAll:function(){function e(O){var Q=D.filter(O.getChildren()||[],function(S){return S.isExpandable});Q=m(D.map(Q,e));return!O.isExpanded||O==g.rootNode&&!g.showRoot?Q:Q.then(function(){return g._collapseNode(O)})}
var g=this;return R(e(this.rootNode))},mayHaveChildren:function(){},getItemChildren:function(){},getLabel:function(e){return this.model.getLabel(e)},getIconClass:function(e,g){return!e||this.model.mayHaveChildren(e)?g?"dijitFolderOpened":"dijitFolderClosed":"dijitLeaf"},getLabelClass:function(){},getRowClass:function(){},getIconStyle:function(){},getLabelStyle:function(){},getRowStyle:function(){},getTooltip:function(){return""},_onDownArrow:function(e,g){(e=this._getNext(g))&&e.isTreeNode&&this.focusNode(e)},
_onUpArrow:function(e,g){if(e=g.getPreviousSibling())for(g=e;g.isExpandable&&g.isExpanded&&g.hasChildren();)g=g.getChildren(),g=g[g.length-1];else if(e=g.getParent(),this.showRoot||e!==this.rootNode)g=e;g&&g.isTreeNode&&this.focusNode(g)},_onRightArrow:function(e,g){g.isExpandable&&!g.isExpanded?this._expandNode(g):g.hasChildren()&&(g=g.getChildren()[0])&&g.isTreeNode&&this.focusNode(g)},_onLeftArrow:function(e,g){g.isExpandable&&g.isExpanded?this._collapseNode(g):(e=g.getParent())&&e.isTreeNode&&
(this.showRoot||e!==this.rootNode)&&this.focusNode(e)},focusLastChild:function(){var e=this._getLast();e&&e.isTreeNode&&this.focusNode(e)},_getFirst:function(){return this.showRoot?this.rootNode:this.rootNode.getChildren()[0]},_getLast:function(){for(var e=this.rootNode;e.isExpanded;){var g=e.getChildren();if(!g.length)break;e=g[g.length-1]}return e},_getNext:function(e){if(e.isExpandable&&e.isExpanded&&e.hasChildren())return e.getChildren()[0];for(;e&&e.isTreeNode;){var g=e.getNextSibling();if(g)return g;
e=e.getParent()}return null},childSelector:".dijitTreeRow",isExpandoNode:function(e,g){return w.isDescendant(e,g.expandoNode)||w.isDescendant(e,g.expandoNodeText)},_onNodePress:function(e,g){this.focusNode(e)},__click:function(e,g,O,Q){var S=this.isExpandoNode(g.target,e);e.isExpandable&&(O||S)?this._onExpandoClick({node:e}):(this._publish("execute",{item:e.item,node:e,evt:g}),this[Q](e.item,e,g),this.focusNode(e));g.stopPropagation();g.preventDefault()},_onClick:function(e,g){this.__click(e,g,this.openOnClick,
"onClick")},_onDblClick:function(e,g){this.__click(e,g,this.openOnDblClick,"onDblClick")},_onExpandoClick:function(e){e=e.node;this.focusNode(e);e.isExpanded?this._collapseNode(e):this._expandNode(e)},onClick:function(){},onDblClick:function(){},onOpen:function(){},onClose:function(){},_getNextNode:function(e){h.deprecated(this.declaredClass+"::_getNextNode(node) is deprecated. Use _getNext(node) instead.","","2.0");return this._getNext(e)},_getRootOrFirstNode:function(){h.deprecated(this.declaredClass+
"::_getRootOrFirstNode() is deprecated. Use _getFirst() instead.","","2.0");return this._getFirst()},_collapseNode:function(e){e._expandNodeDeferred&&delete e._expandNodeDeferred;if("Loading"!=e.state&&e.isExpanded){var g=e.collapse();this.onClose(e.item,e);this._state(e,!1);this._startPaint(g);return g}},_expandNode:function(e){if(e._expandNodeDeferred)return e._expandNodeDeferred;var g=this.model,O=e.item,Q=this;e._loadDeferred||(e.markProcessing(),e._loadDeferred=new l,g.getChildren(O,function(S){e.unmarkProcessing();
e.setChildItems(S).then(function(){e._loadDeferred.resolve(S)})},function(S){console.error(Q,": error loading "+e.label+" children: ",S);e._loadDeferred.reject(S)}));g=e._loadDeferred.then(J.hitch(this,function(){var S=e.expand();this.onOpen(e.item,e);this._state(e,!0);return S}));this._startPaint(g);return g},focusNode:function(e){for(var g=[],O=this.domNode;O&&O.tagName&&"IFRAME"!==O.tagName.toUpperCase();O=O.parentNode)g.push({domNode:O.contentWindow||O,scrollLeft:O.scrollLeft||0,scrollTop:O.scrollTop||
0});this.focusChild(e);this.defer(function(){for(var Q=0,S=g.length;Q<S;Q++)g[Q].domNode.scrollLeft=g[Q].scrollLeft,g[Q].domNode.scrollTop=g[Q].scrollTop},0)},_onNodeMouseEnter:function(){},_onNodeMouseLeave:function(){},_onItemChange:function(e){var g=this.model.getIdentity(e);if(g=this._itemNodesMap[g]){var O=this.getLabel(e),Q=this.getTooltip(e);D.forEach(g,function(S){S.set({item:e,label:O,tooltip:Q});S._updateItemClasses(e)})}},_onItemChildrenChange:function(e,g){e=this.model.getIdentity(e);
(e=this._itemNodesMap[e])&&D.forEach(e,function(O){O.setChildItems(g)})},_onItemDelete:function(e){e=this.model.getIdentity(e);var g=this._itemNodesMap[e];g&&(D.forEach(g,function(O){this.dndController.removeTreeNode(O);var Q=O.getParent();Q&&Q.removeChild(O);this.lastFocusedChild&&!w.isDescendant(this.lastFocusedChild.domNode,this.domNode)&&delete this.lastFocusedChild;this.focusedChild&&!w.isDescendant(this.focusedChild.domNode,this.domNode)&&this.focus();O.destroyRecursive()},this),delete this._itemNodesMap[e])},
_initState:function(){this._openedNodes={};if(this.persist&&this.cookieName){var e=P(this.cookieName);e&&D.forEach(e.split(","),function(g){this._openedNodes[g]=!0},this)}},_state:function(e,g){if(!this.persist)return!1;var O=D.map(e.getTreePath(),function(Q){return this.model.getIdentity(Q)},this).join("/");if(1===arguments.length)return this._openedNodes[O];g?this._openedNodes[O]=!0:delete this._openedNodes[O];this._saveExpandedNodes()},_saveExpandedNodes:function(){if(this.persist&&this.cookieName){var e=
[],g;for(g in this._openedNodes)e.push(g);P(this.cookieName,e.join(","),{expires:365})}},destroy:function(){this._curSearch&&(this._curSearch.timer.remove(),delete this._curSearch);this.rootNode&&this.rootNode.destroyRecursive();this.dndController&&!J.isString(this.dndController)&&this.dndController.destroy();this.rootNode=null;this.inherited(arguments)},destroyRecursive:function(){this.destroy()},resize:function(e){e&&L.setMarginBox(this.domNode,e);this._nodePixelIndent=L.position(this.tree.indentDetector).w||
this._nodePixelIndent;this.expandChildrenDeferred.then(J.hitch(this,function(){this.rootNode.set("indent",this.showRoot?0:-1);this._adjustWidths()}))},_outstandingPaintOperations:0,_startPaint:function(e){this._outstandingPaintOperations++;this._adjustWidthsTimer&&(this._adjustWidthsTimer.remove(),delete this._adjustWidthsTimer);var g=J.hitch(this,function(){this._outstandingPaintOperations--;0>=this._outstandingPaintOperations&&!this._adjustWidthsTimer&&this._started&&(this._adjustWidthsTimer=this.defer("_adjustWidths"))});
u(e,g,g)},_adjustWidths:function(){this._adjustWidthsTimer&&(this._adjustWidthsTimer.remove(),delete this._adjustWidthsTimer);this.containerNode.style.width="auto";this.containerNode.style.width=this.domNode.scrollWidth>this.domNode.offsetWidth?"auto":"100%"},_createTreeNode:function(e){return new U(e)},focus:function(){this.lastFocusedChild?this.focusNode(this.lastFocusedChild):this.focusFirstChild()}});f("dojo-bidi")&&T.extend({_setTextDirAttr:function(e){e&&this.textDir!=e&&(this._set("textDir",
e),this.rootNode.set("textDir",e))}});T.PathError=c("TreePathError");T._TreeNode=U;return T})},"dijit/tree/TreeStoreModel":function(){define(["dojo/_base/array","dojo/aspect","dojo/_base/declare","dojo/_base/lang"],function(D,E,P,G){return P("dijit.tree.TreeStoreModel",null,{store:null,childrenAttrs:["children"],newItemIdAttr:"id",labelAttr:"",root:null,query:null,deferItemLoadingUntilExpand:!1,constructor:function(l){G.mixin(this,l);this.connects=[];l=this.store;if(!l.getFeatures()["dojo.data.api.Identity"])throw Error("dijit.tree.TreeStoreModel: store must support dojo.data.Identity");
l.getFeatures()["dojo.data.api.Notification"]&&(this.connects=this.connects.concat([E.after(l,"onNew",G.hitch(this,"onNewItem"),!0),E.after(l,"onDelete",G.hitch(this,"onDeleteItem"),!0),E.after(l,"onSet",G.hitch(this,"onSetItem"),!0)]))},destroy:function(){for(var l;l=this.connects.pop();)l.remove()},getRoot:function(l,m){this.root?l(this.root):this.store.fetch({query:this.query,onComplete:G.hitch(this,function(w){if(1!=w.length)throw Error("dijit.tree.TreeStoreModel: root query returned "+w.length+
" items, but must return exactly one");this.root=w[0];l(this.root)}),onError:m})},mayHaveChildren:function(l){return D.some(this.childrenAttrs,function(m){return this.store.hasAttribute(l,m)},this)},getChildren:function(l,m,w){var t=this.store;if(t.isItemLoaded(l)){for(var L=[],k=0;k<this.childrenAttrs.length;k++){var c=t.getValues(l,this.childrenAttrs[k]);L=L.concat(c)}var a=0;this.deferItemLoadingUntilExpand||D.forEach(L,function(h){t.isItemLoaded(h)||a++});0==a?m(L):D.forEach(L,function(h,y){t.isItemLoaded(h)||
t.loadItem({item:h,onItem:function(J){L[y]=J;0==--a&&m(L)},onError:w})})}else{var f=G.hitch(this,arguments.callee);t.loadItem({item:l,onItem:function(h){f(h,m,w)},onError:w})}},isItem:function(l){return this.store.isItem(l)},fetchItemByIdentity:function(l){this.store.fetchItemByIdentity(l)},getIdentity:function(l){return this.store.getIdentity(l)},getLabel:function(l){return this.labelAttr?this.store.getValue(l,this.labelAttr):this.store.getLabel(l)},newItem:function(l,m,w){var t={parent:m,attribute:this.childrenAttrs[0]},
L;this.newItemIdAttr&&l[this.newItemIdAttr]?this.fetchItemByIdentity({identity:l[this.newItemIdAttr],scope:this,onItem:function(k){k?this.pasteItem(k,null,m,!0,w):(L=this.store.newItem(l,t))&&void 0!=w&&this.pasteItem(L,m,m,!1,w)}}):(L=this.store.newItem(l,t))&&void 0!=w&&this.pasteItem(L,m,m,!1,w)},pasteItem:function(l,m,w,t,L){var k=this.store,c=this.childrenAttrs[0];m&&D.forEach(this.childrenAttrs,function(f){if(k.containsValue(m,f,l)){if(!t){var h=D.filter(k.getValues(m,f),function(y){return y!=
l});k.setValues(m,f,h)}c=f}});if(w)if("number"==typeof L){var a=k.getValues(w,c).slice();a.splice(L,0,l);k.setValues(w,c,a)}else k.setValues(w,c,k.getValues(w,c).concat(l))},onChange:function(){},onChildrenChange:function(){},onDelete:function(){},onNewItem:function(l,m){m&&this.getChildren(m.item,G.hitch(this,function(w){this.onChildrenChange(m.item,w)}))},onDeleteItem:function(l){this.onDelete(l)},onSetItem:function(l,m){if(-1!=D.indexOf(this.childrenAttrs,m))this.getChildren(l,G.hitch(this,function(w){this.onChildrenChange(l,
w)}));else this.onChange(l)}})})},"dijit/tree/ForestStoreModel":function(){define(["dojo/_base/array","dojo/_base/declare","dojo/_base/kernel","dojo/_base/lang","./TreeStoreModel"],function(D,E,P,G,l){return E("dijit.tree.ForestStoreModel",l,{rootId:"$root$",rootLabel:"ROOT",query:null,constructor:function(m){this.root={store:this,root:!0,id:m.rootId,label:m.rootLabel,children:m.rootChildren}},mayHaveChildren:function(m){return m===this.root||this.inherited(arguments)},getChildren:function(m,w,t){m===
this.root?this.root.children?w(this.root.children):this.store.fetch({query:this.query,onComplete:G.hitch(this,function(L){this.root.children=L;w(L)}),onError:t}):this.inherited(arguments)},isItem:function(m){return m===this.root?!0:this.inherited(arguments)},fetchItemByIdentity:function(m){if(m.identity==this.root.id){var w=m.scope||P.global;m.onItem&&m.onItem.call(w,this.root)}else this.inherited(arguments)},getIdentity:function(m){return m===this.root?this.root.id:this.inherited(arguments)},getLabel:function(m){return m===
this.root?this.root.label:this.inherited(arguments)},newItem:function(m,w,t){return w===this.root?(this.onNewRootItem(m),this.store.newItem(m)):this.inherited(arguments)},onNewRootItem:function(){},pasteItem:function(m,w,t,L,k){if(w===this.root&&!L)this.onLeaveRoot(m);this.inherited(arguments,[m,w===this.root?null:w,t===this.root?null:t,L,k]);if(t===this.root)this.onAddToRoot(m)},onAddToRoot:function(m){console.log(this,": item ",m," added to root")},onLeaveRoot:function(m){console.log(this,": item ",
m," removed from root")},_requeryTop:function(){var m=this.root.children||[];this.store.fetch({query:this.query,onComplete:G.hitch(this,function(w){this.root.children=w;if(m.length!=w.length||D.some(m,function(t,L){return w[L]!=t}))this.onChildrenChange(this.root,w)})})},onNewItem:function(m,w){this._requeryTop();this.inherited(arguments)},onDeleteItem:function(m){-1!=D.indexOf(this.root.children,m)&&this._requeryTop();this.inherited(arguments)},onSetItem:function(m,w,t,L){this._requeryTop();this.inherited(arguments)}})})},
"dijit/tree/_dndSelector":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/kernel dojo/_base/lang dojo/dnd/common dojo/dom dojo/mouse dojo/on dojo/touch ../a11yclick ./_dndContainer".split(" "),function(D,E,P,G,l,m,w,t,L,k,c){return E("dijit.tree._dndSelector",c,{constructor:function(){this.selection={};this.anchor=null;this.events.push(t(this.tree.domNode,L.press,G.hitch(this,"onMouseDown")),t(this.tree.domNode,L.release,G.hitch(this,"onMouseUp")),t(this.tree.domNode,L.move,G.hitch(this,
"onMouseMove")),t(this.tree.domNode,k.press,G.hitch(this,"onClickPress")),t(this.tree.domNode,k.release,G.hitch(this,"onClickRelease")))},singular:!1,getSelectedTreeNodes:function(){var a=[],f=this.selection,h;for(h in f)a.push(f[h]);return a},selectNone:function(){this.setSelection([]);return this},destroy:function(){this.inherited(arguments);this.selection=this.anchor=null},addTreeNode:function(a,f){this.setSelection(this.getSelectedTreeNodes().concat([a]));f&&(this.anchor=a);return a},removeTreeNode:function(a){var f=
D.filter(this.getSelectedTreeNodes(),function(h){return!m.isDescendant(h.domNode,a.domNode)});this.setSelection(f);return a},isTreeNodeSelected:function(a){return a.id&&!!this.selection[a.id]},setSelection:function(a){var f=this.getSelectedTreeNodes();D.forEach(this._setDifference(f,a),G.hitch(this,function(h){h.setSelected(!1);this.anchor==h&&delete this.anchor;delete this.selection[h.id]}));D.forEach(this._setDifference(a,f),G.hitch(this,function(h){h.setSelected(!0);this.selection[h.id]=h}));this._updateSelectionProperties()},
_setDifference:function(a,f){D.forEach(f,function(h){h.__exclude__=!0});a=D.filter(a,function(h){return!h.__exclude__});D.forEach(f,function(h){delete h.__exclude__});return a},_updateSelectionProperties:function(){var a=this.getSelectedTreeNodes(),f=[],h=[];D.forEach(a,function(y){var J=y.getTreePath();h.push(y);f.push(J)},this);a=D.map(h,function(y){return y.item});this.tree._set("paths",f);this.tree._set("path",f[0]||[]);this.tree._set("selectedNodes",h);this.tree._set("selectedNode",h[0]||null);
this.tree._set("selectedItems",a);this.tree._set("selectedItem",a[0]||null)},onClickPress:function(a){if(!(this.current&&this.current.isExpandable&&this.tree.isExpandoNode(a.target,this.current))){"mousedown"==a.type&&w.isLeft(a)&&a.preventDefault();var f="keydown"==a.type?this.tree.focusedChild:this.current;if(f){var h=l.getCopyKeyState(a),y=f.id;this.singular||a.shiftKey||!this.selection[y]?(this._doDeselect=!1,this.userSelect(f,h,a.shiftKey)):this._doDeselect=!0}}},onClickRelease:function(a){this._doDeselect&&
(this._doDeselect=!1,this.userSelect("keyup"==a.type?this.tree.focusedChild:this.current,l.getCopyKeyState(a),a.shiftKey))},onMouseMove:function(){this._doDeselect=!1},onMouseDown:function(){},onMouseUp:function(){},_compareNodes:function(a,f){if(a===f)return 0;if("sourceIndex"in document.documentElement)return a.sourceIndex-f.sourceIndex;if("compareDocumentPosition"in document.documentElement)return a.compareDocumentPosition(f)&2?1:-1;if(document.createRange){var h=doc.createRange();h.setStartBefore(a);
a=doc.createRange();a.setStartBefore(f);return h.compareBoundaryPoints(h.END_TO_END,a)}throw Error("dijit.tree._compareNodes don't know how to compare two different nodes in this browser");},userSelect:function(a,f,h){if(this.singular)this.anchor==a&&f?this.selectNone():(this.setSelection([a]),this.anchor=a);else if(h&&this.anchor){f=this._compareNodes(this.anchor.rowNode,a.rowNode);h=this.anchor;0>f?f=h:(f=a,a=h);for(h=[];f!=a;)h.push(f),f=this.tree._getNext(f);h.push(a);this.setSelection(h)}else this.selection[a.id]&&
f?this.removeTreeNode(a):f?this.addTreeNode(a,!0):(this.setSelection([a]),this.anchor=a)},getItem:function(a){return{data:this.selection[a],type:["treeNode"]}},forInSelectedItems:function(a,f){f=f||P.global;for(var h in this.selection)a.call(f,this.getItem(h),h,this)}})})},"dijit/tree/_dndContainer":function(){define("dojo/aspect dojo/_base/declare dojo/dom-class dojo/_base/lang dojo/on dojo/touch".split(" "),function(D,E,P,G,l,m){return E("dijit.tree._dndContainer",null,{constructor:function(w,t){this.tree=
w;this.node=w.domNode;G.mixin(this,t);this.containerState="";P.add(this.node,"dojoDndContainer");this.events=[l(this.node,m.enter,G.hitch(this,"onOverEvent")),l(this.node,m.leave,G.hitch(this,"onOutEvent")),D.after(this.tree,"_onNodeMouseEnter",G.hitch(this,"onMouseOver"),!0),D.after(this.tree,"_onNodeMouseLeave",G.hitch(this,"onMouseOut"),!0),l(this.node,"dragstart, selectstart",function(L){L.preventDefault()})]},destroy:function(){for(var w;w=this.events.pop();)w.remove();this.node=this.parent=
null},onMouseOver:function(w){this.current=w},onMouseOut:function(){this.current=null},_changeState:function(w,t){var L="dojoDnd"+w;w=w.toLowerCase()+"State";P.replace(this.node,L+t,L+this[w]);this[w]=t},_addItemClass:function(w,t){P.add(w,"dojoDndItem"+t)},_removeItemClass:function(w,t){P.remove(w,"dojoDndItem"+t)},onOverEvent:function(){this._changeState("Container","Over")},onOutEvent:function(){this._changeState("Container","")}})})},"jimu/dijit/LayerChooserFromMapWithDropbox":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/html dojo/on dojo/keys dojo/Evented dojo/Deferred dijit/popup dijit/_WidgetBase dijit/_TemplatedMixin dojo/text!./templates/LayerChooserFromMapWithDropbox.html jimu/LayerInfos/LayerInfos".split(" "),
function(D,E,P,G,l,m,w,t,L,k,c,a){return D([L,k,m],{templateString:c,baseClass:"jimu-layer-chooser-from-map-withdropbox",declaredClass:"jimu.dijit.LayerChooserFromMapWithDropbox",_selectedItem:null,_isLayerChooserShow:!1,layerInfosObj:null,layerChooser:null,customClass:"",postMixInProperties:function(){this.inherited(arguments);this.nls=window.jimuNls.queryableLayerSource;this.nls.customSelectLayer=this.label?this.label:this.nls.selectLayer},postCreate:function(){this.inherited(arguments);this.layerInfosObj=
a.getInstanceSync();this.layerChooser.domNode.style.zIndex=1;this.layerChooser.tree.domNode.style.borderTop="0";this.layerChooser.tree.domNode.style.maxHeight="290px";this.own(G(this.layerChooser,"tree-click",E.hitch(this,this._onTreeClick)));this.own(G(this.layerChooser,"update",E.hitch(this,this._onLayerChooserUpdate)));this.own(G(document.body,"click",E.hitch(this,this._onBodyClicked)));this.own(G(document.body,"keydown",E.hitch(this,function(f){f.keyCode===l.ENTER&&this._onBodyClicked(f)})));
this.own(G(this.layerChooser.domNode,"keydown",E.hitch(this,function(f){f.keyCode===l.ESCAPE&&this.hideLayerChooser()})))},destroy:function(){this.hideLayerChooser();this.layerChooser&&this.layerChooser.destroy();this.layerChooser=null;this.inherited(arguments)},getLayerChooser:function(){return this.layerChooser},setSelectedLayer:function(f){var h=new w;if(f){var y=this.layerInfosObj.getLayerOrTableInfoById(f.id);y?this.layerChooser.filter(y).then(E.hitch(this,function(J){J?(this._onSelectNewItem({layerInfo:y,
name:y.title,url:f.url}),h.resolve(!0)):h.resolve(!1)}),E.hitch(this,function(){h.resolve(!1)})):h.resolve(!1)}else this._onSelectNewItem(null),h.resolve(!0);return h},getSelectedItem:function(){return this._selectedItem},getSelectedItems:function(){return[this._selectedItem]},_onBodyClicked:function(f){f=f.target||f.srcElement;f===this.domNode||P.isDescendant(f,this.domNode)||f===this.layerChooser.domNode||P.isDescendant(f,this.layerChooser.domNode)||this.hideLayerChooser()},_onDropDownClick:function(f){f.stopPropagation();
f.preventDefault();this._isLayerChooserShow?this.hideLayerChooser():(this.isActive=!0,this.showLayerChooser())},_onDropDownKeydown:function(f){f.keyCode===l.ENTER&&this._onDropDownClick(f)},_getSelectedItems:function(){return this.layerChooser.getSelectedItems()},showLayerChooser:function(){this.layerChooser.domNode.style.minWidth=this.domNode.clientWidth+2+"px";t.open({parent:this,popup:this.layerChooser,around:this.domNode});var f=this.layerChooser.domNode.parentNode;f&&(P.addClass(f,"jimu-layer-chooser-from-map-withdropbox-popup"),
this.customClass&&P.addClass(f,this.customClass),this.layerChooser.tree.domNode.focus());this._isLayerChooserShow=!0},hideLayerChooser:function(){t.close(this.layerChooser);this._isLayerChooserShow=!1;this.isActive&&(this.dropDownBtn.focus(),this.isActive=!1)},_onLayerChooserUpdate:function(){this._selectedItem&&this.layerChooser.onlyShowVisible&&!this._selectedItem.layerInfo.isShowInMap()&&(this._selectedItem=null,this.emit("selection-change",[]))},_onSelectNewItem:function(f){var h=E.getObject("layerInfo.id",
!1,this._selectedItem)||-1,y=E.getObject("layerInfo.id",!1,f)||-1;h=h!==y;this._selectedItem=f;this.hideLayerChooser();f=E.getObject("layerInfo.title",!1,this._selectedItem)||"";this.layerNameNode.innerHTML=f;P.setAttr(this.layerNameNode,"title",f);f=E.getObject("layerInfo.layerObject",!1,this._selectedItem);h&&this.emit("selection-change",[f])},_onTreeClick:function(){var f=this._getSelectedItems();this._onSelectNewItem(0<f.length?f[0]:null)}})})},"jimu/dijit/FeatureSetChooserForSingleLayer":function(){define("dojo/on dojo/Evented dojo/_base/lang dojo/_base/array dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin jimu/dijit/DrawBox jimu/dijit/_FeatureSetChooserCore esri/symbols/jsonUtils".split(" "),
function(D,E,P,G,l,m,w,t,L,k,c){return l([m,w,t,E],{baseClass:"jimu-single-layer-featureset-chooser",templateString:"\x3cdiv\x3e\x3c/div\x3e",drawBox:null,map:null,featureLayer:null,updateSelection:!1,postCreate:function(){this.inherited(arguments);var a=c.fromJson({style:"esriSFSSolid",color:[79,129,189,77],type:"esriSFS",outline:{style:"esriSLSSolid",color:[54,93,141,255],width:1.5,type:"esriSLS"}});this.drawBox=new L({map:this.map,showClear:!0,keepOneGraphic:!0,geoTypes:["EXTENT"]});this.drawBox.setPolygonSymbol(a);
a=this.drawBox.getDrawItemIcons();G.forEach(a,P.hitch(this,function(f){f.title=""}));this.drawBox.extentIcon.title=window.jimuNls.spatialFilterByFeatures.drawShapesTip;this.drawBox.placeAt(this.domNode);this.own(D(this.drawBox,"user-clear",P.hitch(this,this._onDrawBoxUserClear)));this.own(D(this.drawBox,"draw-activate",P.hitch(this,function(){this.emit("draw-activate")})));this.own(D(this.drawBox,"draw-deactivate",P.hitch(this,function(){this.emit("draw-deactivate")})));this.own(D(this.drawBox,"draw-end",
P.hitch(this,this._onDrawEnd)));this.featureSetChooserCore=new k({map:this.map,featureLayer:this.featureLayer,drawBox:this.drawBox,updateSelection:this.updateSelection});this.own(D(this.featureSetChooserCore,"loading",P.hitch(this,function(){this.emit("loading")})));this.own(D(this.featureSetChooserCore,"unloading",P.hitch(this,function(){this.emit("unloading")})));this.own(D(this.featureLayer,"visibility-change",P.hitch(this,function(){this.featureLayer.visible?this.drawBox.enable():this.drawBox.disable()})))},
getFeatures:function(){return this.featureSetChooserCore.getFeatures()},syncGetFeatures:function(){return this.featureSetChooserCore.syncGetFeatures()},disable:function(){this.drawBox.disable()},enable:function(){this.drawBox.enable()},deactivate:function(){this.drawBox.deactivate()},clearAllGraphics:function(){this.featureSetChooserCore.clear(!1)},isLoading:function(){return this.featureSetChooserCore.isLoading()},getFeatureLayer:function(){return this.featureLayer},destroy:function(){this.featureSetChooserCore&&
this.featureSetChooserCore.destroy();this.featureSetChooserCore=null;this.inherited(arguments)},_onDrawEnd:function(){this.drawBox.clear()},_onDrawBoxUserClear:function(){this.clearAllGraphics();this.emit("user-clear")},showMiddleFeatureLayer:function(){this.featureSetChooserCore&&this.featureSetChooserCore.showMiddleFeatureLayer()},hideMiddleFeatureLayer:function(){this.featureSetChooserCore&&this.featureSetChooserCore.hideMiddleFeatureLayer()}})})},"jimu/dijit/_FeatureSetChooserCore":function(){define("dojo/on dojo/sniff dojo/Evented dojo/Deferred dojo/_base/lang dojo/_base/array dojo/_base/declare jimu/utils jimu/symbolUtils jimu/SelectionManager jimu/LayerInfos/LayerInfos esri/graphic esri/tasks/query esri/tasks/QueryTask esri/layers/FeatureLayer esri/symbols/jsonUtils esri/geometry/geometryEngine".split(" "),
function(D,E,P,G,l,m,w,t,L,k,c,a,f,h,y,J,I){return w([P],{baseClass:"jimu-featureset-chooser-core",_middleFeatureLayer:null,_isLoading:!1,_def:null,_isDestroyed:!1,_handles:null,selectionManager:null,layerInfosObj:null,layerInfo:null,map:null,featureLayer:null,drawBox:null,updateSelection:!1,fullyWithin:!1,constructor:function(q){l.mixin(this,q);this.layerInfosObj=c.getInstanceSync();this.selectionManager=k.getInstance();this.featureLayer.getSelectionSymbol()||this.selectionManager.setSelectionSymbol(this.featureLayer);
q=t.getFeatureLayerDefinition(this.featureLayer);delete q.id;this._middleFeatureLayer=new y({layerDefinition:q,featureSet:null},{id:"featureLayer_"+t.getRandomString()});q=null;var F=this._middleFeatureLayer.geometryType;"esriGeometryPoint"===F?q=L.getDefaultMarkerSymbol():"esriGeometryPolyline"===F?q=L.getDefaultLineSymbol():"esriGeometryPolygon"===F&&(q=J.fromJson({style:"esriSFSSolid",color:[79,129,189,77],type:"esriSFS",outline:{style:"esriSLSSolid",color:[54,93,141,255],width:1.5,type:"esriSLS"}}));
this._middleFeatureLayer.setSelectionSymbol(q);q=D(this.drawBox,"user-clear",l.hitch(this,this._onDrawBoxUserClear));F=D(this.drawBox,"draw-end",l.hitch(this,this._onDrawEnd));this._handles=[q,F];if(this.layerInfo=this.layerInfosObj.getLayerInfoById(this.featureLayer.id))q=D(this.layerInfo,"filterChanged",l.hitch(this,this._handleFilterChange)),this._handles.push(q)},hideMiddleFeatureLayer:function(){if(this._middleFeatureLayer){this._middleFeatureLayer.hide();var q=this.selectionManager.getDisplayLayer(this._middleFeatureLayer.id);
q&&q.hide()}},showMiddleFeatureLayer:function(){if(this._middleFeatureLayer){this._middleFeatureLayer.show();var q=this.selectionManager.getDisplayLayer(this._middleFeatureLayer.id);q&&q.show()}},clear:function(q){this.drawBox.clear();this._clearMiddleFeatureLayer();q&&this.selectionManager.clearSelection(this.featureLayer)},getFeatures:function(){var q=new G,F=l.hitch(this,function(){var C=this.syncGetFeatures();q.resolve(C)}),u=l.hitch(this,function(C){q.reject(C)});1===this._getDeferredStatus(this._def)?
this._def.then(F,u):F();return q},syncGetFeatures:function(){return(this.updateSelection?this.featureLayer:this._middleFeatureLayer).getSelectedFeatures()},isLoading:function(){return 1===this._getDeferredStatus(this._def)},_onLoading:function(){this.drawBox.deactivate();this.emit("loading")},_onUnloading:function(){this.emit("unloading")},_getDeferredStatus:function(q){var F=0;return F=q?q.isResolved()?2:q.isRejected()?-1:1:0},_onDrawEnd:function(q,F,u,C,z,M){if(this.isLoading())throw"should not draw when loading";
if(this.featureLayer.visible){var p=new G;this._def=p;var H=y.SELECTION_NEW;C&&(H=y.SELECTION_ADD);E("mac")?M&&(H=y.SELECTION_SUBTRACT):z&&(H=y.SELECTION_SUBTRACT);this.emit("loading");this._getFeaturesByGeometry(q.geometry).then(l.hitch(this,function(r){this.selectionManager.updateSelectionByFeatures(this.updateSelection?this.featureLayer:this._middleFeatureLayer,r,H);this._onUnloading();p.resolve(r)}),l.hitch(this,function(r){console.error(r);this._onUnloading();p.reject(r)}))}},_addTolerance:function(q){var F=
2.54*this.map.getScale()/9600;return I.buffer(q,10*F,"meters")},_getFeaturesByGeometry:function(q){"point"!==q.type&&"polyline"!==q.type||"esriGeometryPoint"!==this.featureLayer.geometryType||(q=this._addTolerance(q));var F=new G,u=[];if(this.featureLayer.getMap()&&this.featureLayer.mode!==y.MODE_SELECTION)q=this.selectionManager.getClientFeaturesByGeometry(this.featureLayer,q,this.fullyWithin),0<q.length&&(u=m.map(q,l.hitch(this,function(z){return new a(z.toJson())}))),F.resolve(u);else{u=new f;
u.geometry=q;u.outSpatialReference=this.map.spatialReference;u.returnGeometry=!0;u.spatialRelationship=this.fullyWithin?f.SPATIAL_REL_CONTAINS:f.SPATIAL_REL_INTERSECTS;(q=this.featureLayer.getDefinitionExpression())||(q="1\x3d1");if(this.layerInfo){var C=this.layerInfo.getFilter();C&&(q="("+q+") AND ("+C+")")}q&&(u.where=q);u.outFields=["*"];(new h(this.featureLayer.url)).execute(u).then(l.hitch(this,function(z){F.resolve(z.features)}),l.hitch(this,function(z){F.reject(z)}))}return F},_onDrawBoxUserClear:function(){this.clear()},
_clearMiddleFeatureLayer:function(){this._middleFeatureLayer&&(this._middleFeatureLayer.clear(),this.selectionManager.clearSelection(this._middleFeatureLayer))},_handleFilterChange:function(){var q=this.layerInfo.getFilter()||"1\x3d1",F=this.featureLayer.getSelectedFeatures(),u=this.featureLayer.objectIdField;if(F&&0<F.length){var C=m.map(F,function(M){return M.attributes[u]}),z=new f;z.where=u+" in ("+C.join(",")+") AND "+q;(new h(this.featureLayer.url)).executeForIds(z).then(l.hitch(this,function(M){m.forEach(F,
function(p){0<=M.indexOf(p.attributes[u])?p.show():p.hide()});this.selectionManager._isLayerNeedDisplayLayer(this.featureLayer)&&this.selectionManager._updateDisplayLayer(this.featureLayer,F,y.SELECTION_NEW);this.featureLayer.emit("selection-complete",{features:this.featureLayer.getSelectedFeatures()})}),l.hitch(this,function(M){console.error(M)}))}},destroy:function(){this._isDestroyed||(m.forEach(this._handles,l.hitch(this,function(q){q.remove()})),this._handles=null,this.clear());this._isDestroyed=
!0}})})},"widgets/Query/SingleQueryResult":function(){define("dojo/_base/declare dijit/_WidgetBase jimu/dijit/BindLabelPropsMixin dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/Evented dojo/text!./SingleQueryResult.html dojo/_base/lang dojo/on dojo/keys dojo/_base/query dojo/_base/html dojo/_base/array dojo/Deferred esri/lang esri/tasks/QueryTask esri/tasks/FeatureSet esri/dijit/PopupTemplate esri/dijit/PopupRenderer esri/tasks/RelationshipQuery jimu/utils jimu/symbolUtils jimu/dijit/Popup jimu/dijit/Message jimu/dijit/FeatureActionPopupMenu jimu/BaseFeatureAction jimu/dijit/SymbolChooser jimu/LayerInfos/LayerInfos jimu/FeatureActionManager ./SingleQueryLoader ./RelatedRecordsResult jimu/dijit/LoadingIndicator jimu/dijit/formSelect".split(" "),
function(D,E,P,G,l,m,w,t,L,k,c,a,f,h,y,J,I,q,F,u,C,z,M,p,H,r,B,b,n,v,K){return D([E,P,G,l,m],{baseClass:"single-query-result",templateString:w,singleQueryLoader:null,featureLayer:null,singleRelatedRecordsResult:null,multipleRelatedRecordsResult:null,popupMenu:null,map:null,nls:null,currentAttrs:null,queryWidget:null,_lastFeatureClass:"jimu-table-row-last",_lastFeatureArrowClass:"popup-title-icon",_lastRelatedClass:"related-table-btn-last",postMixInProperties:function(){this.inherited(arguments);this.isRenderIdForAttrs=
!0;var d=window.jimuNls.common;this.nls.back=d.back;this.nls.expand=d.expand.split(" $")[0];this.nls.collapse=d.collapse.split(" $")[0]},getCurrentAttrs:function(){return this.singleQueryLoader?this.singleQueryLoader.getCurrentAttrs():null},postCreate:function(){this.inherited(arguments);this.singleQueryLoader=new v(this.map,this.currentAttrs);this.popupMenu=H.getInstance();this.featureActionManager=n.getInstance();this.btnFeatureAction.title=window.jimuNls.featureActions.featureActions;this._initExpandListIcon();
this.own(L(this.multipleRelatedRecordsDiv,"keydown",t.hitch(this,function(d){d.keyCode===k.ESCAPE&&d.target!==this.multipleRelatedRecordsResultBackBtn&&(d.stopPropagation(),this.multipleRelatedRecordsResultBackBtn.focus())})));this.own(L(this.singleRelatedRecordsResultDiv,"keydown",t.hitch(this,function(d){d.keyCode===k.ESCAPE&&d.target!==this.singleRelatedRecordsResultBackBtn&&(d.stopPropagation(),this.singleRelatedRecordsResultBackBtn.focus())})))},_initExpandListIcon:function(){var d=this.getCurrentAttrs();
(d=d&&d.config)&&d.defaultExpand?(a.addClass(this.expandedListIcon,"expanded"),this.expandedListIcon.title=this.nls.collapseAll,a.addClass(this.resultsTbody,"expanded")):(a.addClass(this.expandedListIcon,"folded"),this.expandedListIcon.title=this.nls.expandAll,a.addClass(this.resultsTbody,"folded"))},destroy:function(){this.emit("features-update",{taskIndex:this.currentAttrs.queryTr.taskIndex});this.queryWidget=null;var d=this.getCurrentAttrs();d&&d.query&&(d.query.resultLayer&&d.query.resultLayer.getMap()&&
this.map.removeLayer(d.query.resultLayer),d.query.resultLayer=null);this.inherited(arguments)},_isValidNumber:function(d){return"number"===typeof d&&!isNaN(d)},zoomToLayer:function(){var d=this.getCurrentAttrs(),x=d.query.resultLayer;x&&!this._isTable(d.layerInfo)&&(d=f.filter(x.graphics,t.hitch(this,function(A){return(A=A.geometry)?"point"===A.type?this._isValidNumber(A.x)&&this._isValidNumber(A.y):"multipoint"===A.type?A.points&&0<A.points.length?f.every(A.points,t.hitch(this,function(N){return N?
this._isValidNumber(N[0])&&this._isValidNumber(N[1]):!1})):!1:!0:!1})),0<d.length&&(d=C.toFeatureSet(d),C.zoomToFeatureSet(this.map,d)))},_emitFeaturesUpdate:function(){this.emit("features-update",{taskIndex:this.currentAttrs.queryTr.taskIndex,features:this.currentAttrs.query.resultLayer.graphics})},executeQueryForFirstTime:function(){var d=new h;this._clearResultPage();this._hideResultsNumberDiv();var x=this.getCurrentAttrs(),A=x.query.resultLayer,N=t.hitch(this,function(U){if(this.domNode){this.shelter.hide();
var T=x.query.allCount;this._updateNumSpan(x.query.foundedNum,T);0<T&&(this._addResultItems(U,A),this._addResultLayerToMap(A),this.zoomToLayer());d.resolve(T);this._emitFeaturesUpdate()}}),R=t.hitch(this,function(U){console.error(U);this.domNode&&(this.shelter.hide(),A&&this.map.removeLayer(A),A=null,this._showQueryErrorMsg(),d.reject(U))});this.shelter.show();3!==x.queryType&&this._showResultsNumberDiv();this.singleQueryLoader.executeQueryForFirstTime().then(N,R);return d},getResultLayer:function(){var d=
this.getCurrentAttrs();return t.getObject("query.resultLayer",!1,d)},showResultLayer:function(){var d=this.getResultLayer();d&&d.show()},hideResultLayer:function(){var d=this.getResultLayer();d&&d.hide()},showLayer:function(){this.showResultLayer();this.multipleRelatedRecordsResult&&this.multipleRelatedRecordsResult.showLayer();this.singleRelatedRecordsResult&&this.singleRelatedRecordsResult.showLayer()},hideLayer:function(){this.hideResultLayer();this.multipleRelatedRecordsResult&&this.multipleRelatedRecordsResult.hideLayer();
this.singleRelatedRecordsResult&&this.singleRelatedRecordsResult.hideLayer()},_addResultLayerToMap:function(d){0>this.map.graphicsLayerIds.indexOf(d.id)&&this.map.addLayer(d)},_showResultsNumberDiv:function(){a.setStyle(this.resultsNumberDiv,"display","flex")},_hideResultsNumberDiv:function(){a.setStyle(this.resultsNumberDiv,"display","none")},_updateNumSpan:function(d,x){d>x&&(d=x);this._updateLoadMoreVisible(d<x);d=C.localizeNumber(d);x=C.localizeNumber(x);this.numSpan.innerHTML=d+"/"+x},_isTable:function(d){return"Table"===
d.type},_onResultsScroll:function(){C.isScrollToBottom(this.resultsContainer)&&this._continueQuery()},_continueQuery:function(){var d=this.getCurrentAttrs(),x=d.query.allCount,A=d.query.foundedNum;if(!(A>=x)){var N=d.query.resultLayer,R=t.hitch(this,function(T){this.domNode&&(this._updateLoadMoreState(!1),this.shelter.hide(),A=d.query.foundedNum,this._updateNumSpan(A,x),this._addResultItems(T,N),this.zoomToLayer(),this._emitFeaturesUpdate(),this.emit("features-layout-update"))}),U=t.hitch(this,function(T){console.error(T);
this.domNode&&(this._updateLoadMoreState(!1),this._showQueryErrorMsg(),this.shelter.hide())});this.shelter.show();this._updateLoadMoreState(!0);this.singleQueryLoader.executeQueryWhenScrollToBottom().then(R,U)}},_clearResultPage:function(){this._hideInfoWindow();this._unSelectResultTr();a.empty(this.resultsTbody);this._updateNumSpan(0,0)},_unSelectResultTr:function(){this.resultTr&&a.removeClass(this.resultTr,"jimu-state-active");this.resultTr=null},_selectResultTr:function(d){this._unSelectResultTr();
(this.resultTr=d)&&a.addClass(this.resultTr,"jimu-state-active")},_addResultItems:function(d,x){var A=this.getCurrentAttrs(),N=A.config.url,R=A.config.objectIdField,U=this._getCurrentRelationships(),T=t.clone(A.config.popupInfo);T.mediaInfos=[];var e=new q(T),g=!0;x.renderer||(g=!1);var O=this._isWebMapShowRelatedRecordsEnabled();this._featuresNum=d.length;f.forEach(d,t.hitch(this,function(Q,S){var Y="";Y=0===S%2?"even":"odd";x.add(Q);this._createQueryResultItem({resultLayer:x,feature:Q,trClass:Y,
popupTemplate2:e,relationships:U,objectIdField:R,url:N,relationshipPopupTemplates:A.relationshipPopupTemplates,shouldCreateSymbolNode:g,isWebMapShowRelatedRecordsEnabled:O},S)}))},_updateLoadMoreVisible:function(d){d?a.removeClass(this.loadMoreIcon,"query-hidden"):a.addClass(this.loadMoreIcon,"query-hidden")},_updateLoadMoreState:function(d){d?a.addClass(this.loadMoreIcon,"loading"):a.removeClass(this.loadMoreIcon,"loading")},_onLoadMoreClicked:function(){this._continueQuery()},_onLoadMoreKeydown:function(d){d.keyCode!==
k.ENTER&&d.keyCode!==k.SPACE||this._onLoadMoreClicked()},_clearPopItemClass:function(){var d=c(".query-result-item-table .popup-td.expanded",this.resultsTbody),x=c(".query-result-item-table .popup-td.folded",this.resultsTbody);d&&d.length&&d.removeClass("expanded");x&&x.length&&x.removeClass("folded")},_onExpandClicked:function(){var d=this.nls.expand;this._clearPopItemClass();a.hasClass(this.resultsTbody,"expanded")?(a.addClass(this.expandedListIcon,"folded"),a.removeClass(this.resultsTbody,"expanded"),
a.addClass(this.resultsTbody,"folded"),this.expandedListIcon.title=this.nls.expandAll):(a.removeClass(this.expandedListIcon,"folded"),a.addClass(this.resultsTbody,"expanded"),a.removeClass(this.resultsTbody,"folded"),this.expandedListIcon.title=this.nls.collapseAll,d=this.nls.collapse);for(var x=c(".popup-title-icon",this.resultsTbody),A=0;A<x.length;A++)a.setAttr(x[A],"aria-label",d);this.emit("features-layout-update")},_onExpandKeydown:function(d){d.keyCode!==k.ENTER&&d.keyCode!==k.SPACE||this._onExpandClicked()},
_getPopupTitle:function(d,x){if(d)return"function"===typeof d.title?d.title(x):d.title},_createQueryResultItem:function(d,x){var A="",N="",R="";x===this._featuresNum-1&&(A=" "+this._lastFeatureClass,N=" "+this._lastRelatedClass,R='data-lastArrow\x3d"true"');var U=d.resultLayer,T=d.feature,e=d.trClass,g=d.popupTemplate2,O=d.relationships,Q=d.objectIdField,S=d.url,Y=d.relationshipPopupTemplates,V=d.shouldCreateSymbolNode;d=d.isWebMapShowRelatedRecordsEnabled;if(T&&T.attributes){var aa=this._getPopupTitle(g,
T);A=a.toDom('\x3ctr role\x3d"button" tabindex\x3d"0" class\x3d"jimu-table-row jimu-table-row-separator query-result-item'+A+'"  cellpadding\x3d"0" cellspacing\x3d"0"\x3e\x3ctd\x3e\x3ctable class\x3d"query-result-item-table"\x3e\x3ctbody\x3e\x3ctr\x3e\x3ctd class\x3d"symbol-td"\x3e\x3c/td\x3e\x3ctd class\x3d"popup-td expanded"\x3e\x3cdiv class\x3d"popup-title-container"\x3e\x3cdiv class\x3d"popup-title"\x3e'+aa+'\x3c/div\x3e\x3cdiv role\x3d"button" tabindex\x3d"0" aria-label\x3d"'+this.nls.collapse+
'" '+R+' class\x3d"popup-title-icon"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"popup-content"\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/tbody\x3e\x3c/table\x3e\x3c/td\x3e\x3c/tr\x3e');a.addClass(A,e);a.place(A,this.resultsTbody);A.feature=T;e=c(".symbol-td",A)[0];if(V)try{var X=U.renderer;if(X){var ca=X.getSymbol(T);if(ca){var W=z.createSymbolNode(ca,{width:32,height:32});W&&a.place(W,e)}}}catch(Z){console.error(Z)}else a.destroy(e);var ea=c(".popup-td .popup-content",A)[0];U=g.title;V=g.info&&
g.info.title;g.title=null;V&&(g.info.title=null);X=new F({template:g,graphic:T,chartTheme:g.chartTheme});a.place(X.domNode,ea);X.startup();g.title=U;V&&(g.info.title=V);if(Q&&O&&0<O.length&&d){var da=T.attributes[Q];f.forEach(O,t.hitch(this,function(Z,ba){var ha=this._getRelationshipLayerInfo(Z.relatedTableId),ia=ha.name,ja=Y[Z.relatedTableId],fa="related-table-btn";x===this._featuresNum-1&&ba===O.length-1&&(fa=fa+" "+N);ba=a.create("div",{"class":fa,role:"button",tabindex:"0",innerHTML:ia},ea);ba.queryStatus=
"unload";ba.url=S;ba.layerName=ia;ba.objectId=da;ba.relationship=Z;ba.relationshipLayerInfo=ha;ba.relationshipPopupTemplate=ja}))}}},_onBtnMultipleRelatedBackClicked:function(){this._showFeaturesResultDiv()},_onBtnMultipleRelatedBackKeydown:function(d){d.keyCode===k.ENTER||d.keyCode===k.SPACE||d.keyCode===k.ESCAPE?(d.stopPropagation(),this._onBtnMultipleRelatedBackClicked(),this.btnFeatureAction.focus()):d.keyCode===k.TAB&&d.shiftKey&&(d.preventDefault(),this.multipleRelatedRecordsResult.lastFocusItem.focus())},
_onBtnSingleRelatedBackClicked:function(){this._showFeaturesResultDiv()},_onBtnSingleRelatedBackKeydown:function(d){d.keyCode===k.ENTER||d.keyCode===k.SPACE||d.keyCode===k.ESCAPE?(d.stopPropagation(),this._onBtnSingleRelatedBackClicked(),this._currentRelatedRecord.focus()):d.keyCode===k.TAB&&d.shiftKey&&d.stopPropagation()},_onBtnSingleRelatedTitleKeydown:function(d){d.keyCode===k.TAB&&d.shiftKey&&(d.preventDefault(),this.singleRelatedRecordsResult.lastFocusItem.focus())},_showFeaturesResultDiv:function(){this.multipleRelatedRecordsResult&&
this.multipleRelatedRecordsResult.destroy();this.multipleRelatedRecordsResult=null;this.singleRelatedRecordsResult&&this.singleRelatedRecordsResult.destroy();this.singleRelatedRecordsResult=null;a.addClass(this.multipleRelatedRecordsDiv,"not-visible");a.addClass(this.singleRelatedRecordsResultDiv,"not-visible");a.removeClass(this.featuresResultDiv,"not-visible");this.emit("hide-related-records")},_showMultipleRelatedRecords:function(){this.singleRelatedRecordsResult&&this.singleRelatedRecordsResult.destroy();
this.singleRelatedRecordsResult=null;a.addClass(this.featuresResultDiv,"not-visible");a.addClass(this.singleRelatedRecordsResultDiv,"not-visible");a.removeClass(this.multipleRelatedRecordsDiv,"not-visible");this.emit("show-related-records");var d=this._getCurrentRelationships();this.relatedLayersSelect.removeOption(this.relatedLayersSelect.getOptions());f.forEach(d,t.hitch(this,function(x){var A=this._getRelationshipLayerInfo(x.relatedTableId);this.relatedLayersSelect.addOption({value:x.id+"",label:A.name,
relationship:x,relationshipLayerInfo:A,relationshipPopupTemplate:this.currentAttrs.relationshipPopupTemplates[x.relatedTableId]})}));this._onRelatedLayersSelectChanged()},_onRelatedLayersSelectChanged:function(){var d=this.relatedLayersSelect.get("value"),x=this.relatedLayersSelect.getOptions(d);if(x){this.multipleRelatedRecordsResult&&this.multipleRelatedRecordsResult.destroy();this.multipleRelatedRecordsResult=new K({map:this.map,layerDefinition:x.relationshipLayerInfo,nls:this.nls,config:this.currentAttrs.config});
this.multipleRelatedRecordsResult.placeAt(this.multipleRelatedRecordsDiv);this.multipleRelatedRecordsResult.lastFocusItem=this.multipleRelatedRecordsResultBackBtn;this.multipleRelatedRecordsResultBackBtn.focus();this.own(L(this.multipleRelatedRecordsResult,"focus-result-header",t.hitch(this,function(){this.multipleRelatedRecordsResultBackBtn.focus()})));var A=this.currentAttrs.config.url;this.shelter.show();var N=t.hitch(this,function(R){console.error(R);this.domNode&&this.shelter.hide()});this.singleQueryLoader.getObjectIdsForAllRelatedRecordsAction().then(t.hitch(this,
function(R){this._queryRelatedRecords(A,R,x.relationship.id).then(t.hitch(this,function(U){if(this.domNode){this.shelter.hide();var T=[];f.forEach(R,t.hitch(this,function(O){(O=U[O])&&O.features&&0<O.features.length&&(T=T.concat(O.features))}));var e=x.relationshipLayerInfo,g=new I;g.fields=t.clone(e.fields);g.features=T;g.geometryType=e.geometryType;g.fieldAliases={};f.forEach(g.fields,t.hitch(this,function(O){var Q=O.name;g.fieldAliases[Q]=O.alias||Q}));this.multipleRelatedRecordsResult.setResult(x.relationshipPopupTemplate,
g)}}),N)}),N)}},_showSingleRelatedRecordsDiv:function(){this.multipleRelatedRecordsResult&&this.multipleRelatedRecordsResult.destroy();this.multipleRelatedRecordsResult=null;a.addClass(this.featuresResultDiv,"not-visible");a.addClass(this.multipleRelatedRecordsDiv,"not-visible");a.removeClass(this.singleRelatedRecordsResultDiv,"not-visible");this.emit("show-related-records")},_onSingleRelatedTableButtonClicked:function(d){this.singleRelatedRecordsResult&&this.singleRelatedRecordsResult.destroy();
this.singleRelatedRecordsResult=null;var x=d.url,A=d.layerName,N=d.objectId,R=d.relationship,U=d.relationshipLayerInfo,T=d.relationshipPopupTemplate;this.singleRelatedRecordsResult=new K({map:this.map,layerDefinition:U,nls:this.nls,config:this.currentAttrs.config});this.singleRelatedRecordsResult.placeAt(this.singleRelatedRecordsResultDiv);this.singleRelatedRecordsResultTitle.lastFocusItem=this.singleRelatedRecordsResultBackBtn;this.own(L(this.singleRelatedRecordsResult,"focus-result-header",t.hitch(this,
function(){this.singleRelatedRecordsResultTitle.focus()})));this._showSingleRelatedRecordsDiv();var e=t.hitch(this,function(){var g=new I;g.fields=t.clone(U.fields);g.features=d.relatedFeatures;g.geometryType=U.geometryType;g.fieldAliases={};f.forEach(g.fields,t.hitch(this,function(O){var Q=O.name;g.fieldAliases[Q]=O.alias||Q}));this.singleRelatedRecordsResult.setResult(T,g);this.relatedTitleDiv.innerHTML=A;this.singleRelatedRecordsResultTitle.focus();this._currentRelatedRecord=d});"unload"===d.queryStatus?
(d.queryStatus="loading",this.shelter.show(),this._queryRelatedRecords(x,[N],R.id).then(t.hitch(this,function(g){this.domNode&&(this.shelter.hide(),g=(g=(g=g&&g[N])&&g.features)||[],d.relatedFeatures=g,d.queryStatus="loaded",e())}),t.hitch(this,function(g){this.domNode&&(this.shelter.hide(),console.error(g),d.queryStatus="unload",e())}))):"loaded"===d.queryStatus&&e()},_queryRelatedRecords:function(d,x,A){d=new J(d);var N=new u;N.objectIds=x;N.relationshipId=A;N.outFields=["*"];N.returnGeometry=!0;
N.outSpatialReference=this.map.spatialReference;return d.executeRelationshipQuery(N)},_getCurrentRelationships:function(){return this.getCurrentAttrs().queryTr.layerInfo.relationships||[]},_getRelationshipInfo:function(d){for(var x=this._getCurrentRelationships(),A=0;A<x.length;A++)if(x[A].id===d)return x[A];return null},_getRelationshipLayerInfo:function(d){return this.getCurrentAttrs().relationshipLayerInfos[d]},_tryLocaleNumber:function(d){var x=d;if(y.isDefined(d)&&isFinite(d))try{var A=C.localizeNumber(d);
"string"===typeof A&&(x=A)}catch(N){console.error(N)}return x+""},_showQueryErrorMsg:function(d){new p({message:d||this.nls.queryError})},_onSinglePopupExpandIconClicked:function(d){var x=this.nls.expand,A=d.parentNode.parentNode;if(A){var N=a.hasClass(this.resultsTbody,"expanded");a.hasClass(A,"expanded")||a.hasClass(A,"folded")?a.hasClass(A,"expanded")?(a.removeClass(A,"expanded"),a.addClass(A,"folded")):(a.addClass(A,"expanded"),a.removeClass(A,"folded"),x=this.nls.collapse):N?(a.addClass(A,"folded"),
a.removeClass(A,"expanded")):(a.addClass(A,"expanded"),a.removeClass(A,"folded"),x=this.nls.collapse);a.setAttr(d,"aria-label",x);"true"===a.getAttr(d,"data-lastArrow")&&this.emit("features-layout-update")}},_onResultsTableKeydown:function(d){d.keyCode!==k.ENTER&&d.keyCode!==k.SPACE||this._onResultsTableClicked(d)},_onResultsTableClicked:function(d){d=d.target||d.srcElement;if(a.isDescendant(d,this.resultsTable))if(a.hasClass(d,"popup-title-icon"))this._onSinglePopupExpandIconClicked(d);else if(a.hasClass(d,
"related-table-btn"))this._onSingleRelatedTableButtonClicked(d);else if(d=a.hasClass(d,"query-result-item")?d:C.getAncestorDom(d,t.hitch(this,function(R){return a.hasClass(R,"query-result-item")}),this.resultsTbody)){this._selectResultTr(d);a.addClass(d,"jimu-state-active");d=d.feature;var x=d.geometry;if(x){var A=x.type;if("point"===A)var N=x;else"multipoint"===A?1===x.points.length?N=x.getPoint(0):1<x.points.length&&(N=x.getPoint(0)):"polyline"===A?(N=x.getExtent(),N=N.expand(1.4),N=N.getCenter()):
"polygon"===A?(N=x.getExtent(),N=N.expand(1.4),N=N.getCenter()):"extent"===A&&(N=x.expand(1.4),N=N.getCenter());x=C.toFeatureSet(d);C.zoomToFeatureSet(this.map,x);"function"===typeof this.map.infoWindow.setFeatures&&this.map.infoWindow.setFeatures([d]);"function"===typeof this.map.infoWindow.reposition&&this.map.infoWindow.reposition();this.map.infoWindow.show(N)}}},_hideInfoWindow:function(){this.map&&this.map.infoWindow&&(this.map.infoWindow.hide(),"function"===typeof this.map.infoWindow.setFeatures&&
this.map.infoWindow.setFeatures([]))},_getDisplayedFields:function(d,x){d=t.clone(d);if(x&&!x.readFromWebMap){var A=[];f.map(x.fieldInfos,function(R){R.visible&&A.push(R.fieldName)});x=x.title.substring(1,x.title.length-1).split("}{");var N=A.concat(x);d=f.filter(d,function(R){return N.includes(R.name)})}return d},_getFeatureSet:function(){var d=this.currentAttrs.query.resultLayer,x=null,A=this.currentAttrs.config&&this.currentAttrs.config.popupInfo;A&&(x=A.fieldInfos);var N=new I;N.fields=this._getDisplayedFields(d.fields,
A);N.features=[].concat(d.graphics);N.geometryType=d.geometryType;N.fieldAliases={};f.forEach(N.fields,t.hitch(this,function(R){var U=R.name;R=this._getFieldAliasByPopupInfo(R,x);N.fieldAliases[U]=R}));return N},_getFieldAliasByPopupInfo:function(d,x){var A=d.name;d=d.alias||A;x&&x.length&&(x=x.filter(function(N){return N.fieldName===A})[0])&&(d=x.label);return d},_onBtnMenuClicked:function(d){var x=a.position(d.target||d.srcElement),A=this._getFeatureSet(),N=this.getCurrentAttrs();this.featureActionManager.getSupportedActions(A,
N.query.resultLayer).then(t.hitch(this,function(R){f.forEach(R,t.hitch(this,function(e){e.data=A}));if(!N.config.enableExport){var U=["ExportToCSV","ExportToFeatureCollection","ExportToGeoJSON","SaveToMyContent"];R=f.filter(R,t.hitch(this,function(e){return 0>U.indexOf(e.name)}))}R=f.filter(R,t.hitch(this,function(e){return"CreateLayer"!==e.name}));var T=new r({name:"RemoveQueryResult",iconClass:"icon-close",label:this.nls.removeThisResult,iconFormat:"svg",map:this.map,onExecute:t.hitch(this,this._removeResult)});
T.name="RemoveQueryResult";T.data=A;R.push(T);(T=this._getRelatedTableAction(A))&&R.push(T);(T=this._getSymbolAction(A))&&R.push(T);this.popupMenu.setActions(R);this.popupMenu._setFocusedNodeBeforeOpen();this.popupMenu.show(x)}))},_onBtnMenuKeydown:function(d){d.keyCode!==k.ENTER&&d.keyCode!==k.SPACE||this._onBtnMenuClicked(d)},_getObjectIdField:function(){return this.currentAttrs.config.objectIdField},_getSymbolAction:function(d){var x=null;this.currentAttrs.query.resultLayer.renderer&&this.currentAttrs.config.canModifySymbol&&
(x=new r({name:"ChangeSymbol",label:this.nls.changeSymbol,data:d&&d.features,iconClass:"icon-edit-symbol",iconFormat:"svg",map:this.map,onExecute:t.hitch(this,this._showSymbolChooser)}));return x},_showSymbolChooser:function(){var d=this.currentAttrs.query.resultLayer,x=d.renderer,A={};(x=x.defaultSymbol||x.symbol)?A.symbol=x:(d=C.getSymbolTypeByGeometryType(d.geometryType),A.type=d);var N=new B(A),R=new M({width:380,autoHeight:!0,titleLabel:this.nls.changeSymbol,content:N,onClose:t.hitch(this,function(){N.destroy();
R=N=null}),buttons:[{label:window.jimuNls.common.ok,onClick:t.hitch(this,function(){var U=N.getSymbol();this._updateSymbol(U);R.close()})},{label:window.jimuNls.common.cancel,onClick:t.hitch(this,function(){R.close()})}]})},_updateSymbol:function(d){var x=this.currentAttrs.query.resultLayer;f.forEach(x.graphics,function(A){A.setSymbol(d)});x.redraw();x=c(".symbol",this.resultsTable);f.forEach(x,t.hitch(this,function(A){var N=A.parentElement;a.destroy(A);(A=z.createSymbolNode(d,{width:32,height:32}))&&
a.place(A,N)}))},_getRelatedTableAction:function(d){var x=null,A=d&&d.features,N=this._getCurrentRelationships();this._getObjectIdField()&&0<A.length&&N&&0<N.length&&this._isWebMapShowRelatedRecordsEnabled()&&(x=new r({iconClass:"icon-show-related-record",icon:"",data:d,label:this.nls.showAllRelatedRecords,onExecute:t.hitch(this,function(){this._showMultipleRelatedRecords();var R=new h;R.resolve();return R}),getIcon:function(){return""}}));return x},_isWebMapShowRelatedRecordsEnabled:function(){var d=
this.currentAttrs.config.popupInfo;return d.relatedRecordsInfo?!1!==d.relatedRecordsInfo.showRelatedRecords:!0},_removeResult:function(){this.queryWidget.removeSingleQueryResult(this);this._hideInfoWindow()},_getAvailableWidget:function(d){return(d=this.queryWidget.appConfig.getConfigElementsByName(d)[0])&&d.visible?d:null},_openAttributeTable:function(){var d=this._getAvailableWidget("AttributeTable");if(d){var x=b.getInstanceSync().getLayerInfoById(this.currentAttrs.query.resultLayer.id);this.queryWidget.widgetManager.triggerWidgetOpen(d.id).then(t.hitch(this,
function(){this.queryWidget.publishData({target:"AttributeTable",layer:x})}))}}})})},"widgets/Query/RelatedRecordsResult":function(){define("dojo/query dojo/keys dojo/Evented dojo/_base/html dojo/_base/lang dojo/_base/array dojo/_base/declare dijit/_WidgetBase dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./RelatedRecordsResult.html esri/dijit/PopupRenderer esri/layers/FeatureLayer esri/renderers/SimpleRenderer jimu/utils jimu/symbolUtils jimu/BaseFeatureAction jimu/dijit/Popup jimu/dijit/FeatureActionPopupMenu jimu/dijit/SymbolChooser jimu/FeatureActionManager".split(" "),
function(D,E,P,G,l,m,w,t,L,k,c,a,f,h,y,J,I,q,F,u,C){return w([t,L,k,P],{baseClass:"related-records-result",templateString:c,popupMenu:null,featureActionManager:null,featureSet:null,layer:null,map:null,layerDefinition:null,nls:null,config:null,postCreate:function(){this.inherited(arguments);this.popupMenu=F.getInstance();this.featureActionManager=C.getInstance();this.btnAction.title=window.jimuNls.featureActions.featureActions;if("Table"!==this.layerDefinition.type){this.layer=new f({layerDefinition:{type:this.layerDefinition.type,
geometryType:this.layerDefinition.geometryType,fields:this.layerDefinition.fields,typeIdField:this.layerDefinition.typeIdField,types:this.layerDefinition.types}});var z=y.getTypeByGeometryType(this.layerDefinition.geometryType),M=null;"point"===z?M=J.getDefaultMarkerSymbol():"polyline"===z?M=J.getDefaultLineSymbol():"polygon"===z&&(M=J.getDefaultFillSymbol());M&&(z=new h(M),this.layer.setRenderer(z));this.map.addLayer(this.layer)}else this.layer=new f({layerDefinition:{type:this.layerDefinition.type,
fields:this.layerDefinition.fields,typeIdField:this.layerDefinition.typeIdField,types:this.layerDefinition.types}})},destroy:function(){this.layer&&this.map.removeLayer(this.layer);this.layer=null;this.inherited(arguments)},setResult:function(z,M){this.layer&&this.layer.clear();this.featureSet=M;if(0<M.features.length){m.forEach(M.features,l.hitch(this,function(H,r){this.layer&&this.layer.add(H);this._createItem(z,H,r)}));var p=D(".item-title",this.content);this.lastFocusItem=p[p.length-1];G.removeClass(this.btnAction,
"not-visible");G.addClass(this.noResultTip,"not-visible");G.removeClass(this.content,"not-visible");M.geometryType&&y.zoomToFeatureSet(this.map,M)}else G.addClass(this.btnAction,"not-visible"),G.removeClass(this.noResultTip,"not-visible"),G.addClass(this.content,"not-visible"),this.lastFocusItem=this.noResultTip},_onNoResultTipKeydown:function(z){z.keyCode!==E.TAB||z.shiftKey||(z.preventDefault(),this.emit("focus-result-header"))},getLayer:function(){return this.layer},showLayer:function(){this.layer&&
this.layer.show()},hideLayer:function(){this.layer&&this.layer.hide()},_createItem:function(z,M,p){var H=z.getTitle(M)||"",r="";p===this.featureSet.features.length-1&&(r='data-isLastItem\x3d"true"');p=G.toDom('\x3cdiv class\x3d"item"\x3e\x3cdiv class\x3d"item-title" '+r+' role\x3d"button" tabindex\x3d"0"\x3e'+H+'\x3c/div\x3e\x3cdiv class\x3d"item-content" '+r+' tabindex\x3d"0"\x3e\x3c/div\x3e\x3c/div\x3e');H=D(".item-content",p)[0];z=new a({template:z,graphic:M,chartTheme:z.chartTheme});G.place(z.domNode,
H);z.startup();G.place(p,this.content)},_onContentClicked:function(z){z=z.target||z.srcElement;var M=null;if(M=G.hasClass(z,"item-title")?z:y.getAncestorDom(z,function(r){return G.hasClass(r,"item-title")},this.content)){var p=M.parentNode;G.toggleClass(p,"selected");var H=G.hasClass(p,"selected");D(".item",this.content).removeClass("selected");H&&G.addClass(p,"selected");"true"===G.getAttr(z,"data-isLastItem")&&(this.lastFocusItem=H?M.nextElementSibling:M)}},_onContentKeydown:function(z){if(z.keyCode===
E.ENTER||z.keyCode===E.SPACE)this._onContentClicked(z);else if(z.keyCode===E.TAB&&!z.shiftKey&&"true"===G.getAttr(z.target,"data-isLastItem")){var M=G.hasClass(z.target.parentNode,"selected");if(!M||M&&G.hasClass(z.target,"item-content"))z.preventDefault(),this.emit("focus-result-header")}},_onBtnBackClicked:function(){this.emit("back")},_onBtnMenuClicked:function(z){if(this.featureSet){var M=G.position(z.target||z.srcElement);this.featureActionManager.getSupportedActions(this.featureSet).then(l.hitch(this,
function(p){m.forEach(p,l.hitch(this,function(B){B.data=this.featureSet}));if(!this.config.enableExport){var H=["ExportToCSV","ExportToFeatureCollection","ExportToGeoJSON","SaveToMyContent"];p=m.filter(p,l.hitch(this,function(B){return 0>H.indexOf(B.name)}))}p=m.filter(p,l.hitch(this,function(B){return"CreateLayer"!==B.name}));var r=this._getSymbolAction();r&&p.push(r);this.popupMenu.setActions(p);this.popupMenu._setFocusedNodeBeforeOpen();this.popupMenu.show(M)}))}},_onBtnMenuKeydown:function(z){z.keyCode!==
E.ENTER&&z.keyCode!==E.SPACE||this._onBtnMenuClicked(z)},_getSymbolAction:function(){var z=null;"Table"!==this.layerDefinition.type&&this.layer&&this.layer.renderer&&this.config.canModifySymbol&&((z=this.featureSet&&this.featureSet.features)||(z=[]),z=new I({name:"ChangeSymbol",label:this.nls.changeSymbol,data:z,iconClass:"icon-edit-symbol",iconFormat:"svg",map:this.map,onExecute:l.hitch(this,this._showSymbolChooser)}));return z},_showSymbolChooser:function(){if(this.layer){var z=this.layer.renderer,
M={};(z=z.defaultSymbol||z.symbol)?M.symbol=z:(z=y.getSymbolTypeByGeometryType(this.layer.geometryType),M.type=z);var p=new u(M),H=new q({width:380,autoHeight:!0,titleLabel:this.nls.changeSymbol,content:p,onClose:l.hitch(this,function(){p.destroy();H=p=null}),buttons:[{label:window.jimuNls.common.ok,onClick:l.hitch(this,function(){var r=p.getSymbol();r=new h(r);this.layer.setRenderer(r);this.layer.redraw();H.close()})},{label:window.jimuNls.common.cancel,onClick:l.hitch(this,function(){H.close()})}]})}}})})},
"widgets/Query/_build-generate_module":function(){define(["dojo/text!./Widget.html","dojo/text!./css/style.css","dojo/i18n!./nls/strings"],function(){})},"url:widgets/Query/TaskSetting.html":'\x3cdiv tabindex\x3d"0" data-a11y-label-by\x3d"taskSettingName"\x3e\r\n  \x3ctable class\x3d"top"\x3e\r\n    \x3ctr\x3e\r\n      \x3ctd class\x3d"first-td"\x3e\r\n        \x3cdiv role\x3d"button" tabindex\x3d"0" aria-label\x3d"${nls.back}" class\x3d"back-arrow feature-action icon-arrow-back" data-dojo-attach-point\x3d"backArrow" data-dojo-attach-event\x3d"onclick:_onBtnParamsBackClicked,onkeydown:_onBtnParamsBackKeydown"\x3e\x3c/div\x3e\r\n      \x3c/td\x3e\r\n      \x3ctd class\x3d"second-td"\x3e\r\n        \x3cdiv class\x3d"task-name jimu-ellipsis" data-dojo-attach-point\x3d"taskNameDiv" data-a11y-label-id\x3d"taskSettingName"\x3e\x3c/div\x3e\r\n      \x3c/td\x3e\r\n      \x3ctd class\x3d"third-td"\x3e\x3c/td\x3e\r\n    \x3c/tr\x3e\r\n  \x3c/table\x3e\r\n  \x3cdiv class\x3d"content-container"\x3e\r\n\r\n    \x3cdiv class\x3d"params-container" data-dojo-attach-point\x3d"paramsContainer"\x3e\r\n      \x3cdiv tabindex\x3d"0" class\x3d"not-visible" data-dojo-attach-point\x3d"noFilterTip"\x3e${nls.noAttributeSpatialFilterTip}\x3c/div\x3e\r\n      \x3cdiv class\x3d"attributes-section" data-dojo-attach-point\x3d"attributesSectionDiv" data-a11y-label-by\x3d"queryCriteira-label queryCriteira-sql"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"criteiraLabelDiv" class\x3d"first-stress attribute-filter-label" data-a11y-label-id\x3d"queryCriteira-label"\x3e${nls.queryCriteira}\x3c/div\x3e\r\n        \x3cdiv class\x3d"sql-div jimu-widget-note" data-dojo-attach-point\x3d"sqlDiv" data-a11y-label-id\x3d"queryCriteira-sql"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"spatial-section" data-dojo-attach-point\x3d"spatialSectionDiv" data-a11y-label-by\x3d"spatialFilter-label spatialFilter-tip"\x3e\r\n        \x3cdiv tabindex\x3d"0" class\x3d"spearator not-visible" data-dojo-attach-point\x3d"spatialSpearator"\x3e\x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"spatialFilterLabelDiv" class\x3d"first-stress spatial-filter-label" data-a11y-label-id\x3d"spatialFilter-label"\x3e${nls.spatialFilter}\x3c/div\x3e\r\n        \x3cdiv class\x3d"spatial-filter-tip" data-dojo-attach-point\x3d"spatialFilterTip" data-a11y-label-id\x3d"spatialFilter-tip"\x3e\x3c/div\x3e\r\n        \x3cselect data-dojo-type\x3d"jimu/dijit/formSelect" data-a11y-label-by\x3d"spatialFilter-label spatialFilter-tip" data-dojo-attach-point\x3d"spatialTypeSelect" data-dojo-attach-event\x3d"change:_onSpatialTypeSelectChanged" class\x3d"restrict-select-width" style\x3d"width:100%;box-sizing:border-box;"\x3e\x3c/select\x3e\r\n\r\n        \x3cdiv class\x3d"spatial-filter-content" data-dojo-attach-point\x3d"spatialFilterContent"\x3e\r\n          \x3cdiv class\x3d"drawing-section" data-dojo-attach-point\x3d"drawingSection"\x3e\x3c/div\x3e\r\n          \x3cdiv class\x3d"features-section" data-dojo-attach-point\x3d"featuresSection"\x3e\r\n            \x3cdiv class\x3d"relationship-section"\x3e\r\n              \x3cdiv class\x3d"second-stress relationship-tip" data-a11y-label-id\x3d"spatialRelationship"\x3e${nls.spatialRelationship}\x3c/div\x3e\r\n              \x3cselect data-dojo-attach-point\x3d"relationshipSelect" data-a11y-label-by\x3d"spatialRelationship" data-dojo-type\x3d"jimu/dijit/formSelect" class\x3d"restrict-select-width relationship-select" style\x3d"width:100%;box-sizing:border-box;"\x3e\x3c/select\x3e\r\n            \x3c/div\x3e\r\n          \x3c/div\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n\r\n    \x3cdiv data-dojo-attach-point\x3d"layerNameContainer" class\x3d"result-name-container"\x3e\r\n      \x3cdiv class\x3d"first-stress" data-a11y-label-id\x3d"layerName" \x3e${nls.layerName}\x3c/div\x3e\r\n      \x3cdiv class\x3d"result-name-text" data-a11y-label-by\x3d"layerName" data-dojo-attach-point\x3d"layerNameTextBox" data-dojo-type\x3d"dijit/form/TextBox" data-dojo-attach-event\x3d"change:_onLayerNameTextChanged"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n\r\n  \x3cdiv role\x3d"button" tabindex\x3d"0" class\x3d"jimu-btn btn-execute" data-dojo-attach-point\x3d"btnExecute" data-dojo-attach-event\x3d"onclick:_onBtnApplyClicked,onkeydown:_onBtnApplyKeydown"\x3e${nls.apply}\x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"shelter" data-dojo-type\x3d"jimu/dijit/LoadingIndicator" data-dojo-props\x3d\'hidden:true\'\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:jimu/dijit/templates/SearchDistance.html":'\x3cdiv\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"cbxDiv"\x3e\x3c/div\x3e\r\n\t\x3ctable style\x3d"table-layout:fixed;width:100%;"\x3e\r\n\t\t\x3ccolgroup\x3e\r\n\t\t\t\x3ccol width\x3d"auto"\x3e\x3c/col\x3e\r\n\t\t\t\x3ccol width\x3d"15px"\x3e\x3c/col\x3e\r\n\t\t\t\x3ccol width\x3d"auto"\x3e\x3c/col\x3e\r\n\t\t\x3c/colgroup\x3e\r\n\t\t\x3ctbody\x3e\r\n\t\t\t\x3ctr\x3e\r\n\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\x3cinput data-dojo-attach-point\x3d"numberTextBox" data-dojo-type\x3d"dijit/form/NumberTextBox"\r\n\t\t\t\t\t data-dojo-props\x3d\'"required":true,intermediateChanges:false,constraints:{min:0,pattern:"#####0.##########"}\'\r\n\t\t\t\t\t style\x3d"width:100%;" data-dojo-attach-event\x3d"change:_onNumberTextBoxChanged" /\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\x3ctd\x3e\x3c/td\x3e\r\n\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\x3cselect data-dojo-type\x3d"jimu/dijit/formSelect" data-dojo-attach-point\x3d"unitSelect"\r\n\t\t\t\t\tdata-dojo-attach-event\x3d"change:_onUnitSelectChanged" style\x3d"width:100%;"\x3e\r\n\t\t\t\t\t\t\x3coption value\x3d"MILES" selected\x3e${nls.miles}\x3c/option\x3e\r\n\t\t\t\t\t\t\x3coption value\x3d"KILOMETERS"\x3e${nls.kilometers}\x3c/option\x3e\r\n\t\t\t\t\t\t\x3coption value\x3d"FEET"\x3e${nls.feet}\x3c/option\x3e\r\n\t\t\t\t\t\t\x3coption value\x3d"METERS"\x3e${nls.meters}\x3c/option\x3e\r\n\t\t\t\t\t\t\x3coption value\x3d"YARDS"\x3e${nls.yards}\x3c/option\x3e\r\n\t\t\t\t\t\t\x3coption value\x3d"NAUTICAL_MILES"\x3e${nls.nauticalMiles}\x3c/option\x3e\r\n\t\t\t\t\t\x3c/select\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\x3c/tr\x3e\r\n\t\t\x3c/tbody\x3e\r\n\t\x3c/table\x3e\r\n\x3c/div\x3e',
"url:jimu/dijit/templates/SpatialFilterByFeatures.html":'\x3cdiv\x3e\r\n\t\x3cdiv class\x3d"layer-tip second-stress" data-dojo-attach-point\x3d"tipNode"\x3e${nls.relatedLayer}\x3c/div\x3e\r\n\t\x3ctable\x3e\r\n\t\t\x3ccolgroup\x3e\r\n\t\t\t\x3ccol width\x3d"auto"\x3e\x3c/col\x3e\r\n\t\t\t\x3ccol width\x3d"100"\x3e\x3c/col\x3e\r\n\t\t\x3c/colgroup\x3e\r\n\t\t\x3ctbody\x3e\r\n\t\t\t\x3ctr\x3e\r\n\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\x3cdiv class\x3d"layers-select-div" data-dojo-attach-point\x3d"layerSelectDiv"\x3e\x3c/div\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\t\x3ctd\x3e\r\n\t\t\t\t\t\x3cdiv class\x3d"jimu-float-trailing" data-dojo-attach-point\x3d"featureSetChooserDiv"\x3e\x3c/div\x3e\r\n\t\t\t\t\x3c/td\x3e\r\n\t\t\t\x3c/tr\x3e\r\n\t\t\x3c/tbody\x3e\r\n\t\x3c/table\x3e\r\n\r\n\t\x3cdiv class\x3d"selection-option not-visible" data-dojo-attach-point\x3d"selectionOptionDiv"\x3e\x3c/div\x3e\r\n\r\n\t\x3cdiv class\x3d"search-distance-div" data-dojo-attach-point\x3d"searchDistanceDiv"\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"loading" data-dojo-type\x3d"jimu/dijit/LoadingShelter" data-dojo-props\x3d\'hidden:true\'\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:jimu/dijit/templates/_TreeNode.html":'\x3cdiv class\x3d"dijitTreeNode" role\x3d"presentation"\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"rowNode" class\x3d"dijitTreeRow" role\x3d"presentation"\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"expandoNode" class\x3d"dijitInline dijitTreeExpando" role\x3d"presentation"\x3e\x3c/span\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"expandoNodeText" class\x3d"dijitExpandoText" role\x3d"presentation"\x3e\x3c/span\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"contentNode" class\x3d"dijitTreeContent" role\x3d"presentation"\x3e\r\n\t\t\t\x3cspan role\x3d"presentation" class\x3d"dijitInline dijitIcon dijitTreeIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"labelNode,focusNode" class\x3d"dijitTreeLabel" role\x3d"treeitem" tabindex\x3d"-1" aria-selected\x3d"false"\x3e\x3c/span\x3e\r\n\t\t\x3c/span\x3e\r\n\t\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dijitTreeNodeContainer" role\x3d"presentation" style\x3d"display: none;"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:dijit/templates/TreeNode.html":'\x3cdiv class\x3d"dijitTreeNode" role\x3d"presentation"\r\n\t\x3e\x3cdiv data-dojo-attach-point\x3d"rowNode" class\x3d"dijitTreeRow" role\x3d"presentation"\r\n\t\t\x3e\x3cspan data-dojo-attach-point\x3d"expandoNode" class\x3d"dijitInline dijitTreeExpando" role\x3d"presentation"\x3e\x3c/span\r\n\t\t\x3e\x3cspan data-dojo-attach-point\x3d"expandoNodeText" class\x3d"dijitExpandoText" role\x3d"presentation"\x3e\x3c/span\r\n\t\t\x3e\x3cspan data-dojo-attach-point\x3d"contentNode"\r\n\t\t\tclass\x3d"dijitTreeContent" role\x3d"presentation"\x3e\r\n\t\t\t\x3cspan role\x3d"presentation" class\x3d"dijitInline dijitIcon dijitTreeIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\r\n\t\t\t\x3e\x3cspan data-dojo-attach-point\x3d"labelNode,focusNode" class\x3d"dijitTreeLabel" role\x3d"treeitem"\r\n\t\t\t\t   tabindex\x3d"-1" aria-selected\x3d"false" id\x3d"${id}_label"\x3e\x3c/span\x3e\r\n\t\t\x3c/span\r\n\t\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dijitTreeNodeContainer" role\x3d"presentation"\r\n\t\t style\x3d"display: none;" aria-labelledby\x3d"${id}_label"\x3e\x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:dijit/templates/Tree.html":'\x3cdiv role\x3d"tree"\x3e\r\n\t\x3cdiv class\x3d"dijitInline dijitTreeIndent" style\x3d"position: absolute; top: -9999px" data-dojo-attach-point\x3d"indentDetector"\x3e\x3c/div\x3e\r\n\t\x3cdiv class\x3d"dijitTreeExpando dijitTreeExpandoLoading" data-dojo-attach-point\x3d"rootLoadingIndicator"\x3e\x3c/div\x3e\r\n\t\x3cdiv data-dojo-attach-point\x3d"containerNode" class\x3d"dijitTreeContainer" role\x3d"presentation"\x3e\r\n\t\x3c/div\x3e\r\n\x3c/div\x3e\r\n',"url:jimu/dijit/templates/LayerChooserFromMapWithDropbox.html":'\x3cdiv\x3e\r\n\x3ctable role\x3d"listbox" aria-haspopup\x3d"true" data-dojo-attach-point\x3d"dropDownBtn" data-dojo-attach-event\x3d"onclick: _onDropDownClick,onkeydown: _onDropDownKeydown"\r\n  tabindex\x3d"0" title\x3d"${nls.customSelectLayer}" aria-label\x3d"${nls.customSelectLayer}"\x3e\r\n    \x3ccaption class\x3d"screen-readers-only-no-position"\x3e${nls.customSelectLayer}\x3c/caption\x3e\r\n    \x3ccolgroup\x3e\r\n      \x3ccol width\x3d"10px"\x3e\x3c/col\x3e\r\n      \x3ccol width\x3d"auto"\x3e\x3c/col\x3e\r\n      \x3ccol width\x3d"30px"\x3e\x3c/col\x3e\r\n    \x3c/colgroup\x3e\r\n    \x3ctbody\x3e\r\n      \x3ctr\x3e\r\n        \x3ctd\x3e\x3c/td\x3e\r\n        \x3ctd\x3e\r\n          \x3cdiv class\x3d"layer-name jimu-ellipsis" data-dojo-attach-point\x3d"layerNameNode"\x3e\x3c/div\x3e\r\n        \x3c/td\x3e\r\n        \x3ctd\x3e\r\n          \x3cdiv class\x3d"drop-select jimu-float-trailing" data-dojo-attach-point\x3d"dropArrowNode"\x3e\r\n            \x3cdiv class\x3d"jimu-icon jimu-icon-down-arrow-8"\x3e\x3c/div\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\x3c/div\x3e\r\n',
"url:widgets/Query/SingleQueryResult.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"features-result" data-dojo-attach-point\x3d"featuresResultDiv"\x3e\r\n    \x3cdiv role\x3d"button" tabindex\x3d"0" class\x3d"popup-menu-button query-result-action-button" data-dojo-attach-point\x3d"btnFeatureAction" data-dojo-attach-event\x3d"click:_onBtnMenuClicked,keydown:_onBtnMenuKeydown"\x3e\x3c/div\x3e\r\n    \x3cdiv tabindex\x3d"0" class\x3d"results-number" data-dojo-attach-point\x3d"resultsNumberDiv"\x3e\r\n      \x3cdiv class\x3d"number-container"\x3e\r\n        \x3cdiv\x3e${nls.displayedFeatures}:\x3c/div\x3e\r\n        \x3cspan data-dojo-attach-point\x3d"numSpan"\x3e\x3c/span\x3e\r\n      \x3c/div\x3e\r\n      \x3cdiv class\x3d"action-container"\x3e\r\n        \x3cdiv role\x3d"button" tabindex\x3d"0" data-dojo-attach-point\x3d"loadMoreIcon" class\x3d"icon load-more-button query-hidden" title\x3d"${nls.loadMore}" data-dojo-attach-event\x3d"onclick:_onLoadMoreClicked,onkeydown:_onLoadMoreKeydown"\x3e\x3c/div\x3e\r\n        \x3cdiv role\x3d"button" tabindex\x3d"0" data-dojo-attach-point\x3d"expandedListIcon" class\x3d"icon expand-list" data-dojo-attach-event\x3d"onclick:_onExpandClicked,onkeydown:_onExpandKeydown"\x3e\x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"results-container" data-dojo-attach-point\x3d"resultsContainer" data-dojo-attach-event\x3d"onscroll:_onResultsScroll" onselectstart\x3d"return false;"\x3e\r\n      \x3ctable data-dojo-attach-point\x3d"resultsTable" valign\x3d"top" class\x3d"results-table" data-dojo-attach-event\x3d"onclick:_onResultsTableClicked,onkeydown:_onResultsTableKeydown" cellpadding\x3d"0" cellspacing\x3d"0" \x3e\r\n        \x3ctbody data-dojo-attach-point\x3d"resultsTbody"\x3e\x3c/tbody\x3e\r\n      \x3c/table\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"multiple-related-records-section not-visible" data-dojo-attach-point\x3d"multipleRelatedRecordsDiv"\x3e\r\n    \x3ctable class\x3d"related-records-header multiple-related-records-header"\x3e\r\n      \x3ctbody\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"first-td"\x3e\r\n            \x3cdiv role\x3d"button" tabindex\x3d"0" aria-label\x3d"${nls.back}" class\x3d"back-arrow feature-action icon-arrow-back"  data-dojo-attach-point\x3d"multipleRelatedRecordsResultBackBtn" data-dojo-attach-event\x3d"onclick:_onBtnMultipleRelatedBackClicked,onkeydown:_onBtnMultipleRelatedBackKeydown"\x3e\x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"middle-td"\x3e\r\n            \x3cselect data-dojo-type\x3d"jimu/dijit/formSelect" aria-label\x3d"${nls.relatedLayer}" data-dojo-attach-point\x3d"relatedLayersSelect" data-dojo-attach-event\x3d"change:_onRelatedLayersSelectChanged" style\x3d"width:100%;"\x3e\x3c/select\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"last-td"\x3e\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n      \x3c/tbody\x3e\r\n    \x3c/table\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv class\x3d"single-related-records-section not-visible" data-dojo-attach-point\x3d"singleRelatedRecordsResultDiv"\x3e\r\n    \x3ctable role\x3d"title" tabindex\x3d"0" class\x3d"related-records-header single-related-records-header" data-dojo-attach-point\x3d"singleRelatedRecordsResultTitle" data-a11y-label-by\x3d"single-related-records-title"  data-dojo-attach-event\x3d"onkeydown:_onBtnSingleRelatedTitleKeydown"\x3e\r\n      \x3ctbody\x3e\r\n        \x3ctr\x3e\r\n          \x3ctd class\x3d"first-td"\x3e\r\n            \x3cdiv role\x3d"button" tabindex\x3d"0" aria-label\x3d"${nls.back}" class\x3d"back-arrow feature-action icon-arrow-back" data-dojo-attach-point\x3d"singleRelatedRecordsResultBackBtn" data-dojo-attach-event\x3d"onclick:_onBtnSingleRelatedBackClicked,onkeydown:_onBtnSingleRelatedBackKeydown"\x3e\x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"middle-td"\x3e\r\n            \x3cdiv class\x3d"related-records-title jimu-ellipsis" data-dojo-attach-point\x3d"relatedTitleDiv" data-a11y-label-id\x3d"single-related-records-title"\x3e\x3c/div\x3e\r\n          \x3c/td\x3e\r\n          \x3ctd class\x3d"last-td"\x3e\x3c/td\x3e\r\n        \x3c/tr\x3e\r\n      \x3c/tbody\x3e\r\n    \x3c/table\x3e\r\n  \x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"shelter" data-dojo-type\x3d"jimu/dijit/LoadingIndicator" data-dojo-props\x3d"hidden:true"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/Query/RelatedRecordsResult.html":'\x3cdiv\x3e\r\n  \x3cdiv role\x3d"button" tabindex\x3d"0" class\x3d"popup-menu-button related-records-action-button not-visible" data-dojo-attach-point\x3d"btnAction" data-dojo-attach-event\x3d"click:_onBtnMenuClicked,keydown:_onBtnMenuKeydown"\x3e\x3c/div\x3e\r\n  \x3cdiv tabindex\x3d"0" class\x3d"noresult-tip not-visible" data-dojo-attach-point\x3d"noResultTip" data-dojo-attach-event\x3d"keydown:_onNoResultTipKeydown"\x3e${nls.noResult}\x3c/div\x3e\r\n  \x3cdiv class\x3d"content not-visible" data-dojo-attach-point\x3d"content" data-dojo-attach-event\x3d"click:_onContentClicked,keydown:_onContentKeydown"\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/Query/Widget.html":'\x3cdiv\x3e\r\n  \x3cdiv class\x3d"jimu-widget-normal query-widget-content"\x3e\r\n    \x3cdiv class\x3d"query-tab-header" data-dojo-attach-point\x3d"tabHeader" data-dojo-attach-event\x3d"onclick:_onTabHeaderClicked,onkeydown:_onTabHeaderKeydown"\x3e\r\n      \x3cdiv role\x3d"tab" tabindex\x3d"0" aria-selected\x3d"true" class\x3d"query-tab-item jimu-ellipsis jimu-float-leading selected firstFocusNode" data-dojo-attach-point\x3d"taskQueryItem" title\x3d"${labelTasks}"\x3e${labelTasks}\x3c/div\x3e\r\n      \x3cdiv role\x3d"tab" tabindex\x3d"-1" aria-selected\x3d"false" class\x3d"query-tab-item jimu-ellipsis jimu-float-trailing" data-dojo-attach-point\x3d"resultQueryItem" title\x3d"${labelResults}"\x3e${labelResults}\x3c/div\x3e\r\n    \x3c/div\x3e\r\n    \x3cdiv class\x3d"query-tabs-container"\x3e\r\n      \x3cdiv class\x3d"query-tab-view task-tab-view selected" data-dojo-attach-point\x3d"taskTabView"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"taskList" class\x3d"task-list"\x3e\r\n            \x3cdiv data-dojo-attach-point\x3d"tasksNode" class\x3d"tasks"\x3e\r\n              \x3cdiv class\x3d"execute-tip not-visible"\x3e${nls.executeQueryTip}\x3c/div\x3e\r\n              \x3cdiv class\x3d"tasks-table-container"\x3e\r\n                \x3ctable data-dojo-attach-event\x3d"onclick:_onTaskListClicked,onkeydown:_onTaskListKeydown"\r\n                cellpadding\x3d"0" cellspacing\x3d"0" class\x3d"list-table tasks-table" onselectstart\x3d"return false;"\x3e\r\n                  \x3ccolgroup\x3e\r\n                    \x3ccol width\x3d"40px"\x3e\x3c/col\x3e\r\n                    \x3ccol width\x3d"auto"\x3e\x3c/col\x3e\r\n                  \x3c/colgroup\x3e\r\n                  \x3ctbody data-dojo-attach-point\x3d"tasksTbody"\x3e\x3c/tbody\x3e\r\n                \x3c/table\x3e\r\n              \x3c/div\x3e\r\n            \x3c/div\x3e\r\n            \x3cdiv tabindex\x3d"0" data-dojo-attach-point\x3d"noQueryTipSection" class\x3d"no-query-tip"\x3e${nls.noTask}\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"taskSettingContainer" class\x3d"task-setting-container"\x3e\r\n        \x3c/div\x3e\r\n      \x3c/div\x3e\r\n\r\n      \x3cdiv class\x3d"query-tab-view result-tab-view" data-dojo-attach-point\x3d"resultTabView"\x3e\r\n        \x3cdiv class\x3d"result-section" data-dojo-attach-point\x3d"resultSection"\x3e\r\n          \x3cdiv class\x3d"resultlayers-select-div" data-dojo-attach-point\x3d"resultLayersSelectDiv"\x3e\r\n            \x3cdiv data-dojo-type\x3d"jimu/dijit/formSelect" aria-label\x3d"${nls.layerName}" data-dojo-attach-point\x3d"resultLayersSelect" class\x3d"restrict-select-width" style\x3d"width:100%;" data-dojo-attach-event\x3d"change:_onResultLayerSelectChanged"\x3e\x3c/div\x3e\r\n          \x3c/div\x3e\r\n          \x3cdiv class\x3d"single-result-details" data-dojo-attach-point\x3d"singleResultDetails"\x3e\x3c/div\x3e\r\n        \x3c/div\x3e\r\n        \x3cdiv tabindex\x3d"0" class\x3d"no-result-section" data-dojo-attach-point\x3d"noresultSection"\x3e${nls.noResult}\x3c/div\x3e\r\n      \x3c/div\x3e\r\n    \x3c/div\x3e\r\n  \x3c/div\x3e\r\n  \x3c!--virtual last focus node--\x3e\r\n  \x3cdiv tabindex\x3d"0" class\x3d"screen-readers-only lastFocusNode" data-dojo-attach-point\x3d"lastNode_framework"\x3e\x3c/div\x3e\r\n  \x3cdiv data-dojo-attach-point\x3d"shelter" data-dojo-type\x3d"jimu/dijit/LoadingIndicator" data-dojo-props\x3d\'hidden:true\'\x3e\x3c/div\x3e\r\n\x3c/div\x3e',
"url:widgets/Query/css/style.css":'.jimu-widget-query{position: relative; width: 99%; height: 100%; min-width: 222px; min-height: 237px; overflow-x: hidden;}.jimu-widget-query .list-table tr.single-task:first-child,.jimu-widget-query .query-task-setting,.jimu-widget-query .back-arrow,.jimu-widget-query .single-query-result .query-result-action-button,.jimu-widget-query .single-query-result .query-result-item.jimu-table-row,.jimu-widget-query table.related-records-header,.jimu-widget-query .related-records-result .related-records-action-button,.jimu-widget-query .related-records-result .noresult-tip,.jimu-widget-query .related-records-result .content .item,.jimu-widget-query .related-records-result .content .item-title,.jimu-widget-query .related-records-result .content .item.selected .item-content{outline-offset: -2px !important;}.jimu-widget-query .popup-menu-button {width: 28px; height: 28px;}.jimu-widget-query .query-hidden {visibility: hidden;}.jimu-widget-query .text-ellipsis{white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}.jimu-widget-query .first-stress{font-family: "Avenir Light"; font-size: 14px; color: #000; margin-bottom: 5px; font-weight: bold;}.jimu-widget-query .second-stress{font-size: 12px; color: #353535; margin-bottom: 5px;}.jimu-widget-query .jimu-table-row{color: #000;}.jimu-widget-query .jimu-table-row.jimu-state-active{font-weight: normal; background-color: #eee;}.jimu-widget-query .query-result-item.jimu-table-row:first-child{border-top: 1px solid #cbcbcb;}.jimu-widget-query .not-visible{display: none !important;}.jimu-widget-query .jimu-checkbox .label{font-size: 12px; position: relative; top: 2px;}.jimu-widget-query .query-widget-content{position: absolute; width: 100%; left: 0; right: 0; height: auto; top: 0; bottom: 0;}.jimu-widget-query .query-tab-header{position: absolute; width: 100%; height: 30px; left: 0; right: 0; top: 0; font-size: 14px; border-bottom: 2px solid #ccc;}.jimu-widget-query .query-tab-item{width: calc(50% - 4px); height: 28px; line-height: 28px; cursor: pointer; text-align: center; padding: 0 5px; margin-top: 2px;}.jimu-widget-query .query-tab-item:first-child{margin-left: 2px;}.jimu-widget-query .query-tab-item:last-child{margin-right: 2px;}.jimu-rtl .jimu-widget-query .query-tab-item:first-child{margin-left: 0; margin-right: 2px;}.jimu-rtl .jimu-widget-query .query-tab-item:last-child{margin-right: 0; margin-left: 2px;}.jimu-widget-query .query-tab-item.selected{border-bottom: 2px solid #898989; font-weight: bold; color: #000;}.jimu-widget-query .query-tabs-container{position: absolute; width: 100%; left: 0; right: 0; top: 30px; bottom: 0;}.jimu-widget-query .query-tab-view{display: none; position: relative; width: 100%; height: 100%;}.jimu-widget-query .query-tab-view.selected{display: block;}.jimu-widget-query .list-table{width: 99%; border-collapse: collapse; table-layout: fixed; margin-left: auto; margin-right: auto;}.jimu-widget-query .list-table tr.single-task{border-top: 1px solid #D7D7D7; border-bottom: 1px solid #D7D7D7;}.jimu-widget-query .list-table tr.single-task:first-child{border-top: 0;}.jimu-widget-query .list-table tr.single-task:hover, .jimu-widget-query .list-table tr.single-task.selected{background-color: #eee;}.jimu-widget-query .list-table tr.single-task \x3e td{padding-top: 13px; padding-bottom: 13px; cursor: pointer; vertical-align: top;}.jimu-widget-query .list-table tr.single-task .list-item-name{width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 16px;}.jimu-widget-query .list-table tr.single-task .first-td{text-align: center;}.jimu-widget-query .list-table tr.single-task .task-icon{width: 16px; height: 16px; vertical-align: middle;}.jimu-widget-query .task-list{position: absolute; top: 10px; bottom: 0; width: 100%;}.jimu-widget-query .task-list .tasks{position: absolute; width: 100%; height: 100%; left: 0; top: 0; overflow-y: auto;}.jimu-widget-query .task-list .tasks .execute-tip{margin-top: 10px; line-height: 20px;}.jimu-widget-query .task-list .tasks .tasks-table-container{width: 100%;}.jimu-widget-query .task-list .invalid-config{display: none; position: absolute; width: 100%; height: 100%; left: 0; top: 0;}.jimu-widget-query .task-list .no-query-tip{display: none; margin: 0 2px; line-height: 20px;}.jimu-widget-query .task-setting-container{height: 100%; display: none;}.jimu-widget-query .query-task-setting{position: relative; height: 100%;}.jimu-widget-query .query-task-setting table.top{width: 100%; table-layout: fixed; padding-top: 12px;}.jimu-widget-query .query-task-setting table.top .first-td{width: 30px;}.jimu-widget-query .query-task-setting table.top .second-td{width: auto;}.jimu-widget-query .query-task-setting table.top .third-td{width: 30px;}.jimu-widget-query.only-one-task .query-task-setting table.top .first-td,.jimu-widget-query.only-one-task .query-task-setting table.top .third-td{width: 0;}.jimu-widget-query.only-one-task .query-task-setting table.top .first-td,.jimu-widget-query.only-one-task .query-task-setting table.top .third-td{display: none; overflow: hidden;}.jimu-widget-query .back-arrow{display: inline-block; width: 16px; height: 16px;}.jimu-rtl .jimu-widget-query .back-arrow{-webkit-transform: rotate(180deg); -ms-transform: rotate(180deg); transform: rotate(180deg);}.jimu-widget-query .query-task-setting .task-name{text-align: center;}.jimu-widget-query .query-task-setting .content-container {position: absolute; width: 100%; top: 50px; overflow-x: hidden; overflow-y: auto; bottom: 50px; padding: 2px;}.jimu-widget-query .query-task-setting .content-container .result-name-container {margin-top: 12px;}.jimu-widget-query .query-task-setting .content-container .result-name-container .result-name-text {width: 100%;}.jimu-widget-query .query-task-setting .spatial-section .spearator{height: 1px; margin-bottom: 12px; border-top: 1px solid #D7D7D7; display: none;}.jimu-widget-query .query-task-setting .spatial-section .relationship-section{margin-top: 10px;}.jimu-widget-query .query-task-setting .spatial-section .jimu-dijit-spatial-filter-features{margin-top: 10px;}.jimu-widget-query .query-task-setting .attributes-section{margin-bottom: 12px;}.jimu-widget-query .query-task-setting .attributes-section .jimu-filter-parameters .jimu-single-filter-parameter .hint{color:#666666;}.jimu-widget-query .query-task-setting .attributes-section .jimu-filter-parameters .jimu-single-filter-parameter .prompt{color:#000000;}.jimu-widget-query .query-task-setting .attributes-section .attribute-filter-label{margin-bottom: 5px;}.jimu-widget-query .query-task-setting .btn-execute.jimu-btn{position: absolute; width: calc(100% - 4px); margin: 0 2px; bottom: 2px; text-align: center; background-color: #59A700; border-radius: 0;}.jimu-widget-query .query-task-setting .btn-execute.jimu-btn.disabled{background-color: #ccc !important; cursor: default;}.jimu-widget-query .query-task-setting .btn-execute:hover{background-color: #417505;}.jimu-widget-query .query-task-setting .btn-execute:active{background-color: #59A700;}.jimu-query-spatial-filter-drawing \x3e .jimu-checkbox {width: 100%;}.jimu-query-spatial-filter-drawing \x3e .jimu-checkbox \x3e div.label {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 90%;}.jimu-query-spatial-filter-drawing .search-distance-div{margin-top: 15px;}.jimu-query-spatial-filter-drawing .jimu-draw-box .drawings-clear{margin-left: 18px;}.jimu-rtl .jimu-query-spatial-filter-drawing .jimu-draw-box .drawings-clear{margin-left: 0; margin-right: 18px;}.jimu-widget-query .result-list{padding-top: 10px;}.jimu-widget-query .result-tab-view .result-section{position: absolute; left: 0; right: 0; top: 0; bottom: 0;}.jimu-widget-query .result-tab-view .no-result-section{position: absolute; top: 10px; margin: 0 2px; line-height: 20px; width: calc(100% - 4px);}.jimu-widget-query .resultlayers-select-div{position: absolute; left: 2px; right: 37px; top: 15px; text-align: center; overflow: visible;}.jimu-rtl .jimu-widget-query .resultlayers-select-div{left: 37px; right: 2px;}.jimu-widget-query .single-result-details{position: absolute; width: 100%; left: 0; right: 0; top: 45px; bottom: 5px;}.jimu-widget-query .single-query-result,.jimu-widget-query .single-query-result .features-result{position: relative; width: 100%; height: 100%;}.jimu-widget-query .single-query-result .multiple-related-records-section,.jimu-widget-query .single-query-result .single-related-records-section{position: relative; width: 100%; height: calc(100% + 45px); top: -45px;}.jimu-widget-query .single-query-result .query-result-action-button{position: absolute; top: -28px; right: 0;}.jimu-rtl .jimu-widget-query .single-query-result .query-result-action-button{right: auto; left: 0;}.jimu-widget-query .single-query-result .results-number{position: relative; top: 13px; margin: 0 2px; display: flex; align-items: center; justify-content: space-between;}.jimu-widget-query .single-query-result .results-number .number-container {display: flex; align-items: center; justify-content: flex-start;}.jimu-widget-query .single-query-result .results-number .action-container {display: flex; align-items: center; justify-content: space-between; width: 52px;}.jimu-widget-query .single-query-result .results-number .action-container .icon {width: 16px; height: 16px; cursor: pointer; background-position: center; background-repeat: no-repeat; background-size: contain; background-clip: content-box;}.jimu-widget-query .single-query-result .results-number .action-container .icon.load-more-button {background-image: url(images/load-light-hover.svg); opacity: 0.5;}.jimu-widget-query .single-query-result .results-number .action-container .icon.load-more-button.loading,.jimu-widget-query .single-query-result .results-number .action-container .icon.load-more-button.loading:hover {background-image: url(images/loading-light.svg); -webkit-animation: load8 1.1s infinite linear; animation: load8 1.1s infinite linear;}.jimu-widget-query .single-query-result .results-number .action-container .icon.load-more-button:hover {background-image: url(images/load-light-hover.svg); opacity:1;}.jimu-widget-query .single-query-result .results-number .action-container .icon.expand-list {background-image: url(images/fold-list-light-hover.svg); opacity: 0.5;}.jimu-widget-query .single-query-result .results-number .action-container .icon.expand-list:hover {background-image: url(images/fold-list-light-hover.svg); opacity: 1;}.jimu-widget-query .single-query-result .results-number .action-container .icon.expand-list.folded {background-image: url(images/expand-list-light-hover.svg); opacity:0.5;}.jimu-widget-query .single-query-result .results-number .action-container .icon.expand-list.folded:hover {background-image: url(images/expand-list-light-hover.svg); opacity:1;}.jimu-widget-query .single-query-result .results-container{position: absolute; width: 100%; left: 0; right: 0; top: 40px; bottom: 0; overflow-x: hidden; overflow-y: auto;}.jimu-widget-query .single-query-result .results-container .query-result-item-table .popup-td .popup-title-container {display: flex; align-items: center; justify-content: space-between;}.jimu-widget-query .single-query-result .results-container .query-result-item-table .popup-td .popup-title-container .popup-title {font-weight: bold;}.jimu-widget-query .single-query-result .results-container .query-result-item-table .popup-td .popup-content {margin-top: 8px;}.jimu-widget-query .single-query-result .results-container tbody.folded .query-result-item-table .popup-td .popup-content,.jimu-widget-query .single-query-result .results-container tbody.expanded .query-result-item-table .popup-td.folded .popup-content,.jimu-widget-query .single-query-result .results-container tbody.folded .query-result-item-table .popup-td.folded .popup-content {display: none;}.jimu-widget-query .single-query-result .results-container tbody.expanded .query-result-item-table .popup-td .popup-content,.jimu-widget-query .single-query-result .results-container tbody.expanded .query-result-item-table .popup-td.expanded .popup-content,.jimu-widget-query .single-query-result .results-container tbody.folded .query-result-item-table .popup-td.expanded .popup-content {display: block;}.jimu-widget-query .single-query-result .results-container .query-result-item-table .popup-td .popup-title-icon {width: 24px; height: 16px;}.jimu-widget-query .single-query-result .results-container tbody.folded .query-result-item-table .popup-td .popup-title-icon,.jimu-widget-query .single-query-result .results-container tbody.expanded .query-result-item-table .popup-td.folded .popup-title-icon,.jimu-widget-query .single-query-result .results-container tbody.folded .query-result-item-table .popup-td.folded .popup-title-icon {background: url(images/expand-item-light-hover.svg) center center no-repeat content-box; opacity: 0.5;}.jimu-widget-query .single-query-result .results-container tbody.folded .query-result-item-table .popup-td .popup-title-icon:hover,.jimu-widget-query .single-query-result .results-container tbody.expanded .query-result-item-table .popup-td.folded .popup-title-icon:hover,.jimu-widget-query .single-query-result .results-container tbody.folded .query-result-item-table .popup-td.folded .popup-title-icon:hover {background: url(images/expand-item-light-hover.svg) center center no-repeat content-box; opacity: 1;}.jimu-widget-query .single-query-result .results-container tbody.expanded .query-result-item-table .popup-td .popup-title-icon,.jimu-widget-query .single-query-result .results-container tbody.expanded .query-result-item-table .popup-td.expanded .popup-title-icon,.jimu-widget-query .single-query-result .results-container tbody.folded .query-result-item-table .popup-td.expanded .popup-title-icon {background: url(images/fold-item-light-hover.svg) center center no-repeat content-box; opacity: 0.5; outline-offset: -1px !important;}.jimu-widget-query .single-query-result .results-container tbody.expanded .query-result-item-table .popup-td .popup-title-icon:hover,.jimu-widget-query .single-query-result .results-container tbody.expanded .query-result-item-table .popup-td.expanded .popup-title-icon:hover,.jimu-widget-query .single-query-result .results-container tbody.folded .query-result-item-table .popup-td.expanded .popup-title-icon:hover {background: url(images/fold-item-light-hover.svg) center center no-repeat content-box; opacity: 1;}.jimu-widget-query .single-query-result .results-table{table-layout: fixed; width: 100%; border-collapse: collapse;}.jimu-widget-query .single-query-result .query-result-item.jimu-table-row{border-left: 0 !important; border-right: 0 !important;}.jimu-widget-query .single-query-result .query-result-item \x3e td{padding-top: 8px; padding-bottom: 8px; cursor: pointer;}.jimu-rtl .jimu-widget-query .single-query-result .query-result-item \x3e td{padding-left: 0; padding-right: 15px;}.jimu-widget-query .single-query-result .query-result-item .esriViewPopup .header{margin-bottom: 8px;}.jimu-widget-query .single-query-result .query-result-item .esriViewPopup .hzLine{display: none;}.jimu-widget-query .single-query-result .query-result-item .esriViewPopup .mainSection .break{display: none;}.jimu-widget-query .single-query-result .query-result-item-table{width: 100%; table-layout: fixed; border-collapse: collapse;}.jimu-widget-query .single-query-result .query-result-item-table .symbol-td{width: 36px;}.jimu-widget-query .single-query-result .query-result-item-table .popup-td{width: auto;}.jimu-widget-query .single-query-result .query-result-item .related-table-btn{height: 30px; line-height: 30px; margin: 5px 2px; padding: 0 5px; background: url(images/arrow_right1.png) right center no-repeat content-box; overflow: hidden; text-overflow: hidden; white-space: nowrap; font-family: "Avenir Medium"; color: #000;}.jimu-widget-query .single-query-result .query-result-item .related-table-btn:hover{font-weight: bold; background: url(images/arrow_right2.png) right center no-repeat content-box;}.jimu-rtl .jimu-widget-query .single-query-result .query-result-item .related-table-btn{background: url(images/arrow_left1.png) left center no-repeat content-box;}.jimu-rtl .jimu-widget-query .single-query-result .query-result-item .related-table-btn:hover{background: url(images/arrow_left2.png) left center no-repeat content-box;}.jimu-widget-query table.related-records-header{margin-top: 5px; width: 100%; min-height: 36px; border-collapse: collapse; table-layout: fixed;}.jimu-widget-query table.related-records-header\x3etbody\x3etr\x3etd{height: 36px;}.jimu-widget-query table.related-records-header\x3etbody\x3etr\x3e.first-td{width: 30px;}.jimu-widget-query table.related-records-header\x3etbody\x3etr\x3e.middle-td{width: auto;}.jimu-widget-query table.related-records-header\x3etbody\x3etr\x3e.last-td{width: 40px;}.jimu-widget-query table.related-records-header .related-records-title{text-align: center;}.jimu-widget-query .related-records-result{position: absolute; left: 0; right: 0; top: 45px; bottom: 0; width: 100%; height: calc(100% - 45px);}.jimu-widget-query .related-records-result .related-records-action-button{position: absolute; right: 0; top: -40px; z-index: 1;}.jimu-rtl .jimu-widget-query .related-records-result .related-records-action-button{position: absolute; right: auto; left: 0; top: 0;}.jimu-widget-query .related-records-result .noresult-tip{line-height: 25px; padding: 0 2px;}.jimu-widget-query .related-records-result .content{position: absolute; left: 0; right: 0; top: 0; bottom: 0; overflow: auto;}.jimu-widget-query .related-records-result .content .item{border-top: 1px solid #E2E2E2;}.jimu-widget-query .related-records-result .content .item:last-child{border-bottom: 1px solid #E2E2E2;}.jimu-widget-query .related-records-result .content .item-title{position: relative; height: 36px; line-height: 36px; cursor: pointer; background: url(images/arrow_right1.png) right center no-repeat content-box;}.jimu-rtl .jimu-widget-query .related-records-result .content .item-title{background: url(images/arrow_left1.png) left center no-repeat content-box;}.jimu-widget-query .related-records-result .content .item.selected .item-title{background: url(images/arrow_down.png) right center no-repeat content-box;}.jimu-rtl .jimu-widget-query .related-records-result .content .item.selected .item-title{background: url(images/arrow_down.png) left center no-repeat content-box;}.jimu-widget-query .related-records-result .content .item-title .esriNumericValue{position: absolute; left: 4px; right: 18px; top: 0; bottom: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}.jimu-rtl .jimu-widget-query .related-records-result .content .item-title .esriNumericValue{left: 18px; right: 4px;}.jimu-widget-query .related-records-result .content .item-content{border-top: 1px solid #E2E2E2; display: none;}.jimu-widget-query .related-records-result .content .item.selected .item-content{display: block;}.jimu-widget-query .related-records-result .esriViewPopup .header{display: none;}.jimu-widget-query .related-records-result .esriViewPopup .hzLine{display: none;}.query-resultlayer-tooltipdialog-content{cursor: default;}.query-resultlayer-tooltipdialog-content .result-item{height: 20px; line-height: 20px; cursor: pointer;}.query-operations-tooltipdialog-content{cursor: default;}.query-operations-tooltipdialog-content .operation-item{height: 20px; line-height: 20px; cursor: pointer;}',
"*now":function(D){D(['dojo/i18n!*preload*widgets/Query/nls/Widget*["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/on dojo/keys dojo/query dojo/Deferred dojo/_base/lang dojo/_base/html dojo/_base/array dojo/promise/all dojo/_base/declare dijit/_WidgetsInTemplateMixin jimu/utils jimu/BaseWidget jimu/MapManager jimu/filterUtils jimu/dijit/Message jimu/symbolUtils esri/lang esri/request esri/symbols/jsonUtils esri/layers/FeatureLayer esri/dijit/PopupTemplate esri/renderers/SimpleRenderer ./TaskSetting ./SingleQueryLoader ./SingleQueryResult ./utils jimu/LayerInfos/LayerInfos jimu/dijit/LoadingIndicator jimu/dijit/formSelect".split(" "),function(D,
E,P,G,l,m,w,t,L,k,c,a,f,h,y,J,I,q,F,u,C,z,M,p,H,r,B){return L([a,k],{name:"Query",baseClass:"jimu-widget-query",currentTaskSetting:null,hiddenClass:"not-visible",_resultLayerInfos:null,mapManager:null,layerInfosObj:null,labelTasks:"",labelResults:"",_focusNodes:{},miniCycleHandlers:{},postMixInProperties:function(){this.inherited(arguments);this.layerInfosObj=B.getInstanceSync();this.mapManager=f.getInstance();this._resultLayerInfos=[];var b=I.substitute({clearResults:this.nls.clearResults},this.nls.operationalTip);
this.nls.operationalTip=b;this.nls.layerName=window.apiNls.widgets.directions.layerName;this.labelTasks=this.nls.tasks;this.labelResults=this.nls.queryResults;this._setUrlForConfig();this._showFilterLabel=!0;this.config&&(this.config=r.getConfigWithValidDataSource(this.config),this._updateConfig(),this.config.labelTasks&&(this.labelTasks=this.config.labelTasks),this.config.labelResults&&(this.labelResults=this.config.labelResults),this._showFilterLabel=this.config.showFilterLabel)},_updateConfig:function(){this.config&&
this.config.queries&&0<this.config.queries.length&&w.forEach(this.config.queries,l.hitch(this,function(b){this._rebuildFilter(b.url,b.filter)}));this.config&&("undefined"===typeof this.config.showFilterLabel&&(this.config.showFilterLabel=!0),"undefined"===typeof this.config.criteiraLabel&&(this.config.criteiraLabel=this.nls.queryCriteira),"undefined"===typeof this.config.spatialFilterLabel&&(this.config.spatialFilterLabel=this.nls.spatialFilter))},_setUrlForConfig:function(){this.config&&this.config.queries&&
0<this.config.queries.length&&w.forEach(this.config.queries,l.hitch(this,function(b){if(b.webMapLayerId){var n=this.layerInfosObj.getLayerOrTableInfoById(b.webMapLayerId);n&&(b.url=n.getUrl())}}))},_rebuildFilter:function(b,n){try{if(n){delete n.expr;var v=new h;v.isHosted=c.isHostedService(b);v.getExprByFilterObj(n)}}catch(K){console.log(K)}},postCreate:function(){this.inherited(arguments);this._initSelf();this._updateResultDetailUI();var b=P(".single-task",this.tasksTbody);1===b.length?(m.addClass(this.domNode,
"only-one-task"),this._showTaskSettingPane(!0),this._onClickTaskTr(b[0])):(this._updateFocusNodes("taskList"),this.own(D(this.taskTabView,"keydown",l.hitch(this,function(n){n.keyCode===E.ESCAPE&&(n.stopPropagation(),this.taskQueryItem.focus())}))));this.own(D(this.resultTabView,"keydown",l.hitch(this,function(n){n.keyCode===E.ESCAPE&&(n.stopPropagation(),this.resultQueryItem.focus())})));this.own(D(this.lastNode_framework,"focus",l.hitch(this,function(){("true"===m.getAttr(this.taskQueryItem,"aria-selected")?
this.taskQueryItem:this.resultQueryItem).focus()})))},_focusCurrentFirstNode:function(b){b||(b="true"===m.getAttr(this.taskQueryItem,"aria-selected")?"none"!==m.getStyle(this.taskList,"display")?this._focusNodes.taskList.first:this._focusNodes.taskSetting?this._focusNodes.taskSetting.first:null:this._focusNodes.result?this._focusNodes.result.first:null);b&&b.focus()},_updateFocusNodes:function(b){if("taskList"===b){var n=P(".single-task",this.tasksTbody);if(0===n.length)var v=n=this.noQueryTipSection;
else v=n[0],n=n[n.length-1];this._focusNodes.taskList={first:v,last:n}}else if("taskSetting"===b)v=this.currentTaskSetting.domNode,n=this.currentTaskSetting.btnExecute,this._focusNodes.taskSetting={first:v,last:n};else if("result"===b){if(0===this._resultLayerInfos.length)n=v=this.noresultSection;else{v=P("."+this.singleQueryResult._lastFeatureClass,this.singleQueryResult.resultsTbody);if(v[0]){v=v[v.length-1];n=P("."+this.singleQueryResult._lastRelatedClass,v)[0];var K=P(".popup-content",v)[0];K=
"block"===m.getStyle(K,"display");n=n&&K?n:P("."+this.singleQueryResult._lastFeatureArrowClass,v)[0]}else n=this.singleQueryResult.expandedListIcon;v=this.resultLayersSelect.domNode}this._focusNodes.result={first:v,last:n}}this._initMiniCycle(b,v,n)},_initMiniCycle:function(b,n,v){this.miniCycleHandlers[b]?(this.miniCycleHandlers[b].first.remove(),this.miniCycleHandlers[b].last.remove()):this.miniCycleHandlers[b]={};this.miniCycleHandlers[b].first=D(n,"keydown",l.hitch(this,function(K){K.keyCode===
E.TAB&&K.shiftKey&&K.target===n&&(K.preventDefault(),v.focus())}));this.miniCycleHandlers[b].last=D(v,"keydown",l.hitch(this,function(K){K.keyCode!==E.TAB||K.shiftKey||(K.preventDefault(),n.focus())}))},_onFeaturesLayoutUpdate:function(){this._updateFocusNodes("result")},onOpen:function(){var b=this._getCurrentResultLayerInfo();(b=b&&b.singleQueryResult)&&b.showLayer();this._showTempLayers();this.inherited(arguments)},onActive:function(){this._showTempLayers()},onDeActive:function(){this.currentTaskSetting&&
this.currentTaskSetting.deactivate();this.mapManager.enableWebMapPopup();this._hideTempLayers()},onClose:function(){this.config.hideLayersAfterWidgetClosed&&this._hideAllLayers();this._hideInfoWindow();this._hideTempLayers();this.inherited(arguments)},destroy:function(){this._hideInfoWindow();this._removeResultLayerInfos(this._resultLayerInfos);this.inherited(arguments)},_hideTempLayers:function(){this.currentTaskSetting&&this.currentTaskSetting.hideTempLayers()},_showTempLayers:function(){this.currentTaskSetting&&
this.currentTaskSetting.showTempLayers()},_initSelf:function(){var b=this.config.queries;0===b.length?(m.setStyle(this.tasksNode,"display","none"),m.setStyle(this.noQueryTipSection,"display","block")):w.forEach(b,l.hitch(this,function(n,v){r.dynamicUpdateConfigIcon(n,this.folderUrl+"css/images/default_task_icon.png");var K=n.name,d=m.toDom('\x3ctr role\x3d"button" tabindex\x3d"0" class\x3d"single-task"\x3e\x3ctd class\x3d"first-td"\x3e\x3cspan class\x3d"task-icon"\x3e\x3c/span\x3e\x3c/td\x3e\x3ctd class\x3d"second-td"\x3e\x3cdiv class\x3d"list-item-name task-name-div"\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e');
P(".task-name-div",d)[0].innerHTML=K;m.place(d,this.tasksTbody);K=P("span.task-icon",d)[0];var x=n.icon;if(x){var A=null;x.url||x.imageData?(x.setWidth(16),x.setHeight(16)):(A={width:17,height:17},x.setSize(16));x=J.createSymbolNode(x,A);m.place(x,K)}d.taskIndex=v;d.singleConfig=n;0===v%2?m.addClass(d,"even"):m.addClass(d,"odd")}))},_onTabHeaderClicked:function(b){b=b.target||b.srcElement;b===this.taskQueryItem?((b=this._getCurrentResultLayerInfo())&&(b=b.singleQueryResult)&&(b.singleRelatedRecordsResult||
b.multipleRelatedRecordsResult)&&b._showFeaturesResultDiv(),this._switchToTaskTab()):b===this.resultQueryItem&&this._switchToResultTab()},_onTabHeaderKeydown:function(b){var n=b.target||b.srcElement;b.keyCode===E.ENTER?this._onTabHeaderClicked(b):b.keyCode===E.LEFT_ARROW||b.keyCode===E.RIGHT_ARROW?(n===this.taskQueryItem?this.resultQueryItem:this.taskQueryItem).focus():b.keyCode===E.TAB&&(b.shiftKey?b.preventDefault():n===this.taskQueryItem&&"-1"===m.getAttr(this.taskQueryItem,"tabindex")&&(b.preventDefault(),
this._focusCurrentFirstNode()))},_switchToTaskTab:function(){m.removeClass(this.resultQueryItem,"selected");m.removeClass(this.resultTabView,"selected");m.addClass(this.taskQueryItem,"selected");m.addClass(this.taskTabView,"selected");m.setAttr(this.resultQueryItem,"tabindex","-1");m.setAttr(this.resultQueryItem,"aria-selected","false");m.setAttr(this.taskQueryItem,"tabindex","0");m.setAttr(this.taskQueryItem,"aria-selected","true");c.initFirstFocusNode(this.domNode,this.taskQueryItem)},_switchToResultTab:function(){this._updateResultDetailUI();
m.removeClass(this.taskQueryItem,"selected");m.removeClass(this.taskTabView,"selected");m.addClass(this.resultQueryItem,"selected");m.addClass(this.resultTabView,"selected");m.setAttr(this.taskQueryItem,"tabindex","-1");m.setAttr(this.taskQueryItem,"aria-selected","false");m.setAttr(this.resultQueryItem,"tabindex","0");m.setAttr(this.resultQueryItem,"aria-selected","true");this._updateFocusNodes("result");c.initFirstFocusNode(this.domNode,this.resultQueryItem)},_updateResultDetailUI:function(){0<
this._resultLayerInfos.length?(m.removeClass(this.resultSection,this.hiddenClass),m.addClass(this.noresultSection,this.hiddenClass)):(m.addClass(this.resultSection,this.hiddenClass),m.removeClass(this.noresultSection,this.hiddenClass),this.noresultSection.focus())},_showTaskListPane:function(){m.setStyle(this.taskList,"display","block");m.setStyle(this.taskSettingContainer,"display","none");this._switchToTaskTab()},_showTaskSettingPane:function(){m.setStyle(this.taskList,"display","none");m.setStyle(this.taskSettingContainer,
"display","block");this._switchToTaskTab()},_onTaskListClicked:function(b){(b=c.getAncestorDom(b.target||b.srcElement,l.hitch(this,function(n){return m.hasClass(n,"single-task")}),10))&&this._onClickTaskTr(b)},_onTaskListKeydown:function(b){b.keyCode!==E.ENTER&&b.keyCode!==E.SPACE||this._onClickTaskTr(b.target||b.srcElement)},_onClickTaskTr:function(b){this._getLayerInfoAndRelationshipLayerInfos(b).then(l.hitch(this,function(n){var v=n.layerInfo,K=n.layerObject,d=n.relationshipLayerInfos;n=n.relationshipPopupTemplates;
b.singleConfig.objectIdField=c.getObjectIdField(v);var x=this._getPopupInfo(v,b.singleConfig);x||console.error("can't get popupInfo");x.fieldInfos=r.getPortalFieldInfosWithoutShape(v,x.fieldInfos);delete x.readFromWebMap;var A=p.getCleanCurrentAttrsTemplate();A.queryTr=b;A.config=l.clone(b.singleConfig);A.config.popupInfo=x;A.layerInfo=v;A.layerObject=K;A.relationshipLayerInfos=d;A.relationshipPopupTemplates=n;A.query.maxRecordCount=v.maxRecordCount||1E3;A.queryType=r.getQueryType(v);this.currentTaskSetting&&
this.currentTaskSetting.destroy();this.currentTaskSetting=null;this._showTaskSettingPane();this.currentTaskSetting=new M({wId:this.id,nls:this.nls,map:this.map,showFilterLabel:this._showFilterLabel,criteiraLabel:this.config.criteiraLabel,spatialFilterLabel:this.config.spatialFilterLabel,currentAttrs:A,layerInfosObj:this.layerInfosObj,onBack:l.hitch(this,function(){this._showTaskListPane();this._focusCurrentFirstNode()}),onApply:l.hitch(this,function(N){this._onBtnApplyClicked(N)})});this.currentTaskSetting.canAutoRunning()&&
(this._switchToResultTab(),this.currentTaskSetting.run());this.currentTaskSetting.placeAt(this.taskSettingContainer);this._updateFocusNodes("taskSetting");this._focusCurrentFirstNode();this.own(D(this.currentTaskSetting.domNode,"keydown",l.hitch(this,function(N){N.keyCode===E.ESCAPE&&(N.stopPropagation(),m.hasClass(this.domNode,"only-one-task")||N.target===this.currentTaskSetting.backArrow?this.taskQueryItem.focus():this.currentTaskSetting.backArrow.focus())})))}),l.hitch(this,function(n){console.error("can't get layerInfo",
n)}))},_getLayerInfoAndServiceInfo:function(b){var n=new G,v=this._getLayerInfo(b),K=this._getServiceInfo(b);this.shelter.show();t([v,K]).then(l.hitch(this,function(d){this.domNode&&(this.shelter.hide(),b.layerInfo=d[0],b.serviceInfo=d[1],n.resolve({layerInfo:b.layerInfo,serviceInfo:b.serviceInfo}))}),l.hitch(this,function(d){console.error(d);if(this.domNode){this.shelter.hide();var x="";d&&403===d.httpCode&&(x=this.nls.noPermissionsMsg);this._showQueryErrorMsg(x);n.reject()}}));return n},_getLayerInfoAndRelationshipLayerInfos:function(b){var n=
new G;this.shelter.show();var v=this._getLayerInfo(b),K=r.tryGetLayerObject(b.singleConfig.webMapLayerId);t([v,K]).then(l.hitch(this,function(d){var x=d[0],A=d[1];b.layerInfo=x;b.layerObject=A;this._getRelationshipLayerInfos(b).then(l.hitch(this,function(N){if(this.domNode){b.relationshipLayerInfos=N;var R={},U=this.map.itemInfo.itemData,T=b.singleConfig.url.replace(/\d*\/*$/g,""),e;for(e in N){var g=r.getPopupInfoForRelatedLayer(U,T+e,N[e]);R[e]=new C(g)}this.shelter.hide();n.resolve({layerInfo:x,
layerObject:A,relationshipLayerInfos:N,relationshipPopupTemplates:R})}}),l.hitch(this,function(N){this.domNode&&(this.shelter.hide(),n.reject(N))}))}),l.hitch(this,function(d){this.domNode&&(this.shelter.hide(),n.reject(d))}));return n},_getLayerInfo:function(b){var n=new G;b.layerInfo?n.resolve(b.layerInfo):q({url:b.singleConfig.url,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}).then(l.hitch(this,function(v){b.layerInfo=v;n.resolve(v)}),l.hitch(this,function(v){n.reject(v)}));
return n},_getServiceInfo:function(b){var n=new G;if(b.serviceInfo)n.resolve(b.serviceInfo);else{var v=this._getServiceUrlByLayerUrl(b.singleConfig.url);q({url:v,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}).then(l.hitch(this,function(K){b.serviceInfo=K;n.resolve(K)}),l.hitch(this,function(K){n.reject(K)}))}return n},_getRelationshipLayerInfos:function(b){var n=new G;if(b.relationshipLayerInfos)n.resolve(b.relationshipLayerInfos);else{var v=b.layerInfo.relationships;if(v&&0<v.length){var K=
this._getServiceUrlByLayerUrl(b.singleConfig.url),d=w.map(v,l.hitch(this,function(x){return q({url:K+"/"+x.relatedTableId,content:{f:"json"},handleAs:"json",callbackParamName:"callback"})}));t(d).then(l.hitch(this,function(x){b.relationshipLayerInfos={};w.forEach(v,l.hitch(this,function(A,N){b.relationshipLayerInfos[A.relatedTableId]=x[N]}));n.resolve(b.relationshipLayerInfos)}),l.hitch(this,function(x){b.relationshipLayerInfos=null;n.reject(x)}))}else b.relationshipLayerInfos={},n.resolve(b.relationshipLayerInfos)}return n},
_getServiceUrlByLayerUrl:function(b){var n=b.lastIndexOf("/");return b.slice(0,n)},_getPopupInfo:function(b,n){var v=null,K=r.getDefaultPopupInfo(b,!1,!1);v=K;v=null;n.popupInfo?n.popupInfo.readFromWebMap?n.webMapLayerId?(v=null,v=(v=r.isTable(b)?this.layerInfosObj.getTableInfoById(n.webMapLayerId):this.layerInfosObj.getLayerInfoById(n.webMapLayerId))?(v=v.getPopupInfo())?l.clone(v):K:K):v=K:(v=l.clone(n.popupInfo),delete v.readFromWebMap):v=n.popup?r.upgradePopupToPopupInfo(b,n.popup):K;v||(v=K);
v.showAttachments=!!b.hasAttachments;r.removePopupInfoUnsupportFields(b,v);return v},_onBtnApplyClicked:function(b){this.mapManager.enableWebMapPopup();m.addClass(this.resultTabView,this.hiddenClass);if(b.config.singleResultLayer){var n=this._getResultLayerInfosByTaskIndex(b.queryTr.taskIndex);0<n.length&&this._removeResultLayerInfos(n)}var v=this.currentTaskSetting.getQueryResultName();v=c.sanitizeHTML(v);this._createNewResultLayer(b,v);this.shelter.show();var K=new H({map:this.map,nls:this.nls,
label:v,currentAttrs:b,queryWidget:this,onBack:l.hitch(this,function(){this._switchToResultTab()})});this.own(D(K,"show-related-records",l.hitch(this,this._onShowRelatedRecords)));this.own(D(K,"hide-related-records",l.hitch(this,this._onHideRelatedRecords)));this.own(D(K,"features-update",l.hitch(this,this._onFeaturesUpdate)));this.own(D(K,"features-layout-update",l.hitch(this,this._onFeaturesLayoutUpdate)));K.executeQueryForFirstTime().then(l.hitch(this,function(){this.domNode&&(this.shelter.hide(),
m.removeClass(this.resultTabView,this.hiddenClass),this._onSingleQueryFinished(K,v),this._updateResultDetailUI(),this.singleQueryResult=K,this._updateFocusNodes("result"),this._focusCurrentFirstNode())}),l.hitch(this,function(d){console.error(d);this.domNode&&(this.shelter.hide(),m.removeClass(this.resultTabView,this.hiddenClass))}))},_createNewResultLayer:function(b,n){var v=null,K=null,d=b.queryTr.taskIndex;K=l.clone(b.layerInfo);K.name=n;K.drawingInfo||(K.drawingInfo={});K.drawingInfo.transparency=
0;K.minScale=0;K.maxScale=0;K.effectiveMinScale=0;K.effectiveMaxScale=0;K.defaultVisibility=!0;delete K.extent;var x=(new p(this.map,b)).getOutputFields();K.fields=w.filter(K.fields,l.hitch(this,function(A){return 0<=x.indexOf(A.name)}));v=new u({layerDefinition:K,featureSet:null});v._queryWidgetTaskIndex=d;n=l.clone(b.config.popupInfo);d=new C(n);n.showAttachments&&r.overridePopupTemplateMethodGetAttachments(d,b.config.url,b.config.objectIdField);v.setInfoTemplate(d);b.query.resultLayer=v;v.drawingInfo=
K.drawingInfo;r.isTable(b.layerInfo)||b.config.useLayerSymbol||!b.config.resultsSymbol||(b=F.fromJson(b.config.resultsSymbol),K=new z(b),v.setRenderer(K));return v},_onSingleQueryFinished:function(b,n){this.currentTaskSetting.onGetQueryResponse();b.placeAt(this.singleResultDetails);this._hideAllSingleQueryResultDijits();this._switchToResultTab();m.setStyle(b.domNode,"display","block");var v=b.getCurrentAttrs().queryTr.taskIndex;b={value:c.getRandomString(),label:n,taskIndex:v,singleQueryResult:b};
this._resultLayerInfos.push(b);this.resultLayersSelect.addOption({value:b.value,label:b.label});this.resultLayersSelect.set("value",b.value);this._showResultLayerInfo(b);this._updateResultDetailUI()},_onResultLayerSelectChanged:function(){var b=this._getCurrentResultLayerInfo();b&&this._showResultLayerInfo(b)},_getCurrentResultLayerInfo:function(){var b=null,n=this.resultLayersSelect.get("value");n&&(b=this._getResultLayerInfoByValue(n));return b},_hideAllLayers:function(b){var n=this._getAllSingleQueryResultDijits();
w.forEach(n,l.hitch(this,function(v){v&&v!==b&&v.hideLayer()}))},_removeResultLayerInfosByTaskIndex:function(b){b=this._getResultLayerInfosByTaskIndex(b);this._removeResultLayerInfos(b)},_getResultLayerInfoByValue:function(b){var n=null;w.some(this._resultLayerInfos,l.hitch(this,function(v){return v.value===b?(n=v,!0):!1}));return n},_getResultLayerInfosByTaskIndex:function(b){var n=this._resultLayerInfos;return n=w.filter(n,l.hitch(this,function(v){return v.taskIndex===b}))},_removeResultLayerInfoByValues:function(b){var n=
[];w.forEach(this._resultLayerInfos,l.hitch(this,function(K,d){0<=b.indexOf(K.value)&&(n.push(d),K.singleQueryResult&&K.singleQueryResult.domNode&&K.singleQueryResult.destroy(),K.singleQueryResult=null)}));n.reverse();w.forEach(n,l.hitch(this,function(K){this._resultLayerInfos.splice(K,1)}));this.resultLayersSelect.removeOption(b);var v=this.resultLayersSelect.getOptions();v&&0<v.length?this.resultLayersSelect.set("value",v[0].value):"function"===typeof this.resultLayersSelect._setDisplay&&this.resultLayersSelect._setDisplay("");
this._updateResultDetailUI()},_removeResultLayerInfos:function(b){b=w.map(b,l.hitch(this,function(n){return n.value}));return this._removeResultLayerInfoByValues(b)},_getAllSingleQueryResultDijits:function(){var b=[];this._resultLayerInfos&&0<this._resultLayerInfos.length&&w.forEach(this._resultLayerInfos,l.hitch(this,function(n){n&&n.singleQueryResult&&b.push(n.singleQueryResult)}));return b},_hideAllSingleQueryResultDijits:function(){var b=this._getAllSingleQueryResultDijits();w.forEach(b,l.hitch(this,
function(n){m.setStyle(n.domNode,"display","none")}))},_showResultLayerInfo:function(b){this._hideAllSingleQueryResultDijits();b=b.singleQueryResult;this._hideAllLayers(b);b&&(m.setStyle(b.domNode,"display","block"),b.showLayer(),b.zoomToLayer())},removeSingleQueryResult:function(b){var n=null;w.some(this._resultLayerInfos,l.hitch(this,function(v){return v.singleQueryResult===b?(n=v.value,!0):!1}));null!==n&&this._removeResultLayerInfoByValues([n])},_onShowRelatedRecords:function(){m.addClass(this.resultLayersSelectDiv,
this.hiddenClass)},_onHideRelatedRecords:function(){m.removeClass(this.resultLayersSelectDiv,this.hiddenClass)},_onFeaturesUpdate:function(b){var n=b.taskIndex;b=b.features;try{this.updateDataSourceData(n,{features:b})}catch(v){console.error(v)}},_isImageServiceLayer:function(b){return-1<b.indexOf("/ImageServer")},_showQueryErrorMsg:function(b){new y({message:b||this.nls.queryError})},_hideInfoWindow:function(){this.map&&this.map.infoWindow&&(this.map.infoWindow.hide(),"function"===typeof this.map.infoWindow.setFeatures&&
this.map.infoWindow.setFeatures([]))}})});