// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
require({cache:{"esri/layers/FeatureLayer":function(){define("require module dojo/_base/declare dojo/_base/connect dojo/_base/lang dojo/_base/array dojo/_base/json dojo/_base/Deferred dojo/date/locale dojo/sniff dojo/io-query dojo/dom-construct dojo/i18n dojo/when dojo/promise/all ../kernel ../lang ../request ../config ../deferredUtils ../promiseList ../SpatialReference ../symbols/SimpleMarkerSymbol ../symbols/SimpleLineSymbol ../symbols/SimpleFillSymbol ../symbols/jsonUtils ../renderers/SimpleRenderer ../renderers/UniqueValueRenderer ../renderers/jsonUtils ../support/expressionUtils ../tasks/QueryTask ../tasks/query ../tasks/FeatureSet ../tasks/StatisticDefinition ../geometry/Extent ../geometry/jsonUtils ../geometry/normalizeUtils ../geometry/scaleUtils ./GraphicsLayer ./Field ./TimeInfo ./FeatureType ./FeatureTemplate ./FeatureEditResult ./LabelClass ./SnapshotMode ./OnDemandMode ./SelectionMode ./StreamMode ./TrackManager ./HeatmapManager ./clustering/ClusterManager dojo/i18n!../nls/jsapi dojo/has!extend-esri?./agscommon".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v,f,a,c,k,q,B,z,D,A,x,y,G,w,C,E,H,I,O,P,T,Z,V,aa,ba,J,K,L,Q,R,M,N,ca,S,W,da,ea,X,Y,fa,ga){var ha=B.defaults,F=p(K,{declaredClass:"esri.layers.FeatureLayer",invalidParams:"query contains one or more unsupported parameters",reHostedFS:/(https?:)?\/\/services.*\.arcgis\.com/i,maxPointCountForAuto:4E3,maxRecordCountForAuto:2E3,maxVertexCountForAuto:25E4,generalizeForScale:4E3,_eventMap:{"add-attachment-complete":["result"],"before-apply-edits":["adds","updates","deletes"],
"delete-attachments-complete":["results"],"edits-complete":["adds","updates","deletes"],"query-attachment-infos-complete":["results"],"query-count-complete":["count"],"query-features-complete":["featureSet"],"query-ids-complete":["objectIds"],"query-related-features-complete":["featureSets"],"selection-complete":["features","method"],"update-end":["error","info"]},constructor:function(c,a){this._preventInit||this._initFeatureLayer(c,a)},_initFeatureLayer:function(c,a){this.i18n=ga;a=a||{};this._featureReduction=
this._featureReduction||a.featureReduction;this._featureReductionEnabled=null!=a.featureReductionEnabled?a.featureReductionEnabled:!0;this.showLabels=null!=a.showLabels?a.showLabels:!0;this._outFields=a.outFields;this._defnExpr=a.definitionExpression;this._loadCallback=a.loadCallback;this._trackIdField=a.trackIdField;this.objectIdField=a.objectIdField;this._maxOffset=null!=a.maxAllowableOffset?a.maxAllowableOffset:this.maxAllowableOffset;this.quantize=null!=a.quantize?a.quantize:!0;this._optEditable=
a.editable;this._optAutoGen=a.autoGeneralize;this.editSummaryCallback=a.editSummaryCallback;this.userId=a.userId;this.userIsAdmin=a.userIsAdmin;this.useMapTime=a.hasOwnProperty("useMapTime")?!!a.useMapTime:!0;this.source=a.source;this.gdbVersion=a.gdbVersion;this.orderByFields=a.orderByFields;this.maxPointCountForAuto=null!=a.maxPointCountForAuto?a.maxPointCountForAuto:this.maxPointCountForAuto;this.maxRecordCountForAuto=null!=a.maxRecordCountForAuto?a.maxRecordCountForAuto:this.maxRecordCountForAuto;
this.maxVertexCountForAuto=null!=a.maxVertexCountForAuto?a.maxVertexCountForAuto:this.maxVertexCountForAuto;this.generalizeForScale=null!=a.generalizeForScale?a.generalizeForScale:this.generalizeForScale;this.queryPagination=this._optQueryPagination=null!=a.queryPagination?a.queryPagination:!0;this.multipatchOption=a.multipatchOption;this._selectedFeatures={};this._selectedFeaturesArr=[];this._newFeatures=[];this._deletedFeatures={};this._ulid=this._getUniqueId();var f=k.isDefined(a.mode)?a.mode:
F.MODE_ONDEMAND;this._isStream&&(f=F.MODE_STREAM);this.mode=f;switch(f){case F.MODE_SNAPSHOT:this.currentMode=F.MODE_SNAPSHOT;this._mode=new S(this);break;case F.MODE_ONDEMAND:case F.MODE_AUTO:this.currentMode=F.MODE_ONDEMAND;this._tileWidth=a.tileWidth||512;this._tileHeight=a.tileHeight||512;this._mode=new W(this);this.latticeTiling=a.latticeTiling;break;case F.MODE_SELECTION:this.currentMode=F.MODE_SELECTION;this._mode=new da(this);this._isSelOnly=!0;break;case F.MODE_STREAM:this.currentMode=F.MODE_STREAM,
this._mode=new ea(this),this._isStream=!0}this._initLayer=g.hitch(this,this._initLayer);this._selectHandler=g.hitch(this,this._selectHandler);this._editable=!1;if(g.isObject(c)&&c.layerDefinition)return this._collection=!0,this.mode=this._isStream?F.MODE_STREAM:F.MODE_SNAPSHOT,this._isStream||this._outFields||(this._outFields=["*"]),this._initLayer(c),this;this._task=new O(this.url,{source:this.source,gdbVersion:this.gdbVersion});f=this._url.path;this._fserver=!1;-1!==f.search(/\/FeatureServer\//i)&&
(this._fserver=!0);this.mode===F.MODE_AUTO&&this.reHostedFS.test(this.url)&&this._queryLimit();var b=a.resourceInfo;b?this._initLayer(b):(this.source&&(b={source:this.source.toJson()},this._url.query=g.mixin(this._url.query,{layer:l.toJson(b)})),this.gdbVersion&&(this._url.query=g.mixin(this._url.query,{gdbVersion:this.gdbVersion})),q({url:f,content:g.mixin({f:"json"},this._url.query),callbackParamName:"callback",load:this._initLayer,error:this._errorHandler}));this.registerConnectEvents()},_initLayer:function(a,
c){if(a||c){this._json=a;this._findCredential();if(this.credential&&this.credential.ssl||a&&a._ssl)this._useSSL(),this._task._useSSL();this.version=a.currentVersion;this.version||(this.version="capabilities"in a||"drawingInfo"in a||"hasAttachments"in a||"htmlPopupType"in a||"relationships"in a||"timeInfo"in a||"typeIdField"in a||"types"in a?10:9.3);this._collection&&(this._isStream||(this.currentMode=F.MODE_SNAPSHOT,this._mode=new S(this)),this._featureSet=a.featureSet,this._nextId=a.nextObjectId,
a=a.layerDefinition);this.geometryType=a.geometryType;"string"!==typeof this.multipatchOption&&"esriGeometryMultiPatch"===this.geometryType&&(this.multipatchOption="xyFootprint");if(a.hasOwnProperty("capabilities")){var f=this.capabilities=a.capabilities;f&&-1!==f.toLowerCase().indexOf("editing")?this._editable=!0:this._editable=!1}else this._collection||(this._editable=this._fserver);k.isDefined(this._optEditable)?(this._editable=this._optEditable,delete this._optEditable):"esriGeometryMultiPatch"===
this.geometryType&&(this._editable=!1);this._json=l.toJson(this._json);this.isEditable()?this._setMaxOffset(null):this.mode===F.MODE_SNAPSHOT||"esriGeometryPolyline"!==this.geometryType&&"esriGeometryPolygon"!==this.geometryType&&!this.hasXYFootprint()||(this._autoGeneralize=k.isDefined(this._optAutoGen)?this._optAutoGen:this.mode===F.MODE_ONDEMAND||this.mode===F.MODE_AUTO,delete this._optAutoGen);var f=a.effectiveMinScale||a.minScale,b=a.effectiveMaxScale||a.maxScale;!this._hasMin&&f&&this.setMinScale(f);
!this._hasMax&&b&&this.setMaxScale(b);this.layerId=a.id;this.name=a.name;this.description=a.description;this.copyright=a.copyrightText;this.type=a.type;this.displayField=a.displayField;this.defaultDefinitionExpression=a.definitionExpression||(a.isView?a.viewDefinitionQuery:a.definitionQuery);this.fullExtent=new V(a.extent);this.initialExtent=new V(this.fullExtent.toJson());this.fullExtent.spatialReference&&(this.spatialReference=new A(this.fullExtent.spatialReference.toJson()));this.defaultVisibility=
a.defaultVisibility;if("esriGeometryPoint"===this.geometryType||"esriGeometryMultipoint"===this.geometryType)this.latticeTiling=!1;this.hasM=a.hasM||!1;this.hasZ=a.hasZ||!1;this.indexedFields=a.indexedFields;this.maxRecordCount=a.maxRecordCount;this.canModifyLayer=a.canModifyLayer;this.supportsStatistics=a.supportsStatistics;this.supportsAdvancedQueries=this._collection?!1:a.supportsAdvancedQueries;this.supportsCalculate=a.supportsCalculate;this.supportsAttachmentsByUploadId=a.supportsAttachmentsByUploadId;
this.supportsCoordinatesQuantization=a.supportsCoordinatesQuantization;this.quantize=this.quantize&&this.supportsCoordinatesQuantization;this.hasLabels=a.hasLabels;this.canScaleSymbols=a.canScaleSymbols;this.supportsRollbackOnFailureParameter=this.supportsRollbackOnFailure=a.supportsRollbackOnFailure;this.syncCanReturnChanges=a.syncCanReturnChanges;this.isDataVersioned=a.isDataVersioned;this.editFieldsInfo=a.editFieldsInfo;this.ownershipBasedAccessControlForFeatures=a.ownershipBasedAccessControlForFeatures;
this.editFieldsInfo&&this.ownershipBasedAccessControlForFeatures&&(this.creatorField=this.editFieldsInfo.creatorField);this.relationships=a.relationships;this.allowGeometryUpdates=k.isDefined(a.allowGeometryUpdates)?a.allowGeometryUpdates:!0;this.allowUpdateWithoutMValues=!!a.allowUpdateWithoutMValues;this.enableZDefaults=!!a.enableZDefaults;this.zDefault=k.isDefined(a.zDefault)?a.zDefault:null;this.advancedQueryCapabilities=a.advancedQueryCapabilities||{supportsStatistics:this.supportsStatistics,
supportsOrderBy:this.supportsAdvancedQueries,supportsDistinct:this.supportsAdvancedQueries};this.url&&(this.advancedQueryCapabilities.supportsPagination=this.advancedQueryCapabilities.supportsPagination&&(this.reHostedFS.test(this.url)||10.3<this.version));this.queryPagination=this._optQueryPagination&&this.advancedQueryCapabilities.supportsPagination;this.useStandardizedQueries=a.useStandardizedQueries;this.tileMaxRecordCount=a.tileMaxRecordCount;this.standardMaxRecordCount=a.standardMaxRecordCount;
this._setMaxOffset(this._maxOffset,!0);this._isTable="Table"===this.type;for(var q=this.fields=[],b=a.fields,f=0;f<b.length;f++)q.push(new L(b[f]));if(!this.objectIdField){this.objectIdField=a.objectIdField;if(!this.objectIdField)for(b=a.fields,f=0;f<b.length;f++)if(q=b[f],"esriFieldTypeOID"===q.type){this.objectIdField=q.name;break}this.objectIdField||this._isStream||console.debug("esri.layers.FeatureLayer: "+k.substitute({url:this.url},"objectIdField is not set [url: ${url}]"))}if(!k.isDefined(this._nextId)){b=
this.objectIdField;q=-1;if(this._collection&&b)for(var n=(f=this._featureSet)&&f.features,v=n?n.length:0,h,f=0;f<v;f++)h=(h=n[f].attributes)&&h[b],h>q&&(q=h);this._nextId=q+1}this.globalIdField=a.globalIdField;if(f=this.typeIdField=a.typeIdField)if(f=!this._getField(f)&&this._getField(f,!0))this.typeIdField=f.name;this.visibilityField=a.visibilityField;if(b=a.defaultSymbol)this.defaultSymbol=w.fromJson(b);var B=this.types=[],z=a.types,u,U,q=(f=this.editFieldsInfo)&&f.creatorField,n=f&&f.editorField;
h=q||n;v=[];if(z)for(f=0;f<z.length;f++)u=new R(z[f]),U=u.templates,h&&U&&U.length&&(v=v.concat(U)),B.push(u);z=a.templates;u=this.templates=[];if(z)for(f=0;f<z.length;f++)B=new M(z[f]),h&&v.push(B),u.push(B);for(f=0;f<v.length;f++)if(h=g.getObject("prototype.attributes",!1,v[f]))q&&delete h[q],n&&delete h[n];if(f=a.timeInfo)this.timeInfo=new Q(f),this._startTimeField=f.startTimeField,this._endTimeField=f.endTimeField,this._startTimeField&&this._endTimeField&&(this._twoTimeFields=!0),this._trackIdField?
f.trackIdField=this._trackIdField:this._trackIdField=f.trackIdField;this.hasAttachments=!this._collection&&a.hasAttachments?!0:!1;this.htmlPopupType=a.htmlPopupType;var f=a.drawingInfo,m;(q=f&&f.labelingInfo)&&!this.labelingInfo&&(this.labelingInfo=d.map(q,function(a){return new ca(a)}),this._fixLabelExpr());if(!this.renderer)if(f&&f.renderer){if(m=f.renderer,this.setRenderer(H.fromJson(m)),"classBreaks"===m.type&&this.renderer.setMaxInclusive(!0),!this._collection){var I=m.type,b=[];m=this.renderer;
switch(I){case "simple":b.push(m.symbol);break;case "uniqueValue":case "classBreaks":b.push(m.defaultSymbol),b=b.concat(d.map(m.infos,function(a){return a.symbol}))}var b=d.filter(b,k.isDefined),p=this._url.path+"/images/",r=this._getToken();d.forEach(b,function(a){var c=a.url;c&&(-1===c.search(/https?\:/)&&-1===c.indexOf("data:")&&(a.url=p+c),r&&-1!==a.url.search(/https?\:/)&&(a.url+="?token\x3d"+r))})}}else if(b)z=this.types,0<z.length?(m=new E(this.defaultSymbol,this.typeIdField),d.forEach(z,function(a){m.addValue(a.id,
a.symbol)})):m=new C(this.defaultSymbol),this.setRenderer(m);else if(!this._isTable){switch(this.geometryType){case "esriGeometryPoint":case "esriGeometryMultipoint":I=new x;break;case "esriGeometryPolyline":I=new y;break;case "esriGeometryPolygon":I=new G;break;default:this.hasXYFootprint()&&(I=new G)}this.setRenderer(I?new C(I):null)}I=f&&f.transparency||0;!this.hasOwnProperty("opacity")&&0<I&&(this.opacity=1-I/100);(e("ie")||7<=e("trident")||e("safari"))&&this.isEditable()&&10.02>this.version&&
(this._ts=!0);this.statistics=a.statistics;this._fixRendererFields();this._updateRequiredFieldsFromLabelingInfo();this._checkFields();this._updateCaps();var O=function(){null==this._maxOffset||this._isFractionalOffsetAllowed()||this._setMaxOffset(this._maxOffset);this.loaded=!0;this.setFeatureReduction(this.getFeatureReduction());this.currentMode!==F.MODE_SNAPSHOT&&(this.queryPagination=!1);this.onLoad(this);var a=this._loadCallback;a&&(delete this._loadCallback,a(this))},I=[];this._collection?(f=
this._featureSet,this._featureSet=null,this._mode._drawFeatures(new T(f)),this._fcAdded=!0):(I.push(this._forceIdentity()),this._limitPromise&&I.push(this._limitPromise));I.push(this._evalGeometryOperations());I.length?D(I).then(g.hitch(this,function(){O.call(this)})):O.call(this)}},setShowLabels:function(a){this.showLabels=a;this.onShowLabelsChange()},onShowLabelsChange:function(){},onRendererChange:function(a){this.inherited(arguments);var c=this._map;this._ager=!!(a&&a.observationAger&&a.observationRenderer);
a&&"colors"in a&&"blurRadius"in a&&"maxPixelIntensity"in a?"esriGeometryPoint"==this.geometryType&&!this._heatmapManager&&c&&(this._heatmapManager=new Y(this),this._heatmapManager.initialize(c)):this.renderer&&this.renderer.getRendererInfo?d.some(this.renderer.rendererInfos,function(a){return a.renderer&&"colors"in a.renderer&&"blurRadius"in a.renderer})||(this._heatmapManager=null):this._heatmapManager=null;this.timeInfo&&c&&(a&&(a.latestObservationRenderer||a.trackRenderer)?this._trackManager||
(this._trackManager=new X(this),this._trackManager.initialize(c),this._childLayer=this._trackManager.container,this._mode._applyTimeFilter()):this._trackManager&&!this._isStream&&(this._trackManager.destroy(),this._trackManager=null));if(a){var f=[],c=d.filter([a,a.observationRenderer,a.latestObservationRenderer,a.trackRenderer],k.isDefined),b=function(a){return null!=a&&"function"!=typeof a&&a};d.forEach(c,function(a){var c=b(a.attributeField),q=b(a.attributeField2);a=b(a.attributeField3);!1!==c&&
f.push(c);!1!==q&&f.push(q);!1!==a&&f.push(a)});this._requiredFields=f}else this._requiredFields=[];this.loaded&&(this._fixRendererFields(),this._checkFields(this._requiredFields),this._collection&&(this._typesDirty=!0))},setFeatureReduction:function(a){a&&(a=g.mixin({},a),null!=a.clusterSize&&null==a.clusterRadius&&(a.clusterRadius=a.clusterSize),delete a.clusterSize);this.loaded?this._isFeatureReductionSupported(a)?this._featureReduction=a:(this._featureReduction=null,a&&console.log("Clustering is not supported for this layer: "+
this.url)):this._featureReduction=a;this._evalFeatureReduction(this._featureReduction)},hasFeatureReduction:function(){return!!this._featureReduction},getFeatureReduction:function(){var a=this._featureReduction;if(a){var a=g.mixin({},a),c=this._clusterManager;if(c=c&&c.aggregationInfo)a.clusterRadius=c.clusterRadius,a.infoTemplate=c.infoTemplate}return a},isFeatureReductionActive:function(){var a=this._clusterManager;return!!(a&&a.isClusteringEnabled()&&a.isClusteringActive())},isFeatureReductionEnabled:function(){return this._featureReductionEnabled},
enableFeatureReduction:function(){this._featureReductionEnabled||(this._featureReductionEnabled=!0,this._evalFeatureReduction(this._featureReduction))},disableFeatureReduction:function(){this._featureReductionEnabled&&(this._featureReductionEnabled=!1,this._evalFeatureReduction(this._featureReduction))},isFeatureReductionApplied:function(){return this.hasFeatureReduction()&&this.isFeatureReductionEnabled()&&this._canCluster(this.getFeatureReduction())},getAggregateGraphics:function(){return this._clusterManager?
this._clusterManager.getAggregateGraphics():[]},getChildGraphics:function(a){return this._clusterManager?this._clusterManager.getFeaturesInCluster(a):[]},getSingleGraphics:function(){return this._clusterManager?this._clusterManager.getSingleGraphics():[]},getFeatureReductionRenderer:function(){return this.isFeatureReductionActive()?this._clusterManager.getClusterRenderer():null},getFeatureReductionLayer:function(){return this._clusterManager?this._clusterManager.container:null},getFeatureReductionField:function(a){var c,
f=this._clusterManager?this._clusterManager.getClusterFields():null;a=a?a.toLowerCase():"";d.some(f,function(f){a===f.name.toLowerCase()&&(c=f);return!!c});return c},_isFeatureReductionSupported:function(a){return a&&"cluster"===a.type&&"esriGeometryPoint"===this.geometryType&&(this._collection||this._isStream||this._optQueryPagination&&this.advancedQueryCapabilities.supportsPagination)},_isReductionCompatibleRenderer:function(a){a=a&&a.declaredClass||"";a=a.toLowerCase();return-1<a.indexOf("simplerenderer")||
-1<a.indexOf("classbreaksrenderer")||-1<a.indexOf("uniquevaluerenderer")},_evalFeatureReduction:function(a){this.loaded&&this.getMap()&&(a=a||this.getFeatureReduction(),this._evalFetchMode(a),a&&this.isFeatureReductionEnabled()?this._canCluster(a)?this._clusterManager?this._updateClusterManager(a):(this._clusterManager=this._createClusterManager(a),this.onFeatureReductionChange()):(console.log("Clustering is supported only for point layers where map spatial reference is WGS84 or Web Mercator"),this._destroyClusterManager()):
this._destroyClusterManager())},_canCluster:function(a){var c=this._map.spatialReference;return this._isFeatureReductionSupported(a)&&this._isReductionCompatibleRenderer(this.renderer)&&(c.isWebMercator()||4326===c.wkid)},_createClusterManager:function(a){a=new fa({layer:this,aggregationInfo:a});this._clusterHandles=[a.on("renderer-change",g.hitch(this,function(){this.onFeatureReductionRendererChange()}))];a.initialize(this._map);return a},_updateClusterManager:function(a){var c=this._clusterManager;
c&&c.setAggregationInfo(a)},_destroyClusterManager:function(a){d.forEach(this._clusterHandles,function(a){a.remove()});this._clusterHandles=null;this._clusterManager&&(this._clusterManager.destroy(a),this._clusterManager=null,this.onFeatureReductionChange())},redraw:function(){this.inherited(arguments);this._clusterManager&&this._clusterManager.redraw();this._trackManager&&this._trackManager.container&&this._trackManager.container.redraw()},_evalSDRenderer:function(a){this.inherited(arguments);var c=
this._getRenderer();this._ager=!!(c&&c.observationAger&&c.observationRenderer);this._trackManager&&this._trackManager.container&&this._trackManager.container.setRenderer(c&&c.trackRenderer);a&&this._evalFeatureReduction()},_setMap:function(a){var c=this.inherited(arguments),f=this._mode,b=this;f&&a.loaded&&f.initialize(a);this.geometryType&&this.attr("data-geometry-type",this.geometryType.replace(/esriGeometry/i,"").toLowerCase());this._addHandle=this.on("graphic-node-add",function(a){a=a.graphic.attributes;
(a=b._selectedFeatures[a&&a[b.objectIdField]])&&a.attr("data-selected","")});return c},_unsetMap:function(a){var c=this._mode;c&&(c.suspend(),c.destroy());this._destroyClusterManager(!1);this._trackManager&&(this._trackManager.destroy(),this._trackManager=null);m.disconnect(this._zoomConnect);m.disconnect(this._addHandle);this._zoomConnect=this._addHandle=null;this._toggleTime(!1);this.inherited("_unsetMap",arguments)},refresh:function(){this._needsRefresh=!1;var a=this._mode;a&&a.refresh()},hasXYFootprint:function(){return"esriGeometryMultiPatch"===
this.geometryType&&"xyFootprint"===this.multipatchOption},getOutFields:function(){return d.filter(this._getOutFields(),function(a){return"*"===a||!!this._getField(a)},this)},getField:function(a){return this._getField(a,!0)},isOutField:function(a){a=this.getField(a);if(!a)return!1;var c=this.getOutFields();return-1<d.indexOf(c,"*")||-1<d.indexOf(c,a.name)},getFieldLabel:function(a){var c=this.infoTemplate,c=c&&c.getFieldInfo&&c.getFieldInfo(a);a=g.isFunction(a)?null:this.getField(a);var f=c||a,b="";
f&&(b=c&&c.label||a&&a.alias||f.name||f.fieldName);return b},getDomain:function(a,c){var f,b,q=c&&c.feature,k=q&&this.typeIdField&&q.attributes&&q.attributes[this.typeIdField];null!=k&&d.some(this.types,function(c){return c.id==k?((f=c.domains&&c.domains[a])&&"inherited"===f.type&&(f=this._getLayerDomain(a),b=!0),!0):!1},this);b||f||(f=this._getLayerDomain(a));return f},_getLayerDomain:function(a){var c;d.some(this.fields,function(f){f.name===a&&(c=f.domain);return!!c});return c},getType:function(a){var c,
f=a&&this.typeIdField&&a.attributes&&a.attributes[this.typeIdField];d.some(this.types,function(a){a.id==f&&(c=a);return!!c});return c},setEditable:function(a){if(!this._collection)return console.log("FeatureLayer:setEditable - this functionality is not yet supported for layer in a feature service"),this;if(!this.loaded)return this._optEditable=a,this;var c=this._editable;this._editable=a;this._updateCaps();if(c!==a)this.onCapabilitiesChange();return this},getEditCapabilities:function(a){var c={canCreate:!1,
canUpdate:!1,canDelete:!1,canUpdateGeometry:!1};if(!this.loaded||!this.isEditable())return c;var f=a&&a.feature;a=a&&a.userId||this.getUserId();var b=d.map(this.capabilities?this.capabilities.toLowerCase().split(","):[],g.trim),q=(c=-1<d.indexOf(b,"editing"))&&-1<d.indexOf(b,"create"),k=c&&-1<d.indexOf(b,"update"),b=c&&-1<d.indexOf(b,"delete"),e=this.ownershipBasedAccessControlForFeatures,y=this.editFieldsInfo,w=y&&y.creatorField,y=y&&y.realm,f=(f=f&&f.attributes)&&w?f[w]:void 0,n=!!this.userIsAdmin,
w=!e||n||!(!e.allowOthersToUpdate&&!e.allowUpdateToOthers),x=!e||n||!(!e.allowOthersToDelete&&!e.allowDeleteToOthers),v=!e||n||!e.hasOwnProperty("allowAnonymousToUpdate")||e.allowAnonymousToUpdate,e=!e||n||!e.hasOwnProperty("allowAnonymousToDelete")||e.allowAnonymousToDelete;a&&y&&(a=a+"@"+y);if(n||c&&!(q||k||b))q=k=b=!0;c={canCreate:q,canUpdate:k,canDelete:b,canUpdateGeometry:n||this.allowGeometryUpdates};a||(c.canUpdate=c.canUpdate&&v,c.canDelete=c.canDelete&&e);null===f?(c.canUpdate=c.canUpdate&&
w,c.canDelete=c.canDelete&&x):""!==f&&f&&a.toLowerCase()!==f.toLowerCase()&&(c.canUpdate=c.canUpdate&&w,c.canDelete=c.canDelete&&x);return c},getUserId:function(){var a;this.loaded&&(a=this.credential&&this.credential.userId||this.userId||"");return a},setUserIsAdmin:function(a){this.userIsAdmin=a},setEditSummaryCallback:function(a){this.editSummaryCallback=a},getEditSummary:function(a,c,f){f=k.isDefined(f)?f:(new Date).getTime();var b="";f=this.getEditInfo(a,c,f);(c=c&&c.callback||this.editSummaryCallback)&&
(f=c(a,f)||"");if(g.isString(f))b=f;else{if(f){a=f.action;c=f.userId;var q=f.timeValue,e=0;a&&e++;c&&e++;k.isDefined(q)&&e++;1<e&&(b=("edit"===a?"edit":"create")+(c?"User":"")+(k.isDefined(q)?f.displayPattern:""))}b=b&&k.substitute(f,this.i18n.layers.FeatureLayer[b])}return b},getEditInfo:function(a,c,f){if(this.loaded){f=k.isDefined(f)?f:(new Date).getTime();c=c&&c.action||"last";var b=this.editFieldsInfo,q=b&&b.creatorField,e=b&&b.creationDateField,y=b&&b.editorField,b=b&&b.editDateField,y=(a=a&&
a.attributes)&&y?a[y]:void 0,b=a&&b?a[b]:null,q=this._getEditData(a&&q?a[q]:void 0,a&&e?a[e]:null,f);f=this._getEditData(y,b,f);var w;switch(c){case "creation":w=q;break;case "edit":w=f;break;case "last":w=f||q}w&&(w.action=w===f?"edit":"creation");return w}},_getEditData:function(a,c,f){var b,q,e;k.isDefined(c)&&(q=f-c,e=0>q?"Full":6E4>q?"Seconds":12E4>q?"Minute":36E5>q?"Minutes":72E5>q?"Hour":864E5>q?"Hours":6048E5>q?"WeekDay":"Full");if(void 0!==a||e)b=b||{},b.userId=a,e&&(a=u.format,f=new Date(c),
b.minutes=Math.floor(q/6E4),b.hours=Math.floor(q/36E5),b.weekDay=a(f,{datePattern:"EEEE",selector:"date"}),b.formattedDate=a(f,{selector:"date"}),b.formattedTime=a(f,{selector:"time"}),b.displayPattern=e,b.timeValue=c);return b},isEditable:function(){return!(!this._editable&&!this.userIsAdmin)},isQueryable:function(){var a=d.map(this.capabilities?this.capabilities.toLowerCase().split(","):[],g.trim);return this._isStream||this.userIsAdmin||this._collection||-1!==d.indexOf(a,"query")||-1!==d.indexOf(a,
"catalog")},setMaxAllowableOffset:function(a){this.isEditable()||this._setMaxOffset(a,!0);return this},getMaxAllowableOffset:function(){var a=this._quantizationParameters?this._quantizationParameters.tolerance:void 0;return null!=this._maxOffset?this._maxOffset:a},_setMaxOffset:function(a,c){if(null==a)return delete this._maxOffset,delete this._quantizationParameters,this;this.quantize&&this.supportsCoordinatesQuantization?("esriGeometryPolyline"===this.geometryType?this._maxOffset=a:delete this._maxOffset,
this._quantizationParameters={mode:"view",originPosition:"upperLeft",tolerance:a,extent:this.fullExtent}):(this._isFractionalOffsetAllowed()&&c||(a=Math.floor(a)),isNaN(a)||0===a?delete this._maxOffset:this._maxOffset=a,delete this._quantizationParameters);return this},_isFractionalOffsetAllowed:function(){return null==this.version||10.1<=this.version||navigator.languages&&this._isLangWithDot(navigator.languages[0])},_isLangWithDot:function(a){a=(a=a&&a.split("-"))&&a[0]&&a[0].toLowerCase();return-1!==
d.indexOf(this._langsWithDot,a)},_langsWithDot:"ar en et fr he ja ko th vi zh".split(" "),setAutoGeneralize:function(a){this.loaded?this.isEditable()||this.mode===F.MODE_SNAPSHOT||"esriGeometryPolyline"!==this.geometryType&&"esriGeometryPolygon"!==this.geometryType&&!this.hasXYFootprint()||((this._autoGeneralize=a)?(this._autoSnapshot&&(this._prevScale=null),this._updateMaxOffset()):this._setMaxOffset(null)):this._optAutoGen=a;return this},setGDBVersion:function(a){this._collection||a===this.gdbVersion||
!a&&!this.gdbVersion||(this.gdbVersion=a,this._task.gdbVersion=a,this._url.query=g.mixin(this._url.query,{gdbVersion:a}),this.loaded&&(this.clearSelection(),this._map&&this.refresh()),this.onGDBVersionChange());return this},hasAllFeatures:function(){return this._mode?this._mode.hasAllFeatures():!0},setDefinitionExpression:function(a){this._defnExpr=a;(a=this._mode)&&a.propertyChangeHandler(1);return this},getDefinitionExpression:function(){return this._defnExpr},setTimeDefinition:function(a){this._isSnapshotMode()?
(this._timeDefn=a,(a=this._mode)&&a.propertyChangeHandler(2)):console.log("FeatureLayer.setTimeDefinition: layer in on-demand or selection mode does not support time definitions. Layer id \x3d "+this.id+", Layer URL \x3d "+this.url);return this},getTimeDefinition:function(){return this._timeDefn},setTimeOffset:function(a,c){this._timeOffset=a;this._timeOffsetUnits=c;var f=this._mode;f&&f.propertyChangeHandler(0);return this},setUseMapTime:function(a){this.useMapTime=a;this._toggleTime(!this.suspended);
(a=this._mode)&&a.propertyChangeHandler(0)},selectFeatures:function(a,c,b,q){c=c||F.SELECTION_NEW;this._hasPartialSelectedFeatures=!1;a=this._getShallowClone(a);var e=this._map,k,y=this,w=z._fixDfd(new h(z._dfdCanceller));a.outFields=this.getOutFields();a.returnGeometry=!0;a.multipatchOption=this.multipatchOption;e&&(a.outSpatialReference=new A(e.spatialReference.toJson()));if(!this._applyQueryFilters(a,!0))return k={features:[]},this._selectHandler(k,c,b,q,w),w;if(e=this._canDoClientSideQuery(a))w._pendingDfd=
f(this._doQuery(a,e)),w._pendingDfd.then(function(a){k={features:a};y._selectHandler(k,c,b,q,w)});else{if(this._collection)return this._resolve([Error("FeatureLayer::selectFeatures - "+this.invalidParams)],null,q,w,!0),w;if(this.loaded&&!this.isQueryable())return this._resolve([Error("Layer does not support query capability.")],null,q,w,!0),w;var d=this;this._ts&&(a._ts=(new Date).getTime());(w._pendingDfd=this._task.execute(a)).addCallbacks(function(a){d._selectHandler(a,c,b,q,w)},function(a){d._hasPartialSelectedFeatures=
!0;d._resolve([a],null,q,w,!0)})}return w},getSelectedFeatures:function(){var a=this._selectedFeatures,c=[],f;for(f in a)a.hasOwnProperty(f)&&c.push(a[f]);return c},clearSelection:function(a){var c=this._selectedFeatures,f=this._mode,b;for(b in c)c.hasOwnProperty(b)&&(this._unSelectFeatureIIf(b,f),f._removeFeatureIIf(b));this._selectedFeatures={};this._isSelOnly&&f._applyTimeFilter(!0);if(!a)this.onSelectionClear();return this},setSelectionSymbol:function(a){if(this._selectionSymbol=a){var c=this._selectedFeatures,
f;for(f in c)c.hasOwnProperty(f)&&c[f].setSymbol(a)}return this},getSelectionSymbol:function(){return this._selectionSymbol},setLabelingInfo:function(a){a?(this.labelingInfo=a,this._fixLabelExpr()):delete this.labelingInfo;this._collection&&(this._typesDirty=!0);this.onLabelingInfoChange()},_fixLabelExpr:function(){var a=/\[([^\[\]]+)\]/ig,c,f=this,b=function(a,c){var b=f._getField(c,!0);return"["+(b&&b.name||c)+"]"};d.forEach(this.labelingInfo,function(f){if(c=f.labelExpression)f.labelExpression=
c.replace(a,b)})},_updateRequiredFieldsFromLabelingInfo:function(){var a=[];d.forEach(this.labelingInfo,function(c){var f=c.labelExpressionInfo;if(c.labelExpression){var b=/[\[\]]/ig;c=c.labelExpression.match(/\[[^\[\]]+\]/ig);(c=d.map(c,function(a){return a.replace(b,"")}))&&(a=a.concat(c))}if(f){if(f.value){var q=/[\{\}]/ig;c=f.value.match(/\{[^\{\}]+\}/ig);(c=d.map(c,function(a){return a.replace(q,"")}))&&(a=a.concat(c))}f.expression&&(a=a.concat(I.extractFieldNames(f.expression)))}});a=d.map(a,
function(a){var c=this.getField(a);return c?c.name:a},this);this._requiredFields&&(this._requiredFields=this._requiredFields.concat(a))},__msigns:[{n:"applyEdits",c:5,a:[{i:0},{i:1}],e:4,f:1}],applyEdits:function(a,c,f,b,e,k){var w=k.assembly,y=k.dfd;this._applyNormalized(a,w&&w[0]);this._applyNormalized(c,w&&w[1]);this.onBeforeApplyEdits(a,c,f);var n={},x=this.objectIdField,w={f:"json"},v=!1;if(this._collection)k={},k.addResults=a?d.map(a,function(){v=!0;return{objectId:this._nextId++,success:!0}},
this):null,k.updateResults=c?d.map(c,function(a){v=!0;var c=a.attributes[x];n[c]=a;return{objectId:c,success:!0}},this):null,k.deleteResults=f?d.map(f,function(a){v=!0;return{objectId:a.attributes[x],success:!0}},this):null,v?this._editHandler(k,a,n,b,e,y):this._resolve([k.addResults,k.updateResults,k.deleteResults],null,b,y);else{a&&0<a.length&&(w.adds=this._convertFeaturesToJson(a,0,1),v=!0);if(c&&0<c.length){for(k=0;k<c.length;k++){var h=c[k];n[h.attributes[x]]=h}w.updates=this._convertFeaturesToJson(c,
0,0,1);v=!0}if(f&&0<f.length){c=[];for(k=0;k<f.length;k++)c.push(f[k].attributes[x]);w.deletes=c.join(",");v=!0}if(v){var A=this;return q({url:this._url.path+"/applyEdits",content:g.mixin(w,this._url.query),callbackParamName:"callback",load:function(c){A._editHandler(c,a,n,b,e,y)},error:function(a){A._resolve([a],null,e,y,!0)}},{usePost:!0})}this._resolve([],null,b,y)}},queryFeatures:function(a,c,f){return this._query("execute","onQueryFeaturesComplete",a,c,f)},queryRelatedFeatures:function(a,c,f){return this._query("executeRelationshipQuery",
"onQueryRelatedFeaturesComplete",a,c,f)},queryIds:function(a,c,f){return this._query("executeForIds","onQueryIdsComplete",a,c,f)},queryCount:function(a,c,f){return this._query("executeForCount","onQueryCountComplete",a,c,f)},queryExtent:function(a,c,f){return this._query("executeForExtent","onQueryExtentComplete",a,c,f)},queryAttachmentInfos:function(a,c,f){var k=this._url.path+"/"+a+"/attachments",e=new h(z._dfdCanceller),w=this;e._pendingDfd=q({url:k,content:g.mixin({f:"json"},this._url.query),
callbackParamName:"callback",load:function(f){f=f.attachmentInfos;var q;d.forEach(f,function(c){q=b.objectToQuery({gdbVersion:w._url.query&&w._url.query.gdbVersion,layer:w._url.query&&w._url.query.layer,token:w._getToken()});c.url=k+"/"+c.id+(q?"?"+q:"");c.objectId=a});w._resolve([f],"onQueryAttachmentInfosComplete",c,e)},error:function(a){w._resolve([a],null,f,e,!0)}});return e},addAttachment:function(a,c,f,b){return this._sendAttachment("add",a,c,f,b)},updateAttachment:function(a,c,f,b,q){f.appendChild(n.create("input",
{type:"hidden",name:"attachmentId",value:c}));return this._sendAttachment("update",a,f,b,q)},deleteAttachments:function(a,c,f,b){var e=this._url.path+"/"+a+"/deleteAttachments",k=new h(z._dfdCanceller),w=this;c={f:"json",attachmentIds:c.join(",")};k._pendingDfd=q({url:e,content:g.mixin(c,this._url.query),callbackParamName:"callback",load:g.hitch(this,function(c){c=c.deleteAttachmentResults;c=d.map(c,function(c){c=new N(c);c.attachmentId=c.objectId;c.objectId=a;return c});w._resolve([c],"onDeleteAttachmentsComplete",
f,k)}),error:function(a){w._resolve([a],null,b,k,!0)}},{usePost:!0});return k},addType:function(a){var c=this.types;if(c){if(d.some(c,function(c){return c.id==a.id?!0:!1}))return!1;c.push(a)}else this.types=[a];return this._typesDirty=!0},deleteType:function(a){if(this._collection){var c=this.types;if(c){var f=-1;d.some(c,function(c,b){return c.id==a?(f=b,!0):!1});if(-1<f)return this._typesDirty=!0,c.splice(f,1)[0]}}},toJson:function(){var a=this._json;if(a=g.isString(a)?l.fromJson(a):g.clone(a)){var a=
a.layerDefinition?a:{layerDefinition:a},c=a.layerDefinition,f=this._collection;if(f&&this._typesDirty){c.types=d.map(this.types||[],function(a){return a.toJson()});var b=this.renderer,q=this.labelingInfo,k=c.drawingInfo;!b&&!q||k||(k=c.drawingInfo={});k&&b&&-1===b.declaredClass.indexOf("TemporalRenderer")&&(k.renderer=b.toJson());q&&(k.labelingInfo=d.map(q,function(a){return a.toJson()}))}b=null;if(!f||this._fcAdded)b={geometryType:c.geometryType,features:this._convertFeaturesToJson(this.graphics,
!0)};a.featureSet=g.mixin({},a.featureSet||{},b);a.featureSet.transform&&(q=a.featureSet.transform,delete a.featureSet.transform,b=new T(a.featureSet),b.quantize(q),a.featureSet=b.toJson());f&&(a.nextObjectId=this._nextId,c.capabilities=this.capabilities);return a}},onSelectionComplete:function(){},onSelectionClear:function(){},onBeforeApplyEdits:function(){},onEditsComplete:function(){},onQueryFeaturesComplete:function(){},onQueryRelatedFeaturesComplete:function(){},onQueryIdsComplete:function(){},
onQueryCountComplete:function(){},onQueryExtentComplete:function(){},onQueryAttachmentInfosComplete:function(){},onAddAttachmentComplete:function(){},onUpdateAttachmentComplete:function(){},onDeleteAttachmentsComplete:function(){},onCapabilitiesChange:function(){},onGDBVersionChange:function(){},onQueryLimitExceeded:function(){},onLabelingInfoChange:function(){},onFeatureReductionRendererChange:function(){},onFeatureReductionChange:function(){},_evalGeometryOperations:function(){var a=new h;setTimeout(g.hitch(this,
function(){this._isGeometryOperationsUsed()?I.enableGeometryOperations().always(function(){a.resolve()}):a.resolve()}),0);return a.promise},_isGeometryOperationsUsed:function(){var a=this.infoTemplate,c=this.renderer,f=this.labelingInfo;return a&&a.hasGeometryOperations&&a.hasGeometryOperations()||c&&c.hasGeometryOperations&&c.hasGeometryOperations()||d.some(f,function(a){return I.hasGeometryOperations(a.labelExpressionInfo&&a.labelExpressionInfo.expression)})?!0:!1},_forceIdentity:function(){var a=
new h,f=this,b,k=this._url&&this._url.path;b=k&&k.toLowerCase().indexOf("/rest/services");var e=this.editFieldsInfo,e=e&&(e.creatorField||e.editorField);(this.userIsAdmin||e)&&!this._getToken()&&-1<b&&c.id?(b=k.substring(0,b)+"/rest/info",q({url:b,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}).then(function(a){if(a.owningSystemUrl)return c.id.checkSignInStatus(a.owningSystemUrl+"/sharing")}).then(function(a){if(a)return c.id.getCredential(k)}).then(function(a){a&&f._findCredential()}).always(function(){a.resolve()})):
a.resolve();return a.promise},_isSnapshotMode:function(){return this._mode?this._mode.isInstanceOf(S):!1},_checkMode:function(a){var c=this.geometryType,f=this.maxRecordCount;a=(a=a&&a.features&&a.features[0])&&a.attributes&&a.attributes.exceedslimit;this.mode===F.MODE_AUTO&&!this.isEditable()&&0===a&&(this.queryPagination||("esriGeometryPolyline"===c||"esriGeometryPolygon"===c||"esriGeometryMultipoint"===c||this.hasXYFootprint())&&f>=this.maxRecordCountForAuto||"esriGeometryPoint"===c&&f>=this.maxPointCountForAuto)&&
(this.currentMode=F.MODE_SNAPSHOT,this._mode=new S(this),this._autoSnapshot=!0)},_evalFetchMode:function(a){this.loaded&&(a&&this.isFeatureReductionEnabled()&&this._canCluster(a)?this._switchToSnapshotMode():this._switchToNormalMode())},_switchToSnapshotMode:function(){if(null==this._savedMode){var a=this.currentMode;a!==F.MODE_SNAPSHOT&&a!==F.MODE_STREAM&&a!==F.MODE_SELECTION&&(this._savedMode=this.mode,this._mode.suspend(),this._mode.destroy(),this.mode=this.currentMode=F.MODE_SNAPSHOT,this._mode=
new S(this),this.queryPagination=this._optQueryPagination&&this.advancedQueryCapabilities.supportsPagination,this.clearSelection(),(a=this.getMap())&&a.loaded&&(this._mode.initialize(a),this._mode.startup()))}},_switchToNormalMode:function(){if(null!=this._savedMode){this._mode.suspend();this._mode.destroy();this.mode=this._savedMode;this._savedMode=null;this.currentMode=F.MODE_ONDEMAND;this._mode=new W(this);this.queryPagination=!1;this.clearSelection();var a=this.getMap();a&&a.loaded&&(this._mode.initialize(a),
this._mode.startup())}},_queryLimit:function(){var a=this,c=new h;this._limitPromise=c.promise;this._limitPromise.then(function(c){a._checkMode(c)});this._limitPromise.always(function(){a._limitPromise=null});setTimeout(function(){var f=new P,b=new Z;b.statisticType="exceedslimit";b.maxPointCount=a.maxPointCountForAuto;b.maxRecordCount=a.maxRecordCountForAuto;b.maxVertexCount=a.maxVertexCountForAuto;b.outStatisticFieldName="exceedslimit";f.outStatistics=[b];a.queryFeatures(f).promise.then(function(a){c.resolve(a)},
function(a){c.reject(a)})},0)},_updateCaps:function(){var a=this._editable,c=g.trim(this.capabilities||""),f=d.map(c?c.split(","):[],g.trim),b=d.map(c?c.toLowerCase().split(","):[],g.trim),c=d.indexOf(b,"editing"),q,b={Create:d.indexOf(b,"create"),Update:d.indexOf(b,"update"),Delete:d.indexOf(b,"delete")};if(a&&-1===c)f.push("Editing");else if(!a&&-1<c){a=[c];for(q in b)-1<b[q]&&a.push(b[q]);a.sort();for(q=a.length-1;0<=q;q--)f.splice(a[q],1)}this.capabilities=f.join(",")},_counter:{value:0},_getUniqueId:function(){return this._counter.value++},
onSuspend:function(){this.inherited(arguments);this._toggleTime(!1);var a=this._mode;a&&a.suspend()},onResume:function(a){this.inherited(arguments);this._toggleTime(!0);var c=this._map,f=this._getRenderer();if(a.firstOccurrence){if(this._fixRendererFields(),this._updateRequiredFieldsFromLabelingInfo(),this._checkFields(),this.clearSelection(),this._evalFeatureReduction(),this.timeInfo&&!this._trackManager&&(this._trackIdField||f&&(f.latestObservationRenderer||f.trackRenderer))&&(this._trackManager=
new X(this),this._trackManager.initialize(c),this._childLayer=this._trackManager.container),f&&"colors"in f&&"blurRadius"in f&&"maxPixelIntensity"in f&&"esriGeometryPoint"==this.geometryType&&!this._heatmapManager&&(this._heatmapManager=new Y(this),this._heatmapManager.initialize(c)),this._autoSnapshot&&this._autoGeneralize&&("esriGeometryPolyline"===this.geometryType||"esriGeometryPolygon"===this.geometryType||this.hasXYFootprint())&&!this.isEditable()&&null==this.getMaxAllowableOffset()&&(f=this.generalizeForScale,
this._calculatedScale=f=this.maxScale?this.maxScale:this.minScale?Math.min(f,this.minScale):Math.min(f,J.getScale(c,this.initialExtent)),this._calcMaxOffset=c.extent.getWidth()/c.width/c.getScale()*f),this._zoomConnect=m.connect(c,"onZoomEnd",this,this._zoomEndHandler),this._updateMaxOffset(),this._needsRefresh=!1,f=this._mode)f._init||f.initialize(c),f.startup()}else this._zoomEndHandler(),this._mode&&this._mode.resume()},_zoomEndHandler:function(){var a=this._map;this._updateMaxOffset();this._prevScale=
a.getScale();!this.suspended&&this._needsRefresh&&this.refresh()},_updateMaxOffset:function(){var a=this._map;a&&a.loaded&&this._autoGeneralize&&(this._autoSnapshot?(a=this.getMaxAllowableOffset(),this._setMaxOffset(this._getMaxOffsetForScale(),!0),this._needsRefresh||(this._needsRefresh=a!=this.getMaxAllowableOffset())):this._setMaxOffset(a.extent.getWidth()/a.width,!a.extent.spatialReference.isWebMercator()))},_getMaxOffsetForScale:function(){if(this._map){var a=this._map.getScale(),c=this._calculatedScale,
f=this._calcMaxOffset,b=this._prevScale;return a>=c&&(null==b||b<c)?f:a<c&&(null==b||b>=c)?null:this.getMaxAllowableOffset()}},_toggleTime:function(a){var c=this._map;a&&this.timeInfo&&this.useMapTime&&c?(this._mapTimeExtent=c.timeExtent,this._timeConnect||(this._timeConnect=m.connect(c,"onTimeExtentChange",this,this._timeChangeHandler))):(this._mapTimeExtent=null,m.disconnect(this._timeConnect),this._timeConnect=null)},_timeChangeHandler:function(a){this._mapTimeExtent=a;(a=this._mode)&&a.propertyChangeHandler(0)},
_getOffsettedTE:function(a){var c=this._timeOffset,f=this._timeOffsetUnits;return a&&c&&f?a.offset(-1*c,f):a},_getTimeOverlap:function(a,c){return a&&c?a.intersection(c):a||c},_getTimeFilter:function(a){var c=this.getTimeDefinition(),f;if(c&&(f=this._getTimeOverlap(c,null),!f))return[!1];if(a){if(a=f?this._getTimeOverlap(a,f):a,!a)return[!1]}else a=f;return[!0,a]},_getAttributeFilter:function(a){var c=this.getDefinitionExpression();return a?c?"("+c+") AND ("+a+")":a:c},_applyQueryFilters:function(a,
c){a.where=this._getAttributeFilter(a.where);a.returnGeometry&&null==a.maxAllowableOffset&&!a.quantizationParameters&&(a.maxAllowableOffset=this._maxOffset,a.quantizationParameters=this._quantizationParameters);c&&this.supportsAdvancedQueries&&(a.orderByFields=a.orderByFields||this.getOrderByFields());if(this.timeInfo){var f=this._getTimeFilter(a.timeExtent);if(f[0])a.timeExtent=f[1];else return!1}return!0},_add:function(a){var c=this._selectionSymbol,f=a.attributes,b=this.visibilityField;c&&this._isSelOnly&&
a.setSymbol(c);if(b&&f&&f.hasOwnProperty(b))a[f[b]?"show":"hide"]();return this.add.apply(this,arguments)},_remove:function(){return this.remove.apply(this,arguments)},_canDoClientSideQuery:function(a){var c=[],f=this._map,b;if((this._collection||!this._isTable&&f)&&!(a.text||a.where&&a.where!==this.getDefinitionExpression()||a.orderByFields&&a.orderByFields.length&&(b=this.getOrderByFields()||[])&&a.orderByFields.join()!==b.join()||a.outStatistics||a.returnDistinctValues)){b=this._isSnapshotMode();
var q=this._isSelOnly,k=a.geometry;if(k){if(q||a.spatialRelationship!==P.SPATIAL_REL_INTERSECTS||"extent"!==k.type||!b&&!f.extent.contains(k))return;c.push(1)}if(f=a.objectIds)if(b)c.push(2);else{var k=f.length,e=this._mode,w=0,y;for(y=0;y<k;y++)e._getFeature(f[y])&&w++;if(w===k)c.push(2);else return}if(this.timeInfo)if(a=a.timeExtent,f=this._mapTimeExtent,b)a&&c.push(3);else if(q){if(a)return}else if(f)if(-1!==d.indexOf(c,2))a&&c.push(3);else if(-1!==d.indexOf(c,1))a==f&&c.push(3);else return;else if(0<
c.length)a&&c.push(3);else if(a)return;return 0<c.length?c:null}},_getAbsMid:function(a){return t.toAbsMid?t.toAbsMid(a):r.id.replace(/\/[^\/]*$/ig,"/")+a},_doQuery:function(a,c,f){var b=[],q=this.objectIdField,k=this,e=new h,w=new h,y=this.graphics;if(-1!==d.indexOf(c,1)){var n=this.spatialIndex||this._map&&this._map.spatialIndex,x,v=a.geometry._normalize(null,!0);null==n&&ha.autoSpatialIndexing?x=(this._map||this).addPlugin(this._getAbsMid("../plugins/spatialIndex")).then(g.hitch(this,g.partial(this._getFromIndex,
v,n)),function(a){w.resolve(g.hitch(this,g.partial(this._filterByExtent,y,v)))}):n&&(x=this._getFromIndex(v,n));x?x.then(function(a){for(var c=0;c<a.length;c++)a[c].results&&(b=b.concat(a[c].results));w.resolve(b)}).otherwise(function(a){w.reject(a)}):w.resolve(this._filterByExtent(y,v))}else w.resolve(y);w.then(function(w){b=w;if(-1!==d.indexOf(c,2)){var y=a.objectIds;b=d.filter(b,function(a){return-1<d.indexOf(y,a.attributes[q])})}-1!==d.indexOf(c,3)&&k.timeInfo&&(w=a.timeExtent,b=k._filterByTime(b,
w.startTime,w.endTime).match);f&&(b=d.map(b,function(a){return a.attributes[q]},this));e.resolve(b)});return e},_getFromIndex:function(c,f){f=f||this.spatialIndex||this._map.spatialIndex;c instanceof Array||(c=[c]);var b=this.id;return a(d.map(c,function(a){return f.intersects(a,b)}))},_filterByExtent:function(a,c){for(var f=[],b=0,q=a.length;b<q;b++){var k=a[b],e=k.geometry;e&&(this.normalization&&c.length?(c[0].intersects(e)||c[1].intersects(e))&&f.push(k):c.intersects(e)&&f.push(k))}return f},
_filterByTime:function(a,c,f){var b=this._startTimeField,q=this._endTimeField,e;this._twoTimeFields||(e=b||q);var w=k.isDefined,y=[],d=[],n,x=a.length,v,h;c=c?c.getTime():-Infinity;f=f?f.getTime():Infinity;if(e)for(n=0;n<x;n++)v=a[n],h=v.attributes,b=h[e],b>=c&&b<=f?y.push(v):d.push(v);else for(n=0;n<x;n++)v=a[n],h=v.attributes,e=h[b],h=h[q],e=w(e)?e:-Infinity,h=w(h)?h:Infinity,e>=c&&e<=f||h>=c&&h<=f||c>=e&&f<=h?y.push(v):d.push(v);return{match:y,noMatch:d}},_getSizeVariables:function(a){return a&&
d.filter(a.getVisualVariablesForType("sizeInfo",!1),function(a){return!(!a.field&&!a.valueExpression)})},_needClientSideSorting:function(a){return this._collection?!(!a||!a.length):d.some(a,function(a){return!!a.valueExpression})},_sortFeatures:function(a){var c=this.renderer,f=this._getSizeVariables(c);if(a&&1<a.length&&this._needClientSideSorting(f)){var b=f[0],q=this;a.sort(function(a,f){a._layer||(a._layer=q);f._layer||(f._layer=q);var k=c._getDataValue(a,b,"sizeInfo",null,q),e=c._getDataValue(f,
b,"sizeInfo",null,q);return null==k?-1:null==e?1:e-k})}return a},_resolve:function(a,c,f,b,q){c&&this[c].apply(this,a);f&&f.apply(null,a);b&&z._resDfd(b,a,q)},_getShallowClone:function(a){var c=new P,f;for(f in a)a.hasOwnProperty(f)&&(c[f]=a[f]);return c},_query:function(a,c,b,q,k){var e=this,w=this._map,y=new h(z._dfdCanceller),n=b,v,x,B;if("executeRelationshipQuery"!==a){var n=this._getShallowClone(b),g=this.getOutFields();n.outFields||(n.outFields=g);n.outFields&&n.outFields.length&&(x=-1<d.indexOf(g,
"*")?!1:!d.every(n.outFields,function(a){return-1<d.indexOf(g,a)}));n.returnGeometry=b.hasOwnProperty("returnGeometry")?b.returnGeometry:!b.outStatistics;n.returnGeometry&&(n.multipatchOption=this.multipatchOption,null!=n.maxAllowableOffset||n.quantizationParameters)&&(b=null!=n.maxAllowableOffset?n.maxAllowableOffset:n.quantizationParameters.tolerance,null!=b&&b!==this.getMaxAllowableOffset()&&(B=!0));var C;w&&(w=w&&w.spatialReference,(b=n.outSpatialReference)?v=!b.equals(w):n.outSpatialReference=
new A(w.toJson()));if(!this._applyQueryFilters(n,"execute"===a&&!n.outStatistics)){switch(a){case "execute":C=new T({features:[]});break;case "executeForIds":C=[];break;case "executeForCount":C=0;break;case "executeForExtent":C={}}this._resolve([C],c,q,y);return y}if(w="executeForExtent"!==a&&!v&&!x&&!B&&this._canDoClientSideQuery(n))return y._pendingDfd=f(this._doQuery(n,w,"executeForIds"===a||"executeForCount"===a)),y._pendingDfd.then(function(f){switch(a){case "execute":C=new T;C.features=f;break;
case "executeForIds":C=f;break;case "executeForCount":C=f.length}e._resolve([C],c,q,y)}),y}if(this._collection)return this._resolve([Error("FeatureLayer::_query - "+this.invalidParams)],null,k,y,!0),y;if(this.loaded&&!this.isQueryable())return this._resolve([Error("Layer does not support query capability.")],null,k,y,!0),y;this._ts&&(n._ts=(new Date).getTime());(y._pendingDfd=this._task[a](n)).addCallbacks(function(f){var b=!!n.outStatistics||v||x||B;if("execute"===a||"executeRelationshipQuery"===
a){var k,w;if("execute"===a)for(k=f.features,w=k.length,--w;0<=w;w--){if(k[w]._layer=e,!b&&!e._isTable){var d=e._mode._getFeature(k[w].attributes[e.objectIdField]);d&&k.splice(w,1,d)}}else for(d in f)if(f.hasOwnProperty(d))for(k=f[d].features,w=k.length,--w;0<=w;w--)k[w]._layer=e}e._resolve([f],c,q,y)},function(a){e._resolve([a],null,k,y,!0)});return y},_convertFeaturesToJson:function(a,c,f,b){var q=[],k=this._selectionSymbol,e=this.visibilityField,w,y=this.objectIdField;this.loaded&&(f||b)&&(w=d.filter(this.fields,
function(a){return!1===a.editable&&(!b||a.name!==y)}));for(f=0;f<a.length;f++){var n=a[f],v={},x=n.geometry,h=n.attributes,A=n.symbol;!x||b&&this.loaded&&!this.allowGeometryUpdates||(v.geometry=x.toJson());e?(v.attributes=h=g.mixin({},h),h[e]=n.visible?1:0):h&&(v.attributes=g.mixin({},h));v.attributes&&w&&w.length&&d.forEach(w,function(a){delete v.attributes[a.name]});A&&A!==k&&(v.symbol=A.toJson());q.push(v)}return c?q:l.toJson(q)},_selectHandler:function(a,c,f,b,q){var k;switch(c){case F.SELECTION_NEW:this.clearSelection(!0);
k=!0;break;case F.SELECTION_ADD:k=!0;break;case F.SELECTION_SUBTRACT:k=!1}b=a.features;var e=this._mode,w=[],y=this.objectIdField,n,d;if(k)for(k=0;k<b.length;k++)n=b[k],d=n.attributes[y],n=e._addFeatureIIf(d,n),w.push(n),this._selectFeatureIIf(d,n,e);else for(k=0;k<b.length;k++)n=b[k],d=n.attributes[y],this._unSelectFeatureIIf(d,e),d=e._removeFeatureIIf(d),w.push(d||n);this._isSelOnly&&e._applyTimeFilter(!0);this._hasPartialSelectedFeatures=!!a.exceededTransferLimit;this._resolve([w,c,a.exceededTransferLimit?
{queryLimitExceeded:!0}:null],"onSelectionComplete",f,q);if(a.exceededTransferLimit)this.onQueryLimitExceeded()},_selectFeatureIIf:function(a,c,f){var b=this._selectedFeatures,k=b[a];k||(f._incRefCount(a),b[a]=c,this._isTable||(this._setSelectSymbol(c),c.attr("data-selected","")));return k||c},_unSelectFeatureIIf:function(a,c){var f=this._selectedFeatures[a];f&&(c._decRefCount(a),delete this._selectedFeatures[a],this._isTable||(this._setUnSelectSymbol(f),f.attr("data-selected")));return f},_isSelected:function(a){},
_setSelectSymbol:function(a){var c=this._selectionSymbol;c&&!this._isSelOnly&&a.setSymbol(c)},_setUnSelectSymbol:function(a){var c=this._selectionSymbol;c&&!this._isSelOnly&&c===a.symbol&&a.setSymbol(null,!0)},_getOutFields:function(){var a=[this.objectIdField,this.typeIdField,this.creatorField,this._startTimeField,this._endTimeField,this._trackIdField].concat(this._requiredFields).concat(this.dataAttributes),a=d.filter(a,function(a,c,f){return!!a&&d.indexOf(f,a)===c}),c=g.clone(this._outFields);
if(c){if(-1!==d.indexOf(c,"*"))return c;d.forEach(a,function(a){-1===d.indexOf(c,a)&&c.push(a)});return c}return a},_checkFields:function(a){var c=a||this._getOutFields();d.forEach(c,function(a){"*"!==a&&(this._getField(a)||console.debug("esri.layers.FeatureLayer: "+k.substitute({url:this.url,field:a},"unable to find '${field}' field in the layer 'fields' information [url: ${url}]")))},this);a||this._isTable||this._fserver||this._collection||this._isStream||d.some(this.fields,function(a){return a&&
"esriFieldTypeGeometry"===a.type?!0:!1})||console.debug("esri.layers.FeatureLayer: "+k.substitute({url:this.url},"unable to find a field of type 'esriFieldTypeGeometry' in the layer 'fields' information. If you are using a map service layer, features will not have geometry [url: ${url}]"))},_fixFieldCase:function(a,c,f){var b=a&&a[c],k;if(b&&!g.isFunction(b)){if(k=!this._getField(b)&&this._getField(b,!0))b=a[c]=k.name;f&&f.push(b)}return b},_fixRendererFields:function(){var a=this.renderer;this._orderBy=
null;this._requiredFields=[];if(a&&0<this.fields.length){var c=[],f,a=d.filter([a,a.observationRenderer,a.latestObservationRenderer,a.trackRenderer],k.isDefined),b=[].concat(a);d.forEach(a,function(a){d.forEach(a.rendererInfos,function(a){a.renderer&&b.push(a.renderer)})});d.forEach(b,function(a){this._fixFieldCase(a,"attributeField",c);this._fixFieldCase(a,"attributeField2",c);this._fixFieldCase(a,"attributeField3",c);this._fixFieldCase(a.rotationInfo,"field",c);(f=this._fixFieldCase(a.sizeInfo,
"field",c))&&!this._orderBy&&(this._orderBy=[f+" DESC"]);this._fixFieldCase(a.sizeInfo,"normalizationField",c);this._fixFieldCase(a.colorInfo,"field",c);this._fixFieldCase(a.colorInfo,"normalizationField",c);this._fixFieldCase(a.field,"field",c);this._fixFieldCase(a.opacityInfo,"field",c);this._fixFieldCase(a.opacityInfo,"normalizationField",c);d.forEach(a.visualVariables,function(a){f=this._fixFieldCase(a,"field",c);"sizeInfo"===a.type&&f&&!this._orderBy&&(this._orderBy=[f+" DESC"]);this._fixFieldCase(a,
"normalizationField",c)},this);var b=d.map(a.getFieldsUsedInExpressions(),function(a){var c=this.getField(a);return c?c.name:a},this);c=c.concat(b);this._orderBy||!a.addBreak||g.isFunction(a.attributeField)||!a.backgroundFillSymbol&&!this._hasSizeDiff(a)||(this._orderBy=[a.attributeField+" DESC"])},this);this._requiredFields=d.filter(c,k.isDefined)}},_hasSizeDiff:function(a){var c=Number.MAX_VALUE,f=-Number.MAX_VALUE,b,k;d.forEach(a.infos,function(a){if(k=a.symbol){b=0;switch(k.type){case "simplemarkersymbol":b=
k.size;break;case "picturemarkersymbol":b=(k.width+k.height)/2;break;case "simplelinesymbol":case "cartographiclinesymbol":b=k.width;break;case "simplefillsymbol":case "picturefillsymbol":b=k.outline&&k.outline.width}b&&(c=Math.min(c,b),f=Math.max(f,b))}});return c!==Number.MAX_VALUE&&f!==-Number.MAX_VALUE&&1<Math.abs(f-c)},getOrderByFields:function(){var a=this.orderByFields||this._orderBy;return this.supportsAdvancedQueries&&a?d.filter(a,function(a){a=a.split(" ")[0];return!!this._getField(a,!0)},
this):null},_getField:function(a,c){var f=this.fields;if(!f||0===f.length)return null;var b;c&&(a=a.toLowerCase());d.some(f,function(f){var k=!1;(k=c?f&&f.name.toLowerCase()===a?!0:!1:f&&f.name===a?!0:!1)&&(b=f);return k});return b},_getDateOpts:function(){this._dtOpts||(this._dtOpts={properties:d.map(d.filter(this.fields,function(a){return!(!a||"esriFieldTypeDate"!==a.type)}),function(a){return a.name})});return this._dtOpts},_applyNormalized:function(a,c){a&&c&&d.forEach(a,function(a,f){a&&c[f]&&
a.setGeometry(c[f])})},_editHandler:function(a,c,f,b,k,q){k=a.addResults;var e=a.updateResults;a=a.deleteResults;var w,y,n,v,x,h=this.objectIdField,A=this._mode,B=this._isTable;w=this.editFieldsInfo;v=this.getOutFields()||[];var C=w&&w.creatorField,l=w&&w.creationDateField,z=w&&w.editorField,u=w&&w.editDateField;w=w&&w.realm;-1===d.indexOf(v,"*")&&(C&&-1===d.indexOf(v,C)&&(C=null),l&&-1===d.indexOf(v,l)&&(l=null),z&&-1===d.indexOf(v,z)&&(z=null),u&&-1===d.indexOf(v,u)&&(u=null));var G=l||u?(new Date).getTime():
null,E=C||z?this.getUserId():void 0;E&&w&&(E=E+"@"+w);if(k){var m=this.globalIdField;for(w=0;w<k.length;w++)k[w]=new N(k[w]),B||(y=k[w],y.success&&(n=y.objectId,v=c[w],(x=v._graphicsLayer)&&x!==this&&x.remove(v),x=v.attributes||{},x[h]=n,n=y.globalId,m&&n&&(x[m]=n),C&&(x[C]=E),z&&(x[z]=E),l&&(x[l]=G),u&&(x[u]=G),v.setAttributes(x),A._init&&A.drawFeature(v)))}if(e)for(w=0;w<e.length;w++)if(e[w]=new N(e[w]),!B&&(y=e[w],y.success)){n=y.objectId;v=f[n];if(c=A._getFeature(n))c.geometry!==v.geometry&&v.geometry&&
c.setGeometry(aa.fromJson(v.geometry.toJson())),c.attributes!==v.attributes&&v.attributes&&c.setAttributes(g.mixin(c.attributes,v.attributes)),this._repaint(c,n);v=c||v;x=v.attributes||{};z&&(x[z]=E);u&&(x[u]=G);v.setAttributes(x)}if(a){f=[];for(w=0;w<a.length;w++)if(a[w]=new N(a[w]),!B&&(y=a[w],y.success&&(n=y.objectId,v=A._getFeature(n))))this._unSelectFeatureIIf(n,A)&&f.push(v),v._count=0,A._removeFeatureIIf(n);if(0<f.length)this.onSelectionComplete(f,F.SELECTION_SUBTRACT)}this._resolve([k,e,a],
"onEditsComplete",b,q)},_sendAttachment:function(a,c,f,b,k){var e=this;return q({url:this._url.path+"/"+c+"/"+("add"===a?"addAttachment":"updateAttachment"),form:f,content:g.mixin(this._url.query,{f:"json",token:this._getToken()||void 0}),callbackParamName:"callback.html",handleAs:"json"}).addCallback(function(f){var k="add"===a?"onAddAttachmentComplete":"onUpdateAttachmentComplete";f=new N(f["add"===a?"addAttachmentResult":"updateAttachmentResult"]);f.attachmentId=f.objectId;f.objectId=c;e._resolve([f],
k,b);return f}).addErrback(function(a){e._resolve([a],null,k,null,!0)})},_repaint:function(a,c,f){c=k.isDefined(c)?c:a.attributes[this.objectIdField];c in this._selectedFeatures&&this._selectionSymbol||a.setSymbol(a.symbol,f)},_getKind:function(a){var c=this._trackManager;return c?c.isLatestObservation(a)?1:0:0}});g.mixin(F,{MODE_SNAPSHOT:0,MODE_ONDEMAND:1,MODE_SELECTION:2,SELECTION_NEW:3,SELECTION_ADD:4,SELECTION_SUBTRACT:5,MODE_AUTO:6,MODE_STREAM:7,POPUP_NONE:"esriServerHTMLPopupTypeNone",POPUP_HTML_TEXT:"esriServerHTMLPopupTypeAsHTMLText",
POPUP_URL:"esriServerHTMLPopupTypeAsURL"});ba._createWrappers(F);e("extend-esri")&&g.setObject("layers.FeatureLayer",F,c);return F})},"esri/promiseList":function(){define(["dojo/_base/array","dojo/Deferred","dojo/when"],function(t,r,p){var m=t.forEach;return function(g){function d(f,a){u[a]=f;n.progress([f,a]);0===--v&&n.resolve(u)}var l,h;g instanceof Array?h=g:g&&"object"===typeof g&&(l=g);var u,e=[];if(l){h=[];for(var b in l)Object.hasOwnProperty.call(l,b)&&(e.push(b),h.push(l[b]));u={}}else h&&
(u=[]);if(!h||!h.length)return(new r).resolve(u);var n=new r;n.promise.always(function(){u=e=null});var v=h.length;m(h,function(f,a){l||e.push(a);p(f,function(c){n.isFulfilled()||d(c,e[a])},function(c){n.isFulfilled()||d(c,e[a])})});return n.promise}})},"esri/tasks/QueryTask":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/Deferred dojo/_base/json dojo/has ../kernel ../request ../deferredUtils ../geometry/Extent ../geometry/normalizeUtils ./Task ./FeatureSet".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v){t=t(n,{declaredClass:"esri.tasks.QueryTask",_eventMap:{complete:["featureSet"],"execute-for-count-complete":["count"],"execute-for-ids-complete":["objectIds"],"execute-relationship-query-complete":["featureSets"]},constructor:function(f,a){this._handler=r.hitch(this,this._handler);this._relationshipQueryHandler=r.hitch(this,this._relationshipQueryHandler);this._executeForIdsHandler=r.hitch(this,this._executeForIdsHandler);this._countHandler=r.hitch(this,this._countHandler);
this._extentHandler=r.hitch(this,this._extentHandler);this.source=a&&a.source;this.gdbVersion=a&&a.gdbVersion;this.registerConnectEvents()},__msigns:[{n:"execute",c:4,a:[{i:0,p:["geometry"]}],e:2},{n:"executeForIds",c:3,a:[{i:0,p:["geometry"]}],e:2},{n:"executeForCount",c:3,a:[{i:0,p:["geometry"]}],e:2},{n:"executeForExtent",c:3,a:[{i:0,p:["geometry"]}],e:2}],onComplete:function(){},onExecuteRelationshipQueryComplete:function(){},onExecuteForIdsComplete:function(){},onExecuteForCountComplete:function(){},
onExecuteForExtentComplete:function(){},execute:function(f,a,c,b,q){b=q.assembly;f=this._encode(r.mixin({},this._url.query,{f:"json"},f.toJson(b&&b[0])));var k=this._handler,e=this._errorHandler;this.source&&(b={source:this.source.toJson()},f.layer=g.toJson(b));this.gdbVersion&&(f.gdbVersion=this.gdbVersion);return h({url:this._url.path+"/query",content:f,callbackParamName:"callback",load:function(f,b){k(f,b,a,c,q.dfd)},error:function(a){e(a,c,q.dfd)}},this.requestOptions)},executeRelationshipQuery:function(f,
a,c){f=this._encode(r.mixin({},this._url.query,{f:"json"},f.toJson()));var b=this._relationshipQueryHandler,e=this._errorHandler;this.gdbVersion&&(f.gdbVersion=this.gdbVersion);var n=new m(u._dfdCanceller);n._pendingDfd=h({url:this._url.path+"/queryRelatedRecords",content:f,callbackParamName:"callback",load:function(f,k){b(f,k,a,c,n)},error:function(a){e(a,c,n)}},this.requestOptions);return n},executeForIds:function(f,a,c,b){var k=b.assembly;f=this._encode(r.mixin({},this._url.query,{f:"json",returnIdsOnly:!0},
f.toJson(k&&k[0])));var e=this._executeForIdsHandler,n=this._errorHandler;this.source&&(k={source:this.source.toJson()},f.layer=g.toJson(k));this.gdbVersion&&(f.gdbVersion=this.gdbVersion);return h({url:this._url.path+"/query",content:f,callbackParamName:"callback",load:function(f,k){e(f,k,a,c,b.dfd)},error:function(a){n(a,c,b.dfd)}},this.requestOptions)},executeForCount:function(f,a,c,b){var k=b.assembly;f=this._encode(r.mixin({},this._url.query,{f:"json",returnIdsOnly:!0,returnCountOnly:!0},f.toJson(k&&
k[0])));var e=this._countHandler,n=this._errorHandler;this.source&&(k={source:this.source.toJson()},f.layer=g.toJson(k));this.gdbVersion&&(f.gdbVersion=this.gdbVersion);return h({url:this._url.path+"/query",content:f,callbackParamName:"callback",load:function(f,k){e(f,k,a,c,b.dfd)},error:function(a){n(a,c,b.dfd)}},this.requestOptions)},executeForExtent:function(f,a,c,b){var k=b.assembly;f=this._encode(r.mixin({},this._url.query,{f:"json",returnExtentOnly:!0,returnCountOnly:!0},f.toJson(k&&k[0])));
var e=this._extentHandler,n=this._errorHandler;this.source&&(k={source:this.source.toJson()},f.layer=g.toJson(k));this.gdbVersion&&(f.gdbVersion=this.gdbVersion);return h({url:this._url.path+"/query",content:f,callbackParamName:"callback",load:function(f,k){e(f,k,a,c,b.dfd)},error:function(a){n(a,c,b.dfd)}},this.requestOptions)},_handler:function(f,a,c,b,e){try{var k=new v(f);this._successHandler([k],"onComplete",c,e)}catch(z){this._errorHandler(z,b,e)}},_relationshipQueryHandler:function(f,a,c,b,
e){try{var k=f.geometryType,q=f.spatialReference,n={};p.forEach(f.relatedRecordGroups,function(a){var c={};c.geometryType=k;c.spatialReference=q;c.features=a.relatedRecords;c=new v(c);if(null!=a.objectId)n[a.objectId]=c;else for(var f in a)a.hasOwnProperty(f)&&"relatedRecords"!==f&&(n[a[f]]=c)});this._successHandler([n],"onExecuteRelationshipQueryComplete",c,e)}catch(A){this._errorHandler(A,b,e)}},_executeForIdsHandler:function(f,a,c,b,e){try{this._successHandler([f.objectIds],"onExecuteForIdsComplete",
c,e)}catch(B){this._errorHandler(B,b,e)}},_countHandler:function(f,a,c,b,e){try{var k,q=f.features,n=f.objectIds;if(n)k=n.length;else{if(q)throw Error("Unable to perform query. Please check your parameters.");k=f.count}this._successHandler([k],"onExecuteForCountComplete",c,e)}catch(A){this._errorHandler(A,b,e)}},_extentHandler:function(f,a,c,b,q){try{f.extent&&(f.extent=new e(f.extent)),this._successHandler([f],"onExecuteForExtentComplete",c,q)}catch(B){this._errorHandler(B,b,q)}}});b._createWrappers(t);
d("extend-esri")&&r.setObject("tasks.QueryTask",t,l);return t})},"esri/tasks/Task":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../deferredUtils ../urlUtils ../Evented".split(" "),function(t,r,p,m,g,d,l,h){t=t(h,{declaredClass:"esri.tasks._Task",_eventMap:{error:["error"],complete:["result"]},constructor:function(d,e){d&&r.isString(d)&&(this._url=l.urlToObject(this.url=d));e&&e.requestOptions&&(this.requestOptions=e.requestOptions);this.normalization=!0;
this._errorHandler=r.hitch(this,this._errorHandler);this.registerConnectEvents()},_useSSL:function(){var d=this._url,e=/^http:/i;this.url&&(this.url=this.url.replace(e,"https:"));d&&d.path&&(d.path=d.path.replace(e,"https:"))},_encode:function(d,e,b){var n,v,f={},a,c;for(a in d)if("declaredClass"!==a&&(n=d[a],v=typeof n,null!==n&&void 0!==n&&"function"!==v))if(r.isArray(n))for(f[a]=[],c=n.length,v=0;v<c;v++)f[a][v]=this._encode(n[v]);else"object"===v?n.toJson&&(v=n.toJson(b&&b[a]),"esri.tasks.FeatureSet"===
n.declaredClass&&v.spatialReference&&(v.sr=v.spatialReference,delete v.spatialReference),f[a]=e?v:p.toJson(v)):f[a]=n;return f},_successHandler:function(h,e,b,n){e&&this[e].apply(this,h);b&&b.apply(null,h);n&&d._resDfd(n,h)},_errorHandler:function(d,e,b){this.onError(d);e&&e(d);b&&b.errback(d)},setNormalization:function(d){this.normalization=d},onError:function(){}});m("extend-esri")&&(g.Task=t);return t})},"esri/tasks/FeatureSet":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../kernel ../lang ../graphic ../SpatialReference ../graphicsUtils ../geometry/jsonUtils ../symbols/jsonUtils".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b){t=t(null,{declaredClass:"esri.tasks.FeatureSet",constructor:function(n){if(n){r.mixin(this,n);var d=this.features,f=n.spatialReference,a=e.getGeometryType(n.geometryType),f=this.spatialReference=new h(f);this.geometryType=n.geometryType;n.fields&&(this.fields=n.fields);p.forEach(d,function(c,k){var e=c.geometry&&c.geometry.spatialReference;d[k]=new l(a&&c.geometry?new a(c.geometry):null,c.symbol&&b.fromJson(c.symbol),c.attributes);d[k].geometry&&!e&&d[k].geometry.setSpatialReference(f)});
this._hydrate()}else this.features=[]},displayFieldName:null,geometryType:null,spatialReference:null,fieldAliases:null,toJson:function(b){var n={};this.displayFieldName&&(n.displayFieldName=this.displayFieldName);this.fields&&(n.fields=this.fields);this.spatialReference?n.spatialReference=this.spatialReference.toJson():this.features[0]&&this.features[0].geometry&&(n.spatialReference=this.features[0].geometry.spatialReference.toJson());this.features[0]&&(this.features[0].geometry&&(n.geometryType=
e.getJsonType(this.features[0].geometry)),n.features=u._encodeGraphics(this.features,b));n.geometryType=n.geometryType||this.geometryType;n.exceededTransferLimit=this.exceededTransferLimit;n.transform=this.transform;return d.fixJson(n)},_hydrate:function(){var b=this.transform,e=this.geometryType;if(b&&e)for(var f=this.features,a=b.translate[0],c=b.translate[1],k=b.scale[0],q=b.scale[1],d=function(a,c,f){if("esriGeometryPoint"===a)return function(a){a.x=c(a.x);a.y=f(a.y)};if("esriGeometryPolyline"===
a||"esriGeometryPolygon"===a)return function(a){a=a.rings||a.paths;var b,k,e,q,n,d,v,x;b=0;for(k=a.length;b<k;b++)for(n=a[b],e=0,q=n.length;e<q;e++)d=n[e],0<e?(v+=d[0],x+=d[1]):(v=d[0],x=d[1]),d[0]=c(v),d[1]=f(x)};if("esriGeometryEnvelope"===a)return function(a){a.xmin=c(a.xmin);a.ymin=f(a.ymin);a.xmax=c(a.xmax);a.ymax=f(a.ymax)};if("esriGeometryMultipoint"===a)return function(a){a=a.points;var b,k,e,q,n;b=0;for(k=a.length;b<k;b++)e=a[b],0<b?(q+=e[0],n+=e[1]):(q=e[0],n=e[1]),e[0]=c(q),e[1]=f(n)}}(e,
function(c){return c*k+a},function(a){return c-a*q}),b=0,e=f.length;b<e;b++)f[b].geometry&&d(f[b].geometry);this.transform=null},quantize:function(b){if(!this.geometryType)return this.transform=null,this;var e=b.translate[0],f=b.translate[1],a=b.scale[0],c=b.scale[1],k=this.features,q=function(a,c,f){var b,e,k,q,n,d,y=[];b=0;for(e=a.length;b<e;b++)if(k=a[b],0<b){if(d=c(k[0]),k=f(k[1]),d!==q||k!==n)y.push([d-q,k-n]),q=d,n=k}else q=c(k[0]),n=f(k[1]),y.push([q,n]);return 0<y.length?y:null},n=function(a,
c,f){if("esriGeometryPoint"===a)return function(a){a.x=c(a.x);a.y=f(a.y);return a};if("esriGeometryPolyline"===a||"esriGeometryPolygon"===a)return function(a){var b,k,e,n,d;e=a.rings||a.paths;d=[];b=0;for(k=e.length;b<k;b++)n=e[b],(n=q(n,c,f))&&d.push(n);return 0<d.length?(a.rings?a.rings=d:a.paths=d,a):null};if("esriGeometryMultipoint"===a)return function(a){var b;b=q(a.points,c,f);return 0<b.length?(a.points=b,a):null};if("esriGeometryEnvelope"===a)return function(a){return a}}(this.geometryType,
function(c){return Math.round((c-e)/a)},function(a){return Math.round((f-a)/c)}),d,h;d=0;for(h=k.length;d<h;d++)k[d].geometry&&(n(k[d].geometry)||k[d].setGeometry(null));this.transform=b;return this}});m("extend-esri")&&r.setObject("tasks.FeatureSet",t,g);return t})},"esri/tasks/StatisticDefinition":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(t,r,p,m){t=t(null,{declaredClass:"esri.tasks.StatisticDefinition",toJson:function(){return{statisticType:this.statisticType,
onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount}}});p("extend-esri")&&r.setObject("tasks.StatisticDefinition",t,m);return t})},"esri/layers/FeatureType":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../kernel ../lang ../symbols/jsonUtils ./RangeDomain ./CodedValueDomain ./InheritedDomain ./FeatureTemplate".split(" "),function(t,
r,p,m,g,d,l,h,u,e,b){t=t(null,{declaredClass:"esri.layers.FeatureType",constructor:function(n){if(n&&r.isObject(n)){this.id=n.id;this.name=n.name;var d=n.symbol;d&&(this.symbol=l.fromJson(d));var d=n.domains,f,a=this.domains={};for(f in d)if(d.hasOwnProperty(f)){var c=d[f];switch(c.type){case "range":a[f]=new h(c);break;case "codedValue":a[f]=new u(c);break;case "inherited":a[f]=new e(c)}}if(f=n.templates)for(d=this.templates=[],n=0;n<f.length;n++)d.push(new b(f[n]))}},toJson:function(){var b={id:this.id,
name:this.name,symbol:this.symbol&&this.symbol.toJson()},e,f=this.domains,a=this.templates,c=d.fixJson;if(f){var k=b.domains={};for(e in f)f.hasOwnProperty(e)&&(k[e]=f[e]&&f[e].toJson());c(k)}a&&(b.templates=p.map(a,function(a){return a.toJson()}));return c(b)}});m("extend-esri")&&r.setObject("layers.FeatureType",t,g);return t})},"esri/layers/FeatureTemplate":function(){define("dojo/_base/declare dojo/_base/lang dojo/has ../kernel ../lang ../graphic".split(" "),function(t,r,p,m,g,d){t=t(null,{declaredClass:"esri.layers.FeatureTemplate",
constructor:function(g){g&&r.isObject(g)&&(this.name=g.name,this.description=g.description,this.drawingTool=g.drawingTool,this.thumbnail=g.thumbnail,g=g.prototype,this.prototype=new d(g.geometry,null,g.attributes))},toJson:function(){return g.fixJson({name:this.name,description:this.description,drawingTool:this.drawingTool,thumbnail:g.fixJson(r.clone(this.thumbnail)),prototype:this.prototype&&this.prototype.toJson()})}});r.mixin(t,{TOOL_AUTO_COMPLETE_POLYGON:"esriFeatureEditToolAutoCompletePolygon",
TOOL_CIRCLE:"esriFeatureEditToolCircle",TOOL_ELLIPSE:"esriFeatureEditToolEllipse",TOOL_FREEHAND:"esriFeatureEditToolFreehand",TOOL_LINE:"esriFeatureEditToolLine",TOOL_NONE:"esriFeatureEditToolNone",TOOL_POINT:"esriFeatureEditToolPoint",TOOL_POLYGON:"esriFeatureEditToolPolygon",TOOL_RECTANGLE:"esriFeatureEditToolRectangle",TOOL_ARROW:"esriFeatureEditToolArrow",TOOL_TRIANGLE:"esriFeatureEditToolTriangle",TOOL_LEFT_ARROW:"esriFeatureEditToolLeftArrow",TOOL_RIGHT_ARROW:"esriFeatureEditToolRightArrow",
TOOL_UP_ARROW:"esriFeatureEditToolUpArrow",TOOL_DOWN_ARROW:"esriFeatureEditToolDownArrow"});p("extend-esri")&&r.setObject("layers.FeatureTemplate",t,m);return t})},"esri/layers/FeatureEditResult":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(t,r,p,m){t=t(null,{declaredClass:"esri.layers.FeatureEditResult",constructor:function(g){g&&r.isObject(g)&&(this.objectId=g.objectId,this.globalId=g.globalId,this.success=g.success,g.success||(g=g.error,this.error=
Error(),this.error.code=g.code,this.error.message=g.description))}});p("extend-esri")&&r.setObject("layers.FeatureEditResult",t,m);return t})},"esri/layers/SnapshotMode":function(){define("dojo/_base/declare dojo/_base/lang dojo/has ../kernel ../SpatialReference ../srUtils ../tasks/query ./RenderMode ./support/ParallelSnapshot".split(" "),function(t,r,p,m,g,d,l,h,u){t=t([h],{declaredClass:"esri.layers._SnapshotMode",maxFeatures:5E4,constructor:function(e){this.featureLayer=e;this._featureMap={};this._hasPartialFeatures=
!1;this._drawFeatures=r.hitch(this,this._drawFeatures);this._queryErrorHandler=r.hitch(this,this._queryErrorHandler);this._handleSuccess=r.hitch(this,this._handleSuccess);this._handleError=r.hitch(this,this._handleError);this._handleProgress=r.hitch(this,this._handleProgress)},startup:function(){if(!this._started){this.inherited(arguments);var e=this.featureLayer,b=e.advancedQueryCapabilities,n=e.reHostedFS.test(e.url);this.pagination=e.queryPagination&&null!=e.maxRecordCount;this._tileQueriesAllowed=
n&&b&&b.supportsQueryWithResultType&&e.isFeatureReductionApplied();n&&this.pagination&&(this._parallelSnapshot=new u({layer:e,mode:this,queryTask:e._task}));e._collection?this._applyTimeFilter():this._fetchAll()}},propertyChangeHandler:function(e){this._init&&(e?this.featureLayer._collection?console.log("FeatureLayer: layer created by value (from a feature collection) does not support definition expressions and time definitions. Layer id \x3d "+this.featureLayer.id):this._fetchAll():this._applyTimeFilter())},
destroy:function(){this._cancelPendingRequest(this._pendingRequest);this._parallelSnapshot&&this._parallelSnapshot.destroy();this.inherited(arguments)},drawFeature:function(e){var b=e.attributes[this.featureLayer.objectIdField];this._addFeatureIIf(b,e);this._incRefCount(b)},resume:function(){this.propertyChangeHandler(0)},refresh:function(){var e=this.featureLayer;e._collection?(e._fireUpdateStart(),e._refresh(!0),e._fireUpdateEnd()):this._fetchAll()},hasAllFeatures:function(){return!this._hasPartialFeatures},
_fetchAll:function(){var e=this.featureLayer;e._collection||e.suspended||!e.isQueryable()||(e._fireUpdateStart(),this._clearIIf(),this._hasPartialFeatures=!1,this._parallelSnapshot?this._parallelSnapshot.fetch(this._createQuery()).then(this._handleSuccess,this._handleError,this._handleProgress):this._sendRequest())},_handleSuccess:function(e){this._hasPartialFeatures=e.hasPartialFeatures;this.featureLayer._fireUpdateEnd(null)},_handleError:function(e){this._queryErrorHandler(e)},_handleProgress:function(e){e.isError?
this.featureLayer._errorHandler(e.error):this._addFeatures(e.features)},_sendRequest:function(e){var b=this.featureLayer,n=this._createQuery();this.pagination&&(this._start=n.start=null==e?0:e,n.num=b.maxRecordCount);this._pendingRequest&&this._cancelPendingRequest(this._pendingRequest);this._pendingRequest=b._task.execute(n,this._drawFeatures,this._queryErrorHandler)},_drawFeatures:function(e){this._pendingRequest=null;var b=this.featureLayer,n=e.exceededTransferLimit,d=n&&!b._collection;e=this._checkMaxLimit(e.features);
var f=e.maxLimitReached;this._addFeatures(e.features);this.pagination&&d&&!f||(this._hasPartialFeatures=!!n,b._fireUpdateEnd(null,n?{queryLimitExceeded:!0}:null));d&&(this.pagination&&!f&&this._sendRequest(this._start+b.maxRecordCount),b.onQueryLimitExceeded())},_queryErrorHandler:function(e){this._pendingRequest=null;this._hasPartialFeatures=!0;var b=this.featureLayer;b._errorHandler(e);b._fireUpdateEnd(e)},_checkMaxLimit:function(e){var b=e?e.length:0,n=this.featureLayer.graphics.length+b,d=n>=
this.maxFeatures;if(d){var f=n-this.maxFeatures;f&&e.splice(b-f,f)}return{maxLimitReached:d,featuresDiscarded:n>this.maxFeatures,features:e}},_createQuery:function(){var e=this.featureLayer,b=new l;b.outFields=e.getOutFields();b.where=e.getDefinitionExpression()||"1\x3d1";b.returnGeometry=!0;b.outSpatialReference=d.createSpatialReference(this.map.spatialReference.toJson());b.timeExtent=e.getTimeDefinition();b.maxAllowableOffset=e._maxOffset;b.quantizationParameters=e._quantizationParameters;b.orderByFields=
e.supportsAdvancedQueries?e.getOrderByFields():null;b.multipatchOption=e.multipatchOption;e._ts&&(b._ts=(new Date).getTime());this._tileQueriesAllowed&&(b.resultType="tile");return b},_addFeatures:function(e){var b=this.featureLayer,d=b.objectIdField,v=e.length,f=b._selectedFeatures,a=b.mode===b.constructor.MODE_AUTO,c,k,q;b._fireUpdateStart();b._sortFeatures(e);for(b=0;b<v;b++)k=e[b],q=k.attributes[d],c=this._addFeatureIIf(q,k),this._incRefCount(q),a&&c!==k&&f[q]&&(c.setGeometry(k.geometry),c.setAttributes(k.attributes));
this._applyTimeFilter(!0)}});p("extend-esri")&&r.setObject("layers._SnapshotMode",t,m);return t})},"esri/layers/RenderMode":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/has","../kernel"],function(t,r,p,m,g){t=t(null,{declaredClass:"esri.layers._RenderMode",initialize:function(d){this.map=d;this._init=!0},startup:function(){this._started=!0},propertyChangeHandler:function(d){},destroy:function(){this._init=this._started=!1},drawFeature:function(d){},suspend:function(){},
resume:function(){},refresh:function(){},hasAllFeatures:function(){return!0},_incRefCount:function(d){(d=this._featureMap[d])&&d._count++},_decRefCount:function(d){(d=this._featureMap[d])&&d._count--},_getFeature:function(d){return this._featureMap[d]},_addFeatureIIf:function(d,g){var h=this._featureMap,l=h[d],e=this.featureLayer;l||(h[d]=g,e._add(g),g._count=0);return l||g},_removeFeatureIIf:function(d){var g=this._featureMap[d],h=this.featureLayer;if(g){if(g._count)return;delete this._featureMap[d];
h._remove(g)}return g},_clearIIf:function(){var d;d=this.featureLayer;var g=d.graphics,h=d._selectedFeatures,u=d.getSelectedFeatures().length,e=d.objectIdField;if(u)for(d=g.length-1;0<=d;d--){var u=g[d],b=u.attributes[e];b in h?u._count=1:(u._count=0,this._removeFeatureIIf(b))}else d.clear(),this._featureMap={}},_cancelPendingRequest:function(d){if(d)try{d.cancel()}catch(l){}},_toggleVisibility:function(d){var g=this.featureLayer,h=g.graphics,u=d?"show":"hide",e,b=h.length;d=d&&g._ager;for(e=0;e<
b;e++){var n=h[e];n[u]();d&&g._repaint(n)}},_applyTimeFilter:function(d){var g=this.featureLayer;if(g.timeInfo&&!g.suspended){d||g._fireUpdateStart();var h=g._trackManager;h&&h.clearTracks();var u=g.getTimeDefinition(),e=g._getOffsettedTE(g._mapTimeExtent);e?(e=g._getTimeOverlap(u,e))?(u=g._filterByTime(g.graphics,e.startTime,e.endTime),h&&h.addFeatures(u.match),p.forEach(u.match,function(b){var e=b._shape;b.visible||(b.show(),(e=b._shape)&&e._moveToFront());g._ager&&e&&g._repaint(b)}),p.forEach(u.noMatch,
function(b){b.visible&&b.hide()})):this._toggleVisibility(!1):(h&&h.addFeatures(g.graphics),this._toggleVisibility(!0));h&&(h.moveLatestToFront(),h.drawTracks());d||g._fireUpdateEnd()}}});m("extend-esri")&&r.setObject("layers._RenderMode",t,g);return t})},"esri/layers/support/ParallelSnapshot":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has dojo/Deferred ../../kernel".split(" "),function(t,r,p,m,g,d){t=t(null,{declaredClass:"esri.layers.support.ParallelSnapshot",layer:null,
mode:null,queryTask:null,batchSize:5,_query:null,_fetchDfd:null,_startPage:null,_lastPage:null,_maxPage:null,_requests:null,constructor:function(d){r.mixin(this,d);this._requests={};this._maxPage=Math.ceil(this.mode.maxFeatures/this.layer.maxRecordCount)},destroy:function(){this.cancel()},fetch:function(d){var h=new g;this.cancel(!0);this._query=d;this._fetchDfd=h;this._sendRequests();return h.promise},cancel:function(d){this._cancelPendingRequests(d);this._reset()},_reset:function(){this._startPage=
this._lastPage=null;this._requests={}},_sendRequests:function(d){var h=this._query,g=this.queryTask,e=this._requests,b=this.layer.maxRecordCount,n;d=null==d?1:d;n=d+this.batchSize-1;n>this._maxPage&&(n=this._maxPage);if(!(d>n))for(this._startPage=d,this._lastPage=n;d<=n;d++)h.start=(d-1)*b,h.num=b,e[d]=g.execute(h),e[d].then(r.hitch(this,this._handleSuccess,d)).otherwise(r.hitch(this,this._handleError,d))},_evalNextBatch:function(d){d===this._lastPage&&this._sendRequests(this._lastPage+1)},_handleSuccess:function(d,
h){h.exceededTransferLimit||this._cancelLaterRequests(d,!0);var g=this.mode._checkMaxLimit(h.features);this._fetchDfd.progress({features:g.features,isError:!1});g.maxLimitReached?((g=g.featuresDiscarded||this._hasRejectedRequests())||(g=!!this._getResult(this._getLastSuccessfulRequest()).exceededTransferLimit),this._resolveFetch(g)):(h.exceededTransferLimit&&this._evalNextBatch(d),this._evalResolution())},_handleError:function(d,h){var g=this._requests;g&&g[d]&&(1===d?this._rejectFetch(h):(this._evalNextBatch(d),
this._fetchDfd.progress({error:h,isError:!0}),this._evalResolution()))},_evalResolution:function(){this._hasPendingRequests()||this._resolveFetch(this._hasRejectedRequests())},_resolveFetch:function(d){this.cancel(!0);this._fetchDfd.resolve({hasPartialFeatures:d})},_rejectFetch:function(d){this.cancel(!0);this._fetchDfd.reject(d)},_getResult:function(d){return d&&d.dfd.results[0]},_hasPendingRequests:function(){return!!this._getPendingRequests().length},_getPendingRequests:function(){var d=this._requests,
h,g=[];for(h in d){var e=d[h];e.isFulfilled()||g.push({pageId:Number(h),dfd:e})}return g},_getLastSuccessfulRequest:function(){var d=this._getResolvedRequests(),h=-Infinity,g,d=p.filter(d,function(e){return!!this._getResult(e).features.length||1===e.pageId},this);p.forEach(d,function(e){e.pageId>h&&(h=e.pageId,g=e)});return g},_getResolvedRequests:function(){var d=this._requests,h,g=[];for(h in d){var e=d[h];e.isResolved()&&g.push({pageId:Number(h),dfd:e})}return g},_hasRejectedRequests:function(){var d=
this._getRejectedRequests(),h=this._getLastSuccessfulRequest(),g=this._getResult(h);g&&!g.exceededTransferLimit&&(d=p.filter(d,function(e){return e.pageId<=h.pageId}));return!!d.length},_getRejectedRequests:function(){var d=this._requests,h,g=[];for(h in d){var e=d[h];e.isRejected()&&g.push({pageId:Number(h),dfd:e})}return g},_cancelPendingRequests:function(d){this._cancelRequests(this._getPendingRequests(),d)},_cancelLaterRequests:function(d,h){var g=p.filter(this._getPendingRequests(),function(e){return e.pageId>
d});this._cancelRequests(g,h)},_cancelRequests:function(d,h){var g=this.mode,e=this._requests;p.forEach(d,function(b){h&&delete e[b.pageId];g._cancelPendingRequest(b.dfd)})}});m("extend-esri")&&r.setObject("layers.support.ParallelSnapshot",t,d);return t})},"esri/layers/OnDemandMode":function(){define("dojo/_base/declare dojo/_base/connect dojo/_base/lang dojo/_base/array dojo/has ../kernel ../geometry/Point ../tasks/query ./RenderMode ./GridLayout".split(" "),function(t,r,p,m,g,d,l,h,u,e){t=t([u],
{declaredClass:"esri.layers._OnDemandMode",constructor:function(b){this.featureLayer=b;this._featureMap={};this._hasPartialFeatures=!1;this._queryErrorHandler=p.hitch(this,this._queryErrorHandler)},initialize:function(b){this.inherited(arguments);var d=this.featureLayer,v=d._srInfo;this._gridLayer=new e(new l(v?v.valid[0]:b.extent.xmin,v?v.valid[1]:b.extent.ymax,b.spatialReference),{width:d._tileWidth,height:d._tileHeight},{width:b.width,height:b.height},v);this._cellMap={};this._gridLayer.setResolution(b.extent)},
startup:function(){this._started||(this.inherited(arguments),this._ioQueue=[],this.featureLayer.suspended||(this._zoomHandler(),this._enableConnectors()))},propertyChangeHandler:function(b){this._init&&(2>b?this._zoomHandler():console.log("FeatureLayer: layer in on-demand mode does not support time definitions. Layer id \x3d "+this.featureLayer.id+", Layer URL \x3d "+this.featureLayer.url))},destroy:function(){this._disableConnectors();this._processIOQueue(!0);this.inherited(arguments)},drawFeature:function(b){var e=
b.geometry,d=[];if(e){var d=this._gridLayer.getCellsInExtent("point"===e.type?{xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y}:e.getExtent(),!1).cells,e=this._cellMap,f,a,c=b.attributes[this.featureLayer.objectIdField],k,q,h;for(f=0;f<d.length;f++)a=d[f],k=a.latticeID,q=a.row,h=a.col,k?a=e[k]=e[k]||a:(e[q]=e[q]||{},a=e[q][h]=e[q][h]||a),a.features=a.features||[],a.features.push(b),this._addFeatureIIf(c,b),this._incRefCount(c)}},suspend:function(){this._init&&this._disableConnectors()},resume:function(){this._init&&
(this._enableConnectors(),this._zoomHandler())},refresh:function(){this._zoomHandler()},hasAllFeatures:function(){if(this._hasPartialFeatures)return!1;var b=!1,e=this._getCurrentCells(),d;for(d=0;d<e.length;d++)if(e[d].hasPartialFeatures){b=!0;break}return!b},_enableConnectors:function(){var b=this.map;this._zoomConnect=r.connect(b,"onZoomEnd",this,this._zoomHandler);this._panConnect=r.connect(b,"onPanEnd",this,this._panHandler);this._resizeConnect=r.connect(b,"onResize",this,this._panHandler)},_disableConnectors:function(){r.disconnect(this._zoomConnect);
r.disconnect(this._panConnect);r.disconnect(this._resizeConnect)},_zoomHandler:function(){this._processIOQueue(!0);var b=this.featureLayer,e=this.map;!b.suspended&&b.isQueryable()&&(b._fireUpdateStart(),this._clearIIf(),this._hasPartialFeatures=!1,(b=b._trackManager)&&b.clearTracks(),this._cellMap={},this._gridLayer.setResolution(e.extent),this._sendRequest())},_panHandler:function(b){if(this.featureLayer.isQueryable()){this.featureLayer._fireUpdateStart();var e=this.featureLayer._resized;b=e?b:null;
e&&this._gridLayer.setMapState(b,this.map.width,this.map.height);this._sendRequest(b)}},_sendRequest:function(b){this._exceeds=!1;var e=this.featureLayer,d=this.map;b=b||d.extent;d=this._gridLayer.getCellsInExtent(b,e.latticeTiling).cells;if(!e.isEditable())var f=this._cellMap,d=m.filter(d,function(a){if(a.lattice){if(f[a.latticeID])return!1}else if(f[a.row]&&f[a.row][a.col])return!1;return!0});var a=e.getOutFields(),c=e.getDefinitionExpression(),k=e._getOffsettedTE(e._mapTimeExtent),q=e.supportsAdvancedQueries?
e.getOrderByFields():null,g=this._ioQueue,z,l=this,A=this._drawFeatures,x,y;this._pending=this._pending||0;for(z=0;z<d.length;z++){x=d[z];y=new h;y.geometry=x.extent||x.lattice;y.outFields=a;y.where=c;e.latticeTiling&&x.extent&&(y.spatialRelationship=h.SPATIAL_REL_CONTAINS);y.returnGeometry=!0;y.timeExtent=k;e._ts&&(y._ts=(new Date).getTime());y.orderByFields=q;y.multipatchOption=e.multipatchOption;y.maxAllowableOffset=e._maxOffset;y.quantizationParameters=e._quantizationParameters;var u=e.advancedQueryCapabilities;
u&&u.supportsQueryWithResultType&&(y.resultType="tile");this._pending++;g.push(e._task.execute(y,function(){var a=x;return function(c){A.apply(l,[c,a])}}.call(this),this._queryErrorHandler))}this._removeOldCells(b);this._endCheck()},_drawFeatures:function(b,e){e.hasPartialFeatures=!!b.exceededTransferLimit;this._exceeds=this._exceeds||b.exceededTransferLimit;this._finalizeIO();var d=this.featureLayer,f=this.map.extent,a=e.extent,c=e.row,k=e.col,q=d.objectIdField,n=b.features,h=this._gridLayer,g=this._cellMap,
A=e.latticeID,x=A?g[A]:g[c]&&g[c][k];if(e.resolution==h._resolution&&(A?A===h.getLatticeID(f):h.intersects(a,f)))if(x)d._sortFeatures(n),this._updateCell(x,n);else for(d._sortFeatures(n),e.features=n,A?g[A]=e:(g[c]=g[c]||{},g[c][k]=e),f=n.length,d=0;d<f;d++)a=n[d],c=a.attributes[q],this._addFeatureIIf(c,a),this._incRefCount(c);else x&&this._removeCell(c,k,A);this._endCheck()},_queryErrorHandler:function(b){this._finalizeIO();this._hasPartialFeatures=!0;this.featureLayer._errorHandler(b);this._endCheck(!0)},
_finalizeIO:function(){this._pending--},_endCheck:function(b){if(0===this._pending){this._processIOQueue();var e=this.featureLayer,d=e._trackManager;d&&(d.clearTracks(),d.addFeatures(e.graphics),e._ager&&m.forEach(e.graphics,function(f){f._shape&&e._repaint(f)}),d.moveLatestToFront(),d.drawTracks());this.featureLayer._fireUpdateEnd(b&&Error("FeatureLayer: an error occurred while updating the layer"),this._exceeds?{queryLimitExceeded:!0}:null);if(this._exceeds)e.onQueryLimitExceeded()}},_processIOQueue:function(b){this._ioQueue=
m.filter(this._ioQueue,function(b){return-1<b.fired?!1:!0});b&&m.forEach(this._ioQueue,this._cancelPendingRequest)},_getCurrentCells:function(b){var e=[];b=b||this._cellMap;for(var d in b)if(b.hasOwnProperty(d)){var f=b[d];f&&(f.hasOwnProperty("row")||f.hasOwnProperty("latticeID")?e.push(f):"object"===typeof f&&e.push.apply(e,this._getCurrentCells(f)))}return e},_removeOldCells:function(b){var e=this._cellMap,d=this._gridLayer,f,a;for(f in e)if(e[f]){var c=e[f],k=c.latticeID,q=0,g=0;if(k)q++,k!==
d.getLatticeID(b)&&(this._removeCell(null,null,k),g++);else for(a in c)c[a]&&(q++,d.intersects(c[a].extent,b)||(this._removeCell(f,a),g++));g===q&&delete e[f]}},_updateCell:function(b,e){var d=this.featureLayer,f=d.objectIdField,d=d._selectedFeatures,a,c=e.length;b.features=b.features||[];for(a=0;a<c;a++){var k=e[a],q=k.attributes[f],n=this._addFeatureIIf(q,k);n===k?(this._incRefCount(q),b.features.push(n)):q in d||(n.setGeometry(k.geometry),n.setAttributes(k.attributes))}},_removeCell:function(b,
e,d){var f=this._cellMap,a=this.featureLayer,c=a.objectIdField,k=d?f[d]:f[b]&&f[b][e];if(k)for(d?delete f[d]:delete f[b][e],b=k.features,e=0;e<b.length;e++)d=b[e].attributes[c],this._decRefCount(d),d in a._selectedFeatures||this._removeFeatureIIf(d)}});g("extend-esri")&&p.setObject("layers._OnDemandMode",t,d);return t})},"esri/layers/GridLayout":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../kernel ../SpatialReference ../geometry/Extent ../geometry/Polyline ../srUtils".split(" "),
function(t,r,p,m,g,d,l,h,u){t=t(null,{declaredClass:"esri.layers._GridLayout",constructor:function(e,b,d,g){this.origin=e;this.cellWidth=b.width;this.cellHeight=b.height;this.mapWidth=d.width;this.mapHeight=d.height;this.srInfo=g},setResolution:function(e){this._resolution=(e.xmax-e.xmin)/this.mapWidth;this.srInfo&&(e=Math.round(Math.round(2*this.srInfo.valid[1]/this._resolution)/this.cellWidth),this._frameStats=[e,0,e-1])},setMapState:function(e,b,d){this.mapWidth=b;this.mapHeight=d;this.setResolution(e)},
getCellCoordinates:function(e){var b=this._resolution,d=this.origin;return{row:Math.floor((d.y-e.y)/(this.cellHeight*b)),col:Math.floor((e.x-d.x)/(this.cellWidth*b))}},normalize:function(e){var b=this._frameStats;if(b){var d=b[0],g=b[1],b=b[2];e<g?(e%=d,e=e<g?e+d:e):e>b&&(e%=d)}return e},intersects:function(e,b){var d=this.srInfo;return d?p.some(b._getParts(d),function(b){return e.intersects(b.extent)}):e.intersects(b)},getCellExtent:function(e,b){var d=this._resolution,g=this.origin,f=this.cellWidth,
a=this.cellHeight;return new l(b*f*d+g.x,g.y-(e+1)*a*d,(b+1)*f*d+g.x,g.y-e*a*d,u.createSpatialReference(g.spatialReference.toJson()))},getLatticeID:function(e){var b=this.getCellCoordinates({x:e.xmin,y:e.ymax}),d=this.getCellCoordinates({x:e.xmax,y:e.ymin});e=b.row;var g=d.row,b=this.normalize(b.col),d=this.normalize(d.col);return e+"_"+g+"_"+b+"_"+d},sorter:function(e,b){return e<b?-1:1},getCellsInExtent:function(e,b){var d=this.getCellCoordinates({x:e.xmin,y:e.ymax}),g=this.getCellCoordinates({x:e.xmax,
y:e.ymin}),f=d.row,a=g.row,d=d.col,g=g.col,c=[],k,q,B,l=[],u=[],A,x,y,m,w=[];for(k=f;k<=a;k++)for(q=d;q<=g;q++)B=this.normalize(q),e=this.getCellExtent(k,B),p.some(c,function(a){return a.row===k&&a.col===B})||c.push({row:k,col:B,extent:e,resolution:this._resolution}),b&&(l.push(e.xmin,e.xmax),u.push(e.ymin,e.ymax));d=this.normalize(d);g=this.normalize(g);l.sort(this.sorter);u.sort(this.sorter);q=l.length;for(k=q-1;0<=k;k--)k<q-1&&l[k]===l[k+1]&&l.splice(k,1);q=u.length;for(k=q-1;0<=k;k--)k<q-1&&u[k]===
u[k+1]&&u.splice(k,1);if(l.length&&u.length){A=l[0];x=l[l.length-1];y=u[0];m=u[u.length-1];q=l.length;for(k=0;k<q;k++)w.push([[l[k],m],[l[k],y]]);q=u.length;for(k=0;k<q;k++)w.push([[A,u[k]],[x,u[k]]]);l=new h({paths:w,spatialReference:this.origin.spatialReference.toJson()});c.push({latticeID:f+"_"+a+"_"+d+"_"+g,lattice:l,resolution:this._resolution})}return{minRow:f,maxRow:a,minCol:d,maxCol:g,cells:c}}});m("extend-esri")&&r.setObject("layers._GridLayout",t,g);return t})},"esri/layers/SelectionMode":function(){define(["dojo/_base/declare",
"dojo/_base/lang","dojo/has","../kernel","./RenderMode"],function(t,r,p,m,g){t=t([g],{declaredClass:"esri.layers._SelectionMode",constructor:function(d){this.featureLayer=d;this._featureMap={}},propertyChangeHandler:function(d){this._init&&0===d&&this._applyTimeFilter()},resume:function(){this.propertyChangeHandler(0)},hasAllFeatures:function(){return!this.featureLayer._hasPartialSelectedFeatures}});p("extend-esri")&&r.setObject("layers._SelectionMode",t,m);return t})},"esri/layers/StreamMode":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/Deferred dojo/has ../kernel ../SpatialReference ../tasks/query ../tasks/QueryTask ../geometry/jsonUtils ./RenderMode".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b){t=t([b],{declaredClass:"esri.layers._StreamMode",constructor:function(b,e){this.featureLayer=b;this._featureMap={};this._setRefreshRate();this._drawBuffer={adds:[],updates:[]};this._timeoutId=null;this._flushDrawBuffer=r.hitch(this,this._flushDrawBuffer);this._featuresByTime={};this._lastEndTimeCheck=null;this._maxFeatureAge=0;b.purgeOptions&&b.purgeOptions.age&&"number"===typeof b.purgeOptions.age&&(this._maxFeatureAge=1E3*Math.ceil(60*b.purgeOptions.age));this._drawFeatures=
r.hitch(this,this._drawFeatures);this._queryErrorHandler=r.hitch(this,this._queryErrorHandler)},startup:function(){this._started||this.inherited(arguments)},propertyChangeHandler:function(b){this._init&&(0===b?this._applyTimeFilter():3===b?this._redrawAllTracks():console.debug("StreamLayer: Stream Layer only supports changing map time or maximumTrackPoints. Layer id \x3d "+this.featureLayer.id))},destroy:function(){this.inherited(arguments);clearTimeout(this._timeoutId);this._featuresByTime=this._drawBuffer=
this._featureMap=null},drawFeature:function(b){var e=this.featureLayer,f=e.objectIdField;this._timeoutId||(this._timeoutId=setTimeout(this._flushDrawBuffer,this._refreshRate));e._joinField&&this._getFeature(b.attributes[f])?this._drawBuffer.updates.push({oid:b.attributes[f],updates:b}):this._drawBuffer.adds.push(b)},resume:function(){this.propertyChangeHandler(0)},refresh:function(){this._pendingRequest&&this._cancelPendingRequest(this._pendingRequest);var b=this.featureLayer;b&&(b._relatedUrl||b._keepLatestUrl?
(b._fireUpdateStart(),b._refreshing=!0,b.disconnect(),b.clear(),b._relatedQueried=!1,b._keepLatestQueried=!1,b.connect()):(b._fireUpdateStart(),b.clear(),b._fireUpdateEnd()))},_drawFeatures:function(b,e){var f=this.featureLayer;f._create(b.features||[]);f._fireUpdateEnd(null,e)},_applyTimeFilter:function(b){this.inherited(arguments);this._redrawAllTracks()},_removeFeatures:function(b){var e=this.featureLayer,f=e.objectIdField;b&&p.forEach(b,function(a){a=a.attributes[f];e._unSelectFeatureIIf(a,this);
this._decRefCount(a);this._removeFeatureIIf(a)},this)},_addFeatures:function(b){var e=this.featureLayer,f=e._endTimeField,a=e._startTimeField,c,d,q,g=[],n=[],h=[];c=e._trackManager;d=e.objectIdField;if(c)for(q in b=c.addFeatures(b),b)b.hasOwnProperty(q)&&(g.push(q),b[q].adds&&(n=n.concat(b[q].adds)),b[q].deletes&&(h=h.concat(b[q].deletes)));else n=b;p.forEach(n,function(c){var b=c.attributes[d],e;e=f&&c.attributes[f];!e&&this._maxFeatureAge&&(e=a&&c.attributes[a]?c.attributes[a]+this._maxFeatureAge:
Date.now()+this._maxFeatureAge);e&&(e=1E3*Math.ceil(e/1E3),this._featuresByTime[e]?this._featuresByTime[e].push(b):this._featuresByTime[e]=[b]);this._addFeatureIIf(b,c);this._incRefCount(b)},this);h.length&&this._removeFeatures(h);c&&c.refreshTracks(g)},_updateFeatures:function(b){var e=this.featureLayer,f,a,c=[];f=e._trackManager;a=e._trackIdField;p.forEach(b,function(b){var d=b.updates;b=this._getFeature(b.oid);var k;if(b){d.geometry&&b.setGeometry(d.geometry);d=d.attributes||{};for(k in d)d.hasOwnProperty(k)&&
(b.attributes[k]=d[k]);b.setAttributes(b.attributes);b.visible=this._checkFeatureTimeIntersects(b);f&&b.attributes[a]?c.push(b.attributes[a]):e._repaint(b,null,!0)}},this);c.length&&f.refreshTracks(c)},_redrawAllTracks:function(){var b=this.featureLayer._trackManager,e;b&&(e=b.trimTracks())&&0<e.length&&(this._removeFeatures(e),b.refreshTracks())},_flushDrawBuffer:function(){clearTimeout(this._timeoutId);var b=this._drawBuffer,e=b.adds.splice(0,b.adds.length),f=b.updates.splice(0,b.updates.length),
b=this.featureLayer;if(!b)return!1;b.updating||b._fireUpdateStart();this._addFeatures(e);this._updateFeatures(f);(e=this._getExpiredFeatures())&&e.length&&(this._removeFeatures(e),b._trackManager&&b._trackManager.removeFeatures(e));b._purge();b._fireUpdateEnd();this._timeoutId=null},_clearDrawBuffer:function(){var b=this._timeoutId,e=this._drawBuffer,f=e.adds,e=e.updates;b&&clearTimeout(b);f.splice(0,f.length);e.splice(0,e.length);this._timeoutId=null},_clearTimeBin:function(){this._featuresByTime=
{};this._lastEndTimeCheck=1E3*Math.ceil(Date.now()/1E3)},_clearFeatureMap:function(){this._featureMap={}},_setRefreshRate:function(b){b=b||0===b?b:200;0>b&&(b=200);this._refreshRate=b},_checkFeatureTimeIntersects:function(b){var e=this.featureLayer,f=e.getMap();return(f=f?f.timeExtent:null)&&e.timeInfo&&(e.timeInfo.startTimeField||e.timeInfo.endTimeField)?0<e._filterByTime([b],f.startTime,f.endTime).match.length:!0},_fetchArchive:function(b){var d=new m,f=this.featureLayer,a,c,k,q,g;this._pendingRequest&&
this._cancelPendingRequest(this._pendingRequest);f._fireUpdateStart();b&&this.map?(b=new u(b),a=new h,c=this.map,k=f.getFilter()||{},q=k.where||"1\x3d1",g=k.geometry?e.fromJson(k.geometry):null,k=k.outFields?k.outFields.split(","):["*"],a.geometry=g,a.where=q,a.outFields=k,a.returnGeometry=!0,a.outSpatialReference=new l(c.spatialReference.toJson()),this._pendingRequest=b.execute(a).then(function(a){this._pendingRequest=null;var c=this._fixFieldNameCasing(f,a);a.features=c;this._drawFeatures(a);f._fireUpdateEnd();
d.resolve()}.bind(this)).otherwise(function(a){this._pendingRequest=null;f._errorHandler(a);f._fireUpdateEnd(a);d.reject(a)}.bind(this))):d.resolve();return d.promise},_queryErrorHandler:function(b){var e=this.featureLayer;e._errorHandler(b);e._fireUpdateEnd(b)},_fixFieldNameCasing:function(b,e){var f=e.features||[],a=e.fields;if(!a||!f.length)return f;for(var a=this._mapFieldNameDifferences(b.fields,a),c=[],d,q,g=0,h=e.features.length;g<h;g++)d=f[g],q=this._swizzleResponseAttributes(d.attributes,
a),c.push({geometry:d.geometry,attributes:q});return c},_mapFieldNameDifferences:function(b,e){var f=[],a={},c,d;c=0;for(d=e.length;c<d;c++)f.push(e[c].name);c=0;for(d=b.length;c<d;c++){var q=b[c].name,g=this._checkForStreamFieldName(q,f);g&&(a[g]=q)}return a},_checkForStreamFieldName:function(b,e){for(var f=b.toLowerCase(),a,c=0,d=e.length;c<d;c++)if(e[c].toLowerCase()===f){a=e[c];break}return a},_swizzleResponseAttributes:function(b,e){var f={},a;for(a in b)if(b.hasOwnProperty(a)){var c=b[a];e.hasOwnProperty(a)?
f[e[a]]=c:f[a]=c}return f},_getExpiredFeatures:function(){var b,e,f,a=[],c=[];if(!this.featureLayer._endTimeField&&!this._maxFeatureAge)return c;b=1E3*Math.floor(this._lastEndTimeCheck/1E3);this._lastEndTimeCheck=e=1E3*Math.ceil(Date.now()/1E3);if(b&&b!==e)for(f=this._featuresByTime;b<=e;b+=1E3)f[b]&&(a=a.concat(f[b]),delete f[b]);p.forEach(a,function(a){(a=this._getFeature(a))&&c.push(a)},this);return c}});g("extend-esri")&&r.setObject("layers._StreamMode",t,d);return t})},"esri/layers/TrackManager":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has dojo/dom-construct dojox/gfx ../kernel ../graphic ../geometry/Polyline ./GraphicsLayer".split(" "),
function(t,r,p,m,g,d,l,h,u,e){var b=-1!==d.renderer.toLowerCase().indexOf("canvas");t=t(null,{declaredClass:"esri.layers._TrackManager",constructor:function(b){this.layer=b;this.trackMap={};this.trackLineMap={}},initialize:function(d){this.map=d;var h=this.layer,f=h._getRenderer(),f=f&&f.trackRenderer;if("esriGeometryPoint"===h.geometryType){var a=this.container=new e._GraphicsLayer({id:h.id+"_tracks",_child:!0,visible:h.visible,minScale:h.minScale,maxScale:h.maxScale});a.loaded=!0;a.onLoad(a);a._setMap(d,
h._div);if(!b){d=a._div.getNode();var c=h._div.getNode();d&&c&&g.place(d,c,"first")}a.setRenderer(f);h.on("visibility-change",r.hitch(this,function(a){this.container.setVisibility(a.visible);this.container.evaluateSuspension()}));h.on("scale-range-change",r.hitch(this,function(){this.container.setScaleRange(this.layer.minScale,this.layer.maxScale)}))}},addFeatures:function(b){var e=this.trackMap,f=this.layer,a=f._trackIdField,c=[];p.forEach(b,function(b){var f=b.attributes[a];(e[f]=e[f]||[]).push(b);
-1===p.indexOf(c,f)&&c.push(f)});var d=f._startTimeField,q=f.objectIdField,g=function(a,c){var b=a.attributes[d],f=c.attributes[d];return b===f?a.attributes[q]<c.attributes[q]?-1:1:b<f?-1:1};p.forEach(c,function(a){e[a].sort(g)})},trimTracks:function(b){function e(b){for(b=f[b]||[];b.length>a;)c.push(b.shift())}var f=this.trackMap,a=this.layer.maximumTrackPoints||0,c=[],d;if(!a)return c;if(b)p.forEach(b,function(a){e(a)});else for(d in f)f.hasOwnProperty(d)&&e(d);return c},drawTracks:function(b){function e(b){var e=
c[b],k,g,y;g=f.trackLineMap[b];a.remove(g);delete f.trackLineMap[b];g=null;if(!e||2>e.length)return!1;g=[];for(k=e.length-1;0<=k;k--)(y=e[k].geometry)&&g.push([y.x,y.y]);e={};e[q]=b;1<g.length&&(g=new h(new u({paths:[g],spatialReference:d}),null,e),a.add(g),f.trackLineMap[b]=g)}var f=this,a=this.container,c,d,q,g;if(a)if(c=this.trackMap,d=this.map.spatialReference,q=this.layer._trackIdField,b)p.forEach(b,function(a){e(a)});else for(g in c)c.hasOwnProperty(g)&&e(g)},refreshTracks:function(b){function e(b){var e,
k;f.drawTracks([b]);if(d&&d.latestObservationRenderer)for(b=a[b]||[],e=b.length,k=0;k<e;k++)c._repaint(b[k],null,!0)}var f=this,a=this.trackMap,c=this.layer,d=c._getRenderer(),q;if(b)p.forEach(b,function(a){e(a)});else for(q in a)a.hasOwnProperty(q)&&e(q);this.moveLatestToFront()},moveLatestToFront:function(b){p.forEach(this.getLatestObservations(b),function(b){var f=b._shape;f&&f._moveToFront();this._repaint(b,null,!0)},this.layer)},getLatestObservations:function(b){function e(a){a=c[a];return a[a.length-
1]}var f=[],a=this.layer._getRenderer(),c=this.trackMap,d;if(!a.latestObservationRenderer)return f;if(b)p.forEach(b,function(a){f.push(e(a))});else for(d in c)c.hasOwnProperty(d)&&f.push(e(d));return f},clearTracks:function(b){var e=this.getLatestObservations(b),f=this.container,a;b?p.forEach(b,function(c){delete this.trackMap[c];f&&(a=this.trackLineMap[c],f.remove(a),delete this.trackLineMap[c])},this):(this.trackMap={},this.trackLineMap={},f&&f.clear());p.forEach(e,function(a){this._repaint(a,null,
!0)},this.layer)},isLatestObservation:function(b){var e=this.trackMap[b.attributes[this.layer._trackIdField]];return e?e[e.length-1]===b:!1},destroy:function(){var b=this.container;b&&(b.clear(),b._unsetMap(this.map,this.layer._div));this.map=this.layer=this.trackMap=this.container=null}});m("extend-esri")&&r.setObject("layers._TrackManager",t,l);return t})},"esri/layers/HeatmapManager":function(){define("dojo/_base/declare dojo/_base/lang dojo/aspect dojo/_base/array require ../kernel ../sniff ../geometry/Point ../geometry/webMercatorUtils ./MapImage ../renderers/HeatmapRenderer ../tasks/query dojo/_base/fx".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v){function f(){}function a(a){var c=a.layer;return{geometry:a.geometry,attributes:a.attributes,getLayer:function(){return c}}}t=t(null,{declaredClass:"esri.layers.HeatmapManager",heatmapRenderer:null,sourceLayer:null,imageLayer:null,useTiles:!0,useWorker:!1,map:null,constructor:function(a){this.sourceLayer=a;this._hndls=[]},initialize:function(a){this.map=a;var c=this.sourceLayer,f=c.renderer;c.setDrawMode(!1);this.imageLayer=a._getMapImageLyr();var e=this;this.heatmapRenderer=
f instanceof b?f:(f.getRendererInfoByZoom(a.getZoom())||f.getRendererInfoByScale(a.getScale())).renderer;this._setupDraw=this._setupDraw.bind(this);this.recalculateHeatmap=this.recalculateHeatmap.bind(this);this._removeRenderer=this._removeRenderer.bind(this);this._handleRendererChange=this._handleRendererChange.bind(this);this._rendererChangeHandle=this.sourceLayer.on("renderer-change",this._handleRendererChange);this._handleOpacityChange=this._handleOpacityChange.bind(this);this._reprojectFeature=
this._reprojectFeature.bind(this);g(["../workers/heatmapCalculator"],function(a){e._calculator=new a(r.mixin({width:e.map.width,height:e.map.height},e._getOptions()));e._setupRenderer();e.heatmapRenderer.getStats=a.calculateStats;e.heatmapRenderer.getHistogramData=a.getHistogramData})},destroy:function(){this._removeHandlers();this._rendererChangeHandle&&this._rendererChangeHandle.remove();this._rendererChangeHandle=this.sourceLayer=this.imageLayer=this.map=this.heatmapRenderer=this._hndls=null},
_handleRendererChange:function(a){var c=a.renderer,f=c instanceof b;this.heatmapRenderer?f?this.heatmapRenderer=c:this._removeRenderer(a):f&&(this.heatmapRenderer=c,this.sourceLayer&&this.map&&this._setupRenderer())},_handleOpacityChange:function(a){a=a.opacity;var c=this._getImageBySourceId(this.sourceLayer.id);c&&c.setOpacity(a)},_setupRenderer:function(){var a=this._hndls,b=this.sourceLayer,e=this.map,d=this;b._originalDraw=b._draw;b._draw=f;b._div.clear();clearTimeout(this._resetTimer);this._resetTimer=
setTimeout(this._resetGraphics.bind(this),250);a.push(b.on("update-end",this._setupDraw));a.push(b.on("suspend",function(a){(a=d._getImageBySourceId(d.sourceLayer.id))&&a.hide()}));a.push(b.on("resume",function(a){(a=d._getImageBySourceId(d.sourceLayer.id))&&a.show()}));a.push(p.after(b,"redraw",this._setupDraw));a.push(e.on("layer-remove",function(a){a.layer==b&&((a=d._getImageBySourceId(d.sourceLayer.id))&&d.imageLayer.removeImage(a),d._removeRenderer({target:b}))}));b._collection&&a.push(b.on("graphic-add",
function(a){d._reprojectFeature(a.graphic);d._setupDraw()}));1!==b.mode&&(a.push(e.on("resize, pan-end",this._setupDraw)),a.push(e.on("zoom-end",this._setupDraw)));a.push(b.on("opacity-change",this._handleOpacityChange));this.imageLayer.suspended&&this.imageLayer.resume();b.graphics&&b.graphics.length&&(b.graphics[0].geometry&&!e.spatialReference.equals(b.graphics[0].geometry.spatialReference)&&m.forEach(b.graphics,function(a){this._reprojectFeature(a)}.bind(this)),this._setupDraw())},_setupDraw:function(){if(!this._drawTimer){var a=
this;this._drawTimer=setTimeout(function(){clearTimeout(a._drawTimer);a._drawTimer=null;a.sourceLayer._getRenderer().isInstanceOf(b)&&a.recalculateHeatmap()},16)}},_removeRenderer:function(a){var c=a.target;c._draw=c._originalDraw;delete c._originalDraw;c.setDrawMode(!0);this._removeHandlers();this._hndls=[];var b=this._getImageBySourceId(this.sourceLayer.id);b&&this.imageLayer.removeImage(b);clearTimeout(this._drawTimer);clearTimeout(this._resetTimer);this._drawTimer=this._resetTimer=null;c.renderer!=
a.renderer&&c.renderer.getRendererInfo?this.heatmapRenderer=null:(c.redraw(),this.destroy())},recalculateHeatmap:function(){this._calculator?this._doMainCalculation():this._calculatorClient&&this._doWorkerCalculation()},_reprojectFeature:function(a){if(a&&a.geometry){var c=a.geometry,b=this.map.spatialReference;b.equals(c.spatialReference)||(c=u.project(c,b),null==c?console.log("Unable to reproject features to map's spatial reference. Please convert feature geometry before adding to layer"):a.geometry=
c)}},_doWorkerCalculation:function(){},_doMainCalculation:function(){var c=this.sourceLayer,b=this.map,f=this.heatmapRenderer,d=this.map.extent,g=this.map.width,h=this.map.height,A=this._calculator,x=this,y=function(k){k=x._getScreenPoints(k.features,b,c);k=A.calculateImageData(r.mixin({screenPoints:k,mapinfo:{extent:[d.xmin,d.ymin,d.xmax,d.ymax],resolution:b.getResolution()},width:g,height:h},x._getOptions()));k=f.getSymbol(a({geometry:b.extent,attributes:{size:[g,h],imageData:k},layer:c}));k=new e({extent:b.extent,
href:k.url,opacity:0,sourceId:c.id});x._swapMapImages(k,x._getImageBySourceId(c.id));c.suspended&&k.hide()},v={geometry:b.extent,timeExtent:c.useMapTime?b.timeExtent:void 0,spatialRelationship:n.SPATIAL_REL_INTERSECTS};null!=c._canDoClientSideQuery(v)?c.queryFeatures(v,y):y({features:c.graphics})},_getScreenPoints:function(a,b,f){var c=[],e=a.length,d=0,k=0,q,y=new h(b.extent.xmin,b.extent.ymax,b.spatialReference),g=b.toScreen(y),w=g.x,g=g.y,n=b.getResolution(),v;for((k=b.extent.getCacheValue("_parts"))&&
(v=m.map(k,function(a){return f._intersects(b,a.extent)[0]}));e--;)k=a[e],k.geometry&&(q={x:Math.ceil((k.geometry.x-y.x)/n+w),y:Math.floor((y.y-k.geometry.y)/n-g),attributes:k.attributes},v&&(k=1<v.length&&q.x<-v[0]?v[1]:v[0],q.x+=k),c[d++]=q);return c},_getImageBySourceId:function(a){var c=this.imageLayer.getImages(),c=m.filter(c,function(c){return c.sourceId==a});if(c.length)return c[c.length-1]},_swapMapImages:function(a,b){function c(){f.removeImage(b)}var f=this.imageLayer,e=this.sourceLayer.opacity;
f.addImage(a);v.anim(a._node,{opacity:e},null,null,function(){a.opacity=e});null!=b&&v.anim(b._node,{opacity:0},null,null,c)},_removeHandlers:function(){if(null!=this._hndls)for(var a=this._hndls.length;a--;)this._hndls[a].remove()},_getOptions:function(){var a=this.heatmapRenderer;return{blurRadius:a.blurRadius,gradient:a.gradient,maxPixelIntensity:a.maxPixelIntensity,minPixelIntensity:a.minPixelIntensity,field:a.field,fieldOffset:a.fieldOffset}},_resetGraphics:function(){clearTimeout(this._resetTimer);
this._resetTimer=null;for(var a=this.sourceLayer.graphics,b=a.length,f;b--;)f=a[b],f._shape=f._offsets=void 0}});l("extend-esri")&&r.setObject("layers.HeatmapManager",t,d);return t})},"esri/layers/clustering/ClusterManager":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../../kernel ../../Evented ../../graphic ../../lang ../../Color ../../graphicsUtils ../../dijit/PopupTemplate ../../dijit/Legend/utils ../../renderers/ClassBreaksRenderer ../../symbols/SimpleMarkerSymbol ../GraphicsLayer ../Field ./GeohashAggregation ./statUtils dojo/i18n!../../nls/jsapi".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v,f,a,c,k,q,B){var z=B.layers.clusters,D=B.widgets.popup,A=z.numFeatures,x=Math.pow(2,53)-1;t=t(d,{declaredClass:"esri.layers.clustering.ClusterManager",layer:null,aggregationInfo:null,container:null,defaults:{clusterRadius:80,markerSymbol:{color:[77,77,77,255],size:6,angle:0,xoffset:0,yoffset:0,type:"esriSMS",style:"esriSMSCircle",outline:{color:[255,255,255,255],width:.75,type:"esriSLS",style:"esriSLSSolid"}}},_initialized:!1,_map:null,_eventHandles:null,_clusterRadius:null,
_renderer:null,_statisticInfos:null,_fields:null,_infoTemplate:null,_clusterGenerator:null,_singleGraphics:null,constructor:function(a){this._eventHandles=[];this.layer=a.layer;this.setAggregationInfo(a.aggregationInfo)},initialize:function(a){this._initialized=!0;this._map=a;this.container=this._createContainer();this._clusterGenerator=this._createClusterGenerator();this._initClusterGenerator();this._createLayerEventListeners();this._createMapEventListeners();this._createPopupEventListeners()},destroy:function(a){this._clearSingleGraphics();
this._removeClusterBoundary();this._destroyEventListeners();this._removeFromPopup(this.container);this._removeFromPopup(this.layer);this._resetClusterNav();this._destroyClusterGenerator(a);this._destroyContainer();this.layer=this.aggregationInfo=this._map=null},setAggregationInfo:function(a){this.aggregationInfo=a?r.mixin({},a):null;this._applyAggregationInfo()},getClusterRenderer:function(){return this._renderer},getClusterFields:function(){return this._fields||[]},getFeaturesInCluster:function(a){a=
a&&a.getAggregationInfo();return this._clusterGenerator?this._clusterGenerator.getFeaturesInCluster(a):[]},getAggregateGraphics:function(){return this.container?this.container.graphics.slice(0):[]},getSingleGraphics:function(){return this._singleGraphics?this._singleGraphics.slice(0):[]},redraw:function(){this.container&&this.container.redraw()},isClusteringEnabled:function(){return!(!this._clusterGenerator||!this._clusterGenerator.clustersEnabled)},isClusteringActive:function(){return!!(this._clusterGenerator&&
0<this._clusterGenerator.getNumFeatures())},_createContainer:function(){var c=this.layer,b=new a._GraphicsLayer({_child:!0,id:c.id+"_clusters",visible:c.visible,minScale:c.minScale,maxScale:c.maxScale,infoTemplate:this._infoTemplate});b.fields=this._fields;b.setRenderer(this._renderer);b.loaded=!0;b.onLoad(b);b._setMap(this._map,c._div);return c._childLayer=b},_destroyContainer:function(){var a=this.container;a&&(a.clear(),a._unsetMap(this._map,this.layer._div),this.layer._childLayer=null);this.container=
null},_createClusterGenerator:function(){return new k({map:this._map,layer:this.layer,clusterRadius:this._clusterRadius,statisticInfos:this._statisticInfos})},_initClusterGenerator:function(){var a=this._clusterGenerator;a.loaded?(this._applyRenderer(),this._initClusterUpdates()):this._eventHandles.push(a.on("load",r.hitch(this,function(){this._applyRenderer();this._initClusterUpdates()})),a.on("load-error",r.hitch(this,function(a){console.log(a.error)})))},_destroyClusterGenerator:function(a){this._clusterGenerator&&
this._clusterGenerator.destroy(a);this._clusterGenerator=null},_applyAggregationInfo:function(){this._applyClusterRadius();this._applyRenderer();this._clusterGenerator&&!this._clusterGenerator.isUpdateScheduled()&&this.redraw()},_applyClusterRadius:function(){var a=this.aggregationInfo;this._clusterRadius=a&&a.clusterRadius||this.defaults.clusterRadius;this._clusterGenerator&&this._clusterGenerator.setClusterRadius(this._clusterRadius);this._computeClusterRadius()},_computeClusterRadius:function(){var a=
this.aggregationInfo||{};a.clusterRadius=this._clusterRadius;this.aggregationInfo=a},_applyRenderer:function(){var a=this.container,c=this._getClusterRendererInfo(),b=this._compareStatInfos(this._statisticInfos,c.statisticInfos);b&&(this._statisticInfos=c.statisticInfos,this._clusterGenerator&&(this._clusterGenerator.setStatisticInfos(p.map(this._statisticInfos,function(a){return{attributeInfo:a.attributeInfo,statisticType:a.statisticType}})),a&&p.forEach(a.graphics,function(a){this._applyClusterAttributes(a,
a.getAggregationInfo())},this)));this._renderer=c.renderer;this._applyFields();this._applyInfoTemplate(!!b&&this._initialized);a&&(a.setRenderer(this._renderer),this.emit("renderer-change"))},_applyFields:function(){this._fields=this._getFields(this._statisticInfos);this.container&&(this.container.fields=this._fields)},_applyInfoTemplate:function(a){if(this.layer.infoTemplate){var c=this.aggregationInfo,c=c&&c.infoTemplate||this._infoTemplate;a=a||!c?this._createInfoTemplate():this._updateInfoTemplate(c)}else a=
null;this._infoTemplate=a;this.container&&this.container.setInfoTemplate(this._infoTemplate);this._computeInfoTemplate()},_computeInfoTemplate:function(){var a=this.aggregationInfo||{};a.infoTemplate=this._infoTemplate;this.aggregationInfo=a},_getClusterRendererInfo:function(){var a=this.layer&&this.layer.renderer;return a?this._createClusterRenderer(a):this._getDefaultClusterRenderer()},_getDefaultClusterRenderer:function(){var a=this._createContinuousCountRenderer();this._addSizeByCountVariable(a);
return{renderer:a,statisticInfos:[]}},_createContinuousCountRenderer:function(a){var c=new v(null,"cluster_count");c.addBreak({minValue:-x,maxValue:x,symbol:a?new a.constructor(a.toJson()):new f(r.clone(this.defaults.markerSymbol))});return c},_createClusterRenderer:function(a){if(!this._isSupportedRenderer(a))return this._getDefaultClusterRenderer();var c,b=[];if(this._isSimpleRenderer(a))c=this._createContinuousCountRenderer(a.symbol);else{c=new a.constructor(a.toJson());var f=this._getRendererAttributeInfo(a),
e;this._isCBRenderer(c)?(e=q.getClusterField(f,"avg"),b.push(this._getStatInfo(f,"avg")),c.normalizationType=null,c.normalizationField=null,c.normalizationTotal=null):this._isUVRenderer(c)&&(e=q.getClusterField(f,"type"),b.push(this._getStatInfo(f,"type")));c.attributeField=e;c.setValueExpression(null);c.valueExpressionTitle=null;c.setVisualVariables(null);this._setRendererTitle(c,a)}a=this._getSupportedVariables(a);f=this._createClusterVariables(a.allVars,b);c.setVisualVariables(f);a.sizeVars.length||
this._isCBSizeRenderer(c)||this._addSizeByCountVariable(c);return{renderer:c,statisticInfos:b}},_isSupportedRenderer:function(a){if(this._isSimpleRenderer(a))return!0;if(this._isCBRenderer(a)){var c=a.normalizationType;return"function"===typeof a.attributeField||c&&"field"!==c?!1:!0}return this._isUVRenderer(a)?"function"===typeof a.attributeField||a.attributeField2?!1:!0:!1},_isSimpleRenderer:function(a){return-1<a.declaredClass.toLowerCase().indexOf("simplerenderer")},_isCBRenderer:function(a){return-1<
a.declaredClass.toLowerCase().indexOf("classbreaksrenderer")},_isUVRenderer:function(a){return-1<a.declaredClass.toLowerCase().indexOf("uniquevaluerenderer")},_isCBSizeRenderer:function(a){var c=a.infos;if(!this._isCBRenderer(a)||!c||2>c.length)return!1;var b=Infinity,f=-Infinity;p.forEach(c,function(a){if(a=a.symbol){var c=0;switch(a.type){case "simplemarkersymbol":c=a.size;break;case "picturemarkersymbol":c=(a.width+a.height)/2}b=Math.min(b,c);f=Math.max(f,c)}});return Infinity!==b&&-Infinity!==
f&&b!==f},_getRendererAttributeInfo:function(a){var c=a.attributeField,b=c?this.layer.getField(c):null;return{field:c,attributeType:b&&"esriFieldTypeDate"===b.type?"date":null,rotationType:null,valueExpression:a.valueExpression,valueExpressionTitle:a.valueExpressionTitle,normalizationField:a.normalizationField}},_setRendererTitle:function(a,c){a.legendOptions=r.clone(c.legendOptions);a.legendOptions&&a.legendOptions.title||(a.legendOptions=a.legendOptions||{},a.legendOptions.title=n.getRendererTitle(c,
this.layer))},_getSupportedVariables:function(a){var c=a.getVisualVariablesForType("colorInfo",!1)||[],b=a.getVisualVariablesForType("sizeInfo",!1)||[],f=a.getVisualVariablesForType("opacityInfo",!1)||[];a=a.getVisualVariablesForType("rotationInfo",!1)||[];c=p.filter(c,this._variableFilter);b=p.filter(b,this._variableFilter);f=p.filter(f,this._variableFilter);a=p.filter(a,this._variableFilter);return{sizeVars:b,allVars:c.concat(b).concat(f).concat(a)}},_variableFilter:function(a){return"function"!==
typeof a.field},_createClusterVariables:function(a,c){return p.map(a,function(a){return this._createVarForAvg(a,c)},this)},_createVarForAvg:function(a,c){var b=r.clone(a),f=this._getVariableAttributeInfo(a);b.field=q.getClusterField(f,"avg");b.normalizationField=null;b.valueExpression=null;b.valueExpressionTitle=null;f=this._getStatInfo(f,"avg");this._addStatInfo(c,f);this._setVariableTitle(b,a);return b},_getVariableAttributeInfo:function(a){var c="rotationInfo"===a.type,b=c?"angle":null,c=c?a.rotationType:
null,f=a.legendOptions&&a.legendOptions.title,e=a.field,d=e?this.layer.getField(e):null;d&&"esriFieldTypeDate"===d.type&&(b="date");return{field:e,attributeType:b,rotationType:c,valueExpression:a.valueExpression,valueExpressionTitle:a.valueExpressionTitle||a.valueExpression&&f,normalizationField:a.normalizationField}},_setVariableTitle:function(a,c){a.legendOptions&&a.legendOptions.title||(a.legendOptions=a.legendOptions||{},a.legendOptions.title=n.getVisualVariableTitle(c,this.layer))},_getStatInfo:function(a,
c){return{statisticHash:q.getStatisticHash(a,c),attributeInfo:a,statisticType:c}},_addStatInfo:function(a,c){var b=this._findStatInfo(a,c);b?b.attributeInfo.valueExpressionTitle||(b.attributeInfo.valueExpressionTitle=c.attributeInfo.valueExpressionTitle):a.push(c)},_findStatInfo:function(a,c){var b;p.some(a,function(a){a.statisticHash===c.statisticHash&&(b=a);return!!b});return b},_compareStatInfos:function(a,c){var b=p.filter(a,function(a){return!this._findStatInfo(c,a)},this),f=p.filter(c,function(c){return!this._findStatInfo(a,
c)},this);return f.length||b.length?{added:f,removed:b}:null},_addSizeByCountVariable:function(a){var c=this._createSizeByCountVariable();c&&this._addVariable(a,c)},_getSizeByCountVariable:function(a){a=a.getVisualVariablesForType("sizeInfo",!1)||[];return p.filter(a,function(a){return"cluster_count"===a.field})[0]},_updateSizeByCountVariable:function(){var a=this._renderer,c=this._getSizeByCountVariable(a);if(c){var b=this._createSizeByCountVariable();b&&this._replaceVariable(a,c,b)}},_createSizeByCountVariable:function(){var a=
this._clusterGenerator,c;if(a){c=a.getCurrentLodStats();var b=a.getNumFeatures(),a=a.clusters,f=c.min,e=c.max;1===c.count&&f===b||1===a.length&&a[0].count===b?(f=1,e=b):f&&f===e&&(e=2*f);c={type:"sizeInfo",field:"cluster_count",valueUnit:"unknown",minSize:12,maxSize:50,minDataValue:f,maxDataValue:e,legendOptions:{title:A}}}return c},_addVariable:function(a,c){var b=a.visualVariables||[];b.push(c);a.setVisualVariables(b)},_replaceVariable:function(a,c,b){var f=a.visualVariables;c=p.indexOf(f,c);-1<
c&&f.splice(c,1);f.push(b);a.setVisualVariables(f)},_getFields:function(a){var b=[new c({name:"cluster_count",type:"esriFieldTypeInteger"})];p.forEach(a,function(a){var f=a.statisticType;a=a.attributeInfo;var e;"avg"===f?e="date"===a.attributeType?"esriFieldTypeDate":"esriFieldTypeDouble":"type"===f&&(e=a.field?this.layer.getField(a.field).type:"esriFieldTypeString");b.push(new c({name:q.getClusterField(a,f),type:e}))},this);return b},_createInfoTemplate:function(){var a=this._statisticInfos,c=this._renderer,
f=[{fieldName:"cluster_count",label:A,visible:!0,format:{digitSeparator:!0,places:0}}],e=[],d=[h.substitute({count:"{cluster_count}"},z.countSummary)],k=this._isUVRenderer(c)?c.infos:[];p.forEach(a,function(a){var c,b,w=a.statisticType,g=a.attributeInfo,h=q.getClusterField(g,w),x=this._getFieldLabel(a);"avg"===w?(c={fieldName:h,label:x,visible:!0,format:"date"===g.attributeType?{dateFormat:"shortDateShortTime"}:{digitSeparator:!0,places:1}},b=this._getFieldSummary(a,h)):"type"===w&&(b="expression/"+
h,c={fieldName:b,visible:!0},e.push({name:h,title:x,returnType:"string",expression:this._getExpression(k,h)}),b=this._getFieldSummary(a,b));c&&f.push(c);b&&d.push(b)},this);return new b({fieldInfos:f,expressionInfos:e,description:d.join("\x3cbr/\x3e\x3cbr/\x3e")})},_updateInfoTemplate:function(a){var c=a.toJson(),f=this._isUVRenderer(this._renderer)?this._renderer.infos:[];p.forEach(this._statisticInfos,function(a){var b=a.statisticType;a=q.getClusterField(a.attributeInfo,b);"type"===b&&(b=this._findExpressionInfo(a,
c))&&(b.expression=this._getExpression(f,a))},this);return new b(c)},_findExpressionInfo:function(a,c){var b;p.some(c.expressionInfos,function(c){c.name===a&&(b=c);return!!b});return b},_escapeDoubleQuotes:function(a){return a?a.replace(/"/g,'\\"'):""},_getExpression:function(a,c){return["var uvInfos \x3d ["+this._getObjects(a).join(", ")+"];",'var predominantType \x3d Text($feature["'+c+'"]);','var label \x3d "'+this._escapeDoubleQuotes(z.predominantNoneValue)+'";',"for (var i \x3d 0; i \x3c Count(uvInfos); i++) {\nif (uvInfos[i].value \x3d\x3d predominantType) {\nlabel \x3d uvInfos[i].label;\nbreak;\n}\n}\nreturn label;"].join("\n")},
_getObjects:function(a){return p.map(a,function(a){return'{"value": "'+String(a.value)+'","label": "'+this._escapeDoubleQuotes(String(a.label))+'"}'},this)},_getFieldLabel:function(a){var c=a.statisticType,b=a.attributeInfo,f=b.field;a=b.normalizationField;var e="",d;"avg"===c?d=a?z.avgNormFieldLabel:z.avgFieldLabel:"type"===c&&(d=z.predominantFieldLabel);d&&(c=b.valueExpression?b.valueExpressionTitle:this.layer.getFieldLabel(f),a=a&&this.layer.getFieldLabel(a),e=h.substitute({fieldLabel:c||"",normFieldLabel:a||
""},d));return e},_getFieldSummary:function(a,c){var b=a.statisticType,f=a.attributeInfo,e=f.field,d=f.normalizationField,k="",q;"avg"===b?q=d?z.avgNormFieldSummary:z.avgFieldSummary:"type"===b&&(q=z.predominantFieldSummary);q&&(b=f.valueExpression?f.valueExpressionTitle:this.layer.getFieldLabel(e),d=d&&this.layer.getFieldLabel(d),k=h.substitute({fieldLabel:b||"",normFieldLabel:d||"",fieldValue:"{"+c+"}"},q));return k},_removeFromPopup:function(a){var c=this._map.infoWindow,b=c.features;if(b&&b.length){var f=
p.filter(b,function(c){return c.getLayer()!==a});f.length<b.length&&(f.length?c.setFeatures(f):(c.clearFeatures(),c.hide()))}},_resetClusterNav:function(){this._resetClusterNavPartial();this._popupClusterGraphic=null},_resetClusterNavPartial:function(){this._map.infoWindow.removeActions(this._popupActions);this._hideSingleGraphic(this._popupSingleGraphic);this._popupSingleGraphic=null},_addClusterBoundary:function(a,c){var b=c.clusterFillSymbol;b&&(b=new b.constructor(b.toJson()));b=new l(a,b);this._map.graphics.add(b);
this._clusterBoundary=b},_removeClusterBoundary:function(){this._map.graphics.remove(this._clusterBoundary);this._clusterBoundary=null},_createBrowseFeaturesAction:function(){return this._map.infoWindow.addActions([{title:D.NLS_browseFeatures,className:"browseFeatures",callback:r.hitch(this,function(a){a.preventDefault();a=this._map.infoWindow;var c=a.getSelectedFeature(),b=c.getChildGraphics(),f=a.getCurrentAnchor();a.setFeatures(b,{anchor:f});if(b=e.graphicsExtent(b))this._addClusterBoundary(b,
a),a.show(this._getPopupLocation(b,f));this._popupClusterGraphic=c})}])[0]},_getPopupLocation:function(a,c){var b=a.getCenter();c=c.toLowerCase();-1<c.indexOf("top")?b.update(b.x,a.ymax):-1<c.indexOf("bottom")?b.update(b.x,a.ymin):-1<c.indexOf("left")?b.update(a.xmin,b.y):b.update(a.xmax,b.y);return b},_createViewSummaryAction:function(){return this._map.infoWindow.addActions([{title:D.NLS_viewSummary,className:"viewSummary",callback:r.hitch(this,function(a){a.preventDefault();a=this._popupClusterGraphic;
var c=this._map.infoWindow;c.setFeatures([a]);c.show(a.geometry);this._popupClusterGraphic=null})}])[0]},_initClusterUpdates:function(){this._updateSizeVariable();this._updateClusterGraphics();this._eventHandles.push(this._clusterGenerator.on("update-end",r.hitch(this,function(a){a.mapLevelChange&&this._updateSizeVariable();this._updateClusterGraphics()})),this._clusterGenerator.on("index-complete",r.hitch(this,function(){this._updateSizeVariable()})))},_updateClusterGraphics:function(){this._hideSingleGraphics();
var a=[],c=[];p.forEach(this._clusterGenerator.clusters,function(b){var f=new l(b.centroid);f.setAggregationSourceLayer(this.layer);f.setAggregationInfo(b);this._applyClusterAttributes(f,b);1===b.count?(b=this._getSingleGraphic(f),c.push(b)):a.push(f)},this);this._showSingleGraphics(c);this._addGraphics(a)},_addGraphics:function(a){var c=this.container;c.clear();p.forEach(a,function(a){c.add(a)})},_getSingleGraphic:function(a){var c=this._clusterGenerator.getCell(a.getAggregationInfo().primary).features[0],
b=this.layer.renderer,b=b&&b.getSymbol(c),f=this._getSizeByCountVariable(this._renderer);b&&f&&(a=f?this._renderer.getSize(a,{sizeInfo:f,shape:b.style,resolution:this._map.getResolutionInMeters(),scale:this._map.getScale()}):null,c.setSize(a));return c},_showSingleGraphics:function(a){p.forEach(a,this._showSingleGraphic);this._singleGraphics=a},_hideSingleGraphics:function(){p.forEach(this._singleGraphics,function(a){a.setSize(null);this._hideSingleGraphic(a)},this);this._singleGraphics=null},_clearSingleGraphics:function(){p.forEach(this._singleGraphics,
function(a){a.setSize(null)});this._singleGraphics=null},_showSingleGraphic:function(a){a&&(a._suspended=!1,a.draw())},_hideSingleGraphic:function(a){a&&(a._suspended=!0,a.show(),a.draw())},_updateSizeVariable:function(){this.isClusteringEnabled()&&(this._updateSizeByCountVariable(),this.emit("renderer-change"))},_applyClusterAttributes:function(a,c){a.setAttributes(c.attributes)},_createLayerEventListeners:function(){var a=this.layer;this._eventHandles.push(a.on("visibility-change",r.hitch(this,
function(a){this.container.setVisibility(a.visible)})),a.on("scale-range-change",r.hitch(this,function(){this.container.setScaleRange(this.layer.minScale,this.layer.maxScale)})),a.on("renderer-change",r.hitch(this,function(){this._applyRenderer()})),a.on("info-template-change",r.hitch(this,function(){this._applyInfoTemplate()})))},_createMapEventListeners:function(){this._eventHandles.push(this._map.on("zoom-start",r.hitch(this,function(){this._removeClusterBoundary();this._removeFromPopup(this.container);
this._removeFromPopup(this.layer);this._resetClusterNav();this.container.clear();this._hideSingleGraphics()})))},_createPopupEventListeners:function(){var a=this._map.infoWindow;this._eventHandles.push(a.on("selection-change",r.hitch(this,function(){this._resetClusterNavPartial();var a=this._map.infoWindow.getSelectedFeature(),c=a&&a.getLayer();if(c){var b;c===this.container?(this._removeClusterBoundary(),b=this._createBrowseFeaturesAction()):c===this.layer&&a._suspended?(b=this._createViewSummaryAction(),
this._popupSingleGraphic=a,this._showSingleGraphic(a)):this._removeClusterBoundary();this._popupActions=b?[b]:null}})),a.on("clear-features",r.hitch(this,function(a){this._resetClusterNav();a.isIntermediate||this._removeClusterBoundary()})),a.on("hide",r.hitch(this,function(){this._popupSingleGraphic&&this._popupSingleGraphic.hide();this._clusterBoundary&&this._clusterBoundary.hide()})),a.on("show",r.hitch(this,function(){this._popupSingleGraphic&&this._popupSingleGraphic.show();this._clusterBoundary&&
this._clusterBoundary.show()})))},_destroyEventListeners:function(){p.forEach(this._eventHandles,function(a){a.remove()})}});m("extend-esri")&&r.setObject("layers.clustering.ClusterManager",t,g);return t})},"esri/dijit/PopupTemplate":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dojo/dom-construct ../kernel ../InfoTemplate ../PopupInfo ./PopupRenderer".split(" "),function(t,r,p,m,g,d,l,h){t=t([d,l],{declaredClass:"esri.dijit.PopupTemplate","-chains-":{constructor:"manual"},chartTheme:null,
constructor:function(d,e){r.mixin(this,e);this.initialize(d,e)},getTitle:function(d){var e;this.info&&(e=this.titleHasRelatedFields?"":this._getPopupValues(d,null,!0).title);return e||""},getContent:function(d){return this.info?(new h({template:this,graphic:d,chartTheme:this.chartTheme},m.create("div"))).domNode:""}});p("extend-esri")&&r.setObject("dijit.PopupTemplate",t,g);return t})},"esri/PopupInfo":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/json dojo/i18n dojo/has dojo/Deferred dojo/sniff dojo/promise/all dojox/html/entities ./lang ./kernel ./request ./promiseList ./tasks/query ./tasks/QueryTask ./tasks/RelationshipQuery ./tasks/StatisticDefinition ./support/expressionUtils ./layers/support/attributeUtils dojo/i18n!dojo/cldr/nls/number".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v,f,a,c,k,q,B,z,D){t=t(null,{declaredClass:"esri.PopupInfo",_reExprField:/^\s*expression\//i,_exprPrefix:"expression/",_relatedFieldPrefix:"relationships/",initialize:function(a,c){if(a){r.mixin(this,c);this.info=a;this.title=this.getTitle;this.content=this.getContent;this._exprCache=this._compileExpressions(this.info.expressionInfos);var b=this._fieldLabels={},f=this._fieldsMap={};this.info.fieldInfos&&p.forEach(this.info.fieldInfos,function(a){var c=a.fieldName.toLowerCase(),
e=this._isExpressionField(c)?this.getExpressionInfo(c):null;b[c]=e?e.title:a.label;f[c]=a},this);this.titleHasRelatedFields=!(!this.info.title||-1===this.info.title.indexOf("{"+this._relatedFieldPrefix))}},toJson:function(){return m.fromJson(m.toJson(this.info))},getTitle:function(){},getContent:function(){},getFieldInfo:function(a){var c;p.some(this.info&&this.info.fieldInfos,function(b){b.fieldName===a&&(c=b);return!!c});return c},getExpressionInfo:function(a){if(this._isExpressionField(a)){a=a.replace(this._reExprField,
"");a=a.toLowerCase();var c;p.some(this.info.expressionInfos,function(b){b.name.toLowerCase()===a&&(c=b);return!!c});return c}},hasGeometryOperations:function(){return p.some(this.info.expressionInfos,function(a){return B.hasGeometryOperations(a.expression)})},getComponents:function(a){var c=this.info,b={};c.fieldInfos&&(c=p.filter(c.fieldInfos,function(a){return-1!==a.fieldName.indexOf(this._relatedFieldPrefix)},this))&&0<c.length&&(b.relatedInfo=this._getRelatedRecords({graphic:a,fieldsInfo:c}));
this._needFullResolutionFeature(a)&&(b.fullResolutionFeature=this._getFullResolutionFeature(a));return f(b).then(r.hitch(this,function(c){return this._getPopupValues(a,c.fullResolutionFeature)}))},getAttachments:function(a){var c=a.getSourceLayer();a=a.attributes;if(this.info.showAttachments&&c&&c.hasAttachments&&c.objectIdField&&(a=a&&a[c.objectIdField]))return c.queryAttachmentInfos(a)},_needFullResolutionFeature:function(a){return(a=a.getSourceLayer())?"esriGeometryPoint"!==a.geometryType&&"function"===
typeof a.getMaxAllowableOffset&&0<a.getMaxAllowableOffset()&&this.hasGeometryOperations():!1},_getFullResolutionFeature:function(c){var b=c.getSourceLayer(),f=b.objectIdField;c=(c=c.attributes)&&f&&c[f];if(null==c)return null;var e=new a;e.objectIds=[c];e.maxAllowableOffset=0;e.outFields=[f];return b.queryFeatures(e).then(function(a){return a.features&&a.features[0]})},_isExpressionField:function(a){return this._reExprField.test(a)},_compileExpressions:function(a){var c={};p.forEach(a,function(a){var b=
a.returnType&&a.returnType.toLowerCase();c[a.name]=z.createAttributeCache({valueExpression:a.expression},"number"!==b)});return c},_fetchAttributes:function(a,c){var b=r.clone(a.attributes)||{},f=c&&c.geometry,d=this._exprPrefix,k=this._exprCache;p.forEach(this.info.expressionInfos,function(c){var q=d+c.name;c=(c=k[c.name])?a._getDataValue(c.attributeInfo,c,B,null,f):null;"string"===typeof c&&(c=e.encode(c));b[q]=c});return b},_getPopupValues:function(a,c,f){var e=this.info,d=a.getSourceLayer(),k=
this._fetchAttributes(a,c),q=r.clone(k);c=e.fieldInfos;var g="",h="",x,n,v,A,B,l=d&&d._getDateOpts&&d._getDateOpts().properties,l=l&&l.slice(0),y={dateFormat:{properties:l,formatter:"DateFormat"+this._insertOffset(this._dateFormats.shortDateShortTime)}};if(this._relatedInfo)for(A in this._relatedInfo)if(this._relatedInfo.hasOwnProperty(A)){var u=this._relatedInfo[A],m=this._relatedLayersInfo[A];u&&(p.forEach(u.relatedFeatures,function(a){for(B in a.attributes)if(a.attributes.hasOwnProperty(B)&&"esriRelCardinalityOneToOne"===
m.relation.cardinality){var c=this._toRelatedFieldName([m.relation.id,B]);k[c]=q[c]=a.attributes[B]}},this),p.forEach(u.relatedStatsFeatures,function(a){for(B in a.attributes)if(a.attributes.hasOwnProperty(B)){var c=this._toRelatedFieldName([m.relation.id,B]);k[c]=q[c]=a.attributes[B]}},this))}c&&p.forEach(c,function(a){n=a.fieldName;var c=this._getLayerFieldInfo(d,n);c&&(n=a.fieldName=c.name);q[n]=this._formatValue(q[n],n,y);l&&a.format&&a.format.dateFormat&&(a=p.indexOf(l,n),-1<a&&l.splice(a,1))},
this);if(d){A=d.types;var z=(u=d.typeIdField)&&k[u];for(n in k)if(k.hasOwnProperty(n)&&-1===n.indexOf(this._relatedFieldPrefix)&&(v=k[n],b.isDefined(v))){var t=this._getDomainName(d,a,A,z,n,v);b.isDefined(t)?q[n]=t:n===u&&(t=this._getTypeName(d,a,v),b.isDefined(t)&&(q[n]=t))}}e.title&&(g=this._processFieldsInLinks(this._fixTokens(e.title,d),k),g=r.trim(b.substitute(q,g,y)||""));if(f)return{title:g};e.description&&(h=this._processFieldsInLinks(this._fixTokens(e.description,d),k),h=r.trim(b.substitute(q,
h,y)||""));c&&(x=[],p.forEach(c,function(a){(n=a.fieldName)&&a.visible&&x.push([this._fieldLabels[n.toLowerCase()]||n,b.substitute(q,"${"+n+"}",y)||""])},this));var D,M;e.mediaInfos&&(D=[],p.forEach(e.mediaInfos,function(a){M=0;v=a.value;switch(a.type){case "image":var c=v.sourceURL,c=c&&r.trim(b.substitute(k,this._fixTokens(c,d)));M=!!c;break;case "piechart":case "linechart":case "columnchart":case "barchart":var f,c=v.normalizeField;v.fields=p.map(v.fields,function(a){return(f=this._getLayerFieldInfo(d,
a))?f.name:a},this);c&&(f=this._getLayerFieldInfo(d,c),v.normalizeField=f?f.name:c);M=p.some(v.fields,function(a){return b.isDefined(k[a])||-1!==a.indexOf(this._relatedFieldPrefix)&&this._relatedInfo},this);break;default:return}if(M){a=r.clone(a);v=a.value;var c=a.title?this._processFieldsInLinks(this._fixTokens(a.title,d),k):"",e=a.caption?this._processFieldsInLinks(this._fixTokens(a.caption,d),k):"";a.title=c?r.trim(b.substitute(q,c,y)||""):"";a.caption=e?r.trim(b.substitute(q,e,y)||""):"";if("image"===
a.type)v.sourceURL=b.substitute(k,this._fixTokens(v.sourceURL,d)),v.linkURL&&(v.linkURL=r.trim(b.substitute(k,this._fixTokens(v.linkURL,d))||""));else{var g,h;p.forEach(v.fields,function(a,c){if(-1!==a.indexOf(this._relatedFieldPrefix))h=this._getRelatedChartInfos(a,v,k,y),h instanceof Array?v.fields=h:v.fields[c]=h;else{var b=k[a],b=void 0===b?null:b;g=k[v.normalizeField]||0;b&&g&&(b/=g);v.fields[c]={y:b,tooltip:(this._fieldLabels[a.toLowerCase()]||a)+":\x3cbr/\x3e"+this._formatValue(b,a,y,!!g)}}},
this)}D.push(a)}},this));return{title:g,description:h,hasDescription:!!e.description,fields:x&&x.length?x:null,mediaInfos:D&&D.length?D:null,formatted:q,editSummary:d&&d.getEditSummary?d.getEditSummary(a):""}},_getRelatedChartInfos:function(a,c,f,e){var d,k,q,g,h,x;d=[];x=this._fromRelatedFieldName(a);h=x[0];k=this._relatedInfo[h];h=this._relatedLayersInfo[h];k&&p.forEach(k.relatedFeatures,function(k){k=k.attributes;var h,w;for(w in k)if(k.hasOwnProperty(w)&&w===x[1]){h={};g=k[w];c.normalizeField&&
(q=-1!==c.normalizeField.indexOf(this._relatedFieldPrefix)?k[this._fromRelatedFieldName(c.normalizeField)[1]]:f[c.normalizeField]);g&&q&&(g/=q);if(c.tooltipField)if(-1!==c.tooltipField.indexOf(this._relatedFieldPrefix)){var n=this._fromRelatedFieldName(c.tooltipField)[1],v=b.isDefined(k[n])?k[n]:n;h.tooltip=v+":\x3cbr/\x3e"+this._formatValue(g,n,e,!!q)}else h.tooltip=(this._fieldLabels[a.toLowerCase()]||a)+":\x3cbr/\x3e"+this._formatValue(g,c.tooltipField,e,!!q);else h.tooltip=g;h.y=g;d.push(h)}},
this);return"esriRelCardinalityOneToMany"===h.relation.cardinality||"esriRelCardinalityManyToMany"===h.relation.cardinality?d:d[0]},_dateFormats:{shortDate:"(datePattern: 'M/d/y', selector: 'date')",shortDateLE:"(datePattern: 'd/M/y', selector: 'date')",longMonthDayYear:"(datePattern: 'MMMM d, y', selector: 'date')",dayShortMonthYear:"(datePattern: 'd MMM y', selector: 'date')",longDate:"(datePattern: 'EEEE, MMMM d, y', selector: 'date')",shortDateShortTime:"(datePattern: 'M/d/y', timePattern: 'h:mm a', selector: 'date and time')",
shortDateLEShortTime:"(datePattern: 'd/M/y', timePattern: 'h:mm a', selector: 'date and time')",shortDateShortTime24:"(datePattern: 'M/d/y', timePattern: 'H:mm', selector: 'date and time')",shortDateLEShortTime24:"(datePattern: 'd/M/y', timePattern: 'H:mm', selector: 'date and time')",shortDateLongTime:"(datePattern: 'M/d/y', timePattern: 'h:mm:ss a', selector: 'date and time')",shortDateLELongTime:"(datePattern: 'd/M/y', timePattern: 'h:mm:ss a', selector: 'date and time')",shortDateLongTime24:"(datePattern: 'M/d/y', timePattern: 'H:mm:ss', selector: 'date and time')",
shortDateLELongTime24:"(datePattern: 'd/M/y', timePattern: 'H:mm:ss', selector: 'date and time')",longMonthYear:"(datePattern: 'MMMM y', selector: 'date')",shortMonthYear:"(datePattern: 'MMM y', selector: 'date')",year:"(datePattern: 'y', selector: 'date')"},_reHref:/href\s*=\s*\"([^\"]+)\"/ig,_reHrefApos:/href\s*=\s*\'([^\']+)\'/ig,_reEmptyHref:/^href\s*=\s*"\s*"$/i,_reEmptyHrefApos:/^href\s*=\s*'\s*'$/i,_fixTokens:function(a,c){var b=this;return a.replace(/(\{([^\{\r\n]+)\})/g,function(a,f,e){a=
b._getLayerFieldInfo(c,e);return"$"+(a?"{"+a.name+"}":f)})},_encodeAttributes:function(a){a=r.clone(a)||{};var c,b;for(c in a)(b=a[c])&&"string"===typeof b&&(b=encodeURIComponent(b).replace(/\'/g,"\x26apos;"),a[c]=b);return a},_processFieldsInLinks:function(a,c){var b=this._encodeAttributes(c),b=r.hitch(this,this._addValuesToHref,c,b);a&&(a=a.replace(this._reHref,b).replace(this._reHrefApos,b));return a},_addValuesToHref:function(a,c,f,e){e=e&&r.trim(e);f=b.substitute(e&&0===e.indexOf("${")?a:c,f);
this._reEmptyHref.test(f)?f='href\x3d"about:blank"':this._reEmptyHrefApos.test(f)&&(f="href\x3d'about:blank'");return f},_getLayerFieldInfo:function(a,c){return a&&a.getField?a.getField(c):null},_formatValue:function(a,c,f,e){var d=this._fieldsMap[c.toLowerCase()],k=d&&d.format;c=-1!==p.indexOf(f.dateFormat.properties,c);var q="number"===typeof a&&!c&&(!k||!k.dateFormat);if(!b.isDefined(a)||!d||!b.isDefined(k))return q?this._forceLTR(a):a;var g="",d=[],h=k.hasOwnProperty("places")||k.hasOwnProperty("digitSeparator"),
n=k.hasOwnProperty("digitSeparator")?k.digitSeparator:!0;if(h&&!c)g="NumberFormat",d.push("places: "+(b.isDefined(k.places)&&(!e||0<k.places)?Number(k.places):"Infinity")),d.length&&(g+="("+d.join(",")+")");else if(k.dateFormat)g="DateFormat"+this._insertOffset(this._dateFormats[k.dateFormat]||this._dateFormats.shortDateShortTime);else return q?this._forceLTR(a):a;var x=this._applyFormatting(a,g,f);h&&-1<a.constructor.toString().indexOf("Array")&&(x="",p.forEach(a,r.hitch(this,function(a,c){c&&(x+=
" ");x+=this._applyFormatting(a,g,f)})));h&&!n&&D.group&&(x=x.replace(new RegExp("\\"+D.group,"g"),""));c&&(x='\x3cspan class\x3d"esriDateValue"\x3e'+x+"\x3c/span\x3e");return q?this._forceLTR(x):x},_applyFormatting:function(a,c,f){return b.substitute({myKey:a},"${myKey:"+c+"}",f)||""},_forceLTR:function(a){var c=h("ie");return c&&10>=c?a:"\x3cspan class\x3d'esriNumericValue'\x3e"+a+"\x3c/span\x3e"},_insertOffset:function(a){a&&(a=b.isDefined(this.utcOffset)?a.replace(/\)\s*$/,", utcOffset:"+this.utcOffset+
")"):a);return a},_getDomainName:function(a,c,b,f,e,d){return(a=a.getDomain&&a.getDomain(e,{feature:c}))&&a.codedValues?a.getName(d):null},_getTypeName:function(a,c,b){return(a=a.getType&&a.getType(c))&&a.name},_getRelatedRecords:function(a){var c=a.graphic,b;this._relatedLayersInfoPromise||(this._relatedLayersInfoPromise=this._getRelatedLayersInfo(a).then(r.hitch(this,function(a){for(b in a)a.hasOwnProperty(b)&&a[b]&&(this._relatedLayersInfo[b].relatedLayerInfo=a[b])})));return this._relatedLayersInfoPromise.then(r.hitch(this,
function(){return this._queryRelatedLayers(c)})).then(r.hitch(this,function(a){this._setRelatedRecords(c,a);return a}))},_getRelatedLayersInfo:function(a){var c=a.fieldsInfo,b,f,e={};b=a.graphic.getSourceLayer();this._relatedLayersInfo||(this._relatedLayersInfo={});p.forEach(c,function(a){var c,f,e,d;c=this._fromRelatedFieldName(a.fieldName);f=c[0];c=c[1];f&&(!this._relatedLayersInfo[f]&&b&&b.relationships&&(p.some(b.relationships,function(a){if(a.id==f)return d=a,!0}),d&&(this._relatedLayersInfo[f]=
{relation:d,relatedFields:[],outStatistics:[]})),this._relatedLayersInfo[f]&&(this._relatedLayersInfo[f].relatedFields.push(c),a.statisticType&&(e=new q,e.statisticType=a.statisticType,e.onStatisticField=c,e.outStatisticFieldName=c,this._relatedLayersInfo[f].outStatistics.push(e))))},this);for(f in this._relatedLayersInfo)this._relatedLayersInfo.hasOwnProperty(f)&&this._relatedLayersInfo[f]&&(a=this._relatedLayersInfo[f].relation,a=b.url.replace(/[0-9]+$/,a.relatedTableId),this._relatedLayersInfo[f].relatedLayerUrl=
a,e[f]=v({url:a,content:{f:"json"},callbackParamName:"callback"}));return u(e)},_queryRelatedLayers:function(a){var c={},b;for(b in this._relatedLayersInfo)this._relatedLayersInfo.hasOwnProperty(b)&&(c[b]=this._queryRelatedLayer({graphic:a,relatedInfo:this._relatedLayersInfo[b]}));return u(c)},_queryRelatedLayer:function(b){var f,e,d,k,q,g,h,n,v,B,A,m,z;f=b.graphic;e=f.getSourceLayer();d=e.url.match(/[0-9]+$/g)[0];A=b.relatedInfo;B=A.relatedLayerInfo;m=A.relatedLayerUrl;b=A.relation;p.some(B.relationships,
function(a){if(a.relatedTableId===parseInt(d,10))return k=a,!0},this);k&&(q=new a,p.some(B.fields,function(a){if(a.name===k.keyField)return n=-1!==p.indexOf(["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],a.type)?"number":"string",!0}),k.relationshipTableId&&k.keyFieldInRelationshipTable?(z=new l,this._queryRelatedRecords(f,k).then(r.hitch(this,function(b){var d;(d=b[f.attributes[e.objectIdField]])?(b=p.map(d.features,function(a){return a.attributes[B.objectIdField]},
this),A.outStatistics&&0<A.outStatistics.length&&B.supportsStatistics&&(v=new a,v.objectIds=b,v.outFields=q.outFields,v.outStatistics=A.outStatistics),v&&(g=new c(m),g.execute(v).then(r.hitch(this,function(a){var c=[];c.push(d);c.push(a);z.resolve(c)})))):z.resolve()}))):(h="string"===n?k.keyField+"\x3d'"+f.attributes[b.keyField]+"'":k.keyField+"\x3d"+f.attributes[b.keyField],q.where=h,q.outFields=A.relatedFields,A.outStatistics&&0<A.outStatistics.length&&B.supportsStatistics&&(v=new a,v.where=q.where,
v.outFields=q.outFields,v.outStatistics=A.outStatistics),g=new c(m),h=[],h.push(g.execute(q)),v&&h.push(g.execute(v))));return h?u(h):z?z.promise:void 0},_setRelatedRecords:function(a,c){this._relatedInfo=[];for(var f in c)if(c.hasOwnProperty(f)&&c[f]){var e=c[f];this._relatedInfo[f]={};this._relatedInfo[f].relatedFeatures=e[0].features;b.isDefined(e[1])&&(this._relatedInfo[f].relatedStatsFeatures=e[1].features)}},_handlerErrorResponse:function(a,c){a.reject(c)},_fromRelatedFieldName:function(a){var c=
[];-1!==a.indexOf(this._relatedFieldPrefix)&&(a=a.split("/"),c=a.slice(1));return c},_toRelatedFieldName:function(a){var c="";a&&0<a.length&&(c=this._relatedFieldPrefix+a[0]+"/"+a[1]);return c},_queryRelatedRecords:function(a,c){var b=a.getSourceLayer(),f=new k;f.outFields=["*"];f.relationshipId=c.id;f.objectIds=[a.attributes[b.objectIdField]];return b.queryRelatedFeatures(f)}});d("extend-esri")&&(n.PopupInfo=n.PopupInfoTemplate=t);return t})},"dojox/html/entities":function(){define(["dojo/_base/lang"],
function(t){var r=t.getObject("dojox.html.entities",!0),p=function(g,d){var l,h;if(d._encCache&&d._encCache.regexp&&d._encCache.mapper&&d.length==d._encCache.length)l=d._encCache.mapper,h=d._encCache.regexp;else{l={};h=["["];var u;for(u=0;u<d.length;u++)l[d[u][0]]="\x26"+d[u][1]+";",h.push(d[u][0]);h.push("]");h=new RegExp(h.join(""),"g");d._encCache={mapper:l,regexp:h,length:d.length}}return g=g.replace(h,function(e){return l[e]})},m=function(g,d){var l,h;if(d._decCache&&d._decCache.regexp&&d._decCache.mapper&&
d.length==d._decCache.length)l=d._decCache.mapper,h=d._decCache.regexp;else{l={};h=["("];var u;for(u=0;u<d.length;u++){var e="\x26"+d[u][1]+";";u&&h.push("|");l[e]=d[u][0];h.push(e)}h.push(")");h=new RegExp(h.join(""),"g");d._decCache={mapper:l,regexp:h,length:d.length}}return g=g.replace(h,function(b){return l[b]})};r.html=[["\x26","amp"],['"',"quot"],["\x3c","lt"],["\x3e","gt"],["\u00a0","nbsp"]];r.latin=[["\u00a1","iexcl"],["\u00a2","cent"],["\u00a3","pound"],["\u20ac","euro"],["\u00a4","curren"],
["\u00a5","yen"],["\u00a6","brvbar"],["\u00a7","sect"],["\u00a8","uml"],["\u00a9","copy"],["\u00aa","ordf"],["\u00ab","laquo"],["\u00ac","not"],["\u00ad","shy"],["\u00ae","reg"],["\u00af","macr"],["\u00b0","deg"],["\u00b1","plusmn"],["\u00b2","sup2"],["\u00b3","sup3"],["\u00b4","acute"],["\u00b5","micro"],["\u00b6","para"],["\u00b7","middot"],["\u00b8","cedil"],["\u00b9","sup1"],["\u00ba","ordm"],["\u00bb","raquo"],["\u00bc","frac14"],["\u00bd","frac12"],["\u00be","frac34"],["\u00bf","iquest"],["\u00c0",
"Agrave"],["\u00c1","Aacute"],["\u00c2","Acirc"],["\u00c3","Atilde"],["\u00c4","Auml"],["\u00c5","Aring"],["\u00c6","AElig"],["\u00c7","Ccedil"],["\u00c8","Egrave"],["\u00c9","Eacute"],["\u00ca","Ecirc"],["\u00cb","Euml"],["\u00cc","Igrave"],["\u00cd","Iacute"],["\u00ce","Icirc"],["\u00cf","Iuml"],["\u00d0","ETH"],["\u00d1","Ntilde"],["\u00d2","Ograve"],["\u00d3","Oacute"],["\u00d4","Ocirc"],["\u00d5","Otilde"],["\u00d6","Ouml"],["\u00d7","times"],["\u00d8","Oslash"],["\u00d9","Ugrave"],["\u00da",
"Uacute"],["\u00db","Ucirc"],["\u00dc","Uuml"],["\u00dd","Yacute"],["\u00de","THORN"],["\u00df","szlig"],["\u00e0","agrave"],["\u00e1","aacute"],["\u00e2","acirc"],["\u00e3","atilde"],["\u00e4","auml"],["\u00e5","aring"],["\u00e6","aelig"],["\u00e7","ccedil"],["\u00e8","egrave"],["\u00e9","eacute"],["\u00ea","ecirc"],["\u00eb","euml"],["\u00ec","igrave"],["\u00ed","iacute"],["\u00ee","icirc"],["\u00ef","iuml"],["\u00f0","eth"],["\u00f1","ntilde"],["\u00f2","ograve"],["\u00f3","oacute"],["\u00f4",
"ocirc"],["\u00f5","otilde"],["\u00f6","ouml"],["\u00f7","divide"],["\u00f8","oslash"],["\u00f9","ugrave"],["\u00fa","uacute"],["\u00fb","ucirc"],["\u00fc","uuml"],["\u00fd","yacute"],["\u00fe","thorn"],["\u00ff","yuml"],["\u0192","fnof"],["\u0391","Alpha"],["\u0392","Beta"],["\u0393","Gamma"],["\u0394","Delta"],["\u0395","Epsilon"],["\u0396","Zeta"],["\u0397","Eta"],["\u0398","Theta"],["\u0399","Iota"],["\u039a","Kappa"],["\u039b","Lambda"],["\u039c","Mu"],["\u039d","Nu"],["\u039e","Xi"],["\u039f",
"Omicron"],["\u03a0","Pi"],["\u03a1","Rho"],["\u03a3","Sigma"],["\u03a4","Tau"],["\u03a5","Upsilon"],["\u03a6","Phi"],["\u03a7","Chi"],["\u03a8","Psi"],["\u03a9","Omega"],["\u03b1","alpha"],["\u03b2","beta"],["\u03b3","gamma"],["\u03b4","delta"],["\u03b5","epsilon"],["\u03b6","zeta"],["\u03b7","eta"],["\u03b8","theta"],["\u03b9","iota"],["\u03ba","kappa"],["\u03bb","lambda"],["\u03bc","mu"],["\u03bd","nu"],["\u03be","xi"],["\u03bf","omicron"],["\u03c0","pi"],["\u03c1","rho"],["\u03c2","sigmaf"],["\u03c3",
"sigma"],["\u03c4","tau"],["\u03c5","upsilon"],["\u03c6","phi"],["\u03c7","chi"],["\u03c8","psi"],["\u03c9","omega"],["\u03d1","thetasym"],["\u03d2","upsih"],["\u03d6","piv"],["\u2022","bull"],["\u2026","hellip"],["\u2032","prime"],["\u2033","Prime"],["\u203e","oline"],["\u2044","frasl"],["\u2118","weierp"],["\u2111","image"],["\u211c","real"],["\u2122","trade"],["\u2135","alefsym"],["\u2190","larr"],["\u2191","uarr"],["\u2192","rarr"],["\u2193","darr"],["\u2194","harr"],["\u21b5","crarr"],["\u21d0",
"lArr"],["\u21d1","uArr"],["\u21d2","rArr"],["\u21d3","dArr"],["\u21d4","hArr"],["\u2200","forall"],["\u2202","part"],["\u2203","exist"],["\u2205","empty"],["\u2207","nabla"],["\u2208","isin"],["\u2209","notin"],["\u220b","ni"],["\u220f","prod"],["\u2211","sum"],["\u2212","minus"],["\u2217","lowast"],["\u221a","radic"],["\u221d","prop"],["\u221e","infin"],["\u2220","ang"],["\u2227","and"],["\u2228","or"],["\u2229","cap"],["\u222a","cup"],["\u222b","int"],["\u2234","there4"],["\u223c","sim"],["\u2245",
"cong"],["\u2248","asymp"],["\u2260","ne"],["\u2261","equiv"],["\u2264","le"],["\u2265","ge"],["\u2282","sub"],["\u2283","sup"],["\u2284","nsub"],["\u2286","sube"],["\u2287","supe"],["\u2295","oplus"],["\u2297","otimes"],["\u22a5","perp"],["\u22c5","sdot"],["\u2308","lceil"],["\u2309","rceil"],["\u230a","lfloor"],["\u230b","rfloor"],["\u2329","lang"],["\u232a","rang"],["\u25ca","loz"],["\u2660","spades"],["\u2663","clubs"],["\u2665","hearts"],["\u2666","diams"],["\u0152","OElig"],["\u0153","oelig"],
["\u0160","Scaron"],["\u0161","scaron"],["\u0178","Yuml"],["\u02c6","circ"],["\u02dc","tilde"],["\u2002","ensp"],["\u2003","emsp"],["\u2009","thinsp"],["\u200c","zwnj"],["\u200d","zwj"],["\u200e","lrm"],["\u200f","rlm"],["\u2013","ndash"],["\u2014","mdash"],["\u2018","lsquo"],["\u2019","rsquo"],["\u201a","sbquo"],["\u201c","ldquo"],["\u201d","rdquo"],["\u201e","bdquo"],["\u2020","dagger"],["\u2021","Dagger"],["\u2030","permil"],["\u2039","lsaquo"],["\u203a","rsaquo"]];r.encode=function(g,d){g&&(d?
g=p(g,d):(g=p(g,r.html),g=p(g,r.latin)));return g};r.decode=function(g,d){g&&(d?g=m(g,d):(g=m(g,r.html),g=m(g,r.latin)));return g};return r})},"esri/tasks/RelationshipQuery":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/has","../kernel"],function(t,r,p,m,g){t=t(null,{declaredClass:"esri.tasks.RelationshipQuery",definitionExpression:"",relationshipId:null,returnGeometry:!1,objectIds:null,outSpatialReference:null,outFields:null,toJson:function(){var d={definitionExpression:this.definitionExpression,
relationshipId:this.relationshipId,returnGeometry:this.returnGeometry,maxAllowableOffset:this.maxAllowableOffset,geometryPrecision:this.geometryPrecision},g=this.objectIds,h=this.outFields,u=this.outSpatialReference;g&&(d.objectIds=g.join(","));h&&(d.outFields=h.join(","));u&&(d.outSR=u.wkid||p.toJson(u.toJson()));d._ts=this._ts;return d}});m("extend-esri")&&r.setObject("tasks.RelationshipQuery",t,g);return t})},"esri/dijit/PopupRenderer":function(){define("require dojo/_base/declare dojo/_base/connect dojo/_base/lang dojo/_base/array dojo/_base/kernel dojo/sniff dojo/query dojo/dom dojo/dom-attr dojo/dom-class dojo/dom-construct dojo/dom-style dojox/html/entities dijit/_Widget dijit/_Templated ../kernel ../lang ../urlUtils ./_EventedWidget dojo/i18n!../nls/jsapi dojo/NodeList-dom".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v,f,a,c,k,q,B,z,D){var A=0,x=D.widgets.popup,y=D.widgets.templatePicker;r=r([z,a,c],{declaredClass:"esri.dijit._PopupRenderer",constructor:function(){this._nls=m.mixin({},x)},templateString:"\x3cdiv class\x3d'esriViewPopup'\x3e\x3cdiv class\x3d'statusSection hidden' dojoAttachPoint\x3d'_status'\x3e\x3c/div\x3e\x3cdiv class\x3d'mainSection'\x3e\x3cdiv class\x3d'header' dojoAttachPoint\x3d'_title'\x3e\x3c/div\x3e\x3cdiv class\x3d'hzLine'\x3e\x3c/div\x3e\x3cdiv dojoAttachPoint\x3d'_description'\x3e\x3c/div\x3e\x3cdiv class\x3d'break'\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'attachmentsSection hidden'\x3e\x3cdiv\x3e${_nls.NLS_attach}:\x3c/div\x3e\x3cul dojoAttachPoint\x3d'_attachmentsList'\x3e\x3c/ul\x3e\x3cdiv class\x3d'break'\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'mediaSection hidden'\x3e\x3cdiv class\x3d'header' dojoAttachPoint\x3d'_mediaTitle'\x3e\x3c/div\x3e\x3cdiv class\x3d'hzLine'\x3e\x3c/div\x3e\x3cdiv class\x3d'caption' dojoAttachPoint\x3d'_mediaCaption'\x3e\x3c/div\x3e\x3cdiv class\x3d'gallery' dojoAttachPoint\x3d'_gallery'\x3e\x3cdiv class\x3d'mediaHandle prev' dojoAttachPoint\x3d'_prevMedia' dojoAttachEvent\x3d'onclick: _goToPrevMedia'\x3e\x3c/div\x3e\x3cdiv class\x3d'mediaHandle next' dojoAttachPoint\x3d'_nextMedia' dojoAttachEvent\x3d'onclick: _goToNextMedia'\x3e\x3c/div\x3e\x3cul class\x3d'summary'\x3e\x3cli class\x3d'image mediaCount hidden' dojoAttachPoint\x3d'_imageCount'\x3e0\x3c/li\x3e\x3cli class\x3d'image mediaIcon hidden'\x3e\x3c/li\x3e\x3cli class\x3d'chart mediaCount hidden' dojoAttachPoint\x3d'_chartCount'\x3e0\x3c/li\x3e\x3cli class\x3d'chart mediaIcon hidden'\x3e\x3c/li\x3e\x3c/ul\x3e\x3cdiv class\x3d'frame' dojoAttachPoint\x3d'_mediaFrame'\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d'editSummarySection hidden' dojoAttachPoint\x3d'_editSummarySection'\x3e\x3cdiv class\x3d'break'\x3e\x3c/div\x3e\x3cdiv class\x3d'break hidden' dojoAttachPoint\x3d'_mediaBreak'\x3e\x3c/div\x3e\x3cdiv class\x3d'editSummary' dojoAttachPoint\x3d'_editSummary'\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e",
showTitle:!0,startup:function(){this.inherited(arguments);this._showStatus(y.loading);this._contentDfd=this.template.getComponents(this.graphic).then(m.hitch(this,this._handleComponentsSuccess)).otherwise(m.hitch(this,this._handleComponentsError))},destroy:function(){this._contentDfd&&this._contentDfd.cancel();this._attachmentsDfd&&this._attachmentsDfd.cancel();this._destroyFrame();this.template=this.graphic=this._nls=this._mediaInfos=this._mediaPtr=this._contentDfd=this._attachmentsDfd=null;this.inherited(arguments)},
_goToPrevMedia:function(){0>this._mediaPtr-1||(this._mediaPtr--,this._updateUI(),this._displayMedia())},_goToNextMedia:function(){this._mediaPtr+1!==this._mediaInfos.length&&(this._mediaPtr++,this._updateUI(),this._displayMedia())},_updateUI:function(){var a=this._mediaInfos,c=a.length,f=this.domNode,k=this._prevMedia,q=this._nextMedia;if(1<c){var h=0,n=0;g.forEach(a,function(a){"image"===a.type?h++:-1!==a.type.indexOf("chart")&&n++});h&&(e.set(this._imageCount,"innerHTML",h),d.query(".summary .image",
f).removeClass("hidden"));n&&(e.set(this._chartCount,"innerHTML",n),d.query(".summary .chart",f).removeClass("hidden"))}else d.query(".summary",f).addClass("hidden"),b.add(k,"hidden"),b.add(q,"hidden");a=this._mediaPtr;0===a?b.add(k,"hidden"):b.remove(k,"hidden");a===c-1?b.add(q,"hidden"):b.remove(q,"hidden");this._destroyFrame()},_displayMedia:function(){var a=this._mediaInfos[this._mediaPtr],c=a.title,f=a.caption,k=d.query(".mediaSection .hzLine",this.domNode)[0];e.set(this._mediaTitle,"innerHTML",
c);b[c?"remove":"add"](this._mediaTitle,"hidden");e.set(this._mediaCaption,"innerHTML",f);b[f?"remove":"add"](this._mediaCaption,"hidden");b[c&&f?"remove":"add"](k,"hidden");this._rid=null;if("image"===a.type)this._showImage(a);else{var q=this,c=["dojox/charting/Chart2D","dojox/charting/action2d/Tooltip"],f=a.value.theme||this.chartTheme;m.isString(f)&&(f=f.replace(/\./gi,"/"),-1===f.indexOf("/")&&(f="dojox/charting/themes/"+f));f||(f="./Rainbow");c.push(f);try{var g=this._rid=A++;t(c,function(c,
b,f){g===q._rid&&(q._rid=null,q._showChart(a.type,a.value,c,b,f))})}catch(O){console.log("PopupRenderer: error loading modules")}}},_preventNewTab:function(a){return(a=a&&m.trim(a).toLowerCase())&&(0===a.indexOf("mailto:")||0===a.indexOf("tel:"))},_showImage:function(a){b.add(this._mediaFrame,"image");var c=v.get(this._gallery,"height"),f=a.value,e;f.linkURL&&(e=n.create("a",{href:f.linkURL,target:this._preventNewTab(f.linkURL)?"":"_blank"},this._mediaFrame));f=a.refreshInterval?this._addURLParameter(f.sourceURL,
"timestamp",Date.now()):f.sourceURL;n.create("img",{className:"esriPopupMediaImage",src:f},e||this._mediaFrame);var k=d.query(".esriPopupMediaImage",this._mediaFrame)[0];this._imageLoadHandle=p.connect(k,"onload",this,function(){this._clearImageHandles();this._imageLoaded(k,c);this._initImageRefresh(a)})},_addURLParameter:function(a,c,b){var f=-1===a.indexOf("?")?"?":"\x26";return a+f+c+"\x3d"+b},_initImageRefresh:function(a){if(a.refreshInterval){var c=6E4*a.refreshInterval;this._imageRefreshHandle=
setTimeout(m.hitch(this,function(){this._destroyFrame();this._showImage(a)}),c)}},_clearImageHandles:function(){p.disconnect(this._imageLoadHandle);this._imageLoadHandle=null;clearTimeout(this._imageRefreshHandle);this._imageRefreshHandle=null},_showChart:function(a,c,f,e,d){b.remove(this._mediaFrame,"image");f=this._chart=new f(n.create("div",{"class":"chart"},this._mediaFrame),{margins:{l:4,t:4,r:4,b:4}});d&&f.setTheme(d);switch(a){case "piechart":f.addPlot("default",{type:"Pie",labels:!1});f.addSeries("Series A",
c.fields);break;case "linechart":f.addPlot("default",{type:"Markers"});f.addAxis("x",{min:0,majorTicks:!1,minorTicks:!1,majorLabels:!1,minorLabels:!1});f.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});g.forEach(c.fields,function(a,c){a.x=c+1});f.addSeries("Series A",c.fields);break;case "columnchart":f.addPlot("default",{type:"Columns",gap:3});f.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});f.addSeries("Series A",c.fields);break;case "barchart":f.addPlot("default",{type:"Bars",
gap:3}),f.addAxis("x",{includeZero:!0,fixUpper:"minor",minorLabels:!1}),f.addAxis("y",{vertical:!0,majorTicks:!1,minorTicks:!1,majorLabels:!1,minorLabels:!1}),f.addSeries("Series A",c.fields)}this._action=new e(f);f.render()},_destroyFrame:function(){this._rid=null;this._clearImageHandles();this._chart&&(this._chart.destroy(),this._chart=null);this._action&&(this._action.destroy(),this._action=null);e.set(this._mediaFrame,"innerHTML","")},_imageLoaded:function(a,c){var b=a.height;b<c&&v.set(a,"marginTop",
Math.round((c-b)/2)+"px")},_attListHandler:function(a,c){if(a===this._attachmentsDfd){this._attachmentsDfd=null;var b="";c instanceof Error||!c||!c.length||g.forEach(c,function(a){b+="\x3cli\x3e";b+="\x3ca href\x3d'"+B.addProxy(a.url)+"' target\x3d'_blank'\x3e"+(a.name||"[No name]")+"\x3c/a\x3e";b+="\x3c/li\x3e"});e.set(this._attachmentsList,"innerHTML",b||"\x3cli\x3e"+this._nls.NLS_noAttach+"\x3c/li\x3e")}},_supportedURIInfos:[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,label:x.NLS_moreInfo},{pattern:/^\s*(tel:([^\s]+))\s*$/i,
label:"${hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"${hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,appName:"App Studio Player",label:x.NLS_openLinkInApp},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,appName:"Collector",label:x.NLS_openLinkInApp},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,appName:"Explorer",label:x.NLS_openLinkInApp},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,appName:"Navigator",label:x.NLS_openLinkInApp},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,
appName:"Survey123",label:x.NLS_openLinkInApp},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,appName:"Trek2There",label:x.NLS_openLinkInApp},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,appName:"Workforce",label:x.NLS_openLinkInApp},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,appName:"iForm",label:x.NLS_openLinkInApp},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,appName:"FlowFinity",label:x.NLS_openLinkInApp},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,appName:"Laserfische",label:x.NLS_openLinkInApp},
{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,appName:"Microsoft Power BI",label:x.NLS_openLinkInApp}],_findURIInfo:function(a){var c;g.some(this._supportedURIInfos,function(b){b.pattern.test(a)&&(c=b);return!!c});return c},_createLinkIfURI:function(a){var c=this._findURIInfo(a);if(c){var b=a.match(c.pattern);return a.replace(c.pattern,"\x3ca target\x3d'_blank' href\x3d'$1' title\x3d'$1'\x3e"+q.substitute({appName:c.appName,hierPart:b&&b[2]},c.label)+"\x3c/a\x3e")}return a},_showStatus:function(a){e.set(this._status,
"innerHTML",a);b.remove(this._status,"hidden");d.query(".mainSection",this.domNode).addClass("hidden")},_hideStatus:function(){e.set(this._status,"innerHTML","");b.add(this._status,"hidden");d.query(".mainSection",this.domNode).removeClass("hidden")},_handleComponentsSuccess:function(a){if(a){this._hideStatus();var c=this.showTitle?a.title:"",k=a.description,q=a.fields,h=a.mediaInfos,n=this.domNode,v=this._nls,B=this,l=this.template,A=this.graphic;this._prevMedia.title=v.NLS_prevMedia;this._nextMedia.title=
v.NLS_nextMedia;e.set(this._title,"innerHTML",c);c||b.add(this._title,"hidden");!a.hasDescription&&q&&(k="",g.forEach(q,function(a){k+="\x3ctr valign\x3d'top'\x3e";k+="\x3ctd class\x3d'attrName'\x3e"+f.encode(a[0])+"\x3c/td\x3e";k+="\x3ctd class\x3d'attrValue'\x3e"+this._createLinkIfURI(a[1])+"\x3c/td\x3e";k+="\x3c/tr\x3e"},this),k&&(k="\x3ctable class\x3d'attrTable' cellpadding\x3d'0px' cellspacing\x3d'0px'\x3e"+k+"\x3c/table\x3e"));e.set(this._description,"innerHTML",k);k||b.add(this._description,
"hidden");d.query("a",this._description).forEach(function(a){B._preventNewTab(a.href)?"_blank"===a.target&&e.remove(a,"target"):e.set(a,"target","_blank")});c&&k?d.query(".mainSection .hzLine",n).removeClass("hidden"):c||k?d.query(".mainSection .hzLine",n).addClass("hidden"):d.query(".mainSection",n).addClass("hidden");if(c=this._attachmentsDfd=l.getAttachments(A))c.addBoth(m.hitch(this,this._attListHandler,c)),e.set(this._attachmentsList,"innerHTML","\x3cli\x3e"+v.NLS_searching+"...\x3c/li\x3e"),
d.query(".attachmentsSection",n).removeClass("hidden");h&&h.length&&(d.query(".mediaSection",n).removeClass("hidden"),u.setSelectable(this._mediaFrame,!1),this._mediaInfos=h,this._mediaPtr=0,this._updateUI(),this._displayMedia());a.editSummary&&(e.set(this._editSummary,"innerHTML",a.editSummary),h&&h.length&&b.remove(this._mediaBreak,"hidden"),b.remove(this._editSummarySection,"hidden"));this.emit("content-update")}else this._showStatus(x.NLS_noInfo)},_handleComponentsError:function(a){a&&"cancel"===
a.dojoType||(console.log("PopupRenderer: error loading template",a),this._showStatus(x.NLS_noInfo))}});l("extend-esri")&&m.setObject("dijit._PopupRenderer",r,k);return r})},"dijit/_Widget":function(){define("dojo/aspect dojo/_base/config dojo/_base/connect dojo/_base/declare dojo/has dojo/_base/kernel dojo/_base/lang dojo/query dojo/ready ./registry ./_WidgetBase ./_OnDijitClickMixin ./_FocusMixin dojo/uacss ./hccss".split(" "),function(t,r,p,m,g,d,l,h,u,e,b,n,v){function f(){}function a(a){return function(c,
b,e,d){return c&&"string"==typeof b&&c[b]==f?c.on(b.substring(2).toLowerCase(),l.hitch(e,d)):a.apply(p,arguments)}}t.around(p,"connect",a);d.connect&&t.around(d,"connect",a);t=m("dijit._Widget",[b,n,v],{onClick:f,onDblClick:f,onKeyDown:f,onKeyPress:f,onKeyUp:f,onMouseDown:f,onMouseMove:f,onMouseOut:f,onMouseOver:f,onMouseLeave:f,onMouseEnter:f,onMouseUp:f,constructor:function(a){this._toConnect={};for(var c in a)this[c]===f&&(this._toConnect[c.replace(/^on/,"").toLowerCase()]=a[c],delete a[c])},postCreate:function(){this.inherited(arguments);
for(var a in this._toConnect)this.on(a,this._toConnect[a]);delete this._toConnect},on:function(a,b){return this[this._onMap(a)]===f?p.connect(this.domNode,a.toLowerCase(),this,b):this.inherited(arguments)},_setFocusedAttr:function(a){this._focused=a;this._set("focused",a)},setAttribute:function(a,b){d.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(a,b)},attr:function(a,b){return 2<=arguments.length||"object"===typeof a?this.set.apply(this,
arguments):this.get(a)},getDescendants:function(){d.deprecated(this.declaredClass+"::getDescendants() is deprecated. Use getChildren() instead.","","2.0");return this.containerNode?h("[widgetId]",this.containerNode).map(e.byNode):[]},_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return!0}});g("dijit-legacy-requires")&&u(0,function(){require(["dijit/_base"])});return t})},"dijit/_WidgetBase":function(){define("require dojo/_base/array dojo/aspect dojo/_base/config dojo/_base/connect dojo/_base/declare dojo/dom dojo/dom-attr dojo/dom-class dojo/dom-construct dojo/dom-geometry dojo/dom-style dojo/has dojo/_base/kernel dojo/_base/lang dojo/on dojo/ready dojo/Stateful dojo/topic dojo/_base/window ./Destroyable dojo/has!dojo-bidi?./_BidiMixin ./registry".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v,f,a,c,k,q,B,z,D,A,x){function y(a){return function(c){h[c?"set":"remove"](this.domNode,a,c);this._set(a,c)}}v.add("dijit-legacy-requires",!f.isAsync);v.add("dojo-bidi",!1);v("dijit-legacy-requires")&&k(0,function(){t(["dijit/_base/manager"])});var G={};m=d("dijit._WidgetBase",[q,D],{id:"",_setIdAttr:"domNode",lang:"",_setLangAttr:y("lang"),dir:"",_setDirAttr:y("dir"),"class":"",_setClassAttr:{node:"domNode",type:"class"},_setTypeAttr:null,style:"",title:"",tooltip:"",
baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,ownerDocument:null,_setOwnerDocumentAttr:function(a){this._set("ownerDocument",a)},attributeMap:{},_blankGif:m.blankGif||t.toUrl("dojo/resources/blank.gif"),textDir:"",_introspect:function(){var a=this.constructor;if(!a._setterAttrs){var c=a.prototype,b=a._setterAttrs=[],a=a._onMap={},f;for(f in c.attributeMap)b.push(f);for(f in c)/^on/.test(f)&&(a[f.substring(2).toLowerCase()]=f),/^_set[A-Z](.*)Attr$/.test(f)&&(f=f.charAt(4).toLowerCase()+
f.substr(5,f.length-9),c.attributeMap&&f in c.attributeMap||b.push(f))}},postscript:function(a,c){this.create(a,c)},create:function(c,b){this._introspect();this.srcNodeRef=l.byId(b);this._connects=[];this._supportingWidgets=[];this.srcNodeRef&&this.srcNodeRef.id&&"string"==typeof this.srcNodeRef.id&&(this.id=this.srcNodeRef.id);c&&(this.params=c,a.mixin(this,c));this.postMixInProperties();this.id||(this.id=x.getUniqueId(this.declaredClass.replace(/\./g,"_")),this.params&&delete this.params.id);this.ownerDocument=
this.ownerDocument||(this.srcNodeRef?this.srcNodeRef.ownerDocument:document);this.ownerDocumentBody=z.body(this.ownerDocument);x.add(this);this.buildRendering();var f;if(this.domNode){this._applyAttributes();var e=this.srcNodeRef;e&&e.parentNode&&this.domNode!==e&&(e.parentNode.replaceChild(this.domNode,e),f=!0);this.domNode.setAttribute("widgetId",this.id)}this.postCreate();f&&delete this.srcNodeRef;this._created=!0},_applyAttributes:function(){var a={},c;for(c in this.params||{})a[c]=this._get(c);
r.forEach(this.constructor._setterAttrs,function(c){if(!(c in a)){var b=this._get(c);b&&this.set(c,b)}},this);for(c in a)this.set(c,a[c])},postMixInProperties:function(){},buildRendering:function(){this.domNode||(this.domNode=this.srcNodeRef||this.ownerDocument.createElement("div"));if(this.baseClass){var a=this.baseClass.split(" ");this.isLeftToRight()||(a=a.concat(r.map(a,function(a){return a+"Rtl"})));u.add(this.domNode,a)}},postCreate:function(){},startup:function(){this._started||(this._started=
!0,r.forEach(this.getChildren(),function(c){c._started||c._destroyed||!a.isFunction(c.startup)||(c.startup(),c._started=!0)}))},destroyRecursive:function(a){this._beingDestroyed=!0;this.destroyDescendants(a);this.destroy(a)},destroy:function(c){function b(a){a.destroyRecursive?a.destroyRecursive(c):a.destroy&&a.destroy(c)}this._beingDestroyed=!0;this.uninitialize();r.forEach(this._connects,a.hitch(this,"disconnect"));r.forEach(this._supportingWidgets,b);this.domNode&&r.forEach(x.findWidgets(this.domNode,
this.containerNode),b);this.destroyRendering(c);x.remove(this.id);this._destroyed=!0},destroyRendering:function(a){this.bgIframe&&(this.bgIframe.destroy(a),delete this.bgIframe);this.domNode&&(a?h.remove(this.domNode,"widgetId"):e.destroy(this.domNode),delete this.domNode);this.srcNodeRef&&(a||e.destroy(this.srcNodeRef),delete this.srcNodeRef)},destroyDescendants:function(a){r.forEach(this.getChildren(),function(c){c.destroyRecursive&&c.destroyRecursive(a)})},uninitialize:function(){return!1},_setStyleAttr:function(c){var b=
this.domNode;a.isObject(c)?n.set(b,c):b.style.cssText=b.style.cssText?b.style.cssText+("; "+c):c;this._set("style",c)},_attrToDom:function(c,b,f){f=3<=arguments.length?f:this.attributeMap[c];r.forEach(a.isArray(f)?f:[f],function(f){var e=this[f.node||f||"domNode"];switch(f.type||"attribute"){case "attribute":a.isFunction(b)&&(b=a.hitch(this,b));f=f.attribute?f.attribute:/^on[A-Z][a-zA-Z]*$/.test(c)?c.toLowerCase():c;e.tagName?h.set(e,f,b):e.set(f,b);break;case "innerText":e.innerHTML="";e.appendChild(this.ownerDocument.createTextNode(b));
break;case "innerHTML":e.innerHTML=b;break;case "class":u.replace(e,b,this[c]);break;case "toggleClass":u.toggle(e,f.className||c,b)}},this)},get:function(a){var c=this._getAttrNames(a);return this[c.g]?this[c.g]():this._get(a)},set:function(c,b){if("object"===typeof c){for(var f in c)this.set(f,c[f]);return this}f=this._getAttrNames(c);var e=this[f.s];if(a.isFunction(e))var d=e.apply(this,Array.prototype.slice.call(arguments,1));else{var e=this.focusNode&&!a.isFunction(this.focusNode)?"focusNode":
"domNode",k=this[e]&&this[e].tagName,q;if((q=k)&&!(q=G[k])){q=this[e];var g={},h;for(h in q)g[h.toLowerCase()]=!0;q=G[k]=g}h=q;f=c in this.attributeMap?this.attributeMap[c]:f.s in this?this[f.s]:h&&f.l in h&&"function"!=typeof b||/^aria-|^data-|^role$/.test(c)?e:null;null!=f&&this._attrToDom(c,b,f);this._set(c,b)}return d||this},_attrPairNames:{},_getAttrNames:function(a){var c=this._attrPairNames;if(c[a])return c[a];var b=a.replace(/^[a-z]|-[a-zA-Z]/g,function(a){return a.charAt(a.length-1).toUpperCase()});
return c[a]={n:a+"Node",s:"_set"+b+"Attr",g:"_get"+b+"Attr",l:b.toLowerCase()}},_set:function(a,c){var b=this[a];this[a]=c;!this._created||b===c||b!==b&&c!==c||(this._watchCallbacks&&this._watchCallbacks(a,b,c),this.emit("attrmodified-"+a,{detail:{prevValue:b,newValue:c}}))},_get:function(a){return this[a]},emit:function(a,b,f){b=b||{};void 0===b.bubbles&&(b.bubbles=!0);void 0===b.cancelable&&(b.cancelable=!0);b.detail||(b.detail={});b.detail.widget=this;var e,d=this["on"+a];d&&(e=d.apply(this,f?
f:[b]));this._started&&!this._beingDestroyed&&c.emit(this.domNode,a.toLowerCase(),b);return e},on:function(a,b){var f=this._onMap(a);return f?p.after(this,f,b,!0):this.own(c(this.domNode,a,b))[0]},_onMap:function(a){var c=this.constructor,b=c._onMap;if(!b){var b=c._onMap={},f;for(f in c.prototype)/^on/.test(f)&&(b[f.replace(/^on/,"").toLowerCase()]=f)}return b["string"==typeof a&&a.toLowerCase()]},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getChildren:function(){return this.containerNode?
x.findWidgets(this.containerNode):[]},getParent:function(){return x.getEnclosingWidget(this.domNode.parentNode)},connect:function(a,c,b){return this.own(g.connect(a,c,this,b))[0]},disconnect:function(a){a.remove()},subscribe:function(c,b){return this.own(B.subscribe(c,a.hitch(this,b)))[0]},unsubscribe:function(a){a.remove()},isLeftToRight:function(){return this.dir?"ltr"==this.dir.toLowerCase():b.isBodyLtr(this.ownerDocument)},isFocusable:function(){return this.focus&&"none"!=n.get(this.domNode,"display")},
placeAt:function(a,c){var b=!a.tagName&&x.byId(a);!b||!b.addChild||c&&"number"!==typeof c?(b=b&&"domNode"in b?b.containerNode&&!/after|before|replace/.test(c||"")?b.containerNode:b.domNode:l.byId(a,this.ownerDocument),e.place(this.domNode,b,c),!this._started&&(this.getParent()||{})._started&&this.startup()):b.addChild(this,c);return this},defer:function(c,b){var f=setTimeout(a.hitch(this,function(){f&&(f=null,this._destroyed||a.hitch(this,c)())}),b||0);return{remove:function(){f&&(clearTimeout(f),
f=null);return null}}}});v("dojo-bidi")&&m.extend(A);return m})},"dijit/Destroyable":function(){define(["dojo/_base/array","dojo/aspect","dojo/_base/declare"],function(t,r,p){return p("dijit.Destroyable",null,{destroy:function(m){this._destroyed=!0},own:function(){var m=["destroyRecursive","destroy","remove"];t.forEach(arguments,function(g){function d(){h.remove();t.forEach(u,function(e){e.remove()})}var l,h=r.before(this,"destroy",function(e){g[l](e)}),u=[];g.then?(l="cancel",g.then(d,d)):t.forEach(m,
function(e){"function"===typeof g[e]&&(l||(l=e),u.push(r.after(g,e,d,!0)))})},this);return arguments}})})},"dijit/_OnDijitClickMixin":function(){define("dojo/on dojo/_base/array dojo/keys dojo/_base/declare dojo/has ./a11yclick".split(" "),function(t,r,p,m,g,d){t=m("dijit._OnDijitClickMixin",null,{connect:function(g,h,u){return this.inherited(arguments,[g,"ondijitclick"==h?d:h,u])}});t.a11yclick=d;return t})},"dijit/_FocusMixin":function(){define(["./focus","./_WidgetBase","dojo/_base/declare","dojo/_base/lang"],
function(t,r,p,m){m.extend(r,{focused:!1,onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus()},_onBlur:function(){this.onBlur()}});return p("dijit._FocusMixin",null,{_focusManager:t})})},"dijit/hccss":function(){define(["dojo/dom-class","dojo/hccss","dojo/domReady","dojo/_base/window"],function(t,r,p,m){p(function(){r("highcontrast")&&t.add(m.body(),"dijit_a11y")});return r})},"dojo/hccss":function(){define("require ./_base/config ./dom-class ./dom-style ./has ./domReady ./_base/window".split(" "),
function(t,r,p,m,g,d,l){g.add("highcontrast",function(){var d=l.doc.createElement("div");try{d.style.cssText='border: 1px solid; border-color:red green; position: absolute; height: 5px; top: -999px;background-image: url("'+(r.blankGif||t.toUrl("./resources/blank.gif"))+'");';l.body().appendChild(d);var u=m.getComputedStyle(d),e=u.backgroundImage;return u.borderTopColor==u.borderRightColor||e&&("none"==e||"url(invalid-url:)"==e)}catch(b){return console.warn("hccss: exception detecting high-contrast mode, document is likely hidden: "+
b.toString()),!1}finally{8>=g("ie")?d.outerHTML="":l.body().removeChild(d)}});d(function(){g("highcontrast")&&p.add(l.body(),"dj_a11y")});return g})},"dijit/_Templated":function(){define("./_WidgetBase ./_TemplatedMixin ./_WidgetsInTemplateMixin dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/_base/kernel".split(" "),function(t,r,p,m,g,d,l){d.extend(t,{waiRole:"",waiState:""});return g("dijit._Templated",[r,p],{constructor:function(){l.deprecated(this.declaredClass+": dijit._Templated deprecated, use dijit._TemplatedMixin and if necessary dijit._WidgetsInTemplateMixin",
"","2.0")},_processNode:function(d,g){var e=this.inherited(arguments),b=g(d,"waiRole");b&&d.setAttribute("role",b);(b=g(d,"waiState"))&&m.forEach(b.split(/\s*,\s*/),function(b){-1!=b.indexOf("-")&&(b=b.split("-"),d.setAttribute("aria-"+b[0],b[1]))});return e}})})},"dijit/_TemplatedMixin":function(){define("dojo/cache dojo/_base/declare dojo/dom-construct dojo/_base/lang dojo/on dojo/sniff dojo/string ./_AttachMixin".split(" "),function(t,r,p,m,g,d,l,h){var u=r("dijit._TemplatedMixin",h,{templateString:null,
templatePath:null,_skipNodeCache:!1,searchContainerNode:!0,_stringRepl:function(e){var b=this.declaredClass,d=this;return l.substitute(e,this,function(e,f){"!"==f.charAt(0)&&(e=m.getObject(f.substr(1),!1,d));if("undefined"==typeof e)throw Error(b+" template:"+f);return null==e?"":"!"==f.charAt(0)?e:this._escapeValue(""+e)},this)},_escapeValue:function(e){return e.replace(/["'<>&]/g,function(b){return{"\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;",'"':"\x26quot;","'":"\x26#x27;"}[b]})},buildRendering:function(){if(!this._rendered){this.templateString||
(this.templateString=t(this.templatePath,{sanitize:!0}));var e=u.getCachedTemplate(this.templateString,this._skipNodeCache,this.ownerDocument),b;if(m.isString(e)){if(b=p.toDom(this._stringRepl(e),this.ownerDocument),1!=b.nodeType)throw Error("Invalid template: "+e);}else b=e.cloneNode(!0);this.domNode=b}this.inherited(arguments);this._rendered||this._fillContent(this.srcNodeRef);this._rendered=!0},_fillContent:function(e){var b=this.containerNode;if(e&&b)for(;e.hasChildNodes();)b.appendChild(e.firstChild)}});
u._templateCache={};u.getCachedTemplate=function(e,b,d){var g=u._templateCache,f=e,a=g[f];if(a){try{if(!a.ownerDocument||a.ownerDocument==(d||document))return a}catch(c){}p.destroy(a)}e=l.trim(e);if(b||e.match(/\$\{([^\}]+)\}/g))return g[f]=e;b=p.toDom(e,d);if(1!=b.nodeType)throw Error("Invalid template: "+e);return g[f]=b};d("ie")&&g(window,"unload",function(){var e=u._templateCache,b;for(b in e){var d=e[b];"object"==typeof d&&p.destroy(d);delete e[b]}});return u})},"dojo/cache":function(){define(["./_base/kernel",
"./text"],function(t){return t.cache})},"dijit/_AttachMixin":function(){define("require dojo/_base/array dojo/_base/connect dojo/_base/declare dojo/_base/lang dojo/mouse dojo/on dojo/touch ./_WidgetBase".split(" "),function(t,r,p,m,g,d,l,h,u){var e=g.delegate(h,{mouseenter:d.enter,mouseleave:d.leave,keypress:p._keypress}),b;p=m("dijit._AttachMixin",null,{constructor:function(){this._attachPoints=[];this._attachEvents=[]},buildRendering:function(){this.inherited(arguments);this._attachTemplateNodes(this.domNode);
this._beforeFillContent()},_beforeFillContent:function(){},_attachTemplateNodes:function(b){for(var e=b;;)if(1==e.nodeType&&(this._processTemplateNode(e,function(b,a){return b.getAttribute(a)},this._attach)||this.searchContainerNode)&&e.firstChild)e=e.firstChild;else{if(e==b)break;for(;!e.nextSibling;)if(e=e.parentNode,e==b)return;e=e.nextSibling}},_processTemplateNode:function(b,e,f){var a=!0,c=this.attachScope||this,d=e(b,"dojoAttachPoint")||e(b,"data-dojo-attach-point");if(d)for(var q=d.split(/\s*,\s*/);d=
q.shift();)g.isArray(c[d])?c[d].push(b):c[d]=b,a="containerNode"!=d,this._attachPoints.push(d);if(e=e(b,"dojoAttachEvent")||e(b,"data-dojo-attach-event"))for(d=e.split(/\s*,\s*/),q=g.trim;e=d.shift();)if(e){var h=null;-1!=e.indexOf(":")?(h=e.split(":"),e=q(h[0]),h=q(h[1])):e=q(e);h||(h=e);this._attachEvents.push(f(b,e,g.hitch(c,h)))}return a},_attach:function(d,g,f){g=g.replace(/^on/,"").toLowerCase();g="dijitclick"==g?b||(b=t("./a11yclick")):e[g]||g;return l(d,g,f)},_detachTemplateNodes:function(){var b=
this.attachScope||this;r.forEach(this._attachPoints,function(e){delete b[e]});this._attachPoints=[];r.forEach(this._attachEvents,function(b){b.remove()});this._attachEvents=[]},destroyRendering:function(){this._detachTemplateNodes();this.inherited(arguments)}});g.extend(u,{dojoAttachEvent:"",dojoAttachPoint:""});return p})},"dijit/_WidgetsInTemplateMixin":function(){define(["dojo/_base/array","dojo/aspect","dojo/_base/declare","dojo/_base/lang","dojo/parser"],function(t,r,p,m,g){return p("dijit._WidgetsInTemplateMixin",
null,{_earlyTemplatedStartup:!1,contextRequire:null,_beforeFillContent:function(){if(/dojoType|data-dojo-type/i.test(this.domNode.innerHTML)){var d=this.domNode;this.containerNode&&!this.searchContainerNode&&(this.containerNode.stopParser=!0);g.parse(d,{noStart:!this._earlyTemplatedStartup,template:!0,inherited:{dir:this.dir,lang:this.lang,textDir:this.textDir},propsThis:this,contextRequire:this.contextRequire,scope:"dojo"}).then(m.hitch(this,function(d){this._startupWidgets=d;for(var g=0;g<d.length;g++)this._processTemplateNode(d[g],
function(d,e){return d[e]},function(d,e,b){return e in d?d.connect(d,e,b):d.on(e,b,!0)});this.containerNode&&this.containerNode.stopParser&&delete this.containerNode.stopParser}));if(!this._startupWidgets)throw Error(this.declaredClass+": parser returned unfilled promise (probably waiting for module auto-load), unsupported by _WidgetsInTemplateMixin.   Must pre-load all supporting widgets before instantiation.");}},_processTemplateNode:function(d,g,h){return g(d,"dojoType")||g(d,"data-dojo-type")?
!0:this.inherited(arguments)},startup:function(){t.forEach(this._startupWidgets,function(d){d&&!d._started&&d.startup&&d.startup()});this._startupWidgets=null;this.inherited(arguments)}})})},"dojo/parser":function(){define("require ./_base/kernel ./_base/lang ./_base/array ./_base/config ./dom ./_base/window ./_base/url ./aspect ./promise/all ./date/stamp ./Deferred ./has ./query ./on ./ready".split(" "),function(t,r,p,m,g,d,l,h,u,e,b,n,v,f,a,c){function k(a){return eval("("+a+")")}function q(a){var c=
a._nameCaseMap,b=a.prototype;if(!c||c._extendCnt<z){var c=a._nameCaseMap={},f;for(f in b)"_"!==f.charAt(0)&&(c[f.toLowerCase()]=f);c._extendCnt=z}return c}function B(a,c){c||(c=t);var b=c._dojoParserCtorMap||(c._dojoParserCtorMap={}),f=a.join();if(!b[f]){for(var e=[],d=0,k=a.length;d<k;d++){var q=a[d];e[e.length]=b[q]=b[q]||p.getObject(q)||~q.indexOf("/")&&c(q)}d=e.shift();b[f]=e.length?d.createSubclass?d.createSubclass(e):d.extend.apply(d,e):d}return b[f]}new Date("X");var z=0;u.after(p,"extend",
function(){z++},!0);var D={_clearCache:function(){z++;_ctorMap={}},_functionFromScript:function(a,c){var b="",f="",e=a.getAttribute(c+"args")||a.getAttribute("args"),d=a.getAttribute("with"),e=(e||"").split(/\s*,\s*/);d&&d.length&&m.forEach(d.split(/\s*,\s*/),function(a){b+="with("+a+"){";f+="}"});return new Function(e,b+a.innerHTML+f)},instantiate:function(a,c,b){c=c||{};b=b||{};var f=(b.scope||r._scopeName)+"Type",e="data-"+(b.scope||r._scopeName)+"-",d=e+"type",k=e+"mixins",q=[];m.forEach(a,function(a){var b=
f in c?c[f]:a.getAttribute(d)||a.getAttribute(f);if(b){var e=a.getAttribute(k),b=e?[b].concat(e.split(/\s*,\s*/)):[b];q.push({node:a,types:b})}});return this._instantiate(q,c,b)},_instantiate:function(a,c,b,f){function d(a){c._started||b.noStart||m.forEach(a,function(a){"function"!==typeof a.startup||a._started||a.startup()});return a}a=m.map(a,function(a){var f=a.ctor||B(a.types,b.contextRequire);if(!f)throw Error("Unable to resolve constructor for: '"+a.types.join()+"'");return this.construct(f,
a.node,c,b,a.scripts,a.inherited)},this);return f?e(a).then(d):d(a)},construct:function(c,e,d,g,n,B){function x(c){C&&p.setObject(C,c);for(t=0;t<L.length;t++)u[L[t].advice||"after"](c,L[t].method,p.hitch(c,L[t].func),!0);for(t=0;t<Q.length;t++)Q[t].call(c);for(t=0;t<R.length;t++)c.watch(R[t].prop,R[t].func);for(t=0;t<M.length;t++)a(c,M[t].event,M[t].func);return c}var l=c&&c.prototype;g=g||{};var w={};g.defaults&&p.mixin(w,g.defaults);B&&p.mixin(w,B);var y;v("dom-attributes-explicit")?y=e.attributes:
v("dom-attributes-specified-flag")?y=m.filter(e.attributes,function(a){return a.specified}):(B=(/^input$|^img$/i.test(e.nodeName)?e:e.cloneNode(!1)).outerHTML.replace(/=[^\s"']+|="[^"]*"|='[^']*'/g,"").replace(/^\s*<[a-zA-Z0-9]*\s*/,"").replace(/\s*>.*$/,""),y=m.map(B.split(/\s+/),function(a){var c=a.toLowerCase();return{name:a,value:"LI"==e.nodeName&&"value"==a||"enctype"==c?e.getAttribute(c):e.getAttributeNode(c).value}}));var A=g.scope||r._scopeName;B="data-"+A+"-";var z={};"dojo"!==A&&(z[B+"props"]=
"data-dojo-props",z[B+"type"]="data-dojo-type",z[B+"mixins"]="data-dojo-mixins",z[A+"type"]="dojotype",z[B+"id"]="data-dojo-id");for(var t=0,D,A=[],C,G;D=y[t++];){var J=D.name,K=J.toLowerCase();D=D.value;switch(z[K]||K){case "data-dojo-type":case "dojotype":case "data-dojo-mixins":break;case "data-dojo-props":G=D;break;case "data-dojo-id":case "jsid":C=D;break;case "data-dojo-attach-point":case "dojoattachpoint":w.dojoAttachPoint=D;break;case "data-dojo-attach-event":case "dojoattachevent":w.dojoAttachEvent=
D;break;case "class":w["class"]=e.className;break;case "style":w.style=e.style&&e.style.cssText;break;default:if(J in l||(J=q(c)[K]||J),J in l)switch(typeof l[J]){case "string":w[J]=D;break;case "number":w[J]=D.length?Number(D):NaN;break;case "boolean":w[J]="false"!=D.toLowerCase();break;case "function":""===D||-1!=D.search(/[^\w\.]+/i)?w[J]=new Function(D):w[J]=p.getObject(D,!1)||new Function(D);A.push(J);break;default:K=l[J],w[J]=K&&"length"in K?D?D.split(/\s*,\s*/):[]:K instanceof Date?""==D?new Date(""):
"now"==D?new Date:b.fromISOString(D):K instanceof h?r.baseUrl+D:k(D)}else w[J]=D}}for(y=0;y<A.length;y++)z=A[y].toLowerCase(),e.removeAttribute(z),e[z]=null;if(G)try{G=k.call(g.propsThis,"{"+G+"}"),p.mixin(w,G)}catch(N){throw Error(N.toString()+" in data-dojo-props\x3d'"+G+"'");}p.mixin(w,d);n||(n=c&&(c._noScript||l._noScript)?[]:f("\x3e script[type^\x3d'dojo/']",e));var L=[],Q=[],R=[],M=[];if(n)for(t=0;t<n.length;t++)z=n[t],e.removeChild(z),d=z.getAttribute(B+"event")||z.getAttribute("event"),g=
z.getAttribute(B+"prop"),G=z.getAttribute(B+"method"),A=z.getAttribute(B+"advice"),y=z.getAttribute("type"),z=this._functionFromScript(z,B),d?"dojo/connect"==y?L.push({method:d,func:z}):"dojo/on"==y?M.push({event:d,func:z}):w[d]=z:"dojo/aspect"==y?L.push({method:G,advice:A,func:z}):"dojo/watch"==y?R.push({prop:g,func:z}):Q.push(z);c=(n=c.markupFactory||l.markupFactory)?n(w,e,c):new c(w,e);return c.then?c.then(x):x(c)},scan:function(a,c){function b(a){if(!a.inherited){a.inherited={};var c=a.node,f=
b(a.parent),c={dir:c.getAttribute("dir")||f.dir,lang:c.getAttribute("lang")||f.lang,textDir:c.getAttribute(h)||f.textDir},e;for(e in c)c[e]&&(a.inherited[e]=c[e])}return a.inherited}var f=[],e=[],d={},k=(c.scope||r._scopeName)+"Type",q="data-"+(c.scope||r._scopeName)+"-",g=q+"type",h=q+"textdir",q=q+"mixins",x=a.firstChild,l=c.inherited;if(!l){var u=function(a,c){return a.getAttribute&&a.getAttribute(c)||a.parentNode&&u(a.parentNode,c)},l={dir:u(a,"dir"),lang:u(a,"lang"),textDir:u(a,h)},z;for(z in l)l[z]||
delete l[z]}for(var l={inherited:l},A,p;;)if(x)if(1!=x.nodeType)x=x.nextSibling;else if(A&&"script"==x.nodeName.toLowerCase())(D=x.getAttribute("type"))&&/^dojo\/\w/i.test(D)&&A.push(x),x=x.nextSibling;else if(p)x=x.nextSibling;else{var D=x.getAttribute(g)||x.getAttribute(k);z=x.firstChild;if(D||z&&(3!=z.nodeType||z.nextSibling)){p=null;if(D){var K=x.getAttribute(q);A=K?[D].concat(K.split(/\s*,\s*/)):[D];try{p=B(A,c.contextRequire)}catch(Q){}p||m.forEach(A,function(a){~a.indexOf("/")&&!d[a]&&(d[a]=
!0,e[e.length]=a)});K=p&&!p.prototype._noScript?[]:null;l={types:A,ctor:p,parent:l,node:x,scripts:K};l.inherited=b(l);f.push(l)}else l={node:x,scripts:A,parent:l};A=K;p=x.stopParser||p&&p.prototype.stopParser&&!c.template;x=z}else x=x.nextSibling}else{if(!l||!l.node)break;x=l.node.nextSibling;p=!1;l=l.parent;A=l.scripts}var L=new n;e.length?(v("dojo-debug-messages")&&console.warn("WARNING: Modules being Auto-Required: "+e.join(", ")),(c.contextRequire||t)(e,function(){L.resolve(m.filter(f,function(a){if(!a.ctor)try{a.ctor=
B(a.types,c.contextRequire)}catch(N){}for(var b=a.parent;b&&!b.types;)b=b.parent;var f=a.ctor&&a.ctor.prototype;a.instantiateChildren=!(f&&f.stopParser&&!c.template);a.instantiate=!b||b.instantiate&&b.instantiateChildren;return a.instantiate}))})):L.resolve(f);return L.promise},_require:function(a,c){var b=k("{"+a.innerHTML+"}"),f=[],e=[],d=new n,q=c&&c.contextRequire||t,g;for(g in b)f.push(g),e.push(b[g]);q(e,function(){for(var a=0;a<f.length;a++)p.setObject(f[a],arguments[a]);d.resolve(arguments)});
return d.promise},_scanAmd:function(a,c){var b=new n,e=b.promise;b.resolve(!0);var d=this;f("script[type\x3d'dojo/require']",a).forEach(function(a){e=e.then(function(){return d._require(a,c)});a.parentNode.removeChild(a)});return e},parse:function(a,c){!a||"string"==typeof a||"nodeType"in a||(c=a,a=c.rootNode);var b=a?d.byId(a):l.body();c=c||{};var f=c.template?{template:!0}:{},e=[],k=this,q=this._scanAmd(b,c).then(function(){return k.scan(b,c)}).then(function(a){return k._instantiate(a,f,c,!0)}).then(function(a){return e=
e.concat(a)}).otherwise(function(a){console.error("dojo/parser::parse() error",a);throw a;});p.mixin(e,q);return e}};r.parser=D;g.parseOnLoad&&c(100,D,"parse");return D})},"dojo/date/stamp":function(){define(["../_base/lang","../_base/array"],function(t,r){var p={};t.setObject("dojo.date.stamp",p);p.fromISOString=function(m,g){p._isoRegExp||(p._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/);var d=p._isoRegExp.exec(m),l=null;
if(d){d.shift();d[1]&&d[1]--;d[6]&&(d[6]*=1E3);g&&(g=new Date(g),r.forEach(r.map("FullYear Month Date Hours Minutes Seconds Milliseconds".split(" "),function(e){return g["get"+e]()}),function(e,b){d[b]=d[b]||e}));l=new Date(d[0]||1970,d[1]||0,d[2]||1,d[3]||0,d[4]||0,d[5]||0,d[6]||0);100>d[0]&&l.setFullYear(d[0]||1970);var h=0,u=d[7]&&d[7].charAt(0);"Z"!=u&&(h=60*(d[8]||0)+(Number(d[9])||0),"-"!=u&&(h*=-1));u&&(h-=l.getTimezoneOffset());h&&l.setTime(l.getTime()+6E4*h)}return l};p.toISOString=function(m,
g){var d=function(b){return 10>b?"0"+b:b};g=g||{};var l=[],h=g.zulu?"getUTC":"get",u="";"time"!=g.selector&&(u=m[h+"FullYear"](),u=["0000".substr((u+"").length)+u,d(m[h+"Month"]()+1),d(m[h+"Date"]())].join("-"));l.push(u);if("date"!=g.selector){u=[d(m[h+"Hours"]()),d(m[h+"Minutes"]()),d(m[h+"Seconds"]())].join(":");h=m[h+"Milliseconds"]();g.milliseconds&&(u+="."+(100>h?"0":"")+d(h));if(g.zulu)u+="Z";else if("time"!=g.selector)var h=m.getTimezoneOffset(),e=Math.abs(h),u=u+((0<h?"-":"+")+d(Math.floor(e/
60))+":"+d(e%60));l.push(u)}return l.join("T")};return p})},"esri/dijit/_EventedWidget":function(){define("dojo/_base/declare dojo/_base/lang dojo/aspect dojo/on ../Evented dijit/_WidgetBase".split(" "),function(t,r,p,m,g,d){return t([d,g],{_onMap:function(d){var g=this.constructor._onMap,l;g&&g.FINAL||(delete this.constructor._onMap,g=this.registerConnectEvents(),g.FINAL=!0);d=d.toLowerCase();g[d]?l=this[g[d].method]:(d=this._onCamelCase(d),this[d]&&(l=d));return l},on:function(d,g){var h=this._onMap(d),
e=d.replace(/\-/g,""),b="on"+e in this.domNode;return h||!b?this.inherited(arguments):this.own(m(this.domNode,e,g))[0]},emit:function(d,g,u){var e,b,h,v=d.toLowerCase(),f=this.constructor._onMap||this.registerConnectEvents();b=this[this._onMap(v)];g=g||{};g.target||(g.target=this);b&&f&&f[v]&&(this._onObj2Arr(function(){e=Array.prototype.slice.call(arguments)},f[v].argKeys)(g),h=r.mixin({},arguments),h[2]=e,h[0]=f[v].name.replace(/^on/,""));return this.inherited(h||arguments)}})})},"esri/dijit/Legend/utils":function(){define(["dojo/_base/lang",
"../../lang","dojo/i18n!../../nls/jsapi"],function(t,r,p){var m=p.widgets.legend;return{getVisualVariableTitle:function(g,d){var l,h=g.field,u=g.normalizationField,e=!1,b=!1,n=!1,v,h=t.isFunction(h)?null:h,u=t.isFunction(u)?null:u;if(g.legendOptions&&g.legendOptions.title)l=g.legendOptions.title;else if(g.valueExpressionTitle)l=g.valueExpressionTitle;else{if(d.renderer&&d.renderer.authoringInfo&&d.renderer.authoringInfo.visualVariables){var f=d.renderer.authoringInfo.visualVariables;for(v=0;v<f.length;v++){var a=
f[v];if("colorInfo"===a.type&&"ratio"===a.style){e=!0;break}else if("colorInfo"===a.type&&"percent"===a.style){b=!0;break}else if("colorInfo"===a.type&&"percentTotal"===a.style){n=!0;break}}}(e=n&&"showRatioPercentTotal"||b&&"showRatioPercent"||e&&"showRatio"||u&&"showNormField"||h&&"showField"||null)&&(l=r.substitute({field:h&&d.getFieldLabel(h),normField:u&&d.getFieldLabel(u)},m[e]))}return l},getRendererTitle:function(g,d){var l;if(g){var h,u,e;"esri.renderer.ClassBreaksRenderer"===g.declaredClass&&
(h=g.attributeField,u=g.normalizationField,e="percent-of-total"===g.normalizationType);h=t.isFunction(h)?null:h;u=t.isFunction(u)?null:u;g.legendOptions&&g.legendOptions.title?l=g.legendOptions.title:g.valueExpressionTitle?l=g.valueExpressionTitle:(e=u&&"showNormField"||(e?"showNormPct":null)||h&&"showField"||null)&&(l=r.substitute({field:h&&d.getFieldLabel(h),normField:u&&d.getFieldLabel(u)},m[e]))}return l}}})},"esri/layers/clustering/GeohashAggregation":function(){define("dojo/has dojo/_base/declare dojo/_base/lang dojo/_base/array ../../kernel ../../Evented ../../geometry/Point ../../geometry/Extent ../../geometry/mathUtils ../../support/expressionUtils ../../core/timerUtils ../support/attributeUtils ./geohashUtils ./statUtils".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v,f){r=r(d,{loaded:!1,map:null,layer:null,lod:null,tolerance:null,clusterMode:null,clusterRadius:null,sortEnabled:!0,filterEnabled:!0,bufferEnabled:!0,updateEnabled:!0,clusters:null,clustersEnabled:!0,statisticInfos:null,defaults:{lod:1,tolerance:0,clusterMode:"auto",clusterRadius:80,sortEnabled:!0,filterEnabled:!0,bufferEnabled:!0,updateEnabled:!0},_eventHandles:null,_updateHandle:null,_cellIndex:null,_globalIndex:null,_perfProfile:null,_cellSizeScaleFactor:1.5,_extentScaleFactor:1.25,
_maxGeohashLength:12,_minClusterRadius:15,_levelChange:!0,_clusterFieldPrefix:"cluster_",_mapLevelChange:!1,constructor:function(a){this._update=p.hitch(this,this._update);this._eventHandles=[];this._globalIndex={numFeatures:null,fullExtent:null,lodStats:null};this._perfProfile={lastIndex:{total:null,numFeatures:0},lastUpdate:{cells:null,clusters:null,total:null}};this.clusters=[];this.map=a.map;this.layer=a.layer;this.setLod(a.lod);this.setTolerance(a.tolerance);this.setClusterMode(a.clusterMode);
this.setClusterRadius(a.clusterRadius);this.setSortEnabled(a.sortEnabled);this.setFilterEnabled(a.filterEnabled);this.setBufferEnabled(a.bufferEnabled);this.setUpdateEnabled(a.updateEnabled);this.setStatisticInfos(a.statisticInfos);this._load();this.loaded?this._startup():this._eventHandles.push(this.on("load",p.hitch(this,this._startup)))},destroy:function(a){this._displayFeatures(!0,a);m.forEach(this._eventHandles,function(a){a.remove()});b.clearTimeout(this._updateHandle);this._cellIndex=this._globalIndex=
this._eventHandles=this._updateHandle=this.map=this.layer=this.clusters=null},setLod:function(a){var c=this.lod;this.lod=a||this.defaults.lod;c!==this.lod&&this.update()},setTolerance:function(a){var c=this.tolerance;this.tolerance=a||this.defaults.tolerance;c!==this.tolerance&&this.update()},setClusterMode:function(a){var c=this.clusterMode;this.clusterMode=a||this.defaults.clusterMode;this._evalClusterParams();c!==this.clusterMode&&this.update()},setClusterRadius:function(a){var c=this.clusterRadius;
this.clusterRadius=null!=a?a:this.defaults.clusterRadius;this._evalClusterParams();c!==this.clusterRadius&&this.update()},setSortEnabled:function(a){var c=this.sortEnabled;this.sortEnabled=null!=a?!!a:this.defaults.sortEnabled;c!==this.sortEnabled&&this.update()},setFilterEnabled:function(a){var c=this.filterEnabled;this.filterEnabled=null!=a?!!a:this.defaults.filterEnabled;c!==this.filterEnabled&&this.update()},setBufferEnabled:function(a){var c=this.bufferEnabled;this.bufferEnabled=null!=a?!!a:
this.defaults.bufferEnabled;c!==this.bufferEnabled&&this.update()},setUpdateEnabled:function(a){var c=this.updateEnabled;(this.updateEnabled=null!=a?!!a:this.defaults.updateEnabled)&&c!==this.updateEnabled&&(this._mapLevelChange=!0,this.update())},setStatisticInfos:function(a){this.statisticInfos=a||[];this.loaded&&this._applyStatInfos(this.statisticInfos)},update:function(){this.loaded&&null==this._updateHandle&&(this._updateHandle=b.setTimeout(this._update,b.priority.HIGH))},isUpdateScheduled:function(){return null!=
this._updateHandle},getCell:function(a){return this._cellIndex[a.length][a]},getCluster:function(a){var c;m.some(this.clusters,function(b){-1<m.indexOf(b.geohashes,a)&&(c=b);return!!c});return c},getCellsInCluster:function(a){var c=[];m.forEach(a&&a.geohashes,function(a){(a=this.getCell(a))&&c.push(a)},this);return c},getFeaturesInCluster:function(a){var c=[];a=this.getCellsInCluster(a);m.forEach(a,function(a){Array.prototype.push.apply(c,a.features)});return c},getCurrentLodStats:function(){var a=
this._globalIndex.lodStats;return a&&a[this.lod]},getNumFeatures:function(){return this._globalIndex.numFeatures},getFullExtent:function(){var a=this._globalIndex.fullExtent;return a&&Infinity!==a.xmin?new h(a):null},_load:function(){this._displayFeatures(!1);this._checkLoadStatus();this.map.loaded||this._eventHandles.push(this.map.on("load",p.hitch(this,this._checkLoadStatus)));this.layer.loaded||this._eventHandles.push(this.layer.on("load",p.hitch(this,this._checkLoadStatus)))},_checkLoadStatus:function(){if(this.map.loaded&&
this.layer.loaded){var a;if("esriGeometryPoint"!==this.layer.geometryType)a=Error("GeohashAggregation is supported only for points");else{var c=this.map.spatialReference;c.isWebMercator()||4326===c.wkid||(a=Error("GeohashAggregation is supported only when map spatial reference is WGS84 or WebMercator"))}a?(this.loadError=a,this.emit("load-error",{error:a})):(this.loaded=!0,this.emit("load"))}},_startup:function(){this._evalUpdateStatus();this._processFeatures();this._processExtentChange();this._eventHandles.push(this.layer.on("update-end",
p.hitch(this,this._processFeatures)),this.layer.on("edits-complete",p.hitch(this,this._processFeatures)),this.layer.on("graphics-clear",p.hitch(this,this._processFeatures)),this.layer.on("suspend",p.hitch(this,this._evalUpdateStatus)),this.layer.on("resume",p.hitch(this,this._evalUpdateStatus)),this.map.on("extent-change",p.hitch(this,this._processExtentChange)))},_processFeatures:function(){this._indexFeatures();this.update()},_evalUpdateStatus:function(){this.setUpdateEnabled(!this.layer.suspended)},
_processExtentChange:function(a){this._mapLevelChange=!(!a||!a.levelChange);this._evalClusterParams();this.update()},_update:function(){this._updateHandle=null;if(this.updateEnabled){this.emit("update-start");if(this.clustersEnabled){var a=this.map.geographicExtent;if(a){var c=this._getIntersectingCells(a),a=this._getClusters(c.cells,a);this.clusters=a.clusters;this._applyStatInfosToClusters();var c=c.profile,a=a.profile,b=c.total+a.total;c.total=this._getElapsedTime(c.total);a.total=this._getElapsedTime(a.total);
var f=this._perfProfile.lastUpdate={};f.cells=c;f.clusters=a;f.total=this._getElapsedTime(b)}}else this.clusters=[],this._perfProfile.lastUpdate=null;c=this._mapLevelChange;this._mapLevelChange=!1;this.emit("update-end",{levelChange:this._levelChange,mapLevelChange:c})}},_displayFeatures:function(a,c){var b=this.layer,f=!a;b.suspendGraphics(f);!1!==c&&(f?b.clearNodes():b.redraw())},_indexFeatures:function(){var a=this._getTime();this._initializeIndexing();var c=0,b=this._globalIndex.fullExtent;m.forEach(this.layer.graphics,
function(a){if(a.visible){var f=a.geometry,e=this._getLngLat(f),d;e&&(d=f.getCacheValue("_geohash"),void 0===d&&(d=v.pointToGeohash(e),f.setCacheValue("_geohash",d||null)));d&&(this._addGeohashToIndex(d,a,e),c++,this._updateExtent(b,e))}},this);this._applyStatInfosToIndex();this._globalIndex.numFeatures=c;for(var f=this._globalIndex.lodStats,e=1;e<=this._maxGeohashLength;e++)f[e]=this._getLODStats(e,c);this._perfProfile.lastIndex.total=this._getElapsedTime(a,this._getTime());this._perfProfile.lastIndex.numFeatures=
c;this.emit("index-complete")},_initializeIndexing:function(){this._globalIndex={numFeatures:0,fullExtent:{xmin:Infinity,ymin:Infinity,xmax:-Infinity,ymax:-Infinity},lodStats:{}};for(var a=this._cellIndex=[],c=1;c<=this._maxGeohashLength;c++)a[c]={}},_getLngLat:function(a){if(a){var c=a.getLongitude();a=a.getLatitude();a=null!=c&&null!=a?{x:c,y:a}:null}return a},_addGeohashToIndex:function(a,c,b){for(var f=this._cellIndex,e="",d=0;d<this._maxGeohashLength;d++){var e=e+a[d],k=f[e.length],g=k[e];g||
(g=k[e]={count:0,centroid:{x:null,y:null},extent:{xmin:Infinity,ymin:Infinity,xmax:-Infinity,ymax:-Infinity},features:[],geohash:e,statistics:null});this._updateItem(g,1,b,!0);g.features.push(c)}},_getLODStats:function(a,c){var b=this._cellIndex[a],f=0,e=Infinity,d=-Infinity,g=null,h;for(h in b){var n=b[h];f++;n.count<e&&(e=n.count);n.count>d&&(d=n.count)}0<f&&(g=Number((c/f).toFixed(2)));return{lod:a,count:f,min:Infinity===e?null:e,max:-Infinity===d?null:d,avg:g}},_evalClusterParams:function(){if(this.loaded&&
"auto"===this.clusterMode){var a=this._getClusterParams(this.map.getResolutionInMeters(),this.clusterRadius,this._minClusterRadius);this._levelChange=this.lod!==a.lod;this.lod=a.lod;this.tolerance=a.tolerance}},_getClusterParams:function(a,c,b){c<b&&(c=b);a=Math.ceil(a*c);c=this._getClosestLODRange(a).max;do b=this._getCellSize(c),(b=a>=this._cellSizeScaleFactor*b||1===b)||(c+=1);while(!b);b=a/this._getCellSize(c);return{lod:c,tolerance:a,multiplier:Number(b.toFixed(2))}},_getClosestLODRange:function(a){for(var c,
b=this._maxGeohashLength;1<=b;b--)if(this._getCellSize(b)>=a){c=b;break}null==c&&(c=1);a=c+1;a>this._maxGeohashLength&&(a=this._maxGeohashLength);return{min:c,max:a}},_getCellSize:function(a){a=v.getCellSizeInMeters(a);return Math.ceil(Math.min(a.width,a.height))},_sorter:function(a,c){var b=a.centroid,f=c.centroid;return a.count>c.count?-1:a.count<c.count?1:b.x>f.x?-1:b.x<f.x?1:0},_getIntersectingCells:function(a){var c=this._getTime();a=a.expand(this._extentScaleFactor);var b=v.getIntersecting(a,
this.lod,this.bufferEnabled?this.tolerance:0);a=this._getTime();var f=[],e=this.tolerance,d=this.sortEnabled;m.forEach(b,function(a){(a=this.getCell(a))&&f.push(a)},this);e&&d&&f.sort(this._sorter);b=this._getTime();return{cells:f,profile:{findCells:this._getElapsedTime(c,a),scanAndSortCells:this._getElapsedTime(a,b),total:b-c}}},_getClusters:function(a,c){var b=this._getTime(),f=[],e={},d={findCells:0};m.forEach(a,function(a,c){var b=this._createCluster(a,e,d);b&&f.push(b)},this);this._markIntersecting(f,
c);this.filterEnabled&&(f=this._getIntersectingClusters(f));var g=this._getTime();return{clusters:f,profile:{findCellsInCluster:this._getElapsedTime(d.findCells),total:g-b}}},_markIntersecting:function(a,c){var b=c.normalize();m.forEach(a,function(a){var c=a.centroid.x,f=a.centroid.y;a.isIntersecting=m.some(b,function(a){return c>=a.xmin&&c<=a.xmax&&f>=a.ymin&&f<=a.ymax})})},_getIntersectingClusters:function(a){return m.filter(a,function(a){return a.isIntersecting})},_createCluster:function(a,c,b){if(!c[a.geohash]){var f=
[{cell:a,distance:0}];if(this.tolerance){var e=this._getTime(),d=v.getNeighborsWithinDistance(a.centroid,this.lod,this.tolerance);b.findCells+=this._getTime()-e;m.forEach(d,function(c){if(c!==a.geohash&&(c=this.getCell(c))){var b=this._calculateDistance(a.centroid,c.centroid);b<=this.tolerance&&f.push({cell:c,distance:b})}},this)}return this._mergeCells(f,c)}},_calculateDistance:function(a,c){return u.getLength(v.geographicToWebMercator(a),v.geographicToWebMercator(c))},_mergeCells:function(a,c){var b=
this._initializeCluster({},a[0].cell.geohash);m.forEach(a,function(a){var f=a.cell,e=f.geohash;a=a.distance;var d=c[e];if(d)if(a<d.distance)this._removeCellFromCluster(e,c);else return;c[e]={cluster:b,distance:a};this._updateItem(b,f.count,f.centroid);b.geohashes.push(e)},this);return b},_removeCellFromCluster:function(a,c){var b=c[a].cluster;delete c[a];var f=m.indexOf(b.geohashes,a);-1<f&&b.geohashes.splice(f,1);this._reevaluateCluster(b)},_reevaluateCluster:function(a){var c=a.geohashes;a=this._initializeCluster(a,
a.primary);m.forEach(c,function(c){var b=this.getCell(c);b&&(this._updateItem(a,b.count,b.centroid),a.geohashes.push(c))},this)},_initializeCluster:function(a,c){a.count=0;a.centroid=new l(null,null);a.geohashes=[];a.primary=c;a.statistics=null;return a},_applyStatInfos:function(a){a=this._getValidStatInfos(a);this._applyStatInfosToIndex(a);this._applyStatInfosToClusters(a)},_getValidStatInfos:function(a){var c=[];m.forEach(a,function(a){var b=a.attributeInfo;a=a.statisticType;var e="angle"===b.attributeType;
if(f.isSupportedStatisticType(a)&&(!e||"avg"===a)){var d="arithmetic"===b.rotationType;c.push({attributeCache:n.createAttributeCache(b,"type"===a),identifier:f.getStatisticId(b,a),statFunctions:f.getStatisticFunctions(a),isAngular:e,isDate:"date"===b.attributeType,isArithmetic:d})}});return c},_applyStatInfosToIndex:function(a){a=a||this._getValidStatInfos(this.statisticInfos);var c=this._cellIndex;if(c)for(var b=1;b<=this._maxGeohashLength;b++){var f=c[b],e;for(e in f)this._applyStatInfosToCell(f[e],
a)}},_applyStatInfosToCell:function(a,c){var b=this._initializeStats(a,c);m.forEach(a.features,function(a){this._calcFeatureStats(a,c,b)},this);this._summarizeStats(a,b,c)},_calcFeatureStats:function(a,c,b){a.attributes&&m.forEach(c,function(c){var f=b[c.identifier],d=c.attributeCache,d=d?a._getDataValue(d.attributeInfo,d,e):null;c.statFunctions.updateCellStat(f,d,c)})},_applyStatInfosToClusters:function(a){a=a||this._getValidStatInfos(this.statisticInfos);var c=this._clusterFieldPrefix;m.forEach(this.clusters,
function(b){var f=this._initializeStats(b,a);m.forEach(this.getCellsInCluster(b),function(c){this._calcCellStats(c,a,f)},this);this._summarizeStats(b,f,a,c);b.attributes[c+"id"]=b.primary},this)},_calcCellStats:function(a,c,b){var f=a.statistics;m.forEach(c,function(a){var c=a.identifier;a.statFunctions.updateClusterStat(b[c],f[c],a)})},_initializeStats:function(a,c){var b=a.statistics={};m.forEach(c,function(a){b[a.identifier]=a.statFunctions.initialize(a)});return b},_summarizeStats:function(a,
c,b,f){var e=a.attributes={};f=f||"";e[f+"count"]=a.count;m.forEach(b,function(a){var b=this._getStatFieldName(a,f);e[b]=a.statFunctions.summarize(c[a.identifier],a)},this)},_getStatFieldName:function(a,c){return(c||"")+a.identifier},_updateItem:function(a,c,b,f){var e=b.y,d=a.centroid,k=a.count;d.x=(k*d.x+c*b.x)/(k+c);d.y=(k*d.y+c*e)/(k+c);a.count+=c;f&&this._updateExtent(a.extent,b)},_updateExtent:function(a,c){var b=c.x,f=c.y;b<a.xmin&&(a.xmin=b);b>a.xmax&&(a.xmax=b);f<a.ymin&&(a.ymin=f);f>a.ymax&&
(a.ymax=f)},_getTime:function(){return window.performance?window.performance.now():(new Date).getTime()},_getElapsedTime:function(a,c){var b,f;f=null!=a&&null!=c?c-a:a;null!=f&&(b="millisecond",1E3<=f&&(f/=1E3,b="second",60<=f&&(f/=60,b="minute")),b={value:Number(f.toFixed(2)),unit:b});return b}});t("extend-esri")&&p.setObject("layers.clustering.GeohashAggregation",r,g);return r})},"esri/core/timerUtils":function(){define([],function(){function t(d){var g,h=d.length;for(g=0;g<h;g++)d[g]()}var r={LOW:1,
HIGH:2},p,m={};m[r.LOW]=[];m[r.HIGH]=[];var g=function(){clearTimeout(p);p=null;var d=m[r.HIGH];m[r.HIGH]=[];t(d);d=m[r.LOW];m[r.LOW]=[];t(d)};return{priority:r,callbackQueue:m,setTimeout:function(d,l){var h=[l,m[l].push(d)-1];p||(p=setTimeout(g,0));return h},clearTimeout:function(d){d&&m[d[0]].splice(d[1],1)}}})},"esri/layers/clustering/geohashUtils":function(){define("dojo/has dojo/string dojo/_base/lang dojo/_base/array ../../kernel ../../geometry/Point ../../geometry/Extent ../../SpatialReference ../../geometry/webMercatorUtils".split(" "),
function(t,r,p,m,g,d,l,h,u){function e(a){var c=a.spatialReference;if(!c)return{x:a.x,y:a.y};var b=c.isWebMercator(),f;4326===c.wkid?f={x:a.x,y:a.y}:b&&(f={x:a.getLongitude(),y:a.getLatitude()});return f}function b(a){var c=a.spatialReference,b=!(!c||!c.isWebMercator()),f;c&&4326===c.wkid?f=new l(a.toJson()):b&&(f=u.webMercatorToGeographic(a,!0));return f}function n(a,c){c.x=d.prototype._normalizeX(a.x,h.prototype._info[4326]);c.y=a.y;return c}function v(a){a=E.decimals[a].toString(2);return r.pad(a,
E.bitsPerBase32Char,"0")}function f(a,c){var b;c=c.slice();c.splice(1,0,0);for(var f=c[0],e=c[2],d=0;d<a.length;d++)Number(a[d])?c[0]=c[1]:c[2]=c[1],b=c[1]=(c[0]+c[2])/2,f=c[0],e=c[2];return{value:b,min:f,max:e}}function a(a,c,b){var f=[];c=c.slice();c.splice(1,0,0);for(var e=c[0],d=c[2],k=0;k<b;k++)a>=c[1]?(c[0]=c[1],e=1):(c[2]=c[1],e=0),c[1]=(c[0]+c[2])/2,f.push(e),e=c[0],d=c[2];return{value:f.join(""),min:e,max:d}}function c(a){var c=a*E.bitsPerBase32Char;0===c%2?a=c/=2:(a=(c+1)/2,c-=a);return{lon:a,
lat:c}}function k(a){var c=0;a=a.split("").reverse().join("");for(var b=0;b<a.length;b++)c+=Number(a[b])*Math.pow(2,b);return E.base32[c]}function q(a,c){var b={x:a.xmin,y:a.ymax},f={x:a.xmax,y:a.ymin},e={x:a.xmax,y:a.ymax};return{sw:H.pointToGeohash({x:a.xmin,y:a.ymin},c),nw:H.pointToGeohash(b,c),se:H.pointToGeohash(f,c),ne:H.pointToGeohash(e,c)}}function B(a,c,b,f,e){var d=a;do e[d]||(e[d]=!0,f.push(d)),(a=d===c)||(d=C(d,b));while(!a)}function z(a,c,b,f){var e=q(a,c);a=[];B(e.sw,e.nw,"n",a,{});
c=[];B(e.se,e.ne,"n",c,{});for(e=0;e<a.length;e++)B(a[e],c[e],"e",b,f)}function D(a){return m.filter(a,function(a){return 180===a.xmax?!0:!1})[0]}function A(a){return m.filter(a,function(a){return-180===a.xmin?!0:!1})[0]}function x(a,c,b,f){var e=H.geographicToWebMercator(a);a={x:e.x-c,y:e.y-c};c=H.webMercatorToGeographic({x:e.x+c,y:e.y+c},!0);a=H.webMercatorToGeographic(a,!0);return new l(null!=b?b:a.x,a.y,null!=f?f:c.x,c.y)}function y(a,c,b,f){var e;a=q(a,c);var d,k;"min"===f?k=180:"max"===f&&(d=
-180);var g=d;f=k;e=H.geohashToCell(a.sw).extent;c=H.geohashToCell(a.ne).extent;a=null!=g?g:e.xmin;e=e.ymin;f=null!=f?f:c.xmax;c=c.ymax;a=x({x:a,y:e},b,d,k);b=x({x:f,y:c},b,d,k);return new l(a.xmin,a.ymin,b.xmax,b.ymax)}function G(a,c,b){var f=a,e=0;do e++,(a=f===c)||(f=C(f,b));while(!a);return e}function w(a,c){var b=q(a,c),f=G(b.nw,b.ne,"e");return{rows:G(b.nw,b.sw,"s"),cols:f}}function C(a,c){var b=a.length%2,f=a.slice(-1),e=E.decimals[f],d=a.slice(0,-1);-1!=E.borders[c][b].indexOf(f)&&d&&(d=C(d,
c));return d+E.neighbors[c][b][e]}var E={base32:"0123456789bcdefghjkmnpqrstuvwxyz",decimals:function(){for(var a={},c=0;32>c;c++)a["0123456789bcdefghjkmnpqrstuvwxyz"[c]]=c;return a}(),neighbors:{n:[null,"238967debc01fg45kmstqrwxuvhjyznp"],s:[null,"bc01fg45238967deuvhjyznpkmstqrwx"],e:[null,"14365h7k9dcfesgujnmqp0r2twvyx8zb"],w:[null,"p0r21436x8zb9dcf5h7kjnmqesgutwvy"]},borders:{n:[null,"bcfguvyz"],s:[null,"0145hjnp"],e:[null,"prxz"],w:[null,"028b"]},bitsPerBase32Char:5,maxGeohashLength:12,longitudeRange:[-180,
180],latitudeRange:[-90,90]};E.neighbors.n[0]="14365h7k9dcfesgujnmqp0r2twvyx8zb";E.neighbors.s[0]="p0r21436x8zb9dcf5h7kjnmqesgutwvy";E.neighbors.e[0]="238967debc01fg45kmstqrwxuvhjyznp";E.neighbors.w[0]="bc01fg45238967deuvhjyznpkmstqrwx";E.borders.n[0]="prxz";E.borders.s[0]="028b";E.borders.e[0]="bcfguvyz";E.borders.w[0]="0145hjnp";var H={geographicToWebMercator:function(a){a=d.lngLatToXY(a.x,a.y);return{x:a[0],y:a[1]}},webMercatorToGeographic:function(a,c){var b=d.xyToLngLat(a.x,a.y,c);return{x:b[0],
y:b[1]}},geohashToCell:function(a){for(var c=[],b=0;b<a.length;b++)c.push(v(a[b]));for(var c=c.join(""),b=[],e=[],d=0;d<c.length;d++)0===d%2?b.push(c[d]):e.push(c[d]);b=b.join("");e=e.join("");b=[b,e];c=f(b[0],E.longitudeRange);b=f(b[1],E.latitudeRange);return{point:{x:c.value,y:b.value},extent:{xmin:c.min,xmax:c.max,ymin:b.min,ymax:b.max},geohash:a}},pointToCell:function(b,f){var d,g,q;f=f||E.maxGeohashLength;var h=e(b);if(h){h=n(h,h);d=c(f);q=a(h.x,E.longitudeRange,d.lon);var v=a(h.y,E.latitudeRange,
d.lat);d=q.value;g=v.value;q={xmin:q.min,xmax:q.max,ymin:v.min,ymax:v.max};for(var v=[],x=Math.ceil((d.length+g.length)/E.bitsPerBase32Char),l=0,B=0,w=0;w<x*E.bitsPerBase32Char;w++){var u=0===w%2?d[l++]:g[B++];null==u&&(u=0);v.push(u)}d=v.join("");g=E.bitsPerBase32Char;v=d.length/g;x=[];for(l=0;l<v;l++)B=d.substr(l*g,g),x.push(k(B));d=x.join("");return{point:h,extent:q,geohash:d}}},geohashToPoint:function(a){return H.geohashToCell(a).point},pointToGeohash:function(a,c){var b=H.pointToCell(a,c);return b&&
b.geohash},getCells:function(a){return m.map(a,function(a){return H.geohashToCell(a)})},getCellSize:function(a){var b=E.longitudeRange,f=E.latitudeRange,b=Math.abs(b[1]-b[0]),f=Math.abs(f[1]-f[0]);a=c(a||1);return{width:b/Math.pow(2,a.lon),height:f/Math.pow(2,a.lat)}},getCellSizeInMeters:function(a){a=H.getCellSize(a);var c=u.metersPerDegree;a.width*=c;a.height*=c;return a},getIntersecting:function(a,c,f){c=c||1;f=f||0;var e=[],d=b(a);if(d){f&&(d=H.expandExtent(a,c,f));a=d.normalize();var k={};m.forEach(a,
function(a){z(a,c,e,k)})}return e},countIntersecting:function(a,c,f){c=c||1;f=f||0;var e=0,d=b(a);if(d){f&&(d=H.expandExtent(a,c,f));a=d.normalize();if(2===a.length){e=D(a);d=A(a);f=w(e,c);var k=w(d,c);a=f.rows;f=f.cols+k.cols;e={x:e.xmin,y:e.ymax};d={x:d.xmax,y:d.ymax};e=n(e,{});d=n(d,{});e=H.pointToGeohash(e,c);c=H.pointToGeohash(d,c);e===c&&f--;c={rows:a,cols:f}}else c=w(a[0],c);e=c.cols*c.rows}return e},getChildren:function(a){a=a||"";var c=[],b;for(b in E.decimals)c.push(a+b);return c},getNeighbors:function(a){var c=
C(a,"n"),b=C(a,"s");return[c,C(c,"e"),C(c,"w"),b,C(b,"e"),C(b,"w"),C(a,"e"),C(a,"w")]},getExtentFromDistance:function(a,c){c=c||1E3;var b,f=e(a);f&&(b=x(f,c));return b},expandExtent:function(a,c,f){c=c||1;f=f||0;if(a=b(a)){if(f){a=a.normalize();if(2===a.length){var e=f;f=D(a);a=A(a);f=y(f,c,e,"min");a=y(a,c,e,"max");360<=f.getWidth()+a.getWidth()?(c=-180,a=180):(c=f.xmin,a=a.xmax);return new l(c,f.ymin,a,f.ymax)}return y(a[0],c,f)}return a}},getNeighborsWithinDistance:function(a,c,b){b=b||1E3;c=c||
1;var f=[];if(a=e(a)){b=x(a,b).normalize();var d={};m.forEach(b,function(a){z(a,c,f,d)})}return f}};t("extend-esri")&&p.setObject("layers.clustering.geohashUtils",H,g);return H})},"esri/layers/clustering/statUtils":function(){define(["dojo/_base/lang","../support/attributeUtils"],function(t,r){function p(d){return"number"===typeof d&&!isNaN(d)&&Infinity!==d&&-Infinity!==d}var m={sum:{initialize:function(){return{count:0,sum:null}},updateCellStat:function(d,g){p(g)&&(d.count++,d.sum+=g)},updateClusterStat:function(d,
g){g.count&&(d.count+=g.count,d.sum+=g.sum)},summarize:function(d){return d.sum}},avg:{initialize:function(d){return{count:0,sum:null,avg:null,sum_cosine:null,sum_sine:null}},updateCellStat:function(d,g,h){p(g)&&(d.count++,h.isAngular?(h.isArithmetic||(g=-1*g+90),d.sum_cosine+=Math.cos(g*Math.PI/180),d.sum_sine+=Math.sin(g*Math.PI/180)):d.sum+=g)},updateClusterStat:function(d,g,h){g.count&&(d.count+=g.count,h.isAngular?(d.sum_cosine+=g.sum_cosine,d.sum_sine+=g.sum_sine):d.sum+=g.sum)},summarize:function(d,
g){if(0<d.count){var h=d.count;g.isAngular?(h=180*Math.atan2(d.sum_sine/h,d.sum_cosine/h)/Math.PI,g.isArithmetic||(h=-1*(h-90)),d.avg=0>h?h+360:h):(d.avg=d.sum/h,g.isDate&&(d.avg=Math.ceil(d.avg)))}return d.avg}},type:{initialize:function(){return{uvInfos:{}}},updateCellStat:function(d,g){if(null==g||""===g||"string"===typeof g&&""===t.trim(g))g=null;var h=d.uvInfos;null==h[g]?h[g]={count:1,value:g}:h[g].count++},updateClusterStat:function(d,g){var h=d.uvInfos,l=g.uvInfos,e;for(e in l){var b=l[e];
null==h[e]?h[e]={count:b.count,value:b.value}:h[e].count+=b.count}},summarize:function(d){d=d.uvInfos;var g,h=-Infinity,u;for(g in d){var e=d[g];e.count>h?(h=e.count,u=e.value):e.count===h&&(u=null)}return u}}},g={isSupportedStatisticType:function(d){return m.hasOwnProperty(d)},getStatisticFunctions:function(d){return m[d]},getStatisticId:function(d,g){var h=r.getAttributeIdSource(d),h=h&&r.getAttributeId(h)||d.field;return g+"_"+h},getClusterField:function(d,l){return"cluster_"+g.getStatisticId(d,
l)},getStatisticHash:function(d,l){var h=[g.getStatisticId(d,l)];d.attributeType&&h.push(d.attributeType.toLowerCase());d.rotationType&&h.push(d.rotationType.toLowerCase());return h.join("_")}};return g})},"esri/toolbars/draw":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/Color dojo/_base/window dojo/has dojo/sniff dojo/keys dojo/dom-construct dojo/dom-style dojo/dom-geometry ../kernel ../sniff ./_toolbar ../symbols/SimpleMarkerSymbol ../symbols/SimpleLineSymbol ../symbols/SimpleFillSymbol ../graphic ../geometry/jsonUtils ../geometry/webMercatorUtils ../geometry/Polyline ../geometry/Polygon ../geometry/Multipoint ../geometry/Rect dojo/i18n!../nls/jsapi".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v,f,a,c,k,q,B,z,D,A,x,y,G,w){var C=t(a,{declaredClass:"esri.toolbars.Draw",_eventMap:{"draw-complete":!0,"draw-end":["geometry"]},constructor:function(a,b){this.markerSymbol=new c(c.STYLE_SOLID,10,new k(k.STYLE_SOLID,new g([255,0,0]),2),new g([0,0,0,.25]));this.lineSymbol=new k(k.STYLE_SOLID,new g([255,0,0]),2);this.fillSymbol=new q(q.STYLE_SOLID,new k(k.STYLE_SOLID,new g([255,0,0]),2),new g([0,0,0,.25]));this._points=[];this._mouse=!l("esri-touch")&&!l("esri-pointer");
this._defaultOptions={showTooltips:!0,drawTime:75,tolerance:8,tooltipOffset:15};this._options=r.mixin(r.mixin({},this._defaultOptions),b||{});if(h("ios")||h("android"))this._options.showTooltips=!1;this._onKeyDownHandler=r.hitch(this,this._onKeyDownHandler);this._onMouseDownHandler=r.hitch(this,this._onMouseDownHandler);this._onMouseUpHandler=r.hitch(this,this._onMouseUpHandler);this._onClickHandler=r.hitch(this,this._onClickHandler);this._onMouseMoveHandler=r.hitch(this,this._onMouseMoveHandler);
this._onMouseDragHandler=r.hitch(this,this._onMouseDragHandler);this._onDblClickHandler=r.hitch(this,this._onDblClickHandler);this._updateTooltip=r.hitch(this,this._updateTooltip);this._hideTooltip=r.hitch(this,this._hideTooltip);this._redrawGraphic=r.hitch(this,this._redrawGraphic)},_geometryType:null,respectDrawingVertexOrder:!1,setRespectDrawingVertexOrder:function(a){this.respectDrawingVertexOrder=a},setMarkerSymbol:function(a){this.markerSymbol=a},setLineSymbol:function(a){this.lineSymbol=a},
setFillSymbol:function(a){this.fillSymbol=a},activate:function(a,c){this._geometryType&&this.deactivate();var b=this.map,f=m.connect,e=C;this._options=r.mixin(r.mixin({},this._options),c||{});b.navigationManager.setImmediateClick(!1);switch(a){case e.ARROW:case e.LEFT_ARROW:case e.RIGHT_ARROW:case e.UP_ARROW:case e.DOWN_ARROW:case e.TRIANGLE:case e.CIRCLE:case e.ELLIPSE:case e.RECTANGLE:this._deactivateMapTools(!0,!1,!1,!0);this._onClickHandler_connect=f(b,"onClick",this._onClickHandler);this._mouse?
(this._onMouseDownHandler_connect=f(b,"onMouseDown",this._onMouseDownHandler),this._onMouseDragHandler_connect=f(b,"onMouseDrag",this._onMouseDragHandler),this._onMouseUpHandler_connect=f(b,"onMouseUp",this._onMouseUpHandler)):(this._onMouseDownHandler2_connect=f(b,"onMouseDragStart",this._onMouseDownHandler),this._onMouseDragHandler2_connect=f(b,"onMouseDrag",this._onMouseDragHandler),this._onMouseUpHandler2_connect=f(b,"onMouseDragEnd",this._onMouseUpHandler));l("esri-touch")&&!l("esri-pointer")&&
(this._onMouseDownHandler2_connect=f(b,"onSwipeStart",this._onMouseDownHandler),this._onMouseDragHandler2_connect=f(b,"onSwipeMove",this._onMouseDragHandler),this._onMouseUpHandler2_connect=f(b,"onSwipeEnd",this._onMouseUpHandler));break;case e.POINT:this._onClickHandler_connect=f(b,"onClick",this._onClickHandler);break;case e.LINE:case e.EXTENT:case e.FREEHAND_POLYLINE:case e.FREEHAND_POLYGON:this._deactivateMapTools(!0,!1,!1,!0);this._mouse?(this._onMouseDownHandler_connect=f(b,"onMouseDown",this._onMouseDownHandler),
this._onMouseDragHandler_connect=f(b,"onMouseDrag",this._onMouseDragHandler),this._onMouseUpHandler_connect=f(b,"onMouseUp",this._onMouseUpHandler)):(this._onMouseDownHandler_connect=f(b,"onMouseDragStart",this._onMouseDownHandler),this._onMouseDragHandler_connect=f(b,"onMouseDrag",this._onMouseDragHandler),this._onMouseUpHandler_connect=f(b,"onMouseDragEnd",this._onMouseUpHandler));l("esri-touch")&&!l("esri-pointer")&&(this._onMouseDownHandler2_connect=f(b,"onSwipeStart",this._onMouseDownHandler),
this._onMouseDragHandler2_connect=f(b,"onSwipeMove",this._onMouseDragHandler),this._onMouseUpHandler2_connect=f(b,"onSwipeEnd",this._onMouseUpHandler));break;case e.POLYLINE:case e.POLYGON:case e.MULTI_POINT:b.navigationManager.setImmediateClick(!0);this._onClickHandler_connect=f(b,"onClick",this._onClickHandler);this._onDblClickHandler_connect=f(b,"onDblClick",this._onDblClickHandler);this._dblClickZoom=b.isDoubleClickZoom;b.disableDoubleClickZoom();break;default:console.error("Unsupported geometry type: "+
a);return}this._onKeyDown_connect=f(b,"onKeyDown",this._onKeyDownHandler);this._redrawConnect=f(b,"onExtentChange",this._redrawGraphic);this._geometryType=a;this._toggleTooltip(!0);b.snappingManager&&"freehandpolyline"!==this._geometryType&&"freehandpolygon"!==this._geometryType&&(b.snappingManager._startSelectionLayerQuery(),b.snappingManager._setUpSnapping());this.onActivate(this._geometryType)},deactivate:function(){var a=this.map;this._clear();var c=m.disconnect;c(this._onMouseMoveHandler_connect);
c(this._onMouseDownHandler_connect);c(this._onMouseDragHandler_connect);c(this._onMouseUpHandler_connect);c(this._onMouseDownHandler2_connect);c(this._onMouseDragHandler2_connect);c(this._onMouseUpHandler2_connect);c(this._onClickHandler_connect);c(this._onDblClickHandler_connect);c(this._onKeyDown_connect);c(this._redrawConnect);this._onMouseDownHandler_connect=this._onMouseMoveHandler_connect=this._onMouseDragHandler_connect=this._onMouseUpHandler_connect=this._onMouseDownHandler2_connect=this._onMouseDragHandler2_connect=
this._onMouseUpHandler2_connect=this._onClickHandler_connect=this._onDblClickHandler_connect=this._onKeyDown_connect=this._redrawConnect=null;a.snappingManager&&(a.snappingManager._stopSelectionLayerQuery(),a.snappingManager._killOffSnapping());switch(this._geometryType){case C.CIRCLE:case C.ELLIPSE:case C.TRIANGLE:case C.ARROW:case C.LEFT_ARROW:case C.RIGHT_ARROW:case C.UP_ARROW:case C.DOWN_ARROW:case C.RECTANGLE:case C.LINE:case C.EXTENT:case C.FREEHAND_POLYLINE:case C.FREEHAND_POLYGON:this._activateMapTools(!0,
!1,!1,!0);break;case C.POLYLINE:case C.POLYGON:case C.MULTI_POINT:this._dblClickZoom&&a.enableDoubleClickZoom()}c=this._geometryType;this._geometryType=null;a.navigationManager.setImmediateClick(!1);this._toggleTooltip(!1);this.onDeactivate(c)},_clear:function(){this._graphic&&this.map.graphics.remove(this._graphic,!0);this._tGraphic&&this.map.graphics.remove(this._tGraphic,!0);this._graphic=this._tGraphic=null;this.map.snappingManager&&this.map.snappingManager._setGraphic(null);this._points=[]},
finishDrawing:function(){var a,c=this._points,b=this.map.spatialReference,f=C,c=c.slice(0,c.length);switch(this._geometryType){case f.POLYLINE:if(!this._graphic||2>c.length)return;a=new A(b);a.addPath([].concat(c));break;case f.POLYGON:if(!this._graphic||3>c.length)return;a=new x(b);c=[].concat(c,[c[0].offset(0,0)]);x.prototype.isClockwise(c)||this.respectDrawingVertexOrder||(console.debug(this.declaredClass+" :  Polygons drawn in anti-clockwise direction will be reversed to be clockwise."),c.reverse());
a.addRing(c);break;case f.MULTI_POINT:a=new y(b),p.forEach(c,function(c){a.addPoint(c)})}m.disconnect(this._onMouseMoveHandler_connect);this._clear();this._setTooltipMessage(0);this._drawEnd(a)},_drawEnd:function(a){if(a){var c=this.map.spatialReference,b;this.onDrawEnd(a);c&&(c.isWebMercator()?b=D.webMercatorToGeographic(a,!0):4326===c.wkid&&(b=z.fromJson(a.toJson())));this.onDrawComplete({geometry:a,geographicGeometry:b})}},_normalizeRect:function(a,c,b){var f=a.x;a=a.y;var e=c.x;c=c.y;return{x:Math.min(f,
e),y:Math.max(a,c),width:Math.abs(f-e),height:Math.abs(a-c),spatialReference:b}},_onMouseDownHandler:function(a){this._dragged=!1;var c;this.map.snappingManager&&(c=this.map.snappingManager._snappingPoint);var b=c||a.mapPoint,f=C;c=this.map;var e=c.spatialReference;this._points.push(b.offset(0,0));switch(this._geometryType){case f.LINE:this._graphic=c.graphics.add(new B(new A({paths:[[[b.x,b.y],[b.x,b.y]]],spatialReference:e}),this.lineSymbol),!0);c.snappingManager&&c.snappingManager._setGraphic(this._graphic);
break;case f.FREEHAND_POLYLINE:this._oldPoint=a.screenPoint;b=new A(e);b.addPath(this._points);this._graphic=c.graphics.add(new B(b,this.lineSymbol),!0);c.snappingManager&&c.snappingManager._setGraphic(this._graphic);break;case f.CIRCLE:case f.ELLIPSE:case f.TRIANGLE:case f.ARROW:case f.LEFT_ARROW:case f.RIGHT_ARROW:case f.UP_ARROW:case f.DOWN_ARROW:case f.RECTANGLE:case f.FREEHAND_POLYGON:this._oldPoint=a.screenPoint,b=new x(e),b.addRing(this._points),this._graphic=c.graphics.add(new B(b,this.fillSymbol),
!0),c.snappingManager&&c.snappingManager._setGraphic(this._graphic)}l("esri-touch")&&a.preventDefault();if(1===this._points.length)this.onDrawStart()},_onMouseMoveHandler:function(a){var c;this.map.snappingManager&&(c=this.map.snappingManager._snappingPoint);var b=this._points[this._points.length-1];a=c||a.mapPoint;c=this._tGraphic;var f=c.geometry;switch(this._geometryType){case C.POLYLINE:case C.POLYGON:f.setPoint(0,0,{x:b.x,y:b.y}),f.setPoint(0,1,{x:a.x,y:a.y}),c.setGeometry(f)}},_onMouseDragHandler:function(a){if(this._graphic||
this._points.length)if(l("esri-touch")&&!this._points.length)a.preventDefault();else{this._dragged=!0;var c;this.map.snappingManager&&(c=this.map.snappingManager._snappingPoint);var b=this._points[0],f=c||a.mapPoint,e=this.map,d=e.spatialReference;c=this._graphic;var g=C,k=e.toScreen(b),q=e.toScreen(f),h=[],h=q.x-k.x,q=q.y-k.y,n=Math.sqrt(h*h+q*q);switch(this._geometryType){case g.CIRCLE:this._hideTooltip();c.geometry=x.createCircle({center:k,r:n,numberOfPoints:60,map:e});c.setGeometry(c.geometry);
break;case g.ELLIPSE:this._hideTooltip();c.geometry=x.createEllipse({center:k,longAxis:h,shortAxis:q,numberOfPoints:60,map:e});c.setGeometry(c.geometry);break;case g.TRIANGLE:this._hideTooltip();h=[[0,-n],[.8660254037844386*n,.5*n],[-.8660254037844386*n,.5*n],[0,-n]];c.geometry=this._toPolygon(h,k.x,k.y);c.setGeometry(c.geometry);break;case g.ARROW:this._hideTooltip();b=q/n;e=h/n;f=.25*e*n;d=.25*n/(q/h);n*=.25*b;h=[[h,q],[h-f*(1+24/d),q+24*e-n],[h-f*(1+12/d),q+12*e-n],[-12*b,12*e],[12*b,-12*e],[h-
f*(1-12/d),q-12*e-n],[h-f*(1-24/d),q-24*e-n],[h,q]];c.geometry=this._toPolygon(h,k.x,k.y);c.setGeometry(c.geometry);break;case g.LEFT_ARROW:this._hideTooltip();h=0>=h?[[h,0],[.75*h,q],[.75*h,.5*q],[0,.5*q],[0,-.5*q],[.75*h,-.5*q],[.75*h,-q],[h,0]]:[[0,0],[.25*h,q],[.25*h,.5*q],[h,.5*q],[h,-.5*q],[.25*h,-.5*q],[.25*h,-q],[0,0]];c.geometry=this._toPolygon(h,k.x,k.y);c.setGeometry(c.geometry);break;case g.RIGHT_ARROW:this._hideTooltip();h=0<=h?[[h,0],[.75*h,q],[.75*h,.5*q],[0,.5*q],[0,-.5*q],[.75*h,
-.5*q],[.75*h,-q],[h,0]]:[[0,0],[.25*h,q],[.25*h,.5*q],[h,.5*q],[h,-.5*q],[.25*h,-.5*q],[.25*h,-q],[0,0]];c.geometry=this._toPolygon(h,k.x,k.y);c.setGeometry(c.geometry);break;case g.UP_ARROW:this._hideTooltip();h=0>=q?[[0,q],[-h,.75*q],[-.5*h,.75*q],[-.5*h,0],[.5*h,0],[.5*h,.75*q],[h,.75*q],[0,q]]:[[0,0],[-h,.25*q],[-.5*h,.25*q],[-.5*h,q],[.5*h,q],[.5*h,.25*q],[h,.25*q],[0,0]];c.geometry=this._toPolygon(h,k.x,k.y);c.setGeometry(c.geometry);break;case g.DOWN_ARROW:this._hideTooltip();h=0<=q?[[0,q],
[-h,.75*q],[-.5*h,.75*q],[-.5*h,0],[.5*h,0],[.5*h,.75*q],[h,.75*q],[0,q]]:[[0,0],[-h,.25*q],[-.5*h,.25*q],[-.5*h,q],[.5*h,q],[.5*h,.25*q],[h,.25*q],[0,0]];c.geometry=this._toPolygon(h,k.x,k.y);c.setGeometry(c.geometry);break;case g.RECTANGLE:this._hideTooltip();h=[[0,0],[h,0],[h,q],[0,q],[0,0]];c.geometry=this._toPolygon(h,k.x,k.y);c.setGeometry(c.geometry);break;case g.LINE:c.setGeometry(r.mixin(c.geometry,{paths:[[[b.x,b.y],[f.x,f.y]]]}));break;case g.EXTENT:c&&e.graphics.remove(c,!0);c=new G(this._normalizeRect(b,
f,d));c._originOnly=!0;this._graphic=e.graphics.add(new B(c,this.fillSymbol),!0);e.snappingManager&&e.snappingManager._setGraphic(this._graphic);break;case g.FREEHAND_POLYLINE:this._hideTooltip();if(!1===this._canDrawFreehandPoint(a)){l("esri-touch")&&a.preventDefault();return}this._points.push(a.mapPoint.offset(0,0));c.geometry._insertPoints([f.offset(0,0)],0);c.setGeometry(c.geometry);break;case g.FREEHAND_POLYGON:this._hideTooltip();if(!1===this._canDrawFreehandPoint(a)){l("esri-touch")&&a.preventDefault();
return}this._points.push(a.mapPoint.offset(0,0));c.geometry._insertPoints([f.offset(0,0)],0);c.setGeometry(c.geometry)}l("esri-touch")&&a.preventDefault()}},_canDrawFreehandPoint:function(a){if(!this._oldPoint)return!1;var c=this._oldPoint.x-a.screenPoint.x,b=this._oldPoint.y-a.screenPoint.y,f=this._options.tolerance;if((0>c?-1*c:c)<f&&(0>b?-1*b:b)<f)return!1;c=new Date;if(c-this._startTime<this._options.drawTime)return!1;this._startTime=c;this._oldPoint=a.screenPoint;return!0},_onMouseUpHandler:function(a){if(this._dragged&&
this._graphic){0===this._points.length&&this._points.push(a.mapPoint.offset(0,0));var c;this.map.snappingManager&&(c=this.map.snappingManager._snappingPoint);var b=this._points[0];c=c||a.mapPoint;var f=this.map.spatialReference,e=C,d;switch(this._geometryType){case e.CIRCLE:case e.ELLIPSE:case e.TRIANGLE:case e.ARROW:case e.LEFT_ARROW:case e.RIGHT_ARROW:case e.UP_ARROW:case e.DOWN_ARROW:case e.RECTANGLE:d=this._graphic.geometry;break;case e.LINE:d=new A({paths:[[[b.x,b.y],[c.x,c.y]]],spatialReference:f});
break;case e.EXTENT:d=(new G(this._normalizeRect(b,c,f))).getExtent();break;case e.FREEHAND_POLYLINE:d=new A(f);d.addPath([].concat(this._points,[c.offset(0,0)]));break;case e.FREEHAND_POLYGON:d=new x(f),b=[].concat(this._points,[c.offset(0,0),this._points[0].offset(0,0)]),x.prototype.isClockwise(b)||this.respectDrawingVertexOrder||(console.debug(this.declaredClass+" :  Polygons drawn in anti-clockwise direction will be reversed to be clockwise."),b.reverse()),d.addRing(b)}l("esri-touch")&&a.preventDefault();
this._clear();this._drawEnd(d)}else this._clear()},_onClickHandler:function(a){var c;this.map.snappingManager&&(c=this.map.snappingManager._snappingPoint);a=c||a.mapPoint;c=this.map;var b=c.toScreen(a),f=C;this._points.push(a.offset(0,0));switch(this._geometryType){case f.POINT:this.onDrawStart();this._drawEnd(a.offset(0,0));this._setTooltipMessage(0);break;case f.POLYLINE:1===this._points.length?(b=new A(c.spatialReference),b.addPath(this._points),this._graphic=c.graphics.add(new B(b,this.lineSymbol),
!0),c.snappingManager&&c.snappingManager._setGraphic(this._graphic),this._onMouseMoveHandler_connect=m.connect(c,"onMouseMove",this._onMouseMoveHandler),this._tGraphic=c.graphics.add(new B(new A({paths:[[[a.x,a.y],[a.x,a.y]]],spatialReference:c.spatialReference}),this.lineSymbol),!0),this.onDrawStart()):(this._graphic.geometry._insertPoints([a.offset(0,0)],0),this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.lineSymbol),c=this._tGraphic,b=c.geometry,b.setPoint(0,0,a.offset(0,0)),b.setPoint(0,
1,a.offset(0,0)),c.setGeometry(b));break;case f.POLYGON:1===this._points.length?(b=new x(c.spatialReference),b.addRing(this._points),this._graphic=c.graphics.add(new B(b,this.fillSymbol),!0),c.snappingManager&&c.snappingManager._setGraphic(this._graphic),this._onMouseMoveHandler_connect=m.connect(c,"onMouseMove",this._onMouseMoveHandler),this._tGraphic=c.graphics.add(new B(new A({paths:[[[a.x,a.y],[a.x,a.y]]],spatialReference:c.spatialReference}),this.fillSymbol),!0),this.onDrawStart()):(this._graphic.geometry._insertPoints([a.offset(0,
0)],0),this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.fillSymbol),c=this._tGraphic,b=c.geometry,b.setPoint(0,0,a.offset(0,0)),b.setPoint(0,1,a.offset(0,0)),c.setGeometry(b));break;case f.MULTI_POINT:a=this._points;1===a.length?(b=new y(c.spatialReference),b.addPoint(a[a.length-1]),this._graphic=c.graphics.add(new B(b,this.markerSymbol),!0),c.snappingManager&&c.snappingManager._setGraphic(this._graphic),this.onDrawStart()):(this._graphic.geometry.addPoint(a[a.length-1]),this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.markerSymbol));
break;case f.ARROW:this._addShape([[0,0],[-24,24],[-24,12],[-96,12],[-96,-12],[-24,-12],[-24,-24],[0,0]],b.x,b.y);break;case f.LEFT_ARROW:this._addShape([[0,0],[24,24],[24,12],[96,12],[96,-12],[24,-12],[24,-24],[0,0]],b.x,b.y);break;case f.RIGHT_ARROW:this._addShape([[0,0],[-24,24],[-24,12],[-96,12],[-96,-12],[-24,-12],[-24,-24],[0,0]],b.x,b.y);break;case f.UP_ARROW:this._addShape([[0,0],[-24,24],[-12,24],[-12,96],[12,96],[12,24],[24,24],[0,0]],b.x,b.y);break;case f.DOWN_ARROW:this._addShape([[0,
0],[-24,-24],[-12,-24],[-12,-96],[12,-96],[12,-24],[24,-24],[0,0]],b.x,b.y);break;case f.TRIANGLE:this._addShape([[0,-48],[41.56921938165306,24],[-41.56921938165306,24],[0,-48]],b.x,b.y);break;case f.RECTANGLE:this._addShape([[0,-96],[96,-96],[96,0],[0,0],[0,-96]],b.x-48,b.y+48);break;case f.CIRCLE:this._clear();this.onDrawStart();this._drawEnd(x.createCircle({center:b,r:48,numberOfPoints:60,map:c}));break;case f.ELLIPSE:this._clear(),this.onDrawStart(),this._drawEnd(x.createEllipse({center:b,longAxis:48,
shortAxis:24,numberOfPoints:60,map:c}))}this._setTooltipMessage(this._points.length)},_addShape:function(a,c,b){this._setTooltipMessage(0);this._clear();this.onDrawStart();this._drawEnd(this._toPolygon(a,c,b))},_toPolygon:function(a,c,b){var f=this.map,e=new x(f.spatialReference);e.addRing(p.map(a,function(a){return f.toMap({x:a[0]+c,y:a[1]+b})}));return e},_onDblClickHandler:function(a){var c,b=this._points,f=this.map.spatialReference,e=C;l("esri-touch")&&b.push(a.mapPoint);var d=b[b.length-1],g=
b[b.length-2],b=d&&g&&d.x===g.x&&d.y===g.y?b.slice(0,b.length-1):b.slice(0,b.length);switch(this._geometryType){case e.POLYLINE:if(!this._graphic||2>b.length){m.disconnect(this._onMouseMoveHandler_connect);this._clear();this._onClickHandler(a);return}c=new A(f);c.addPath([].concat(b));break;case e.POLYGON:if(!this._graphic||2>b.length){m.disconnect(this._onMouseMoveHandler_connect);this._clear();this._onClickHandler(a);return}c=new x(f);a=[].concat(b,[b[0].offset(0,0)]);x.prototype.isClockwise(a)||
this.respectDrawingVertexOrder||(console.debug(this.declaredClass+" :  Polygons drawn in anti-clockwise direction will be reversed to be clockwise."),a.reverse());c.addRing(a);break;case e.MULTI_POINT:c=new y(f),p.forEach(b,function(a){c.addPoint(a)})}m.disconnect(this._onMouseMoveHandler_connect);this._clear();this._setTooltipMessage(0);this._drawEnd(c)},_onKeyDownHandler:function(a){a.keyCode===u.ESCAPE&&(m.disconnect(this._onMouseMoveHandler_connect),this._clear(),this._setTooltipMessage(0))},
_toggleTooltip:function(a){this._options.showTooltips&&(a?this._tooltip||(this._tooltip=e.create("div",{"class":"esriMapTooltip"},this.map.container),n.isBodyLtr()||b.set(this._tooltip,"direction","rtl"),this._tooltip.style.display="none",this._tooltip.style.position="fixed",this._setTooltipMessage(0),this._onTooltipMouseEnterHandler_connect=m.connect(this.map,"onMouseOver",this._updateTooltip),this._onTooltipMouseLeaveHandler_connect=m.connect(this.map,"onMouseOut",this._hideTooltip),this._onTooltipMouseMoveHandler_connect=
m.connect(this.map,"onMouseMove",this._updateTooltip)):this._tooltip&&(m.disconnect(this._onTooltipMouseEnterHandler_connect),m.disconnect(this._onTooltipMouseLeaveHandler_connect),m.disconnect(this._onTooltipMouseMoveHandler_connect),e.destroy(this._tooltip),this._tooltip=null))},_hideTooltip:function(){var a=this._tooltip;a&&(a.style.display="none")},_setTooltipMessage:function(a){var c=this._tooltip;if(c){var b="";switch(this._geometryType){case C.POINT:b=w.toolbars.draw.addPoint;break;case C.ARROW:case C.LEFT_ARROW:case C.RIGHT_ARROW:case C.UP_ARROW:case C.DOWN_ARROW:case C.TRIANGLE:case C.RECTANGLE:case C.CIRCLE:case C.ELLIPSE:b=
w.toolbars.draw.addShape;break;case C.LINE:case C.EXTENT:case C.FREEHAND_POLYLINE:case C.FREEHAND_POLYGON:b=w.toolbars.draw.freehand;break;case C.POLYLINE:case C.POLYGON:b=w.toolbars.draw.start;1===a?b=w.toolbars.draw.resume:2<=a&&(b=w.toolbars.draw.complete);break;case C.MULTI_POINT:b=w.toolbars.draw.addMultipoint,1<=a&&(b=w.toolbars.draw.finish)}c.innerHTML=b}},_updateTooltip:function(a){var c=this._tooltip;if(c){var f;a.clientX||a.pageY?(f=a.clientX,a=a.clientY):(f=a.clientX+d.body().scrollLeft-
d.body().clientLeft,a=a.clientY+d.body().scrollTop-d.body().clientTop);c.style.display="none";b.set(c,{left:f+this._options.tooltipOffset+"px",top:a+"px"});c.style.display=""}},_redrawGraphic:function(a,c,b,f){if(b||this.map.wrapAround180)(a=this._graphic)&&a.setGeometry(a.geometry),(a=this._tGraphic)&&a.setGeometry(a.geometry)},onActivate:function(){},onDeactivate:function(){},onDrawComplete:function(){},onDrawStart:function(){},onDrawEnd:function(){}});r.mixin(C,{POINT:"point",MULTI_POINT:"multipoint",
LINE:"line",EXTENT:"extent",POLYLINE:"polyline",POLYGON:"polygon",FREEHAND_POLYLINE:"freehandpolyline",FREEHAND_POLYGON:"freehandpolygon",ARROW:"arrow",LEFT_ARROW:"leftarrow",RIGHT_ARROW:"rightarrow",UP_ARROW:"uparrow",DOWN_ARROW:"downarrow",TRIANGLE:"triangle",CIRCLE:"circle",ELLIPSE:"ellipse",RECTANGLE:"rectangle"});l("extend-esri")&&r.setObject("toolbars.Draw",C,v);return C})},"esri/toolbars/_toolbar":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel","../Evented"],
function(t,r,p,m,g){t=t([g],{declaredClass:"esri.toolbars._Toolbar",constructor:function(d){this.map=d},_cursors:{move:"pointer","move-v":"pointer","move-gv":"pointer",box0:"nw-resize",box1:"n-resize",box2:"ne-resize",box3:"e-resize",box4:"se-resize",box5:"s-resize",box6:"sw-resize",box7:"w-resize",box8:"pointer"},_deactivateMapTools:function(d,g,h,u){var e=this.map;d&&(this._mapNavState={isDoubleClickZoom:e.isDoubleClickZoom,isClickRecenter:e.isClickRecenter,isPan:e.isPan,isRubberBandZoom:e.isRubberBandZoom,
isKeyboardNavigation:e.isKeyboardNavigation,isScrollWheelZoom:e.isScrollWheelZoom},e.disableDoubleClickZoom(),e.disableClickRecenter(),e.disablePan(),e.disableRubberBandZoom(),e.disableKeyboardNavigation());g&&e.hideZoomSlider();h&&e.hidePanArrows();u&&e.graphics.disableMouseEvents()},_activateMapTools:function(d,g,h,u){var e=this.map,b=this._mapNavState;d&&b&&(b.isDoubleClickZoom&&e.enableDoubleClickZoom(),b.isClickRecenter&&e.enableClickRecenter(),b.isPan&&e.enablePan(),b.isRubberBandZoom&&e.enableRubberBandZoom(),
b.isKeyboardNavigation&&e.enableKeyboardNavigation(),b.isScrollWheelZoom&&e.enableScrollWheelZoom());g&&e.showZoomSlider();h&&e.showPanArrows();u&&e.graphics.enableMouseEvents()},_deactivateScrollWheel:function(){var d=this.map;this._scrollWheelState={isScrollWheelZoom:d.isScrollWheelZoom,isScrollWheelPan:d.isScrollWheelPan};d.disableScrollWheelZoom();d.disableScrollWheelPan()},_activateScrollWheel:function(){var d=this.map,g=this._scrollWheelState;g&&(g.isScrollWheelZoom&&d.enableScrollWheelZoom(),
g.isScrollWheelPan&&d.enableScrollWheelPan())}});p("extend-esri")&&r.setObject("toolbars._Toolbar",t,m);return t})},"esri/toolbars/edit":function(){define("require dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/array dojo/_base/Color dojo/has dojo/dom-construct dojo/dom-style ../kernel ../lang ../sniff ./_toolbar ./_Box ./_GraphicMover ./_VertexEditor ./TextEditor ../symbols/SimpleMarkerSymbol ../symbols/SimpleLineSymbol ../symbols/TextSymbol ../graphic".split(" "),function(t,r,
p,m,g,d,l,h,u,e,b,n,v,f,a,c,k,q,B,z,D){var A=r(v,{declaredClass:"esri.toolbars.Edit",constructor:function(a,c){this._map=a;this._tool=0;if(this._map.loaded)this._scratchGL=a.graphics;else var b=m.connect(this._map,"onLoad",this,function(){m.disconnect(b);b=null;this._scratchGL=this._map.graphics});var f=l("esri-mobile");this._defaultOptions=p.mixin({vertexSymbol:new q(q.STYLE_CIRCLE,f?20:12,new B(B.STYLE_SOLID,new d([0,0,0,.5]),1),new d([128,128,128])),ghostVertexSymbol:new q(q.STYLE_CIRCLE,f?18:
10,new B(B.STYLE_SOLID,new d([0,0,0,.5]),1),new d([255,255,255,.75])),ghostLineSymbol:new B(B.STYLE_DOT,new d([128,128,128]),2),allowDeleteVertices:!0,allowAddVertices:!0,rotateHandleOffset:f?24:16,boxLineSymbol:new B(B.STYLE_DASH,new d([64,64,64]),1),boxHandleSymbol:new q(q.STYLE_SQUARE,f?16:9,new B(B.STYLE_SOLID,new d([0,0,0,.5]),1),new d([255,255,255,.75])),textAnchorSymbol:new q(q.STYLE_CIRCLE,10,null,new d([255,0,0]))},c||{})},activate:function(a,c,b){this.deactivate();this._graphic=c;this._options=
p.mixin(p.mixin({},this._defaultOptions),b||{});var f=A.MOVE;b=A.EDIT_VERTICES;var e=A.SCALE,d=A.ROTATE,g=A.EDIT_TEXT,q=!1,k=!1,h=!1,n=this._map,v=n.spatialReference,x=c.geometry.spatialReference;this._geo=!(!v||!x||v.equals(x)||!v.isWebMercator()||4326!==x.wkid);this._isTextPoint=this._prepareTextSymbolEditing(c,a);(a&f)===f&&(q=this._enableMove(c));f=(a&e)===e;d=(a&d)===d;if(f||d)h=this._enableBoxEditing(c,f,d);(a&b)===b&&(k=this._enableVertexEditing(c));(a&g)===g&&this._enableTextEditing(c);if(!(q||
k||h))throw Error("[esri.toolbars.Edit::activate] Unable to activate the tool. Check if the tool is valid for the given geometry type.");if(this._tool=a)this._mapPanEndHandle=m.connect(n,"onPanEnd",this,this._mapPanEndHandler),this._mapExtChgHandle=m.connect(n,"onExtentChange",this,this._mapExtentChangeHandler),this.onActivate(this._tool,c);n.snappingManager&&(q||k)&&n.snappingManager._startSelectionLayerQuery()},deactivate:function(){this._isTextPoint=null;var a=this._tool,c=this._graphic;if(a){var b=
!!this._modified;this._clear();m.disconnect(this._mapPanEndHandle);m.disconnect(this._mapExtChgHandle);this._graphic=this._geo=this._mapPanEndHandle=this._mapExtChgHandle=null;this.onDeactivate(a,c,{isModified:b});this._map.snappingManager&&this._map.snappingManager._stopSelectionLayerQuery()}},refresh:function(){this._refreshMoveables(!0)},getCurrentState:function(){return{tool:this._tool,graphic:this._graphic,isModified:!!this._modified}},onActivate:function(a,c){},onDeactivate:function(a,c,b){},
onGraphicMoveStart:function(a){},onGraphicFirstMove:function(a){this._modified=!0},onGraphicMove:function(a,c){},onGraphicMoveStop:function(a,c){},onGraphicClick:function(a,c){},onVertexMoveStart:function(a,c){},onVertexFirstMove:function(a,c){this._modified=!0},onVertexMove:function(a,c,b){},onVertexMoveStop:function(a,c,b){},onVertexAdd:function(a,c){this._modified=!0},onVertexClick:function(a,c){},onVertexMouseOver:function(a,c){},onVertexMouseOut:function(a,c){},onVertexDelete:function(a,c){this._modified=
!0},onTextEditStart:function(a,c){},onTextEditEnd:function(a){},onScaleStart:function(a){},onScaleFirstMove:function(a){this._modified=!0},onScale:function(a,c){},onScaleStop:function(a,c){},onRotateStart:function(a){},onRotateFirstMove:function(a){this._modified=!0},onRotate:function(a,c){},onRotateStop:function(a,c){},_eventMap:{activate:["tool","graphic"],deactivate:["tool","graphic","info"],"graphic-move-start":["graphic"],"graphic-first-move":["graphic"],"graphic-move":["graphic","transform"],
"graphic-move-stop":["graphic","transform"],"graphic-click":["graphic","info"],"vertex-move-start":["graphic","vertexinfo"],"vertex-first-move":["graphic","vertexinfo"],"vertex-move":["graphic","vertexinfo","transform"],"vertex-move-stop":["graphic","vertexinfo","transform"],"vertex-add":["graphic","vertexinfo"],"vertex-click":["graphic","vertexinfo"],"vertex-mouse-over":["graphic","vertexinfo"],"vertex-mouse-out":["graphic","vertexinfo"],"vertex-delete":["graphic","vertexinfo"],"scale-start":["graphic"],
"scale-first-move":["graphic"],scale:["graphic","info"],"scale-stop":["graphic","info"],"rotate-start":["graphic"],"rotate-first-move":["graphic"],rotate:["graphic","info"],"rotate-stop":["graphic","info"]},_prepareTextSymbolEditing:function(a,c){if("point"===a.geometry.type||"multipoint"===a.geometry.type){var b=a.getLayer(),f=b.renderer,b=a.symbol||b._getSymbol(a);!b&&(f.hasVisualVariables("sizeInfo",!1)||f.hasVisualVariables("colorInfo",!1)||f.hasVisualVariables("opacityInfo",!1))&&f.addBreak&&
f.infos&&1===f.infos.length&&(b=f.infos[0].symbol||f.defaultSymbol);if(b&&"textsymbol"===b.type){if((c&A.SCALE)===A.SCALE||(c&A.ROTATE)===A.ROTATE||(c&A.EDIT_TEXT)===A.EDIT_TEXT){a.setSymbol(new z(b.toJson()));var e=this;this._textSymbolEditor?(this._textSymbolEditor.createForm(a),this._textSymbolEditor.show()):this._options&&this._options.textSymbolEditor?(this._textSymbolEditor=this._options.textSymbolEditor,this._textSymbolEditor.on("symbol-change",function(){e._boxEditor&&e._boxEditor.refresh()})):
t(["../dijit/SymbolEditor"],function(c){if(!e._textSymbolEditor){var b;b=e._options.textSymbolEditorHolder?h.create("div",null,e._options.textSymbolEditorHolder):h.create("div",null,e._map.root);e._textSymbolEditor=new c({graphic:a},b);c=e._textSymbolEditor.domNode.parentNode.id;u.set(e._textSymbolEditor.domNode,{position:"map_root"===c?"absolute":"relative",left:"map_root"===c?e._map.width/2-100+"px":"5px",top:"20px","z-index":50});e._textSymbolEditor.startup();e._textSymbolEditor.createForm(a);
e._textSymbolEditor.show();e._textSymbolEditor.on("symbol-change",function(){e._boxEditor&&e._boxEditor.refresh()})}})}if((c&A.MOVE)===A.MOVE||(c&A.ROTATE)===A.ROTATE||(c&A.SCALE)===A.SCALE)this._textAnchor=new D(a.geometry,this._options.textAnchorSymbol),this._scratchGL.add(this._textAnchor);return!0}}return!1},_enableMove:function(c){var b=this._map;switch(c.geometry.type){case "point":case "polyline":case "polygon":return this._graphicMover=new a(c,b,this,this._textAnchor),!0}return!1},_enableVertexEditing:function(a){var b=
this._map;switch(a.geometry.type){case "multipoint":case "polyline":case "polygon":return this._vertexEditor=c.create(a,b,this),!0}return!1},_enableBoxEditing:function(a,c,b){var e=this._map,d=a.geometry.type;return"polyline"===d||"polygon"===d||this._isTextPoint?(this._boxEditor=new f(a,e,this,c,b,this._options.uniformScaling,this._isTextPoint),!0):!1},_enableTextEditing:function(a){return this._isTextPoint?(this._textEditor=new k(a,this._map,this),m.connect(this._textEditor,"onEditStart",p.hitch(this,
function(){this._textAnchor&&(this._textAnchor.getLayer().remove(this._textAnchor),this._textAnchor=null);this._map.disableKeyboardNavigation();this._disableMove();this._disableBoxEditing()})),!0):!1},_disableMove:function(){var a=this._graphicMover;a&&(a.destroy(),this._graphicMover=null)},_disableVertexEditing:function(){var a=this._vertexEditor;a&&(a.destroy(),this._vertexEditor=null)},_disableBoxEditing:function(){var a=this._boxEditor;a&&(a.destroy(),this._boxEditor=null)},_disableTextEditing:function(){this._textEditor&&
(this._textEditor.destroy(),this._textEditor=null);this._map.enableKeyboardNavigation()},_disableSymbolEditing:function(){this._textSymbolEditor&&this._textSymbolEditor.hide()},_clear:function(){this._disableMove();this._disableVertexEditing();this._disableBoxEditing();this._disableTextEditing();this._disableSymbolEditing();this._textAnchor&&(this._textAnchor.getLayer().remove(this._textAnchor),this._textAnchor=null);this._tool=0;this._modified=!1},_mapPanEndHandler:function(){this._refreshMoveables()},
_mapExtentChangeHandler:function(a,c,b){b&&this._refreshMoveables()},_refreshMoveables:function(a){var c=g.filter([this._graphicMover,this._vertexEditor,this._boxEditor],b.isDefined);g.forEach(c,function(c){c.refresh(a)})},_beginOperation:function(a){g.forEach(this._getAffectedTools(a),function(a){a.suspend()})},_endOperation:function(a){g.forEach(this._getAffectedTools(a),function(a){a.resume()})},_getAffectedTools:function(a){var c=[];switch(a){case "MOVE":c=[this._vertexEditor,this._boxEditor];
break;case "VERTICES":c=[this._boxEditor];break;case "BOX":c=[this._vertexEditor]}return c=g.filter(c,b.isDefined)}});p.mixin(A,{MOVE:1,EDIT_VERTICES:2,SCALE:4,ROTATE:8,EDIT_TEXT:16});l("extend-esri")&&p.setObject("toolbars.Edit",A,e);return A})},"esri/toolbars/_Box":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/Color dojo/has dojo/dom-style dojox/gfx/Moveable dojox/gfx/matrix ../kernel ../lang ../geometry/Point ../geometry/Polyline ../symbols/SimpleMarkerSymbol ../geometry/webMercatorUtils ../geometry/jsonUtils ../graphic".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v,f,a,c,k){t=t(null,{declaredClass:"esri.toolbars._Box",constructor:function(a,c,b,f,e,d,g){this._graphic=a;this._map=c;this._toolbar=b;this._scale=f;this._rotate=e;this._defaultEventArgs={};this._scaleEvent="Scale";this._rotateEvent="Rotate";this._uniformScaling=d;a=b._options;this._markerSymbol=a.boxHandleSymbol;this._lineSymbol=a.boxLineSymbol;this._moveStartHandler=r.hitch(this,this._moveStartHandler);this._firstMoveHandler=r.hitch(this,this._firstMoveHandler);
this._moveStopHandler=r.hitch(this,this._moveStopHandler);this._moveHandler=r.hitch(this,this._moveHandler);this._isTextPoint=g;this._init()},destroy:function(){this._cleanUp();this._graphic=this._map=this._toolbar=this._markerSymbol=this._lineSymbol=null},refresh:function(){this._draw()},suspend:function(){p.forEach(this._getAllGraphics(),function(a){a.hide()})},resume:function(){p.forEach(this._getAllGraphics(),function(a){a.show()});this._draw()},_init:function(){this._draw()},_cleanUp:function(){this._connects&&
p.forEach(this._connects,m.disconnect);var a=this._toolbar._scratchGL;this._anchors&&p.forEach(this._anchors,function(c){a.remove(c.graphic);(c=c.moveable)&&c.destroy()});this._box&&a.remove(this._box);this._box=this._anchors=this._connects=null},_draw:function(){if(this._graphic.getDojoShape()){var a=this._map,c=this._toolbar._scratchGL,b=this._getBoxCoords(),f=new v(a.spatialReference),e=r.clone(p.filter(b,function(a,c){return 8!==c&&0===c%2}));e[0]&&e.push([e[0][0],e[0][1]]);f.addPath(e);this._rotate&&
f.addPath([b[1],b[8]]);this._box?this._box.setGeometry(f):(this._box=new k(f,this._lineSymbol),c.add(this._box));this._anchors?p.forEach(this._anchors,function(c,f){this._scale||(f=8);var e=new n(b[f],a.spatialReference);c.graphic.setGeometry(e);var e=c.moveable,d=c.graphic.getDojoShape();d&&(e?d!==e.shape&&(e.destroy(),c.moveable=this._getMoveable(c.graphic,f)):c.moveable=this._getMoveable(c.graphic,f))},this):(this._anchors=[],this._connects=[],p.forEach(b,function(b,f){if(this._scale||!(8>f)){b=
new n(b,a.spatialReference);var e=new k(b,this._markerSymbol);this._isTextPoint&&1===f%2&&e.hide();c.add(e);this._anchors.push({graphic:e,moveable:this._getMoveable(e,f)})}},this))}else this._cleanUp()},_getBoxCoords:function(a){var c=this._map,b,f=[],e,d,g;if(this._isTextPoint){b=this._graphic.getNode().getBoundingClientRect();var q=c.__container.getBoundingClientRect();b=[{x:b.left-q.left,y:b.top-q.top},{x:b.right-q.left,y:b.top-q.top},{x:b.right-q.left,y:b.bottom-q.top},{x:b.left-q.left,y:b.bottom-
q.top}]}else b=this._getTransformedBoundingBox(this._graphic);p.forEach(b,function(b,q,k){e=b;(d=k[q+1])||(d=k[0]);g={x:(e.x+d.x)/2,y:(e.y+d.y)/2};a||(e=c.toMap(e),g=c.toMap(g));f.push([e.x,e.y]);f.push([g.x,g.y])});this._rotate&&(b=r.clone(f[1]),b=a?{x:b[0],y:b[1]}:c.toScreen({x:b[0],y:b[1],spatialReference:c.spatialReference}),b.y-=this._toolbar._options.rotateHandleOffset,a||(b=c.toMap(b)),f.push([b.x,b.y]));return f},_getTransformedBoundingBox:function(a){var c=this._map,b=a.geometry.getExtent(),
f=a.geometry.spatialReference;a=new n(b.xmin,b.ymax,f);b=new n(b.xmax,b.ymin,f);a=c.toScreen(a);b=c.toScreen(b);return[{x:a.x,y:a.y},{x:b.x,y:a.y},{x:b.x,y:b.y},{x:a.x,y:b.y}]},_getAllGraphics:function(){var a=[this._box];this._anchors&&p.forEach(this._anchors,function(c){a.push(c.graphic)});return a=p.filter(a,b.isDefined)},_getMoveable:function(a,c){var b=a.getDojoShape();if(b){var f=new h(b);f._index=c;this._connects.push(m.connect(f,"onMoveStart",this._moveStartHandler));this._connects.push(m.connect(f,
"onFirstMove",this._firstMoveHandler));this._connects.push(m.connect(f,"onMoveStop",this._moveStopHandler));f.onMove=this._moveHandler;(b=b.getEventSource())&&l.set(b,"cursor",this._toolbar._cursors["box"+c]);return f}},_moveStartHandler:function(a){this._toolbar["on"+(8===a.host._index?this._rotateEvent:this._scaleEvent)+"Start"](this._graphic)},_firstMoveHandler:function(a){this._toolbar._deactivateScrollWheel();var c=a.host._index,b=this._wrapOffset=a.host.shape._wrapOffsets[0]||0,f=this._graphic.getLayer()._getTransform(),
e;a=p.map(this._getBoxCoords(!0),function(a){return{x:a[0]+b,y:a[1]}});e=this._isTextPoint?this._map.toScreen(this._graphic.geometry):{x:a[1].x,y:a[3].y};this._centerCoord=u.multiplyPoint(u.invert(f),e);if(8===c)e=u.multiplyPoint(u.invert(f),a[1]),this._isTextPoint&&(this._centerCoord=this._deNormalizePoint(this._centerCoord,e)),this._startLine=[this._centerCoord,e],this._moveLine=r.clone(this._startLine);else if(e=u.multiplyPoint(u.invert(f),a[c]),f=u.multiplyPoint(u.invert(f),a[(c+4)%8]),this._isTextPoint&&
(this._centerCoord=this._deNormalizePoint(this._centerCoord,e)),this._firstMoverToAnchor=Math.sqrt((e.x-this._centerCoord.x)*(e.x-this._centerCoord.x)+(e.y-this._centerCoord.y)*(e.y-this._centerCoord.y)),this._startBox=f,this._startBox.width=a[4].x-a[0].x,this._startBox.height=a[4].y-a[0].y,this._moveBox=r.clone(this._startBox),this._xfactor=e.x>f.x?1:-1,this._yfactor=e.y>f.y?1:-1,1===c||5===c)this._xfactor=0;else if(3===c||7===c)this._yfactor=0;this._toolbar._beginOperation("BOX");this._toolbar["on"+
(8===c?this._rotateEvent:this._scaleEvent)+"FirstMove"](this._graphic)},_moveHandler:function(a,c){var b=a.host._index,f=this._defaultEventArgs,e,d,g,k;f.angle=0;f.scaleX=1;f.scaleY=1;if(8===b)e=this._startLine,d=this._moveLine,g=d[1],g.x+=c.dx,g.y+=c.dy,g=this._getAngle(e,d),this._isTextPoint&&(g+=this._graphic.symbol.angle),d=u.rotategAt(g,e[0]),this._graphic.getDojoShape().setTransform(d),f.transform=d,f.angle=g,f.around=e[0];else{e=this._startBox;d=this._moveBox;d.width+=c.dx*this._xfactor;d.height+=
c.dy*this._yfactor;this._uniformScaling||this._isTextPoint?(e=d.x+this._xfactor*d.width,d=d.y+this._yfactor*d.height,e=Math.sqrt((e-this._centerCoord.x)*(e-this._centerCoord.x)+(d-this._centerCoord.y)*(d-this._centerCoord.y)),this._scaleRatio=g=k=e/this._firstMoverToAnchor,e=this._centerCoord):(g=d.width/e.width,k=d.height/e.height,e={x:e.x,y:e.y});if(isNaN(g)||Infinity===g||-Infinity===g)g=1;if(isNaN(k)||Infinity===k||-Infinity===k)k=1;d=u.scaleAt(g,k,e);if(this._isTextPoint){var q=u.rotategAt(this._graphic.symbol.angle,
e);this._graphic.getDojoShape().setTransform([q,d])}else this._graphic.getDojoShape().setTransform(d);f.transform=d;f.scaleX=g;f.scaleY=k;f.around=e}this._toolbar["on"+(8===b?this._rotateEvent:this._scaleEvent)](this._graphic,f)},_moveStopHandler:function(b){this._toolbar._activateScrollWheel();var f=this._graphic,e=this._toolbar,d=e._geo?a.geographicToWebMercator(f.geometry):f.geometry,g=d.spatialReference,k=f.getDojoShape(),q=k.getTransform(),h=f.getLayer()._getTransform();this._isTextPoint?(f=
this._graphic.symbol,8===b.host._index?f.angle+=this._getAngle(this._startLine,this._moveLine):f.font.setSize(Math.round(f.font.size*this._scaleRatio*100)/100),this._graphic.setSymbol(f)):(d=d.toJson(),this._updateSegments(d.paths||d.rings,q,h,g),k.setTransform(null),d=c.fromJson(d),f.setGeometry(e._geo?a.webMercatorToGeographic(d,!0):d));this._draw();this._startLine=this._moveLine=this._startBox=this._moveBox=this._xfactor=this._yfactor=null;e._endOperation("BOX");this._defaultEventArgs.transform=
q;e["on"+(8===b.host._index?this._rotateEvent:this._scaleEvent)+"Stop"](this._graphic,this._defaultEventArgs)},_updateSegments:function(a,c,b,f){var e=this._map,d=this._wrapOffset||0;p.forEach(a,function(a){p.forEach(a,function(a){this._updatePoint(a,f,d,u,e,b,c)},this)},this)},_updatePoint:function(a,c,b,f,e,d,g){c=e.toScreen({x:a[0],y:a[1],spatialReference:c},!0);c.x+=b;c=f.multiplyPoint([d,g,f.invert(d)],c);c.x-=b;b=e.toMap(c);a[0]=b.x;a[1]=b.y},_getAngle:function(a,c){return 180*Math.atan2(c[0].y-
c[1].y,c[0].x-c[1].x)/Math.PI-180*Math.atan2(a[0].y-a[1].y,a[0].x-a[1].x)/Math.PI},_deNormalizePoint:function(a,c){var b=this._map._getFrameWidth();if(-1===b)return a;for(var f={x:a.x,y:a.y};Math.abs(f.x-c.x)>=b;)f.x=f.x<c.x?f.x+b:f.x-b;var e=Math.abs(f.x-c.x);Math.abs(f.x-c.x+b)<e?f.x+=b:Math.abs(f.x-c.x-b)<e&&(f.x-=b);return f}});d("extend-esri")&&r.setObject("toolbars._Box",t,e);return t})},"dojox/gfx/Moveable":function(){define("dojo/_base/lang dojo/_base/declare dojo/_base/array dojo/_base/event dojo/topic dojo/touch dojo/dom-class dojo/_base/window ./Mover dojo/mouse".split(" "),
function(t,r,p,m,g,d,l,h,u,e){return r("dojox.gfx.Moveable",null,{constructor:function(b,e){this.shape=b;this.delay=e&&0<e.delay?e.delay:0;this.mover=e&&e.mover?e.mover:u;this.leftButtonOnly=e&&e.leftButtonOnly;this.events=[this.shape.on(d.press,t.hitch(this,"onMouseDown"))]},destroy:function(){p.forEach(this.events,function(b){b.remove()});this.events=this.shape=null},onMouseDown:function(b){this.delay?(this.events.push(this.shape.on(d.move,t.hitch(this,"onMouseMove")),this.shape.on(d.release,t.hitch(this,
"onMouseUp"))),this._lastX=b.clientX,this._lastY=b.clientY):this.leftButtonOnly&&!e.isLeft(b)||new this.mover(this.shape,b,this);m.stop(b)},onMouseMove:function(b){var e=b.clientY;if(Math.abs(b.clientX-this._lastX)>this.delay||Math.abs(e-this._lastY)>this.delay)this.onMouseUp(b),new this.mover(this.shape,b,this);m.stop(b)},onMouseUp:function(b){this.events.pop().remove()},onMoveStart:function(b){g.publish("/gfx/move/start",b);l.add(h.body(),"dojoMove")},onMoveStop:function(b){g.publish("/gfx/move/stop",
b);l.remove(h.body(),"dojoMove")},onFirstMove:function(b){},onMove:function(b,e,d){this.onMoving(b,e,d);this.shape.applyLeftTransform(e);this.onMoved(b,e)},onMoving:function(b,e){},onMoved:function(b,e){}})})},"dojox/gfx/Mover":function(){define("dojo/_base/lang dojo/_base/array dojo/_base/declare dojo/on dojo/touch dojo/_base/event".split(" "),function(t,r,p,m,g,d){return p("dojox.gfx.Mover",null,{constructor:function(l,h,u){this.shape=l;this.lastX=h.clientX;this.lastY=h.clientY;l=this.host=u;h=
document;u=m(h,g.move,t.hitch(this,"onFirstMove"));this.events=[m(h,g.move,t.hitch(this,"onMouseMove")),m(h,g.release,t.hitch(this,"destroy")),m(h,"dragstart",t.hitch(d,"stop")),m(h,"selectstart",t.hitch(d,"stop")),u];if(l&&l.onMoveStart)l.onMoveStart(this)},onMouseMove:function(g){var h=g.clientX,l=g.clientY;this.host.onMove(this,{dx:h-this.lastX,dy:l-this.lastY},g);this.lastX=h;this.lastY=l;d.stop(g)},onFirstMove:function(){this.host.onFirstMove(this);this.events.pop().remove()},destroy:function(){r.forEach(this.events,
function(d){d.remove()});var d=this.host;if(d&&d.onMoveStop)d.onMoveStop(this);this.events=this.shape=null}})})},"esri/toolbars/_GraphicMover":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/json dojo/dom-style dojox/gfx/Moveable dojox/gfx/Mover dojox/gfx/matrix ../kernel ../PointerEvents ../sniff ../geometry/webMercatorUtils ../geometry/ScreenPoint ../geometry/Point".split(" "),function(t,r,p,m,g,d,l,h,u,e,b,n,v,f){var a=t(null,{declaredClass:"esri.toolbars._GraphicMover",
constructor:function(a,b,f,e){this.graphic=a;this.map=b;this.toolbar=f;this.tempPt=e;this._enableGraphicMover();this._moved=!1},refresh:function(a){var c=this.graphic.getDojoShape();!c||!a&&c._hostGraphic||(this._disableGraphicMover(),this._enableGraphicMover())},destroy:function(){this._disableGraphicMover()},hasMoved:function(){return this._moved},_enableGraphicMover:function(){var c=this.graphic,b=c.getDojoShape();b&&(b._hostGraphic=c,this._moveable=new d(b,{mover:a.Mover}),this._moveStartHandle=
p.connect(this._moveable,"onMoveStart",this,this._moveStartHandler),this._firstMoveHandle=p.connect(this._moveable,"onFirstMove",this,this._firstMoveHandler),this._movingHandle=p.connect(this._moveable,"onMoving",this,this._movingHandler),this._moveStopHandle=p.connect(this._moveable,"onMoveStop",this,this._moveStopHandler),(c=b.getEventSource())&&g.set(c,"cursor",this.toolbar._cursors.move))},_disableGraphicMover:function(){var a=this._moveable;if(a){p.disconnect(this._moveStartHandle);p.disconnect(this._firstMoveHandle);
p.disconnect(this._movingHandle);p.disconnect(this._moveStopHandle);var b=a.shape;b&&(b._hostGraphic=null,(b=b.getEventSource())&&g.set(b,"cursor","inherit"));a.destroy()}this._moveable=null},_moveStartHandler:function(){var a=this.graphic,b=this.map;this._startTx=a.getDojoShape().getTransform();"point"===this.graphic.geometry.type&&b.snappingManager&&b.snappingManager._setUpSnapping();this.toolbar.onGraphicMoveStart(a)},_firstMoveHandler:function(){this.toolbar._beginOperation("MOVE");this.toolbar.onGraphicFirstMove(this.graphic)},
_movingHandler:function(a,f,d){a=a.shape.getTransform();f=this.map;var c;b("esri-pointer")?c=f.navigationManager.pointerEvents._processTouchEvent(d,d):d&&"pointermove"===d.type&&(c=e.prototype._processTouchEvent.call({map:f},d,d));c&&f.snappingManager&&f.snappingManager._onSnappingMouseMoveHandler(c);this.tempPt&&this.tempPt.getDojoShape().setTransform(a);this.toolbar.onGraphicMove(this.graphic,a)},_moveStopHandler:function(a){var c=this.graphic,b=this.toolbar,e=this.map,d=b._geo?n.geographicToWebMercator(c.geometry):
c.geometry,g=d.type,l=c.getDojoShape(),u=l.getTransform();if(m.toJson(u)!==m.toJson(this._startTx)){this._moved=!0;switch(g){case "point":var g=[u,h.invert(this._startTx)],p;e.snappingManager&&(p=e.snappingManager._snappingPoint);d=p||e.toMap(h.multiplyPoint(g,e.toScreen(d,!0)));e.snappingManager&&e.snappingManager._killOffSnapping();break;case "polyline":d=this._updatePolyGeometry(d,d.paths,u);break;case "polygon":d=this._updatePolyGeometry(d,d.rings,u)}l.setTransform(null);c.setGeometry(b._geo?
n.webMercatorToGeographic(d,!0):d);this.tempPt&&this.tempPt.setGeometry(new f(c.geometry.toJson()))}else this._moved=!1;b._endOperation("MOVE");b.onGraphicMoveStop(c,u);this._moved||(a=a.__e,e=this.map.position,a=new v(a.pageX-e.x,a.pageY-e.y),b.onGraphicClick(c,{screenPoint:a,mapPoint:this.map.toMap(a)}))},_updatePolyGeometry:function(a,b,f){var c=this.map,e=a.getPoint(0,0),c=c.toMap(c.toScreen(e).offset(f.dx,f.dy));f=c.x-e.x;for(var e=c.y-e.y,d,g,k,c=0;c<b.length;c++)for(g=b[c],d=0;d<g.length;d++)k=
a.getPoint(c,d),a.setPoint(c,d,k.offset(f,e));return a}});a.Mover=t(l,{declaredClass:"esri.toolbars._Mover",constructor:function(a,b,f){this.__e=b}});b("extend-esri")&&(r.setObject("toolbars._GraphicMover",a,u),r.setObject("toolbars._Mover",a.Mover,u));return a})},"esri/toolbars/_VertexEditor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/array dojo/has dijit/Menu dijit/MenuItem ../kernel ./_VertexMover ../geometry/Point ../geometry/jsonUtils dojo/i18n!../nls/jsapi".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n){var v=t(null,{declaredClass:"esri.toolbars._GraphicVertexEditor",constructor:function(b,a,c){this.graphic=b;this.map=a;this.toolbar=c;b=c._options;this._symbol1=b.vertexSymbol;this._symbol2=b.ghostVertexSymbol;a=b.ghostLineSymbol;this._lineStroke={style:a.style,width:a.width,color:a.color};this._canDel=b.allowDeleteVertices;this._canAdd=b.allowAddVertices;this._addControllers()},destroy:function(){this._removeControllers()},refresh:function(b){b?(this._removeControllers(),
this._addControllers()):(this._refresh(this._vertexMovers),this._refresh(this._mpVertexMovers))},suspend:function(){this._suspended||this._removeControllers();this._suspended=!0},resume:function(){this._suspended&&this._addControllers();this._suspended=!1},_addControllers:function(){this._firstMoveHandle=p.connect(u,"onFirstMove",this,this._firstMoveHandler);this._moveStopHandle=p.connect(u,"onMoveStop",this,this._moveStopHandler);this._vertexMovers=this._add(this._getSegments(this.graphic.geometry),
this._symbol1);this._canAdd&&(this._mpVertexMovers=this._add(this._getMidpointSegments(this.graphic.geometry),this._symbol2,!0));var b=this._getGraphicsLayer();this._mouseOverHandle=p.connect(b,"onMouseOver",this,this._mouseOverHandler);this._mouseOutHandle=p.connect(b,"onMouseOut",this,this._mouseOutHandler);this._canDel&&(this._ctxMenu=new d({style:"font-size: 12px; margin-left: 5px; margin-top: 5px;"}),b=this._ctxDelete=new l({label:n.toolbars.edit.deleteLabel,iconClass:"vertexDeleteIcon",style:"outline: none;"}),
this._deleteHandle=p.connect(b,"onClick",this,this._deleteHandler),this._ctxMenu.addChild(b),this._ctxMenu.startup())},_removeControllers:function(){p.disconnect(this._firstMoveHandle);p.disconnect(this._moveStopHandle);p.disconnect(this._mouseOverHandle);p.disconnect(this._mouseOutHandle);p.disconnect(this._deleteHandle);this._ctxMenu&&(this._ctxDelete=null,this._unbindCtxNode(),this._ctxMenu.destroyRecursive());this._remove(this._vertexMovers);this._remove(this._mpVertexMovers);this._vertexMovers=
this._mpVertexMovers=null},_add:function(b,a,c){var f,e,d=this.graphic,g=[];for(f=0;f<b.length;f++){var h=b[f],n=[];for(e=0;e<h.length;e++)n.push(new u(h[e],a,d,f,e,h.length,this,c));g.push(n)}return g},_remove:function(b){b&&m.forEach(b,function(a){m.forEach(a,function(a){a.destroy()})})},_refresh:function(b){b&&m.forEach(b,function(a){m.forEach(a,function(a){a.refresh()})})},_isNew:function(b){return-1===m.indexOf(this._vertexMovers[b.segIndex],b)?!0:!1},_getGraphicsLayer:function(){return this.toolbar._scratchGL},
_deleteHandler:function(b){b=this._selectedMover;this._updateRelatedGraphic(b,b.relatedGraphic,b.graphic.geometry,b.segIndex,b.ptIndex,b.segLength,!1,!0);this._canAdd&&this._deleteMidpoints(b);this._deleteVertex(b);this.toolbar._endOperation("VERTICES")},_mouseOverHandler:function(b){b=b.graphic;var a=this._findMover(b);a&&(this.toolbar.onVertexMouseOver(this.graphic,a._getInfo()),a._placeholder||(this._selectedMover=a,this._canDel&&this._bindCtxNode(b.getDojoShape().getNode())))},_mouseOutHandler:function(b){if(b=
this._findMover(b.graphic))this.toolbar.onVertexMouseOut(this.graphic,b._getInfo())},_bindCtxNode:function(b){this._unbindCtxNode();this._ctxDelete.set("disabled",this._selectedMover.segLength<=this.minLength?!0:!1);this._ctxMenu.bindDomNode(b);this._bindNode=b},_unbindCtxNode:function(){var b=this._bindNode;b&&this._ctxMenu.unBindDomNode(b)},_findMover:function(b){var a,c=[];a=this._mpVertexMovers;m.forEach(this._vertexMovers,function(a){c=c.concat(a)});a&&m.forEach(a,function(a){c=c.concat(a)});
for(a=0;a<c.length;a++){var f=c[a];if(f.graphic===b)return f}},_firstMoveHandler:function(b){!this._isNew(b)&&this._canAdd&&this._hideRelatedMidpoints(b);this.toolbar._beginOperation("VERTICES")},_moveStopHandler:function(b,a){var c=this._isNew(b);a&&(a.dx||a.dy)?(this._updateRelatedGraphic(b,b.relatedGraphic,b.graphic.geometry,b.segIndex,b.ptIndex,b.segLength,c),this._canAdd&&(c?this._addMidpoints(b):(this._repositionRelatedMidpoints(b),this._showRelatedMidpoints(b))),this.toolbar._endOperation("VERTICES")):
!c&&this._canAdd&&this._showRelatedMidpoints(b)},_showRelatedMidpoints:function(b){var a=this._getAdjacentMidpoints(b.ptIndex,b.segLength),c=this._mpVertexMovers[b.segIndex];for(b=0;b<a.length;b++){var f=c[a[b]];f.graphic.show();f.refresh()}},_hideRelatedMidpoints:function(b){var a=this._getAdjacentMidpoints(b.ptIndex,b.segLength),c=this._mpVertexMovers[b.segIndex];for(b=0;b<a.length;b++)c[a[b]].graphic.hide()},_repositionRelatedMidpoints:function(b){var a,c=this._getAdjacentMidpoints(b.ptIndex,b.segLength),
f=this._mpVertexMovers[b.segIndex];for(a=0;a<c.length;a++){var d=this._getAdjacentVertices(c[a],b.segLength),g=b.relatedGraphic.geometry.getPoint(b.segIndex,d[0]),d=b.relatedGraphic.geometry.getPoint(b.segIndex,d[1]),g=new e({x:(g.x+d.x)/2,y:(g.y+d.y)/2,spatialReference:g.spatialReference.toJson()});f[c[a]].graphic.setGeometry(g)}},_addMidpoints:function(b){var a=b.segIndex,c=b.ptIndex,f=b.segLength,d=c+1,g,h=f+1;this._mpVertexMovers[a].splice(c,1);var n=this._vertexMovers[a];for(g=0;g<d;g++)n[g].segLength+=
1;for(g=d;g<n.length;g++)n[g].ptIndex+=1,n[g].segLength+=1;b.ptIndex=d;b.segLength=n.length+1;n.splice(d,0,b);b.graphic.setSymbol(this._symbol1);n=this._mpVertexMovers[a];for(g=0;g<c;g++)n[g].segLength+=1;for(g=c;g<f-1;g++)n[g].ptIndex+=1,n[g].segLength+=1;d=this._getAdjacentVertices(c,h);a=this._getAdjacentVertices(c+1,h);f=b.relatedGraphic.geometry.getPoint(b.segIndex,d[0]);g=b.relatedGraphic.geometry.getPoint(b.segIndex,d[1]);d=new e({x:(f.x+g.x)/2,y:(f.y+g.y)/2,spatialReference:f.spatialReference.toJson()});
f=b.relatedGraphic.geometry.getPoint(b.segIndex,a[0]);g=b.relatedGraphic.geometry.getPoint(b.segIndex,a[1]);a=new e({x:(f.x+g.x)/2,y:(f.y+g.y)/2,spatialReference:f.spatialReference.toJson()});f=new u(d,this._symbol2,this.graphic,b.segIndex,c,h,this,!0);b=new u(a,this._symbol2,this.graphic,b.segIndex,c+1,h,this,!0);n.splice(c,0,f,b)},_deleteVertex:function(b){var a,c=b.ptIndex,f=this._vertexMovers[b.segIndex];for(a=0;a<c;a++)--f[a].segLength;for(a=c+1;a<f.length;a++){var e=f[a];--e.ptIndex;--e.segLength}f.splice(c,
1);a=b._getInfo();b.destroy();this.toolbar.onVertexDelete(this.graphic,a)}});r.mixin(v,{create:function(b,a,c){switch(b.geometry.type){case "multipoint":return new v.MultipointVertexEditor(b,a,c);case "polyline":return new v.PolylineVertexEditor(b,a,c);case "polygon":return new v.PolygonVertexEditor(b,a,c)}}});v.MultipointVertexEditor=t(v,{declaredClass:"esri.toolbars._MultipointVertexEditor",minLength:1,constructor:function(){this._moveStartHandle=p.connect(u,"onMoveStart",this,this._moveStartHandler);
p.disconnect(this._firstMoveHandle)},destroy:function(){this.inherited(arguments);p.disconnect(this._moveStartHandle)},_getSegments:function(b){var a=b.points,c=[],f=b.spatialReference;for(b=0;b<a.length;b++){var d=a[b];c.push(new e({x:d[0],y:d[1],spatialReference:f.toJson()}))}return[c]},_getMidpointSegments:function(b){return[]},_getControlPoints:function(b,a,c,e,d){return[]},_getGraphicsLayer:function(){return this.graphic._graphicsLayer},_mouseOverHandler:function(b){var a=b.graphic;if(b=this._findMover(b))this.toolbar.onVertexMouseOver(a,
b._getInfo()),this._selectedMover=b,this._canDel&&this._bindCtxNode(b.graphic.getDojoShape().getNode())},_mouseOutHandler:function(b){var a=b.graphic;if(b=this._findMover(b))this.toolbar.onVertexMouseOut(a,b._getInfo())},_findMover:function(b){var a=[].concat(this._vertexMovers[0]),c=b.target;for(b=0;b<a.length;b++){var f=a[b];if(f.graphic.getDojoShape().getNode()===c)return f}},_moveStartHandler:function(b){var a=b.ptIndex,c=b.segLength-1,f=b.relatedGraphic.geometry.points;b=f.splice(a,1);f.push(b[0]);
f=this._vertexMovers[0];for(b=c;b>a;b--)--f[b].ptIndex;b=f.splice(a,1);f.push(b[0]);b[0].ptIndex=c},_moveStopHandler:function(b){this._updateRelatedGraphic(b,b.relatedGraphic,b.graphic.geometry,b.segIndex,b.ptIndex,b.segLength);this.toolbar._endOperation("VERTICES")},_updateRelatedGraphic:function(b,a,c,e,d,g,h,n){b=a.geometry;n?b.removePoint(d):b.setPoint(d,c);a.setGeometry(b)},_deleteMidpoints:function(b){}});v.PolylineVertexEditor=t(v,{declaredClass:"esri.toolbars._PolylineVertexEditor",minLength:2,
_getSegments:function(b){var a,c,f=b.paths,e=[];for(a=0;a<f.length;a++){var d=f[a],g=[];for(c=0;c<d.length;c++)g.push(b.getPoint(a,c));e.push(g)}return e},_getMidpointSegments:function(b){var a,c,f=b.paths,d=[],g=b.spatialReference;for(a=0;a<f.length;a++){var h=f[a],n=[];for(c=0;c<h.length-1;c++){var v=b.getPoint(a,c),l=b.getPoint(a,c+1),v=new e({x:(v.x+l.x)/2,y:(v.y+l.y)/2,spatialReference:g.toJson()});n.push(v)}d.push(n)}return d},_getControlPoints:function(b,a,c,e,d){var f=this.map,g,h;this._isNew(b)?
(b=e,e+=1,0<=b&&(g=f.toScreen(a.getPoint(c,b))),e<=d&&(h=f.toScreen(a.getPoint(c,e)))):(b=e-1,e+=1,0<=b&&(g=f.toScreen(a.getPoint(c,b))),e<d&&(h=f.toScreen(a.getPoint(c,e))));return[g,h]},_getAdjacentMidpoints:function(b,a){var c=[],f=b-1;0<=f&&c.push(f);b<a-1&&c.push(b);return c},_getAdjacentVertices:function(b,a){return[b,b+1]},_deleteMidpoints:function(b){var a=this._mpVertexMovers[b.segIndex],c=a.length-1,f=this._getAdjacentMidpoints(b.ptIndex,b.segLength).sort(),d,g=f[0];for(d=0;d<g;d++)--a[d].segLength;
for(d=g+1;d<a.length;d++){var h=a[d];--h.ptIndex;--h.segLength}if(1===f.length)a.splice(g,1)[0].destroy();else for(h=this._getAdjacentVertices(g,c),d=b.relatedGraphic.geometry.getPoint(b.segIndex,h[0]),h=b.relatedGraphic.geometry.getPoint(b.segIndex,h[1]),d=new e({x:(d.x+h.x)/2,y:(d.y+h.y)/2,spatialReference:d.spatialReference.toJson()}),b=new u(d,this._symbol2,this.graphic,b.segIndex,g,c,this,!0),a=a.splice(g,f.length,b),d=0;d<a.length;d++)a[d].destroy()},_updateRelatedGraphic:function(f,a,c,e,d,
g,h,n){f=a.geometry;h?f.insertPoint(e,d+1,b.fromJson(c.toJson())):n?f.removePoint(e,d):f.setPoint(e,d,b.fromJson(c.toJson()));a.setGeometry(f)}});v.PolygonVertexEditor=t(v,{declaredClass:"esri.toolbars._PolygonVertexEditor",minLength:3,_getSegments:function(b){var a,c,f=b.rings,e=[];for(a=0;a<f.length;a++){var d=f[a],g=[];for(c=0;c<d.length-1;c++)g.push(b.getPoint(a,c));e.push(g)}return e},_getMidpointSegments:function(b){var a,c,f=b.rings,d=[],g=b.spatialReference;for(a=0;a<f.length;a++){var h=f[a],
n=[];for(c=0;c<h.length-1;c++){var v=b.getPoint(a,c),l=b.getPoint(a,c+1),v=new e({x:(v.x+l.x)/2,y:(v.y+l.y)/2,spatialReference:g.toJson()});n.push(v)}d.push(n)}return d},_getControlPoints:function(b,a,c,e,d){var f=this.map;this._isNew(b)?b=e:(b=e-1,b=0>b?(d+b)%d:b);e=(e+1)%d;d=f.toScreen(a.getPoint(c,b));a=f.toScreen(a.getPoint(c,e));return[d,a]},_getAdjacentMidpoints:function(b,a){var c=b-1;return[0>c?(a+c)%a:c,b]},_getAdjacentVertices:function(b,a){return[b,(b+1)%a]},_deleteMidpoints:function(b){var a=
b.ptIndex,c=this._mpVertexMovers[b.segIndex],f=c.length-1,d=this._getAdjacentMidpoints(a,b.segLength).sort(),g,h;h=d[0];var n=d[d.length-1];if(0===a)for(g=this._getAdjacentVertices(f-1,f),a=b.relatedGraphic.geometry.getPoint(b.segIndex,g[0]),g=b.relatedGraphic.geometry.getPoint(b.segIndex,g[1]),a=new e({x:(a.x+g.x)/2,y:(a.y+g.y)/2,spatialReference:a.spatialReference.toJson()}),b=new u(a,this._symbol2,this.graphic,b.segIndex,f-1,f,this,!0),c.splice(n,1,b)[0].destroy(),c.splice(h,1)[0].destroy(),d=
0;d<c.length-1;d++)h=c[d],--h.ptIndex,--h.segLength;else{g=this._getAdjacentVertices(h,f);a=b.relatedGraphic.geometry.getPoint(b.segIndex,g[0]);g=b.relatedGraphic.geometry.getPoint(b.segIndex,g[1]);a=new e({x:(a.x+g.x)/2,y:(a.y+g.y)/2,spatialReference:a.spatialReference.toJson()});b=new u(a,this._symbol2,this.graphic,b.segIndex,h,f,this,!0);n=c.splice(h,d.length,b);for(d=0;d<n.length;d++)n[d].destroy();for(d=0;d<h;d++)--c[d].segLength;for(d=h+1;d<c.length;d++)h=c[d],--h.ptIndex,--h.segLength}},_updateRelatedGraphic:function(f,
a,c,e,d,g,h,n){f=a.geometry;h?f.insertPoint(e,d+1,b.fromJson(c.toJson())):n?(f.removePoint(e,d),0===d&&f.setPoint(e,g-1,b.fromJson(f.getPoint(e,0).toJson()))):(f.setPoint(e,d,b.fromJson(c.toJson())),0===d&&f.setPoint(e,g,b.fromJson(c.toJson())));a.setGeometry(f)}});g("extend-esri")&&(r.setObject("toolbars._GraphicVertexEditor",v,h),r.setObject("toolbars._MultipointVertexEditor",v.MultipointVertexEditor,h),r.setObject("toolbars._PolylineVertexEditor",v.PolylineVertexEditor,h),r.setObject("toolbars._PolygonVertexEditor",
v.PolygonVertexEditor,h));return v})},"dijit/Menu":function(){define("require dojo/_base/array dojo/_base/declare dojo/dom dojo/dom-attr dojo/dom-geometry dojo/dom-style dojo/keys dojo/_base/lang dojo/on dojo/sniff dojo/_base/window dojo/window ./popup ./DropDownMenu dojo/ready".split(" "),function(t,r,p,m,g,d,l,h,u,e,b,n,v,f,a,c){b("dijit-legacy-requires")&&c(0,function(){t(["dijit/MenuItem","dijit/PopupMenuItem","dijit/CheckedMenuItem","dijit/MenuSeparator"])});return p("dijit.Menu",a,{constructor:function(){this._bindings=
[]},targetNodeIds:[],selector:"",contextMenuForWindow:!1,leftClickToOpen:!1,refocus:!0,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(this.ownerDocumentBody):r.forEach(this.targetNodeIds,this.bindDomNode,this);this.inherited(arguments)},_iframeContentWindow:function(a){return v.get(this._iframeContentDocument(a))||this._iframeContentDocument(a).__parent__||a.name&&document.frames[a.name]||null},_iframeContentDocument:function(a){return a.contentDocument||a.contentWindow&&a.contentWindow.document||
a.name&&document.frames[a.name]&&document.frames[a.name].document||null},bindDomNode:function(a){a=m.byId(a,this.ownerDocument);var b;if("iframe"==a.tagName.toLowerCase()){var c=a;b=this._iframeContentWindow(c);b=n.body(b.document)}else b=a==n.body(this.ownerDocument)?this.ownerDocument.documentElement:a;var f={node:a,iframe:c};g.set(a,"_dijitMenu"+this.id,this._bindings.push(f));var d=u.hitch(this,function(a){var b=this.selector,f=b?function(a){return e.selector(b,a)}:function(a){return a},d=this;
return[e(a,f(this.leftClickToOpen?"click":"contextmenu"),function(a){a.stopPropagation();a.preventDefault();(new Date).getTime()<d._lastKeyDown+500||d._scheduleOpen(this,c,{x:a.pageX,y:a.pageY},a.target)}),e(a,f("keydown"),function(a){if(93==a.keyCode||a.shiftKey&&a.keyCode==h.F10||d.leftClickToOpen&&a.keyCode==h.SPACE)a.stopPropagation(),a.preventDefault(),d._scheduleOpen(this,c,null,a.target),d._lastKeyDown=(new Date).getTime()})]});f.connects=b?d(b):[];c&&(f.onloadHandler=u.hitch(this,function(){var a=
this._iframeContentWindow(c),a=n.body(a.document);f.connects=d(a)}),c.addEventListener?c.addEventListener("load",f.onloadHandler,!1):c.attachEvent("onload",f.onloadHandler))},unBindDomNode:function(a){var b;try{b=m.byId(a,this.ownerDocument)}catch(A){return}a="_dijitMenu"+this.id;if(b&&g.has(b,a)){for(var c=g.get(b,a)-1,f=this._bindings[c],e;e=f.connects.pop();)e.remove();(e=f.iframe)&&(e.removeEventListener?e.removeEventListener("load",f.onloadHandler,!1):e.detachEvent("onload",f.onloadHandler));
g.remove(b,a);delete this._bindings[c]}},_scheduleOpen:function(a,b,c,f){this._openTimer||(this._openTimer=this.defer(function(){delete this._openTimer;this._openMyself({target:f,delegatedTarget:a,iframe:b,coords:c})},1))},_openMyself:function(a){function c(){w.refocus&&p&&p.focus();f.close(w)}var e=a.target,g=a.iframe,h=a.coords,k=!h;this.currentTarget=a.delegatedTarget;if(h){if(g){a=d.position(g,!0);var e=this._iframeContentWindow(g),e=d.docScroll(e.document),n=l.getComputedStyle(g),v=l.toPixelValue,
u=(b("ie")&&b("quirks")?0:v(g,n.paddingLeft))+(b("ie")&&b("quirks")?v(g,n.borderLeftWidth):0),g=(b("ie")&&b("quirks")?0:v(g,n.paddingTop))+(b("ie")&&b("quirks")?v(g,n.borderTopWidth):0);h.x+=a.x+u-e.x;h.y+=a.y+g-e.y}}else h=d.position(e,!0),h.x+=10,h.y+=10;var w=this,g=this._focusManager.get("prevNode");a=this._focusManager.get("curNode");var p=!a||m.isDescendant(a,this.domNode)?g:a;f.open({popup:this,x:h.x,y:h.y,onExecute:c,onCancel:c,orient:this.isLeftToRight()?"L":"R"});this.focus();k||this.defer(function(){this._cleanUp(!0)});
this._onBlur=function(){this.inherited("_onBlur",arguments);f.close(this)}},destroy:function(){r.forEach(this._bindings,function(a){a&&this.unBindDomNode(a.node)},this);this.inherited(arguments)}})})},"dijit/popup":function(){define("dojo/_base/array dojo/aspect dojo/_base/declare dojo/dom dojo/dom-attr dojo/dom-construct dojo/dom-geometry dojo/dom-style dojo/has dojo/keys dojo/_base/lang dojo/on ./place ./BackgroundIframe ./Viewport ./main dojo/touch".split(" "),function(t,r,p,m,g,d,l,h,u,e,b,n,
v,f,a,c){function k(){this._popupWrapper&&(d.destroy(this._popupWrapper),delete this._popupWrapper)}p=p(null,{_stack:[],_beginZIndex:1E3,_idGen:1,_repositionAll:function(){if(this._firstAroundNode){var a=this._firstAroundPosition,c=l.position(this._firstAroundNode,!0),f=c.x-a.x,a=c.y-a.y;if(f||a)for(this._firstAroundPosition=c,c=0;c<this._stack.length;c++){var e=this._stack[c].wrapper.style;e.top=parseFloat(e.top)+a+"px";"auto"==e.right?e.left=parseFloat(e.left)+f+"px":e.right=parseFloat(e.right)-
f+"px"}this._aroundMoveListener=setTimeout(b.hitch(this,"_repositionAll"),f||a?10:50)}},_createWrapper:function(a){var b=a._popupWrapper,c=a.domNode;b||(b=d.create("div",{"class":"dijitPopup",style:{display:"none"},role:"region","aria-label":a["aria-label"]||a.label||a.name||a.id},a.ownerDocumentBody),b.appendChild(c),c=c.style,c.display="",c.visibility="",c.position="",c.top="0px",a._popupWrapper=b,r.after(a,"destroy",k,!0),"ontouchend"in document&&n(b,"touchend",function(a){/^(input|button|textarea)$/i.test(a.target.tagName)||
a.preventDefault()}),b.dojoClick=!0);return b},moveOffScreen:function(a){var b=this._createWrapper(a);a=l.isBodyLtr(a.ownerDocument);var c={visibility:"hidden",top:"-9999px",display:""};c[a?"left":"right"]="-9999px";c[a?"right":"left"]="auto";h.set(b,c);return b},hide:function(a){var b=this._createWrapper(a);h.set(b,{display:"none",height:"auto",overflowY:"visible",border:""});a=a.domNode;"_originalStyle"in a&&(a.style.cssText=a._originalStyle)},getTopPopup:function(){for(var a=this._stack,b=a.length-
1;0<b&&a[b].parent===a[b-1].widget;b--);return a[b]},open:function(c){for(var d=this._stack,k=c.popup,q=k.domNode,p=c.orient||["below","below-alt","above","above-alt"],x=c.parent?c.parent.isLeftToRight():l.isBodyLtr(k.ownerDocument),r=c.around,t=c.around&&c.around.id?c.around.id+"_dropdown":"popup_"+this._idGen++;d.length&&(!c.parent||!m.isDescendant(c.parent.domNode,d[d.length-1].widget.domNode));)this.close(d[d.length-1].widget);var w=this.moveOffScreen(k);k.startup&&!k._started&&k.startup();var C,
E=l.position(q);if("maxHeight"in c&&-1!=c.maxHeight)C=c.maxHeight||Infinity;else{C=a.getEffectiveBox(this.ownerDocument);var H=r?l.position(r,!1):{y:c.y-(c.padding||0),h:2*(c.padding||0)};C=Math.floor(Math.max(H.y,C.h-(H.y+H.h)))}E.h>C&&(E=h.getComputedStyle(q),h.set(w,{overflowY:"scroll",height:C+"px",border:E.borderLeftWidth+" "+E.borderLeftStyle+" "+E.borderLeftColor}),q._originalStyle=q.style.cssText,q.style.border="none");g.set(w,{id:t,style:{zIndex:this._beginZIndex+d.length},"class":"dijitPopup "+
(k.baseClass||k["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:c.parent?c.parent.id:""});0==d.length&&r&&(this._firstAroundNode=r,this._firstAroundPosition=l.position(r,!0),this._aroundMoveListener=setTimeout(b.hitch(this,"_repositionAll"),50));u("config-bgIframe")&&!k.bgIframe&&(k.bgIframe=new f(w));t=k.orient?b.hitch(k,"orient"):null;p=r?v.around(w,r,p,x,t):v.at(w,c,"R"==p?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],c.padding,t);w.style.visibility="visible";q.style.visibility="visible";q=
[];q.push(n(w,"keydown",b.hitch(this,function(a){if(a.keyCode==e.ESCAPE&&c.onCancel)a.stopPropagation(),a.preventDefault(),c.onCancel();else if(a.keyCode==e.TAB&&(a.stopPropagation(),a.preventDefault(),(a=this.getTopPopup())&&a.onCancel))a.onCancel()})));k.onCancel&&c.onCancel&&q.push(k.on("cancel",c.onCancel));q.push(k.on(k.onExecute?"execute":"change",b.hitch(this,function(){var a=this.getTopPopup();if(a&&a.onExecute)a.onExecute()})));d.push({widget:k,wrapper:w,parent:c.parent,onExecute:c.onExecute,
onCancel:c.onCancel,onClose:c.onClose,handlers:q});if(k.onOpen)k.onOpen(p);return p},close:function(a){for(var b=this._stack;a&&t.some(b,function(b){return b.widget==a})||!a&&b.length;){var c=b.pop(),f=c.widget,e=c.onClose;f.bgIframe&&(f.bgIframe.destroy(),delete f.bgIframe);if(f.onClose)f.onClose();for(var d;d=c.handlers.pop();)d.remove();f&&f.domNode&&this.hide(f);e&&e()}0==b.length&&this._aroundMoveListener&&(clearTimeout(this._aroundMoveListener),this._firstAroundNode=this._firstAroundPosition=
this._aroundMoveListener=null)}});return c.popup=new p})},"dijit/place":function(){define("dojo/_base/array dojo/dom-geometry dojo/dom-style dojo/_base/kernel dojo/_base/window ./Viewport ./main".split(" "),function(t,r,p,m,g,d,l){function h(e,b,h,v){var f=d.getEffectiveBox(e.ownerDocument);e.parentNode&&"body"==String(e.parentNode.tagName).toLowerCase()||g.body(e.ownerDocument).appendChild(e);var a=null;t.some(b,function(b){var c=b.corner,d=b.pos,g=0,k={w:{L:f.l+f.w-d.x,R:d.x-f.l,M:f.w}[c.charAt(1)],
h:{T:f.t+f.h-d.y,B:d.y-f.t,M:f.h}[c.charAt(0)]},n=e.style;n.left=n.right="auto";h&&(g=h(e,b.aroundCorner,c,k,v),g="undefined"==typeof g?0:g);var q=e.style,l=q.display,u=q.visibility;"none"==q.display&&(q.visibility="hidden",q.display="");n=r.position(e);q.display=l;q.visibility=u;l={L:d.x,R:d.x-n.w,M:Math.max(f.l,Math.min(f.l+f.w,d.x+(n.w>>1))-n.w)}[c.charAt(1)];u={T:d.y,B:d.y-n.h,M:Math.max(f.t,Math.min(f.t+f.h,d.y+(n.h>>1))-n.h)}[c.charAt(0)];d=Math.max(f.l,l);q=Math.max(f.t,u);l=Math.min(f.l+f.w,
l+n.w)-d;u=Math.min(f.t+f.h,u+n.h)-q;g+=n.w-l+(n.h-u);if(null==a||g<a.overflow)a={corner:c,aroundCorner:b.aroundCorner,x:d,y:q,w:l,h:u,overflow:g,spaceAvailable:k};return!g});a.overflow&&h&&h(e,a.aroundCorner,a.corner,a.spaceAvailable,v);b=a.y;var c=a.x,k=g.body(e.ownerDocument);/relative|absolute/.test(p.get(k,"position"))&&(b-=p.get(k,"marginTop"),c-=p.get(k,"marginLeft"));k=e.style;k.top=b+"px";k.left=c+"px";k.right="auto";return a}var u={TL:"BR",TR:"BL",BL:"TR",BR:"TL"};return l.place={at:function(e,
b,d,g,f){d=t.map(d,function(a){var c={corner:a,aroundCorner:u[a],pos:{x:b.x,y:b.y}};g&&(c.pos.x+="L"==a.charAt(1)?g.x:-g.x,c.pos.y+="T"==a.charAt(0)?g.y:-g.y);return c});return h(e,d,f)},around:function(e,b,d,g,f){function a(a,b){w.push({aroundCorner:a,corner:b,pos:{x:{L:A,R:A+y,M:A+(y>>1)}[a.charAt(1)],y:{T:x,B:x+G,M:x+(G>>1)}[a.charAt(0)]}})}var c;if("string"==typeof b||"offsetWidth"in b||"ownerSVGElement"in b){if(c=r.position(b,!0),/^(above|below)/.test(d[0])){var k=r.getBorderExtents(b),n=b.firstChild?
r.getBorderExtents(b.firstChild):{t:0,l:0,b:0,r:0},v=r.getBorderExtents(e),l=e.firstChild?r.getBorderExtents(e.firstChild):{t:0,l:0,b:0,r:0};c.y+=Math.min(k.t+n.t,v.t+l.t);c.h-=Math.min(k.t+n.t,v.t+l.t)+Math.min(k.b+n.b,v.b+l.b)}}else c=b;if(b.parentNode)for(k="absolute"==p.getComputedStyle(b).position,b=b.parentNode;b&&1==b.nodeType&&"BODY"!=b.nodeName;){n=r.position(b,!0);v=p.getComputedStyle(b);/relative|absolute/.test(v.position)&&(k=!1);if(!k&&/hidden|auto|scroll/.test(v.overflow)){var l=Math.min(c.y+
c.h,n.y+n.h),u=Math.min(c.x+c.w,n.x+n.w);c.x=Math.max(c.x,n.x);c.y=Math.max(c.y,n.y);c.h=l-c.y;c.w=u-c.x}"absolute"==v.position&&(k=!0);b=b.parentNode}var A=c.x,x=c.y,y="w"in c?c.w:c.w=c.width,G="h"in c?c.h:(m.deprecated("place.around: dijit/place.__Rectangle: { x:"+A+", y:"+x+", height:"+c.height+", width:"+y+" } has been deprecated.  Please use { x:"+A+", y:"+x+", h:"+c.height+", w:"+y+" }","","2.0"),c.h=c.height),w=[];t.forEach(d,function(b){var c=g;switch(b){case "above-centered":a("TM","BM");
break;case "below-centered":a("BM","TM");break;case "after-centered":c=!c;case "before-centered":a(c?"ML":"MR",c?"MR":"ML");break;case "after":c=!c;case "before":a(c?"TL":"TR",c?"TR":"TL");a(c?"BL":"BR",c?"BR":"BL");break;case "below-alt":c=!c;case "below":a(c?"BL":"BR",c?"TL":"TR");a(c?"BR":"BL",c?"TR":"TL");break;case "above-alt":c=!c;case "above":a(c?"TL":"TR",c?"BL":"BR");a(c?"TR":"TL",c?"BR":"BL");break;default:a(b.aroundCorner,b.corner)}});e=h(e,w,f,{w:y,h:G});e.aroundNodePos=c;return e}}})},
"dijit/Viewport":function(){define(["dojo/Evented","dojo/on","dojo/domReady","dojo/sniff","dojo/window"],function(t,r,p,m,g){var d=new t,l;p(function(){var h=g.getBox();d._rlh=r(window,"resize",function(){var e=g.getBox();if(h.h!=e.h||h.w!=e.w)h=e,d.emit("resize")});if(8==m("ie")){var u=screen.deviceXDPI;setInterval(function(){screen.deviceXDPI!=u&&(u=screen.deviceXDPI,d.emit("resize"))},500)}m("ios")&&(r(document,"focusin",function(e){l=e.target}),r(document,"focusout",function(e){l=null}))});d.getEffectiveBox=
function(d){d=g.getBox(d);var h=l&&l.tagName&&l.tagName.toLowerCase();m("ios")&&l&&!l.readOnly&&("textarea"==h||"input"==h&&/^(color|email|number|password|search|tel|text|url)$/.test(l.type))&&(d.h*=0==orientation||180==orientation?.66:.4,h=l.getBoundingClientRect(),d.h=Math.max(d.h,h.top+h.height));return d};return d})},"dijit/BackgroundIframe":function(){define("require ./main dojo/_base/config dojo/dom-construct dojo/dom-style dojo/_base/lang dojo/on dojo/sniff".split(" "),function(t,r,p,m,g,d,
l,h){h.add("config-bgIframe",(h("ie")||h("trident"))&&!/IEMobile\/10\.0/.test(navigator.userAgent));var u=new function(){var e=[];this.pop=function(){var b;e.length?(b=e.pop(),b.style.display=""):(9>h("ie")?(b=p.dojoBlankHtmlUrl||t.toUrl("dojo/resources/blank.html")||'javascript:""',b=document.createElement("\x3ciframe src\x3d'"+b+"' role\x3d'presentation' style\x3d'position: absolute; left: 0px; top: 0px;z-index: -1; filter:Alpha(Opacity\x3d\"0\");'\x3e")):(b=m.create("iframe"),b.src='javascript:""',
b.className="dijitBackgroundIframe",b.setAttribute("role","presentation"),g.set(b,"opacity",.1)),b.tabIndex=-1);return b};this.push=function(b){b.style.display="none";e.push(b)}};r.BackgroundIframe=function(e){if(!e.id)throw Error("no id");if(h("config-bgIframe")){var b=this.iframe=u.pop();e.appendChild(b);7>h("ie")||h("quirks")?(this.resize(e),this._conn=l(e,"resize",d.hitch(this,"resize",e))):g.set(b,{width:"100%",height:"100%"})}};d.extend(r.BackgroundIframe,{resize:function(e){this.iframe&&g.set(this.iframe,
{width:e.offsetWidth+"px",height:e.offsetHeight+"px"})},destroy:function(){this._conn&&(this._conn.remove(),this._conn=null);this.iframe&&(this.iframe.parentNode.removeChild(this.iframe),u.push(this.iframe),delete this.iframe)}});return r.BackgroundIframe})},"dijit/DropDownMenu":function(){define(["dojo/_base/declare","dojo/keys","dojo/text!./templates/Menu.html","./_MenuBase"],function(t,r,p,m){return t("dijit.DropDownMenu",m,{templateString:p,baseClass:"dijitMenu",_onUpArrow:function(){this.focusPrev()},
_onDownArrow:function(){this.focusNext()},_onRightArrow:function(g){this._moveToPopup(g);g.stopPropagation();g.preventDefault()},_onLeftArrow:function(g){if(this.parentMenu)if(this.parentMenu._isMenuBar)this.parentMenu.focusPrev();else this.onCancel(!1);else g.stopPropagation(),g.preventDefault()}})})},"dijit/_MenuBase":function(){define("dojo/_base/array dojo/_base/declare dojo/dom dojo/dom-attr dojo/dom-class dojo/_base/lang dojo/mouse dojo/on dojo/window ./a11yclick ./registry ./_Widget ./_CssStateMixin ./_KeyNavContainer ./_TemplatedMixin".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v,f,a){return r("dijit._MenuBase",[n,a,f,v],{selected:null,_setSelectedAttr:function(a){this.selected!=a&&(this.selected&&(this.selected._setSelected(!1),this._onChildDeselect(this.selected)),a&&a._setSelected(!0),this._set("selected",a))},activated:!1,_setActivatedAttr:function(a){g.toggle(this.domNode,"dijitMenuActive",a);g.toggle(this.domNode,"dijitMenuPassive",!a);this._set("activated",a)},parentMenu:null,popupDelay:500,passivePopupDelay:Infinity,autoFocus:!1,
childSelector:function(a){var c=b.byNode(a);return a.parentNode==this.containerNode&&c&&c.focus},postCreate:function(){var a=this,f="string"==typeof this.childSelector?this.childSelector:d.hitch(this,"childSelector");this.own(h(this.containerNode,h.selector(f,l.enter),function(){a.onItemHover(b.byNode(this))}),h(this.containerNode,h.selector(f,l.leave),function(){a.onItemUnhover(b.byNode(this))}),h(this.containerNode,h.selector(f,e),function(c){a.onItemClick(b.byNode(this),c);c.stopPropagation()}),
h(this.containerNode,h.selector(f,"focusin"),function(){a._onItemFocus(b.byNode(this))}));this.inherited(arguments)},onKeyboardSearch:function(a,b,f,e){this.inherited(arguments);if(a&&(-1==e||a.popup&&1==e))this.onItemClick(a,b)},_keyboardSearchCompare:function(a,b){return a.shortcutKey?b==a.shortcutKey.toLowerCase()?-1:0:this.inherited(arguments)?1:0},onExecute:function(){},onCancel:function(){},_moveToPopup:function(a){if(this.focusedChild&&this.focusedChild.popup&&!this.focusedChild.disabled)this.onItemClick(this.focusedChild,
a);else(a=this._getTopMenu())&&a._isMenuBar&&a.focusNext()},_onPopupHover:function(){this.set("selected",this.currentPopupItem);this._stopPendingCloseTimer()},onItemHover:function(a){this.activated?(this.set("selected",a),!a.popup||a.disabled||this.hover_timer||(this.hover_timer=this.defer(function(){this._openItemPopup(a)},this.popupDelay))):Infinity>this.passivePopupDelay&&(this.passive_hover_timer&&this.passive_hover_timer.remove(),this.passive_hover_timer=this.defer(function(){this.onItemClick(a,
{type:"click"})},this.passivePopupDelay));this._hoveredChild=a;a._set("hovering",!0)},_onChildDeselect:function(a){this._stopPopupTimer();this.currentPopupItem==a&&(this._stopPendingCloseTimer(),this._pendingClose_timer=this.defer(function(){this.currentPopupItem=this._pendingClose_timer=null;a._closePopup()},this.popupDelay))},onItemUnhover:function(a){this._hoveredChild==a&&(this._hoveredChild=null);this.passive_hover_timer&&(this.passive_hover_timer.remove(),this.passive_hover_timer=null);a._set("hovering",
!1)},_stopPopupTimer:function(){this.hover_timer&&(this.hover_timer=this.hover_timer.remove())},_stopPendingCloseTimer:function(){this._pendingClose_timer&&(this._pendingClose_timer=this._pendingClose_timer.remove())},_getTopMenu:function(){for(var a=this;a.parentMenu;a=a.parentMenu);return a},onItemClick:function(a,b){this.passive_hover_timer&&this.passive_hover_timer.remove();this.focusChild(a);if(a.disabled)return!1;if(a.popup){this.set("selected",a);this.set("activated",!0);var c=/^key/.test(b._origType||
b.type)||0==b.clientX&&0==b.clientY;this._openItemPopup(a,c)}else this.onExecute(),a._onClick?a._onClick(b):a.onClick(b)},_openItemPopup:function(a,b){if(a!=this.currentPopupItem){this.currentPopupItem&&(this._stopPendingCloseTimer(),this.currentPopupItem._closePopup());this._stopPopupTimer();var c=a.popup;c.parentMenu=this;this.own(this._mouseoverHandle=h.once(c.domNode,"mouseover",d.hitch(this,"_onPopupHover")));var f=this;a._openPopup({parent:this,orient:this._orient||["after","before"],onCancel:function(){b&&
f.focusChild(a);f._cleanUp()},onExecute:d.hitch(this,"_cleanUp",!0),onClose:function(){f._mouseoverHandle&&(f._mouseoverHandle.remove(),delete f._mouseoverHandle)}},b);this.currentPopupItem=a}},onOpen:function(){this.isShowingNow=!0;this.set("activated",!0)},onClose:function(){this.set("activated",!1);this.set("selected",null);this.isShowingNow=!1;this.parentMenu=null},_closeChild:function(){this._stopPopupTimer();this.currentPopupItem&&(this.focused&&(m.set(this.selected.focusNode,"tabIndex",this.tabIndex),
this.selected.focusNode.focus()),this.currentPopupItem._closePopup(),this.currentPopupItem=null)},_onItemFocus:function(a){if(this._hoveredChild&&this._hoveredChild!=a)this.onItemUnhover(this._hoveredChild);this.set("selected",a)},_onBlur:function(){this._cleanUp(!0);this.inherited(arguments)},_cleanUp:function(a){this._closeChild();"undefined"==typeof this.isShowingNow&&this.set("activated",!1);a&&this.set("selected",null)}})})},"dijit/_CssStateMixin":function(){define("dojo/_base/array dojo/_base/declare dojo/dom dojo/dom-class dojo/has dojo/_base/lang dojo/on dojo/domReady dojo/touch dojo/_base/window ./a11yclick ./registry".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n){r=r("dijit._CssStateMixin",[],{hovering:!1,active:!1,_applyAttributes:function(){this.inherited(arguments);t.forEach("disabled readOnly checked selected focused state hovering active _opened".split(" "),function(b){this.watch(b,d.hitch(this,"_setStateClass"))},this);for(var b in this.cssStateNodes||{})this._trackMouseState(this[b],this.cssStateNodes[b]);this._trackMouseState(this.domNode,this.baseClass);this._setStateClass()},_cssMouseEvent:function(b){if(!this.disabled)switch(b.type){case "mouseover":case "MSPointerOver":case "pointerover":this._set("hovering",
!0);this._set("active",this._mouseDown);break;case "mouseout":case "MSPointerOut":case "pointerout":this._set("hovering",!1);this._set("active",!1);break;case "mousedown":case "touchstart":case "MSPointerDown":case "pointerdown":case "keydown":this._set("active",!0);break;case "mouseup":case "dojotouchend":case "MSPointerUp":case "pointerup":case "keyup":this._set("active",!1)}},_setStateClass:function(){function b(a){f=f.concat(t.map(f,function(b){return b+a}),"dijit"+a)}var f=this.baseClass.split(" ");
this.isLeftToRight()||b("Rtl");var a="mixed"==this.checked?"Mixed":this.checked?"Checked":"";this.checked&&b(a);this.state&&b(this.state);this.selected&&b("Selected");this._opened&&b("Opened");this.disabled?b("Disabled"):this.readOnly?b("ReadOnly"):this.active?b("Active"):this.hovering&&b("Hover");this.focused&&b("Focused");var a=this.stateNode||this.domNode,c={};t.forEach(a.className.split(" "),function(a){c[a]=!0});"_stateClasses"in this&&t.forEach(this._stateClasses,function(a){delete c[a]});t.forEach(f,
function(a){c[a]=!0});var e=[],d;for(d in c)e.push(d);a.className=e.join(" ");this._stateClasses=f},_subnodeCssMouseEvent:function(b,f,a){function c(a){m.toggle(b,f+"Active",a)}if(!this.disabled&&!this.readOnly)switch(a.type){case "mouseover":case "MSPointerOver":case "pointerover":m.toggle(b,f+"Hover",!0);break;case "mouseout":case "MSPointerOut":case "pointerout":m.toggle(b,f+"Hover",!1);c(!1);break;case "mousedown":case "touchstart":case "MSPointerDown":case "pointerdown":case "keydown":c(!0);
break;case "mouseup":case "MSPointerUp":case "pointerup":case "dojotouchend":case "keyup":c(!1);break;case "focus":case "focusin":m.toggle(b,f+"Focused",!0);break;case "blur":case "focusout":m.toggle(b,f+"Focused",!1)}},_trackMouseState:function(b,f){b._cssState=f}});h(function(){function d(a,b,f){if(!f||!p.isDescendant(f,b))for(;b&&b!=f;b=b.parentNode)if(b._cssState){var c=n.getEnclosingWidget(b);c&&(b==c.domNode?c._cssMouseEvent(a):c._subnodeCssMouseEvent(b,b._cssState,a))}}var f=e.body(),a;l(f,
u.over,function(a){d(a,a.target,a.relatedTarget)});l(f,u.out,function(a){d(a,a.target,a.relatedTarget)});l(f,b.press,function(b){a=b.target;d(b,a)});l(f,b.release,function(b){d(b,a);a=null});l(f,"focusin, focusout",function(a){var b=a.target;if(b._cssState&&!b.getAttribute("widgetId")){var c=n.getEnclosingWidget(b);c&&c._subnodeCssMouseEvent(b,b._cssState,a)}})});return r})},"dijit/_KeyNavContainer":function(){define("dojo/_base/array dojo/_base/declare dojo/dom-attr dojo/_base/kernel dojo/keys dojo/_base/lang ./registry ./_Container ./_FocusMixin ./_KeyNavMixin".split(" "),
function(t,r,p,m,g,d,l,h,u,e){return r("dijit._KeyNavContainer",[u,e,h],{connectKeyNavHandlers:function(b,e){var h=this._keyNavCodes={},f=d.hitch(this,"focusPrev"),a=d.hitch(this,"focusNext");t.forEach(b,function(a){h[a]=f});t.forEach(e,function(b){h[b]=a});h[g.HOME]=d.hitch(this,"focusFirstChild");h[g.END]=d.hitch(this,"focusLastChild")},startupKeyNavChildren:function(){m.deprecated("startupKeyNavChildren() call no longer needed","","2.0")},startup:function(){this.inherited(arguments);t.forEach(this.getChildren(),
d.hitch(this,"_startupChild"))},addChild:function(b,e){this.inherited(arguments);this._startupChild(b)},_startupChild:function(b){b.set("tabIndex","-1")},_getFirst:function(){var b=this.getChildren();return b.length?b[0]:null},_getLast:function(){var b=this.getChildren();return b.length?b[b.length-1]:null},focusNext:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,1))},focusPrev:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,-1),!0)},childSelector:function(b){return(b=
l.byNode(b))&&b.getParent()==this}})})},"dijit/_Container":function(){define(["dojo/_base/array","dojo/_base/declare","dojo/dom-construct","dojo/_base/kernel"],function(t,r,p,m){return r("dijit._Container",null,{buildRendering:function(){this.inherited(arguments);this.containerNode||(this.containerNode=this.domNode)},addChild:function(g,d){var l=this.containerNode;if(0<d){for(l=l.firstChild;0<d;)1==l.nodeType&&d--,l=l.nextSibling;l?d="before":(l=this.containerNode,d="last")}p.place(g.domNode,l,d);
this._started&&!g._started&&g.startup()},removeChild:function(g){"number"==typeof g&&(g=this.getChildren()[g]);g&&(g=g.domNode)&&g.parentNode&&g.parentNode.removeChild(g)},hasChildren:function(){return 0<this.getChildren().length},_getSiblingOfChild:function(g,d){var l=this.getChildren(),h=t.indexOf(l,g);return l[h+d]},getIndexOfChild:function(g){return t.indexOf(this.getChildren(),g)}})})},"dijit/_KeyNavMixin":function(){define("dojo/_base/array dojo/_base/declare dojo/dom-attr dojo/keys dojo/_base/lang dojo/on dijit/registry dijit/_FocusMixin".split(" "),
function(t,r,p,m,g,d,l,h){return r("dijit._KeyNavMixin",h,{tabIndex:"0",childSelector:null,postCreate:function(){this.inherited(arguments);p.set(this.domNode,"tabIndex",this.tabIndex);if(!this._keyNavCodes){var h=this._keyNavCodes={};h[m.HOME]=g.hitch(this,"focusFirstChild");h[m.END]=g.hitch(this,"focusLastChild");h[this.isLeftToRight()?m.LEFT_ARROW:m.RIGHT_ARROW]=g.hitch(this,"_onLeftArrow");h[this.isLeftToRight()?m.RIGHT_ARROW:m.LEFT_ARROW]=g.hitch(this,"_onRightArrow");h[m.UP_ARROW]=g.hitch(this,
"_onUpArrow");h[m.DOWN_ARROW]=g.hitch(this,"_onDownArrow")}var e=this,h="string"==typeof this.childSelector?this.childSelector:g.hitch(this,"childSelector");this.own(d(this.domNode,"keypress",g.hitch(this,"_onContainerKeypress")),d(this.domNode,"keydown",g.hitch(this,"_onContainerKeydown")),d(this.domNode,"focus",g.hitch(this,"_onContainerFocus")),d(this.containerNode,d.selector(h,"focusin"),function(b){e._onChildFocus(l.getEnclosingWidget(this),b)}))},_onLeftArrow:function(){},_onRightArrow:function(){},
_onUpArrow:function(){},_onDownArrow:function(){},focus:function(){this.focusFirstChild()},_getFirstFocusableChild:function(){return this._getNextFocusableChild(null,1)},_getLastFocusableChild:function(){return this._getNextFocusableChild(null,-1)},focusFirstChild:function(){this.focusChild(this._getFirstFocusableChild())},focusLastChild:function(){this.focusChild(this._getLastFocusableChild())},focusChild:function(d,e){d&&(this.focusedChild&&d!==this.focusedChild&&this._onChildBlur(this.focusedChild),
d.set("tabIndex",this.tabIndex),d.focus(e?"end":"start"))},_onContainerFocus:function(d){d.target!==this.domNode||this.focusedChild||this.focus()},_onFocus:function(){p.set(this.domNode,"tabIndex","-1");this.inherited(arguments)},_onBlur:function(d){p.set(this.domNode,"tabIndex",this.tabIndex);this.focusedChild&&(this.focusedChild.set("tabIndex","-1"),this.lastFocusedChild=this.focusedChild,this._set("focusedChild",null));this.inherited(arguments)},_onChildFocus:function(d){d&&d!=this.focusedChild&&
(this.focusedChild&&!this.focusedChild._destroyed&&this.focusedChild.set("tabIndex","-1"),d.set("tabIndex",this.tabIndex),this.lastFocused=d,this._set("focusedChild",d))},_searchString:"",multiCharSearchDuration:1E3,onKeyboardSearch:function(d,e,b,g){d&&this.focusChild(d)},_keyboardSearchCompare:function(d,e){var b=d.domNode,b=(d.label||(b.focusNode?b.focusNode.label:"")||b.innerText||b.textContent||"").replace(/^\s+/,"").substr(0,e.length).toLowerCase();return e.length&&b==e?-1:0},_isFormElement:function(d){return"INPUT"===
d.tagName||"TEXTAREA"===d.tagName||"SELECT"===d.tagName||"BUTTON"===d.tagName},_onContainerKeydown:function(d){if(!this._isFormElement(document.activeElement)){var e=this._keyNavCodes[d.keyCode];e?(e(d,this.focusedChild),d.stopPropagation(),d.preventDefault(),this._searchString=""):d.keyCode!=m.SPACE||!this._searchTimer||d.ctrlKey||d.altKey||d.metaKey||(d.stopImmediatePropagation(),d.preventDefault(),this._keyboardSearch(d," "))}},_onContainerKeypress:function(d){this._isFormElement(document.activeElement)||
d.charCode<=m.SPACE||d.ctrlKey||d.altKey||d.metaKey||(d.preventDefault(),d.stopPropagation(),this._keyboardSearch(d,String.fromCharCode(d.charCode).toLowerCase()))},_keyboardSearch:function(d,e){var b=null,h,v=0;g.hitch(this,function(){this._searchTimer&&this._searchTimer.remove();this._searchString+=e;var f=/^(.)\1*$/.test(this._searchString)?1:this._searchString.length;h=this._searchString.substr(0,f);this._searchTimer=this.defer(function(){this._searchTimer=null;this._searchString=""},this.multiCharSearchDuration);
var a=this.focusedChild||null;if(1==f||!a)if(a=this._getNextFocusableChild(a,1),!a)return;f=a;do{var c=this._keyboardSearchCompare(a,h);c&&0==v++&&(b=a);if(-1==c){v=-1;break}a=this._getNextFocusableChild(a,1)}while(a&&a!=f)})();this.onKeyboardSearch(b,d,h,v)},_onChildBlur:function(){},_getNextFocusableChild:function(d,e){var b=d;do{if(d)d=this._getNext(d,e);else if(d=this[0<e?"_getFirst":"_getLast"](),!d)break;if(null!=d&&d!=b&&d.isFocusable())return d}while(d!=b);return null},_getFirst:function(){return null},
_getLast:function(){return null},_getNext:function(d,e){if(d)for(d=d.domNode;d;)if((d=d[0>e?"previousSibling":"nextSibling"])&&"getAttribute"in d){var b=l.byNode(d);if(b)return b}return null}})})},"dijit/MenuItem":function(){define("dojo/_base/declare dojo/dom dojo/dom-attr dojo/dom-class dojo/_base/kernel dojo/sniff dojo/_base/lang ./_Widget ./_TemplatedMixin ./_Contained ./_CssStateMixin dojo/text!./templates/MenuItem.html".split(" "),function(t,r,p,m,g,d,l,h,u,e,b,n){l=t("dijit.MenuItem"+(d("dojo-bidi")?
"_NoBidi":""),[h,u,e,b],{templateString:n,baseClass:"dijitMenuItem",label:"",_setLabelAttr:function(b){this._set("label",b);var f="",a;a=b.search(/{\S}/);if(0<=a){var f=b.charAt(a+1),c=b.substr(0,a);b=b.substr(a+3);a=c+f+b;b=c+'\x3cspan class\x3d"dijitMenuItemShortcutKey"\x3e'+f+"\x3c/span\x3e"+b}else a=b;this.domNode.setAttribute("aria-label",a+" "+this.accelKey);this.containerNode.innerHTML=b;this._set("shortcutKey",f)},iconClass:"dijitNoIcon",_setIconClassAttr:{node:"iconNode",type:"class"},accelKey:"",
disabled:!1,_fillContent:function(b){!b||"label"in this.params||this._set("label",b.innerHTML)},buildRendering:function(){this.inherited(arguments);p.set(this.containerNode,"id",this.id+"_text");this.accelKeyNode&&p.set(this.accelKeyNode,"id",this.id+"_accel");r.setSelectable(this.domNode,!1)},onClick:function(){},focus:function(){try{8==d("ie")&&this.containerNode.focus(),this.focusNode.focus()}catch(v){}},_setSelected:function(b){m.toggle(this.domNode,"dijitMenuItemSelected",b)},setLabel:function(b){g.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.",
"","2.0");this.set("label",b)},setDisabled:function(b){g.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",b)},_setDisabledAttr:function(b){this.focusNode.setAttribute("aria-disabled",b?"true":"false");this._set("disabled",b)},_setAccelKeyAttr:function(b){this.accelKeyNode&&(this.accelKeyNode.style.display=b?"":"none",this.accelKeyNode.innerHTML=b,p.set(this.containerNode,"colSpan",b?"1":"2"));this._set("accelKey",b)}});d("dojo-bidi")&&
(l=t("dijit.MenuItem",l,{_setLabelAttr:function(b){this.inherited(arguments);"auto"===this.textDir&&this.applyTextDir(this.textDirNode)}}));return l})},"dijit/_Contained":function(){define(["dojo/_base/declare","./registry"],function(t,r){return t("dijit._Contained",null,{_getSibling:function(p){var m=this.getParent();return m&&m._getSiblingOfChild&&m._getSiblingOfChild(this,"previous"==p?-1:1)||null},getPreviousSibling:function(){return this._getSibling("previous")},getNextSibling:function(){return this._getSibling("next")},
getIndexInParent:function(){var p=this.getParent();return p&&p.getIndexOfChild?p.getIndexOfChild(this):-1}})})},"esri/toolbars/_VertexMover":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/sniff dojo/dom-style dojox/gfx/Moveable ../kernel ../PointerEvents ../sniff ../geometry/Point ../graphic ../geometry/webMercatorUtils".split(" "),function(t,r,p,m,g,d,l,h,u,e,b,n){t=t(null,{declaredClass:"esri.toolbars.VertexMover",constructor:function(b,f,a,c,e,d,g,h){this.point=b;
this.symbol=f;this.relatedGraphic=a;this.segIndex=c;this.ptIndex=e;this.segLength=d;this.editor=g;this.map=g.map;this._scratchGL=g.toolbar._scratchGL;this._placeholder=h||!1;this._type=a.geometry.type;this._init();this._enable()},refresh:function(b){if(b||this._needRefresh())this._disable(),this._enable()},destroy:function(){this._disable();this.graphic&&this._scratchGL.remove(this.graphic);this.point=this.symbol=this.graphic=this.relatedGraphic=this.segIndex=this.ptIndex=this.segLength=this.editor=
this.map=this._scratchGL=null},_init:function(){var d=new e(this.point.toJson()),d=new b(d,this.symbol);switch(this._type){case "multipoint":d._shape=this.relatedGraphic.getDojoShape().children[this.ptIndex];break;case "polyline":case "polygon":this._scratchGL.add(d)}this.graphic=d},_enable:function(){var b=this.graphic.getDojoShape();b&&(b._hasMover=!0,this._moveable=this._getMoveable(b),(b=b.getEventSource())&&g.set(b,"cursor",this.editor.toolbar._cursors[this._placeholder?"move-gv":"move-v"]))},
_disable:function(){var b=this._moveable;if(b){p.disconnect(this._startHandle);p.disconnect(this._firstHandle);p.disconnect(this._movingHandle);p.disconnect(this._stopHandle);var f=b.shape;f&&(f=f.getEventSource())&&g.set(f,"cursor","inherit");b.destroy();this._moveable=null}},_needRefresh:function(){var b=this.graphic.getDojoShape(),f=!1;if(b)switch(this._type){case "multipoint":var a=this.relatedGraphic.getDojoShape();a&&(a=a.children[this.ptIndex],b!==a&&(this.graphic._shape=a,f=!0));break;case "polyline":case "polygon":f=
!b._hasMover}return f},_getMoveable:function(b){b=new d(b,m("mac")&&m("ff")&&!u("esri-touch")&&{leftButtonOnly:!0});this._startHandle=p.connect(b,"onMoveStart",this,this._moveStartHandler);this._firstHandle=p.connect(b,"onFirstMove",this,this._firstMoveHandler);this._movingHandle=p.connect(b,"onMoving",this,this._movingHandler);this._stopHandle=p.connect(b,"onMoveStop",this,this._moveStopHandler);return b},_getPtIndex:function(){return this.ptIndex+(this._placeholder?1:0)},_getInfo:function(){return{graphic:this.graphic,
isGhost:this._placeholder,segmentIndex:this.segIndex,pointIndex:this._getPtIndex()}},_moveStartHandler:function(b){var f=this.map;f.snappingManager&&f.snappingManager._setUpSnapping();this.editor.toolbar._deactivateScrollWheel();b.shape.moveToFront();this.constructor.onMoveStart(this);this.editor.toolbar.onVertexMoveStart(this.relatedGraphic,this._getInfo())},_firstMoveHandler:function(b){var f=b.shape,a=this._getControlEdges(),c=this._scratchGL._div,e,d=[],g=b.host.shape._wrapOffsets[0]||0;for(e=
0;e<a.length;e++){var h=a[e];h.x1+=g;h.x2+=g;d.push([c.createLine({x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2}).setStroke(this.editor._lineStroke),h.x1,h.y1,h.x2,h.y2])}f._lines=d;b.shape.moveToFront();this.constructor.onFirstMove(this);this.editor.toolbar.onVertexFirstMove(this.relatedGraphic,this._getInfo())},_movingHandler:function(b,f,a){f=this.map;var c;u("esri-pointer")?c=f.navigationManager.pointerEvents._processTouchEvent(a,a):a&&"pointermove"===a.type&&(c=h.prototype._processTouchEvent.call({map:f},
a,a));c&&f.snappingManager&&f.snappingManager._onSnappingMouseMoveHandler(c);a=b.shape;b=a.getTransform();a=a._lines;for(c=0;c<a.length;c++)f=a[c],f[0].setShape({x1:f[1]+b.dx,y1:f[2]+b.dy,x2:f[3],y2:f[4]});this.editor.toolbar.onVertexMove(this.relatedGraphic,this._getInfo(),b)},_moveStopHandler:function(b){b=b.shape;var f=this.editor.toolbar,a=b.getTransform(),c=this.map,e=this.graphic,d=f._geo?n.geographicToWebMercator(e.geometry):e.geometry;f._activateScrollWheel();var g,h=b._lines;if(h){for(g=
0;g<h.length;g++)h[g][0].removeShape();b._lines=null}g=!1;var h=!0,l=this._getInfo();a&&(a.dx||a.dy)?this._placeholder&&(this._placeholder=!1,g=!0):h=!1;var m;c.snappingManager&&(m=c.snappingManager._snappingPoint);m=m||c.toMap(c.toScreen(d).offset(a.dx,a.dy));c.snappingManager&&c.snappingManager._killOffSnapping();b.setTransform(null);e.setGeometry(f._geo?n.webMercatorToGeographic(m,!0):m);this.constructor.onMoveStop(this,a);f.onVertexMoveStop(this.relatedGraphic,l,a);if(!h)f.onVertexClick(this.relatedGraphic,
l);if(g)f.onVertexAdd(this.relatedGraphic,this._getInfo())},_getControlEdges:function(){var b=this.map,f=this.relatedGraphic.geometry,a=this.segIndex,c=this.ptIndex,e=this.segLength,d=this._scratchGL._getTransform(),g=d.dx,d=d.dy,h=b.toScreen(this.graphic.geometry),b=h.x-g,h=h.y-d,n=[],f=this.editor._getControlPoints(this,f,a,c,e);f[0]&&n.push({x1:b,y1:h,x2:f[0].x-g,y2:f[0].y-d});f[1]&&n.push({x1:b,y1:h,x2:f[1].x-g,y2:f[1].y-d});return n}});u("extend-esri")&&r.setObject("toolbars.VertexMover",t,l);
r.mixin(t,{onMoveStart:function(){},onFirstMove:function(){},onMoveStop:function(){}});return t})},"esri/toolbars/TextEditor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/event dojo/has dojo/dom-construct dojo/dom-class dojo/dom-style dojo/keys ../kernel".split(" "),function(t,r,p,m,g,d,l,h,u,e){t=t(null,{declaredClass:"esri.toolbars.TextEditor",constructor:function(b,e,d){this._graphic=b;this._map=e;this._toolbar=d;this._enable(this._graphic)},destroy:function(){this._disable()},
onEditStart:function(){},onEditEnd:function(){},_enable:function(b){this._editBox?(p.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null):(this._map.navigationManager.setImmediateClick(!0),this._addEditBoxHandler=p.connect(b.getLayer(),"onDblClick",this,function(e){this._map.navigationManager.setImmediateClick(!1);e.graphic==b&&(m.stop(e),p.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null,this._addTextBox(b))}))},_disable:function(){this._applyEdit();this._addEditBoxHandler&&
(p.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null);this._removeTextBox();this.onEditEnd(this._graphic);this._toolbar.onTextEditEnd(this._graphic)},_addTextBox:function(b,e){if(!this._editBox){var g;b.symbol.text||(b.symbol.text="Tempt text",b.setSymbol(b.symbol),g="");var f=this._createInputTextStyle(b,this._map);""!==g&&(g=e||b.symbol.text);this._editBox=d.create("input",{type:"text",value:g});h.set(this._editBox,f);l.add(this._editBox,"esriTextEditorInput");this._map.container.appendChild(this._editBox);
this._editBox.focus();this._editBoxKeyHandler=p.connect(this._editBox,"onkeyup",r.hitch(this,function(a){a.keyCode!=u.ENTER&&a.keyCode!==u.TAB||this._disable()}));this._editBoxBlurHandler=p.connect(this._editBox,"onblur",r.hitch(this,function(a){this._disable()}));b.symbol.text="";b.setSymbol(b.symbol);b.hide();var a=this._editBox;this._disableBoxHandler||(this._disableBoxHandler=this._map.on("zoom-start",r.hitch(this,function(){this._disable()})));this._moveBoxHandler=this._map.on("pan",function(b){h.set(a,
{left:this._editBoxLeft+b.delta.x+"px",top:this._editBoxTop+b.delta.y+"px"})});this._moveBoxStartHandler=this._map.on("pan-start",function(){this._editBoxLeft=parseFloat(h.get(a,"left"));this._editBoxTop=parseFloat(h.get(a,"top"))});this.onEditStart(b,this._editBox);this._toolbar.onTextEditStart(b,this._editBox)}},_removeTextBox:function(){this._editBoxBlurHandler&&(p.disconnect(this._editBoxBlurHandler),this._editBoxBlurHandler=null);this._editBox&&(this._editBox.parentNode.removeChild(this._editBox),
this._editBox=null);this._disableBoxHandler&&(this._disableBoxHandler.remove(),this._disableBoxHandler=null);this._moveBoxHandler&&(this._moveBoxHandler.remove(),this._moveBoxHandler=null);this._moveBoxStartHandler&&(this._moveBoxStartHandler.remove(),this._moveBoxStartHandler=null);this._editBoxKeyHandler&&(p.disconnect(this._editBoxKeyHandler),this._editBoxKeyHandler=null)},_createInputTextStyle:function(b,e){var d=b.getDojoShape().getTransformedBoundingBox(),f=b.symbol.font;return{"font-family":f.family,
"font-size":f.size+"px","font-style":f.style,"font-variant":f.variant,"font-weight":f.weight,left:d[0].x+"px",top:d[0].y+"px",width:Math.abs(d[0].x-d[1].x)/Math.cos(b.symbol.angle/180*Math.PI)+"px"}},_applyEdit:function(){if(this._editBox)if(this._editBox.value){this._graphic.show();var b=this._graphic.symbol;b.text=this._editBox.value;this._graphic.setSymbol(b)}else this._graphic.getLayer().remove(this._graphic)}});g("extend-esri")&&r.setObject("toolbars.TextEditor",t,e);return t})},"esri/dijit/editing/TemplatePicker":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/html dojo/_base/array dojo/_base/json dojo/_base/kernel dojo/has dojo/query dojo/sniff dojo/dom-class dojo/dom-construct dojo/dom-geometry dojo/dom-style dijit/_Widget dijit/_Templated dojo/data/ItemFileReadStore dojox/grid/DataGrid dojox/gfx ../../layers/FeatureLayer ../../symbols/SimpleMarkerSymbol ../../symbols/PictureMarkerSymbol ../../symbols/SimpleFillSymbol ../../symbols/SimpleLineSymbol ./TemplatePickerItem ../../kernel ../../lang ../../request ../_EventedWidget dojo/i18n!../../nls/jsapi dojo/text!./templates/TemplatePicker.html".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v,f,a,c,k,q,B,z,D,A,x,y,G,w,C,E,H,I,O){var P=t([H,a,c],{declaredClass:"esri.dijit.editing.TemplatePicker",widgetsInTemplate:!0,templateString:O,featureLayers:null,items:null,grouping:!0,showTooltip:!1,maxLabelLength:0,rows:4,_rows:0,columns:3,surfaceWidth:30,surfaceHeight:30,emptyMessage:"",useLegend:!0,legendCache:{},_uniqueId:{id:0},_assumedCellWidth:90,_initialAutoWidth:300,_initialAutoHeight:200,_ieTimer:150,constructor:function(a,b){a=a||{};a.items||a.featureLayers||
console.error("TemplatePicker: please provide 'featureLayers' or 'items' parameter in the constructor");this._dojo14x=4<=l.version.minor;this._itemWidgets={};a.featureLayers&&a.featureLayers.length&&(this._flChanged=1);this._nls=I.widgets.templatePicker;this.emptyMessage=a.emptyMessage||this._nls&&this._nls.creationDisabled||""},postMixInProperties:function(){this.inherited(arguments);this._preprocess()},startup:function(){this.inherited(arguments);if("auto"===this.rows&&"auto"===this.columns){var a=
v.getContentBox(this.domNode);a.w||(this.domNode.style.width=this._initialAutoWidth+"px");if(!a.h||1>=a.h)this.domNode.style.height=this._initialAutoHeight+"px";a=v.getContentBox(this.domNode);this._columns=Math.floor(a.w/this._assumedCellWidth)||1}this._applyGridPatches();this._setGridLayout();p.connect(this.grid,"onRowClick",this,this._rowClicked);this._setGridData();this._toggleTooltip();9>h("ie")&&(this._repaintItems=r.hitch(this,this._repaintItems),setTimeout(this._repaintItems,this._ieTimer))},
destroy:function(){this.showTooltip=!1;this._toggleTooltip();this._clearLegendInfo();this.featureLayers=this.items=this.grid=this._flItems=this._itItems=this._groupRowIndices=this._selectedCell=this._selectedInfo=this._selectedItem=null;this.inherited(arguments)},getSelected:function(){return this._selectedCell?this._selectedItem:null},clearSelection:function(){var a=this._selectedCell,b=this._selectedInfo;a&&this._rowClicked({cellNode:a,rowIndex:b.selRow,cellIndex:b.selCol})},update:function(a){a=
"auto"===this.rows&&"auto"===this.columns&&a?!0:!1;var b=this.grid,c;if(a){c=this.domNode;var f;f=l.query("#"+c.id+".templatePicker div.item")[0];c=v.getContentBox(c);f=(f=f&&f.parentNode)?m.coords(f).w:this._assumedCellWidth;this._columns=(this._columns=Math.floor((c.w-b.views.views[0].getScrollbarWidth())/f))||1}f=this._rows;this._preprocess();var e=this._rows;this._setGridLayout();this._setGridData();e!==f&&b.set("autoHeight",this._rows,!1);a?(b._resize({w:c.w,h:c.h}),b.viewsHeaderNode.style.display=
"none"):b.update();this._toggleTooltip();var d=this,g=this.getSelected();g&&b.store.fetch({onComplete:function(a){var c=(a=d._locate(g,d._selectedInfo,a))&&b.views.views[0].getCellNode(a[0],a[1]);c&&d._rowClicked({cellNode:c,rowIndex:a[0],cellIndex:a[1]},!0)}});9>h("ie")&&setTimeout(this._repaintItems,this._ieTimer);a=this.featureLayers;c=this.items;a&&a.length||c&&c.length||!b||!this.emptyMessage||b.showMessage(this.emptyMessage)},_eventMap:{"selection-change":!0},onSelectionChange:function(){},
_setUseLegendAttr:function(a){var b=this.useLegend;this._started&&b===a||(a?this._flChanged=1:this._clearLegendInfo());this.useLegend=a},_setFeatureLayersAttr:function(a){var b=this.featureLayers;this._started&&b===a||(this._flChanged=1);this.featureLayers=a},_adjustRowsCols:function(a){if("auto"===this.rows&&"auto"===this.columns)this._started||(this._rows=!1,this._columns=null,this._autoWidth=!1);else{var b=0;this._rows=this.rows;this._columns=this.columns;"auto"===this.rows?(this.featureLayers?
this.grouping?(b=a.length,g.forEach(a,function(a){b+=Math.ceil(a.length/this.columns)},this)):(g.forEach(a,function(a){b+=a.length},this),b=Math.ceil(b/this.columns)):b=Math.ceil(a.length/this.columns),this._rows=b):"auto"===this.columns&&(this.featureLayers?this.grouping?b=3:(g.forEach(a,function(a){b+=a.length},this),b=Math.ceil(b/this.rows)):b=Math.ceil(a.length/this.rows),this._columns=b)}},_preprocess:function(){this.items&&(this.grouping=!1);this._autoWidth=!1;if("auto"===this.rows||"auto"===
this.columns)this._autoWidth=!0;var a;if(this.featureLayers)if(this.useLegend&&this._flChanged&&(this._legendIndices=[],this._loadingIndices=[],this._legendSymbols={},this._ignoreLegends(),this._loadingLegends=[],clearTimeout(this._legendTimer),this._legendTimer=null,this._processSelectionLayers(),this._flChanged=0),g.every(this.featureLayers,function(a){return a.loaded}))this.featureLayers=g.filter(this.featureLayers,function(a){return!(a.hasZ&&!a.enableZDefaults)}),a=this._flItems=this._getItemsFromLayers(this.featureLayers),
this._adjustRowsCols(a);else{var b=this.featureLayers.length;g.forEach(this.featureLayers,function(a){if(a.loaded)b--;else var c=p.connect(a,"onLoad",this,function(){p.disconnect(c);c=null;b--;b||this.update()})},this)}else a=this._itItems=this._getItemsFromItems(this.items),this._adjustRowsCols(a)},_processSelectionLayers:function(){var a,b,c,f,e,d,h,k={};g.forEach(this.featureLayers,function(e,g){e.mode===z.MODE_SELECTION&&e._map&&e.url&&e._params.drawMode&&!e.source&&(b=r.trim(e._url.path).replace(/\/(MapServer|FeatureServer).*/ig,
"/MapServer").replace(/^https?:\/\//ig,"").toLowerCase(),c=k[b]=k[b]||{},f=c.featureLayers=c.featureLayers||{},d=c.indices=c.indices||[],f[g]=e,d.push(g),a=e._map)});a&&g.forEach(a.layerIds,function(f){(f=a.getLayer(f))&&f.url&&(f.getImageUrl||f.getTileUrl)&&f.loaded&&10.1<=f.version&&(b=r.trim(f._url.path).replace(/(\/MapServer).*/ig,"$1"),e=b.replace(/^https?:\/\//ig,"").toLowerCase(),k[e]&&!k[e].mapServiceUrl&&(c=k[e],c.mapServiceUrl=b,c.mapServiceLayer=f,this._legendIndices=this._legendIndices.concat(c.indices),
h=this._fetchLegend({pickerInstance:this,info:c},e),h.then?(this._loadingIndices=this._loadingIndices.concat(c.indices),this._loadingLegends.push(h)):this._processLegendResponse(h,c)))},this)},_fetchLegend:function(a,b){var c=P.prototype,f=c.legendCache[b];f?f.then&&f._contexts.push(a):(f=c.legendCache[b]=E({url:a.info.mapServiceUrl+"/legend",content:{f:"json"},callbackParamName:"callback"}),f._contexts=[a],f.addBoth(function(a){if(!f.canceled){c.legendCache[b]=a;var e=f._contexts;f._contexts=null;
g.forEach(e,function(b){var c=b.pickerInstance;b=b.info;var e;c._destroyed||(g.forEach(b.indices,function(a){e=g.indexOf(c._loadingIndices,a);-1<e&&c._loadingIndices.splice(e,1)}),e=g.indexOf(c._loadingLegends,f),-1<e&&c._loadingLegends.splice(e,1),c._processLegendResponse(a,b))})}}));return f},_clearLegendInfo:function(){clearTimeout(this._legendTimer);this._ignoreLegends();this._legendIndices=this._loadingIndices=this._legendSymbols=this._loadingLegends=this._legendTimer=null},_ignoreLegends:function(){this._loadingLegends&&
g.forEach(this._loadingLegends,function(a){var b=-1;g.some(a._contexts,function(a,c){a.pickerInstance===this&&(b=c);return-1<b},this);-1<b&&a._contexts.splice(b,1)},this)},_processLegendResponse:function(a,b){if(!a||a instanceof Error){var c;g.forEach(b.indices,function(a){c=g.indexOf(this._legendIndices,a);-1<c&&this._legendIndices.splice(c,1)},this)}else g.forEach(b.indices,function(c){var f=b.featureLayers[c].layerId,e,d=b.mapServiceUrl+"/"+f+"/images/",h=b.mapServiceLayer._getToken(),k,n,q,l;
this._legendSymbols[c]||(k=null,g.some(a.layers,function(a){a.layerId==f&&(k=a);return!!k}),k&&(n=this._legendSymbols[c]={},g.forEach(k.legend,function(a){if((q=a.values)&&q.length)for(e=0;e<q.length;e++)n[q[e]]=a;else n.defaultSymbol=a;(l=a.url)&&!a._fixed&&(a._fixed=1,-1===l.search(/https?\:/)&&(a.url=d+l),h&&-1!==a.url.search(/https?\:/)&&(a.url+=(-1<a.url.indexOf("?")?"\x26":"?")+"token\x3d"+h))})))},this);var f=this;f._started&&!f._legendTimer&&(f._legendTimer=setTimeout(function(){clearTimeout(f._legendTimer);
f._legendTimer=null;f._destroyed||f.update()},0))},_applyGridPatches:function(){var a=this.grid,b=a.adaptWidth,c,e,d;a.adaptWidth=function(){c=this.views.views;for(e=0;d=c[e];e++)f.set(d.headerNode,"display","block");b.apply(this,arguments);for(e=0;d=c[e];e++)f.set(d.headerNode,"display","none")};if(this._dojo14x){if("auto"!==this.rows&&"auto"!==this.columns)var g=p.connect(a,"_onFetchComplete",this,function(){p.disconnect(g);this.grid.set("autoHeight",this._rows)});p.connect(a,"_onDelete",this,this._destroyItems);
p.connect(a,"_clearData",this,this._destroyItems);p.connect(a,"destroy",this,this._destroyItems);(a=a.focus)&&a.findAndFocusGridCell&&(a.findAndFocusGridCell=function(){return!1})}},_setGridLayout:function(){var a=function(a){return function(b,c){return this._cellGet(a,b,c)}},b=r.hitch(this,this._cellFormatter),c=[],f=this._columns,e;for(e=0;e<f;e++)c.push({field:"cell"+e,get:r.hitch(this,a(e)),formatter:b});a={cells:[c]};this.grouping&&(f={field:"groupName",colSpan:f,get:r.hitch(this,this._cellGetGroup),
formatter:r.hitch(this,this._cellGroupFormatter)},a.cells.push([f]));f=this.grid;b=q.prototype.rowsPerPage;f.set("rowsPerPage",this._rows>b?this._rows:b);f.set("structure",a)},_setGridData:function(){var a=[];if(this.grouping){this._groupRowIndices=[];var b,c,f=this._columns;g.forEach(this._flItems,function(e,d){a.push({});var g=0===d?0:b+c+1;this._groupRowIndices.push(g);b=g;c=Math.ceil(e.length/f);a=a.concat(this._getStoreItems(e))},this)}else this.featureLayers?(g.forEach(this._flItems,function(b){a=
a.concat(b)}),a=this._getStoreItems(a)):a=this._getStoreItems(this._itItems);var e=new k({data:{items:a}});this.grid.setStore(e)},_toggleTooltip:function(){if(this.showTooltip){if(!this.tooltip){this.tooltip=n.create("div",{"class":"esriMapTooltip"},this.domNode);this.tooltip.style.display="none";this.tooltip.style.position="fixed";var a=this.grid;this._mouseOverConnect=p.connect(a,"onCellMouseOver",this,this._cellMouseOver);this._mouseOutConnect=p.connect(a,"onCellMouseOut",this,this._cellMouseOut)}}else this.tooltip&&
(p.disconnect(this._mouseOverConnect),p.disconnect(this._mouseOutConnect),n.destroy(this.tooltip),this.tooltip=null)},_rowClicked:function(a,c){var f=a.cellNode,e=a.rowIndex,d=a.cellIndex,g=this._getCellInfo(f,e,d);if(g){var h=this.grid.store;if(!h.getValue(g,"loadingCell")&&(this._selectedCell&&b.remove(this._selectedCell,"selectedItem"),f!==this._selectedCell?(b.add(f,"selectedItem"),this._selectedCell=f,this._selectedItem={featureLayer:h.getValue(g,"layer"),type:h.getValue(g,"type"),template:h.getValue(g,
"template"),symbolInfo:h.getValue(g,"symbolInfo"),item:this._getItem(g)},this._selectedInfo={selRow:e,selCol:d,index1:h.getValue(g,"index1"),index2:h.getValue(g,"index2"),index:h.getValue(g,"index")}):this._selectedCell=this._selectedInfo=this._selectedItem=null,!c))this.onSelectionChange()}},_locate:function(a,b,c){var f=this.grid.store,e=Array(this._columns),d,h=b.index1,k=b.index2,n=b.index,q=a.item;g.some(c,function(a,b){return g.some(e,function(c,e){var g=f.getValue(a,"cell"+e);return g&&(q?
n===f.getValue(g,"index"):h===f.getValue(g,"index1")&&k===f.getValue(g,"index2"))?(d=[b,e],!0):!1})});return d},_getCellInfo:function(a,b,c){if(a)return a=this.grid,b=a.getItem(b),a.store.getValue(b,"cell"+c)},_getItem:function(a){var b=this.items;if(b)return b[this.grid.store.getValue(a,"index")]},_cellMouseOver:function(a){var b=this.tooltip,c=a.cellNode,e=this._getCellInfo(c,a.rowIndex,a.cellIndex);if(b&&e){var d=this.grid.store;a=d.getValue(e,"template");var g=d.getValue(e,"type"),h=d.getValue(e,
"symbolInfo"),d=d.getValue(e,"layer");a=(e=this._getItem(e))&&e.label+(e.description?": "+e.description:"")||a&&a.name+(a.description?": "+a.description:"")||g&&g.name||h&&h.label+(h.description?": "+h.description:"")||(d&&d.name+": ")+"Default";b.style.display="none";b.innerHTML=a;c=m.coords(c.firstChild);f.set(b,{left:c.x+"px",top:c.y+c.h+5+"px"});b.style.display=""}},_cellMouseOut:function(){var a=this.tooltip;a&&(a.style.display="none")},_destroyItems:function(){var a=this._itemWidgets,b;for(b in a)a[b]&&
(a[b].destroy(),delete a[b])},_repaintItems:function(){var a=this._itemWidgets,b;for(b in a){var c=a[b];c&&c._repaint(c._surface)}},_getStoreItems:function(a){var b=this._uniqueId;a=g.map(a,function(a){return r.mixin({surfaceId:"tpick-surface-"+b.id++},a)});for(var c=a.length,f=0,e={},d=0,h,k=[],n=!0,q=this._columns;f<c;)n=!0,h="cell"+d,e[h]=a[f],f++,d++,0===d%q&&(n=!1,k.push(e),e={},d=0);n&&c&&k.push(e);return k},_getItemsFromLayers:function(a){var b=[];g.forEach(a,function(a,c){b.push(this._getItemsFromLayer(a,
c))},this);return b},_getItemsFromLayer:function(a,b){var c=[];if(this.useLegend&&-1<g.indexOf(this._loadingIndices,b))return[{label:this._nls&&this._nls.loading||"",symbol:null,layer:a,type:null,template:null,index1:b,index2:0,loadingCell:1}];var f=[],f=f.concat(a.templates);g.forEach(a.types,function(a){var b=a.templates;g.forEach(b,function(b){b._type_=a});f=f.concat(b)});var f=g.filter(f,C.isDefined),h=a.renderer;if(h){var k=h.declaredClass.replace("esri.renderer.","");if(0<f.length)g.forEach(f,
function(f){var n=f.prototype;if(n){var q;if(q=h.valueExpression?this._createSimpleSymbol(a):this._isUnclassedRenderer(h)?h.infos[0].symbol:h.getSymbol(n)){var l=null,m;if(!(9>e("ie"))&&f.thumbnail&&f.thumbnail.imageData)l=new A(f.thumbnail);else if(this.useLegend&&-1<g.indexOf(this._legendIndices,b)){if(m=this._legendSymbols&&this._legendSymbols[b])switch(k){case "SimpleRenderer":l=m.defaultSymbol;break;case "UniqueValueRenderer":g.some(h.infos,function(a){a.symbol===q&&(l=m[a.value]);return!!l});
break;case "ClassBreaksRenderer":g.some(h.infos,function(a){a.symbol===q&&(l=m[a.maxValue]);return!!l})}l&&(n=d.fromJson(d.toJson(A.defaultProps)),n.url=l.url,n.imageData=l.imageData,n.contentType=l.contentType,n.width=l.width,n.height=l.height,C.isDefined(n.width)&&C.isDefined(n.height)||(n.width=15,n.height=15),l=new A(n))}c.push({label:this._trimLabel(f.name),symbol:l||q,legendOverride:!!l,layer:a,type:f._type_,template:f,index1:b,index2:c.length})}else switch(k){case "HeatmapRenderer":c.push({label:this._trimLabel(f.name),
symbol:new D,legendOverride:!!l,layer:a,type:f._type_,template:f,index1:b,index2:c.length})}}delete f._type_},this);else{var n=[];"TemporalRenderer"===k&&(h=h.observationRenderer)&&(k=h.declaredClass.replace("esri.renderer.",""));switch(k){case "SimpleRenderer":n=[{symbol:h.symbol,label:h.label,description:h.description}];break;case "UniqueValueRenderer":case "ClassBreaksRenderer":n=h.infos}c=g.map(n,function(c,f){return{label:this._trimLabel(c.label),description:c.description,symbolInfo:r.mixin({constructor:function(){}},
c),symbol:c.symbol,layer:a,index1:b,index2:f}},this)}}return c},_isUnclassedRenderer:function(a){return!!((a.hasVisualVariables("sizeInfo",!1)||a.hasVisualVariables("colorInfo",!1)||a.hasVisualVariables("opacityInfo",!1))&&a.addBreak&&a.infos&&1===a.infos.length)},_createSimpleSymbol:function(a){var b;switch(a.geometryType){case "esriGeometryPoint":case "esriGeometryMultipoint":b=new D;break;case "esriGeometryPolyline":b=new y;break;case "esriGeometryPolygon":b=new x;break;default:a.hasXYFootprint&&
a.hasXYFootprint()&&(b=new x)}return b},_getItemsFromItems:function(a){return g.map(a,function(a,b){a=r.mixin({index:b},a);a.label=this._trimLabel(a.label);return a},this)},_trimLabel:function(a){var b=this.maxLabelLength;b&&a&&a.length>b&&(a=a.substr(0,b)+"...");return a||""},_cellGet:function(a,b,c){return c?this.grid.store.getValue(c,"cell"+a):""},_cellFormatter:function(a){if(a){var b=this._itemWidgets,c=this.grid.store,f=c.getValue(a,"surfaceId"),e=b[f];e||(e=b[f]=new G({id:f,label:c.getValue(a,
"label"),symbol:c.getValue(a,"symbol"),legendOverride:c.getValue(a,"legendOverride"),surfaceWidth:this.surfaceWidth,surfaceHeight:this.surfaceHeight,template:c.getValue(a,"template")}));return e||""}return""},_cellGetGroup:function(a,b){if(!this._groupRowIndices)return"";var c=g.indexOf(this._groupRowIndices,a);return b&&-1!==c?(c=this.featureLayers[c])&&(this.groupLabelFunction?this.groupLabelFunction(c):c.name)||"":""},_cellGroupFormatter:function(a){return a?"\x3cdiv class\x3d'groupLabel'\x3e"+
a+"\x3c/div\x3e":""}});h("extend-esri")&&r.setObject("dijit.editing.TemplatePicker",P,w);return P})},"dojo/data/ItemFileReadStore":function(){define("../_base/kernel ../_base/lang ../_base/declare ../_base/array ../_base/xhr ../Evented ./util/filter ./util/simpleFetch ../date/stamp".split(" "),function(t,r,p,m,g,d,l,h,u){p=p("dojo.data.ItemFileReadStore",[d],{constructor:function(e){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=!1;this.url=this._ccUrl=this._jsonFileUrl=
e.url;this._jsonData=e.data;this.data=null;this._datatypeMap=e.typeMap||{};this._datatypeMap.Date||(this._datatypeMap.Date={type:Date,deserialize:function(b){return u.fromISOString(b)}});this._features={"dojo.data.api.Read":!0,"dojo.data.api.Identity":!0};this._itemsByIdentity=null;this._storeRefPropName="_S";this._itemNumPropName="_0";this._rootItemPropName="_RI";this._reverseRefMap="_RRM";this._loadInProgress=!1;this._queuedFetches=[];void 0!==e.urlPreventCache&&(this.urlPreventCache=e.urlPreventCache?
!0:!1);void 0!==e.hierarchical&&(this.hierarchical=e.hierarchical?!0:!1);e.clearOnClose&&(this.clearOnClose=!0);"failOk"in e&&(this.failOk=e.failOk?!0:!1)},url:"",_ccUrl:"",data:null,typeMap:null,clearOnClose:!1,urlPreventCache:!1,failOk:!1,hierarchical:!0,_assertIsItem:function(e){if(!this.isItem(e))throw Error(this.declaredClass+": Invalid item argument.");},_assertIsAttribute:function(e){if("string"!==typeof e)throw Error(this.declaredClass+": Invalid attribute argument.");},getValue:function(e,
b,d){e=this.getValues(e,b);return 0<e.length?e[0]:d},getValues:function(e,b){this._assertIsItem(e);this._assertIsAttribute(b);return(e[b]||[]).slice(0)},getAttributes:function(e){this._assertIsItem(e);var b=[],d;for(d in e)d!==this._storeRefPropName&&d!==this._itemNumPropName&&d!==this._rootItemPropName&&d!==this._reverseRefMap&&b.push(d);return b},hasAttribute:function(e,b){this._assertIsItem(e);this._assertIsAttribute(b);return b in e},containsValue:function(e,b,d){var g=void 0;"string"===typeof d&&
(g=l.patternToRegExp(d,!1));return this._containsValue(e,b,d,g)},_containsValue:function(e,b,d,g){return m.some(this.getValues(e,b),function(b){if(null!==b&&!r.isObject(b)&&g){if(b.toString().match(g))return!0}else if(d===b)return!0})},isItem:function(e){return e&&e[this._storeRefPropName]===this&&this._arrayOfAllItems[e[this._itemNumPropName]]===e?!0:!1},isItemLoaded:function(e){return this.isItem(e)},loadItem:function(e){this._assertIsItem(e.item)},getFeatures:function(){return this._features},
getLabel:function(e){if(this._labelAttr&&this.isItem(e))return this.getValue(e,this._labelAttr)},getLabelAttributes:function(e){return this._labelAttr?[this._labelAttr]:null},filter:function(e,b,d){var g=[],f,a;if(e.query){var c;f=e.queryOptions?e.queryOptions.ignoreCase:!1;var h={};for(a in e.query)c=e.query[a],"string"===typeof c?h[a]=l.patternToRegExp(c,f):c instanceof RegExp&&(h[a]=c);for(f=0;f<b.length;++f){var n=!0,m=b[f];if(null===m)n=!1;else for(a in e.query)c=e.query[a],this._containsValue(m,
a,c,h[a])||(n=!1);n&&g.push(m)}}else for(f=0;f<b.length;++f)a=b[f],null!==a&&g.push(a);d(g,e)},_fetchItems:function(e,b,d){var h=this;if(this._loadFinished)this.filter(e,this._getItemsArray(e.queryOptions),b);else if(this._jsonFileUrl!==this._ccUrl?(t.deprecated(this.declaredClass+": ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0"),this.url=this._ccUrl=this._jsonFileUrl):this.url!==this._ccUrl&&(this._ccUrl=this._jsonFileUrl=
this.url),null!=this.data&&(this._jsonData=this.data,this.data=null),this._jsonFileUrl)if(this._loadInProgress)this._queuedFetches.push({args:e,filter:r.hitch(h,"filter"),findCallback:r.hitch(h,b)});else{this._loadInProgress=!0;var f=g.get({url:h._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});f.addCallback(function(a){try{h._getItemsFromLoadedData(a),h._loadFinished=!0,h._loadInProgress=!1,h.filter(e,h._getItemsArray(e.queryOptions),b),h._handleQueuedFetches()}catch(k){h._loadFinished=
!0,h._loadInProgress=!1,d(k,e)}});f.addErrback(function(a){h._loadInProgress=!1;d(a,e)});var a=null;e.abort&&(a=e.abort);e.abort=function(){var b=f;b&&-1===b.fired&&(b.cancel(),b=null);a&&a.call(e)}}else if(this._jsonData)try{this._loadFinished=!0,this._getItemsFromLoadedData(this._jsonData),this._jsonData=null,h.filter(e,this._getItemsArray(e.queryOptions),b)}catch(c){d(c,e)}else d(Error(this.declaredClass+": No JSON source data was provided as either URL or a nested Javascript object."),e)},_handleQueuedFetches:function(){if(0<
this._queuedFetches.length){for(var e=0;e<this._queuedFetches.length;e++){var b=this._queuedFetches[e],d=b.args,g=b.filter,b=b.findCallback;g?g(d,this._getItemsArray(d.queryOptions),b):this.fetchItemByIdentity(d)}this._queuedFetches=[]}},_getItemsArray:function(e){return e&&e.deep?this._arrayOfAllItems:this._arrayOfTopLevelItems},close:function(e){this.clearOnClose&&this._loadFinished&&!this._loadInProgress&&(""!=this._jsonFileUrl&&null!=this._jsonFileUrl||""!=this.url&&null!=this.url||null!=this.data||
console.debug(this.declaredClass+": WARNING!  Data reload  information has not been provided.  Please set 'url' or 'data' to the appropriate value before the next fetch"),this._arrayOfAllItems=[],this._arrayOfTopLevelItems=[],this._loadFinished=!1,this._itemsByIdentity=null,this._loadInProgress=!1,this._queuedFetches=[])},_getItemsFromLoadedData:function(e){function b(a){return null!==a&&"object"===typeof a&&(!r.isArray(a)||g)&&!r.isFunction(a)&&(a.constructor==Object||r.isArray(a))&&"undefined"===
typeof a._reference&&"undefined"===typeof a._type&&"undefined"===typeof a._value&&f.hierarchical}function d(a){f._arrayOfAllItems.push(a);for(var c in a){var e=a[c];if(e)if(r.isArray(e))for(var g=0;g<e.length;++g){var h=e[g];b(h)&&d(h)}else b(e)&&d(e)}}var g=!1,f=this;this._labelAttr=e.label;var a,c;this._arrayOfAllItems=[];this._arrayOfTopLevelItems=e.items;for(a=0;a<this._arrayOfTopLevelItems.length;++a)c=this._arrayOfTopLevelItems[a],r.isArray(c)&&(g=!0),d(c),c[this._rootItemPropName]=!0;var h=
{},q;for(a=0;a<this._arrayOfAllItems.length;++a)for(q in c=this._arrayOfAllItems[a],c){if(q!==this._rootItemPropName){var l=c[q];null!==l?r.isArray(l)||(c[q]=[l]):c[q]=[null]}h[q]=q}for(;h[this._storeRefPropName];)this._storeRefPropName+="_";for(;h[this._itemNumPropName];)this._itemNumPropName+="_";for(;h[this._reverseRefMap];)this._reverseRefMap+="_";if(h=e.identifier)for(this._itemsByIdentity={},this._features["dojo.data.api.Identity"]=h,a=0;a<this._arrayOfAllItems.length;++a)if(c=this._arrayOfAllItems[a],
e=c[h],e=e[0],Object.hasOwnProperty.call(this._itemsByIdentity,e)){if(this._jsonFileUrl)throw Error(this.declaredClass+":  The json data as specified by: ["+this._jsonFileUrl+"] is malformed.  Items within the list have identifier: ["+h+"].  Value collided: ["+e+"]");if(this._jsonData)throw Error(this.declaredClass+":  The json data provided by the creation arguments is malformed.  Items within the list have identifier: ["+h+"].  Value collided: ["+e+"]");}else this._itemsByIdentity[e]=c;else this._features["dojo.data.api.Identity"]=
Number;for(a=0;a<this._arrayOfAllItems.length;++a)c=this._arrayOfAllItems[a],c[this._storeRefPropName]=this,c[this._itemNumPropName]=a;for(a=0;a<this._arrayOfAllItems.length;++a)for(q in c=this._arrayOfAllItems[a],c)for(e=c[q],h=0;h<e.length;++h)if(l=e[h],null!==l&&"object"==typeof l){if("_type"in l&&"_value"in l){var m=l._type,u=this._datatypeMap[m];if(u)if(r.isFunction(u))e[h]=new u(l._value);else if(r.isFunction(u.deserialize))e[h]=u.deserialize(l._value);else throw Error("dojo.data.ItemFileReadStore: Value provided in typeMap was neither a constructor, nor a an object with a deserialize function");
else throw Error("dojo.data.ItemFileReadStore: in the typeMap constructor arg, no object class was specified for the datatype '"+m+"'");}if(l._reference){l=l._reference;if(r.isObject(l))for(m=0;m<this._arrayOfAllItems.length;++m){var u=this._arrayOfAllItems[m],p=!0,x;for(x in l)u[x]!=l[x]&&(p=!1);p&&(e[h]=u)}else e[h]=this._getItemByIdentity(l);this.referenceIntegrity&&(l=e[h],this.isItem(l)&&this._addReferenceToMap(l,c,q))}else this.isItem(l)&&this.referenceIntegrity&&this._addReferenceToMap(l,c,
q)}},_addReferenceToMap:function(e,b,d){},getIdentity:function(e){var b=this._features["dojo.data.api.Identity"];return b===Number?e[this._itemNumPropName]:(e=e[b])?e[0]:null},fetchItemByIdentity:function(e){var b,d;if(this._loadFinished)b=this._getItemByIdentity(e.identity),e.onItem&&(d=e.scope?e.scope:t.global,e.onItem.call(d,b));else{var h=this;this._jsonFileUrl!==this._ccUrl?(t.deprecated(this.declaredClass+": ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0"),
this.url=this._ccUrl=this._jsonFileUrl):this.url!==this._ccUrl&&(this._ccUrl=this._jsonFileUrl=this.url);null!=this.data&&null==this._jsonData&&(this._jsonData=this.data,this.data=null);this._jsonFileUrl?this._loadInProgress?this._queuedFetches.push({args:e}):(this._loadInProgress=!0,d=g.get({url:h._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk}),d.addCallback(function(f){var a=e.scope?e.scope:t.global;try{h._getItemsFromLoadedData(f),h._loadFinished=
!0,h._loadInProgress=!1,b=h._getItemByIdentity(e.identity),e.onItem&&e.onItem.call(a,b),h._handleQueuedFetches()}catch(c){h._loadInProgress=!1,e.onError&&e.onError.call(a,c)}}),d.addErrback(function(b){h._loadInProgress=!1;e.onError&&e.onError.call(e.scope?e.scope:t.global,b)})):this._jsonData&&(h._getItemsFromLoadedData(h._jsonData),h._jsonData=null,h._loadFinished=!0,b=h._getItemByIdentity(e.identity),e.onItem&&(d=e.scope?e.scope:t.global,e.onItem.call(d,b)))}},_getItemByIdentity:function(e){var b=
null;this._itemsByIdentity?Object.hasOwnProperty.call(this._itemsByIdentity,e)&&(b=this._itemsByIdentity[e]):Object.hasOwnProperty.call(this._arrayOfAllItems,e)&&(b=this._arrayOfAllItems[e]);void 0===b&&(b=null);return b},getIdentityAttributes:function(e){e=this._features["dojo.data.api.Identity"];return e===Number?null:[e]},_forceLoad:function(){var e=this;this._jsonFileUrl!==this._ccUrl?(t.deprecated(this.declaredClass+": ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0"),
this.url=this._ccUrl=this._jsonFileUrl):this.url!==this._ccUrl&&(this._ccUrl=this._jsonFileUrl=this.url);null!=this.data&&(this._jsonData=this.data,this.data=null);if(this._jsonFileUrl){var b=g.get({url:this._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk,sync:!0});b.addCallback(function(b){try{if(!0!==e._loadInProgress&&!e._loadFinished)e._getItemsFromLoadedData(b),e._loadFinished=!0;else if(e._loadInProgress)throw Error(this.declaredClass+":  Unable to perform a synchronous load, an async load is in progress.");
}catch(v){throw console.log(v),v;}});b.addErrback(function(b){throw b;})}else this._jsonData&&(e._getItemsFromLoadedData(e._jsonData),e._jsonData=null,e._loadFinished=!0)}});r.extend(p,h);return p})},"dojo/data/util/filter":function(){define(["../../_base/lang"],function(t){var r={};t.setObject("dojo.data.util.filter",r);r.patternToRegExp=function(p,m){for(var g="^",d=null,l=0;l<p.length;l++)switch(d=p.charAt(l),d){case "\\":g+=d;l++;g+=p.charAt(l);break;case "*":g+=".*";break;case "?":g+=".";break;
case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":g+="\\";default:g+=d}g+="$";return m?new RegExp(g,"mi"):new RegExp(g,"m")};return r})},"dojo/data/util/simpleFetch":function(){define(["../../_base/lang","../../_base/kernel","./sorter"],function(t,r,p){var m={};t.setObject("dojo.data.util.simpleFetch",m);m.errorHandler=function(g,d){d.onError&&d.onError.call(d.scope||r.global,g,d)};m.fetchHandler=function(g,d){var l=d.abort||null,h=!1,m=d.start?
d.start:0,e=d.count&&Infinity!==d.count?m+d.count:g.length;d.abort=function(){h=!0;l&&l.call(d)};var b=d.scope||r.global;d.store||(d.store=this);d.onBegin&&d.onBegin.call(b,g.length,d);d.sort&&g.sort(p.createSortFunction(d.sort,this));if(d.onItem)for(var n=m;n<g.length&&n<e;++n){var v=g[n];h||d.onItem.call(b,v,d)}d.onComplete&&!h&&(n=null,d.onItem||(n=g.slice(m,e)),d.onComplete.call(b,n,d))};m.fetch=function(g){g=g||{};g.store||(g.store=this);this._fetchItems(g,t.hitch(this,"fetchHandler"),t.hitch(this,
"errorHandler"));return g};return m})},"dojo/data/util/sorter":function(){define(["../../_base/lang"],function(t){var r={};t.setObject("dojo.data.util.sorter",r);r.basicComparator=function(p,m){var g=-1;null===p&&(p=void 0);null===m&&(m=void 0);if(p==m)g=0;else if(p>m||null==p)g=1;return g};r.createSortFunction=function(p,m){function g(b,f,a,c){return function(e,d){var g=c.getValue(e,b),h=c.getValue(d,b);return f*a(g,h)}}for(var d=[],l,h=m.comparatorMap,u=r.basicComparator,e=0;e<p.length;e++){l=p[e];
var b=l.attribute;if(b){l=l.descending?-1:1;var n=u;h&&("string"!==typeof b&&"toString"in b&&(b=b.toString()),n=h[b]||u);d.push(g(b,l,n,m))}}return function(b,f){for(var a=0;a<d.length;){var c=d[a++](b,f);if(0!==c)return c}return 0}};return r})},"dojox/grid/DataGrid":function(){define("../main dojo/_base/array dojo/_base/lang dojo/_base/json dojo/_base/sniff dojo/_base/declare ./_Grid ./DataSelection dojo/_base/html dojo/has dojo/has!dojo-bidi?./bidi/_BidiMixin".split(" "),function(t,r,p,m,g,d,l,
h,u){var e=d("dojox.grid.DataGrid",l,{store:null,query:null,queryOptions:null,fetchText:"...",sortFields:null,updateDelay:1,items:null,_store_connects:null,_by_idty:null,_by_idx:null,_cache:null,_pages:null,_pending_requests:null,_bop:-1,_eop:-1,_requests:0,rowCount:0,_isLoaded:!1,_isLoading:!1,keepSelection:!1,postCreate:function(){this._pages=[];this._store_connects=[];this._by_idty={};this._by_idx=[];this._cache=[];this._pending_requests={};this._setStore(this.store);this.inherited(arguments)},
destroy:function(){this.selection.destroy();this.inherited(arguments)},createSelection:function(){this.selection=new h(this)},get:function(b,e){if(e&&"_item"==this.field&&!this.fields)return e;if(e&&this.fields){var d=[],f=this.grid.store;r.forEach(this.fields,function(a){d=d.concat(f.getValues(e,a))});return d}return e||"string"!==typeof b?e?this.field?"_item"==this.field?e:this.grid.store.getValue(e,this.field):this.value:this.defaultValue:this.inherited(arguments)},_checkUpdateStatus:function(){if(0<
this.updateDelay){var b=!1;this._endUpdateDelay&&(clearTimeout(this._endUpdateDelay),delete this._endUpdateDelay,b=!0);this.updating||(this.beginUpdate(),b=!0);if(b){var e=this;this._endUpdateDelay=setTimeout(function(){delete e._endUpdateDelay;e.endUpdate()},this.updateDelay)}}},_onSet:function(b,e,d,f){this._checkUpdateStatus();b=this.getItemIndex(b);-1<b&&this.updateRow(b)},_createItem:function(b,e){var d=this._hasIdentity?this.store.getIdentity(b):m.toJson(this.query)+":idx:"+e+":sort:"+m.toJson(this.getSortProps());
return this._by_idty[d]={idty:d,item:b}},_addItem:function(b,e,d){this._by_idx[e]=this._createItem(b,e);d||this.updateRow(e)},_onNew:function(b,e){this._checkUpdateStatus();var d=this.get("rowCount");this._addingItem=!0;this.updateRowCount(d+1);this._addingItem=!1;this._addItem(b,d);this.showMessage()},_onDelete:function(b){this._checkUpdateStatus();b=this._getItemIndex(b,!0);if(0<=b){this._pages=[];this._eop=this._bop=-1;var e=this._by_idx[b];this._by_idx.splice(b,1);delete this._by_idty[e.idty];
this.updateRowCount(this.get("rowCount")-1);0===this.get("rowCount")&&this.showMessage(this.noDataMessage)}this.selection.isSelected(b)&&(this.selection.deselect(b),this.selection.selected.splice(b,1))},_onRevert:function(){this._refresh()},setStore:function(b,e,d){this._requestsPending(0)||(this._setQuery(e,d),this._setStore(b),this._refresh(!0))},setQuery:function(b,e){this._requestsPending(0)||(this._setQuery(b,e),this._refresh(!0))},setItems:function(b){this.items=b;this._setStore(this.store);
this._refresh(!0)},_setQuery:function(b,e){this.query=b;this.queryOptions=e||this.queryOptions},_setStore:function(b){this.store&&this._store_connects&&r.forEach(this._store_connects,this.disconnect,this);if(this.store=b){b=this.store.getFeatures();var e=[];this._canEdit=!!b["dojo.data.api.Write"]&&!!b["dojo.data.api.Identity"];this._hasIdentity=!!b["dojo.data.api.Identity"];b["dojo.data.api.Notification"]&&!this.items&&(e.push(this.connect(this.store,"onSet","_onSet")),e.push(this.connect(this.store,
"onNew","_onNew")),e.push(this.connect(this.store,"onDelete","_onDelete")));this._canEdit&&e.push(this.connect(this.store,"revert","_onRevert"));this._store_connects=e}},_onFetchBegin:function(b,e){this.scroller&&(this.rowCount!=b&&(e.isRender?(this.scroller.init(b,this.keepRows,this.rowsPerPage),this.rowCount=b,this._setAutoHeightAttr(this.autoHeight,!0),this._skipRowRenormalize=!0,this.prerender(),this._skipRowRenormalize=!1):this.updateRowCount(b)),b?this.showMessage():(this.views.render(),this._resize(),
this.showMessage(this.noDataMessage),this.focus.initFocusView()))},_onFetchComplete:function(b,e){this.scroller&&(b&&0<b.length&&(r.forEach(b,function(b,f){this._addItem(b,e.start+f,!0)},this),this.updateRows(e.start,b.length),e.isRender?(this.setScrollTop(0),this.postrender()):this._lastScrollTop&&this.setScrollTop(this._lastScrollTop),g("ie")&&u.setSelectable(this.domNode,this.selectable)),delete this._lastScrollTop,this._isLoaded||(this._isLoading=!1,this._isLoaded=!0),this._pending_requests[e.start]=
!1)},_onFetchError:function(b,e){console.log(b);delete this._lastScrollTop;this._isLoaded||(this._isLoading=!1,this._isLoaded=!0,this.showMessage(this.errorMessage));this._pending_requests[e.start]=!1;this.onFetchError(b,e)},onFetchError:function(b,e){},_fetch:function(b,e){b=b||0;if(this.store&&!this._pending_requests[b]){this._isLoaded||this._isLoading||(this._isLoading=!0,this.showMessage(this.loadingMessage));this._pending_requests[b]=!0;try{if(this.items){var d=this.items,f=this.store;this.rowsPerPage=
d.length;var a={start:b,count:this.rowsPerPage,isRender:e};this._onFetchBegin(d.length,a);var c=0;r.forEach(d,function(a){f.isItemLoaded(a)||c++});if(0===c)this._onFetchComplete(d,a);else{var g=function(b){c--;0===c&&this._onFetchComplete(d,a)};r.forEach(d,function(a){f.isItemLoaded(a)||f.loadItem({item:a,onItem:g,scope:this})},this)}}else this.store.fetch({start:b,count:this.rowsPerPage,query:this.query,sort:this.getSortProps(),queryOptions:this.queryOptions,isRender:e,onBegin:p.hitch(this,"_onFetchBegin"),
onComplete:p.hitch(this,"_onFetchComplete"),onError:p.hitch(this,"_onFetchError")})}catch(q){this._onFetchError(q,{start:b,count:this.rowsPerPage})}}},_clearData:function(){this.updateRowCount(0);this._by_idty={};this._by_idx=[];this._pages=[];this._bop=this._eop=-1;this._isLoading=this._isLoaded=!1},getItem:function(b){var e=this._by_idx[b];return!e||e&&!e.item?(this._preparePage(b),null):e.item},getItemIndex:function(b){return this._getItemIndex(b,!1)},_getItemIndex:function(b,e){if(!e&&!this.store.isItem(b))return-1;
for(var d=this._hasIdentity?this.store.getIdentity(b):null,f=0,a=this._by_idx.length;f<a;f++){var c=this._by_idx[f];if(c&&(d&&c.idty==d||c.item===b))return f}return-1},filter:function(b,e){this.query=b;e&&this._clearData();this._fetch()},_getItemAttr:function(b,e){var d=this.getItem(b);return d?this.store.getValue(d,e):this.fetchText},_render:function(){this.domNode.parentNode&&(this.scroller.init(this.get("rowCount"),this.keepRows,this.rowsPerPage),this.prerender(),this._fetch(0,!0))},_requestsPending:function(b){return this._pending_requests[b]},
_rowToPage:function(b){return this.rowsPerPage?Math.floor(b/this.rowsPerPage):b},_pageToRow:function(b){return this.rowsPerPage?this.rowsPerPage*b:b},_preparePage:function(b){(b<this._bop||b>=this._eop)&&!this._addingItem&&(b=this._rowToPage(b),this._needPage(b),this._bop=b*this.rowsPerPage,this._eop=this._bop+(this.rowsPerPage||this.get("rowCount")))},_needPage:function(b){this._pages[b]||(this._pages[b]=!0,this._requestPage(b))},_requestPage:function(b){b=this._pageToRow(b);0<Math.min(this.rowsPerPage,
this.get("rowCount")-b)&&(this._requests++,this._requestsPending(b)||setTimeout(p.hitch(this,"_fetch",b,!1),1))},getCellName:function(b){return b.field},_refresh:function(b){this._clearData();this._fetch(0,b)},sort:function(){this.edit.apply();this._lastScrollTop=this.scrollTop;this._refresh()},canSort:function(){return!this._isLoading},getSortProps:function(){var b=this.getCell(this.getSortIndex());if(b){var e=b.sortDesc,d=!(0<this.sortInfo);return[{attribute:b.field,descending:"undefined"==typeof e?
d:d?!e:e}]}return this.sortFields?this.sortFields:null},styleRowState:function(b){if(this.store&&this.store.getState){for(var e=this.store.getState(b.index),d="",f=0,a=["inflight","error","inserting"],c;c=a[f];f++)if(e[c]){d=" dojoxGridRow-"+c;break}b.customClasses+=d}},onStyleRow:function(b){this.styleRowState(b);this.inherited(arguments)},canEdit:function(b,e){return this._canEdit},_copyAttr:function(b,e){var d=this.getItem(b);return this.store.getValue(d,e)},doStartEdit:function(b,e){this._cache[e]||
(this._cache[e]=this._copyAttr(e,b.field));this.onStartEdit(b,e)},doApplyCellEdit:function(b,e,d){this.store.fetchItemByIdentity({identity:this._by_idx[e].idty,onItem:p.hitch(this,function(f){var a=this.store.getValue(f,d);"number"==typeof a?b=isNaN(b)?b:parseFloat(b):"boolean"==typeof a?b="true"==b?!0:"false"==b?!1:b:a instanceof Date&&(a=new Date(b),b=isNaN(a.getTime())?b:a);this.store.setValue(f,d,b);this.onApplyCellEdit(b,e,d)})})},doCancelEdit:function(b){this._cache[b]&&(this.updateRow(b),delete this._cache[b]);
this.onCancelEdit.apply(this,arguments)},doApplyEdit:function(b,e){this.onApplyEdit(b)},removeSelectedRows:function(){if(this._canEdit){this.edit.apply();var b=p.hitch(this,function(b){b.length&&(r.forEach(b,this.store.deleteItem,this.store),this.selection.clear())});this.allItemsSelected?this.store.fetch({query:this.query,queryOptions:this.queryOptions,onComplete:b}):b(this.selection.getSelected())}}});e.cell_markupFactory=function(b,e,d){var f=p.trim(u.attr(e,"field")||"");f&&(d.field=f);d.field=
d.field||d.name;if(f=p.trim(u.attr(e,"fields")||""))d.fields=f.split(",");b&&b(e,d)};e.markupFactory=function(b,d,g,f){return l.markupFactory(b,d,g,p.partial(e.cell_markupFactory,f))};return e})},"dojox/main":function(){define(["dojo/_base/kernel"],function(t){return t.dojox})},"dojox/grid/_Grid":function(){define("dojo/_base/kernel ../main dojo/_base/declare ./_Events ./_Scroller ./_Layout ./_View ./_ViewManager ./_RowManager ./_FocusManager ./_EditManager ./Selection ./_RowSelector ./util dijit/_Widget dijit/_TemplatedMixin dijit/CheckedMenuItem dojo/text!./resources/_Grid.html dojo/string dojo/_base/array dojo/_base/lang dojo/_base/sniff dojox/html/metrics dojo/_base/html dojo/query dojo/dnd/common dojo/i18n!dijit/nls/loading".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v,f,a,c,k,q,B,z,D,A,x,y,G){t.isCopyKey||(t.isCopyKey=t.dnd.getCopyKeyState);p=p("dojox.grid._Grid",[a,c,m],{templateString:q,classTag:"dojoxGrid",rowCount:5,keepRows:75,rowsPerPage:25,autoWidth:!1,initialWidth:"",autoHeight:"",rowHeight:0,autoRender:!0,defaultHeight:"15em",height:"",structure:null,elasticView:-1,singleClickEdit:!1,selectionMode:"extended",rowSelector:"",columnReordering:!1,headerMenu:null,placeholderLabel:"GridColumns",selectable:!1,_click:null,loadingMessage:"\x3cspan class\x3d'dojoxGridLoading'\x3e${loadingState}\x3c/span\x3e",
errorMessage:"\x3cspan class\x3d'dojoxGridError'\x3e${errorState}\x3c/span\x3e",noDataMessage:"",escapeHTMLInData:!0,formatterScope:null,editable:!1,summary:"",_setSummaryAttr:"domNode",sortInfo:0,_placeholders:null,_layoutClass:d,buildRendering:function(){this.inherited(arguments);this.domNode.getAttribute("tabIndex")||(this.domNode.tabIndex="0");this.createScroller();this.createLayout();this.createViews();this.createManagers();this.createSelection();this.connect(this.selection,"onSelected","onSelected");
this.connect(this.selection,"onDeselected","onDeselected");this.connect(this.selection,"onChanged","onSelectionChanged");x.initOnFontResize();this.connect(x,"onFontResize","textSizeChanged");f.funnelEvents(this.domNode,this,"doKeyEvent",f.keyEvents);"none"!=this.selectionMode&&this.domNode.setAttribute("aria-multiselectable","single"==this.selectionMode?"false":"true");y.addClass(this.domNode,this.classTag);this.isLeftToRight()||y.addClass(this.domNode,this.classTag+"Rtl");0<this.rowHeight&&y.addClass(this.viewsNode,
this.classTag+"FixedRowHeight")},postMixInProperties:function(){this.inherited(arguments);var a=t.i18n.getLocalization("dijit","loading",this.lang);this.loadingMessage=B.substitute(this.loadingMessage,a);this.errorMessage=B.substitute(this.errorMessage,a);this.srcNodeRef&&this.srcNodeRef.style.height&&(this.height=this.srcNodeRef.style.height);this._setAutoHeightAttr(this.autoHeight,!0);this.lastScrollTop=this.scrollTop=0},postCreate:function(){this._placeholders=[];this._setHeaderMenuAttr(this.headerMenu);
this._setStructureAttr(this.structure);this._click=[];this.inherited(arguments);this.domNode&&this.autoWidth&&this.initialWidth&&(this.domNode.style.width=this.initialWidth);this.domNode&&!this.editable&&y.attr(this.domNode,"aria-readonly","true")},destroy:function(){this.domNode.onReveal=null;this.domNode.onSizeChange=null;delete this._click;this.scroller&&(this.scroller.destroy(),delete this.scroller);this.edit.destroy();delete this.edit;this.views.destroyViews();this.focus&&(this.focus.destroy(),
delete this.focus);this.headerMenu&&this._placeholders.length&&(z.forEach(this._placeholders,function(a){a.unReplace(!0)}),this.headerMenu.unBindDomNode(this.viewsHeaderNode));this.inherited(arguments)},_setAutoHeightAttr:function(a,b){"string"==typeof a&&(a=a&&"false"!=a?"true"==a?!0:window.parseInt(a,10):!1);"number"==typeof a&&(isNaN(a)&&(a=!1),0>a?a=!0:0===a&&(a=!1));this.autoHeight=a;this._autoHeight="boolean"==typeof a?a:"number"==typeof a?a>=this.get("rowCount"):!1;this._started&&!b&&this.render()},
_getRowCountAttr:function(){return this.updating&&this.invalidated&&void 0!=this.invalidated.rowCount?this.invalidated.rowCount:this.rowCount},textSizeChanged:function(){this.render()},sizeChange:function(){this.update()},createManagers:function(){this.rows=new u(this);this.focus=new e(this);this.edit=new b(this)},createSelection:function(){this.selection=new n(this)},createScroller:function(){this.scroller=new g;this.scroller.grid=this;this.scroller.renderRow=D.hitch(this,"renderRow");this.scroller.removeRow=
D.hitch(this,"rowRemoved")},createLayout:function(){this.layout=new this._layoutClass(this);this.connect(this.layout,"moveColumn","onMoveColumn")},onMoveColumn:function(){this.update()},onResizeColumn:function(a){},createViews:function(){this.views=new h(this);this.views.createView=D.hitch(this,"createView")},createView:function(a,b){var c=new (D.getObject(a))({grid:this,index:b});this.viewsNode.appendChild(c.domNode);this.viewsHeaderNode.appendChild(c.headerNode);this.views.addView(c);y.attr(this.domNode,
"align",this.isLeftToRight()?"left":"right");return c},buildViews:function(){for(var a=0,b;b=this.layout.structure[a];a++)this.createView(b.type||r._scopeName+".grid._View",a).setStructure(b);this.scroller.setContentNodes(this.views.getContentNodes())},_setStructureAttr:function(a){a&&D.isString(a)&&(t.deprecated("dojox.grid._Grid.set('structure', 'objVar')","use dojox.grid._Grid.set('structure', objVar) instead","2.0"),a=D.getObject(a));this.structure=a;if(!a)if(this.layout.structure)a=this.layout.structure;
else return;this.views.destroyViews();this.focus.focusView=null;a!==this.layout.structure&&this.layout.setStructure(a);this._structureChanged()},setStructure:function(a){t.deprecated("dojox.grid._Grid.setStructure(obj)","use dojox.grid._Grid.set('structure', obj) instead.","2.0");this._setStructureAttr(a)},getColumnTogglingItems:function(){var a,b=[];a=z.map(this.layout.cells,function(a){a.menuItems||(a.menuItems=[]);var c=this,e=new k({label:a.name,checked:!a.hidden,_gridCell:a,onChange:function(a){if(c.layout.setColumnVisibility(this._gridCell.index,
a)){var b=this._gridCell.menuItems;1<b.length&&z.forEach(b,function(b){b!==this&&b.setAttribute("checked",a)},this);a=z.filter(c.layout.cells,function(a){1<a.menuItems.length?z.forEach(a.menuItems,"item.set('disabled', false);"):a.menuItems[0].set("disabled",!1);return!a.hidden});1==a.length&&z.forEach(a[0].menuItems,"item.set('disabled', true);")}},destroy:function(){var a=z.indexOf(this._gridCell.menuItems,this);this._gridCell.menuItems.splice(a,1);delete this._gridCell;k.prototype.destroy.apply(this,
arguments)}});a.menuItems.push(e);a.hidden||b.push(e);return e},this);1==b.length&&b[0].set("disabled",!0);return a},_setHeaderMenuAttr:function(a){this._placeholders&&this._placeholders.length&&(z.forEach(this._placeholders,function(a){a.unReplace(!0)}),this._placeholders=[]);this.headerMenu&&this.headerMenu.unBindDomNode(this.viewsHeaderNode);if(this.headerMenu=a)this.headerMenu.bindDomNode(this.viewsHeaderNode),this.headerMenu.getPlaceholders&&(this._placeholders=this.headerMenu.getPlaceholders(this.placeholderLabel))},
setHeaderMenu:function(a){t.deprecated("dojox.grid._Grid.setHeaderMenu(obj)","use dojox.grid._Grid.set('headerMenu', obj) instead.","2.0");this._setHeaderMenuAttr(a)},setupHeaderMenu:function(){this._placeholders&&this._placeholders.length&&z.forEach(this._placeholders,function(a){a._replaced&&a.unReplace(!0);a.replace(this.getColumnTogglingItems())},this)},_fetch:function(a){this.setScrollTop(0)},getItem:function(a){return null},showMessage:function(a){a?(this.messagesNode.innerHTML=a,this.messagesNode.style.display=
""):(this.messagesNode.innerHTML="",this.messagesNode.style.display="none")},_structureChanged:function(){this.buildViews();this.autoRender&&this._started&&this.render()},hasLayout:function(){return this.layout.cells.length},resize:function(a,b){this._pendingChangeSize=a;this._pendingResultSize=b;this.sizeChange()},_getPadBorder:function(){return this._padBorder=this._padBorder||y._getPadBorderExtents(this.domNode)},_getHeaderHeight:function(){var a=this.viewsHeaderNode.style,b="none"==a.display?
0:this.views.measureHeader();a.height=b+"px";this.views.normalizeHeaderNodeHeight();return b},_resize:function(a,b){a=a||this._pendingChangeSize;b=b||this._pendingResultSize;delete this._pendingChangeSize;delete this._pendingResultSize;if(this.domNode){var c=this.domNode.parentNode;if(c&&1==c.nodeType&&this.hasLayout()&&"hidden"!=c.style.visibility&&"none"!=c.style.display){var e=this._getPadBorder(),f=void 0,d;this._autoHeight?this.domNode.style.height="auto":"number"==typeof this.autoHeight?(d=
f=this._getHeaderHeight(),d+=this.scroller.averageRowHeight*this.autoHeight,this.domNode.style.height=d+"px"):this.domNode.clientHeight<=e.h&&(c==document.body?this.domNode.style.height=this.defaultHeight:this.height?this.domNode.style.height=this.height:this.fitTo="parent");b&&(a=b);!this._autoHeight&&a?(y.marginBox(this.domNode,a),this.height=this.domNode.style.height,delete this.fitTo):"parent"==this.fitTo&&(d=this._parentContentBoxHeight=0<this._parentContentBoxHeight?this._parentContentBoxHeight:
y._getContentBox(c).h,this.domNode.style.height=Math.max(0,d)+"px");c=z.some(this.views.views,function(a){return a.flexCells});this._autoHeight||0!==(d||y._getContentBox(this.domNode).h)?(this.viewsHeaderNode.style.display="block",c||void 0!==f||(f=this._getHeaderHeight())):this.viewsHeaderNode.style.display="none";c&&(f=void 0);this.adaptWidth();this.adaptHeight(f);this.postresize()}}},adaptWidth:function(){var a=!this.initialWidth&&this.autoWidth,b=a?0:this.domNode.clientWidth||this.domNode.offsetWidth-
this._getPadBorder().w,b=this.views.arrange(1,b);this.views.onEach("adaptWidth");a&&(this.domNode.style.width=b+"px")},adaptHeight:function(a){a=void 0===a?this._getHeaderHeight():a;var b=this._autoHeight?-1:Math.max(this.domNode.clientHeight-a,0)||0;this.views.onEach("setSize",[0,b]);this.views.onEach("adaptHeight");if(!this._autoHeight){var c=0,e=0,f=z.filter(this.views.views,function(a){(a=a.hasHScrollbar())?c++:e++;return!a});0<c&&0<e&&z.forEach(f,function(a){a.adaptHeight(!0)})}!0===this.autoHeight||
-1!=b||"number"==typeof this.autoHeight&&this.autoHeight>=this.get("rowCount")?this.scroller.windowHeight=b:this.scroller.windowHeight=Math.max(this.domNode.clientHeight-a,0)},startup:function(){this._started||(this.inherited(arguments),this.autoRender&&this.render())},render:function(){this.domNode&&this._started&&(this.hasLayout()?(this.update=this.defaultUpdate,this._render()):this.scroller.init(0,this.keepRows,this.rowsPerPage))},_render:function(){this.scroller.init(this.get("rowCount"),this.keepRows,
this.rowsPerPage);this.prerender();this.setScrollTop(0);this.postrender()},prerender:function(){this.keepRows=this._autoHeight?0:this.keepRows;this.scroller.setKeepInfo(this.keepRows);this.views.render();this._resize()},postrender:function(){this.postresize();this.focus.initFocusView();y.setSelectable(this.domNode,this.selectable)},postresize:function(){if(this._autoHeight){var a=Math.max(this.views.measureContent())+"px";this.viewsNode.style.height=a}},renderRow:function(a,b){this.views.renderRow(a,
b,this._skipRowRenormalize)},rowRemoved:function(a){this.views.rowRemoved(a)},invalidated:null,updating:!1,beginUpdate:function(){this.invalidated=[];this.updating=!0},endUpdate:function(){this.updating=!1;var a=this.invalidated,b;if(a.all)this.update();else if(void 0!=a.rowCount)this.updateRowCount(a.rowCount);else for(b in a)this.updateRow(Number(b));this.invalidated=[]},defaultUpdate:function(){this.domNode&&(this.updating?this.invalidated.all=!0:(this.lastScrollTop=this.scrollTop,this.prerender(),
this.scroller.invalidateNodes(),this.setScrollTop(this.lastScrollTop),this.postrender()))},update:function(){this.render()},updateRow:function(a){a=Number(a);this.updating?this.invalidated[a]=!0:(this.views.updateRow(a),this.scroller.rowHeightChanged(a))},updateRows:function(a,b){a=Number(a);b=Number(b);var c;if(this.updating)for(c=0;c<b;c++)this.invalidated[c+a]=!0;else{for(c=0;c<b;c++)this.views.updateRow(c+a,this._skipRowRenormalize);this.scroller.rowHeightChanged(a)}},updateRowCount:function(a){this.updating?
this.invalidated.rowCount=a:(this.rowCount=a,this._setAutoHeightAttr(this.autoHeight,!0),this.layout.cells.length&&this.scroller.updateRowCount(a),this._resize(),this.layout.cells.length&&this.setScrollTop(this.scrollTop))},updateRowStyles:function(a){this.views.updateRowStyles(a)},getRowNode:function(a){if(!this.focus.focusView||this.focus.focusView instanceof v)for(var b=0,c;c=this.views.views[b];b++){if(!(c instanceof v))return c.rowNodes[a]}else return this.focus.focusView.rowNodes[a];return null},
rowHeightChanged:function(a){this.views.renormalizeRow(a);this.scroller.rowHeightChanged(a)},fastScroll:!0,delayScroll:!1,scrollRedrawThreshold:A("ie")?100:50,scrollTo:function(a){if(this.fastScroll){var b=Math.abs(this.lastScrollTop-a);this.lastScrollTop=a;if(b>this.scrollRedrawThreshold||this.delayScroll){this.delayScroll=!0;this.scrollTop=a;this.views.setScrollTop(a);this._pendingScroll&&window.clearTimeout(this._pendingScroll);var c=this;this._pendingScroll=window.setTimeout(function(){delete c._pendingScroll;
c.finishScrollJob()},200)}else this.setScrollTop(a)}else this.setScrollTop(a)},finishScrollJob:function(){this.delayScroll=!1;this.setScrollTop(this.scrollTop)},setScrollTop:function(a){this.scroller.scroll(this.views.setScrollTop(a))},scrollToRow:function(a){this.setScrollTop(this.scroller.findScrollTop(a)+1)},styleRowNode:function(a,b){b&&this.rows.styleRowNode(a,b)},_mouseOut:function(a){this.rows.setOverRow(-2)},getCell:function(a){return this.layout.cells[a]},setCellWidth:function(a,b){this.getCell(a).unitWidth=
b},getCellName:function(a){return"Cell "+a.index},canSort:function(a){},sort:function(){},getSortAsc:function(a){a=void 0==a?this.sortInfo:a;return 0<a},getSortIndex:function(a){a=void 0==a?this.sortInfo:a;return Math.abs(a)-1},setSortIndex:function(a,b){var c=a+1;void 0!=b?c*=b?1:-1:this.getSortIndex()==a&&(c=-this.sortInfo);this.setSortInfo(c)},setSortInfo:function(a){this.canSort(a)&&(this.sortInfo=a,this.sort(),this.update())},doKeyEvent:function(a){a.dispatch="do"+a.type;this.onKeyEvent(a)},
_dispatch:function(a,b){return a in this?this[a](b):!1},dispatchKeyEvent:function(a){this._dispatch(a.dispatch,a)},dispatchContentEvent:function(a){this.edit.dispatchEvent(a)||a.sourceView.dispatchContentEvent(a)||this._dispatch(a.dispatch,a)},dispatchHeaderEvent:function(a){a.sourceView.dispatchHeaderEvent(a)||this._dispatch("doheader"+a.type,a)},dokeydown:function(a){this.onKeyDown(a)},doclick:function(a){if(a.cellNode)this.onCellClick(a);else this.onRowClick(a)},dodblclick:function(a){if(a.cellNode)this.onCellDblClick(a);
else this.onRowDblClick(a)},docontextmenu:function(a){if(a.cellNode)this.onCellContextMenu(a);else this.onRowContextMenu(a)},doheaderclick:function(a){if(a.cellNode)this.onHeaderCellClick(a);else this.onHeaderClick(a)},doheaderdblclick:function(a){if(a.cellNode)this.onHeaderCellDblClick(a);else this.onHeaderDblClick(a)},doheadercontextmenu:function(a){if(a.cellNode)this.onHeaderCellContextMenu(a);else this.onHeaderContextMenu(a)},doStartEdit:function(a,b){this.onStartEdit(a,b)},doApplyCellEdit:function(a,
b,c){this.onApplyCellEdit(a,b,c)},doCancelEdit:function(a){this.onCancelEdit(a)},doApplyEdit:function(a){this.onApplyEdit(a)},addRow:function(){this.updateRowCount(this.get("rowCount")+1)},removeSelectedRows:function(){this.allItemsSelected?this.updateRowCount(0):this.updateRowCount(Math.max(0,this.get("rowCount")-this.selection.getSelected().length));this.selection.clear()}});p.markupFactory=function(a,b,c,e){var f=function(a){a=y.attr(a,"width")||"auto";"auto"!=a&&"em"!=a.slice(-2)&&"%"!=a.slice(-1)&&
(a=parseInt(a,10)+"px");return a};a.structure||"table"!=b.nodeName.toLowerCase()||(a.structure=G("\x3e colgroup",b).map(function(a){var b=y.attr(a,"span"),b={noscroll:"true"==y.attr(a,"noscroll")?!0:!1,__span:b?parseInt(b,10):1,cells:[]};y.hasAttr(a,"width")&&(b.width=f(a));return b}),a.structure.length||a.structure.push({__span:Infinity,cells:[]}),G("thead \x3e tr",b).forEach(function(b,c){var d=0,g=0,h,k=null;G("\x3e th",b).map(function(b){k?d>=h+k.__span&&(g++,h+=k.__span,k=a.structure[g]):(h=
0,k=a.structure[0]);var q={name:D.trim(y.attr(b,"name")||b.innerHTML),colSpan:parseInt(y.attr(b,"colspan")||1,10),type:D.trim(y.attr(b,"cellType")||""),id:D.trim(y.attr(b,"id")||"")};d+=q.colSpan;var n=y.attr(b,"rowspan");n&&(q.rowSpan=n);y.hasAttr(b,"width")&&(q.width=f(b));y.hasAttr(b,"relWidth")&&(q.relWidth=window.parseInt(y.attr(b,"relWidth"),10));y.hasAttr(b,"hidden")&&(q.hidden="true"==y.attr(b,"hidden")||!0===y.attr(b,"hidden"));e&&e(b,q);q.type=q.type?D.getObject(q.type):r.grid.cells.Cell;
q.type&&q.type.markupFactory&&q.type.markupFactory(b,q);k.cells[c]||(k.cells[c]=[]);k.cells[c].push(q)})}));return new c(a,b)};return p})},"dojox/grid/_Events":function(){define(["dojo/keys","dojo/dom-class","dojo/_base/declare","dojo/_base/event","dojo/_base/sniff"],function(t,r,p,m,g){return p("dojox.grid._Events",null,{cellOverClass:"dojoxGridCellOver",onKeyEvent:function(d){this.dispatchKeyEvent(d)},onContentEvent:function(d){this.dispatchContentEvent(d)},onHeaderEvent:function(d){this.dispatchHeaderEvent(d)},
onStyleRow:function(d){d.customClasses+=(d.odd?" dojoxGridRowOdd":"")+(d.selected?" dojoxGridRowSelected":"")+(d.over?" dojoxGridRowOver":"");this.focus.styleRow(d);this.edit.styleRow(d)},onKeyDown:function(d){if(!d.altKey&&!d.metaKey){var g;switch(d.keyCode){case t.ESCAPE:this.edit.cancel();break;case t.ENTER:if(!this.edit.isEditing()){g=this.focus.getHeaderIndex();if(0<=g){this.setSortIndex(g);break}else this.selection.clickSelect(this.focus.rowIndex,dojo.isCopyKey(d),d.shiftKey);m.stop(d)}d.shiftKey||
(g=this.edit.isEditing(),this.edit.apply(),g||this.edit.setEditCell(this.focus.cell,this.focus.rowIndex));this.edit.isEditing()||((this.focus.focusView||this.views.views[0]).content.decorateEvent(d),this.onRowClick(d),m.stop(d));break;case t.SPACE:this.edit.isEditing()||(g=this.focus.getHeaderIndex(),0<=g?this.setSortIndex(g):(this.selection.clickSelect(this.focus.rowIndex,dojo.isCopyKey(d),d.shiftKey),this.focus._focusifyCellNode(!0),this.focus.setFocusCell(this.focus.cell,this.focus.rowIndex),m.stop(d)));
break;case t.TAB:this.focus[d.shiftKey?"previousKey":"nextKey"](d);break;case t.LEFT_ARROW:case t.RIGHT_ARROW:if(!this.edit.isEditing()){var h=d.keyCode;m.stop(d);g=this.focus.getHeaderIndex();0<=g&&d.shiftKey&&d.ctrlKey?this.focus.colSizeAdjust(d,g,5*(h==t.LEFT_ARROW?-1:1)):(d=h==t.LEFT_ARROW?1:-1,this.isLeftToRight()&&(d*=-1),this.focus.move(0,d))}break;case t.UP_ARROW:this.edit.isEditing()||0===this.focus.rowIndex||(m.stop(d),this.focus.move(-1,0));break;case t.DOWN_ARROW:this.edit.isEditing()||
this.focus.rowIndex+1==this.rowCount||(m.stop(d),this.focus.move(1,0));break;case t.PAGE_UP:this.edit.isEditing()||0===this.focus.rowIndex||(m.stop(d),this.focus.rowIndex!=this.scroller.firstVisibleRow+1?this.focus.move(this.scroller.firstVisibleRow-this.focus.rowIndex,0):(this.setScrollTop(this.scroller.findScrollTop(this.focus.rowIndex-1)),this.focus.move(this.scroller.firstVisibleRow-this.scroller.lastVisibleRow+1,0)));break;case t.PAGE_DOWN:this.edit.isEditing()||this.focus.rowIndex+1==this.rowCount||
(m.stop(d),this.focus.rowIndex!=this.scroller.lastVisibleRow-1?this.focus.move(this.scroller.lastVisibleRow-this.focus.rowIndex-1,0):(this.setScrollTop(this.scroller.findScrollTop(this.focus.rowIndex+1)),this.focus.move(this.scroller.lastVisibleRow-this.scroller.firstVisibleRow-1,0)))}}},onMouseOver:function(d){-1==d.rowIndex?this.onHeaderCellMouseOver(d):this.onCellMouseOver(d)},onMouseOut:function(d){-1==d.rowIndex?this.onHeaderCellMouseOut(d):this.onCellMouseOut(d)},onMouseDown:function(d){-1==
d.rowIndex?this.onHeaderCellMouseDown(d):this.onCellMouseDown(d)},onMouseOverRow:function(d){this.rows.isOver(d.rowIndex)||(this.rows.setOverRow(d.rowIndex),-1==d.rowIndex?this.onHeaderMouseOver(d):this.onRowMouseOver(d))},onMouseOutRow:function(d){if(this.rows.isOver(-1))this.onHeaderMouseOut(d);else this.rows.isOver(-2)||(this.rows.setOverRow(-2),this.onRowMouseOut(d))},onMouseDownRow:function(d){if(-1!=d.rowIndex)this.onRowMouseDown(d)},onCellMouseOver:function(d){d.cellNode&&r.add(d.cellNode,
this.cellOverClass)},onCellMouseOut:function(d){d.cellNode&&r.remove(d.cellNode,this.cellOverClass)},onCellMouseDown:function(d){},onCellClick:function(d){this._click[0]=this._click[1];this._click[1]=d;this.edit.isEditCell(d.rowIndex,d.cellIndex)||this.focus.setFocusCell(d.cell,d.rowIndex);1<this._click.length&&null==this._click[0]&&this._click.shift();this.onRowClick(d)},onCellDblClick:function(d){var l;l=1<this._click.length&&g("ie")?this._click[1]:1<this._click.length&&this._click[0].rowIndex!=
this._click[1].rowIndex?this._click[0]:d;this.focus.setFocusCell(l.cell,l.rowIndex);this.edit.setEditCell(l.cell,l.rowIndex);this.onRowDblClick(d)},onCellContextMenu:function(d){this.onRowContextMenu(d)},onCellFocus:function(d,g){this.edit.cellFocus(d,g)},onRowClick:function(d){this.edit.rowClick(d);this.selection.clickSelectEvent(d)},onRowDblClick:function(d){},onRowMouseOver:function(d){},onRowMouseOut:function(d){},onRowMouseDown:function(d){},onRowContextMenu:function(d){m.stop(d)},onHeaderMouseOver:function(d){},
onHeaderMouseOut:function(d){},onHeaderCellMouseOver:function(d){d.cellNode&&r.add(d.cellNode,this.cellOverClass)},onHeaderCellMouseOut:function(d){d.cellNode&&r.remove(d.cellNode,this.cellOverClass)},onHeaderCellMouseDown:function(d){},onHeaderClick:function(d){},onHeaderCellClick:function(d){this.setSortIndex(d.cell.index);this.onHeaderClick(d)},onHeaderDblClick:function(d){},onHeaderCellDblClick:function(d){this.onHeaderDblClick(d)},onHeaderCellContextMenu:function(d){this.onHeaderContextMenu(d)},
onHeaderContextMenu:function(d){this.headerMenu||m.stop(d)},onStartEdit:function(d,g){},onApplyCellEdit:function(d,g,h){},onCancelEdit:function(d){},onApplyEdit:function(d){},onCanSelect:function(d){return!0},onCanDeselect:function(d){return!0},onSelected:function(d){this.updateRowStyles(d)},onDeselected:function(d){this.updateRowStyles(d)},onSelectionChanged:function(){}})})},"dojox/grid/_Scroller":function(){define(["dijit/registry","dojo/_base/declare","dojo/_base/lang","./util","dojo/_base/html"],
function(t,r,p,m,g){var d=function(d){d&&dojo.forEach(t.toArray(),function(h){h.domNode&&g.isDescendant(h.domNode,d,!0)&&h.destroy()})},l=function(d,l){for(var e=[],b=0,h;h=d.childNodes[b];){b++;var m=g.byId(h);(m&&m.tagName?m.tagName.toLowerCase():"")==l&&e.push(h)}return e};return r("dojox.grid._Scroller",null,{constructor:function(d){this.setContentNodes(d);this.pageHeights=[];this.pageNodes=[];this.stack=[]},rowCount:0,defaultRowHeight:32,keepRows:100,contentNode:null,scrollboxNode:null,defaultPageHeight:0,
keepPages:10,pageCount:0,windowHeight:0,firstVisibleRow:0,lastVisibleRow:0,averageRowHeight:0,page:0,pageTop:0,init:function(d,g,e){switch(arguments.length){case 3:this.rowsPerPage=e;case 2:this.keepRows=g;case 1:this.rowCount=d}this.defaultPageHeight=(0<this.grid.rowHeight?this.grid.rowHeight:this.defaultRowHeight)*this.rowsPerPage;this.pageCount=this._getPageCount(this.rowCount,this.rowsPerPage);this.setKeepInfo(this.keepRows);this.invalidate();this.scrollboxNode&&(this.scrollboxNode.scrollTop=
0,this.scroll(0),this.scrollboxNode.onscroll=p.hitch(this,"onscroll"))},_getPageCount:function(d,g){return d?Math.ceil(d/g)||1:0},destroy:function(){this.invalidateNodes();delete this.contentNodes;delete this.contentNode;delete this.scrollboxNode},setKeepInfo:function(d){this.keepPages=(this.keepRows=d)?Math.max(Math.ceil(this.keepRows/this.rowsPerPage),2):this.keepPages},setContentNodes:function(d){this.colCount=(this.contentNodes=d)?this.contentNodes.length:0;this.pageNodes=[];for(d=0;d<this.colCount;d++)this.pageNodes[d]=
[]},getDefaultNodes:function(){return this.pageNodes[0]||[]},invalidate:function(){this._invalidating=!0;this.invalidateNodes();this.pageHeights=[];this.height=this.pageCount?(this.pageCount-1)*this.defaultPageHeight+this.calcLastPageHeight():0;this.resize();this._invalidating=!1},updateRowCount:function(d){this.invalidateNodes();this.rowCount=d;d=this.pageCount;0===d&&(this.height=1);this.pageCount=this._getPageCount(this.rowCount,this.rowsPerPage);if(this.pageCount<d)for(--d;d>=this.pageCount;d--)this.height-=
this.getPageHeight(d),delete this.pageHeights[d];else this.pageCount>d&&(this.height+=this.defaultPageHeight*(this.pageCount-d-1)+this.calcLastPageHeight());this.resize()},pageExists:function(d){return!!this.getDefaultPageNode(d)},measurePage:function(d){return this.grid.rowHeight?((d+1)*this.rowsPerPage>this.rowCount?this.rowCount-d*this.rowsPerPage:this.rowsPerPage)*this.grid.rowHeight:(d=this.getDefaultPageNode(d))&&d.innerHTML?d.offsetHeight:void 0},positionPage:function(d,g){for(var e=0;e<this.colCount;e++)this.pageNodes[e][d].style.top=
g+"px"},repositionPages:function(d){for(var g=this.getDefaultNodes(),e=0,b=0;b<this.stack.length;b++)e=Math.max(this.stack[b],e);var h=(b=g[d])?this.getPageNodePosition(b)+this.getPageHeight(d):0;for(d+=1;d<=e;d++){if(b=g[d]){if(this.getPageNodePosition(b)==h)break;this.positionPage(d,h)}h+=this.getPageHeight(d)}},installPage:function(d){for(var g=0;g<this.colCount;g++)this.contentNodes[g].appendChild(this.pageNodes[g][d])},preparePage:function(d,g){for(var e=g?this.popPage():null,b=0;b<this.colCount;b++){var h=
this.pageNodes[b],l=null===e?this.createPageNode():this.invalidatePageNode(e,h);l.pageIndex=d;h[d]=l}},renderPage:function(d){var g=[],e;for(e=0;e<this.colCount;e++)g[e]=this.pageNodes[e][d];e=0;for(d*=this.rowsPerPage;e<this.rowsPerPage&&d<this.rowCount;e++,d++)this.renderRow(d,g)},removePage:function(d){var g=0;for(d*=this.rowsPerPage;g<this.rowsPerPage;g++,d++)this.removeRow(d)},destroyPage:function(d){for(var h=0;h<this.colCount;h++){var e=this.invalidatePageNode(d,this.pageNodes[h]);e&&g.destroy(e)}},
pacify:function(d){},pacifying:!1,pacifyTicks:200,setPacifying:function(d){this.pacifying!=d&&(this.pacifying=d,this.pacify(this.pacifying))},startPacify:function(){this.startPacifyTicks=(new Date).getTime()},doPacify:function(){var d=(new Date).getTime()-this.startPacifyTicks>this.pacifyTicks;this.setPacifying(!0);this.startPacify();return d},endPacify:function(){this.setPacifying(!1)},resize:function(){this.scrollboxNode&&(this.windowHeight=this.scrollboxNode.clientHeight);for(var d=0;d<this.colCount;d++)m.setStyleHeightPx(this.contentNodes[d],
Math.max(1,this.height));d=!this._invalidating;if(!d){var g=this.grid.get("autoHeight");"number"==typeof g&&g<=Math.min(this.rowsPerPage,this.rowCount)&&(d=!0)}d&&this.needPage(this.page,this.pageTop);d=this.page<this.pageCount-1?this.rowsPerPage:this.rowCount%this.rowsPerPage||this.rowsPerPage;g=this.getPageHeight(this.page);this.averageRowHeight=0<g&&0<d?g/d:0},calcLastPageHeight:function(){if(!this.pageCount)return 0;var d=(this.rowCount%this.rowsPerPage||this.rowsPerPage)*this.defaultRowHeight;
return this.pageHeights[this.pageCount-1]=d},updateContentHeight:function(d){this.height+=d;this.resize()},updatePageHeight:function(d,g,e){if(this.pageExists(d)){var b=this.getPageHeight(d),h=this.measurePage(d);void 0===h&&(h=b);this.pageHeights[d]=h;if(b!=h){this.updateContentHeight(h-b);var l=this.grid.get("autoHeight");"number"==typeof l&&l>this.rowCount||!0===l&&!g?e?(g=this.grid.viewsNode.style,g.height=parseInt(g.height)+h-b+"px",this.repositionPages(d)):this.grid.sizeChange():this.repositionPages(d)}return h}return 0},
rowHeightChanged:function(d,g){this.updatePageHeight(Math.floor(d/this.rowsPerPage),!1,g)},invalidateNodes:function(){for(;this.stack.length;)this.destroyPage(this.popPage())},createPageNode:function(){var d=document.createElement("div");g.attr(d,"role","presentation");d.style.position="absolute";d.style[this.grid.isLeftToRight()?"left":"right"]="0";return d},getPageHeight:function(d){d=this.pageHeights[d];return void 0!==d?d:this.defaultPageHeight},pushPage:function(d){return this.stack.push(d)},
popPage:function(){return this.stack.shift()},findPage:function(d){for(var g=0,e=0,b=0;g<this.pageCount&&!(b=this.getPageHeight(g),e+b>=d);g++,e+=b);this.page=g;this.pageTop=e},buildPage:function(d,g,e){this.preparePage(d,g);this.positionPage(d,e);this.installPage(d);this.renderPage(d);this.pushPage(d)},needPage:function(d,g){var e=this.getPageHeight(d);this.pageExists(d)?this.positionPage(d,g):(this.buildPage(d,!this.grid._autoHeight&&this.keepPages&&this.stack.length>=this.keepPages,g),e=this.updatePageHeight(d,
!0));return e},onscroll:function(){this.scroll(this.scrollboxNode.scrollTop)},scroll:function(d){this.grid.scrollTop=d;if(this.colCount){this.startPacify();this.findPage(d);for(var g=this.height,e=this.getScrollBottom(d),b=this.page,h=this.pageTop;b<this.pageCount&&(0>e||h<e);b++)h+=this.needPage(b,h);this.firstVisibleRow=this.getFirstVisibleRow(this.page,this.pageTop,d);this.lastVisibleRow=this.getLastVisibleRow(b-1,h,e);g!=this.height&&this.repositionPages(b-1);this.endPacify()}},getScrollBottom:function(d){return 0<=
this.windowHeight?d+this.windowHeight:-1},processNodeEvent:function(d,g){for(var e=d.target;e&&e!=g&&e.parentNode&&e.parentNode.parentNode!=g;)e=e.parentNode;if(!e||!e.parentNode||e.parentNode.parentNode!=g)return!1;d.topRowIndex=e.parentNode.pageIndex*this.rowsPerPage;var b=d.topRowIndex,h;a:{h=0;for(var l,f=e.parentNode;l=f.childNodes[h++];)if(l==e){--h;break a}h=-1}d.rowIndex=b+h;d.rowTarget=e;return!0},processEvent:function(d){return this.processNodeEvent(d,this.contentNode)},renderRow:function(d,
g){},removeRow:function(d){},getDefaultPageNode:function(d){return this.getDefaultNodes()[d]},positionPageNode:function(d,g){},getPageNodePosition:function(d){return d.offsetTop},invalidatePageNode:function(g,l){var e=l[g];e&&(delete l[g],this.removePage(g,e),d(e),e.innerHTML="");return e},getPageRow:function(d){return d*this.rowsPerPage},getLastPageRow:function(d){return Math.min(this.rowCount,this.getPageRow(d+1))-1},getFirstVisibleRow:function(d,g,e){if(!this.pageExists(d))return 0;var b=this.getPageRow(d),
h=this.getDefaultNodes();d=l(h[d],"div");for(var h=0,m=d.length;h<m&&g<e;h++,b++)g+=d[h].offsetHeight;return b?b-1:b},getLastVisibleRow:function(d,g,e){if(!this.pageExists(d))return 0;var b=this.getDefaultNodes(),h=this.getLastPageRow(d);d=l(b[d],"div");for(b=d.length-1;0<=b&&g>e;b--,h--)g-=d[b].offsetHeight;return h+1},findTopRow:function(d){for(var g=this.getDefaultNodes(),g=l(g[this.page],"div"),e=0,b=g.length,h=this.pageTop,m;e<b;e++)if(m=g[e].offsetHeight,h+=m,h>=d)return this.offset=m-(h-d),
e+this.page*this.rowsPerPage;return-1},findScrollTop:function(d){var g=Math.floor(d/this.rowsPerPage),e=0,b;for(b=0;b<g;b++)e+=this.getPageHeight(b);this.pageTop=e;this.page=g;this.needPage(g,this.pageTop);b=this.getDefaultNodes();var h=l(b[g],"div"),g=d-this.rowsPerPage*g;b=0;for(d=h.length;b<d&&b<g;b++)e+=h[b].offsetHeight;return e},dummy:0})})},"dojox/grid/util":function(){define(["../main","dojo/_base/lang","dojo/dom"],function(t,r,p){var m=r.getObject("grid.util",!0,t);m.na="...";m.rowIndexTag=
"gridRowIndex";m.gridViewTag="gridView";m.fire=function(g,d,l){var h=g&&d&&g[d];return h&&(l?h.apply(g,l):g[d]())};m.setStyleHeightPx=function(g,d){if(0<=d){var l=g.style,h=d+"px";g&&l.height!=h&&(l.height=h)}};m.mouseEvents="mouseover mouseout mousedown mouseup click dblclick contextmenu".split(" ");m.keyEvents=["keyup","keydown","keypress"];m.funnelEvents=function(g,d,l,h){h=h?h:m.mouseEvents.concat(m.keyEvents);for(var p=0,e=h.length;p<e;p++)d.connect(g,"on"+h[p],l)};m.removeNode=function(g){(g=
p.byId(g))&&g.parentNode&&g.parentNode.removeChild(g);return g};m.arrayCompare=function(g,d){for(var l=0,h=g.length;l<h;l++)if(g[l]!=d[l])return!1;return g.length==d.length};m.arrayInsert=function(g,d,l){g.length<=d?g[d]=l:g.splice(d,0,l)};m.arrayRemove=function(g,d){g.splice(d,1)};m.arraySwap=function(g,d,l){var h=g[d];g[d]=g[l];g[l]=h};return m})},"dojox/grid/_Layout":function(){define("dojo/_base/kernel ../main dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/dom-geometry ./cells ./_RowSelector".split(" "),
function(t,r,p,m,g,d){return p("dojox.grid._Layout",null,{constructor:function(d){this.grid=d},cells:[],structure:null,defaultWidth:"6em",moveColumn:function(d,g,p,e,b){var h=this.structure[d].cells[0],l=this.structure[g].cells[0],f=null,a=f=0;d=0;for(var c;c=h[d];d++)if(c.index==p){f=d;break}f=h.splice(f,1)[0];f.view=this.grid.views.views[g];d=0;for(c=null;c=l[d];d++)if(c.index==e){a=d;break}b||(a+=1);l.splice(a,0,f);if(p=this.grid.getCell(this.grid.getSortIndex()))p._currentlySorted=this.grid.getSortAsc();
this.cells=[];for(d=p=0;g=this.structure[d];d++)for(e=0;b=g.cells[e];e++)for(h=0;c=b[h];h++)c.index=p,this.cells.push(c),"_currentlySorted"in c&&(l=p+1,l*=c._currentlySorted?1:-1,this.grid.sortInfo=l,delete c._currentlySorted),p++;m.forEach(this.cells,function(a){var b=a.markup[2].split(" ");parseInt(b[1].substring(5))!=a.index&&(b[1]='idx\x3d"'+a.index+'"',a.markup[2]=b.join(" "))});this.grid.setupHeaderMenu()},setColumnVisibility:function(g,h){var l=this.cells[g];if(l.hidden==h){l.hidden=!h;var e=
l.view,b=e.viewWidth;b&&"auto"!=b&&(e._togglingColumn=d.getMarginBox(l.getHeaderNode()).w||0);e.update();return!0}return!1},addCellDef:function(d,h,m){var e=this,b=function(b){var d=0;1<b.colSpan?d=0:(d=b.width||e._defaultCellProps.width||e.defaultWidth,isNaN(d)||(d+="em"));return d};d={grid:this.grid,subrow:d,layoutIndex:h,index:this.cells.length};if(m&&m instanceof r.grid.cells._Base)return h=g.clone(m),d.unitWidth=b(h._props),h=g.mixin(h,this._defaultCellProps,m._props,d);h=m.type||m.cellType||
this._defaultCellProps.type||this._defaultCellProps.cellType||r.grid.cells.Cell;g.isString(h)&&(h=g.getObject(h));d.unitWidth=b(m);return new h(g.mixin({},this._defaultCellProps,m,d))},addRowDef:function(d,g){for(var h=[],e=0,b=0,l=!0,p=0,f;f=g[p];p++)f=this.addCellDef(d,p,f),h.push(f),this.cells.push(f),l&&f.relWidth?e+=f.relWidth:f.width&&(f=f.width,"string"==typeof f&&"%"==f.slice(-1)?b+=window.parseInt(f,10):"auto"==f&&(l=!1));e&&l&&m.forEach(h,function(a){a.relWidth&&(a.width=a.unitWidth=a.relWidth/
e*(100-b)+"%")});return h},addRowsDef:function(d){var h=[];if(g.isArray(d))if(g.isArrayLike(d[0]))for(var l=0,e;d&&(e=d[l]);l++)h.push(this.addRowDef(l,e));else h.push(this.addRowDef(0,d));return h},addViewDef:function(d){this._defaultCellProps=d.defaultCell||{};d.width&&"auto"==d.width&&delete d.width;return g.mixin({},d,{cells:this.addRowsDef(d.rows||d.cells)})},setStructure:function(d){this.fieldIndex=0;this.cells=[];var h=this.structure=[];if(this.grid.rowSelector){var l={type:r._scopeName+".grid._RowSelector"};
if(g.isString(this.grid.rowSelector)){var e=this.grid.rowSelector;"false"==e?l=null:"true"!=e&&(l.width=e)}else this.grid.rowSelector||(l=null);l&&h.push(this.addViewDef(l))}var b=function(a){return"name"in a||"field"in a||"get"in a},l=function(a){return g.isArray(a)&&(g.isArray(a[0])||b(a[0]))?!0:!1},e=function(a){return null!==a&&g.isObject(a)&&("cells"in a||"rows"in a||"type"in a&&!b(a))};if(g.isArrayLike(d)){for(var n=!1,m=0,f;f=d[m];m++)if(e(f)){n=!0;break}if(n)for(m=0;f=d[m];m++)l(f)?h.push(this.addViewDef({cells:f})):
e(f)&&h.push(this.addViewDef(f));else h.push(this.addViewDef({cells:d}))}else e(d)&&h.push(this.addViewDef(d));this.cellCount=this.cells.length;this.grid.setupHeaderMenu()}})})},"dojox/grid/cells":function(){define(["../main","./cells/_base"],function(t){return t.grid.cells})},"dojox/grid/cells/_base":function(){define("dojo/_base/kernel dojo/_base/declare dojo/_base/lang dojo/_base/event dojo/_base/connect dojo/_base/array dojo/_base/sniff dojo/dom dojo/dom-attr dojo/dom-construct dijit/_Widget ../util".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n){var v=r("dojox.grid._DeferredTextWidget",b,{deferred:null,_destroyOnRemove:!0,postCreate:function(){this.deferred&&this.deferred.addBoth(p.hitch(this,function(a){this.domNode&&(this.domNode.innerHTML=a)}))}}),f=function(){setTimeout(p.hitch.apply(t,arguments),0)},a=r("dojox.grid.cells._Base",null,{styles:"",classes:"",editable:!1,alwaysEditing:!1,formatter:null,defaultValue:"...",value:null,hidden:!1,noresize:!1,draggable:!0,_valueProp:"value",_formatPending:!1,constructor:function(a){this._props=
a||{};p.mixin(this,a);void 0===this.draggable&&(this.draggable=!0)},_defaultFormat:function(a,b){var c=this.grid.formatterScope||this,d=this.formatter;d&&c&&"string"==typeof d&&(d=this.formatter=c[d]);c=a!=this.defaultValue&&d?d.apply(c,b):a;if("undefined"==typeof c)return this.defaultValue;c&&c.addBoth&&(c=new v({deferred:c},e.create("span",{innerHTML:this.defaultValue})));return c&&c.declaredClass&&c.startup?"\x3cdiv class\x3d'dojoxGridStubNode' linkWidget\x3d'"+c.id+"' cellIdx\x3d'"+this.index+
"'\x3e"+this.defaultValue+"\x3c/div\x3e":c},format:function(a,b){var c=this.grid.edit.info,d=this.get?this.get(a,b):this.value||this.defaultValue,d=d&&d.replace&&this.grid.escapeHTMLInData?d.replace(/&(?![a-z0-9]{1,8}\;)/ig,"\x26amp;").replace(/</g,"\x26lt;"):d;return this.editable&&(this.alwaysEditing||c.rowIndex==a&&c.cell==this)?this.formatEditing(c.value?c.value:d,a):this._defaultFormat(d,[d,a,this])},formatEditing:function(a,b){},getNode:function(a){return this.view.getCellNode(a,this.index)},
getHeaderNode:function(){return this.view.getHeaderCellNode(this.index)},getEditNode:function(a){return(this.getNode(a)||0).firstChild||0},canResize:function(){var a=this.unitWidth;return a&&"auto"!==a},isFlex:function(){var a=this.unitWidth;return a&&p.isString(a)&&("auto"==a||"%"==a.slice(-1))},applyEdit:function(a,b){this.getNode(b)&&this.grid.edit.applyCellEdit(a,this,b)},cancelEdit:function(a){this.grid.doCancelEdit(a)},_onEditBlur:function(a){this.grid.edit.isEditCell(a,this.index)&&this.grid.edit.apply()},
registerOnBlur:function(a,b){this.commitOnBlur&&g.connect(a,"onblur",function(a){setTimeout(p.hitch(this,"_onEditBlur",b),250)})},needFormatNode:function(a,b){this._formatPending=!0;f(this,"_formatNode",a,b)},cancelFormatNode:function(){this._formatPending=!1},_formatNode:function(a,b){this._formatPending&&(this._formatPending=!1,l("ie")||h.setSelectable(this.grid.domNode,!0),this.formatNode(this.getEditNode(b),a,b))},formatNode:function(a,b,c){l("ie")?f(this,"focus",c,a):this.focus(c,a)},dispatchEvent:function(a,
b){if(a in this)return this[a](b)},getValue:function(a){return this.getEditNode(a)[this._valueProp]},setValue:function(a,b){var c=this.getEditNode(a);c&&(c[this._valueProp]=b)},focus:function(a,b){var c=b||this.getEditNode(a);try{n.fire(c,"focus"),n.fire(c,"select")}catch(D){}},save:function(a){this.value=this.value||this.getValue(a)},restore:function(a){this.setValue(a,this.value)},_finish:function(a){h.setSelectable(this.grid.domNode,!1);this.cancelFormatNode()},apply:function(a){this.applyEdit(this.getValue(a),
a);this._finish(a)},cancel:function(a){this.cancelEdit(a);this._finish(a)}});a.markupFactory=function(a,b){var c=p.trim(u.get(a,"formatter")||"");c&&(b.formatter=p.getObject(c)||c);if(c=p.trim(u.get(a,"get")||""))b.get=p.getObject(c);c=function(b,c,d){var e=p.trim(u.get(a,b)||"");e&&(c[d||b]="false"!=e.toLowerCase())};c("sortDesc",b);c("editable",b);c("alwaysEditing",b);c("noresize",b);c("draggable",b);if(c=p.trim(u.get(a,"loadingText")||u.get(a,"defaultValue")||""))b.defaultValue=c;c=function(b,
c,d){var e=p.trim(u.get(a,b)||"")||void 0;e&&(c[d||b]=e)};c("styles",b);c("headerStyles",b);c("cellStyles",b);c("classes",b);c("headerClasses",b);c("cellClasses",b)};var c=a.Cell=r("dojox.grid.cells.Cell",a,{constructor:function(){this.keyFilter=this.keyFilter},keyFilter:null,formatEditing:function(a,b){this.needFormatNode(a,b);return'\x3cinput class\x3d"dojoxGridInput" type\x3d"text" value\x3d"'+a+'"\x3e'},formatNode:function(a,b,c){this.inherited(arguments);this.registerOnBlur(a,c)},doKey:function(a){this.keyFilter&&
-1==String.fromCharCode(a.charCode).search(this.keyFilter)&&m.stop(a)},_finish:function(a){this.inherited(arguments);var b=this.getEditNode(a);try{n.fire(b,"blur")}catch(z){}}});c.markupFactory=function(b,c){a.markupFactory(b,c);var d=p.trim(u.get(b,"keyFilter")||"");d&&(c.keyFilter=new RegExp(d))};(a.RowIndex=r("dojox.grid.cells.RowIndex",c,{name:"Row",postscript:function(){this.editable=!1},get:function(a){return a+1}})).markupFactory=function(a,b){c.markupFactory(a,b)};(a.Select=r("dojox.grid.cells.Select",
c,{options:null,values:null,returnIndex:-1,constructor:function(a){this.values=this.values||this.options},formatEditing:function(a,b){this.needFormatNode(a,b);for(var c=['\x3cselect class\x3d"dojoxGridSelect"\x3e'],d=0,e,f;void 0!==(e=this.options[d])&&void 0!==(f=this.values[d]);d++)f=f.replace?f.replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;"):f,e=e.replace?e.replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;"):e,c.push("\x3coption",a==f?" selected":"",' value\x3d"'+f+'"',"\x3e",e,"\x3c/option\x3e");
c.push("\x3c/select\x3e");return c.join("")},_defaultFormat:function(a,b){var c=this.inherited(arguments);if(!this.formatter&&this.values&&this.options){var e=d.indexOf(this.values,c);0<=e&&(c=this.options[e])}return c},getValue:function(a){var b=this.getEditNode(a);if(b)return a=b.selectedIndex,b=b.options[a],-1<this.returnIndex?a:b.value||b.innerHTML}})).markupFactory=function(a,b){c.markupFactory(a,b);var d=p.trim(u.get(a,"options")||"");if(d){var e=d.split(",");e[0]!=d&&(b.options=e)}if(d=p.trim(u.get(a,
"values")||""))e=d.split(","),e[0]!=d&&(b.values=e)};var k=a.AlwaysEdit=r("dojox.grid.cells.AlwaysEdit",c,{alwaysEditing:!0,_formatNode:function(a,b){this.formatNode(this.getEditNode(b),a,b)},applyStaticValue:function(a){var b=this.grid.edit;b.applyCellEdit(this.getValue(a),this,a);b.start(this,a,!0)}});k.markupFactory=function(a,b){c.markupFactory(a,b)};(a.Bool=r("dojox.grid.cells.Bool",k,{_valueProp:"checked",formatEditing:function(a,b){return'\x3cinput class\x3d"dojoxGridInput" type\x3d"checkbox"'+
(a?' checked\x3d"checked"':"")+' style\x3d"width: auto" /\x3e'},doclick:function(a){"INPUT"==a.target.tagName&&this.applyStaticValue(a.rowIndex)}})).markupFactory=function(a,b){k.markupFactory(a,b)};return a})},"dojox/grid/_RowSelector":function(){define(["dojo/_base/declare","./_View"],function(t,r){return t("dojox.grid._RowSelector",r,{defaultWidth:"2em",noscroll:!0,padBorderWidth:2,buildRendering:function(){this.inherited("buildRendering",arguments);this.scrollboxNode.style.overflow="hidden";this.headerNode.style.visibility=
"hidden"},getWidth:function(){return this.viewWidth||this.defaultWidth},buildRowContent:function(p,m){m.innerHTML='\x3ctable class\x3d"dojoxGridRowbarTable" style\x3d"width:'+(this.contentWidth||0)+'px;height:1px;" border\x3d"0" cellspacing\x3d"0" cellpadding\x3d"0" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd class\x3d"dojoxGridRowbarInner"\x3e\x26nbsp;\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e'},renderHeader:function(){},updateRow:function(){},resize:function(){this.adaptHeight()},adaptWidth:function(){!("contentWidth"in
this)&&this.contentNode&&0<this.contentNode.offsetWidth&&(this.contentWidth=this.contentNode.offsetWidth-this.padBorderWidth)},doStyleRowNode:function(p,m){var g=["dojoxGridRowbar dojoxGridNonNormalizedCell"];this.grid.rows.isOver(p)&&g.push("dojoxGridRowbarOver");this.grid.selection.isSelected(p)&&g.push("dojoxGridRowbarSelected");m.className=g.join(" ")},domouseover:function(p){this.grid.onMouseOverRow(p)},domouseout:function(p){if(!this.isIntraRowEvent(p))this.grid.onMouseOutRow(p)}})})},"dojox/grid/_View":function(){define("dojo dijit/registry ../main dojo/_base/declare dojo/_base/array dojo/_base/lang dojo/_base/connect dojo/_base/sniff dojo/query dojo/_base/window dojo/text!./resources/View.html dojo/dnd/Source dijit/_Widget dijit/_TemplatedMixin dojox/html/metrics ./util dojo/_base/html ./_Builder dojo/dnd/Avatar dojo/dnd/Manager".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n,v,f,a,c,k,q,B,z){b=m("dojox.grid._View",[v,f],{defaultWidth:"18em",viewWidth:"",templateString:b,classTag:"dojoxGrid",marginBottom:0,rowPad:2,_togglingColumn:-1,_headerBuilderClass:q._HeaderBuilder,_contentBuilderClass:q._ContentBuilder,postMixInProperties:function(){this.rowNodes={}},postCreate:function(){this.connect(this.scrollboxNode,"onscroll","doscroll");c.funnelEvents(this.contentNode,this,"doContentEvent","mouseover mouseout click dblclick contextmenu mousedown".split(" "));
c.funnelEvents(this.headerNode,this,"doHeaderEvent","dblclick mouseover mouseout mousemove mousedown click contextmenu".split(" "));this.content=new this._contentBuilderClass(this);this.header=new this._headerBuilderClass(this);this.grid.isLeftToRight()||(this.headerNodeContainer.style.width="")},destroy:function(){k.destroy(this.headerNode);delete this.headerNode;for(var a in this.rowNodes)this._cleanupRowWidgets(this.rowNodes[a]),k.destroy(this.rowNodes[a]);this.rowNodes={};this.source&&this.source.destroy();
this.inherited(arguments)},focus:function(){h("ie")||h("webkit")||h("opera")?this.hiddenFocusNode.focus():this.scrollboxNode.focus()},setStructure:function(a){a=this.structure=a;a.width&&!isNaN(a.width)?this.viewWidth=a.width+"em":this.viewWidth=a.width||(a.noscroll?"auto":this.viewWidth);this._onBeforeRow=a.onBeforeRow||function(){};this._onAfterRow=a.onAfterRow||function(){};if(this.noscroll=a.noscroll)this.scrollboxNode.style.overflow="hidden";this.simpleStructure=1==a.cells.length;this.testFlexCells();
this.updateStructure()},_cleanupRowWidgets:function(a){a&&g.forEach(u("[widgetId]",a).map(r.byNode),function(a){a._destroyOnRemove?(a.destroy(),delete a):a.domNode&&a.domNode.parentNode&&a.domNode.parentNode.removeChild(a.domNode)})},onBeforeRow:function(a,b){this._onBeforeRow(a,b);0<=a&&this._cleanupRowWidgets(this.getRowNode(a))},onAfterRow:function(a,b,c){this._onAfterRow(a,b,c);var d=this.grid;g.forEach(u(".dojoxGridStubNode",c),function(a){if(a&&a.parentNode){var b=a.getAttribute("linkWidget"),
c=window.parseInt(k.attr(a,"cellIdx"),10);d.getCell(c);(b=r.byId(b))?(a.parentNode.replaceChild(b.domNode,a),b._started||b.startup(),t.destroy(a)):a.innerHTML=""}},this)},testFlexCells:function(){this.flexCells=!1;for(var a=0,b;b=this.structure.cells[a];a++)for(var c=0,d;d=b[c];c++)d.view=this,this.flexCells=this.flexCells||d.isFlex();return this.flexCells},updateStructure:function(){this.header.update();this.content.update()},getScrollbarWidth:function(){var b=this.hasVScrollbar(),c=k.style(this.scrollboxNode,
"overflow");this.noscroll||!c||"hidden"==c?b=!1:"scroll"==c&&(b=!0);return b?a.getScrollbar().w:0},getColumnsWidth:function(){var a=this.headerContentNode;return a&&a.firstChild?a.firstChild.offsetWidth||k.style(a.firstChild,"width"):0},setColumnsWidth:function(a){this.headerContentNode.firstChild.style.width=a+"px";this.viewWidth&&(this.viewWidth=a+"px")},getWidth:function(){return this.viewWidth||this.getColumnsWidth()+this.getScrollbarWidth()+"px"},getContentWidth:function(){return Math.max(0,
k._getContentBox(this.domNode).w-this.getScrollbarWidth())+"px"},render:function(){this.scrollboxNode.style.height="";this.renderHeader();0<=this._togglingColumn&&(this.setColumnsWidth(this.getColumnsWidth()-this._togglingColumn),this._togglingColumn=-1);var a=this.grid.layout.cells,b=d.hitch(this,function(b,c){!this.grid.isLeftToRight()&&(c=!c);for(var d=c?-1:1,e=this.header.getCellNodeIndex(b)+d,f=a[e];f&&f.getHeaderNode()&&"none"==f.getHeaderNode().style.display;)e+=d,f=a[e];return f?f.getHeaderNode():
null});if(this.grid.columnReordering&&this.simpleStructure){this.source&&this.source.destroy();this.bottomMarker&&k.destroy(this.bottomMarker);this.bottomMarker=k.byId("dojoxGrid_bottomMarker");this.topMarker&&k.destroy(this.topMarker);this.topMarker=k.byId("dojoxGrid_topMarker");this.bottomMarker||(this.bottomMarker=k.create("div",{id:"dojoxGrid_bottomMarker","class":"dojoxGridColPlaceBottom"},e.body()),this._hide(this.bottomMarker),this.topMarker=k.create("div",{id:"dojoxGrid_topMarker","class":"dojoxGridColPlaceTop"},
e.body()),this._hide(this.topMarker));this.arrowDim=k.contentBox(this.bottomMarker);var c=k.contentBox(this.headerContentNode.firstChild.rows[0]).h;this.source=new n(this.headerContentNode.firstChild.rows[0],{horizontal:!0,accept:["gridColumn_"+this.grid.id],viewIndex:this.index,generateText:!1,onMouseDown:d.hitch(this,function(a){this.header.decorateEvent(a);if((this.header.overRightResizeArea(a)||this.header.overLeftResizeArea(a))&&this.header.canResize(a)&&!this.header.moveable)this.header.beginColumnResize(a);
else{if(this.grid.headerMenu)this.grid.headerMenu.onCancel(!0);a.button===(9>h("ie")?1:0)&&n.prototype.onMouseDown.call(this.source,a)}}),onMouseOver:d.hitch(this,function(a){var b=this.source;b._getChildByEvent(a)&&n.prototype.onMouseOver.apply(b,arguments)}),_markTargetAnchor:d.hitch(this,function(a){var d=this.source;if(d.current!=d.targetAnchor||d.before!=a){d.targetAnchor&&b(d.targetAnchor,d.before)&&d._removeItemClass(b(d.targetAnchor,d.before),d.before?"After":"Before");n.prototype._markTargetAnchor.call(d,
a);var e=a?d.targetAnchor:b(d.targetAnchor,d.before);a=0;e||(e=d.targetAnchor,a=k.contentBox(e).w+this.arrowDim.w/2+2);e=k.position(e,!0);a=Math.floor(e.x-this.arrowDim.w/2+a);k.style(this.bottomMarker,"visibility","visible");k.style(this.topMarker,"visibility","visible");k.style(this.bottomMarker,{left:a+"px",top:c+e.y+"px"});k.style(this.topMarker,{left:a+"px",top:e.y-this.arrowDim.h+"px"});d.targetAnchor&&b(d.targetAnchor,d.before)&&d._addItemClass(b(d.targetAnchor,d.before),d.before?"After":"Before")}}),
_unmarkTargetAnchor:d.hitch(this,function(){var a=this.source;a.targetAnchor&&(a.targetAnchor&&b(a.targetAnchor,a.before)&&a._removeItemClass(b(a.targetAnchor,a.before),a.before?"After":"Before"),this._hide(this.bottomMarker),this._hide(this.topMarker),n.prototype._unmarkTargetAnchor.call(a))}),destroy:d.hitch(this,function(){l.disconnect(this._source_conn);l.unsubscribe(this._source_sub);n.prototype.destroy.call(this.source);this.bottomMarker&&(k.destroy(this.bottomMarker),delete this.bottomMarker);
this.topMarker&&(k.destroy(this.topMarker),delete this.topMarker)}),onDndCancel:d.hitch(this,function(){n.prototype.onDndCancel.call(this.source);this._hide(this.bottomMarker);this._hide(this.topMarker)})});this._source_conn=l.connect(this.source,"onDndDrop",this,"_onDndDrop");this._source_sub=l.subscribe("/dnd/drop/before",this,"_onDndDropBefore");this.source.startup()}},_hide:function(a){k.style(a,{top:"-10000px",visibility:"hidden"})},_onDndDropBefore:function(a,b,c){z.manager().target===this.source&&
(this.source._targetNode=this.source.targetAnchor,this.source._beforeTarget=this.source.before,b=this.grid.views.views,a=b[a.viewIndex],b=b[this.index],b!=a&&(a.convertColPctToFixed(),b.convertColPctToFixed()))},_onDndDrop:function(a,b,c){if(z.manager().target!==this.source)z.manager().source===this.source&&(this._removingColumn=!0);else{this._hide(this.bottomMarker);this._hide(this.topMarker);c=function(a){return a?k.attr(a,"idx"):null};var d=k.marginBox(b[0]).w;if(a.viewIndex!==this.index){var e=
this.grid.views.views,f=e[a.viewIndex],e=e[this.index];f.viewWidth&&"auto"!=f.viewWidth&&f.setColumnsWidth(f.getColumnsWidth()-d);e.viewWidth&&"auto"!=e.viewWidth&&e.setColumnsWidth(e.getColumnsWidth())}d=this.source._targetNode;f=this.source._beforeTarget;!this.grid.isLeftToRight()&&(f=!f);var e=this.grid.layout,g=this.index;delete this.source._targetNode;delete this.source._beforeTarget;e.moveColumn(a.viewIndex,g,c(b[0]),c(d),f)}},renderHeader:function(){this.headerContentNode.innerHTML=this.header.generateHtml(this._getHeaderContent);
this.flexCells&&(this.contentWidth=this.getContentWidth(),this.headerContentNode.firstChild.style.width=this.contentWidth);c.fire(this,"onAfterRow",[-1,this.structure.cells,this.headerContentNode])},_getHeaderContent:function(a){var b=a.name||a.grid.getCellName(a);/^\s+$/.test(b)&&(b="\x26nbsp;");var c=['\x3cdiv class\x3d"dojoxGridSortNode'];a.index!=a.grid.getSortIndex()?c.push('"\x3e'):c=c.concat([" ",0<a.grid.sortInfo?"dojoxGridSortUp":"dojoxGridSortDown",'"\x3e\x3cdiv class\x3d"dojoxGridArrowButtonChar"\x3e',
0<a.grid.sortInfo?"\x26#9650;":"\x26#9660;",'\x3c/div\x3e\x3cdiv class\x3d"dojoxGridArrowButtonNode" role\x3d"presentation"\x3e\x3c/div\x3e','\x3cdiv class\x3d"dojoxGridColCaption"\x3e']);c=c.concat([b,"\x3c/div\x3e\x3c/div\x3e"]);return c.join("")},resize:function(){this.adaptHeight();this.adaptWidth()},hasHScrollbar:function(a){var b=this._hasHScroll||!1;if(void 0==this._hasHScroll||a)this.noscroll?this._hasHScroll=!1:(a=k.style(this.scrollboxNode,"overflow"),this._hasHScroll="hidden"==a?!1:"scroll"==
a?!0:this.scrollboxNode.offsetWidth-this.getScrollbarWidth()<this.contentNode.offsetWidth);b!==this._hasHScroll&&this.grid.update();return this._hasHScroll},hasVScrollbar:function(a){var b=this._hasVScroll||!1;if(void 0==this._hasVScroll||a)this.noscroll?this._hasVScroll=!1:(a=k.style(this.scrollboxNode,"overflow"),this._hasVScroll="hidden"==a?!1:"scroll"==a?!0:this.scrollboxNode.scrollHeight>this.scrollboxNode.clientHeight);b!==this._hasVScroll&&this.grid.update();return this._hasVScroll},convertColPctToFixed:function(){var a=
!1;this.grid.initialWidth="";var b=u("th",this.headerContentNode),c=g.map(b,function(b,c){var d=b.style.width;k.attr(b,"vIdx",c);if(d&&"%"==d.slice(-1))a=!0;else if(d&&"px"==d.slice(-2))return window.parseInt(d,10);return k.contentBox(b).w});return a?(g.forEach(this.grid.layout.cells,function(a,b){if(a.view==this){var d=a.view.getHeaderCellNode(a.index);if(d&&k.hasAttr(d,"vIdx")){var e=window.parseInt(k.attr(d,"vIdx"));this.setColWidth(b,c[e]);k.removeAttr(d,"vIdx")}}},this),!0):!1},adaptHeight:function(b){if(!this.grid._autoHeight){var d=
this.domNode.style.height&&parseInt(this.domNode.style.height.replace(/px/,""),10)||this.domNode.clientHeight;if(!b&&(b=this.noscroll))a:{for(var e=0;e<this.grid.views.views.length;++e)if(b=this.grid.views.views[e],b!==this&&b.hasHScrollbar()){b=!0;break a}b=!1}b&&(d-=a.getScrollbar().h);c.setStyleHeightPx(this.scrollboxNode,d)}this.hasVScrollbar(!0)},adaptWidth:function(){this.flexCells&&(this.contentWidth=this.getContentWidth(),this.headerContentNode.firstChild.style.width=this.contentWidth);var a=
this.scrollboxNode.offsetWidth-this.getScrollbarWidth();this._removingColumn?(a=Math.min(a,this.getColumnsWidth())+"px",this._removingColumn=!1):a=Math.max(a,this.getColumnsWidth())+"px";this.contentNode.style.width=a;this.hasHScrollbar(!0)},setSize:function(a,b){var c=this.domNode.style,d=this.headerNode.style;a&&(c.width=a,d.width=a);c.height=0<=b?b+"px":""},renderRow:function(a){var b=this.createRowNode(a);this.buildRow(a,b);return b},createRowNode:function(a){var b=document.createElement("div");
b.className=this.classTag+"Row";this instanceof p.grid._RowSelector?k.attr(b,"role","presentation"):(k.attr(b,"role","row"),"none"!=this.grid.selectionMode&&b.setAttribute("aria-selected","false"));b[c.gridViewTag]=this.id;b[c.rowIndexTag]=a;return this.rowNodes[a]=b},buildRow:function(a,b){this.buildRowContent(a,b);this.styleRow(a,b)},buildRowContent:function(a,b){b.innerHTML=this.content.generateHtml(a,a);this.flexCells&&this.contentWidth&&(b.firstChild.style.width=this.contentWidth);c.fire(this,
"onAfterRow",[a,this.structure.cells,b])},rowRemoved:function(a){0<=a&&this._cleanupRowWidgets(this.getRowNode(a));this.grid.edit.save(this,a);delete this.rowNodes[a]},getRowNode:function(a){return this.rowNodes[a]},getCellNode:function(a,b){var c=this.getRowNode(a);if(c)return this.content.getCellNode(c,b)},getHeaderCellNode:function(a){if(this.headerContentNode)return this.header.getCellNode(this.headerContentNode,a)},styleRow:function(a,b){var c;c=void 0==b.style.cssText?b.getAttribute("style"):
b.style.cssText;b._style=c;this.styleRowNode(a,b)},styleRowNode:function(a,b){b&&this.doStyleRowNode(a,b)},doStyleRowNode:function(a,b){this.grid.styleRowNode(a,b)},updateRow:function(a){var b=this.getRowNode(a);b&&(b.style.height="",this.buildRow(a,b));return b},updateRowStyles:function(a){this.styleRowNode(a,this.getRowNode(a))},lastTop:0,firstScroll:0,_nativeScroll:!1,doscroll:function(a){if(13<=h("ff")||h("chrome"))this._nativeScroll=!0;a=this.grid.isLeftToRight();if(2>this.firstScroll){if(!a&&
1==this.firstScroll||a&&0===this.firstScroll){var b=k.marginBox(this.headerNodeContainer);h("ie")?this.headerNodeContainer.style.width=b.w+this.getScrollbarWidth()+"px":h("mozilla")&&(this.headerNodeContainer.style.width=b.w-this.getScrollbarWidth()+"px",this.scrollboxNode.scrollLeft=a?this.scrollboxNode.clientWidth-this.scrollboxNode.scrollWidth:this.scrollboxNode.scrollWidth-this.scrollboxNode.clientWidth)}this.firstScroll++}this.headerNode.scrollLeft=this.scrollboxNode.scrollLeft;a=this.scrollboxNode.scrollTop;
a!==this.lastTop&&this.grid.scrollTo(a);this._nativeScroll=!1},setScrollTop:function(a){this.lastTop=a;this._nativeScroll||(this.scrollboxNode.scrollTop=a);return this.scrollboxNode.scrollTop},doContentEvent:function(a){if(this.content.decorateEvent(a))this.grid.onContentEvent(a)},doHeaderEvent:function(a){if(this.header.decorateEvent(a))this.grid.onHeaderEvent(a)},dispatchContentEvent:function(a){return this.content.dispatchEvent(a)},dispatchHeaderEvent:function(a){return this.header.dispatchEvent(a)},
setColWidth:function(a,b){this.grid.setCellWidth(a,b+"px")},update:function(){if(this.domNode){this.content.update();this.grid.update();var a=this.scrollboxNode.scrollLeft;this.scrollboxNode.scrollLeft=a;this.headerNode.scrollLeft=a}}});var D=m("dojox.grid._GridAvatar",B,{construct:function(){var a=e.doc,b=a.createElement("table");b.cellPadding=b.cellSpacing="0";b.className="dojoxGridDndAvatar";b.style.position="absolute";b.style.zIndex=1999;b.style.margin="0px";var c=a.createElement("tbody"),d=a.createElement("tr"),
f=a.createElement("td"),g=a.createElement("td");d.className="dojoxGridDndAvatarItem";g.className="dojoxGridDndAvatarItemImage";g.style.width="16px";var h=this.manager.source;if(h.creator)h=h._normalizedCreator(h.getItem(this.manager.nodes[0].id).data,"avatar").node;else{var h=this.manager.nodes[0].cloneNode(!0),l,q;"tr"==h.tagName.toLowerCase()?(l=a.createElement("table"),q=a.createElement("tbody"),q.appendChild(h),l.appendChild(q),h=l):"th"==h.tagName.toLowerCase()&&(l=a.createElement("table"),q=
a.createElement("tbody"),a=a.createElement("tr"),l.cellPadding=l.cellSpacing="0",a.appendChild(h),q.appendChild(a),l.appendChild(q),h=l)}h.id="";f.appendChild(h);d.appendChild(g);d.appendChild(f);k.style(d,"opacity",.9);c.appendChild(d);b.appendChild(c);this.node=b;b=z.manager();this.oldOffsetY=b.OFFSET_Y;b.OFFSET_Y=1},destroy:function(){z.manager().OFFSET_Y=this.oldOffsetY;this.inherited(arguments)}}),A=z.manager().makeAvatar;z.manager().makeAvatar=function(){return void 0===this.source.viewIndex||
k.hasClass(e.body(),"dijit_a11y")?A.call(z.manager()):new D(this)};return b})},"dojo/dnd/Source":function(){define("../_base/array ../_base/declare ../_base/kernel ../_base/lang ../dom-class ../dom-geometry ../mouse ../ready ../topic ./common ./Selector ./Manager".split(" "),function(t,r,p,m,g,d,l,h,u,e,b,n){p.isAsync||h(0,function(){require(["dojo/dnd/AutoSource","dojo/dnd/Target"])});var v=r("dojo.dnd.Source",b,{isSource:!0,horizontal:!1,copyOnly:!1,selfCopy:!1,selfAccept:!0,skipForm:!1,withHandles:!1,
autoSync:!1,delay:0,accept:["text"],generateText:!0,constructor:function(b,a){m.mixin(this,m.mixin({},a));var c=this.accept;if(c.length){this.accept={};for(var d=0;d<c.length;++d)this.accept[c[d]]=1}this.mouseDown=this.isDragging=!1;this.targetBox=this.targetAnchor=null;this.before=!0;this._lastY=this._lastX=0;this.sourceState="";this.isSource&&g.add(this.node,"dojoDndSource");this.targetState="";this.accept&&g.add(this.node,"dojoDndTarget");this.horizontal&&g.add(this.node,"dojoDndHorizontal");this.topics=
[u.subscribe("/dnd/source/over",m.hitch(this,"onDndSourceOver")),u.subscribe("/dnd/start",m.hitch(this,"onDndStart")),u.subscribe("/dnd/drop",m.hitch(this,"onDndDrop")),u.subscribe("/dnd/cancel",m.hitch(this,"onDndCancel"))]},checkAcceptance:function(b,a){if(this==b)return!this.copyOnly||this.selfAccept;for(var c=0;c<a.length;++c){for(var d=b.getItem(a[c].id).type,e=!1,f=0;f<d.length;++f)if(d[f]in this.accept){e=!0;break}if(!e)return!1}return!0},copyState:function(b,a){if(b)return!0;2>arguments.length&&
(a=this==n.manager().target);if(a){if(this.copyOnly)return this.selfCopy}else return this.copyOnly;return!1},destroy:function(){v.superclass.destroy.call(this);t.forEach(this.topics,function(b){b.remove()});this.targetAnchor=null},onMouseMove:function(b){if(!this.isDragging||"Disabled"!=this.targetState){v.superclass.onMouseMove.call(this,b);var a=n.manager();if(!this.isDragging&&this.mouseDown&&this.isSource&&(Math.abs(b.pageX-this._lastX)>this.delay||Math.abs(b.pageY-this._lastY)>this.delay)){var c=
this.getSelectedNodes();c.length&&a.startDrag(this,c,this.copyState(e.getCopyKeyState(b),!0))}this.isDragging&&(c=!1,this.current&&(this.targetBox&&this.targetAnchor==this.current||(this.targetBox=d.position(this.current,!0)),c=this.horizontal?b.pageX-this.targetBox.x<this.targetBox.w/2==d.isBodyLtr(this.current.ownerDocument):b.pageY-this.targetBox.y<this.targetBox.h/2),this.current!=this.targetAnchor||c!=this.before)&&(this._markTargetAnchor(c),a.canDrop(!this.current||a.source!=this||!(this.current.id in
this.selection)))}},onMouseDown:function(b){this.mouseDown||!this._legalMouseDown(b)||this.skipForm&&e.isFormElement(b)||(this.mouseDown=!0,this._lastX=b.pageX,this._lastY=b.pageY,v.superclass.onMouseDown.call(this,b))},onMouseUp:function(b){this.mouseDown&&(this.mouseDown=!1,v.superclass.onMouseUp.call(this,b))},onDndSourceOver:function(b){this!==b?(this.mouseDown=!1,this.targetAnchor&&this._unmarkTargetAnchor()):this.isDragging&&(b=n.manager(),b.canDrop("Disabled"!=this.targetState&&(!this.current||
b.source!=this||!(this.current.id in this.selection))))},onDndStart:function(b,a,c){this.autoSync&&this.sync();this.isSource&&this._changeState("Source",this==b?c?"Copied":"Moved":"");a=this.accept&&this.checkAcceptance(b,a);this._changeState("Target",a?"":"Disabled");this==b&&n.manager().overSource(this);this.isDragging=!0},onDndDrop:function(b,a,c,d){if(this==d)this.onDrop(b,a,c);this.onDndCancel()},onDndCancel:function(){this.targetAnchor&&(this._unmarkTargetAnchor(),this.targetAnchor=null);this.before=
!0;this.mouseDown=this.isDragging=!1;this._changeState("Source","");this._changeState("Target","")},onDrop:function(b,a,c){if(this!=b)this.onDropExternal(b,a,c);else this.onDropInternal(a,c)},onDropExternal:function(b,a,c){var d=this._normalizedCreator;this._normalizedCreator=this.creator?function(a,c){return d.call(this,b.getItem(a.id).data,c)}:c?function(a){var c=b.getItem(a.id);a=a.cloneNode(!0);a.id=e.getUniqueId();return{node:a,data:c.data,type:c.type}}:function(a){var c=b.getItem(a.id);b.delItem(a.id);
return{node:a,data:c.data,type:c.type}};this.selectNone();c||this.creator||b.selectNone();this.insertNodes(!0,a,this.before,this.current);!c&&this.creator&&b.deleteSelectedNodes();this._normalizedCreator=d},onDropInternal:function(b,a){var c=this._normalizedCreator;if(!(this.current&&this.current.id in this.selection)){if(a)this._normalizedCreator=this.creator?function(a,b){return c.call(this,this.getItem(a.id).data,b)}:function(a){var b=this.getItem(a.id);a=a.cloneNode(!0);a.id=e.getUniqueId();return{node:a,
data:b.data,type:b.type}};else{if(!this.current)return;this._normalizedCreator=function(a){var b=this.getItem(a.id);return{node:a,data:b.data,type:b.type}}}this._removeSelection();this.insertNodes(!0,b,this.before,this.current);this._normalizedCreator=c}},onDraggingOver:function(){},onDraggingOut:function(){},onOverEvent:function(){v.superclass.onOverEvent.call(this);n.manager().overSource(this);if(this.isDragging&&"Disabled"!=this.targetState)this.onDraggingOver()},onOutEvent:function(){v.superclass.onOutEvent.call(this);
n.manager().outSource(this);if(this.isDragging&&"Disabled"!=this.targetState)this.onDraggingOut()},_markTargetAnchor:function(b){if(this.current!=this.targetAnchor||this.before!=b)this.targetAnchor&&this._removeItemClass(this.targetAnchor,this.before?"Before":"After"),this.targetAnchor=this.current,this.targetBox=null,this.before=b,this.targetAnchor&&this._addItemClass(this.targetAnchor,this.before?"Before":"After")},_unmarkTargetAnchor:function(){this.targetAnchor&&(this._removeItemClass(this.targetAnchor,
this.before?"Before":"After"),this.targetBox=this.targetAnchor=null,this.before=!0)},_markDndStatus:function(b){this._changeState("Source",b?"Copied":"Moved")},_legalMouseDown:function(b){if("touchstart"!=b.type&&!l.isLeft(b))return!1;if(!this.withHandles)return!0;for(b=b.target;b&&b!==this.node;b=b.parentNode){if(g.contains(b,"dojoDndHandle"))return!0;if(g.contains(b,"dojoDndItem")||g.contains(b,"dojoDndIgnore"))break}return!1}});return v})},"dojo/dnd/common":function(){define(["../sniff","../_base/kernel",
"../_base/lang","../dom"],function(t,r,p,m){var g=p.getObject("dojo.dnd",!0);g.getCopyKeyState=function(d){return d[t("mac")?"metaKey":"ctrlKey"]};g._uniqueId=0;g.getUniqueId=function(){var d;do d=r._scopeName+"Unique"+ ++g._uniqueId;while(m.byId(d));return d};g._empty={};g.isFormElement=function(d){d=d.target;3==d.nodeType&&(d=d.parentNode);return 0<=" a button textarea input select option ".indexOf(" "+d.tagName.toLowerCase()+" ")};return g})},"dojo/dnd/Selector":function(){define("../_base/array ../_base/declare ../_base/kernel ../_base/lang ../dom ../dom-construct ../mouse ../_base/NodeList ../on ../touch ./common ./Container".split(" "),
function(t,r,p,m,g,d,l,h,u,e,b,n){var v=r("dojo.dnd.Selector",n,{constructor:function(b,a){a||(a={});this.singular=a.singular;this.autoSync=a.autoSync;this.selection={};this.anchor=null;this.simpleSelection=!1;this.events.push(u(this.node,e.press,m.hitch(this,"onMouseDown")),u(this.node,e.release,m.hitch(this,"onMouseUp")))},singular:!1,getSelectedNodes:function(){var d=new h,a=b._empty,c;for(c in this.selection)c in a||d.push(g.byId(c));return d},selectNone:function(){return this._removeSelection()._removeAnchor()},
selectAll:function(){this.forInItems(function(b,a){this._addItemClass(g.byId(a),"Selected");this.selection[a]=1},this);return this._removeAnchor()},deleteSelectedNodes:function(){var e=b._empty,a;for(a in this.selection)if(!(a in e)){var c=g.byId(a);this.delItem(a);d.destroy(c)}this.anchor=null;this.selection={};return this},forInSelectedItems:function(d,a){a=a||p.global;var c=this.selection,e=b._empty,f;for(f in c)f in e||d.call(a,this.getItem(f),f,this)},sync:function(){v.superclass.sync.call(this);
this.anchor&&!this.getItem(this.anchor.id)&&(this.anchor=null);var d=[],a=b._empty,c;for(c in this.selection)c in a||this.getItem(c)||d.push(c);t.forEach(d,function(a){delete this.selection[a]},this);return this},insertNodes:function(b,a,c,d){var e=this._normalizedCreator;this._normalizedCreator=function(a,c){var d=e.call(this,a,c);b?(this.anchor?this.anchor!=d.node&&(this._removeItemClass(d.node,"Anchor"),this._addItemClass(d.node,"Selected")):(this.anchor=d.node,this._removeItemClass(d.node,"Selected"),
this._addItemClass(this.anchor,"Anchor")),this.selection[d.node.id]=1):(this._removeItemClass(d.node,"Selected"),this._removeItemClass(d.node,"Anchor"));return d};v.superclass.insertNodes.call(this,a,c,d);this._normalizedCreator=e;return this},destroy:function(){v.superclass.destroy.call(this);this.selection=this.anchor=null},onMouseDown:function(d){this.autoSync&&this.sync();if(this.current)if(!this.singular&&!b.getCopyKeyState(d)&&!d.shiftKey&&this.current.id in this.selection)this.simpleSelection=
!0,l.isLeft(d)&&(d.stopPropagation(),d.preventDefault());else{if(!this.singular&&d.shiftKey){b.getCopyKeyState(d)||this._removeSelection();var a=this.getAllNodes();if(a.length&&(this.anchor||(this.anchor=a[0],this._addItemClass(this.anchor,"Anchor")),this.selection[this.anchor.id]=1,this.anchor!=this.current)){for(var c=0,e;c<a.length&&(e=a[c],e!=this.anchor&&e!=this.current);++c);for(++c;c<a.length;++c){e=a[c];if(e==this.anchor||e==this.current)break;this._addItemClass(e,"Selected");this.selection[e.id]=
1}this._addItemClass(this.current,"Selected");this.selection[this.current.id]=1}}else this.singular?this.anchor==this.current?b.getCopyKeyState(d)&&this.selectNone():(this.selectNone(),this.anchor=this.current,this._addItemClass(this.anchor,"Anchor"),this.selection[this.current.id]=1):b.getCopyKeyState(d)?this.anchor==this.current?(delete this.selection[this.anchor.id],this._removeAnchor()):this.current.id in this.selection?(this._removeItemClass(this.current,"Selected"),delete this.selection[this.current.id]):
(this.anchor&&(this._removeItemClass(this.anchor,"Anchor"),this._addItemClass(this.anchor,"Selected")),this.anchor=this.current,this._addItemClass(this.current,"Anchor"),this.selection[this.current.id]=1):this.current.id in this.selection||(this.selectNone(),this.anchor=this.current,this._addItemClass(this.current,"Anchor"),this.selection[this.current.id]=1);d.stopPropagation();d.preventDefault()}},onMouseUp:function(){this.simpleSelection&&(this.simpleSelection=!1,this.selectNone(),this.current&&
(this.anchor=this.current,this._addItemClass(this.anchor,"Anchor"),this.selection[this.current.id]=1))},onMouseMove:function(){this.simpleSelection=!1},onOverEvent:function(){this.onmousemoveEvent=u(this.node,e.move,m.hitch(this,"onMouseMove"))},onOutEvent:function(){this.onmousemoveEvent&&(this.onmousemoveEvent.remove(),delete this.onmousemoveEvent)},_removeSelection:function(){var d=b._empty,a;for(a in this.selection)if(!(a in d)){var c=g.byId(a);c&&this._removeItemClass(c,"Selected")}this.selection=
{};return this},_removeAnchor:function(){this.anchor&&(this._removeItemClass(this.anchor,"Anchor"),this.anchor=null);return this}});return v})},"dojo/dnd/Container":function(){define("../_base/array ../_base/declare ../_base/kernel ../_base/lang ../_base/window ../dom ../dom-class ../dom-construct ../Evented ../has ../on ../query ../touch ./common".split(" "),function(t,r,p,m,g,d,l,h,u,e,b,n,v,f){r=r("dojo.dnd.Container",u,{skipForm:!1,allowNested:!1,constructor:function(a,c){this.node=d.byId(a);
c||(c={});this.creator=c.creator||null;this.skipForm=c.skipForm;this.parent=c.dropParent&&d.byId(c.dropParent);this.map={};this.current=null;this.containerState="";l.add(this.node,"dojoDndContainer");c&&c._skipStartup||this.startup();this.events=[b(this.node,v.over,m.hitch(this,"onMouseOver")),b(this.node,v.out,m.hitch(this,"onMouseOut")),b(this.node,"dragstart",m.hitch(this,"onSelectStart")),b(this.node,"selectstart",m.hitch(this,"onSelectStart"))]},creator:function(){},getItem:function(a){return this.map[a]},
setItem:function(a,b){this.map[a]=b},delItem:function(a){delete this.map[a]},forInItems:function(a,b){b=b||p.global;var c=this.map,d=f._empty,e;for(e in c)e in d||a.call(b,c[e],e,this);return b},clearItems:function(){this.map={}},getAllNodes:function(){return n((this.allowNested?"":"\x3e ")+".dojoDndItem",this.parent)},sync:function(){var a={};this.getAllNodes().forEach(function(b){if(b.id){var c=this.getItem(b.id);if(c){a[b.id]=c;return}}else b.id=f.getUniqueId();var c=b.getAttribute("dndType"),
d=b.getAttribute("dndData");a[b.id]={data:d||b.innerHTML,type:c?c.split(/\s*,\s*/):["text"]}},this);this.map=a;return this},insertNodes:function(a,b,d){this.parent.firstChild?b?d||(d=this.parent.firstChild):d&&(d=d.nextSibling):d=null;var c;if(d)for(b=0;b<a.length;++b)c=this._normalizedCreator(a[b]),this.setItem(c.node.id,{data:c.data,type:c.type}),d.parentNode.insertBefore(c.node,d);else for(b=0;b<a.length;++b)c=this._normalizedCreator(a[b]),this.setItem(c.node.id,{data:c.data,type:c.type}),this.parent.appendChild(c.node);
return this},destroy:function(){t.forEach(this.events,function(a){a.remove()});this.clearItems();this.node=this.parent=this.current=null},markupFactory:function(a,b,d){a._skipStartup=!0;return new d(b,a)},startup:function(){if(!this.parent&&(this.parent=this.node,"table"==this.parent.tagName.toLowerCase())){var a=this.parent.getElementsByTagName("tbody");a&&a.length&&(this.parent=a[0])}this.defaultCreator=f._defaultCreator(this.parent);this.sync()},onMouseOver:function(a){for(var b=a.relatedTarget;b&&
b!=this.node;)try{b=b.parentNode}catch(k){b=null}b||(this._changeState("Container","Over"),this.onOverEvent());b=this._getChildByEvent(a);this.current!=b&&(this.current&&this._removeItemClass(this.current,"Over"),b&&this._addItemClass(b,"Over"),this.current=b)},onMouseOut:function(a){for(a=a.relatedTarget;a;){if(a==this.node)return;try{a=a.parentNode}catch(c){a=null}}this.current&&(this._removeItemClass(this.current,"Over"),this.current=null);this._changeState("Container","");this.onOutEvent()},onSelectStart:function(a){this.withHandles||
this.skipForm&&f.isFormElement(a)||(a.stopPropagation(),a.preventDefault())},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(a,b){var c="dojoDnd"+a,d=a.toLowerCase()+"State";l.replace(this.node,c+b,c+this[d]);this[d]=b},_addItemClass:function(a,b){l.add(a,"dojoDndItem"+b)},_removeItemClass:function(a,b){l.remove(a,"dojoDndItem"+b)},_getChildByEvent:function(a){if(a=a.target)for(var b=a.parentNode;b;a=b,b=a.parentNode)if((b==this.parent||this.allowNested)&&l.contains(a,"dojoDndItem"))return a;
return null},_normalizedCreator:function(a,b){var c=(this.creator||this.defaultCreator).call(this,a,b);m.isArray(c.type)||(c.type=["text"]);c.node.id||(c.node.id=f.getUniqueId());l.add(c.node,"dojoDndItem");return c}});f._createNode=function(a){return a?function(b){return h.create(a,{innerHTML:b})}:f._createSpan};f._createTrTd=function(a){var b=h.create("tr");h.create("td",{innerHTML:a},b);return b};f._createSpan=function(a){return h.create("span",{innerHTML:a})};f._defaultCreatorNodes={ul:"li",ol:"li",
div:"div",p:"div"};f._defaultCreator=function(a){a=a.tagName.toLowerCase();var b="tbody"==a||"thead"==a?f._createTrTd:f._createNode(f._defaultCreatorNodes[a]);return function(a,c){var d=a&&m.isObject(a),e,g;d&&a.tagName&&a.nodeType&&a.getAttribute?(e=a.getAttribute("dndData")||a.innerHTML,d=(d=a.getAttribute("dndType"))?d.split(/\s*,\s*/):["text"],g=a):(e=d&&a.data?a.data:a,d=d&&a.type?a.type:["text"],g=("avatar"==c?f._createSpan:b)(String(e)));g.id||(g.id=f.getUniqueId());return{node:g,data:e,type:d}}};
return r})},"dojo/dnd/Manager":function(){define("../_base/array ../_base/declare ../_base/lang ../_base/window ../dom-class ../Evented ../has ../keys ../on ../topic ../touch ./common ./autoscroll ./Avatar".split(" "),function(t,r,p,m,g,d,l,h,u,e,b,n,v,f){var a=r("dojo.dnd.Manager",[d],{constructor:function(){this.source=this.avatar=null;this.nodes=[];this.copy=!0;this.target=null;this.canDropFlag=!1;this.events=[]},OFFSET_X:l("touch")?4:16,OFFSET_Y:l("touch")?4:16,overSource:function(a){this.avatar&&
(this.target=a&&"Disabled"!=a.targetState?a:null,this.canDropFlag=!!this.target,this.avatar.update());e.publish("/dnd/source/over",a)},outSource:function(a){this.avatar?this.target==a&&(this.target=null,this.canDropFlag=!1,this.avatar.update(),e.publish("/dnd/source/over",null)):e.publish("/dnd/source/over",null)},startDrag:function(a,d,f){function c(a){a.preventDefault();a.stopPropagation()}v.autoScrollStart(m.doc);this.source=a;this.nodes=d;this.copy=!!f;this.avatar=this.makeAvatar();m.body().appendChild(this.avatar.node);
e.publish("/dnd/start",a,d,this.copy);this.events=[u(m.doc,b.move,p.hitch(this,"onMouseMove")),u(m.doc,b.release,p.hitch(this,"onMouseUp")),u(m.doc,"keydown",p.hitch(this,"onKeyDown")),u(m.doc,"keyup",p.hitch(this,"onKeyUp")),u(m.doc,"dragstart",c),u(m.body(),"selectstart",c)];a="dojoDnd"+(f?"Copy":"Move");g.add(m.body(),a)},canDrop:function(a){a=!(!this.target||!a);this.canDropFlag!=a&&(this.canDropFlag=a,this.avatar.update())},stopDrag:function(){g.remove(m.body(),["dojoDndCopy","dojoDndMove"]);
t.forEach(this.events,function(a){a.remove()});this.events=[];this.avatar.destroy();this.source=this.target=this.avatar=null;this.nodes=[]},makeAvatar:function(){return new f(this)},updateAvatar:function(){this.avatar.update()},onMouseMove:function(a){var b=this.avatar;b&&(v.autoScrollNodes(a),b=b.node.style,b.left=a.pageX+this.OFFSET_X+"px",b.top=a.pageY+this.OFFSET_Y+"px",b=!!this.source.copyState(n.getCopyKeyState(a)),this.copy!=b&&this._setCopyStatus(b));l("touch")&&a.preventDefault()},onMouseUp:function(a){if(this.avatar){if(this.target&&
this.canDropFlag){var b=!!this.source.copyState(n.getCopyKeyState(a));e.publish("/dnd/drop/before",this.source,this.nodes,b,this.target,a);e.publish("/dnd/drop",this.source,this.nodes,b,this.target,a)}else e.publish("/dnd/cancel");this.stopDrag()}},onKeyDown:function(a){if(this.avatar)switch(a.keyCode){case h.CTRL:a=!!this.source.copyState(!0);this.copy!=a&&this._setCopyStatus(a);break;case h.ESCAPE:e.publish("/dnd/cancel"),this.stopDrag()}},onKeyUp:function(a){this.avatar&&a.keyCode==h.CTRL&&(a=
!!this.source.copyState(!1),this.copy!=a&&this._setCopyStatus(a))},_setCopyStatus:function(a){this.copy=a;this.source._markDndStatus(this.copy);this.updateAvatar();g.replace(m.body(),"dojoDnd"+(this.copy?"Copy":"Move"),"dojoDnd"+(this.copy?"Move":"Copy"))}});n._manager=null;a.manager=n.manager=function(){n._manager||(n._manager=new a);return n._manager};return a})},"dojo/dnd/autoscroll":function(){define("../_base/lang ../sniff ../_base/window ../dom-geometry ../dom-style ../window".split(" "),function(t,
r,p,m,g,d){var l={};t.setObject("dojo.dnd.autoscroll",l);l.getViewport=d.getBox;l.V_TRIGGER_AUTOSCROLL=32;l.H_TRIGGER_AUTOSCROLL=32;l.V_AUTOSCROLL_VALUE=16;l.H_AUTOSCROLL_VALUE=16;var h,u=p.doc,e=Infinity,b=Infinity;l.autoScrollStart=function(g){u=g;h=d.getBox(u);g=p.body(u).parentNode;e=Math.max(g.scrollHeight-h.h,0);b=Math.max(g.scrollWidth-h.w,0)};l.autoScroll=function(g){var n=h||d.getBox(u),f=p.body(u).parentNode,a=0,c=0;g.clientX<l.H_TRIGGER_AUTOSCROLL?a=-l.H_AUTOSCROLL_VALUE:g.clientX>n.w-
l.H_TRIGGER_AUTOSCROLL&&(a=Math.min(l.H_AUTOSCROLL_VALUE,b-f.scrollLeft));g.clientY<l.V_TRIGGER_AUTOSCROLL?c=-l.V_AUTOSCROLL_VALUE:g.clientY>n.h-l.V_TRIGGER_AUTOSCROLL&&(c=Math.min(l.V_AUTOSCROLL_VALUE,e-f.scrollTop));window.scrollBy(a,c)};l._validNodes={div:1,p:1,td:1};l._validOverflow={auto:1,scroll:1};l.autoScrollNodes=function(b){for(var d,e,a,c,h,n=0,t=0,u=b.target;u;){if(1==u.nodeType&&u.tagName.toLowerCase()in l._validNodes){a=g.getComputedStyle(u);h=a.overflowX.toLowerCase()in l._validOverflow;
c=a.overflowY.toLowerCase()in l._validOverflow;if(h||c)d=m.getContentBox(u,a),e=m.position(u,!0);if(h){a=Math.min(l.H_TRIGGER_AUTOSCROLL,d.w/2);h=b.pageX-e.x;if(r("webkit")||r("opera"))h+=p.body().scrollLeft;n=0;0<h&&h<d.w&&(h<a?n=-a:h>d.w-a&&(n=a),u.scrollLeft+=n)}if(c){c=Math.min(l.V_TRIGGER_AUTOSCROLL,d.h/2);a=b.pageY-e.y;if(r("webkit")||r("opera"))a+=p.body().scrollTop;t=0;0<a&&a<d.h&&(a<c?t=-c:a>d.h-c&&(t=c),u.scrollTop+=t)}if(n||t)return}try{u=u.parentNode}catch(D){u=null}}l.autoScroll(b)};
return l})},"dojo/dnd/Avatar":function(){define("../_base/declare ../_base/window ../dom ../dom-attr ../dom-class ../dom-construct ../hccss ../query".split(" "),function(t,r,p,m,g,d,l,h){return t("dojo.dnd.Avatar",null,{constructor:function(d){this.manager=d;this.construct()},construct:function(){var g=d.create("table",{"class":"dojoDndAvatar",style:{position:"absolute",zIndex:"1999",margin:"0px"}}),e=this.manager.source,b,h=d.create("tbody",null,g),p=d.create("tr",null,h),f=d.create("td",null,p),
a=Math.min(5,this.manager.nodes.length),c=0;l("highcontrast")&&d.create("span",{id:"a11yIcon",innerHTML:this.manager.copy?"+":"\x3c"},f);d.create("span",{innerHTML:e.generateText?this._generateText():""},f);for(m.set(p,{"class":"dojoDndAvatarHeader",style:{opacity:.9}});c<a;++c)e.creator?b=e._normalizedCreator(e.getItem(this.manager.nodes[c].id).data,"avatar").node:(b=this.manager.nodes[c].cloneNode(!0),"tr"==b.tagName.toLowerCase()&&(p=d.create("table"),d.create("tbody",null,p).appendChild(b),b=
p)),b.id="",p=d.create("tr",null,h),f=d.create("td",null,p),f.appendChild(b),m.set(p,{"class":"dojoDndAvatarItem",style:{opacity:(9-c)/10}});this.node=g},destroy:function(){d.destroy(this.node);this.node=!1},update:function(){g.toggle(this.node,"dojoDndAvatarCanDrop",this.manager.canDropFlag);if(l("highcontrast")){var d=p.byId("a11yIcon"),e="+";this.manager.canDropFlag&&!this.manager.copy?e="\x3c ":this.manager.canDropFlag||this.manager.copy?this.manager.canDropFlag||(e="x"):e="o";d.innerHTML=e}h("tr.dojoDndAvatarHeader td span"+
(l("highcontrast")?" span":""),this.node).forEach(function(b){b.innerHTML=this.manager.source.generateText?this._generateText():""},this)},_generateText:function(){return this.manager.nodes.length.toString()}})})},"dojox/html/metrics":function(){define("dojo/_base/kernel dojo/_base/lang dojo/_base/sniff dojo/ready dojo/_base/unload dojo/_base/window dojo/dom-geometry".split(" "),function(t,r,p,m,g,d,l){var h=r.getObject("dojox.html.metrics",!0),u=r.getObject("dojox");h.getFontMeasurements=function(){var a=
{"1em":0,"1ex":0,"100%":0,"12pt":0,"16px":0,"xx-small":0,"x-small":0,small:0,medium:0,large:0,"x-large":0,"xx-large":0},b;p("ie")&&(b=d.doc.documentElement.style.fontSize||"",b||(d.doc.documentElement.style.fontSize="100%"));var e=d.doc.createElement("div"),f=e.style;f.position="absolute";f.left="-100px";f.top="0";f.width="30px";f.height="1000em";f.borderWidth="0";f.margin="0";f.padding="0";f.outline="0";f.lineHeight="1";f.overflow="hidden";d.body().appendChild(e);for(var g in a)f.fontSize=g,a[g]=
16*Math.round(12*e.offsetHeight/16)/12/1E3;p("ie")&&(d.doc.documentElement.style.fontSize=b);d.body().removeChild(e);e=null;return a};var e=null;h.getCachedFontMeasurements=function(a){if(a||!e)e=h.getFontMeasurements();return e};var b=null,n={};h.getTextBox=function(a,c,e){var f,g;if(b)f=b;else{f=b=d.doc.createElement("div");var h=d.doc.createElement("div");h.appendChild(f);g=h.style;g.overflow="scroll";g.position="absolute";g.left="0px";g.top="-10000px";g.width="1px";g.height="1px";g.visibility=
"hidden";g.borderWidth="0";g.margin="0";g.padding="0";g.outline="0";d.body().appendChild(h)}f.className="";g=f.style;g.borderWidth="0";g.margin="0";g.padding="0";g.outline="0";if(1<arguments.length&&c)for(var k in c)k in n||(g[k]=c[k]);2<arguments.length&&e&&(f.className=e);f.innerHTML=a;g=l.position(f);g.w=f.parentNode.scrollWidth;return g};var v=16,f=16;h.getScrollbar=function(){return{w:v,h:f}};h._fontResizeNode=null;h.initOnFontResize=function(a){var b=h._fontResizeNode=d.doc.createElement("iframe");
a=b.style;a.position="absolute";a.width="5em";a.height="10em";a.top="-10000px";a.display="none";p("ie")?b.onreadystatechange=function(){"complete"==b.contentWindow.document.readyState&&(b.onresize=b.contentWindow.parent[u._scopeName].html.metrics._fontresize)}:b.onload=function(){b.contentWindow.onresize=b.contentWindow.parent[u._scopeName].html.metrics._fontresize};b.setAttribute("src","javascript:'\x3chtml\x3e\x3chead\x3e\x3cscript\x3eif(\"loadFirebugConsole\" in window){window.loadFirebugConsole();}\x3c/script\x3e\x3c/head\x3e\x3cbody\x3e\x3c/body\x3e\x3c/html\x3e'");
d.body().appendChild(b);h.initOnFontResize=function(){}};h.onFontResize=function(){};h._fontresize=function(){h.onFontResize()};g.addOnUnload(function(){var a=h._fontResizeNode;a&&(p("ie")&&a.onresize?a.onresize=null:a.contentWindow&&a.contentWindow.onresize&&(a.contentWindow.onresize=null),h._fontResizeNode=null)});m(function(){try{var a=d.doc.createElement("div");a.style.cssText="top:0;left:0;width:100px;height:100px;overflow:scroll;position:absolute;visibility:hidden;";d.body().appendChild(a);
v=a.offsetWidth-a.clientWidth;f=a.offsetHeight-a.clientHeight;d.body().removeChild(a);delete a}catch(c){}"fontSizeWatch"in t.config&&t.config.fontSizeWatch&&h.initOnFontResize()});return h})},"dojox/grid/_Builder":function(){define("../main dojo/_base/array dojo/_base/lang dojo/_base/window dojo/_base/event dojo/_base/sniff dojo/_base/connect dojo/dnd/Moveable dojox/html/metrics ./util dojo/_base/html dojo/dom-geometry".split(" "),function(t,r,p,m,g,d,l,h,u,e,b,n){var v=t.grid,f=function(a){return 0<=
a.rowIndex?a.rowIndex:r.indexOf(a.parentNode.childNodes,a)},a=function(a,b){return a&&((a.rows||0)[b]||a.childNodes[b])},c=function(a){for(;a&&"TABLE"!=a.tagName;a=a.parentNode);return a},k=function(a){var b=a.toUpperCase();return function(a){return a.tagName!=b}},q=e.rowIndexTag,B=e.gridViewTag,z=v._Builder=p.extend(function(a){a&&(this.view=a,this.grid=a.grid)},{view:null,_table:'\x3ctable class\x3d"dojoxGridRowTable" border\x3d"0" cellspacing\x3d"0" cellpadding\x3d"0" role\x3d"presentation"',getTableArray:function(){var a=
[this._table];this.view.viewWidth&&a.push([' style\x3d"width:',this.view.viewWidth,';"'].join(""));a.push("\x3e");return a},generateCellMarkup:function(a,b,c,d){var e=[],f;d?(f=a.index!=a.grid.getSortIndex()?"":0<a.grid.sortInfo?'aria-sort\x3d"ascending"':'aria-sort\x3d"descending"',a.id||(a.id=this.grid.id+"Hdr"+a.index),f=['\x3cth tabIndex\x3d"-1" aria-readonly\x3d"true" role\x3d"columnheader"',f,' id\x3d"',a.id,'"']):f=['\x3ctd tabIndex\x3d"-1" role\x3d"gridcell"',this.grid.editable&&!a.editable?
'aria-readonly\x3d"true"':""];a.colSpan&&f.push(' colspan\x3d"',a.colSpan,'"');a.rowSpan&&f.push(' rowspan\x3d"',a.rowSpan,'"');f.push(' class\x3d"dojoxGridCell ');a.classes&&f.push(a.classes," ");c&&f.push(c," ");e.push(f.join(""));e.push("");f=['" idx\x3d"',a.index,'" style\x3d"'];b&&";"!=b[b.length-1]&&(b+=";");f.push(a.styles,b||"",a.hidden?"display:none;":"");a.unitWidth&&f.push("width:",a.unitWidth,";");e.push(f.join(""));e.push("");f=['"'];a.attrs&&f.push(" ",a.attrs);f.push("\x3e");e.push(f.join(""));
e.push("");e.push(d?"\x3c/th\x3e":"\x3c/td\x3e");return e},isCellNode:function(a){return!(!a||a==m.doc||!b.attr(a,"idx"))},getCellNodeIndex:function(a){return a?Number(b.attr(a,"idx")):-1},getCellNode:function(b,c){for(var d=0,e;(e=a(b.firstChild,d))&&e.cells;d++)for(var f=0,g;g=e.cells[f];f++)if(this.getCellNodeIndex(g)==c)return g;return null},findCellTarget:function(a,b){for(var c=a;c&&(!this.isCellNode(c)||c.offsetParent&&B in c.offsetParent.parentNode&&c.offsetParent.parentNode[B]!=this.view.id)&&
c!=b;)c=c.parentNode;return c!=b?c:null},baseDecorateEvent:function(a){a.dispatch="do"+a.type;a.grid=this.grid;a.sourceView=this.view;a.cellNode=this.findCellTarget(a.target,a.rowNode);a.cellIndex=this.getCellNodeIndex(a.cellNode);a.cell=0<=a.cellIndex?this.grid.getCell(a.cellIndex):null},findTarget:function(a,b){for(var c=a;c&&c!=this.domNode&&(!(b in c)||B in c&&c[B]!=this.view.id);)c=c.parentNode;return c!=this.domNode?c:null},findRowTarget:function(a){return this.findTarget(a,q)},isIntraNodeEvent:function(a){try{return a.cellNode&&
a.relatedTarget&&b.isDescendant(a.relatedTarget,a.cellNode)}catch(x){return!1}},isIntraRowEvent:function(a){try{var b=a.relatedTarget&&this.findRowTarget(a.relatedTarget);return!b&&-1==a.rowIndex||b&&a.rowIndex==b.gridRowIndex}catch(y){return!1}},dispatchEvent:function(a){return a.dispatch in this?this[a.dispatch](a):!1},domouseover:function(a){a.cellNode&&a.cellNode!=this.lastOverCellNode&&(this.lastOverCellNode=a.cellNode,this.grid.onMouseOver(a));this.grid.onMouseOverRow(a)},domouseout:function(a){if(a.cellNode&&
a.cellNode==this.lastOverCellNode&&!this.isIntraNodeEvent(a,this.lastOverCellNode)&&(this.lastOverCellNode=null,this.grid.onMouseOut(a),!this.isIntraRowEvent(a)))this.grid.onMouseOutRow(a)},domousedown:function(a){if(a.cellNode)this.grid.onMouseDown(a);this.grid.onMouseDownRow(a)},_getTextDirStyle:function(a,b,c){return""}});t=v._ContentBuilder=p.extend(function(a){z.call(this,a)},z.prototype,{update:function(){this.prepareHtml()},prepareHtml:function(){for(var a=this.grid.get,b=this.view.structure.cells,
c=0,d;d=b[c];c++)for(var e=0,f;f=d[e];e++)f.get=f.get||void 0==f.value&&a,f.markup=this.generateCellMarkup(f,f.cellStyles,f.cellClasses,!1),!this.grid.editable&&f.editable&&(this.grid.editable=!0)},generateHtml:function(a,b){var c=this.getTableArray(),d,f=this.view.structure.cells,g=this.grid.getItem(b);e.fire(this.view,"onBeforeRow",[b,f]);for(var h=0,k;k=f[h];h++)if(!k.hidden&&!k.header){c.push(k.invisible?'\x3ctr class\x3d"dojoxGridInvisible"\x3e':"\x3ctr\x3e");for(var l=0,n,m,q;n=k[l];l++)m=n.markup,
d=n.customClasses=[],q=n.customStyles=[],m[5]=n.format(b,g),m[1]=d.join(" "),m[3]=q.join(";"),(d=n.textDir||this.grid.textDir)&&(m[3]+=this._getTextDirStyle(d,n,b)),c.push.apply(c,m);c.push("\x3c/tr\x3e")}c.push("\x3c/table\x3e");return c.join("")},decorateEvent:function(a){a.rowNode=this.findRowTarget(a.target);if(!a.rowNode)return!1;a.rowIndex=a.rowNode[q];this.baseDecorateEvent(a);a.cell=this.grid.getCell(a.cellIndex);return!0}});var D=v._HeaderBuilder=p.extend(function(a){this.moveable=null;z.call(this,
a)},z.prototype,{_skipBogusClicks:!1,overResizeWidth:4,minColWidth:1,update:function(){this.tableMap?this.tableMap.mapRows(this.view.structure.cells):this.tableMap=new v._TableMap(this.view.structure.cells)},generateHtml:function(a,b){var c,d=this.getTableArray(),f=this.view.structure.cells;e.fire(this.view,"onBeforeRow",[-1,f]);for(var g=0,h;h=f[g];g++)if(!h.hidden){d.push(h.invisible?'\x3ctr class\x3d"dojoxGridInvisible"\x3e':"\x3ctr\x3e");for(var k=0,l,n;l=h[k];k++)l.customClasses=[],l.customStyles=
[],this.view.simpleStructure&&(l.draggable&&(l.headerClasses?-1==l.headerClasses.indexOf("dojoDndItem")&&(l.headerClasses+=" dojoDndItem"):l.headerClasses="dojoDndItem"),l.attrs?-1==l.attrs.indexOf("dndType\x3d'gridColumn_")&&(l.attrs+=" dndType\x3d'gridColumn_"+this.grid.id+"'"):l.attrs="dndType\x3d'gridColumn_"+this.grid.id+"'"),n=this.generateCellMarkup(l,l.headerStyles,l.headerClasses,!0),n[5]=void 0!=b?b:a(l),n[3]=l.customStyles.join(";"),(c=l.textDir||this.grid.textDir)&&(n[3]+=this._getTextDirStyle(c,
l,b)),n[1]=l.customClasses.join(" "),d.push(n.join(""));d.push("\x3c/tr\x3e")}d.push("\x3c/table\x3e");return d.join("")},getCellX:function(a){var b;b=k("th");for(var c=a.target;c&&b(c);c=c.parentNode);(b=c)?(b=n.position(b),a=a.clientX-b.x):a=a.layerX;return a},decorateEvent:function(a){this.baseDecorateEvent(a);a.rowIndex=-1;a.cellX=this.getCellX(a);return!0},prepareResize:function(a,b){do{var c=a.cellIndex;a.cellNode=c?a.cellNode.parentNode.cells[c+b]:null;a.cellIndex=a.cellNode?this.getCellNodeIndex(a.cellNode):
-1}while(a.cellNode&&"none"==a.cellNode.style.display);return!!a.cellNode},canResize:function(a){if(!a.cellNode||1<a.cellNode.colSpan)return!1;a=this.grid.getCell(a.cellIndex);return!a.noresize&&a.canResize()},overLeftResizeArea:function(a){if(b.hasClass(m.body(),"dojoDndMove"))return!1;if(d("ie")){var c=a.target;if(b.hasClass(c,"dojoxGridArrowButtonNode")||b.hasClass(c,"dojoxGridArrowButtonChar")||b.hasClass(c,"dojoxGridColCaption"))return!1}return this.grid.isLeftToRight()?0<a.cellIndex&&0<a.cellX&&
a.cellX<this.overResizeWidth&&this.prepareResize(a,-1):a.cellNode&&0<a.cellX&&a.cellX<this.overResizeWidth},overRightResizeArea:function(a){if(b.hasClass(m.body(),"dojoDndMove"))return!1;if(d("ie")){var c=a.target;if(b.hasClass(c,"dojoxGridArrowButtonNode")||b.hasClass(c,"dojoxGridArrowButtonChar")||b.hasClass(c,"dojoxGridColCaption"))return!1}return this.grid.isLeftToRight()?a.cellNode&&a.cellX>=a.cellNode.offsetWidth-this.overResizeWidth:0<a.cellIndex&&a.cellX>=a.cellNode.offsetWidth-this.overResizeWidth&&
this.prepareResize(a,-1)},domousemove:function(a){if(!this.moveable){var c=this.overRightResizeArea(a)?"dojoxGridColResize":this.overLeftResizeArea(a)?"dojoxGridColResize":"";c&&!this.canResize(a)&&(c="dojoxGridColNoResize");b.toggleClass(a.sourceView.headerNode,"dojoxGridColNoResize","dojoxGridColNoResize"==c);b.toggleClass(a.sourceView.headerNode,"dojoxGridColResize","dojoxGridColResize"==c);c&&g.stop(a)}},domousedown:function(a){this.moveable||((this.overRightResizeArea(a)||this.overLeftResizeArea(a))&&
this.canResize(a)?this.beginColumnResize(a):(this.grid.onMouseDown(a),this.grid.onMouseOverRow(a)))},doclick:function(a){return this._skipBogusClicks?(g.stop(a),!0):!1},colResizeSetup:function(a,c){var e=b.contentBox(a.sourceView.headerNode);if(c){this.lineDiv=document.createElement("div");var f=b.position(a.sourceView.headerNode,!0),g=b.contentBox(a.sourceView.domNode),h=a.pageX;!this.grid.isLeftToRight()&&8>d("ie")&&(h-=u.getScrollbar().w);b.style(this.lineDiv,{top:f.y+"px",left:h+"px",height:g.h+
e.h+"px"});b.addClass(this.lineDiv,"dojoxGridResizeColLine");this.lineDiv._origLeft=h;m.body().appendChild(this.lineDiv)}for(var f=[],g=this.tableMap.findOverlappingNodes(a.cellNode),h=0,k;k=g[h];h++)f.push({node:k,index:this.getCellNodeIndex(k),width:k.offsetWidth});g=a.sourceView;k=this.grid.isLeftToRight()?1:-1;for(var l=a.grid.views.views,h=[],n=g.idx+k,q;q=l[n];n+=k)h.push({node:q.headerNode,left:window.parseInt(q.headerNode.style.left)});k=g.headerContentNode.firstChild;return{scrollLeft:a.sourceView.headerNode.scrollLeft,
view:g,node:a.cellNode,index:a.cellIndex,w:b.contentBox(a.cellNode).w,vw:e.w,table:k,tw:b.contentBox(k).w,spanners:f,followers:h}},beginColumnResize:function(a){this.moverDiv=document.createElement("div");b.style(this.moverDiv,{position:"absolute",left:0});m.body().appendChild(this.moverDiv);b.addClass(this.grid.domNode,"dojoxGridColumnResizing");var c=this.moveable=new h(this.moverDiv),d=this.colResizeSetup(a,!0);c.onMove=p.hitch(this,"doResizeColumn",d);l.connect(c,"onMoveStop",p.hitch(this,function(){this.endResizeColumn(d);
d.node.releaseCapture&&d.node.releaseCapture();this.moveable.destroy();delete this.moveable;this.moveable=null;b.removeClass(this.grid.domNode,"dojoxGridColumnResizing")}));a.cellNode.setCapture&&a.cellNode.setCapture();c.onMouseDown(a)},doResizeColumn:function(a,c,d){var e=d.l,e={deltaX:e,w:a.w+(this.grid.isLeftToRight()?e:-e),vw:a.vw+e,tw:a.tw+e};this.dragRecord={inDrag:a,mover:c,leftTop:d};e.w>=this.minColWidth&&(c?b.style(this.lineDiv,"left",this.lineDiv._origLeft+e.deltaX+"px"):this.doResizeNow(a,
e))},endResizeColumn:function(a){if(this.dragRecord){var c=this.dragRecord.leftTop,c=this.grid.isLeftToRight()?c.l:-c.l,c=c+(Math.max(a.w+c,this.minColWidth)-(a.w+c));d("webkit")&&a.spanners.length&&(c+=b._getPadBorderExtents(a.spanners[0].node).w);this.doResizeNow(a,{deltaX:c,w:a.w+c,vw:a.vw+c,tw:a.tw+c});delete this.dragRecord}b.destroy(this.lineDiv);b.destroy(this.moverDiv);b.destroy(this.moverDiv);delete this.moverDiv;this._skipBogusClicks=!0;a.view.update();this._skipBogusClicks=!1;this.grid.onResizeColumn(a.index)},
doResizeNow:function(a,b){a.view.convertColPctToFixed();if(a.view.flexCells&&!a.view.testFlexCells()){var e=c(a.node);e&&(e.style.width="")}for(var f,g,e=0;f=a.spanners[e];e++)g=f.width+b.deltaX,0<g&&(f.node.style.width=g+"px",a.view.setColWidth(f.index,g));if(this.grid.isLeftToRight()||!d("ie"))for(e=0;f=a.followers[e];e++)g=f.left+b.deltaX,f.node.style.left=g+"px";a.node.style.width=b.w+"px";a.view.setColWidth(a.index,b.w);a.view.headerNode.style.width=b.vw+"px";a.view.setColumnsWidth(b.tw);this.grid.isLeftToRight()||
(a.view.headerNode.scrollLeft=a.scrollLeft+b.deltaX)}});v._TableMap=p.extend(function(a){this.mapRows(a)},{map:null,mapRows:function(a){if(a.length){this.map=[];for(var b,c=0;b=a[c];c++)this.map[c]=[];for(c=0;b=a[c];c++)for(var d=0,e=0,f,g;f=b[d];d++){for(;this.map[c][e];)e++;this.map[c][e]={c:d,r:c};g=f.rowSpan||1;f=f.colSpan||1;for(var h=0;h<g;h++)for(var k=0;k<f;k++)this.map[c+h][e+k]=this.map[c][e];e+=f}}},dumpMap:function(){for(var a=0,b;b=this.map[a];a++)for(var c=0;b[c];c++);},getMapCoords:function(a,
b){for(var c=0,d;d=this.map[c];c++)for(var e=0,f;f=d[e];e++)if(f.c==b&&f.r==a)return{j:c,i:e};return{j:-1,i:-1}},getNode:function(a,b,c){return(a=a&&a.rows[b])&&a.cells[c]},_findOverlappingNodes:function(a,b,c){var d=[];b=this.getMapCoords(b,c);c=0;for(var e;e=this.map[c];c++)c!=b.j&&(e=(e=e[b.i])?this.getNode(a,e.r,e.c):null)&&d.push(e);return d},findOverlappingNodes:function(a){return this._findOverlappingNodes(c(a),f(a.parentNode),0<=a.cellIndex?a.cellIndex:r.indexOf(a.parentNode.cells,a))}});
return{_Builder:z,_HeaderBuilder:D,_ContentBuilder:t}})},"dojo/dnd/Moveable":function(){define("../_base/array ../_base/declare ../_base/lang ../dom ../dom-class ../Evented ../has ../on ../topic ../touch ./common ./Mover ../_base/window".split(" "),function(t,r,p,m,g,d,l,h,u,e,b,n,v){function f(b,d){"touchAction"in document.body.style?a="touchAction":"msTouchAction"in document.body.style&&(a="msTouchAction");c=function(b,c){b.style[a]=c};c(b,d)}var a,c=function(){};l("touch-action")&&(c=f);return r("dojo.dnd.Moveable",
[d],{handle:"",delay:0,skip:!1,constructor:function(a,b){this.node=m.byId(a);c(this.node,"none");b||(b={});this.handle=b.handle?m.byId(b.handle):null;this.handle||(this.handle=this.node);this.delay=0<b.delay?b.delay:0;this.skip=b.skip;this.mover=b.mover?b.mover:n;this.events=[h(this.handle,e.press,p.hitch(this,"onMouseDown")),h(this.handle,"dragstart",p.hitch(this,"onSelectStart")),h(this.handle,"selectstart",p.hitch(this,"onSelectStart"))]},markupFactory:function(a,b,c){return new c(b,a)},destroy:function(){t.forEach(this.events,
function(a){a.remove()});c(this.node,"");this.events=this.node=this.handle=null},onMouseDown:function(a){if(!this.skip||!b.isFormElement(a)){if(this.delay)this.events.push(h(this.handle,e.move,p.hitch(this,"onMouseMove")),h(this.handle.ownerDocument,e.release,p.hitch(this,"onMouseUp"))),this._lastX=a.pageX,this._lastY=a.pageY;else this.onDragDetected(a);a.stopPropagation();a.preventDefault()}},onMouseMove:function(a){if(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay)this.onMouseUp(a),
this.onDragDetected(a);a.stopPropagation();a.preventDefault()},onMouseUp:function(a){for(var b=0;2>b;++b)this.events.pop().remove();a.stopPropagation();a.preventDefault()},onSelectStart:function(a){this.skip&&b.isFormElement(a)||(a.stopPropagation(),a.preventDefault())},onDragDetected:function(a){new this.mover(this.node,a,this)},onMoveStart:function(a){u.publish("/dnd/move/start",a);g.add(v.body(),"dojoMove");g.add(this.node,"dojoMoveItem")},onMoveStop:function(a){u.publish("/dnd/move/stop",a);g.remove(v.body(),
"dojoMove");g.remove(this.node,"dojoMoveItem")},onFirstMove:function(){},onMove:function(a,b){this.onMoving(a,b);var c=a.node.style;c.left=b.l+"px";c.top=b.t+"px";this.onMoved(a,b)},onMoving:function(){},onMoved:function(){}})})},"dojo/dnd/Mover":function(){define("../_base/array ../_base/declare ../_base/lang ../sniff ../_base/window ../dom ../dom-geometry ../dom-style ../Evented ../on ../touch ./common ./autoscroll".split(" "),function(t,r,p,m,g,d,l,h,u,e,b,n,v){return r("dojo.dnd.Mover",[u],{constructor:function(f,
a,c){function g(a){a.preventDefault();a.stopPropagation()}this.node=d.byId(f);this.marginBox={l:a.pageX,t:a.pageY};this.mouseButton=a.button;a=this.host=c;f=f.ownerDocument;this.events=[e(f,b.move,p.hitch(this,"onFirstMove")),e(f,b.move,p.hitch(this,"onMouseMove")),e(f,b.release,p.hitch(this,"onMouseUp")),e(f,"dragstart",g),e(f.body,"selectstart",g)];v.autoScrollStart(f);if(a&&a.onMoveStart)a.onMoveStart(this)},onMouseMove:function(b){v.autoScroll(b);var a=this.marginBox;this.host.onMove(this,{l:a.l+
b.pageX,t:a.t+b.pageY},b);b.preventDefault();b.stopPropagation()},onMouseUp:function(b){(m("webkit")&&m("mac")&&2==this.mouseButton?0==b.button:this.mouseButton==b.button)&&this.destroy();b.preventDefault();b.stopPropagation()},onFirstMove:function(b){var a=this.node.style,c,d=this.host;switch(a.position){case "relative":case "absolute":c=Math.round(parseFloat(a.left))||0;a=Math.round(parseFloat(a.top))||0;break;default:a.position="absolute";a=l.getMarginBox(this.node);c=g.doc.body;var e=h.getComputedStyle(c),
f=l.getMarginBox(c,e),e=l.getContentBox(c,e);c=a.l-(e.l-f.l);a=a.t-(e.t-f.t)}this.marginBox.l=c-this.marginBox.l;this.marginBox.t=a-this.marginBox.t;if(d&&d.onFirstMove)d.onFirstMove(this,b);this.events.shift().remove()},destroy:function(){t.forEach(this.events,function(a){a.remove()});var b=this.host;if(b&&b.onMoveStop)b.onMoveStop(this);this.events=this.node=this.host=null}})})},"dojox/grid/_ViewManager":function(){define(["dojo/_base/declare","dojo/_base/sniff","dojo/dom-class"],function(t,r,p){return t("dojox.grid._ViewManager",
null,{constructor:function(m){this.grid=m},defaultWidth:200,views:[],resize:function(){this.onEach("resize")},render:function(){this.onEach("render")},addView:function(m){m.idx=this.views.length;this.views.push(m)},destroyViews:function(){for(var m=0,g;g=this.views[m];m++)g.destroy();this.views=[]},getContentNodes:function(){for(var m=[],g=0,d;d=this.views[g];g++)m.push(d.contentNode);return m},forEach:function(m){for(var g=0,d;d=this.views[g];g++)m(d,g)},onEach:function(m,g){g=g||[];for(var d=0,
l;l=this.views[d];d++)m in l&&l[m].apply(l,g)},normalizeHeaderNodeHeight:function(){for(var m=[],g=0,d;d=this.views[g];g++)d.headerContentNode.firstChild&&m.push(d.headerContentNode);this.normalizeRowNodeHeights(m)},normalizeRowNodeHeights:function(m){var g=0,d=[];if(this.grid.rowHeight)g=this.grid.rowHeight;else{if(1>=m.length)return;for(var l=0,h;h=m[l];l++)p.contains(h,"dojoxGridNonNormalizedCell")||(d[l]=h.firstChild.offsetHeight,g=Math.max(g,d[l]));g=0<=g?g:0;(r("mozilla")||8<r("ie"))&&g&&g++}for(l=
0;h=m[l];l++)d[l]!=g&&(h.firstChild.style.height=g+"px")},resetHeaderNodeHeight:function(){for(var m=0,g;g=this.views[m];m++)if(g=g.headerContentNode.firstChild)g.style.height=""},renormalizeRow:function(m){for(var g=[],d=0,l,h;(l=this.views[d])&&(h=l.getRowNode(m));d++)h.firstChild.style.height="",g.push(h);this.normalizeRowNodeHeights(g)},getViewWidth:function(m){return this.views[m].getWidth()||this.defaultWidth},measureHeader:function(){this.resetHeaderNodeHeight();this.forEach(function(g){g.headerContentNode.style.height=
""});var m=0;this.forEach(function(g){m=Math.max(g.headerNode.offsetHeight,m)});return m},measureContent:function(){var m=0;this.forEach(function(g){m=Math.max(g.domNode.offsetHeight,m)});return m},findClient:function(m){m=this.grid.elasticView||-1;if(0>m)for(var g=1,d;d=this.views[g];g++)if(d.viewWidth){for(g=1;d=this.views[g];g++)if(!d.viewWidth){m=g;break}break}0>m&&(m=Math.floor(this.views.length/2));return m},arrange:function(m,g){var d,l,h,p=this.views.length,e=this,b=0>=g?p:this.findClient(),
n=function(a,b){var c=a.domNode.style,d=a.headerNode.style;e.grid.isLeftToRight()?(c.left=b+"px",d.left=b+"px"):(c.right=b+"px",4>r("ff")?d.right=b+a.getScrollbarWidth()+"px":d.right=b+"px",r("webkit")||"auto"==d.width||(d.width=parseInt(d.width,10)-a.getScrollbarWidth()+"px"));c.top="0px";d.top=0};for(d=0;(l=this.views[d])&&d<b;d++)h=this.getViewWidth(d),l.setSize(h,0),n(l,m),h=l.headerContentNode&&l.headerContentNode.firstChild?l.getColumnsWidth()+l.getScrollbarWidth():l.domNode.offsetWidth,m+=
h;d++;for(var t=g,f=p-1;(l=this.views[f])&&d<=f;f--)h=this.getViewWidth(f),l.setSize(h,0),h=l.domNode.offsetWidth,t-=h,n(l,t);b<p&&(l=this.views[b],h=Math.max(1,t-m),l.setSize(h+"px",0),n(l,m));return m},renderRow:function(m,g,d){for(var l=[],h=0,p,e;(p=this.views[h])&&(e=g[h]);h++)p=p.renderRow(m),e.appendChild(p),l.push(p);d||this.normalizeRowNodeHeights(l)},rowRemoved:function(m){this.onEach("rowRemoved",[m])},updateRow:function(m,g){for(var d=0,l;l=this.views[d];d++)l.updateRow(m);g||this.renormalizeRow(m)},
updateRowStyles:function(m){this.onEach("updateRowStyles",[m])},setScrollTop:function(m){for(var g=m,d=0,l;l=this.views[d];d++)g=l.setScrollTop(m),r("ie")&&l.headerNode&&l.scrollboxNode&&(l.headerNode.scrollLeft=l.scrollboxNode.scrollLeft);return g},getFirstScrollingView:function(){for(var m=0,g;g=this.views[m];m++)if(g.hasHScrollbar()||g.hasVScrollbar())return g;return null}})})},"dojox/grid/_RowManager":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/dom-class"],function(t,r,p){return t("dojox.grid._RowManager",
null,{constructor:function(m){this.grid=m},linesToEms:2,overRow:-2,prepareStylingRow:function(m,g){return{index:m,node:g,odd:!!(m&1),selected:!!this.grid.selection.isSelected(m),over:this.isOver(m),customStyles:"",customClasses:"dojoxGridRow"}},styleRowNode:function(m,g){var d=this.prepareStylingRow(m,g);this.grid.onStyleRow(d);this.applyStyles(d)},applyStyles:function(m){m.node.className=m.customClasses;var g=m.node.style.height,d=m.node,l=m.customStyles+";"+(m.node._style||"");void 0==d.style.cssText?
d.setAttribute("style",l):d.style.cssText=l;m.node.style.height=g},updateStyles:function(m){this.grid.updateRowStyles(m)},setOverRow:function(m){var g=this.overRow;this.overRow=m;g!=this.overRow&&(r.isString(g)||0<=g)&&this.updateStyles(g);this.updateStyles(this.overRow)},isOver:function(m){return this.overRow==m&&!p.contains(this.grid.domNode,"dojoxGridColumnResizing")}})})},"dojox/grid/_FocusManager":function(){define("dojo/_base/array dojo/_base/lang dojo/_base/declare dojo/_base/connect dojo/_base/event dojo/_base/sniff dojo/query ./util dojo/_base/html".split(" "),
function(t,r,p,m,g,d,l,h,u){return p("dojox.grid._FocusManager",null,{constructor:function(d){this.grid=d;this.cell=null;this.rowIndex=-1;this._connects=[];this._headerConnects=[];this.headerMenu=this.grid.headerMenu;this._connects.push(m.connect(this.grid.domNode,"onfocus",this,"doFocus"));this._connects.push(m.connect(this.grid.domNode,"onblur",this,"doBlur"));this._connects.push(m.connect(this.grid.domNode,"mousedown",this,"_mouseDown"));this._connects.push(m.connect(this.grid.domNode,"mouseup",
this,"_mouseUp"));this._connects.push(m.connect(this.grid.domNode,"oncontextmenu",this,"doContextMenu"));this._connects.push(m.connect(this.grid.lastFocusNode,"onfocus",this,"doLastNodeFocus"));this._connects.push(m.connect(this.grid.lastFocusNode,"onblur",this,"doLastNodeBlur"));this._connects.push(m.connect(this.grid,"_onFetchComplete",this,"_delayedCellFocus"));this._connects.push(m.connect(this.grid,"postrender",this,"_delayedHeaderFocus"))},destroy:function(){t.forEach(this._connects,m.disconnect);
t.forEach(this._headerConnects,m.disconnect);delete this.grid;delete this.cell},_colHeadNode:null,_colHeadFocusIdx:null,_contextMenuBindNode:null,tabbingOut:!1,focusClass:"dojoxGridCellFocus",focusView:null,initFocusView:function(){this.focusView=this.grid.views.getFirstScrollingView()||this.focusView||this.grid.views.views[0];this._initColumnHeaders()},isFocusCell:function(d,b){return this.cell==d&&this.rowIndex==b},isLastFocusCell:function(){return this.cell?this.rowIndex==this.grid.rowCount-1&&
this.cell.index==this.grid.layout.cellCount-1:!1},isFirstFocusCell:function(){return this.cell?0===this.rowIndex&&0===this.cell.index:!1},isNoFocusCell:function(){return 0>this.rowIndex||!this.cell},isNavHeader:function(){return!!this._colHeadNode},getHeaderIndex:function(){return this._colHeadNode?t.indexOf(this._findHeaderCells(),this._colHeadNode):-1},_focusifyCellNode:function(e){var b=this.cell&&this.cell.getNode(this.rowIndex);if(b&&(u.toggleClass(b,this.focusClass,e),e)){e=this.scrollIntoView();
try{if(d("webkit")||!this.grid.edit.isEditing())h.fire(b,"focus"),e&&(this.cell.view.scrollboxNode.scrollLeft=e)}catch(n){}}},_delayedCellFocus:function(){if(!this.isNavHeader()&&this.grid.focused){var d=this.cell&&this.cell.getNode(this.rowIndex);if(d)try{this.grid.edit.isEditing()||(u.toggleClass(d,this.focusClass,!0),this._colHeadNode&&this.blurHeader(),h.fire(d,"focus"))}catch(b){}}},_delayedHeaderFocus:function(){this.isNavHeader()&&this.focusHeader()},_initColumnHeaders:function(){t.forEach(this._headerConnects,
m.disconnect);this._headerConnects=[];for(var d=this._findHeaderCells(),b=0;b<d.length;b++)this._headerConnects.push(m.connect(d[b],"onfocus",this,"doColHeaderFocus")),this._headerConnects.push(m.connect(d[b],"onblur",this,"doColHeaderBlur"))},_findHeaderCells:function(){for(var d=l("th",this.grid.viewsHeaderNode),b=[],g=0;g<d.length;g++){var h=d[g],f=u.hasAttr(h,"tabIndex"),a=u.attr(h,"tabIndex");f&&0>a&&b.push(h)}return b},_setActiveColHeader:function(d,b,g){this.grid.domNode.setAttribute("aria-activedescendant",
d.id);null!=g&&0<=g&&g!=b&&u.toggleClass(this._findHeaderCells()[g],this.focusClass,!1);u.toggleClass(d,this.focusClass,!0);this._colHeadNode=d;this._colHeadFocusIdx=b;this._scrollHeader(this._colHeadFocusIdx)},scrollIntoView:function(){var d=this.cell?this._scrollInfo(this.cell):null;if(!d||!d.s)return null;var b=this.grid.scroller.findScrollTop(this.rowIndex);d.n&&d.sr&&(d.n.offsetLeft+d.n.offsetWidth>d.sr.l+d.sr.w?d.s.scrollLeft=d.n.offsetLeft+d.n.offsetWidth-d.sr.w:d.n.offsetLeft<d.sr.l&&(d.s.scrollLeft=
d.n.offsetLeft));d.r&&d.sr&&(b+d.r.offsetHeight>d.sr.t+d.sr.h?this.grid.setScrollTop(b+d.r.offsetHeight-d.sr.h):b<d.sr.t&&this.grid.setScrollTop(b));return d.s.scrollLeft},_scrollInfo:function(d,b){if(d){var e=d.view.scrollboxNode,g={w:e.clientWidth,l:e.scrollLeft,t:e.scrollTop,h:e.clientHeight},f=d.view.getRowNode(this.rowIndex);return{c:d,s:e,sr:g,n:b?b:d.getNode(this.rowIndex),r:f}}return null},_scrollHeader:function(e){var b=null;if(this._colHeadNode){var g=this.grid.getCell(e);if(!g)return;b=
this._scrollInfo(g,g.getNode(0))}b&&b.s&&b.sr&&b.n&&(b.n.offsetLeft+b.n.offsetWidth>b.sr.l+b.sr.w?b.s.scrollLeft=b.n.offsetLeft+b.n.offsetWidth-b.sr.w:b.n.offsetLeft<b.sr.l?b.s.scrollLeft=b.n.offsetLeft:7>=d("ie")&&g&&g.view.headerNode&&(g.view.headerNode.scrollLeft=b.s.scrollLeft))},_isHeaderHidden:function(){var d=this.focusView;if(!d)for(var b=0,g;g=this.grid.views.views[b];b++)if(g.headerNode){d=g;break}return d&&"none"==u.getComputedStyle(d.headerNode).display},colSizeAdjust:function(d,b,g){var e=
this._findHeaderCells(),f=this.focusView;if(!f||!f.header.tableMap.map)for(var a=0,c;c=this.grid.views.views[a];a++)if(c.header.tableMap.map){f=c;break}a=e[b];!f||b==e.length-1&&0===b||(f.content.baseDecorateEvent(d),d.cellNode=a,d.cellIndex=f.content.getCellNodeIndex(d.cellNode),d.cell=0<=d.cellIndex?this.grid.getCell(d.cellIndex):null,f.header.canResize(d)&&(b={l:g},d=f.header.colResizeSetup(d,!1),f.header.doResizeColumn(d,null,b),f.update()))},styleRow:function(d){},setFocusIndex:function(d,b){this.setFocusCell(this.grid.getCell(b),
d)},setFocusCell:function(e,b){e&&!this.isFocusCell(e,b)&&(this.tabbingOut=!1,this._colHeadNode&&this.blurHeader(),this._colHeadNode=this._colHeadFocusIdx=null,this.focusGridView(),this._focusifyCellNode(!1),this.cell=e,this.rowIndex=b,this._focusifyCellNode(!0));if(d("opera"))setTimeout(r.hitch(this.grid,"onCellFocus",this.cell,this.rowIndex),1);else this.grid.onCellFocus(this.cell,this.rowIndex)},next:function(){if(this.cell){var d=this.rowIndex,b=this.cell.index+1,g=this.grid.layout.cellCount-
1,h=this.grid.rowCount-1;b>g&&(b=0,d++);d>h&&(b=g,d=h);if(this.grid.edit.isEditing()&&(g=this.grid.getCell(b),!this.isLastFocusCell()&&(!g.editable||this.grid.canEdit&&!this.grid.canEdit(g,d)))){this.cell=g;this.rowIndex=d;this.next();return}this.setFocusIndex(d,b)}},previous:function(){if(this.cell){var d=this.rowIndex||0,b=(this.cell.index||0)-1;0>b&&(b=this.grid.layout.cellCount-1,d--);0>d&&(b=d=0);if(this.grid.edit.isEditing()){var g=this.grid.getCell(b);if(!this.isFirstFocusCell()&&!g.editable){this.cell=
g;this.rowIndex=d;this.previous();return}}this.setFocusIndex(d,b)}},move:function(d,b){var e=0>b?-1:1;if(this.isNavHeader()){var g=this._findHeaderCells(),f=currentIdx=t.indexOf(g,this._colHeadNode);for(currentIdx+=b;0<=currentIdx&&currentIdx<g.length&&"none"==g[currentIdx].style.display;)currentIdx+=e;0<=currentIdx&&currentIdx<g.length&&this._setActiveColHeader(g[currentIdx],currentIdx,f)}else if(this.cell){var a=this.grid.scroller,g=this.rowIndex,f=this.grid.rowCount-1,c=Math.min(f,Math.max(0,g+
d));d&&(0<d?c>a.getLastPageRow(a.page)&&this.grid.setScrollTop(this.grid.scrollTop+a.findScrollTop(c)-a.findScrollTop(g)):0>d&&c<=a.getPageRow(a.page)&&this.grid.setScrollTop(this.grid.scrollTop-a.findScrollTop(g)-a.findScrollTop(c)));for(var a=this.grid.layout.cellCount-1,h=this.cell.index,l=Math.min(a,Math.max(0,h+b)),m=this.grid.getCell(l);0<=l&&l<a&&m&&!0===m.hidden;)l+=e,m=this.grid.getCell(l);m&&!0!==m.hidden||(l=h);e=m.getNode(c);!e&&d?0<=c+d&&c+d<=f&&this.move(0<d?++d:--d,b):e&&"none"!==u.style(e,
"display")||!b?(this.setFocusIndex(c,l),d&&this.grid.updateRow(g)):0<=l+b&&l+b<=a&&this.move(d,0<b?++b:--b)}},previousKey:function(d){this.grid.edit.isEditing()?(g.stop(d),this.previous()):this.isNavHeader()||this._isHeaderHidden()?(this.tabOut(this.grid.domNode),null!=this._colHeadFocusIdx&&(u.toggleClass(this._findHeaderCells()[this._colHeadFocusIdx],this.focusClass,!1),this._colHeadFocusIdx=null),this._focusifyCellNode(!1)):(this.grid.domNode.focus(),g.stop(d))},nextKey:function(d){d.target===
this.grid.domNode&&null==this._colHeadFocusIdx?(this.focusHeader(),g.stop(d)):this.isNavHeader()?(this.blurHeader(),this.findAndFocusGridCell()||this.tabOut(this.grid.lastFocusNode),this._colHeadNode=this._colHeadFocusIdx=null):this.grid.edit.isEditing()?(g.stop(d),this.next()):this.tabOut(this.grid.lastFocusNode)},tabOut:function(d){this.tabbingOut=!0;d.focus()},focusGridView:function(){h.fire(this.focusView,"focus")},focusGrid:function(d){this.focusGridView();this._focusifyCellNode(!0)},findAndFocusGridCell:function(){var d=
!0,b=0===this.grid.rowCount;this.isNoFocusCell()&&!b?(b=0,this.grid.getCell(b).hidden&&(b=this.isNavHeader()?this._colHeadFocusIdx:0),this.setFocusIndex(0,b)):this.cell&&!b?(this.focusView&&!this.focusView.rowNodes[this.rowIndex]&&this.grid.scrollToRow(this.rowIndex),this.focusGrid()):d=!1;this._colHeadNode=this._colHeadFocusIdx=null;return d},focusHeader:function(){var d=this._findHeaderCells(),b=this._colHeadFocusIdx;this._isHeaderHidden()?this.findAndFocusGridCell():this._colHeadFocusIdx||(this.isNoFocusCell()?
this._colHeadFocusIdx=0:this._colHeadFocusIdx=this.cell.index);for(this._colHeadNode=d[this._colHeadFocusIdx];this._colHeadNode&&0<=this._colHeadFocusIdx&&this._colHeadFocusIdx<d.length&&"none"==this._colHeadNode.style.display;)this._colHeadFocusIdx++,this._colHeadNode=d[this._colHeadFocusIdx];this._colHeadNode&&"none"!=this._colHeadNode.style.display?(this.headerMenu&&this._contextMenuBindNode!=this.grid.domNode&&(this.headerMenu.unBindDomNode(this.grid.viewsHeaderNode),this.headerMenu.bindDomNode(this.grid.domNode),
this._contextMenuBindNode=this.grid.domNode),this._setActiveColHeader(this._colHeadNode,this._colHeadFocusIdx,b),this._scrollHeader(this._colHeadFocusIdx),this._focusifyCellNode(!1)):this.findAndFocusGridCell()},blurHeader:function(){u.removeClass(this._colHeadNode,this.focusClass);u.removeAttr(this.grid.domNode,"aria-activedescendant");if(this.headerMenu&&this._contextMenuBindNode==this.grid.domNode){var d=this.grid.viewsHeaderNode;this.headerMenu.unBindDomNode(this.grid.domNode);this.headerMenu.bindDomNode(d);
this._contextMenuBindNode=d}},doFocus:function(d){d&&d.target!=d.currentTarget?g.stop(d):this._clickFocus||(this.tabbingOut||this.focusHeader(),this.tabbingOut=!1,g.stop(d))},doBlur:function(d){g.stop(d)},doContextMenu:function(d){this.headerMenu||g.stop(d)},doLastNodeFocus:function(d){this.tabbingOut?this._focusifyCellNode(!1):0<this.grid.rowCount?(this.isNoFocusCell()&&this.setFocusIndex(0,0),this._focusifyCellNode(!0)):this.focusHeader();this.tabbingOut=!1;g.stop(d)},doLastNodeBlur:function(d){g.stop(d)},
doColHeaderFocus:function(d){this._setActiveColHeader(d.target,u.attr(d.target,"idx"),this._colHeadFocusIdx);this._scrollHeader(this.getHeaderIndex());g.stop(d)},doColHeaderBlur:function(d){u.toggleClass(d.target,this.focusClass,!1)},_mouseDown:function(d){this._clickFocus=dojo.some(this.grid.views.views,function(b){return b.scrollboxNode===d.target})},_mouseUp:function(d){this._clickFocus=!1}})})},"dojox/grid/_EditManager":function(){define("dojo/_base/lang dojo/_base/array dojo/_base/declare dojo/_base/connect dojo/_base/sniff ./util".split(" "),
function(t,r,p,m,g,d){return p("dojox.grid._EditManager",null,{constructor:function(d){this.grid=d;this.connections=g("ie")?[m.connect(document.body,"onfocus",t.hitch(this,"_boomerangFocus"))]:[];this.connections.push(m.connect(this.grid,"onBlur",this,"apply"));this.connections.push(m.connect(this.grid,"prerender",this,"_onPreRender"))},info:{},destroy:function(){r.forEach(this.connections,m.disconnect)},cellFocus:function(d,g){this.grid.singleClickEdit||this.isEditRow(g)?this.setEditCell(d,g):this.apply();
(this.isEditing()||d&&d.editable&&d.alwaysEditing)&&this._focusEditor(d,g)},rowClick:function(d){this.isEditing()&&!this.isEditRow(d.rowIndex)&&this.apply()},styleRow:function(d){d.index==this.info.rowIndex&&(d.customClasses+=" dojoxGridRowEditing")},dispatchEvent:function(d){var g=d.cell;return(g=g&&g.editable?g:0)&&g.dispatchEvent(d.dispatch,d)},isEditing:function(){return void 0!==this.info.rowIndex},isEditCell:function(d,g){return this.info.rowIndex===d&&this.info.cell.index==g},isEditRow:function(d){return this.info.rowIndex===
d},setEditCell:function(d,g){!this.isEditCell(g,d.index)&&this.grid.canEdit&&this.grid.canEdit(d,g)&&this.start(d,g,this.isEditRow(g)||d.editable)},_focusEditor:function(g,h){d.fire(g,"focus",[h])},focusEditor:function(){this.isEditing()&&this._focusEditor(this.info.cell,this.info.rowIndex)},_boomerangWindow:500,_shouldCatchBoomerang:function(){return this._catchBoomerang>(new Date).getTime()},_boomerangFocus:function(){this._shouldCatchBoomerang()&&(this.grid.focus.focusGrid(),this.focusEditor(),
this._catchBoomerang=0)},_doCatchBoomerang:function(){g("ie")&&(this._catchBoomerang=(new Date).getTime()+this._boomerangWindow)},start:function(d,g,m){this._isValidInput()&&(this.grid.beginUpdate(),this.editorApply(),this.isEditing()&&!this.isEditRow(g)&&(this.applyRowEdit(),this.grid.updateRow(g)),m?(this.info={cell:d,rowIndex:g},this.grid.doStartEdit(d,g),this.grid.updateRow(g)):this.info={},this.grid.endUpdate(),this.grid.focus.focusGrid(),this._focusEditor(d,g),this._doCatchBoomerang())},_editorDo:function(d){var g=
this.info.cell;if(g&&g.editable)g[d](this.info.rowIndex)},editorApply:function(){this._editorDo("apply")},editorCancel:function(){this._editorDo("cancel")},applyCellEdit:function(d,g,m){this.grid.canEdit(g,m)&&this.grid.doApplyCellEdit(d,m,g.field)},applyRowEdit:function(){this.grid.doApplyEdit(this.info.rowIndex,this.info.cell.field)},apply:function(){this.isEditing()&&this._isValidInput()&&(this.grid.beginUpdate(),this.editorApply(),this.applyRowEdit(),this.info={},this.grid.endUpdate(),this.grid.focus.focusGrid(),
this._doCatchBoomerang())},cancel:function(){this.isEditing()&&(this.grid.beginUpdate(),this.editorCancel(),this.info={},this.grid.endUpdate(),this.grid.focus.focusGrid(),this._doCatchBoomerang())},save:function(d,g){var h=this.info.cell;!this.isEditRow(d)||g&&h.view!=g||!h.editable||h.save(h,this.info.rowIndex)},restore:function(d,g){var h=this.info.cell;this.isEditRow(g)&&h.view==d&&h.editable&&h.restore(this.info.rowIndex)},_isValidInput:function(){var d=(this.info.cell||{}).widget;if(!d||!d.isValid)return!0;
d.focused=!0;return d.isValid(!0)},_onPreRender:function(){this.isEditing()&&(this.info.value=this.info.cell.getValue())}})})},"dojox/grid/Selection":function(){define(["dojo/_base/declare","dojo/_base/array","dojo/_base/lang","dojo/dom-attr"],function(t,r,p,m){return t("dojox.grid.Selection",null,{constructor:function(g){this.grid=g;this.selected=[];this.setMode(g.selectionMode)},mode:"extended",selected:null,updating:0,selectedIndex:-1,rangeStartIndex:-1,setMode:function(g){this.selected.length&&
this.deselectAll();this.mode="extended"!=g&&"multiple"!=g&&"single"!=g&&"none"!=g?"extended":g},onCanSelect:function(g){return this.grid.onCanSelect(g)},onCanDeselect:function(g){return this.grid.onCanDeselect(g)},onSelected:function(g){},onDeselected:function(g){},onChanging:function(){},onChanged:function(){},isSelected:function(g){return"none"==this.mode?!1:this.selected[g]},getFirstSelected:function(){if(!this.selected.length||"none"==this.mode)return-1;for(var g=0,d=this.selected.length;g<d;g++)if(this.selected[g])return g;
return-1},getNextSelected:function(g){if("none"==this.mode)return-1;g+=1;for(var d=this.selected.length;g<d;g++)if(this.selected[g])return g;return-1},getSelected:function(){for(var g=[],d=0,l=this.selected.length;d<l;d++)this.selected[d]&&g.push(d);return g},getSelectedCount:function(){for(var g=0,d=0;d<this.selected.length;d++)this.selected[d]&&g++;return g},_beginUpdate:function(){if(0===this.updating)this.onChanging();this.updating++},_endUpdate:function(){this.updating--;if(0===this.updating)this.onChanged()},
select:function(g){"none"!=this.mode&&("multiple"!=this.mode?(this.deselectAll(g),this.addToSelection(g)):this.toggleSelect(g))},addToSelection:function(g){if("none"!=this.mode)if(p.isArray(g))r.forEach(g,this.addToSelection,this);else if(g=Number(g),this.selected[g])this.selectedIndex=g;else if(!1!==this.onCanSelect(g)){this.selectedIndex=g;var d=this.grid.getRowNode(g);d&&m.set(d,"aria-selected","true");this._beginUpdate();this.selected[g]=!0;this.onSelected(g);this._endUpdate()}},deselect:function(g){if("none"!=
this.mode)if(p.isArray(g))r.forEach(g,this.deselect,this);else if(g=Number(g),this.selectedIndex==g&&(this.selectedIndex=-1),this.selected[g]&&!1!==this.onCanDeselect(g)){var d=this.grid.getRowNode(g);d&&m.set(d,"aria-selected","false");this._beginUpdate();delete this.selected[g];this.onDeselected(g);this._endUpdate()}},setSelected:function(g,d){this[d?"addToSelection":"deselect"](g)},toggleSelect:function(g){p.isArray(g)?r.forEach(g,this.toggleSelect,this):this.setSelected(g,!this.selected[g])},
_range:function(g,d,l){var h=0<=g?g:d;g=d;h>g&&(g=h,h=d);for(d=h;d<=g;d++)l(d)},selectRange:function(g,d){this._range(g,d,p.hitch(this,"addToSelection"))},deselectRange:function(g,d){this._range(g,d,p.hitch(this,"deselect"))},insert:function(g){this.selected.splice(g,0,!1);this.selectedIndex>=g&&this.selectedIndex++},remove:function(g){this.selected.splice(g,1);this.selectedIndex>=g&&this.selectedIndex--},deselectAll:function(g){for(var d in this.selected)d!=g&&!0===this.selected[d]&&this.deselect(d)},
clickSelect:function(g,d,l){if("none"!=this.mode){this._beginUpdate();if("extended"!=this.mode)this.select(g);else{if(!l||0>this.rangeStartIndex)this.rangeStartIndex=g;d||this.deselectAll(g);l?this.selectRange(this.rangeStartIndex,g):d?this.toggleSelect(g):this.addToSelection(g)}this._endUpdate()}},clickSelectEvent:function(g){this.clickSelect(g.rowIndex,dojo.isCopyKey(g),g.shiftKey)},clear:function(){this._beginUpdate();this.deselectAll();this._endUpdate()}})})},"dijit/CheckedMenuItem":function(){define(["dojo/_base/declare",
"dojo/dom-class","./MenuItem","dojo/text!./templates/CheckedMenuItem.html","./hccss"],function(t,r,p,m){return t("dijit.CheckedMenuItem",p,{baseClass:"dijitMenuItem dijitCheckedMenuItem",templateString:m,checked:!1,_setCheckedAttr:function(g){this.domNode.setAttribute("aria-checked",g?"true":"false");this._set("checked",g)},iconClass:"",role:"menuitemcheckbox",checkedChar:"\x26#10003;",onChange:function(){},_onClick:function(g){this.disabled||(this.set("checked",!this.checked),this.onChange(this.checked));
this.onClick(g)}})})},"dojox/grid/DataSelection":function(){define(["dojo/_base/declare","./_SelectionPreserver","./Selection"],function(t,r,p){return t("dojox.grid.DataSelection",p,{constructor:function(m){m.keepSelection&&(this.preserver=new r(this))},destroy:function(){this.preserver&&this.preserver.destroy()},getFirstSelected:function(){var m=p.prototype.getFirstSelected.call(this);return-1==m?null:this.grid.getItem(m)},getNextSelected:function(m){m=this.grid.getItemIndex(m);m=p.prototype.getNextSelected.call(this,
m);return-1==m?null:this.grid.getItem(m)},getSelected:function(){for(var m=[],g=0,d=this.selected.length;g<d;g++)this.selected[g]&&m.push(this.grid.getItem(g));return m},addToSelection:function(m){if("none"!=this.mode){var g=null,g="number"==typeof m||"string"==typeof m?m:this.grid.getItemIndex(m);p.prototype.addToSelection.call(this,g)}},deselect:function(m){if("none"!=this.mode){var g=null,g="number"==typeof m||"string"==typeof m?m:this.grid.getItemIndex(m);p.prototype.deselect.call(this,g)}},deselectAll:function(m){var g=
null;m||"number"==typeof m?(g="number"==typeof m||"string"==typeof m?m:this.grid.getItemIndex(m),p.prototype.deselectAll.call(this,g)):this.inherited(arguments)}})})},"dojox/grid/_SelectionPreserver":function(){define(["dojo/_base/declare","dojo/_base/connect","dojo/_base/lang","dojo/_base/array"],function(t,r,p,m){return t("dojox.grid._SelectionPreserver",null,{constructor:function(g){this.selection=g;var d=this.grid=g.grid;this.reset();this._connects=[r.connect(d,"_setStore",this,"reset"),r.connect(d,
"_addItem",this,"_reSelectById"),r.connect(g,"onSelected",p.hitch(this,"_selectById",!0)),r.connect(g,"onDeselected",p.hitch(this,"_selectById",!1)),r.connect(g,"deselectAll",this,"reset")]},destroy:function(){this.reset();m.forEach(this._connects,r.disconnect);delete this._connects},reset:function(){this._selectedById={}},_reSelectById:function(g,d){g&&this.grid._hasIdentity&&(this.selection.selected[d]=this._selectedById[this.grid.store.getIdentity(g)])},_selectById:function(g,d){if("none"!=this.selection.mode&&
this.grid._hasIdentity){var l=d,h=this.grid;if("number"==typeof d||"string"==typeof d)l=(l=h._by_idx[d])&&l.item;l&&(this._selectedById[h.store.getIdentity(l)]=!!g);return l}}})})},"esri/dijit/editing/TemplatePickerItem":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has dojo/sniff dojo/dom-style dijit/_Widget dijit/_Templated dojox/gfx ../../symbols/jsonUtils ../../kernel".split(" "),function(t,r,p,m,g,d,l,h,u,e,b){t=t([l,h],{declaredClass:"esri.dijit.editing.TemplatePickerItem",
templateString:"\x3cdiv class\x3d'item' style\x3d'text-align: center;'\x3e\x3cdiv class\x3d'itemSymbol' dojoAttachPoint\x3d'_surfaceNode'\x3e\x3c/div\x3e\x3cdiv class\x3d'itemLabel'\x3e${label}\x3c/div\x3e\x3c/div\x3e",startup:function(){this._started||(this.inherited(arguments),this._surface=this._draw(this._surfaceNode,this.symbol,this.surfaceWidth,this.surfaceHeight,this.template))},_draw:function(b,g,f,a,c){if(g&&"textsymbol"!==g.type){b=u.createSurface(b,f,a);if(9>m("ie")){var h=b.getEventSource();
d.set(h,"position","relative");d.set(h.parentNode,"position","relative")}g=!this.legendOverride&&this._getDrawingToolShape(g,c)||e.getShapeDescriptors(g);var l;try{l=b.createShape(g.defaultShape).setFill(g.fill).setStroke(g.stroke)}catch(D){b.clear();b.destroy();return}var n=l.getBoundingBox();g=n.width;c=n.height;var h=-(n.x+g/2),n=-(n.y+c/2),p=b.getDimensions(),h={dx:h+p.width/2,dy:n+p.height/2};if(g>f||c>a)n=g/f>c/a,f=((n?f:a)-5)/(n?g:c),r.mixin(h,{xx:f,yy:f});l.applyTransform(h);return b}},_getDrawingToolShape:function(b,
d){var e;switch(d?d.drawingTool||null:null){case "esriFeatureEditToolArrow":e={type:"path",path:"M 10,1 L 3,8 L 3,5 L -15,5 L -15,-2 L 3,-2 L 3,-5 L 10,1 E"};break;case "esriFeatureEditToolLeftArrow":e={type:"path",path:"M -15,1 L -8,8 L -8,5 L 10,5 L 10,-2 L -8,-2 L -8,-5 L -15,1 E"};break;case "esriFeatureEditToolRightArrow":e={type:"path",path:"M 10,1 L 3,8 L 3,5 L -15,5 L -15,-2 L 3,-2 L 3,-5 L 10,1 E"};break;case "esriFeatureEditToolUpArrow":e={type:"path",path:"M 1,-10 L 8,-3 L 5,-3 L 5,15 L -2,15 L -2,-3 L -5,-3 L 1,-10 E"};
break;case "esriFeatureEditToolDownArrow":e={type:"path",path:"M 1,15 L 8,8 L 5,8 L 5,-10 L -2,-10 L -2,8 L -5,8 L 1,15 E"};break;case "esriFeatureEditToolTriangle":e={type:"path",path:"M -10,14 L 2,-10 L 14,14 L -10,14 E"};break;case "esriFeatureEditToolRectangle":e={type:"path",path:"M -10,-10 L 10,-10 L 10,10 L -10,10 L -10,-10 E"};break;case "esriFeatureEditToolCircle":e={type:"circle",cx:0,cy:0,r:10};break;case "esriFeatureEditToolEllipse":e={type:"ellipse",cx:0,cy:0,rx:10,ry:5};break;case "esriFeatureEditToolFreehand":e=
"simplelinesymbol"===b.type||"cartographiclinesymbol"===b.type?{type:"path",path:"m -11, -7c-1.5,-3.75 7.25,-9.25 12.5,-7c5.25,2.25 6.75,9.75 3.75,12.75c-3,3 -3.25,2.5 -9.75,5.25c-6.5,2.75 -7.25,14.25 2,15.25c9.25,1 11.75,-4 13.25,-6.75c1.5,-2.75 3.5,-11.75 12,-6.5"}:{type:"path",path:"M 10,-13 c3.1,0.16667 4.42564,2.09743 2.76923,3.69231c-2.61025,2.87179 -5.61025,5.6718 -6.14358,6.20513c-0.66667,0.93333 -0.46667,1.2 -0.53333,1.93333c-0.00001,0.86666 0.6,1.66667 1.13334,2c1.03077,0.38462 2.8,0.93333 3.38974,1.70769c0.47693,0.42564 0.87693,0.75897 1.41026,1.75897c0.13333,1.06667 -0.46667,2.86667 -1.8,3.8c-0.73333,0.73333 -3.86667,2.66666 -4.86667,3.13333c-0.93333,0.8 -7.4,3.2 -7.6,3.06667c-1.06667,0.46667 -4.73333,1.13334 -5.2,1.26667c-1.6,0.33334 -4.6,0.4 -6.25128,0.05128c-1.41539,-0.18462 -2.34872,-2.31796 -1.41539,-4.45129c0.93333,-1.73333 1.86667,-3.13333 2.64615,-3.85641c1.28718,-1.47692 2.57437,-2.68204 3.88718,-3.54359c0.88718,-1.13845 1.8,-1.33333 2.26666,-2.45641c0.33334,-0.74359 0.37949,-1.7641 0.06667,-2.87692c-0.66666,-1.46666 -1.66666,-1.86666 -2.98975,-2.2c-1.27692,-0.26666 -2.12307,-0.64102 -3.27692,-1.46666c-0.66667,-1.00001 -1.01538,-3.01539 0.73333,-4.06667c1.73333,-1.2 3.6,-1.93333 4.93333,-2.2c1.33333,-0.46667 4.84104,-1.09743 5.84103,-1.23076c1.60001,-0.46667 6.02564,-0.50257 7.29231,-0.56924z"};
break;default:return null}return{defaultShape:e,fill:b.getFill(),stroke:b.getStroke()}},_repaint:function(b){b?(b.getStroke&&b.setStroke&&b.setStroke(b.getStroke()),b.getFill&&b.setFill&&b.setFill(b.getFill()),b.children&&r.isArray(b.children)&&p.forEach(b.children,this._repaint,this)):this._surface=this._draw(this._surfaceNode,this.symbol,this.surfaceWidth,this.surfaceHeight,this.template)},destroy:function(){this._surface&&(this._surface.destroy(),delete this._surface);this.inherited(arguments)}});
m("extend-esri")&&r.setObject("dijit.editing.TemplatePickerItem",t,b);return t})},"url:dijit/templates/Menu.html":'\x3ctable class\x3d"dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable" role\x3d"menu" tabIndex\x3d"${tabIndex}"\r\n\t   cellspacing\x3d"0"\x3e\r\n\t\x3ctbody class\x3d"dijitReset" data-dojo-attach-point\x3d"containerNode"\x3e\x3c/tbody\x3e\r\n\x3c/table\x3e\r\n',"url:dijit/templates/MenuItem.html":'\x3ctr class\x3d"dijitReset" data-dojo-attach-point\x3d"focusNode" role\x3d"menuitem" tabIndex\x3d"-1"\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuItemIconCell" role\x3d"presentation"\x3e\r\n\t\t\x3cspan role\x3d"presentation" class\x3d"dijitInline dijitIcon dijitMenuItemIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\x3e\r\n\t\x3c/td\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuItemLabel" colspan\x3d"2" data-dojo-attach-point\x3d"containerNode,textDirNode"\r\n\t\trole\x3d"presentation"\x3e\x3c/td\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuItemAccelKey" style\x3d"display: none" data-dojo-attach-point\x3d"accelKeyNode"\x3e\x3c/td\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuArrowCell" role\x3d"presentation"\x3e\r\n\t\t\x3cspan data-dojo-attach-point\x3d"arrowWrapper" style\x3d"visibility: hidden"\x3e\r\n\t\t\t\x3cspan class\x3d"dijitInline dijitIcon dijitMenuExpand"\x3e\x3c/span\x3e\r\n\t\t\t\x3cspan class\x3d"dijitMenuExpandA11y"\x3e+\x3c/span\x3e\r\n\t\t\x3c/span\x3e\r\n\t\x3c/td\x3e\r\n\x3c/tr\x3e\r\n',
"url:dojox/grid/resources/View.html":'\x3cdiv class\x3d"dojoxGridView" role\x3d"presentation"\x3e\r\n\t\x3cdiv class\x3d"dojoxGridHeader" dojoAttachPoint\x3d"headerNode" role\x3d"presentation"\x3e\r\n\t\t\x3cdiv dojoAttachPoint\x3d"headerNodeContainer" style\x3d"width:9000em" role\x3d"presentation"\x3e\r\n\t\t\t\x3cdiv dojoAttachPoint\x3d"headerContentNode" role\x3d"row"\x3e\x3c/div\x3e\r\n\t\t\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\t\x3cinput type\x3d"checkbox" class\x3d"dojoxGridHiddenFocus" dojoAttachPoint\x3d"hiddenFocusNode" aria-hidden\x3d"true" /\x3e\r\n\t\x3cinput type\x3d"checkbox" class\x3d"dojoxGridHiddenFocus" aria-hidden\x3d"true" /\x3e\r\n\t\x3cdiv class\x3d"dojoxGridScrollbox" dojoAttachPoint\x3d"scrollboxNode" role\x3d"presentation"\x3e\r\n\t\t\x3cdiv class\x3d"dojoxGridContent" dojoAttachPoint\x3d"contentNode" hidefocus\x3d"hidefocus" role\x3d"presentation"\x3e\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:dijit/templates/CheckedMenuItem.html":'\x3ctr class\x3d"dijitReset" data-dojo-attach-point\x3d"focusNode" role\x3d"${role}" tabIndex\x3d"-1" aria-checked\x3d"${checked}"\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuItemIconCell" role\x3d"presentation"\x3e\r\n\t\t\x3cspan class\x3d"dijitInline dijitIcon dijitMenuItemIcon dijitCheckedMenuItemIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\x3e\r\n\t\t\x3cspan class\x3d"dijitMenuItemIconChar dijitCheckedMenuItemIconChar"\x3e${!checkedChar}\x3c/span\x3e\r\n\t\x3c/td\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuItemLabel" colspan\x3d"2" data-dojo-attach-point\x3d"containerNode,labelNode,textDirNode"\x3e\x3c/td\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuItemAccelKey" style\x3d"display: none" data-dojo-attach-point\x3d"accelKeyNode"\x3e\x3c/td\x3e\r\n\t\x3ctd class\x3d"dijitReset dijitMenuArrowCell" role\x3d"presentation"\x3e\x26#160;\x3c/td\x3e\r\n\x3c/tr\x3e\r\n',
"url:dojox/grid/resources/_Grid.html":'\x3cdiv hidefocus\x3d"hidefocus" role\x3d"grid" dojoAttachEvent\x3d"onmouseout:_mouseOut"\x3e\r\n\t\x3cdiv class\x3d"dojoxGridMasterHeader" dojoAttachPoint\x3d"viewsHeaderNode" role\x3d"presentation"\x3e\x3c/div\x3e\r\n\t\x3cdiv class\x3d"dojoxGridMasterView" dojoAttachPoint\x3d"viewsNode" role\x3d"presentation"\x3e\x3c/div\x3e\r\n\t\x3cdiv class\x3d"dojoxGridMasterMessages" style\x3d"display: none;" dojoAttachPoint\x3d"messagesNode"\x3e\x3c/div\x3e\r\n\t\x3cspan dojoAttachPoint\x3d"lastFocusNode" tabindex\x3d"0"\x3e\x3c/span\x3e\r\n\x3c/div\x3e\r\n',
"url:esri/dijit/editing/templates/TemplatePicker.html":'\x3cdiv class\x3d"templatePicker"\x3e\r\n\r\n  \x3ctable dojoType\x3d"dojox.grid.DataGrid" noDataMessage\x3d"${emptyMessage}" selectionMode\x3d"none" autoHeight\x3d"${_rows}" autoWidth\x3d"${_autoWidth}"\r\n         query\x3d"{ query: \'*\' }" dojoAttachPoint\x3d"grid" class\x3d"grid"\x3e\r\n  \x3c/table\x3e\r\n  \r\n\x3c/div\x3e',"*now":function(t){t(['dojo/i18n!*preload*esri/dijit/editing/nls/TemplatePicker-all*["ar","az","ca","cs","da","de-de","el","en-gb","en-us","es-es","fi-fi","fr-fr","he-il","hu","it-it","ja-jp","ko-kr","nl-nl","nb","pl","pt-br","pt-pt","ro","ru","sk","sl","sv","th","tr","zh-tw","zh-cn","ROOT"]'])},
"*noref":1}});define("esri/dijit/editing/TemplatePicker-all",["../../layers/FeatureLayer","../../toolbars/draw","../../toolbars/edit","./TemplatePicker"],function(t,r,p,m){return{}});