// 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:{"dojo/DeferredList":function(){define(["./_base/kernel","./_base/Deferred","./_base/array"],function(q,m,n){q.DeferredList=function(l,f,e,k,c){var h=[];m.call(this);var b=this;0!==l.length||f||this.resolve([0,[]]);var a=0;n.forEach(l,function(d,c){function t(g,d){h[c]=[g,d];a++;a===l.length&&b.resolve(h)}d.then(function(a){f?b.resolve([c,a]):t(!0,a)},function(a){e?b.reject(a):t(!1,a);if(k)return null;throw a;})})};q.DeferredList.prototype=new m;q.DeferredList.prototype.gatherResults=
function(l){l=new q.DeferredList(l,!1,!0,!1);l.addCallback(function(f){var e=[];n.forEach(f,function(k){e.push(k[1])});return e});return l};return q.DeferredList})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t){function v(){}function g(a){return function(b,
g,d,c){return b&&"string"==typeof g&&b[g]==v?b.on(g.substring(2).toLowerCase(),k.hitch(d,c)):a.apply(n,arguments)}}q.around(n,"connect",g);e.connect&&q.around(e,"connect",g);q=l("dijit._Widget",[a,d,t],{onClick:v,onDblClick:v,onKeyDown:v,onKeyPress:v,onKeyUp:v,onMouseDown:v,onMouseMove:v,onMouseOut:v,onMouseOver:v,onMouseLeave:v,onMouseEnter:v,onMouseUp:v,constructor:function(a){this._toConnect={};for(var b in a)this[b]===v&&(this._toConnect[b.replace(/^on/,"").toLowerCase()]=a[b],delete a[b])},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)]===v?n.connect(this.domNode,a.toLowerCase(),this,b):this.inherited(arguments)},_setFocusedAttr:function(a){this._focused=a;this._set("focused",a)},setAttribute:function(a,b){e.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(){e.deprecated(this.declaredClass+"::getDescendants() is deprecated. Use getChildren() instead.","","2.0");return this.containerNode?c("[widgetId]",this.containerNode).map(b.byNode):[]},_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return!0}});f("dijit-legacy-requires")&&h(0,function(){require(["dijit/_base"])});return q})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A,y,B,x,w){function z(a){return function(b){c[b?"set":"remove"](this.domNode,a,b);this._set(a,b)}}t.add("dijit-legacy-requires",!v.isAsync);t.add("dojo-bidi",!1);t("dijit-legacy-requires")&&p(0,function(){q(["dijit/_base/manager"])});var E={};l=e("dijit._WidgetBase",[r,B],{id:"",_setIdAttr:"domNode",lang:"",_setLangAttr:z("lang"),dir:"",_setDirAttr:z("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:l.blankGif||q.toUrl("dojo/resources/blank.gif"),textDir:"",_introspect:function(){var a=this.constructor;if(!a._setterAttrs){var b=a.prototype,g=a._setterAttrs=[],a=a._onMap={},d;for(d in b.attributeMap)g.push(d);for(d in b)/^on/.test(d)&&(a[d.substring(2).toLowerCase()]=d),/^_set[A-Z](.*)Attr$/.test(d)&&(d=d.charAt(4).toLowerCase()+
d.substr(5,d.length-9),b.attributeMap&&d in b.attributeMap||g.push(d))}},postscript:function(a,b){this.create(a,b)},create:function(a,b){this._introspect();this.srcNodeRef=k.byId(b);this._connects=[];this._supportingWidgets=[];this.srcNodeRef&&this.srcNodeRef.id&&"string"==typeof this.srcNodeRef.id&&(this.id=this.srcNodeRef.id);a&&(this.params=a,g.mixin(this,a));this.postMixInProperties();this.id||(this.id=w.getUniqueId(this.declaredClass.replace(/\./g,"_")),this.params&&delete this.params.id);this.ownerDocument=
this.ownerDocument||(this.srcNodeRef?this.srcNodeRef.ownerDocument:document);this.ownerDocumentBody=y.body(this.ownerDocument);w.add(this);this.buildRendering();var d;if(this.domNode){this._applyAttributes();var c=this.srcNodeRef;c&&c.parentNode&&this.domNode!==c&&(c.parentNode.replaceChild(this.domNode,c),d=!0);this.domNode.setAttribute("widgetId",this.id)}this.postCreate();d&&delete this.srcNodeRef;this._created=!0},_applyAttributes:function(){var a={},b;for(b in this.params||{})a[b]=this._get(b);
m.forEach(this.constructor._setterAttrs,function(b){if(!(b in a)){var g=this._get(b);g&&this.set(b,g)}},this);for(b in a)this.set(b,a[b])},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(m.map(a,function(a){return a+"Rtl"})));h.add(this.domNode,a)}},postCreate:function(){},startup:function(){this._started||(this._started=
!0,m.forEach(this.getChildren(),function(a){a._started||a._destroyed||!g.isFunction(a.startup)||(a.startup(),a._started=!0)}))},destroyRecursive:function(a){this._beingDestroyed=!0;this.destroyDescendants(a);this.destroy(a)},destroy:function(a){function b(b){b.destroyRecursive?b.destroyRecursive(a):b.destroy&&b.destroy(a)}this._beingDestroyed=!0;this.uninitialize();m.forEach(this._connects,g.hitch(this,"disconnect"));m.forEach(this._supportingWidgets,b);this.domNode&&m.forEach(w.findWidgets(this.domNode,
this.containerNode),b);this.destroyRendering(a);w.remove(this.id);this._destroyed=!0},destroyRendering:function(a){this.bgIframe&&(this.bgIframe.destroy(a),delete this.bgIframe);this.domNode&&(a?c.remove(this.domNode,"widgetId"):b.destroy(this.domNode),delete this.domNode);this.srcNodeRef&&(a||b.destroy(this.srcNodeRef),delete this.srcNodeRef)},destroyDescendants:function(a){m.forEach(this.getChildren(),function(b){b.destroyRecursive&&b.destroyRecursive(a)})},uninitialize:function(){return!1},_setStyleAttr:function(a){var b=
this.domNode;g.isObject(a)?d.set(b,a):b.style.cssText=b.style.cssText?b.style.cssText+("; "+a):a;this._set("style",a)},_attrToDom:function(a,b,d){d=3<=arguments.length?d:this.attributeMap[a];m.forEach(g.isArray(d)?d:[d],function(d){var p=this[d.node||d||"domNode"];switch(d.type||"attribute"){case "attribute":g.isFunction(b)&&(b=g.hitch(this,b));d=d.attribute?d.attribute:/^on[A-Z][a-zA-Z]*$/.test(a)?a.toLowerCase():a;p.tagName?c.set(p,d,b):p.set(d,b);break;case "innerText":p.innerHTML="";p.appendChild(this.ownerDocument.createTextNode(b));
break;case "innerHTML":p.innerHTML=b;break;case "class":h.replace(p,b,this[a]);break;case "toggleClass":h.toggle(p,d.className||a,b)}},this)},get:function(a){var b=this._getAttrNames(a);return this[b.g]?this[b.g]():this._get(a)},set:function(a,b){if("object"===typeof a){for(var d in a)this.set(d,a[d]);return this}d=this._getAttrNames(a);var p=this[d.s];if(g.isFunction(p))var c=p.apply(this,Array.prototype.slice.call(arguments,1));else{var p=this.focusNode&&!g.isFunction(this.focusNode)?"focusNode":
"domNode",t=this[p]&&this[p].tagName,u;if((u=t)&&!(u=E[t])){u=this[p];var r={},e;for(e in u)r[e.toLowerCase()]=!0;u=E[t]=r}e=u;d=a in this.attributeMap?this.attributeMap[a]:d.s in this?this[d.s]:e&&d.l in e&&"function"!=typeof b||/^aria-|^data-|^role$/.test(a)?p:null;null!=d&&this._attrToDom(a,b,d);this._set(a,b)}return c||this},_attrPairNames:{},_getAttrNames:function(a){var b=this._attrPairNames;if(b[a])return b[a];var g=a.replace(/^[a-z]|-[a-zA-Z]/g,function(a){return a.charAt(a.length-1).toUpperCase()});
return b[a]={n:a+"Node",s:"_set"+g+"Attr",g:"_get"+g+"Attr",l:g.toLowerCase()}},_set:function(a,b){var g=this[a];this[a]=b;!this._created||g===b||g!==g&&b!==b||(this._watchCallbacks&&this._watchCallbacks(a,g,b),this.emit("attrmodified-"+a,{detail:{prevValue:g,newValue:b}}))},_get:function(a){return this[a]},emit:function(a,b,g){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 d,p=this["on"+a];p&&(d=p.apply(this,g?
g:[b]));this._started&&!this._beingDestroyed&&u.emit(this.domNode,a.toLowerCase(),b);return d},on:function(a,b){var g=this._onMap(a);return g?n.after(this,g,b,!0):this.own(u(this.domNode,a,b))[0]},_onMap:function(a){var b=this.constructor,g=b._onMap;if(!g){var g=b._onMap={},d;for(d in b.prototype)/^on/.test(d)&&(g[d.replace(/^on/,"").toLowerCase()]=d)}return g["string"==typeof a&&a.toLowerCase()]},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getChildren:function(){return this.containerNode?
w.findWidgets(this.containerNode):[]},getParent:function(){return w.getEnclosingWidget(this.domNode.parentNode)},connect:function(a,b,g){return this.own(f.connect(a,b,this,g))[0]},disconnect:function(a){a.remove()},subscribe:function(a,b){return this.own(A.subscribe(a,g.hitch(this,b)))[0]},unsubscribe:function(a){a.remove()},isLeftToRight:function(){return this.dir?"ltr"==this.dir.toLowerCase():a.isBodyLtr(this.ownerDocument)},isFocusable:function(){return this.focus&&"none"!=d.get(this.domNode,"display")},
placeAt:function(a,g){var d=!a.tagName&&w.byId(a);!d||!d.addChild||g&&"number"!==typeof g?(d=d&&"domNode"in d?d.containerNode&&!/after|before|replace/.test(g||"")?d.containerNode:d.domNode:k.byId(a,this.ownerDocument),b.place(this.domNode,d,g),!this._started&&(this.getParent()||{})._started&&this.startup()):d.addChild(this,g);return this},defer:function(a,b){var d=setTimeout(g.hitch(this,function(){d&&(d=null,this._destroyed||g.hitch(this,a)())}),b||0);return{remove:function(){d&&(clearTimeout(d),
d=null);return null}}}});t("dojo-bidi")&&l.extend(x);return l})},"dijit/Destroyable":function(){define(["dojo/_base/array","dojo/aspect","dojo/_base/declare"],function(q,m,n){return n("dijit.Destroyable",null,{destroy:function(l){this._destroyed=!0},own:function(){var l=["destroyRecursive","destroy","remove"];q.forEach(arguments,function(f){function e(){c.remove();q.forEach(h,function(b){b.remove()})}var k,c=m.before(this,"destroy",function(b){f[k](b)}),h=[];f.then?(k="cancel",f.then(e,e)):q.forEach(l,
function(b){"function"===typeof f[b]&&(k||(k=b),h.push(m.after(f,b,e,!0)))})},this);return arguments}})})},"dijit/_OnDijitClickMixin":function(){define("dojo/on dojo/_base/array dojo/keys dojo/_base/declare dojo/has ./a11yclick".split(" "),function(q,m,n,l,f,e){q=l("dijit._OnDijitClickMixin",null,{connect:function(k,c,h){return this.inherited(arguments,[k,"ondijitclick"==c?e:c,h])}});q.a11yclick=e;return q})},"dijit/_FocusMixin":function(){define(["./focus","./_WidgetBase","dojo/_base/declare","dojo/_base/lang"],
function(q,m,n,l){l.extend(m,{focused:!1,onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus()},_onBlur:function(){this.onBlur()}});return n("dijit._FocusMixin",null,{_focusManager:q})})},"dijit/hccss":function(){define(["dojo/dom-class","dojo/hccss","dojo/domReady","dojo/_base/window"],function(q,m,n,l){n(function(){m("highcontrast")&&q.add(l.body(),"dijit_a11y")});return m})},"dojo/hccss":function(){define("require ./_base/config ./dom-class ./dom-style ./has ./domReady ./_base/window".split(" "),
function(q,m,n,l,f,e,k){f.add("highcontrast",function(){var c=k.doc.createElement("div");try{c.style.cssText='border: 1px solid; border-color:red green; position: absolute; height: 5px; top: -999px;background-image: url("'+(m.blankGif||q.toUrl("./resources/blank.gif"))+'");';k.body().appendChild(c);var e=l.getComputedStyle(c),b=e.backgroundImage;return e.borderTopColor==e.borderRightColor||b&&("none"==b||"url(invalid-url:)"==b)}catch(a){return console.warn("hccss: exception detecting high-contrast mode, document is likely hidden: "+
a.toString()),!1}finally{8>=f("ie")?c.outerHTML="":k.body().removeChild(c)}});e(function(){f("highcontrast")&&n.add(k.body(),"dj_a11y")});return f})},"dijit/_Templated":function(){define("./_WidgetBase ./_TemplatedMixin ./_WidgetsInTemplateMixin dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/_base/kernel".split(" "),function(q,m,n,l,f,e,k){e.extend(q,{waiRole:"",waiState:""});return f("dijit._Templated",[m,n],{constructor:function(){k.deprecated(this.declaredClass+": dijit._Templated deprecated, use dijit._TemplatedMixin and if necessary dijit._WidgetsInTemplateMixin",
"","2.0")},_processNode:function(c,e){var b=this.inherited(arguments),a=e(c,"waiRole");a&&c.setAttribute("role",a);(a=e(c,"waiState"))&&l.forEach(a.split(/\s*,\s*/),function(a){-1!=a.indexOf("-")&&(a=a.split("-"),c.setAttribute("aria-"+a[0],a[1]))});return b}})})},"dijit/_TemplatedMixin":function(){define("dojo/cache dojo/_base/declare dojo/dom-construct dojo/_base/lang dojo/on dojo/sniff dojo/string ./_AttachMixin".split(" "),function(q,m,n,l,f,e,k,c){var h=m("dijit._TemplatedMixin",c,{templateString:null,
templatePath:null,_skipNodeCache:!1,searchContainerNode:!0,_stringRepl:function(b){var a=this.declaredClass,d=this;return k.substitute(b,this,function(b,c){"!"==c.charAt(0)&&(b=l.getObject(c.substr(1),!1,d));if("undefined"==typeof b)throw Error(a+" template:"+c);return null==b?"":"!"==c.charAt(0)?b:this._escapeValue(""+b)},this)},_escapeValue:function(b){return b.replace(/["'<>&]/g,function(a){return{"\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;",'"':"\x26quot;","'":"\x26#x27;"}[a]})},buildRendering:function(){if(!this._rendered){this.templateString||
(this.templateString=q(this.templatePath,{sanitize:!0}));var b=h.getCachedTemplate(this.templateString,this._skipNodeCache,this.ownerDocument),a;if(l.isString(b)){if(a=n.toDom(this._stringRepl(b),this.ownerDocument),1!=a.nodeType)throw Error("Invalid template: "+b);}else a=b.cloneNode(!0);this.domNode=a}this.inherited(arguments);this._rendered||this._fillContent(this.srcNodeRef);this._rendered=!0},_fillContent:function(b){var a=this.containerNode;if(b&&a)for(;b.hasChildNodes();)a.appendChild(b.firstChild)}});
h._templateCache={};h.getCachedTemplate=function(b,a,d){var c=h._templateCache,e=b,g=c[e];if(g){try{if(!g.ownerDocument||g.ownerDocument==(d||document))return g}catch(u){}n.destroy(g)}b=k.trim(b);if(a||b.match(/\$\{([^\}]+)\}/g))return c[e]=b;a=n.toDom(b,d);if(1!=a.nodeType)throw Error("Invalid template: "+b);return c[e]=a};e("ie")&&f(window,"unload",function(){var b=h._templateCache,a;for(a in b){var d=b[a];"object"==typeof d&&n.destroy(d);delete b[a]}});return h})},"dojo/cache":function(){define(["./_base/kernel",
"./text"],function(q){return q.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(q,m,n,l,f,e,k,c,h){var b=f.delegate(c,{mouseenter:e.enter,mouseleave:e.leave,keypress:n._keypress}),a;n=l("dijit._AttachMixin",null,{constructor:function(){this._attachPoints=[];this._attachEvents=[]},buildRendering:function(){this.inherited(arguments);this._attachTemplateNodes(this.domNode);
this._beforeFillContent()},_beforeFillContent:function(){},_attachTemplateNodes:function(a){for(var b=a;;)if(1==b.nodeType&&(this._processTemplateNode(b,function(a,b){return a.getAttribute(b)},this._attach)||this.searchContainerNode)&&b.firstChild)b=b.firstChild;else{if(b==a)break;for(;!b.nextSibling;)if(b=b.parentNode,b==a)return;b=b.nextSibling}},_processTemplateNode:function(a,b,c){var g=!0,d=this.attachScope||this,p=b(a,"dojoAttachPoint")||b(a,"data-dojo-attach-point");if(p)for(var e=p.split(/\s*,\s*/);p=
e.shift();)f.isArray(d[p])?d[p].push(a):d[p]=a,g="containerNode"!=p,this._attachPoints.push(p);if(b=b(a,"dojoAttachEvent")||b(a,"data-dojo-attach-event"))for(p=b.split(/\s*,\s*/),e=f.trim;b=p.shift();)if(b){var t=null;-1!=b.indexOf(":")?(t=b.split(":"),b=e(t[0]),t=e(t[1])):b=e(b);t||(t=b);this._attachEvents.push(c(a,b,f.hitch(d,t)))}return g},_attach:function(d,c,e){c=c.replace(/^on/,"").toLowerCase();c="dijitclick"==c?a||(a=q("./a11yclick")):b[c]||c;return k(d,c,e)},_detachTemplateNodes:function(){var a=
this.attachScope||this;m.forEach(this._attachPoints,function(b){delete a[b]});this._attachPoints=[];m.forEach(this._attachEvents,function(a){a.remove()});this._attachEvents=[]},destroyRendering:function(){this._detachTemplateNodes();this.inherited(arguments)}});f.extend(h,{dojoAttachEvent:"",dojoAttachPoint:""});return n})},"dijit/_WidgetsInTemplateMixin":function(){define(["dojo/_base/array","dojo/aspect","dojo/_base/declare","dojo/_base/lang","dojo/parser"],function(q,m,n,l,f){return n("dijit._WidgetsInTemplateMixin",
null,{_earlyTemplatedStartup:!1,contextRequire:null,_beforeFillContent:function(){if(/dojoType|data-dojo-type/i.test(this.domNode.innerHTML)){var e=this.domNode;this.containerNode&&!this.searchContainerNode&&(this.containerNode.stopParser=!0);f.parse(e,{noStart:!this._earlyTemplatedStartup,template:!0,inherited:{dir:this.dir,lang:this.lang,textDir:this.textDir},propsThis:this,contextRequire:this.contextRequire,scope:"dojo"}).then(l.hitch(this,function(e){this._startupWidgets=e;for(var c=0;c<e.length;c++)this._processTemplateNode(e[c],
function(c,b){return c[b]},function(c,b,a){return b in c?c.connect(c,b,a):c.on(b,a,!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(e,k,c){return k(e,"dojoType")||k(e,"data-dojo-type")?
!0:this.inherited(arguments)},startup:function(){q.forEach(this._startupWidgets,function(e){e&&!e._started&&e.startup&&e.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(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u){function p(a){return eval("("+a+")")}function r(a){var b=
a._nameCaseMap,g=a.prototype;if(!b||b._extendCnt<y){var b=a._nameCaseMap={},d;for(d in g)"_"!==d.charAt(0)&&(b[d.toLowerCase()]=d);b._extendCnt=y}return b}function A(a,b){b||(b=q);var g=b._dojoParserCtorMap||(b._dojoParserCtorMap={}),d=a.join();if(!g[d]){for(var c=[],p=0,u=a.length;p<u;p++){var e=a[p];c[c.length]=g[e]=g[e]||n.getObject(e)||~e.indexOf("/")&&b(e)}p=c.shift();g[d]=c.length?p.createSubclass?p.createSubclass(c):p.extend.apply(p,c):p}return g[d]}new Date("X");var y=0;h.after(n,"extend",
function(){y++},!0);var B={_clearCache:function(){y++;_ctorMap={}},_functionFromScript:function(a,b){var g="",d="",c=a.getAttribute(b+"args")||a.getAttribute("args"),p=a.getAttribute("with"),c=(c||"").split(/\s*,\s*/);p&&p.length&&l.forEach(p.split(/\s*,\s*/),function(a){g+="with("+a+"){";d+="}"});return new Function(c,g+a.innerHTML+d)},instantiate:function(a,b,g){b=b||{};g=g||{};var d=(g.scope||m._scopeName)+"Type",c="data-"+(g.scope||m._scopeName)+"-",p=c+"type",u=c+"mixins",e=[];l.forEach(a,function(a){var g=
d in b?b[d]:a.getAttribute(p)||a.getAttribute(d);if(g){var c=a.getAttribute(u),g=c?[g].concat(c.split(/\s*,\s*/)):[g];e.push({node:a,types:g})}});return this._instantiate(e,b,g)},_instantiate:function(a,g,d,c){function p(a){g._started||d.noStart||l.forEach(a,function(a){"function"!==typeof a.startup||a._started||a.startup()});return a}a=l.map(a,function(a){var b=a.ctor||A(a.types,d.contextRequire);if(!b)throw Error("Unable to resolve constructor for: '"+a.types.join()+"'");return this.construct(b,
a.node,g,d,a.scripts,a.inherited)},this);return c?b(a).then(p):p(a)},construct:function(b,d,u,e,k,f){function A(a){D&&n.setObject(D,a);for(q=0;q<O.length;q++)h[O[q].advice||"after"](a,O[q].method,n.hitch(a,O[q].func),!0);for(q=0;q<S.length;q++)S[q].call(a);for(q=0;q<L.length;q++)a.watch(L[q].prop,L[q].func);for(q=0;q<Q.length;q++)g(a,Q[q].event,Q[q].func);return a}var x=b&&b.prototype;e=e||{};var z={};e.defaults&&n.mixin(z,e.defaults);f&&n.mixin(z,f);var w;t("dom-attributes-explicit")?w=d.attributes:
t("dom-attributes-specified-flag")?w=l.filter(d.attributes,function(a){return a.specified}):(f=(/^input$|^img$/i.test(d.nodeName)?d:d.cloneNode(!1)).outerHTML.replace(/=[^\s"']+|="[^"]*"|='[^']*'/g,"").replace(/^\s*<[a-zA-Z0-9]*\s*/,"").replace(/\s*>.*$/,""),w=l.map(f.split(/\s+/),function(a){var b=a.toLowerCase();return{name:a,value:"LI"==d.nodeName&&"value"==a||"enctype"==b?d.getAttribute(b):d.getAttributeNode(b).value}}));var y=e.scope||m._scopeName;f="data-"+y+"-";var C={};"dojo"!==y&&(C[f+"props"]=
"data-dojo-props",C[f+"type"]="data-dojo-type",C[f+"mixins"]="data-dojo-mixins",C[y+"type"]="dojotype",C[f+"id"]="data-dojo-id");for(var q=0,B,y=[],D,E;B=w[q++];){var K=B.name,J=K.toLowerCase();B=B.value;switch(C[J]||J){case "data-dojo-type":case "dojotype":case "data-dojo-mixins":break;case "data-dojo-props":E=B;break;case "data-dojo-id":case "jsid":D=B;break;case "data-dojo-attach-point":case "dojoattachpoint":z.dojoAttachPoint=B;break;case "data-dojo-attach-event":case "dojoattachevent":z.dojoAttachEvent=
B;break;case "class":z["class"]=d.className;break;case "style":z.style=d.style&&d.style.cssText;break;default:if(K in x||(K=r(b)[J]||K),K in x)switch(typeof x[K]){case "string":z[K]=B;break;case "number":z[K]=B.length?Number(B):NaN;break;case "boolean":z[K]="false"!=B.toLowerCase();break;case "function":""===B||-1!=B.search(/[^\w\.]+/i)?z[K]=new Function(B):z[K]=n.getObject(B,!1)||new Function(B);y.push(K);break;default:J=x[K],z[K]=J&&"length"in J?B?B.split(/\s*,\s*/):[]:J instanceof Date?""==B?new Date(""):
"now"==B?new Date:a.fromISOString(B):J instanceof c?m.baseUrl+B:p(B)}else z[K]=B}}for(w=0;w<y.length;w++)C=y[w].toLowerCase(),d.removeAttribute(C),d[C]=null;if(E)try{E=p.call(e.propsThis,"{"+E+"}"),n.mixin(z,E)}catch(R){throw Error(R.toString()+" in data-dojo-props\x3d'"+E+"'");}n.mixin(z,u);k||(k=b&&(b._noScript||x._noScript)?[]:v("\x3e script[type^\x3d'dojo/']",d));var O=[],S=[],L=[],Q=[];if(k)for(q=0;q<k.length;q++)C=k[q],d.removeChild(C),u=C.getAttribute(f+"event")||C.getAttribute("event"),e=
C.getAttribute(f+"prop"),E=C.getAttribute(f+"method"),y=C.getAttribute(f+"advice"),w=C.getAttribute("type"),C=this._functionFromScript(C,f),u?"dojo/connect"==w?O.push({method:u,func:C}):"dojo/on"==w?Q.push({event:u,func:C}):z[u]=C:"dojo/aspect"==w?O.push({method:E,advice:y,func:C}):"dojo/watch"==w?L.push({prop:e,func:C}):S.push(C);b=(k=b.markupFactory||x.markupFactory)?k(z,d,b):new b(z,d);return b.then?b.then(A):A(b)},scan:function(a,b){function g(a){if(!a.inherited){a.inherited={};var b=a.node,d=
g(a.parent),b={dir:b.getAttribute("dir")||d.dir,lang:b.getAttribute("lang")||d.lang,textDir:b.getAttribute(h)||d.textDir},c;for(c in b)b[c]&&(a.inherited[c]=b[c])}return a.inherited}var c=[],p=[],u={},e=(b.scope||m._scopeName)+"Type",r="data-"+(b.scope||m._scopeName)+"-",v=r+"type",h=r+"textdir",r=r+"mixins",k=a.firstChild,f=b.inherited;if(!f){var x=function(a,b){return a.getAttribute&&a.getAttribute(b)||a.parentNode&&x(a.parentNode,b)},f={dir:x(a,"dir"),lang:x(a,"lang"),textDir:x(a,h)},w;for(w in f)f[w]||
delete f[w]}for(var f={inherited:f},y,n;;)if(k)if(1!=k.nodeType)k=k.nextSibling;else if(y&&"script"==k.nodeName.toLowerCase())(B=k.getAttribute("type"))&&/^dojo\/\w/i.test(B)&&y.push(k),k=k.nextSibling;else if(n)k=k.nextSibling;else{var B=k.getAttribute(v)||k.getAttribute(e);w=k.firstChild;if(B||w&&(3!=w.nodeType||w.nextSibling)){n=null;if(B){var J=k.getAttribute(r);y=J?[B].concat(J.split(/\s*,\s*/)):[B];try{n=A(y,b.contextRequire)}catch(S){}n||l.forEach(y,function(a){~a.indexOf("/")&&!u[a]&&(u[a]=
!0,p[p.length]=a)});J=n&&!n.prototype._noScript?[]:null;f={types:y,ctor:n,parent:f,node:k,scripts:J};f.inherited=g(f);c.push(f)}else f={node:k,scripts:y,parent:f};y=J;n=k.stopParser||n&&n.prototype.stopParser&&!b.template;k=w}else k=k.nextSibling}else{if(!f||!f.node)break;k=f.node.nextSibling;n=!1;f=f.parent;y=f.scripts}var O=new d;p.length?(t("dojo-debug-messages")&&console.warn("WARNING: Modules being Auto-Required: "+p.join(", ")),(b.contextRequire||q)(p,function(){O.resolve(l.filter(c,function(a){if(!a.ctor)try{a.ctor=
A(a.types,b.contextRequire)}catch(R){}for(var g=a.parent;g&&!g.types;)g=g.parent;var d=a.ctor&&a.ctor.prototype;a.instantiateChildren=!(d&&d.stopParser&&!b.template);a.instantiate=!g||g.instantiate&&g.instantiateChildren;return a.instantiate}))})):O.resolve(c);return O.promise},_require:function(a,b){var g=p("{"+a.innerHTML+"}"),c=[],u=[],e=new d,r=b&&b.contextRequire||q,t;for(t in g)c.push(t),u.push(g[t]);r(u,function(){for(var a=0;a<c.length;a++)n.setObject(c[a],arguments[a]);e.resolve(arguments)});
return e.promise},_scanAmd:function(a,b){var g=new d,c=g.promise;g.resolve(!0);var p=this;v("script[type\x3d'dojo/require']",a).forEach(function(a){c=c.then(function(){return p._require(a,b)});a.parentNode.removeChild(a)});return c},parse:function(a,b){!a||"string"==typeof a||"nodeType"in a||(b=a,a=b.rootNode);var g=a?e.byId(a):k.body();b=b||{};var d=b.template?{template:!0}:{},c=[],p=this,u=this._scanAmd(g,b).then(function(){return p.scan(g,b)}).then(function(a){return p._instantiate(a,d,b,!0)}).then(function(a){return c=
c.concat(a)}).otherwise(function(a){console.error("dojo/parser::parse() error",a);throw a;});n.mixin(c,u);return c}};m.parser=B;f.parseOnLoad&&u(100,B,"parse");return B})},"dojo/date/stamp":function(){define(["../_base/lang","../_base/array"],function(q,m){var n={};q.setObject("dojo.date.stamp",n);n.fromISOString=function(l,f){n._isoRegExp||(n._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/);var e=n._isoRegExp.exec(l),k=null;
if(e){e.shift();e[1]&&e[1]--;e[6]&&(e[6]*=1E3);f&&(f=new Date(f),m.forEach(m.map("FullYear Month Date Hours Minutes Seconds Milliseconds".split(" "),function(b){return f["get"+b]()}),function(b,a){e[a]=e[a]||b}));k=new Date(e[0]||1970,e[1]||0,e[2]||1,e[3]||0,e[4]||0,e[5]||0,e[6]||0);100>e[0]&&k.setFullYear(e[0]||1970);var c=0,h=e[7]&&e[7].charAt(0);"Z"!=h&&(c=60*(e[8]||0)+(Number(e[9])||0),"-"!=h&&(c*=-1));h&&(c-=k.getTimezoneOffset());c&&k.setTime(k.getTime()+6E4*c)}return k};n.toISOString=function(l,
f){var e=function(a){return 10>a?"0"+a:a};f=f||{};var k=[],c=f.zulu?"getUTC":"get",h="";"time"!=f.selector&&(h=l[c+"FullYear"](),h=["0000".substr((h+"").length)+h,e(l[c+"Month"]()+1),e(l[c+"Date"]())].join("-"));k.push(h);if("date"!=f.selector){h=[e(l[c+"Hours"]()),e(l[c+"Minutes"]()),e(l[c+"Seconds"]())].join(":");c=l[c+"Milliseconds"]();f.milliseconds&&(h+="."+(100>c?"0":"")+e(c));if(f.zulu)h+="Z";else if("time"!=f.selector)var c=l.getTimezoneOffset(),b=Math.abs(c),h=h+((0<c?"-":"+")+e(Math.floor(b/
60))+":"+e(b%60));k.push(h)}return k.join("T")};return n})},"esri/undoManager":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dojo/when ./kernel ./Evented dojo/has!extend-esri?./OperationBase".split(" "),function(q,m,n,l,f,e){q=q([e],{declaredClass:"esri.UndoManager",maxOperations:10,canUndo:!1,canRedo:!1,position:0,length:0,onUndo:function(){},onRedo:function(){},onUndoComplete:function(){},onRedoComplete:function(){},onAdd:function(){},onChange:function(){},constructor:function(e){e=
e||{};e.maxOperations&&(this.maxOperations=e.maxOperations);this._historyStack=[]},add:function(e){if(0<this.maxOperations)for(;this._historyStack.length>=this.maxOperations;)this._historyStack.shift();this._historyStack.splice(this.position,0,e);this.position++;this.clearRedo();this.onAdd();this._checkAvailability()},undo:function(){if(0===this.position)return null;var e=this.peekUndo();this.position--;e?(e=e.performUndo(),this.onUndo(),this._checkAvailability(),l(e).then(m.hitch(this,this.onUndoComplete))):
(this.onUndo(),this._checkAvailability())},redo:function(){if(this.position===this._historyStack.length)return null;var e=this.peekRedo();this.position++;e?(e=e.performRedo(),this.onRedo(),this._checkAvailability(),l(e).then(m.hitch(this,this.onRedoComplete))):(this.onRedo(),this._checkAvailability())},_checkAvailability:function(){this.length=this._historyStack.length;0===this.length?this.canUndo=this.canRedo=!1:0===this.position?(this.canRedo=!0,this.canUndo=!1):this.position===this.length?(this.canUndo=
!0,this.canRedo=!1):this.canRedo=this.canUndo=!0;this.onChange()},clearUndo:function(){this._historyStack.splice(0,this.position);this.position=0;this._checkAvailability()},clearRedo:function(){this._historyStack.splice(this.position,this._historyStack.length-this.position);this.position=this._historyStack.length;this._checkAvailability()},peekUndo:function(){if(0<this._historyStack.length&&0<this.position)return this.get(this.position-1)},peekRedo:function(){if(0<this._historyStack.length&&this.position<
this._historyStack.length)return this.get(this.position)},get:function(e){return this._historyStack[e]},remove:function(e){0<this._historyStack.length&&(this._historyStack.splice(e,1),0<this.position&&e<this.position&&this.position--,this._checkAvailability())},destroy:function(){this._historyStack=null}});n("extend-esri")&&(f.UndoManager=q);return q})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A,y,B,x,w,z,E,C,D,F,G,I,N,M,P,U,V,W,T,K,J,O,S,L,Q,R,ba,X,Y,ca,da,Z,aa,ea,fa){var ga=A.defaults,H=n(J,{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(a,b){this._preventInit||this._initFeatureLayer(a,b)},_initFeatureLayer:function(a,b){this.i18n=fa;b=b||{};this._featureReduction=
this._featureReduction||b.featureReduction;this._featureReductionEnabled=null!=b.featureReductionEnabled?b.featureReductionEnabled:!0;this.showLabels=null!=b.showLabels?b.showLabels:!0;this._outFields=b.outFields;this._defnExpr=b.definitionExpression;this._loadCallback=b.loadCallback;this._trackIdField=b.trackIdField;this.objectIdField=b.objectIdField;this._maxOffset=null!=b.maxAllowableOffset?b.maxAllowableOffset:this.maxAllowableOffset;this.quantize=null!=b.quantize?b.quantize:!0;this._optEditable=
b.editable;this._optAutoGen=b.autoGeneralize;this.editSummaryCallback=b.editSummaryCallback;this.userId=b.userId;this.userIsAdmin=b.userIsAdmin;this.useMapTime=b.hasOwnProperty("useMapTime")?!!b.useMapTime:!0;this.source=b.source;this.gdbVersion=b.gdbVersion;this.orderByFields=b.orderByFields;this.maxPointCountForAuto=null!=b.maxPointCountForAuto?b.maxPointCountForAuto:this.maxPointCountForAuto;this.maxRecordCountForAuto=null!=b.maxRecordCountForAuto?b.maxRecordCountForAuto:this.maxRecordCountForAuto;
this.maxVertexCountForAuto=null!=b.maxVertexCountForAuto?b.maxVertexCountForAuto:this.maxVertexCountForAuto;this.generalizeForScale=null!=b.generalizeForScale?b.generalizeForScale:this.generalizeForScale;this.queryPagination=this._optQueryPagination=null!=b.queryPagination?b.queryPagination:!0;this.multipatchOption=b.multipatchOption;this._selectedFeatures={};this._selectedFeaturesArr=[];this._newFeatures=[];this._deletedFeatures={};this._ulid=this._getUniqueId();var g=p.isDefined(b.mode)?b.mode:
H.MODE_ONDEMAND;this._isStream&&(g=H.MODE_STREAM);this.mode=g;switch(g){case H.MODE_SNAPSHOT:this.currentMode=H.MODE_SNAPSHOT;this._mode=new X(this);break;case H.MODE_ONDEMAND:case H.MODE_AUTO:this.currentMode=H.MODE_ONDEMAND;this._tileWidth=b.tileWidth||512;this._tileHeight=b.tileHeight||512;this._mode=new Y(this);this.latticeTiling=b.latticeTiling;break;case H.MODE_SELECTION:this.currentMode=H.MODE_SELECTION;this._mode=new ca(this);this._isSelOnly=!0;break;case H.MODE_STREAM:this.currentMode=H.MODE_STREAM,
this._mode=new da(this),this._isStream=!0}this._initLayer=f.hitch(this,this._initLayer);this._selectHandler=f.hitch(this,this._selectHandler);this._editable=!1;if(f.isObject(a)&&a.layerDefinition)return this._collection=!0,this.mode=this._isStream?H.MODE_STREAM:H.MODE_SNAPSHOT,this._isStream||this._outFields||(this._outFields=["*"]),this._initLayer(a),this;this._task=new N(this.url,{source:this.source,gdbVersion:this.gdbVersion});g=this._url.path;this._fserver=!1;-1!==g.search(/\/FeatureServer\//i)&&
(this._fserver=!0);this.mode===H.MODE_AUTO&&this.reHostedFS.test(this.url)&&this._queryLimit();var d=b.resourceInfo;d?this._initLayer(d):(this.source&&(d={source:this.source.toJson()},this._url.query=f.mixin(this._url.query,{layer:k.toJson(d)})),this.gdbVersion&&(this._url.query=f.mixin(this._url.query,{gdbVersion:this.gdbVersion})),r({url:g,content:f.mixin({f:"json"},this._url.query),callbackParamName:"callback",load:this._initLayer,error:this._errorHandler}));this.registerConnectEvents()},_initLayer:function(a,
g){if(a||g){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=H.MODE_SNAPSHOT,this._mode=new X(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 d=this.capabilities=a.capabilities;d&&-1!==d.toLowerCase().indexOf("editing")?this._editable=!0:this._editable=!1}else this._collection||(this._editable=this._fserver);p.isDefined(this._optEditable)?(this._editable=this._optEditable,delete this._optEditable):"esriGeometryMultiPatch"===
this.geometryType&&(this._editable=!1);this._json=k.toJson(this._json);this.isEditable()?this._setMaxOffset(null):this.mode===H.MODE_SNAPSHOT||"esriGeometryPolyline"!==this.geometryType&&"esriGeometryPolygon"!==this.geometryType&&!this.hasXYFootprint()||(this._autoGeneralize=p.isDefined(this._optAutoGen)?this._optAutoGen:this.mode===H.MODE_ONDEMAND||this.mode===H.MODE_AUTO,delete this._optAutoGen);var d=a.effectiveMinScale||a.minScale,c=a.effectiveMaxScale||a.maxScale;!this._hasMin&&d&&this.setMinScale(d);
!this._hasMax&&c&&this.setMaxScale(c);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 x(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=p.isDefined(a.allowGeometryUpdates)?a.allowGeometryUpdates:!0;this.allowUpdateWithoutMValues=!!a.allowUpdateWithoutMValues;this.enableZDefaults=!!a.enableZDefaults;this.zDefault=p.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 u=this.fields=[],c=a.fields,d=0;d<c.length;d++)u.push(new O(c[d]));if(!this.objectIdField){this.objectIdField=a.objectIdField;if(!this.objectIdField)for(c=a.fields,d=0;d<c.length;d++)if(u=c[d],"esriFieldTypeOID"===u.type){this.objectIdField=u.name;break}this.objectIdField||this._isStream||console.debug("esri.layers.FeatureLayer: "+p.substitute({url:this.url},"objectIdField is not set [url: ${url}]"))}if(!p.isDefined(this._nextId)){c=
this.objectIdField;u=-1;if(this._collection&&c)for(var r=(d=this._featureSet)&&d.features,t=r?r.length:0,v,d=0;d<t;d++)v=(v=r[d].attributes)&&v[c],v>u&&(u=v);this._nextId=u+1}this.globalIdField=a.globalIdField;if(d=this.typeIdField=a.typeIdField)if(d=!this._getField(d)&&this._getField(d,!0))this.typeIdField=d.name;this.visibilityField=a.visibilityField;if(c=a.defaultSymbol)this.defaultSymbol=C.fromJson(c);var h=this.types=[],A=a.types,l,y,u=(d=this.editFieldsInfo)&&d.creatorField,r=d&&d.editorField;
v=u||r;t=[];if(A)for(d=0;d<A.length;d++)l=new L(A[d]),y=l.templates,v&&y&&y.length&&(t=t.concat(y)),h.push(l);A=a.templates;l=this.templates=[];if(A)for(d=0;d<A.length;d++)h=new Q(A[d]),v&&t.push(h),l.push(h);for(d=0;d<t.length;d++)if(v=f.getObject("prototype.attributes",!1,t[d]))u&&delete v[u],r&&delete v[r];if(d=a.timeInfo)this.timeInfo=new S(d),this._startTimeField=d.startTimeField,this._endTimeField=d.endTimeField,this._startTimeField&&this._endTimeField&&(this._twoTimeFields=!0),this._trackIdField?
d.trackIdField=this._trackIdField:this._trackIdField=d.trackIdField;this.hasAttachments=!this._collection&&a.hasAttachments?!0:!1;this.htmlPopupType=a.htmlPopupType;var d=a.drawingInfo,m;(u=d&&d.labelingInfo)&&!this.labelingInfo&&(this.labelingInfo=e.map(u,function(a){return new ba(a)}),this._fixLabelExpr());if(!this.renderer)if(d&&d.renderer){if(m=d.renderer,this.setRenderer(G.fromJson(m)),"classBreaks"===m.type&&this.renderer.setMaxInclusive(!0),!this._collection){var n=m.type,c=[];m=this.renderer;
switch(n){case "simple":c.push(m.symbol);break;case "uniqueValue":case "classBreaks":c.push(m.defaultSymbol),c=c.concat(e.map(m.infos,function(a){return a.symbol}))}var c=e.filter(c,p.isDefined),N=this._url.path+"/images/",q=this._getToken();e.forEach(c,function(a){var b=a.url;b&&(-1===b.search(/https?\:/)&&-1===b.indexOf("data:")&&(a.url=N+b),q&&-1!==a.url.search(/https?\:/)&&(a.url+="?token\x3d"+q))})}}else if(c)A=this.types,0<A.length?(m=new F(this.defaultSymbol,this.typeIdField),e.forEach(A,function(a){m.addValue(a.id,
a.symbol)})):m=new D(this.defaultSymbol),this.setRenderer(m);else if(!this._isTable){switch(this.geometryType){case "esriGeometryPoint":case "esriGeometryMultipoint":n=new w;break;case "esriGeometryPolyline":n=new z;break;case "esriGeometryPolygon":n=new E;break;default:this.hasXYFootprint()&&(n=new E)}this.setRenderer(n?new D(n):null)}n=d&&d.transparency||0;!this.hasOwnProperty("opacity")&&0<n&&(this.opacity=1-n/100);(b("ie")||7<=b("trident")||b("safari"))&&this.isEditable()&&10.02>this.version&&
(this._ts=!0);this.statistics=a.statistics;this._fixRendererFields();this._updateRequiredFieldsFromLabelingInfo();this._checkFields();this._updateCaps();var M=function(){null==this._maxOffset||this._isFractionalOffsetAllowed()||this._setMaxOffset(this._maxOffset);this.loaded=!0;this.setFeatureReduction(this.getFeatureReduction());this.currentMode!==H.MODE_SNAPSHOT&&(this.queryPagination=!1);this.onLoad(this);var a=this._loadCallback;a&&(delete this._loadCallback,a(this))},n=[];this._collection?(d=
this._featureSet,this._featureSet=null,this._mode._drawFeatures(new P(d)),this._fcAdded=!0):(n.push(this._forceIdentity()),this._limitPromise&&n.push(this._limitPromise));n.push(this._evalGeometryOperations());n.length?B(n).then(f.hitch(this,function(){M.call(this)})):M.call(this)}},setShowLabels:function(a){this.showLabels=a;this.onShowLabelsChange()},onShowLabelsChange:function(){},onRendererChange:function(a){this.inherited(arguments);var b=this._map;this._ager=!!(a&&a.observationAger&&a.observationRenderer);
a&&"colors"in a&&"blurRadius"in a&&"maxPixelIntensity"in a?"esriGeometryPoint"==this.geometryType&&!this._heatmapManager&&b&&(this._heatmapManager=new aa(this),this._heatmapManager.initialize(b)):this.renderer&&this.renderer.getRendererInfo?e.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&&b&&(a&&(a.latestObservationRenderer||a.trackRenderer)?this._trackManager||
(this._trackManager=new Z(this),this._trackManager.initialize(b),this._childLayer=this._trackManager.container,this._mode._applyTimeFilter()):this._trackManager&&!this._isStream&&(this._trackManager.destroy(),this._trackManager=null));if(a){var d=[],b=e.filter([a,a.observationRenderer,a.latestObservationRenderer,a.trackRenderer],p.isDefined),g=function(a){return null!=a&&"function"!=typeof a&&a};e.forEach(b,function(a){var b=g(a.attributeField),c=g(a.attributeField2);a=g(a.attributeField3);!1!==b&&
d.push(b);!1!==c&&d.push(c);!1!==a&&d.push(a)});this._requiredFields=d}else this._requiredFields=[];this.loaded&&(this._fixRendererFields(),this._checkFields(this._requiredFields),this._collection&&(this._typesDirty=!0))},setFeatureReduction:function(a){a&&(a=f.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=f.mixin({},a),b=this._clusterManager;if(b=b&&b.aggregationInfo)a.clusterRadius=b.clusterRadius,a.infoTemplate=b.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 b,
d=this._clusterManager?this._clusterManager.getClusterFields():null;a=a?a.toLowerCase():"";e.some(d,function(d){a===d.name.toLowerCase()&&(b=d);return!!b});return b},_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 b=this._map.spatialReference;return this._isFeatureReductionSupported(a)&&this._isReductionCompatibleRenderer(this.renderer)&&(b.isWebMercator()||4326===b.wkid)},_createClusterManager:function(a){a=new ea({layer:this,aggregationInfo:a});this._clusterHandles=[a.on("renderer-change",f.hitch(this,function(){this.onFeatureReductionRendererChange()}))];a.initialize(this._map);return a},_updateClusterManager:function(a){var b=this._clusterManager;
b&&b.setAggregationInfo(a)},_destroyClusterManager:function(a){e.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 b=
this._getRenderer();this._ager=!!(b&&b.observationAger&&b.observationRenderer);this._trackManager&&this._trackManager.container&&this._trackManager.container.setRenderer(b&&b.trackRenderer);a&&this._evalFeatureReduction()},_setMap:function(a){var b=this.inherited(arguments),d=this._mode,g=this;d&&a.loaded&&d.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=g._selectedFeatures[a&&a[g.objectIdField]])&&a.attr("data-selected","")});return b},_unsetMap:function(a){var b=this._mode;b&&(b.suspend(),b.destroy());this._destroyClusterManager(!1);this._trackManager&&(this._trackManager.destroy(),this._trackManager=null);l.disconnect(this._zoomConnect);l.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 e.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 b=this.getOutFields();return-1<e.indexOf(b,"*")||-1<e.indexOf(b,a.name)},getFieldLabel:function(a){var b=this.infoTemplate,b=b&&b.getFieldInfo&&b.getFieldInfo(a);a=f.isFunction(a)?null:this.getField(a);var d=b||a,g="";
d&&(g=b&&b.label||a&&a.alias||d.name||d.fieldName);return g},getDomain:function(a,b){var d,g,c=b&&b.feature,p=c&&this.typeIdField&&c.attributes&&c.attributes[this.typeIdField];null!=p&&e.some(this.types,function(b){return b.id==p?((d=b.domains&&b.domains[a])&&"inherited"===d.type&&(d=this._getLayerDomain(a),g=!0),!0):!1},this);g||d||(d=this._getLayerDomain(a));return d},_getLayerDomain:function(a){var b;e.some(this.fields,function(d){d.name===a&&(b=d.domain);return!!b});return b},getType:function(a){var b,
d=a&&this.typeIdField&&a.attributes&&a.attributes[this.typeIdField];e.some(this.types,function(a){a.id==d&&(b=a);return!!b});return b},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 b=this._editable;this._editable=a;this._updateCaps();if(b!==a)this.onCapabilitiesChange();return this},getEditCapabilities:function(a){var b={canCreate:!1,
canUpdate:!1,canDelete:!1,canUpdateGeometry:!1};if(!this.loaded||!this.isEditable())return b;var d=a&&a.feature;a=a&&a.userId||this.getUserId();var g=e.map(this.capabilities?this.capabilities.toLowerCase().split(","):[],f.trim),c=(b=-1<e.indexOf(g,"editing"))&&-1<e.indexOf(g,"create"),p=b&&-1<e.indexOf(g,"update"),g=b&&-1<e.indexOf(g,"delete"),u=this.ownershipBasedAccessControlForFeatures,r=this.editFieldsInfo,t=r&&r.creatorField,r=r&&r.realm,d=(d=d&&d.attributes)&&t?d[t]:void 0,v=!!this.userIsAdmin,
t=!u||v||!(!u.allowOthersToUpdate&&!u.allowUpdateToOthers),h=!u||v||!(!u.allowOthersToDelete&&!u.allowDeleteToOthers),k=!u||v||!u.hasOwnProperty("allowAnonymousToUpdate")||u.allowAnonymousToUpdate,u=!u||v||!u.hasOwnProperty("allowAnonymousToDelete")||u.allowAnonymousToDelete;a&&r&&(a=a+"@"+r);if(v||b&&!(c||p||g))c=p=g=!0;b={canCreate:c,canUpdate:p,canDelete:g,canUpdateGeometry:v||this.allowGeometryUpdates};a||(b.canUpdate=b.canUpdate&&k,b.canDelete=b.canDelete&&u);null===d?(b.canUpdate=b.canUpdate&&
t,b.canDelete=b.canDelete&&h):""!==d&&d&&a.toLowerCase()!==d.toLowerCase()&&(b.canUpdate=b.canUpdate&&t,b.canDelete=b.canDelete&&h);return b},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,b,d){d=p.isDefined(d)?d:(new Date).getTime();var g="";d=this.getEditInfo(a,b,d);(b=b&&b.callback||this.editSummaryCallback)&&
(d=b(a,d)||"");if(f.isString(d))g=d;else{if(d){a=d.action;b=d.userId;var c=d.timeValue,u=0;a&&u++;b&&u++;p.isDefined(c)&&u++;1<u&&(g=("edit"===a?"edit":"create")+(b?"User":"")+(p.isDefined(c)?d.displayPattern:""))}g=g&&p.substitute(d,this.i18n.layers.FeatureLayer[g])}return g},getEditInfo:function(a,b,d){if(this.loaded){d=p.isDefined(d)?d:(new Date).getTime();b=b&&b.action||"last";var g=this.editFieldsInfo,c=g&&g.creatorField,u=g&&g.creationDateField,e=g&&g.editorField,g=g&&g.editDateField,e=(a=a&&
a.attributes)&&e?a[e]:void 0,g=a&&g?a[g]:null,c=this._getEditData(a&&c?a[c]:void 0,a&&u?a[u]:null,d);d=this._getEditData(e,g,d);var r;switch(b){case "creation":r=c;break;case "edit":r=d;break;case "last":r=d||c}r&&(r.action=r===d?"edit":"creation");return r}},_getEditData:function(a,b,d){var g,c,u;p.isDefined(b)&&(c=d-b,u=0>c?"Full":6E4>c?"Seconds":12E4>c?"Minute":36E5>c?"Minutes":72E5>c?"Hour":864E5>c?"Hours":6048E5>c?"WeekDay":"Full");if(void 0!==a||u)g=g||{},g.userId=a,u&&(a=h.format,d=new Date(b),
g.minutes=Math.floor(c/6E4),g.hours=Math.floor(c/36E5),g.weekDay=a(d,{datePattern:"EEEE",selector:"date"}),g.formattedDate=a(d,{selector:"date"}),g.formattedTime=a(d,{selector:"time"}),g.displayPattern=u,g.timeValue=b);return g},isEditable:function(){return!(!this._editable&&!this.userIsAdmin)},isQueryable:function(){var a=e.map(this.capabilities?this.capabilities.toLowerCase().split(","):[],f.trim);return this._isStream||this.userIsAdmin||this._collection||-1!==e.indexOf(a,"query")||-1!==e.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,b){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()&&b||(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!==
e.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===H.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=f.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,b){this._timeOffset=a;this._timeOffsetUnits=b;var d=this._mode;d&&d.propertyChangeHandler(0);return this},setUseMapTime:function(a){this.useMapTime=a;this._toggleTime(!this.suspended);
(a=this._mode)&&a.propertyChangeHandler(0)},selectFeatures:function(a,b,d,g){b=b||H.SELECTION_NEW;this._hasPartialSelectedFeatures=!1;a=this._getShallowClone(a);var p=this._map,u,e=this,r=y._fixDfd(new c(y._dfdCanceller));a.outFields=this.getOutFields();a.returnGeometry=!0;a.multipatchOption=this.multipatchOption;p&&(a.outSpatialReference=new x(p.spatialReference.toJson()));if(!this._applyQueryFilters(a,!0))return u={features:[]},this._selectHandler(u,b,d,g,r),r;if(p=this._canDoClientSideQuery(a))r._pendingDfd=
v(this._doQuery(a,p)),r._pendingDfd.then(function(a){u={features:a};e._selectHandler(u,b,d,g,r)});else{if(this._collection)return this._resolve([Error("FeatureLayer::selectFeatures - "+this.invalidParams)],null,g,r,!0),r;if(this.loaded&&!this.isQueryable())return this._resolve([Error("Layer does not support query capability.")],null,g,r,!0),r;var t=this;this._ts&&(a._ts=(new Date).getTime());(r._pendingDfd=this._task.execute(a)).addCallbacks(function(a){t._selectHandler(a,b,d,g,r)},function(a){t._hasPartialSelectedFeatures=
!0;t._resolve([a],null,g,r,!0)})}return r},getSelectedFeatures:function(){var a=this._selectedFeatures,b=[],d;for(d in a)a.hasOwnProperty(d)&&b.push(a[d]);return b},clearSelection:function(a){var b=this._selectedFeatures,d=this._mode,g;for(g in b)b.hasOwnProperty(g)&&(this._unSelectFeatureIIf(g,d),d._removeFeatureIIf(g));this._selectedFeatures={};this._isSelOnly&&d._applyTimeFilter(!0);if(!a)this.onSelectionClear();return this},setSelectionSymbol:function(a){if(this._selectionSymbol=a){var b=this._selectedFeatures,
d;for(d in b)b.hasOwnProperty(d)&&b[d].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,b,d=this,g=function(a,b){var g=d._getField(b,!0);return"["+(g&&g.name||b)+"]"};e.forEach(this.labelingInfo,function(d){if(b=d.labelExpression)d.labelExpression=
b.replace(a,g)})},_updateRequiredFieldsFromLabelingInfo:function(){var a=[];e.forEach(this.labelingInfo,function(b){var d=b.labelExpressionInfo;if(b.labelExpression){var g=/[\[\]]/ig;b=b.labelExpression.match(/\[[^\[\]]+\]/ig);(b=e.map(b,function(a){return a.replace(g,"")}))&&(a=a.concat(b))}if(d){if(d.value){var c=/[\{\}]/ig;b=d.value.match(/\{[^\{\}]+\}/ig);(b=e.map(b,function(a){return a.replace(c,"")}))&&(a=a.concat(b))}d.expression&&(a=a.concat(I.extractFieldNames(d.expression)))}});a=e.map(a,
function(a){var b=this.getField(a);return b?b.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,b,d,g,c,p){var u=p.assembly,t=p.dfd;this._applyNormalized(a,u&&u[0]);this._applyNormalized(b,u&&u[1]);this.onBeforeApplyEdits(a,b,d);var v={},h=this.objectIdField,u={f:"json"},k=!1;if(this._collection)p={},p.addResults=a?e.map(a,function(){k=!0;return{objectId:this._nextId++,success:!0}},
this):null,p.updateResults=b?e.map(b,function(a){k=!0;var b=a.attributes[h];v[b]=a;return{objectId:b,success:!0}},this):null,p.deleteResults=d?e.map(d,function(a){k=!0;return{objectId:a.attributes[h],success:!0}},this):null,k?this._editHandler(p,a,v,g,c,t):this._resolve([p.addResults,p.updateResults,p.deleteResults],null,g,t);else{a&&0<a.length&&(u.adds=this._convertFeaturesToJson(a,0,1),k=!0);if(b&&0<b.length){for(p=0;p<b.length;p++){var A=b[p];v[A.attributes[h]]=A}u.updates=this._convertFeaturesToJson(b,
0,0,1);k=!0}if(d&&0<d.length){b=[];for(p=0;p<d.length;p++)b.push(d[p].attributes[h]);u.deletes=b.join(",");k=!0}if(k){var z=this;return r({url:this._url.path+"/applyEdits",content:f.mixin(u,this._url.query),callbackParamName:"callback",load:function(b){z._editHandler(b,a,v,g,c,t)},error:function(a){z._resolve([a],null,c,t,!0)}},{usePost:!0})}this._resolve([],null,g,t)}},queryFeatures:function(a,b,d){return this._query("execute","onQueryFeaturesComplete",a,b,d)},queryRelatedFeatures:function(a,b,d){return this._query("executeRelationshipQuery",
"onQueryRelatedFeaturesComplete",a,b,d)},queryIds:function(a,b,d){return this._query("executeForIds","onQueryIdsComplete",a,b,d)},queryCount:function(a,b,d){return this._query("executeForCount","onQueryCountComplete",a,b,d)},queryExtent:function(a,b,d){return this._query("executeForExtent","onQueryExtentComplete",a,b,d)},queryAttachmentInfos:function(b,d,g){var p=this._url.path+"/"+b+"/attachments",u=new c(y._dfdCanceller),t=this;u._pendingDfd=r({url:p,content:f.mixin({f:"json"},this._url.query),
callbackParamName:"callback",load:function(g){g=g.attachmentInfos;var c;e.forEach(g,function(d){c=a.objectToQuery({gdbVersion:t._url.query&&t._url.query.gdbVersion,layer:t._url.query&&t._url.query.layer,token:t._getToken()});d.url=p+"/"+d.id+(c?"?"+c:"");d.objectId=b});t._resolve([g],"onQueryAttachmentInfosComplete",d,u)},error:function(a){t._resolve([a],null,g,u,!0)}});return u},addAttachment:function(a,b,d,g){return this._sendAttachment("add",a,b,d,g)},updateAttachment:function(a,b,g,c,p){g.appendChild(d.create("input",
{type:"hidden",name:"attachmentId",value:b}));return this._sendAttachment("update",a,g,c,p)},deleteAttachments:function(a,b,d,g){var p=this._url.path+"/"+a+"/deleteAttachments",u=new c(y._dfdCanceller),t=this;b={f:"json",attachmentIds:b.join(",")};u._pendingDfd=r({url:p,content:f.mixin(b,this._url.query),callbackParamName:"callback",load:f.hitch(this,function(b){b=b.deleteAttachmentResults;b=e.map(b,function(b){b=new R(b);b.attachmentId=b.objectId;b.objectId=a;return b});t._resolve([b],"onDeleteAttachmentsComplete",
d,u)}),error:function(a){t._resolve([a],null,g,u,!0)}},{usePost:!0});return u},addType:function(a){var b=this.types;if(b){if(e.some(b,function(b){return b.id==a.id?!0:!1}))return!1;b.push(a)}else this.types=[a];return this._typesDirty=!0},deleteType:function(a){if(this._collection){var b=this.types;if(b){var d=-1;e.some(b,function(b,g){return b.id==a?(d=g,!0):!1});if(-1<d)return this._typesDirty=!0,b.splice(d,1)[0]}}},toJson:function(){var a=this._json;if(a=f.isString(a)?k.fromJson(a):f.clone(a)){var a=
a.layerDefinition?a:{layerDefinition:a},b=a.layerDefinition,d=this._collection;if(d&&this._typesDirty){b.types=e.map(this.types||[],function(a){return a.toJson()});var g=this.renderer,c=this.labelingInfo,p=b.drawingInfo;!g&&!c||p||(p=b.drawingInfo={});p&&g&&-1===g.declaredClass.indexOf("TemporalRenderer")&&(p.renderer=g.toJson());c&&(p.labelingInfo=e.map(c,function(a){return a.toJson()}))}g=null;if(!d||this._fcAdded)g={geometryType:b.geometryType,features:this._convertFeaturesToJson(this.graphics,
!0)};a.featureSet=f.mixin({},a.featureSet||{},g);a.featureSet.transform&&(c=a.featureSet.transform,delete a.featureSet.transform,g=new P(a.featureSet),g.quantize(c),a.featureSet=g.toJson());d&&(a.nextObjectId=this._nextId,b.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 c;setTimeout(f.hitch(this,
function(){this._isGeometryOperationsUsed()?I.enableGeometryOperations().always(function(){a.resolve()}):a.resolve()}),0);return a.promise},_isGeometryOperationsUsed:function(){var a=this.infoTemplate,b=this.renderer,d=this.labelingInfo;return a&&a.hasGeometryOperations&&a.hasGeometryOperations()||b&&b.hasGeometryOperations&&b.hasGeometryOperations()||e.some(d,function(a){return I.hasGeometryOperations(a.labelExpressionInfo&&a.labelExpressionInfo.expression)})?!0:!1},_forceIdentity:function(){var a=
new c,b=this,d,g=this._url&&this._url.path;d=g&&g.toLowerCase().indexOf("/rest/services");var p=this.editFieldsInfo,p=p&&(p.creatorField||p.editorField);(this.userIsAdmin||p)&&!this._getToken()&&-1<d&&u.id?(d=g.substring(0,d)+"/rest/info",r({url:d,content:{f:"json"},handleAs:"json",callbackParamName:"callback"}).then(function(a){if(a.owningSystemUrl)return u.id.checkSignInStatus(a.owningSystemUrl+"/sharing")}).then(function(a){if(a)return u.id.getCredential(g)}).then(function(a){a&&b._findCredential()}).always(function(){a.resolve()})):
a.resolve();return a.promise},_isSnapshotMode:function(){return this._mode?this._mode.isInstanceOf(X):!1},_checkMode:function(a){var b=this.geometryType,d=this.maxRecordCount;a=(a=a&&a.features&&a.features[0])&&a.attributes&&a.attributes.exceedslimit;this.mode===H.MODE_AUTO&&!this.isEditable()&&0===a&&(this.queryPagination||("esriGeometryPolyline"===b||"esriGeometryPolygon"===b||"esriGeometryMultipoint"===b||this.hasXYFootprint())&&d>=this.maxRecordCountForAuto||"esriGeometryPoint"===b&&d>=this.maxPointCountForAuto)&&
(this.currentMode=H.MODE_SNAPSHOT,this._mode=new X(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!==H.MODE_SNAPSHOT&&a!==H.MODE_STREAM&&a!==H.MODE_SELECTION&&(this._savedMode=this.mode,this._mode.suspend(),this._mode.destroy(),this.mode=this.currentMode=H.MODE_SNAPSHOT,this._mode=
new X(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=H.MODE_ONDEMAND;this._mode=new Y(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,b=new c;this._limitPromise=b.promise;this._limitPromise.then(function(b){a._checkMode(b)});this._limitPromise.always(function(){a._limitPromise=null});setTimeout(function(){var d=new M,g=new U;g.statisticType="exceedslimit";g.maxPointCount=a.maxPointCountForAuto;g.maxRecordCount=a.maxRecordCountForAuto;g.maxVertexCount=a.maxVertexCountForAuto;g.outStatisticFieldName="exceedslimit";d.outStatistics=[g];a.queryFeatures(d).promise.then(function(a){b.resolve(a)},
function(a){b.reject(a)})},0)},_updateCaps:function(){var a=this._editable,b=f.trim(this.capabilities||""),d=e.map(b?b.split(","):[],f.trim),g=e.map(b?b.toLowerCase().split(","):[],f.trim),b=e.indexOf(g,"editing"),c,g={Create:e.indexOf(g,"create"),Update:e.indexOf(g,"update"),Delete:e.indexOf(g,"delete")};if(a&&-1===b)d.push("Editing");else if(!a&&-1<b){a=[b];for(c in g)-1<g[c]&&a.push(g[c]);a.sort();for(c=a.length-1;0<=c;c--)d.splice(a[c],1)}this.capabilities=d.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 b=this._map,d=this._getRenderer();if(a.firstOccurrence){if(this._fixRendererFields(),this._updateRequiredFieldsFromLabelingInfo(),this._checkFields(),this.clearSelection(),this._evalFeatureReduction(),this.timeInfo&&!this._trackManager&&(this._trackIdField||d&&(d.latestObservationRenderer||d.trackRenderer))&&(this._trackManager=
new Z(this),this._trackManager.initialize(b),this._childLayer=this._trackManager.container),d&&"colors"in d&&"blurRadius"in d&&"maxPixelIntensity"in d&&"esriGeometryPoint"==this.geometryType&&!this._heatmapManager&&(this._heatmapManager=new aa(this),this._heatmapManager.initialize(b)),this._autoSnapshot&&this._autoGeneralize&&("esriGeometryPolyline"===this.geometryType||"esriGeometryPolygon"===this.geometryType||this.hasXYFootprint())&&!this.isEditable()&&null==this.getMaxAllowableOffset()&&(d=this.generalizeForScale,
this._calculatedScale=d=this.maxScale?this.maxScale:this.minScale?Math.min(d,this.minScale):Math.min(d,K.getScale(b,this.initialExtent)),this._calcMaxOffset=b.extent.getWidth()/b.width/b.getScale()*d),this._zoomConnect=l.connect(b,"onZoomEnd",this,this._zoomEndHandler),this._updateMaxOffset(),this._needsRefresh=!1,d=this._mode)d._init||d.initialize(b),d.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(),b=this._calculatedScale,
d=this._calcMaxOffset,g=this._prevScale;return a>=b&&(null==g||g<b)?d:a<b&&(null==g||g>=b)?null:this.getMaxAllowableOffset()}},_toggleTime:function(a){var b=this._map;a&&this.timeInfo&&this.useMapTime&&b?(this._mapTimeExtent=b.timeExtent,this._timeConnect||(this._timeConnect=l.connect(b,"onTimeExtentChange",this,this._timeChangeHandler))):(this._mapTimeExtent=null,l.disconnect(this._timeConnect),this._timeConnect=null)},_timeChangeHandler:function(a){this._mapTimeExtent=a;(a=this._mode)&&a.propertyChangeHandler(0)},
_getOffsettedTE:function(a){var b=this._timeOffset,d=this._timeOffsetUnits;return a&&b&&d?a.offset(-1*b,d):a},_getTimeOverlap:function(a,b){return a&&b?a.intersection(b):a||b},_getTimeFilter:function(a){var b=this.getTimeDefinition(),d;if(b&&(d=this._getTimeOverlap(b,null),!d))return[!1];if(a){if(a=d?this._getTimeOverlap(a,d):a,!a)return[!1]}else a=d;return[!0,a]},_getAttributeFilter:function(a){var b=this.getDefinitionExpression();return a?b?"("+b+") AND ("+a+")":a:b},_applyQueryFilters:function(a,
b){a.where=this._getAttributeFilter(a.where);a.returnGeometry&&null==a.maxAllowableOffset&&!a.quantizationParameters&&(a.maxAllowableOffset=this._maxOffset,a.quantizationParameters=this._quantizationParameters);b&&this.supportsAdvancedQueries&&(a.orderByFields=a.orderByFields||this.getOrderByFields());if(this.timeInfo){var d=this._getTimeFilter(a.timeExtent);if(d[0])a.timeExtent=d[1];else return!1}return!0},_add:function(a){var b=this._selectionSymbol,d=a.attributes,g=this.visibilityField;b&&this._isSelOnly&&
a.setSymbol(b);if(g&&d&&d.hasOwnProperty(g))a[d[g]?"show":"hide"]();return this.add.apply(this,arguments)},_remove:function(){return this.remove.apply(this,arguments)},_canDoClientSideQuery:function(a){var b=[],d=this._map,g;if((this._collection||!this._isTable&&d)&&!(a.text||a.where&&a.where!==this.getDefinitionExpression()||a.orderByFields&&a.orderByFields.length&&(g=this.getOrderByFields()||[])&&a.orderByFields.join()!==g.join()||a.outStatistics||a.returnDistinctValues)){g=this._isSnapshotMode();
var c=this._isSelOnly,p=a.geometry;if(p){if(c||a.spatialRelationship!==M.SPATIAL_REL_INTERSECTS||"extent"!==p.type||!g&&!d.extent.contains(p))return;b.push(1)}if(d=a.objectIds)if(g)b.push(2);else{var p=d.length,u=this._mode,r=0,t;for(t=0;t<p;t++)u._getFeature(d[t])&&r++;if(r===p)b.push(2);else return}if(this.timeInfo)if(a=a.timeExtent,d=this._mapTimeExtent,g)a&&b.push(3);else if(c){if(a)return}else if(d)if(-1!==e.indexOf(b,2))a&&b.push(3);else if(-1!==e.indexOf(b,1))a==d&&b.push(3);else return;else if(0<
b.length)a&&b.push(3);else if(a)return;return 0<b.length?b:null}},_getAbsMid:function(a){return q.toAbsMid?q.toAbsMid(a):m.id.replace(/\/[^\/]*$/ig,"/")+a},_doQuery:function(a,b,d){var g=[],p=this.objectIdField,u=this,r=new c,t=new c,v=this.graphics;if(-1!==e.indexOf(b,1)){var h=this.spatialIndex||this._map&&this._map.spatialIndex,k,A=a.geometry._normalize(null,!0);null==h&&ga.autoSpatialIndexing?k=(this._map||this).addPlugin(this._getAbsMid("../plugins/spatialIndex")).then(f.hitch(this,f.partial(this._getFromIndex,
A,h)),function(a){t.resolve(f.hitch(this,f.partial(this._filterByExtent,v,A)))}):h&&(k=this._getFromIndex(A,h));k?k.then(function(a){for(var b=0;b<a.length;b++)a[b].results&&(g=g.concat(a[b].results));t.resolve(g)}).otherwise(function(a){t.reject(a)}):t.resolve(this._filterByExtent(v,A))}else t.resolve(v);t.then(function(c){g=c;if(-1!==e.indexOf(b,2)){var t=a.objectIds;g=e.filter(g,function(a){return-1<e.indexOf(t,a.attributes[p])})}-1!==e.indexOf(b,3)&&u.timeInfo&&(c=a.timeExtent,g=u._filterByTime(g,
c.startTime,c.endTime).match);d&&(g=e.map(g,function(a){return a.attributes[p]},this));r.resolve(g)});return r},_getFromIndex:function(a,b){b=b||this.spatialIndex||this._map.spatialIndex;a instanceof Array||(a=[a]);var d=this.id;return g(e.map(a,function(a){return b.intersects(a,d)}))},_filterByExtent:function(a,b){for(var d=[],g=0,c=a.length;g<c;g++){var p=a[g],u=p.geometry;u&&(this.normalization&&b.length?(b[0].intersects(u)||b[1].intersects(u))&&d.push(p):b.intersects(u)&&d.push(p))}return d},
_filterByTime:function(a,b,d){var g=this._startTimeField,c=this._endTimeField,u;this._twoTimeFields||(u=g||c);var e=p.isDefined,t=[],r=[],v,h=a.length,k,f;b=b?b.getTime():-Infinity;d=d?d.getTime():Infinity;if(u)for(v=0;v<h;v++)k=a[v],f=k.attributes,g=f[u],g>=b&&g<=d?t.push(k):r.push(k);else for(v=0;v<h;v++)k=a[v],f=k.attributes,u=f[g],f=f[c],u=e(u)?u:-Infinity,f=e(f)?f:Infinity,u>=b&&u<=d||f>=b&&f<=d||b>=u&&d<=f?t.push(k):r.push(k);return{match:t,noMatch:r}},_getSizeVariables:function(a){return a&&
e.filter(a.getVisualVariablesForType("sizeInfo",!1),function(a){return!(!a.field&&!a.valueExpression)})},_needClientSideSorting:function(a){return this._collection?!(!a||!a.length):e.some(a,function(a){return!!a.valueExpression})},_sortFeatures:function(a){var b=this.renderer,d=this._getSizeVariables(b);if(a&&1<a.length&&this._needClientSideSorting(d)){var g=d[0],c=this;a.sort(function(a,d){a._layer||(a._layer=c);d._layer||(d._layer=c);var p=b._getDataValue(a,g,"sizeInfo",null,c),u=b._getDataValue(d,
g,"sizeInfo",null,c);return null==p?-1:null==u?1:u-p})}return a},_resolve:function(a,b,d,g,c){b&&this[b].apply(this,a);d&&d.apply(null,a);g&&y._resDfd(g,a,c)},_getShallowClone:function(a){var b=new M,d;for(d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);return b},_query:function(a,b,d,g,p){var u=this,t=this._map,r=new c(y._dfdCanceller),h=d,k,f,A;if("executeRelationshipQuery"!==a){var h=this._getShallowClone(d),z=this.getOutFields();h.outFields||(h.outFields=z);h.outFields&&h.outFields.length&&(f=-1<e.indexOf(z,
"*")?!1:!e.every(h.outFields,function(a){return-1<e.indexOf(z,a)}));h.returnGeometry=d.hasOwnProperty("returnGeometry")?d.returnGeometry:!d.outStatistics;h.returnGeometry&&(h.multipatchOption=this.multipatchOption,null!=h.maxAllowableOffset||h.quantizationParameters)&&(d=null!=h.maxAllowableOffset?h.maxAllowableOffset:h.quantizationParameters.tolerance,null!=d&&d!==this.getMaxAllowableOffset()&&(A=!0));var l;t&&(t=t&&t.spatialReference,(d=h.outSpatialReference)?k=!d.equals(t):h.outSpatialReference=
new x(t.toJson()));if(!this._applyQueryFilters(h,"execute"===a&&!h.outStatistics)){switch(a){case "execute":l=new P({features:[]});break;case "executeForIds":l=[];break;case "executeForCount":l=0;break;case "executeForExtent":l={}}this._resolve([l],b,g,r);return r}if(t="executeForExtent"!==a&&!k&&!f&&!A&&this._canDoClientSideQuery(h))return r._pendingDfd=v(this._doQuery(h,t,"executeForIds"===a||"executeForCount"===a)),r._pendingDfd.then(function(d){switch(a){case "execute":l=new P;l.features=d;break;
case "executeForIds":l=d;break;case "executeForCount":l=d.length}u._resolve([l],b,g,r)}),r}if(this._collection)return this._resolve([Error("FeatureLayer::_query - "+this.invalidParams)],null,p,r,!0),r;if(this.loaded&&!this.isQueryable())return this._resolve([Error("Layer does not support query capability.")],null,p,r,!0),r;this._ts&&(h._ts=(new Date).getTime());(r._pendingDfd=this._task[a](h)).addCallbacks(function(d){var c=!!h.outStatistics||k||f||A;if("execute"===a||"executeRelationshipQuery"===
a){var p,e;if("execute"===a)for(p=d.features,e=p.length,--e;0<=e;e--){if(p[e]._layer=u,!c&&!u._isTable){var t=u._mode._getFeature(p[e].attributes[u.objectIdField]);t&&p.splice(e,1,t)}}else for(t in d)if(d.hasOwnProperty(t))for(p=d[t].features,e=p.length,--e;0<=e;e--)p[e]._layer=u}u._resolve([d],b,g,r)},function(a){u._resolve([a],null,p,r,!0)});return r},_convertFeaturesToJson:function(a,b,d,g){var c=[],p=this._selectionSymbol,u=this.visibilityField,t,r=this.objectIdField;this.loaded&&(d||g)&&(t=e.filter(this.fields,
function(a){return!1===a.editable&&(!g||a.name!==r)}));for(d=0;d<a.length;d++){var v=a[d],h={},A=v.geometry,z=v.attributes,l=v.symbol;!A||g&&this.loaded&&!this.allowGeometryUpdates||(h.geometry=A.toJson());u?(h.attributes=z=f.mixin({},z),z[u]=v.visible?1:0):z&&(h.attributes=f.mixin({},z));h.attributes&&t&&t.length&&e.forEach(t,function(a){delete h.attributes[a.name]});l&&l!==p&&(h.symbol=l.toJson());c.push(h)}return b?c:k.toJson(c)},_selectHandler:function(a,b,d,g,c){var p;switch(b){case H.SELECTION_NEW:this.clearSelection(!0);
p=!0;break;case H.SELECTION_ADD:p=!0;break;case H.SELECTION_SUBTRACT:p=!1}g=a.features;var u=this._mode,e=[],t=this.objectIdField,r,v;if(p)for(p=0;p<g.length;p++)r=g[p],v=r.attributes[t],r=u._addFeatureIIf(v,r),e.push(r),this._selectFeatureIIf(v,r,u);else for(p=0;p<g.length;p++)r=g[p],v=r.attributes[t],this._unSelectFeatureIIf(v,u),v=u._removeFeatureIIf(v),e.push(v||r);this._isSelOnly&&u._applyTimeFilter(!0);this._hasPartialSelectedFeatures=!!a.exceededTransferLimit;this._resolve([e,b,a.exceededTransferLimit?
{queryLimitExceeded:!0}:null],"onSelectionComplete",d,c);if(a.exceededTransferLimit)this.onQueryLimitExceeded()},_selectFeatureIIf:function(a,b,d){var g=this._selectedFeatures,c=g[a];c||(d._incRefCount(a),g[a]=b,this._isTable||(this._setSelectSymbol(b),b.attr("data-selected","")));return c||b},_unSelectFeatureIIf:function(a,b){var d=this._selectedFeatures[a];d&&(b._decRefCount(a),delete this._selectedFeatures[a],this._isTable||(this._setUnSelectSymbol(d),d.attr("data-selected")));return d},_isSelected:function(a){},
_setSelectSymbol:function(a){var b=this._selectionSymbol;b&&!this._isSelOnly&&a.setSymbol(b)},_setUnSelectSymbol:function(a){var b=this._selectionSymbol;b&&!this._isSelOnly&&b===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=e.filter(a,function(a,b,d){return!!a&&e.indexOf(d,a)===b}),b=f.clone(this._outFields);
if(b){if(-1!==e.indexOf(b,"*"))return b;e.forEach(a,function(a){-1===e.indexOf(b,a)&&b.push(a)});return b}return a},_checkFields:function(a){var b=a||this._getOutFields();e.forEach(b,function(a){"*"!==a&&(this._getField(a)||console.debug("esri.layers.FeatureLayer: "+p.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||e.some(this.fields,function(a){return a&&
"esriFieldTypeGeometry"===a.type?!0:!1})||console.debug("esri.layers.FeatureLayer: "+p.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,b,d){var g=a&&a[b],c;if(g&&!f.isFunction(g)){if(c=!this._getField(g)&&this._getField(g,!0))g=a[b]=c.name;d&&d.push(g)}return g},_fixRendererFields:function(){var a=this.renderer;this._orderBy=
null;this._requiredFields=[];if(a&&0<this.fields.length){var b=[],d,a=e.filter([a,a.observationRenderer,a.latestObservationRenderer,a.trackRenderer],p.isDefined),g=[].concat(a);e.forEach(a,function(a){e.forEach(a.rendererInfos,function(a){a.renderer&&g.push(a.renderer)})});e.forEach(g,function(a){this._fixFieldCase(a,"attributeField",b);this._fixFieldCase(a,"attributeField2",b);this._fixFieldCase(a,"attributeField3",b);this._fixFieldCase(a.rotationInfo,"field",b);(d=this._fixFieldCase(a.sizeInfo,
"field",b))&&!this._orderBy&&(this._orderBy=[d+" DESC"]);this._fixFieldCase(a.sizeInfo,"normalizationField",b);this._fixFieldCase(a.colorInfo,"field",b);this._fixFieldCase(a.colorInfo,"normalizationField",b);this._fixFieldCase(a.field,"field",b);this._fixFieldCase(a.opacityInfo,"field",b);this._fixFieldCase(a.opacityInfo,"normalizationField",b);e.forEach(a.visualVariables,function(a){d=this._fixFieldCase(a,"field",b);"sizeInfo"===a.type&&d&&!this._orderBy&&(this._orderBy=[d+" DESC"]);this._fixFieldCase(a,
"normalizationField",b)},this);var g=e.map(a.getFieldsUsedInExpressions(),function(a){var b=this.getField(a);return b?b.name:a},this);b=b.concat(g);this._orderBy||!a.addBreak||f.isFunction(a.attributeField)||!a.backgroundFillSymbol&&!this._hasSizeDiff(a)||(this._orderBy=[a.attributeField+" DESC"])},this);this._requiredFields=e.filter(b,p.isDefined)}},_hasSizeDiff:function(a){var b=Number.MAX_VALUE,d=-Number.MAX_VALUE,g,c;e.forEach(a.infos,function(a){if(c=a.symbol){g=0;switch(c.type){case "simplemarkersymbol":g=
c.size;break;case "picturemarkersymbol":g=(c.width+c.height)/2;break;case "simplelinesymbol":case "cartographiclinesymbol":g=c.width;break;case "simplefillsymbol":case "picturefillsymbol":g=c.outline&&c.outline.width}g&&(b=Math.min(b,g),d=Math.max(d,g))}});return b!==Number.MAX_VALUE&&d!==-Number.MAX_VALUE&&1<Math.abs(d-b)},getOrderByFields:function(){var a=this.orderByFields||this._orderBy;return this.supportsAdvancedQueries&&a?e.filter(a,function(a){a=a.split(" ")[0];return!!this._getField(a,!0)},
this):null},_getField:function(a,b){var d=this.fields;if(!d||0===d.length)return null;var g;b&&(a=a.toLowerCase());e.some(d,function(d){var c=!1;(c=b?d&&d.name.toLowerCase()===a?!0:!1:d&&d.name===a?!0:!1)&&(g=d);return c});return g},_getDateOpts:function(){this._dtOpts||(this._dtOpts={properties:e.map(e.filter(this.fields,function(a){return!(!a||"esriFieldTypeDate"!==a.type)}),function(a){return a.name})});return this._dtOpts},_applyNormalized:function(a,b){a&&b&&e.forEach(a,function(a,d){a&&b[d]&&
a.setGeometry(b[d])})},_editHandler:function(a,b,d,g,c,p){c=a.addResults;var u=a.updateResults;a=a.deleteResults;var r,t,v,h,k,A=this.objectIdField,z=this._mode,l=this._isTable;r=this.editFieldsInfo;h=this.getOutFields()||[];var x=r&&r.creatorField,w=r&&r.creationDateField,y=r&&r.editorField,m=r&&r.editDateField;r=r&&r.realm;-1===e.indexOf(h,"*")&&(x&&-1===e.indexOf(h,x)&&(x=null),w&&-1===e.indexOf(h,w)&&(w=null),y&&-1===e.indexOf(h,y)&&(y=null),m&&-1===e.indexOf(h,m)&&(m=null));var n=w||m?(new Date).getTime():
null,C=x||y?this.getUserId():void 0;C&&r&&(C=C+"@"+r);if(c){var N=this.globalIdField;for(r=0;r<c.length;r++)c[r]=new R(c[r]),l||(t=c[r],t.success&&(v=t.objectId,h=b[r],(k=h._graphicsLayer)&&k!==this&&k.remove(h),k=h.attributes||{},k[A]=v,v=t.globalId,N&&v&&(k[N]=v),x&&(k[x]=C),y&&(k[y]=C),w&&(k[w]=n),m&&(k[m]=n),h.setAttributes(k),z._init&&z.drawFeature(h)))}if(u)for(r=0;r<u.length;r++)if(u[r]=new R(u[r]),!l&&(t=u[r],t.success)){v=t.objectId;h=d[v];if(b=z._getFeature(v))b.geometry!==h.geometry&&h.geometry&&
b.setGeometry(W.fromJson(h.geometry.toJson())),b.attributes!==h.attributes&&h.attributes&&b.setAttributes(f.mixin(b.attributes,h.attributes)),this._repaint(b,v);h=b||h;k=h.attributes||{};y&&(k[y]=C);m&&(k[m]=n);h.setAttributes(k)}if(a){d=[];for(r=0;r<a.length;r++)if(a[r]=new R(a[r]),!l&&(t=a[r],t.success&&(v=t.objectId,h=z._getFeature(v))))this._unSelectFeatureIIf(v,z)&&d.push(h),h._count=0,z._removeFeatureIIf(v);if(0<d.length)this.onSelectionComplete(d,H.SELECTION_SUBTRACT)}this._resolve([c,u,a],
"onEditsComplete",g,p)},_sendAttachment:function(a,b,d,g,c){var p=this;return r({url:this._url.path+"/"+b+"/"+("add"===a?"addAttachment":"updateAttachment"),form:d,content:f.mixin(this._url.query,{f:"json",token:this._getToken()||void 0}),callbackParamName:"callback.html",handleAs:"json"}).addCallback(function(d){var c="add"===a?"onAddAttachmentComplete":"onUpdateAttachmentComplete";d=new R(d["add"===a?"addAttachmentResult":"updateAttachmentResult"]);d.attachmentId=d.objectId;d.objectId=b;p._resolve([d],
c,g);return d}).addErrback(function(a){p._resolve([a],null,c,null,!0)})},_repaint:function(a,b,d){b=p.isDefined(b)?b:a.attributes[this.objectIdField];b in this._selectedFeatures&&this._selectionSymbol||a.setSymbol(a.symbol,d)},_getKind:function(a){var b=this._trackManager;return b?b.isLatestObservation(a)?1:0:0}});f.mixin(H,{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"});T._createWrappers(H);b("extend-esri")&&f.setObject("layers.FeatureLayer",H,u);return H})},"esri/promiseList":function(){define(["dojo/_base/array","dojo/Deferred","dojo/when"],function(q,m,n){var l=q.forEach;return function(f){function e(a,b){h[b]=a;d.progress([a,b]);0===--t&&d.resolve(h)}var k,c;f instanceof Array?c=f:f&&"object"===typeof f&&(k=f);var h,b=[];if(k){c=[];for(var a in k)Object.hasOwnProperty.call(k,a)&&(b.push(a),c.push(k[a]));h={}}else c&&
(h=[]);if(!c||!c.length)return(new m).resolve(h);var d=new m;d.promise.always(function(){h=b=null});var t=c.length;l(c,function(a,g){k||b.push(g);n(a,function(a){d.isFulfilled()||e(a,b[g])},function(a){d.isFulfilled()||e(a,b[g])})});return d.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(q,m,n,l,f,e,k,c,h,b,a,d,t){q=q(d,{declaredClass:"esri.tasks.QueryTask",_eventMap:{complete:["featureSet"],"execute-for-count-complete":["count"],"execute-for-ids-complete":["objectIds"],"execute-relationship-query-complete":["featureSets"]},constructor:function(a,b){this._handler=m.hitch(this,this._handler);this._relationshipQueryHandler=m.hitch(this,this._relationshipQueryHandler);this._executeForIdsHandler=m.hitch(this,this._executeForIdsHandler);this._countHandler=m.hitch(this,this._countHandler);
this._extentHandler=m.hitch(this,this._extentHandler);this.source=b&&b.source;this.gdbVersion=b&&b.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(a,b,d,p,r){p=r.assembly;a=this._encode(m.mixin({},this._url.query,{f:"json"},a.toJson(p&&p[0])));var g=this._handler,u=this._errorHandler;this.source&&(p={source:this.source.toJson()},a.layer=f.toJson(p));this.gdbVersion&&(a.gdbVersion=this.gdbVersion);return c({url:this._url.path+"/query",content:a,callbackParamName:"callback",load:function(a,c){g(a,c,b,d,r.dfd)},error:function(a){u(a,d,r.dfd)}},this.requestOptions)},executeRelationshipQuery:function(a,
b,d){a=this._encode(m.mixin({},this._url.query,{f:"json"},a.toJson()));var g=this._relationshipQueryHandler,u=this._errorHandler;this.gdbVersion&&(a.gdbVersion=this.gdbVersion);var e=new l(h._dfdCanceller);e._pendingDfd=c({url:this._url.path+"/queryRelatedRecords",content:a,callbackParamName:"callback",load:function(a,c){g(a,c,b,d,e)},error:function(a){u(a,d,e)}},this.requestOptions);return e},executeForIds:function(a,b,d,p){var g=p.assembly;a=this._encode(m.mixin({},this._url.query,{f:"json",returnIdsOnly:!0},
a.toJson(g&&g[0])));var u=this._executeForIdsHandler,e=this._errorHandler;this.source&&(g={source:this.source.toJson()},a.layer=f.toJson(g));this.gdbVersion&&(a.gdbVersion=this.gdbVersion);return c({url:this._url.path+"/query",content:a,callbackParamName:"callback",load:function(a,g){u(a,g,b,d,p.dfd)},error:function(a){e(a,d,p.dfd)}},this.requestOptions)},executeForCount:function(a,b,d,p){var g=p.assembly;a=this._encode(m.mixin({},this._url.query,{f:"json",returnIdsOnly:!0,returnCountOnly:!0},a.toJson(g&&
g[0])));var u=this._countHandler,e=this._errorHandler;this.source&&(g={source:this.source.toJson()},a.layer=f.toJson(g));this.gdbVersion&&(a.gdbVersion=this.gdbVersion);return c({url:this._url.path+"/query",content:a,callbackParamName:"callback",load:function(a,g){u(a,g,b,d,p.dfd)},error:function(a){e(a,d,p.dfd)}},this.requestOptions)},executeForExtent:function(a,b,d,p){var g=p.assembly;a=this._encode(m.mixin({},this._url.query,{f:"json",returnExtentOnly:!0,returnCountOnly:!0},a.toJson(g&&g[0])));
var u=this._extentHandler,e=this._errorHandler;this.source&&(g={source:this.source.toJson()},a.layer=f.toJson(g));this.gdbVersion&&(a.gdbVersion=this.gdbVersion);return c({url:this._url.path+"/query",content:a,callbackParamName:"callback",load:function(a,g){u(a,g,b,d,p.dfd)},error:function(a){e(a,d,p.dfd)}},this.requestOptions)},_handler:function(a,b,d,c,e){try{var g=new t(a);this._successHandler([g],"onComplete",d,e)}catch(y){this._errorHandler(y,c,e)}},_relationshipQueryHandler:function(a,b,d,c,
e){try{var g=a.geometryType,p=a.spatialReference,u={};n.forEach(a.relatedRecordGroups,function(a){var b={};b.geometryType=g;b.spatialReference=p;b.features=a.relatedRecords;b=new t(b);if(null!=a.objectId)u[a.objectId]=b;else for(var d in a)a.hasOwnProperty(d)&&"relatedRecords"!==d&&(u[a[d]]=b)});this._successHandler([u],"onExecuteRelationshipQueryComplete",d,e)}catch(x){this._errorHandler(x,c,e)}},_executeForIdsHandler:function(a,b,d,c,e){try{this._successHandler([a.objectIds],"onExecuteForIdsComplete",
d,e)}catch(A){this._errorHandler(A,c,e)}},_countHandler:function(a,b,d,c,e){try{var g,p=a.features,u=a.objectIds;if(u)g=u.length;else{if(p)throw Error("Unable to perform query. Please check your parameters.");g=a.count}this._successHandler([g],"onExecuteForCountComplete",d,e)}catch(x){this._errorHandler(x,c,e)}},_extentHandler:function(a,d,c,p,e){try{a.extent&&(a.extent=new b(a.extent)),this._successHandler([a],"onExecuteForExtentComplete",c,e)}catch(A){this._errorHandler(A,p,e)}}});a._createWrappers(q);
e("extend-esri")&&m.setObject("tasks.QueryTask",q,k);return q})},"esri/tasks/Task":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/json dojo/has ../kernel ../deferredUtils ../urlUtils ../Evented".split(" "),function(q,m,n,l,f,e,k,c){q=q(c,{declaredClass:"esri.tasks._Task",_eventMap:{error:["error"],complete:["result"]},constructor:function(c,b){c&&m.isString(c)&&(this._url=k.urlToObject(this.url=c));b&&b.requestOptions&&(this.requestOptions=b.requestOptions);this.normalization=!0;
this._errorHandler=m.hitch(this,this._errorHandler);this.registerConnectEvents()},_useSSL:function(){var c=this._url,b=/^http:/i;this.url&&(this.url=this.url.replace(b,"https:"));c&&c.path&&(c.path=c.path.replace(b,"https:"))},_encode:function(c,b,a){var d,e,h={},g,u;for(g in c)if("declaredClass"!==g&&(d=c[g],e=typeof d,null!==d&&void 0!==d&&"function"!==e))if(m.isArray(d))for(h[g]=[],u=d.length,e=0;e<u;e++)h[g][e]=this._encode(d[e]);else"object"===e?d.toJson&&(e=d.toJson(a&&a[g]),"esri.tasks.FeatureSet"===
d.declaredClass&&e.spatialReference&&(e.sr=e.spatialReference,delete e.spatialReference),h[g]=b?e:n.toJson(e)):h[g]=d;return h},_successHandler:function(c,b,a,d){b&&this[b].apply(this,c);a&&a.apply(null,c);d&&e._resDfd(d,c)},_errorHandler:function(c,b,a){this.onError(c);b&&b(c);a&&a.errback(c)},setNormalization:function(c){this.normalization=c},onError:function(){}});l("extend-esri")&&(f.Task=q);return q})},"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(q,m,n,l,f,e,k,c,h,b,a){q=q(null,{declaredClass:"esri.tasks.FeatureSet",constructor:function(d){if(d){m.mixin(this,d);var e=this.features,h=d.spatialReference,g=b.getGeometryType(d.geometryType),h=this.spatialReference=new c(h);this.geometryType=d.geometryType;d.fields&&(this.fields=d.fields);n.forEach(e,function(b,d){var c=b.geometry&&b.geometry.spatialReference;e[d]=new k(g&&b.geometry?new g(b.geometry):null,b.symbol&&a.fromJson(b.symbol),b.attributes);e[d].geometry&&!c&&e[d].geometry.setSpatialReference(h)});
this._hydrate()}else this.features=[]},displayFieldName:null,geometryType:null,spatialReference:null,fieldAliases:null,toJson:function(a){var d={};this.displayFieldName&&(d.displayFieldName=this.displayFieldName);this.fields&&(d.fields=this.fields);this.spatialReference?d.spatialReference=this.spatialReference.toJson():this.features[0]&&this.features[0].geometry&&(d.spatialReference=this.features[0].geometry.spatialReference.toJson());this.features[0]&&(this.features[0].geometry&&(d.geometryType=
b.getJsonType(this.features[0].geometry)),d.features=h._encodeGraphics(this.features,a));d.geometryType=d.geometryType||this.geometryType;d.exceededTransferLimit=this.exceededTransferLimit;d.transform=this.transform;return e.fixJson(d)},_hydrate:function(){var a=this.transform,b=this.geometryType;if(a&&b)for(var c=this.features,g=a.translate[0],u=a.translate[1],p=a.scale[0],e=a.scale[1],h=function(a,b,d){if("esriGeometryPoint"===a)return function(a){a.x=b(a.x);a.y=d(a.y)};if("esriGeometryPolyline"===
a||"esriGeometryPolygon"===a)return function(a){a=a.rings||a.paths;var g,c,p,u,e,r,t,h;g=0;for(c=a.length;g<c;g++)for(e=a[g],p=0,u=e.length;p<u;p++)r=e[p],0<p?(t+=r[0],h+=r[1]):(t=r[0],h=r[1]),r[0]=b(t),r[1]=d(h)};if("esriGeometryEnvelope"===a)return function(a){a.xmin=b(a.xmin);a.ymin=d(a.ymin);a.xmax=b(a.xmax);a.ymax=d(a.ymax)};if("esriGeometryMultipoint"===a)return function(a){a=a.points;var g,c,p,u,e;g=0;for(c=a.length;g<c;g++)p=a[g],0<g?(u+=p[0],e+=p[1]):(u=p[0],e=p[1]),p[0]=b(u),p[1]=d(e)}}(b,
function(a){return a*p+g},function(a){return u-a*e}),a=0,b=c.length;a<b;a++)c[a].geometry&&h(c[a].geometry);this.transform=null},quantize:function(a){if(!this.geometryType)return this.transform=null,this;var b=a.translate[0],d=a.translate[1],g=a.scale[0],c=a.scale[1],p=this.features,e=function(a,b,d){var g,c,p,u,e,r,t=[];g=0;for(c=a.length;g<c;g++)if(p=a[g],0<g){if(r=b(p[0]),p=d(p[1]),r!==u||p!==e)t.push([r-u,p-e]),u=r,e=p}else u=b(p[0]),e=d(p[1]),t.push([u,e]);return 0<t.length?t:null},h=function(a,
b,d){if("esriGeometryPoint"===a)return function(a){a.x=b(a.x);a.y=d(a.y);return a};if("esriGeometryPolyline"===a||"esriGeometryPolygon"===a)return function(a){var g,c,p,u,r;p=a.rings||a.paths;r=[];g=0;for(c=p.length;g<c;g++)u=p[g],(u=e(u,b,d))&&r.push(u);return 0<r.length?(a.rings?a.rings=r:a.paths=r,a):null};if("esriGeometryMultipoint"===a)return function(a){var g;g=e(a.points,b,d);return 0<g.length?(a.points=g,a):null};if("esriGeometryEnvelope"===a)return function(a){return a}}(this.geometryType,
function(a){return Math.round((a-b)/g)},function(a){return Math.round((d-a)/c)}),k,f;k=0;for(f=p.length;k<f;k++)p[k].geometry&&(h(p[k].geometry)||p[k].setGeometry(null));this.transform=a;return this}});l("extend-esri")&&m.setObject("tasks.FeatureSet",q,f);return q})},"esri/tasks/StatisticDefinition":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(q,m,n,l){q=q(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}}});n("extend-esri")&&m.setObject("tasks.StatisticDefinition",q,l);return q})},"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(q,
m,n,l,f,e,k,c,h,b,a){q=q(null,{declaredClass:"esri.layers.FeatureType",constructor:function(d){if(d&&m.isObject(d)){this.id=d.id;this.name=d.name;var e=d.symbol;e&&(this.symbol=k.fromJson(e));var e=d.domains,v,g=this.domains={};for(v in e)if(e.hasOwnProperty(v)){var u=e[v];switch(u.type){case "range":g[v]=new c(u);break;case "codedValue":g[v]=new h(u);break;case "inherited":g[v]=new b(u)}}if(v=d.templates)for(e=this.templates=[],d=0;d<v.length;d++)e.push(new a(v[d]))}},toJson:function(){var a={id:this.id,
name:this.name,symbol:this.symbol&&this.symbol.toJson()},b,c=this.domains,g=this.templates,u=e.fixJson;if(c){var p=a.domains={};for(b in c)c.hasOwnProperty(b)&&(p[b]=c[b]&&c[b].toJson());u(p)}g&&(a.templates=n.map(g,function(a){return a.toJson()}));return u(a)}});l("extend-esri")&&m.setObject("layers.FeatureType",q,f);return q})},"esri/layers/FeatureTemplate":function(){define("dojo/_base/declare dojo/_base/lang dojo/has ../kernel ../lang ../graphic".split(" "),function(q,m,n,l,f,e){q=q(null,{declaredClass:"esri.layers.FeatureTemplate",
constructor:function(k){k&&m.isObject(k)&&(this.name=k.name,this.description=k.description,this.drawingTool=k.drawingTool,this.thumbnail=k.thumbnail,k=k.prototype,this.prototype=new e(k.geometry,null,k.attributes))},toJson:function(){return f.fixJson({name:this.name,description:this.description,drawingTool:this.drawingTool,thumbnail:f.fixJson(m.clone(this.thumbnail)),prototype:this.prototype&&this.prototype.toJson()})}});m.mixin(q,{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"});n("extend-esri")&&m.setObject("layers.FeatureTemplate",q,l);return q})},"esri/layers/FeatureEditResult":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel"],function(q,m,n,l){q=q(null,{declaredClass:"esri.layers.FeatureEditResult",constructor:function(f){f&&m.isObject(f)&&(this.objectId=f.objectId,this.globalId=f.globalId,this.success=f.success,f.success||(f=f.error,this.error=
Error(),this.error.code=f.code,this.error.message=f.description))}});n("extend-esri")&&m.setObject("layers.FeatureEditResult",q,l);return q})},"esri/layers/SnapshotMode":function(){define("dojo/_base/declare dojo/_base/lang dojo/has ../kernel ../SpatialReference ../srUtils ../tasks/query ./RenderMode ./support/ParallelSnapshot".split(" "),function(q,m,n,l,f,e,k,c,h){q=q([c],{declaredClass:"esri.layers._SnapshotMode",maxFeatures:5E4,constructor:function(b){this.featureLayer=b;this._featureMap={};this._hasPartialFeatures=
!1;this._drawFeatures=m.hitch(this,this._drawFeatures);this._queryErrorHandler=m.hitch(this,this._queryErrorHandler);this._handleSuccess=m.hitch(this,this._handleSuccess);this._handleError=m.hitch(this,this._handleError);this._handleProgress=m.hitch(this,this._handleProgress)},startup:function(){if(!this._started){this.inherited(arguments);var b=this.featureLayer,a=b.advancedQueryCapabilities,d=b.reHostedFS.test(b.url);this.pagination=b.queryPagination&&null!=b.maxRecordCount;this._tileQueriesAllowed=
d&&a&&a.supportsQueryWithResultType&&b.isFeatureReductionApplied();d&&this.pagination&&(this._parallelSnapshot=new h({layer:b,mode:this,queryTask:b._task}));b._collection?this._applyTimeFilter():this._fetchAll()}},propertyChangeHandler:function(b){this._init&&(b?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(b){var a=b.attributes[this.featureLayer.objectIdField];this._addFeatureIIf(a,b);this._incRefCount(a)},resume:function(){this.propertyChangeHandler(0)},refresh:function(){var b=this.featureLayer;b._collection?(b._fireUpdateStart(),b._refresh(!0),b._fireUpdateEnd()):this._fetchAll()},hasAllFeatures:function(){return!this._hasPartialFeatures},
_fetchAll:function(){var b=this.featureLayer;b._collection||b.suspended||!b.isQueryable()||(b._fireUpdateStart(),this._clearIIf(),this._hasPartialFeatures=!1,this._parallelSnapshot?this._parallelSnapshot.fetch(this._createQuery()).then(this._handleSuccess,this._handleError,this._handleProgress):this._sendRequest())},_handleSuccess:function(b){this._hasPartialFeatures=b.hasPartialFeatures;this.featureLayer._fireUpdateEnd(null)},_handleError:function(b){this._queryErrorHandler(b)},_handleProgress:function(b){b.isError?
this.featureLayer._errorHandler(b.error):this._addFeatures(b.features)},_sendRequest:function(b){var a=this.featureLayer,d=this._createQuery();this.pagination&&(this._start=d.start=null==b?0:b,d.num=a.maxRecordCount);this._pendingRequest&&this._cancelPendingRequest(this._pendingRequest);this._pendingRequest=a._task.execute(d,this._drawFeatures,this._queryErrorHandler)},_drawFeatures:function(b){this._pendingRequest=null;var a=this.featureLayer,d=b.exceededTransferLimit,c=d&&!a._collection;b=this._checkMaxLimit(b.features);
var e=b.maxLimitReached;this._addFeatures(b.features);this.pagination&&c&&!e||(this._hasPartialFeatures=!!d,a._fireUpdateEnd(null,d?{queryLimitExceeded:!0}:null));c&&(this.pagination&&!e&&this._sendRequest(this._start+a.maxRecordCount),a.onQueryLimitExceeded())},_queryErrorHandler:function(b){this._pendingRequest=null;this._hasPartialFeatures=!0;var a=this.featureLayer;a._errorHandler(b);a._fireUpdateEnd(b)},_checkMaxLimit:function(b){var a=b?b.length:0,d=this.featureLayer.graphics.length+a,c=d>=
this.maxFeatures;if(c){var e=d-this.maxFeatures;e&&b.splice(a-e,e)}return{maxLimitReached:c,featuresDiscarded:d>this.maxFeatures,features:b}},_createQuery:function(){var b=this.featureLayer,a=new k;a.outFields=b.getOutFields();a.where=b.getDefinitionExpression()||"1\x3d1";a.returnGeometry=!0;a.outSpatialReference=e.createSpatialReference(this.map.spatialReference.toJson());a.timeExtent=b.getTimeDefinition();a.maxAllowableOffset=b._maxOffset;a.quantizationParameters=b._quantizationParameters;a.orderByFields=
b.supportsAdvancedQueries?b.getOrderByFields():null;a.multipatchOption=b.multipatchOption;b._ts&&(a._ts=(new Date).getTime());this._tileQueriesAllowed&&(a.resultType="tile");return a},_addFeatures:function(b){var a=this.featureLayer,d=a.objectIdField,c=b.length,e=a._selectedFeatures,g=a.mode===a.constructor.MODE_AUTO,u,p,r;a._fireUpdateStart();a._sortFeatures(b);for(a=0;a<c;a++)p=b[a],r=p.attributes[d],u=this._addFeatureIIf(r,p),this._incRefCount(r),g&&u!==p&&e[r]&&(u.setGeometry(p.geometry),u.setAttributes(p.attributes));
this._applyTimeFilter(!0)}});n("extend-esri")&&m.setObject("layers._SnapshotMode",q,l);return q})},"esri/layers/RenderMode":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/array","dojo/has","../kernel"],function(q,m,n,l,f){q=q(null,{declaredClass:"esri.layers._RenderMode",initialize:function(e){this.map=e;this._init=!0},startup:function(){this._started=!0},propertyChangeHandler:function(e){},destroy:function(){this._init=this._started=!1},drawFeature:function(e){},suspend:function(){},
resume:function(){},refresh:function(){},hasAllFeatures:function(){return!0},_incRefCount:function(e){(e=this._featureMap[e])&&e._count++},_decRefCount:function(e){(e=this._featureMap[e])&&e._count--},_getFeature:function(e){return this._featureMap[e]},_addFeatureIIf:function(e,k){var c=this._featureMap,h=c[e],b=this.featureLayer;h||(c[e]=k,b._add(k),k._count=0);return h||k},_removeFeatureIIf:function(e){var k=this._featureMap[e],c=this.featureLayer;if(k){if(k._count)return;delete this._featureMap[e];
c._remove(k)}return k},_clearIIf:function(){var e;e=this.featureLayer;var k=e.graphics,c=e._selectedFeatures,h=e.getSelectedFeatures().length,b=e.objectIdField;if(h)for(e=k.length-1;0<=e;e--){var h=k[e],a=h.attributes[b];a in c?h._count=1:(h._count=0,this._removeFeatureIIf(a))}else e.clear(),this._featureMap={}},_cancelPendingRequest:function(e){if(e)try{e.cancel()}catch(k){}},_toggleVisibility:function(e){var k=this.featureLayer,c=k.graphics,h=e?"show":"hide",b,a=c.length;e=e&&k._ager;for(b=0;b<
a;b++){var d=c[b];d[h]();e&&k._repaint(d)}},_applyTimeFilter:function(e){var k=this.featureLayer;if(k.timeInfo&&!k.suspended){e||k._fireUpdateStart();var c=k._trackManager;c&&c.clearTracks();var h=k.getTimeDefinition(),b=k._getOffsettedTE(k._mapTimeExtent);b?(b=k._getTimeOverlap(h,b))?(h=k._filterByTime(k.graphics,b.startTime,b.endTime),c&&c.addFeatures(h.match),n.forEach(h.match,function(a){var b=a._shape;a.visible||(a.show(),(b=a._shape)&&b._moveToFront());k._ager&&b&&k._repaint(a)}),n.forEach(h.noMatch,
function(a){a.visible&&a.hide()})):this._toggleVisibility(!1):(c&&c.addFeatures(k.graphics),this._toggleVisibility(!0));c&&(c.moveLatestToFront(),c.drawTracks());e||k._fireUpdateEnd()}}});l("extend-esri")&&m.setObject("layers._RenderMode",q,f);return q})},"esri/layers/support/ParallelSnapshot":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has dojo/Deferred ../../kernel".split(" "),function(q,m,n,l,f,e){q=q(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(e){m.mixin(this,e);this._requests={};this._maxPage=Math.ceil(this.mode.maxFeatures/this.layer.maxRecordCount)},destroy:function(){this.cancel()},fetch:function(e){var c=new f;this.cancel(!0);this._query=e;this._fetchDfd=c;this._sendRequests();return c.promise},cancel:function(e){this._cancelPendingRequests(e);this._reset()},_reset:function(){this._startPage=
this._lastPage=null;this._requests={}},_sendRequests:function(e){var c=this._query,h=this.queryTask,b=this._requests,a=this.layer.maxRecordCount,d;e=null==e?1:e;d=e+this.batchSize-1;d>this._maxPage&&(d=this._maxPage);if(!(e>d))for(this._startPage=e,this._lastPage=d;e<=d;e++)c.start=(e-1)*a,c.num=a,b[e]=h.execute(c),b[e].then(m.hitch(this,this._handleSuccess,e)).otherwise(m.hitch(this,this._handleError,e))},_evalNextBatch:function(e){e===this._lastPage&&this._sendRequests(this._lastPage+1)},_handleSuccess:function(e,
c){c.exceededTransferLimit||this._cancelLaterRequests(e,!0);var h=this.mode._checkMaxLimit(c.features);this._fetchDfd.progress({features:h.features,isError:!1});h.maxLimitReached?((h=h.featuresDiscarded||this._hasRejectedRequests())||(h=!!this._getResult(this._getLastSuccessfulRequest()).exceededTransferLimit),this._resolveFetch(h)):(c.exceededTransferLimit&&this._evalNextBatch(e),this._evalResolution())},_handleError:function(e,c){var h=this._requests;h&&h[e]&&(1===e?this._rejectFetch(c):(this._evalNextBatch(e),
this._fetchDfd.progress({error:c,isError:!0}),this._evalResolution()))},_evalResolution:function(){this._hasPendingRequests()||this._resolveFetch(this._hasRejectedRequests())},_resolveFetch:function(e){this.cancel(!0);this._fetchDfd.resolve({hasPartialFeatures:e})},_rejectFetch:function(e){this.cancel(!0);this._fetchDfd.reject(e)},_getResult:function(e){return e&&e.dfd.results[0]},_hasPendingRequests:function(){return!!this._getPendingRequests().length},_getPendingRequests:function(){var e=this._requests,
c,h=[];for(c in e){var b=e[c];b.isFulfilled()||h.push({pageId:Number(c),dfd:b})}return h},_getLastSuccessfulRequest:function(){var e=this._getResolvedRequests(),c=-Infinity,h,e=n.filter(e,function(b){return!!this._getResult(b).features.length||1===b.pageId},this);n.forEach(e,function(b){b.pageId>c&&(c=b.pageId,h=b)});return h},_getResolvedRequests:function(){var e=this._requests,c,h=[];for(c in e){var b=e[c];b.isResolved()&&h.push({pageId:Number(c),dfd:b})}return h},_hasRejectedRequests:function(){var e=
this._getRejectedRequests(),c=this._getLastSuccessfulRequest(),h=this._getResult(c);h&&!h.exceededTransferLimit&&(e=n.filter(e,function(b){return b.pageId<=c.pageId}));return!!e.length},_getRejectedRequests:function(){var e=this._requests,c,h=[];for(c in e){var b=e[c];b.isRejected()&&h.push({pageId:Number(c),dfd:b})}return h},_cancelPendingRequests:function(e){this._cancelRequests(this._getPendingRequests(),e)},_cancelLaterRequests:function(e,c){var h=n.filter(this._getPendingRequests(),function(b){return b.pageId>
e});this._cancelRequests(h,c)},_cancelRequests:function(e,c){var h=this.mode,b=this._requests;n.forEach(e,function(a){c&&delete b[a.pageId];h._cancelPendingRequest(a.dfd)})}});l("extend-esri")&&m.setObject("layers.support.ParallelSnapshot",q,e);return q})},"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(q,m,n,l,f,e,k,c,h,b){q=q([h],
{declaredClass:"esri.layers._OnDemandMode",constructor:function(a){this.featureLayer=a;this._featureMap={};this._hasPartialFeatures=!1;this._queryErrorHandler=n.hitch(this,this._queryErrorHandler)},initialize:function(a){this.inherited(arguments);var d=this.featureLayer,c=d._srInfo;this._gridLayer=new b(new k(c?c.valid[0]:a.extent.xmin,c?c.valid[1]:a.extent.ymax,a.spatialReference),{width:d._tileWidth,height:d._tileHeight},{width:a.width,height:a.height},c);this._cellMap={};this._gridLayer.setResolution(a.extent)},
startup:function(){this._started||(this.inherited(arguments),this._ioQueue=[],this.featureLayer.suspended||(this._zoomHandler(),this._enableConnectors()))},propertyChangeHandler:function(a){this._init&&(2>a?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(a){var b=
a.geometry,c=[];if(b){var c=this._gridLayer.getCellsInExtent("point"===b.type?{xmin:b.x,ymin:b.y,xmax:b.x,ymax:b.y}:b.getExtent(),!1).cells,b=this._cellMap,e,g,u=a.attributes[this.featureLayer.objectIdField],p,r,h;for(e=0;e<c.length;e++)g=c[e],p=g.latticeID,r=g.row,h=g.col,p?g=b[p]=b[p]||g:(b[r]=b[r]||{},g=b[r][h]=b[r][h]||g),g.features=g.features||[],g.features.push(a),this._addFeatureIIf(u,a),this._incRefCount(u)}},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 a=!1,b=this._getCurrentCells(),c;for(c=0;c<b.length;c++)if(b[c].hasPartialFeatures){a=!0;break}return!a},_enableConnectors:function(){var a=this.map;this._zoomConnect=m.connect(a,"onZoomEnd",this,this._zoomHandler);this._panConnect=m.connect(a,"onPanEnd",this,this._panHandler);this._resizeConnect=m.connect(a,"onResize",this,this._panHandler)},_disableConnectors:function(){m.disconnect(this._zoomConnect);
m.disconnect(this._panConnect);m.disconnect(this._resizeConnect)},_zoomHandler:function(){this._processIOQueue(!0);var a=this.featureLayer,b=this.map;!a.suspended&&a.isQueryable()&&(a._fireUpdateStart(),this._clearIIf(),this._hasPartialFeatures=!1,(a=a._trackManager)&&a.clearTracks(),this._cellMap={},this._gridLayer.setResolution(b.extent),this._sendRequest())},_panHandler:function(a){if(this.featureLayer.isQueryable()){this.featureLayer._fireUpdateStart();var b=this.featureLayer._resized;a=b?a:null;
b&&this._gridLayer.setMapState(a,this.map.width,this.map.height);this._sendRequest(a)}},_sendRequest:function(a){this._exceeds=!1;var b=this.featureLayer,e=this.map;a=a||e.extent;e=this._gridLayer.getCellsInExtent(a,b.latticeTiling).cells;if(!b.isEditable())var h=this._cellMap,e=l.filter(e,function(a){if(a.lattice){if(h[a.latticeID])return!1}else if(h[a.row]&&h[a.row][a.col])return!1;return!0});var g=b.getOutFields(),u=b.getDefinitionExpression(),p=b._getOffsettedTE(b._mapTimeExtent),r=b.supportsAdvancedQueries?
b.getOrderByFields():null,k=this._ioQueue,f,m=this,x=this._drawFeatures,w,z;this._pending=this._pending||0;for(f=0;f<e.length;f++){w=e[f];z=new c;z.geometry=w.extent||w.lattice;z.outFields=g;z.where=u;b.latticeTiling&&w.extent&&(z.spatialRelationship=c.SPATIAL_REL_CONTAINS);z.returnGeometry=!0;z.timeExtent=p;b._ts&&(z._ts=(new Date).getTime());z.orderByFields=r;z.multipatchOption=b.multipatchOption;z.maxAllowableOffset=b._maxOffset;z.quantizationParameters=b._quantizationParameters;var n=b.advancedQueryCapabilities;
n&&n.supportsQueryWithResultType&&(z.resultType="tile");this._pending++;k.push(b._task.execute(z,function(){var a=w;return function(b){x.apply(m,[b,a])}}.call(this),this._queryErrorHandler))}this._removeOldCells(a);this._endCheck()},_drawFeatures:function(a,b){b.hasPartialFeatures=!!a.exceededTransferLimit;this._exceeds=this._exceeds||a.exceededTransferLimit;this._finalizeIO();var d=this.featureLayer,c=this.map.extent,g=b.extent,e=b.row,p=b.col,r=d.objectIdField,h=a.features,k=this._gridLayer,f=this._cellMap,
l=b.latticeID,w=l?f[l]:f[e]&&f[e][p];if(b.resolution==k._resolution&&(l?l===k.getLatticeID(c):k.intersects(g,c)))if(w)d._sortFeatures(h),this._updateCell(w,h);else for(d._sortFeatures(h),b.features=h,l?f[l]=b:(f[e]=f[e]||{},f[e][p]=b),c=h.length,d=0;d<c;d++)g=h[d],e=g.attributes[r],this._addFeatureIIf(e,g),this._incRefCount(e);else w&&this._removeCell(e,p,l);this._endCheck()},_queryErrorHandler:function(a){this._finalizeIO();this._hasPartialFeatures=!0;this.featureLayer._errorHandler(a);this._endCheck(!0)},
_finalizeIO:function(){this._pending--},_endCheck:function(a){if(0===this._pending){this._processIOQueue();var b=this.featureLayer,c=b._trackManager;c&&(c.clearTracks(),c.addFeatures(b.graphics),b._ager&&l.forEach(b.graphics,function(a){a._shape&&b._repaint(a)}),c.moveLatestToFront(),c.drawTracks());this.featureLayer._fireUpdateEnd(a&&Error("FeatureLayer: an error occurred while updating the layer"),this._exceeds?{queryLimitExceeded:!0}:null);if(this._exceeds)b.onQueryLimitExceeded()}},_processIOQueue:function(a){this._ioQueue=
l.filter(this._ioQueue,function(a){return-1<a.fired?!1:!0});a&&l.forEach(this._ioQueue,this._cancelPendingRequest)},_getCurrentCells:function(a){var b=[];a=a||this._cellMap;for(var c in a)if(a.hasOwnProperty(c)){var e=a[c];e&&(e.hasOwnProperty("row")||e.hasOwnProperty("latticeID")?b.push(e):"object"===typeof e&&b.push.apply(b,this._getCurrentCells(e)))}return b},_removeOldCells:function(a){var b=this._cellMap,c=this._gridLayer,e,g;for(e in b)if(b[e]){var u=b[e],p=u.latticeID,r=0,h=0;if(p)r++,p!==
c.getLatticeID(a)&&(this._removeCell(null,null,p),h++);else for(g in u)u[g]&&(r++,c.intersects(u[g].extent,a)||(this._removeCell(e,g),h++));h===r&&delete b[e]}},_updateCell:function(a,b){var d=this.featureLayer,c=d.objectIdField,d=d._selectedFeatures,g,e=b.length;a.features=a.features||[];for(g=0;g<e;g++){var p=b[g],r=p.attributes[c],h=this._addFeatureIIf(r,p);h===p?(this._incRefCount(r),a.features.push(h)):r in d||(h.setGeometry(p.geometry),h.setAttributes(p.attributes))}},_removeCell:function(a,
b,c){var d=this._cellMap,g=this.featureLayer,e=g.objectIdField,p=c?d[c]:d[a]&&d[a][b];if(p)for(c?delete d[c]:delete d[a][b],a=p.features,b=0;b<a.length;b++)c=a[b].attributes[e],this._decRefCount(c),c in g._selectedFeatures||this._removeFeatureIIf(c)}});f("extend-esri")&&n.setObject("layers._OnDemandMode",q,e);return q})},"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(q,m,n,l,f,e,k,c,h){q=q(null,{declaredClass:"esri.layers._GridLayout",constructor:function(b,a,d,c){this.origin=b;this.cellWidth=a.width;this.cellHeight=a.height;this.mapWidth=d.width;this.mapHeight=d.height;this.srInfo=c},setResolution:function(b){this._resolution=(b.xmax-b.xmin)/this.mapWidth;this.srInfo&&(b=Math.round(Math.round(2*this.srInfo.valid[1]/this._resolution)/this.cellWidth),this._frameStats=[b,0,b-1])},setMapState:function(b,a,d){this.mapWidth=a;this.mapHeight=d;this.setResolution(b)},
getCellCoordinates:function(b){var a=this._resolution,d=this.origin;return{row:Math.floor((d.y-b.y)/(this.cellHeight*a)),col:Math.floor((b.x-d.x)/(this.cellWidth*a))}},normalize:function(b){var a=this._frameStats;if(a){var d=a[0],c=a[1],a=a[2];b<c?(b%=d,b=b<c?b+d:b):b>a&&(b%=d)}return b},intersects:function(b,a){var d=this.srInfo;return d?n.some(a._getParts(d),function(a){return b.intersects(a.extent)}):b.intersects(a)},getCellExtent:function(b,a){var d=this._resolution,c=this.origin,e=this.cellWidth,
g=this.cellHeight;return new k(a*e*d+c.x,c.y-(b+1)*g*d,(a+1)*e*d+c.x,c.y-b*g*d,h.createSpatialReference(c.spatialReference.toJson()))},getLatticeID:function(b){var a=this.getCellCoordinates({x:b.xmin,y:b.ymax}),d=this.getCellCoordinates({x:b.xmax,y:b.ymin});b=a.row;var c=d.row,a=this.normalize(a.col),d=this.normalize(d.col);return b+"_"+c+"_"+a+"_"+d},sorter:function(b,a){return b<a?-1:1},getCellsInExtent:function(b,a){var d=this.getCellCoordinates({x:b.xmin,y:b.ymax}),e=this.getCellCoordinates({x:b.xmax,
y:b.ymin}),h=d.row,g=e.row,d=d.col,e=e.col,u=[],p,r,k,f=[],l=[],x,w,z,m,C=[];for(p=h;p<=g;p++)for(r=d;r<=e;r++)k=this.normalize(r),b=this.getCellExtent(p,k),n.some(u,function(a){return a.row===p&&a.col===k})||u.push({row:p,col:k,extent:b,resolution:this._resolution}),a&&(f.push(b.xmin,b.xmax),l.push(b.ymin,b.ymax));d=this.normalize(d);e=this.normalize(e);f.sort(this.sorter);l.sort(this.sorter);r=f.length;for(p=r-1;0<=p;p--)p<r-1&&f[p]===f[p+1]&&f.splice(p,1);r=l.length;for(p=r-1;0<=p;p--)p<r-1&&l[p]===
l[p+1]&&l.splice(p,1);if(f.length&&l.length){x=f[0];w=f[f.length-1];z=l[0];m=l[l.length-1];r=f.length;for(p=0;p<r;p++)C.push([[f[p],m],[f[p],z]]);r=l.length;for(p=0;p<r;p++)C.push([[x,l[p]],[w,l[p]]]);f=new c({paths:C,spatialReference:this.origin.spatialReference.toJson()});u.push({latticeID:h+"_"+g+"_"+d+"_"+e,lattice:f,resolution:this._resolution})}return{minRow:h,maxRow:g,minCol:d,maxCol:e,cells:u}}});l("extend-esri")&&m.setObject("layers._GridLayout",q,f);return q})},"esri/layers/SelectionMode":function(){define(["dojo/_base/declare",
"dojo/_base/lang","dojo/has","../kernel","./RenderMode"],function(q,m,n,l,f){q=q([f],{declaredClass:"esri.layers._SelectionMode",constructor:function(e){this.featureLayer=e;this._featureMap={}},propertyChangeHandler:function(e){this._init&&0===e&&this._applyTimeFilter()},resume:function(){this.propertyChangeHandler(0)},hasAllFeatures:function(){return!this.featureLayer._hasPartialSelectedFeatures}});n("extend-esri")&&m.setObject("layers._SelectionMode",q,l);return q})},"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(q,m,n,l,f,e,k,c,h,b,a){q=q([a],{declaredClass:"esri.layers._StreamMode",constructor:function(a,b){this.featureLayer=a;this._featureMap={};this._setRefreshRate();this._drawBuffer={adds:[],updates:[]};this._timeoutId=null;this._flushDrawBuffer=m.hitch(this,this._flushDrawBuffer);this._featuresByTime={};this._lastEndTimeCheck=null;this._maxFeatureAge=0;a.purgeOptions&&a.purgeOptions.age&&"number"===typeof a.purgeOptions.age&&(this._maxFeatureAge=1E3*Math.ceil(60*a.purgeOptions.age));this._drawFeatures=
m.hitch(this,this._drawFeatures);this._queryErrorHandler=m.hitch(this,this._queryErrorHandler)},startup:function(){this._started||this.inherited(arguments)},propertyChangeHandler:function(a){this._init&&(0===a?this._applyTimeFilter():3===a?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(a){var b=this.featureLayer,d=b.objectIdField;this._timeoutId||(this._timeoutId=setTimeout(this._flushDrawBuffer,this._refreshRate));b._joinField&&this._getFeature(a.attributes[d])?this._drawBuffer.updates.push({oid:a.attributes[d],updates:a}):this._drawBuffer.adds.push(a)},resume:function(){this.propertyChangeHandler(0)},refresh:function(){this._pendingRequest&&this._cancelPendingRequest(this._pendingRequest);var a=this.featureLayer;a&&(a._relatedUrl||a._keepLatestUrl?
(a._fireUpdateStart(),a._refreshing=!0,a.disconnect(),a.clear(),a._relatedQueried=!1,a._keepLatestQueried=!1,a.connect()):(a._fireUpdateStart(),a.clear(),a._fireUpdateEnd()))},_drawFeatures:function(a,b){var d=this.featureLayer;d._create(a.features||[]);d._fireUpdateEnd(null,b)},_applyTimeFilter:function(a){this.inherited(arguments);this._redrawAllTracks()},_removeFeatures:function(a){var b=this.featureLayer,d=b.objectIdField;a&&n.forEach(a,function(a){a=a.attributes[d];b._unSelectFeatureIIf(a,this);
this._decRefCount(a);this._removeFeatureIIf(a)},this)},_addFeatures:function(a){var b=this.featureLayer,d=b._endTimeField,g=b._startTimeField,c,e,r,h=[],f=[],k=[];c=b._trackManager;e=b.objectIdField;if(c)for(r in a=c.addFeatures(a),a)a.hasOwnProperty(r)&&(h.push(r),a[r].adds&&(f=f.concat(a[r].adds)),a[r].deletes&&(k=k.concat(a[r].deletes)));else f=a;n.forEach(f,function(a){var b=a.attributes[e],c;c=d&&a.attributes[d];!c&&this._maxFeatureAge&&(c=g&&a.attributes[g]?a.attributes[g]+this._maxFeatureAge:
Date.now()+this._maxFeatureAge);c&&(c=1E3*Math.ceil(c/1E3),this._featuresByTime[c]?this._featuresByTime[c].push(b):this._featuresByTime[c]=[b]);this._addFeatureIIf(b,a);this._incRefCount(b)},this);k.length&&this._removeFeatures(k);c&&c.refreshTracks(h)},_updateFeatures:function(a){var b=this.featureLayer,d,g,c=[];d=b._trackManager;g=b._trackIdField;n.forEach(a,function(a){var e=a.updates;a=this._getFeature(a.oid);var p;if(a){e.geometry&&a.setGeometry(e.geometry);e=e.attributes||{};for(p in e)e.hasOwnProperty(p)&&
(a.attributes[p]=e[p]);a.setAttributes(a.attributes);a.visible=this._checkFeatureTimeIntersects(a);d&&a.attributes[g]?c.push(a.attributes[g]):b._repaint(a,null,!0)}},this);c.length&&d.refreshTracks(c)},_redrawAllTracks:function(){var a=this.featureLayer._trackManager,b;a&&(b=a.trimTracks())&&0<b.length&&(this._removeFeatures(b),a.refreshTracks())},_flushDrawBuffer:function(){clearTimeout(this._timeoutId);var a=this._drawBuffer,b=a.adds.splice(0,a.adds.length),c=a.updates.splice(0,a.updates.length),
a=this.featureLayer;if(!a)return!1;a.updating||a._fireUpdateStart();this._addFeatures(b);this._updateFeatures(c);(b=this._getExpiredFeatures())&&b.length&&(this._removeFeatures(b),a._trackManager&&a._trackManager.removeFeatures(b));a._purge();a._fireUpdateEnd();this._timeoutId=null},_clearDrawBuffer:function(){var a=this._timeoutId,b=this._drawBuffer,c=b.adds,b=b.updates;a&&clearTimeout(a);c.splice(0,c.length);b.splice(0,b.length);this._timeoutId=null},_clearTimeBin:function(){this._featuresByTime=
{};this._lastEndTimeCheck=1E3*Math.ceil(Date.now()/1E3)},_clearFeatureMap:function(){this._featureMap={}},_setRefreshRate:function(a){a=a||0===a?a:200;0>a&&(a=200);this._refreshRate=a},_checkFeatureTimeIntersects:function(a){var b=this.featureLayer,d=b.getMap();return(d=d?d.timeExtent:null)&&b.timeInfo&&(b.timeInfo.startTimeField||b.timeInfo.endTimeField)?0<b._filterByTime([a],d.startTime,d.endTime).match.length:!0},_fetchArchive:function(a){var d=new l,e=this.featureLayer,g,u,p,r,f;this._pendingRequest&&
this._cancelPendingRequest(this._pendingRequest);e._fireUpdateStart();a&&this.map?(a=new h(a),g=new c,u=this.map,p=e.getFilter()||{},r=p.where||"1\x3d1",f=p.geometry?b.fromJson(p.geometry):null,p=p.outFields?p.outFields.split(","):["*"],g.geometry=f,g.where=r,g.outFields=p,g.returnGeometry=!0,g.outSpatialReference=new k(u.spatialReference.toJson()),this._pendingRequest=a.execute(g).then(function(a){this._pendingRequest=null;var b=this._fixFieldNameCasing(e,a);a.features=b;this._drawFeatures(a);e._fireUpdateEnd();
d.resolve()}.bind(this)).otherwise(function(a){this._pendingRequest=null;e._errorHandler(a);e._fireUpdateEnd(a);d.reject(a)}.bind(this))):d.resolve();return d.promise},_queryErrorHandler:function(a){var b=this.featureLayer;b._errorHandler(a);b._fireUpdateEnd(a)},_fixFieldNameCasing:function(a,b){var d=b.features||[],g=b.fields;if(!g||!d.length)return d;for(var g=this._mapFieldNameDifferences(a.fields,g),c=[],e,r,h=0,f=b.features.length;h<f;h++)e=d[h],r=this._swizzleResponseAttributes(e.attributes,
g),c.push({geometry:e.geometry,attributes:r});return c},_mapFieldNameDifferences:function(a,b){var d=[],g={},c,e;c=0;for(e=b.length;c<e;c++)d.push(b[c].name);c=0;for(e=a.length;c<e;c++){var r=a[c].name,h=this._checkForStreamFieldName(r,d);h&&(g[h]=r)}return g},_checkForStreamFieldName:function(a,b){for(var d=a.toLowerCase(),g,c=0,e=b.length;c<e;c++)if(b[c].toLowerCase()===d){g=b[c];break}return g},_swizzleResponseAttributes:function(a,b){var d={},g;for(g in a)if(a.hasOwnProperty(g)){var c=a[g];b.hasOwnProperty(g)?
d[b[g]]=c:d[g]=c}return d},_getExpiredFeatures:function(){var a,b,c,g=[],e=[];if(!this.featureLayer._endTimeField&&!this._maxFeatureAge)return e;a=1E3*Math.floor(this._lastEndTimeCheck/1E3);this._lastEndTimeCheck=b=1E3*Math.ceil(Date.now()/1E3);if(a&&a!==b)for(c=this._featuresByTime;a<=b;a+=1E3)c[a]&&(g=g.concat(c[a]),delete c[a]);n.forEach(g,function(a){(a=this._getFeature(a))&&e.push(a)},this);return e}});f("extend-esri")&&m.setObject("layers._StreamMode",q,e);return q})},"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(q,m,n,l,f,e,k,c,h,b){var a=-1!==e.renderer.toLowerCase().indexOf("canvas");q=q(null,{declaredClass:"esri.layers._TrackManager",constructor:function(a){this.layer=a;this.trackMap={};this.trackLineMap={}},initialize:function(d){this.map=d;var c=this.layer,e=c._getRenderer(),e=e&&e.trackRenderer;if("esriGeometryPoint"===c.geometryType){var g=this.container=new b._GraphicsLayer({id:c.id+"_tracks",_child:!0,visible:c.visible,minScale:c.minScale,maxScale:c.maxScale});g.loaded=!0;g.onLoad(g);g._setMap(d,
c._div);if(!a){d=g._div.getNode();var u=c._div.getNode();d&&u&&f.place(d,u,"first")}g.setRenderer(e);c.on("visibility-change",m.hitch(this,function(a){this.container.setVisibility(a.visible);this.container.evaluateSuspension()}));c.on("scale-range-change",m.hitch(this,function(){this.container.setScaleRange(this.layer.minScale,this.layer.maxScale)}))}},addFeatures:function(a){var b=this.trackMap,d=this.layer,g=d._trackIdField,c=[];n.forEach(a,function(a){var d=a.attributes[g];(b[d]=b[d]||[]).push(a);
-1===n.indexOf(c,d)&&c.push(d)});var e=d._startTimeField,r=d.objectIdField,h=function(a,b){var g=a.attributes[e],d=b.attributes[e];return g===d?a.attributes[r]<b.attributes[r]?-1:1:g<d?-1:1};n.forEach(c,function(a){b[a].sort(h)})},trimTracks:function(a){function b(a){for(a=d[a]||[];a.length>g;)c.push(a.shift())}var d=this.trackMap,g=this.layer.maximumTrackPoints||0,c=[],e;if(!g)return c;if(a)n.forEach(a,function(a){b(a)});else for(e in d)d.hasOwnProperty(e)&&b(e);return c},drawTracks:function(a){function b(a){var b=
e[a],u,f,k;f=d.trackLineMap[a];g.remove(f);delete d.trackLineMap[a];f=null;if(!b||2>b.length)return!1;f=[];for(u=b.length-1;0<=u;u--)(k=b[u].geometry)&&f.push([k.x,k.y]);b={};b[r]=a;1<f.length&&(f=new c(new h({paths:[f],spatialReference:p}),null,b),g.add(f),d.trackLineMap[a]=f)}var d=this,g=this.container,e,p,r,f;if(g)if(e=this.trackMap,p=this.map.spatialReference,r=this.layer._trackIdField,a)n.forEach(a,function(a){b(a)});else for(f in e)e.hasOwnProperty(f)&&b(f)},refreshTracks:function(a){function b(a){var b,
p;d.drawTracks([a]);if(e&&e.latestObservationRenderer)for(a=g[a]||[],b=a.length,p=0;p<b;p++)c._repaint(a[p],null,!0)}var d=this,g=this.trackMap,c=this.layer,e=c._getRenderer(),r;if(a)n.forEach(a,function(a){b(a)});else for(r in g)g.hasOwnProperty(r)&&b(r);this.moveLatestToFront()},moveLatestToFront:function(a){n.forEach(this.getLatestObservations(a),function(a){var b=a._shape;b&&b._moveToFront();this._repaint(a,null,!0)},this.layer)},getLatestObservations:function(a){function b(a){a=c[a];return a[a.length-
1]}var d=[],g=this.layer._getRenderer(),c=this.trackMap,e;if(!g.latestObservationRenderer)return d;if(a)n.forEach(a,function(a){d.push(b(a))});else for(e in c)c.hasOwnProperty(e)&&d.push(b(e));return d},clearTracks:function(a){var b=this.getLatestObservations(a),d=this.container,g;a?n.forEach(a,function(a){delete this.trackMap[a];d&&(g=this.trackLineMap[a],d.remove(g),delete this.trackLineMap[a])},this):(this.trackMap={},this.trackLineMap={},d&&d.clear());n.forEach(b,function(a){this._repaint(a,null,
!0)},this.layer)},isLatestObservation:function(a){var b=this.trackMap[a.attributes[this.layer._trackIdField]];return b?b[b.length-1]===a:!1},destroy:function(){var a=this.container;a&&(a.clear(),a._unsetMap(this.map,this.layer._div));this.map=this.layer=this.trackMap=this.container=null}});l("extend-esri")&&m.setObject("layers._TrackManager",q,k);return q})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t){function v(){}function g(a){var b=a.layer;return{geometry:a.geometry,attributes:a.attributes,getLayer:function(){return b}}}q=q(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(b){this.map=b;var g=this.sourceLayer,d=g.renderer;g.setDrawMode(!1);this.imageLayer=b._getMapImageLyr();var c=this;this.heatmapRenderer=
d instanceof a?d:(d.getRendererInfoByZoom(b.getZoom())||d.getRendererInfoByScale(b.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);f(["../workers/heatmapCalculator"],function(a){c._calculator=new a(m.mixin({width:c.map.width,height:c.map.height},c._getOptions()));c._setupRenderer();c.heatmapRenderer.getStats=a.calculateStats;c.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(b){var g=b.renderer,d=g instanceof a;this.heatmapRenderer?d?this.heatmapRenderer=g:this._removeRenderer(b):d&&(this.heatmapRenderer=g,this.sourceLayer&&this.map&&this._setupRenderer())},_handleOpacityChange:function(a){a=a.opacity;var b=this._getImageBySourceId(this.sourceLayer.id);b&&b.setOpacity(a)},_setupRenderer:function(){var a=this._hndls,b=this.sourceLayer,g=this.map,d=this;b._originalDraw=b._draw;b._draw=v;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(n.after(b,"redraw",this._setupDraw));a.push(g.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(g.on("resize, pan-end",this._setupDraw)),a.push(g.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&&!g.spatialReference.equals(b.graphics[0].geometry.spatialReference)&&l.forEach(b.graphics,function(a){this._reprojectFeature(a)}.bind(this)),this._setupDraw())},_setupDraw:function(){if(!this._drawTimer){var b=
this;this._drawTimer=setTimeout(function(){clearTimeout(b._drawTimer);b._drawTimer=null;b.sourceLayer._getRenderer().isInstanceOf(a)&&b.recalculateHeatmap()},16)}},_removeRenderer:function(a){var b=a.target;b._draw=b._originalDraw;delete b._originalDraw;b.setDrawMode(!0);this._removeHandlers();this._hndls=[];var g=this._getImageBySourceId(this.sourceLayer.id);g&&this.imageLayer.removeImage(g);clearTimeout(this._drawTimer);clearTimeout(this._resetTimer);this._drawTimer=this._resetTimer=null;b.renderer!=
a.renderer&&b.renderer.getRendererInfo?this.heatmapRenderer=null:(b.redraw(),this.destroy())},recalculateHeatmap:function(){this._calculator?this._doMainCalculation():this._calculatorClient&&this._doWorkerCalculation()},_reprojectFeature:function(a){if(a&&a.geometry){var b=a.geometry,g=this.map.spatialReference;g.equals(b.spatialReference)||(b=h.project(b,g),null==b?console.log("Unable to reproject features to map's spatial reference. Please convert feature geometry before adding to layer"):a.geometry=
b)}},_doWorkerCalculation:function(){},_doMainCalculation:function(){var a=this.sourceLayer,c=this.map,e=this.heatmapRenderer,h=this.map.extent,f=this.map.width,k=this.map.height,t=this._calculator,v=this,l=function(d){d=v._getScreenPoints(d.features,c,a);d=t.calculateImageData(m.mixin({screenPoints:d,mapinfo:{extent:[h.xmin,h.ymin,h.xmax,h.ymax],resolution:c.getResolution()},width:f,height:k},v._getOptions()));d=e.getSymbol(g({geometry:c.extent,attributes:{size:[f,k],imageData:d},layer:a}));d=new b({extent:c.extent,
href:d.url,opacity:0,sourceId:a.id});v._swapMapImages(d,v._getImageBySourceId(a.id));a.suspended&&d.hide()},n={geometry:c.extent,timeExtent:a.useMapTime?c.timeExtent:void 0,spatialRelationship:d.SPATIAL_REL_INTERSECTS};null!=a._canDoClientSideQuery(n)?a.queryFeatures(n,l):l({features:a.graphics})},_getScreenPoints:function(a,b,d){var g=[],e=a.length,p=0,h=0,r,u=new c(b.extent.xmin,b.extent.ymax,b.spatialReference),f=b.toScreen(u),k=f.x,f=f.y,t=b.getResolution(),v;for((h=b.extent.getCacheValue("_parts"))&&
(v=l.map(h,function(a){return d._intersects(b,a.extent)[0]}));e--;)h=a[e],h.geometry&&(r={x:Math.ceil((h.geometry.x-u.x)/t+k),y:Math.floor((u.y-h.geometry.y)/t-f),attributes:h.attributes},v&&(h=1<v.length&&r.x<-v[0]?v[1]:v[0],r.x+=h),g[p++]=r);return g},_getImageBySourceId:function(a){var b=this.imageLayer.getImages(),b=l.filter(b,function(b){return b.sourceId==a});if(b.length)return b[b.length-1]},_swapMapImages:function(a,b){function d(){g.removeImage(b)}var g=this.imageLayer,c=this.sourceLayer.opacity;
g.addImage(a);t.anim(a._node,{opacity:c},null,null,function(){a.opacity=c});null!=b&&t.anim(b._node,{opacity:0},null,null,d)},_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,d;b--;)d=a[b],d._shape=d._offsets=void 0}});k("extend-esri")&&m.setObject("layers.HeatmapManager",q,e);return q})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A){var y=A.layers.clusters,B=A.widgets.popup,x=y.numFeatures,w=Math.pow(2,53)-1;q=q(e,{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?m.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 a=this.layer,b=new g._GraphicsLayer({_child:!0,id:a.id+"_clusters",visible:a.visible,minScale:a.minScale,maxScale:a.maxScale,infoTemplate:this._infoTemplate});b.fields=this._fields;b.setRenderer(this._renderer);b.loaded=!0;b.onLoad(b);b._setMap(this._map,a._div);return a._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 p({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",m.hitch(this,function(){this._applyRenderer();this._initClusterUpdates()})),a.on("load-error",m.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,b=this._getClusterRendererInfo(),d=this._compareStatInfos(this._statisticInfos,b.statisticInfos);d&&(this._statisticInfos=b.statisticInfos,this._clusterGenerator&&(this._clusterGenerator.setStatisticInfos(n.map(this._statisticInfos,function(a){return{attributeInfo:a.attributeInfo,statisticType:a.statisticType}})),a&&n.forEach(a.graphics,function(a){this._applyClusterAttributes(a,
a.getAggregationInfo())},this)));this._renderer=b.renderer;this._applyFields();this._applyInfoTemplate(!!d&&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 b=this.aggregationInfo,b=b&&b.infoTemplate||this._infoTemplate;a=a||!b?this._createInfoTemplate():this._updateInfoTemplate(b)}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 b=new t(null,"cluster_count");b.addBreak({minValue:-w,maxValue:w,symbol:a?new a.constructor(a.toJson()):new v(m.clone(this.defaults.markerSymbol))});return b},_createClusterRenderer:function(a){if(!this._isSupportedRenderer(a))return this._getDefaultClusterRenderer();var b,d=[];if(this._isSimpleRenderer(a))b=this._createContinuousCountRenderer(a.symbol);else{b=new a.constructor(a.toJson());var g=this._getRendererAttributeInfo(a),
c;this._isCBRenderer(b)?(c=r.getClusterField(g,"avg"),d.push(this._getStatInfo(g,"avg")),b.normalizationType=null,b.normalizationField=null,b.normalizationTotal=null):this._isUVRenderer(b)&&(c=r.getClusterField(g,"type"),d.push(this._getStatInfo(g,"type")));b.attributeField=c;b.setValueExpression(null);b.valueExpressionTitle=null;b.setVisualVariables(null);this._setRendererTitle(b,a)}a=this._getSupportedVariables(a);g=this._createClusterVariables(a.allVars,d);b.setVisualVariables(g);a.sizeVars.length||
this._isCBSizeRenderer(b)||this._addSizeByCountVariable(b);return{renderer:b,statisticInfos:d}},_isSupportedRenderer:function(a){if(this._isSimpleRenderer(a))return!0;if(this._isCBRenderer(a)){var b=a.normalizationType;return"function"===typeof a.attributeField||b&&"field"!==b?!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 b=a.infos;if(!this._isCBRenderer(a)||!b||2>b.length)return!1;var d=Infinity,g=-Infinity;n.forEach(b,function(a){if(a=a.symbol){var b=0;switch(a.type){case "simplemarkersymbol":b=a.size;break;case "picturemarkersymbol":b=(a.width+a.height)/2}d=Math.min(d,b);g=Math.max(g,b)}});return Infinity!==d&&-Infinity!==
g&&d!==g},_getRendererAttributeInfo:function(a){var b=a.attributeField,d=b?this.layer.getField(b):null;return{field:b,attributeType:d&&"esriFieldTypeDate"===d.type?"date":null,rotationType:null,valueExpression:a.valueExpression,valueExpressionTitle:a.valueExpressionTitle,normalizationField:a.normalizationField}},_setRendererTitle:function(a,b){a.legendOptions=m.clone(b.legendOptions);a.legendOptions&&a.legendOptions.title||(a.legendOptions=a.legendOptions||{},a.legendOptions.title=d.getRendererTitle(b,
this.layer))},_getSupportedVariables:function(a){var b=a.getVisualVariablesForType("colorInfo",!1)||[],d=a.getVisualVariablesForType("sizeInfo",!1)||[],g=a.getVisualVariablesForType("opacityInfo",!1)||[];a=a.getVisualVariablesForType("rotationInfo",!1)||[];b=n.filter(b,this._variableFilter);d=n.filter(d,this._variableFilter);g=n.filter(g,this._variableFilter);a=n.filter(a,this._variableFilter);return{sizeVars:d,allVars:b.concat(d).concat(g).concat(a)}},_variableFilter:function(a){return"function"!==
typeof a.field},_createClusterVariables:function(a,b){return n.map(a,function(a){return this._createVarForAvg(a,b)},this)},_createVarForAvg:function(a,b){var d=m.clone(a),g=this._getVariableAttributeInfo(a);d.field=r.getClusterField(g,"avg");d.normalizationField=null;d.valueExpression=null;d.valueExpressionTitle=null;g=this._getStatInfo(g,"avg");this._addStatInfo(b,g);this._setVariableTitle(d,a);return d},_getVariableAttributeInfo:function(a){var b="rotationInfo"===a.type,d=b?"angle":null,b=b?a.rotationType:
null,g=a.legendOptions&&a.legendOptions.title,c=a.field,e=c?this.layer.getField(c):null;e&&"esriFieldTypeDate"===e.type&&(d="date");return{field:c,attributeType:d,rotationType:b,valueExpression:a.valueExpression,valueExpressionTitle:a.valueExpressionTitle||a.valueExpression&&g,normalizationField:a.normalizationField}},_setVariableTitle:function(a,b){a.legendOptions&&a.legendOptions.title||(a.legendOptions=a.legendOptions||{},a.legendOptions.title=d.getVisualVariableTitle(b,this.layer))},_getStatInfo:function(a,
b){return{statisticHash:r.getStatisticHash(a,b),attributeInfo:a,statisticType:b}},_addStatInfo:function(a,b){var d=this._findStatInfo(a,b);d?d.attributeInfo.valueExpressionTitle||(d.attributeInfo.valueExpressionTitle=b.attributeInfo.valueExpressionTitle):a.push(b)},_findStatInfo:function(a,b){var d;n.some(a,function(a){a.statisticHash===b.statisticHash&&(d=a);return!!d});return d},_compareStatInfos:function(a,b){var d=n.filter(a,function(a){return!this._findStatInfo(b,a)},this),g=n.filter(b,function(b){return!this._findStatInfo(a,
b)},this);return g.length||d.length?{added:g,removed:d}:null},_addSizeByCountVariable:function(a){var b=this._createSizeByCountVariable();b&&this._addVariable(a,b)},_getSizeByCountVariable:function(a){a=a.getVisualVariablesForType("sizeInfo",!1)||[];return n.filter(a,function(a){return"cluster_count"===a.field})[0]},_updateSizeByCountVariable:function(){var a=this._renderer,b=this._getSizeByCountVariable(a);if(b){var d=this._createSizeByCountVariable();d&&this._replaceVariable(a,b,d)}},_createSizeByCountVariable:function(){var a=
this._clusterGenerator,b;if(a){b=a.getCurrentLodStats();var d=a.getNumFeatures(),a=a.clusters,g=b.min,c=b.max;1===b.count&&g===d||1===a.length&&a[0].count===d?(g=1,c=d):g&&g===c&&(c=2*g);b={type:"sizeInfo",field:"cluster_count",valueUnit:"unknown",minSize:12,maxSize:50,minDataValue:g,maxDataValue:c,legendOptions:{title:x}}}return b},_addVariable:function(a,b){var d=a.visualVariables||[];d.push(b);a.setVisualVariables(d)},_replaceVariable:function(a,b,d){var g=a.visualVariables;b=n.indexOf(g,b);-1<
b&&g.splice(b,1);g.push(d);a.setVisualVariables(g)},_getFields:function(a){var b=[new u({name:"cluster_count",type:"esriFieldTypeInteger"})];n.forEach(a,function(a){var d=a.statisticType;a=a.attributeInfo;var g;"avg"===d?g="date"===a.attributeType?"esriFieldTypeDate":"esriFieldTypeDouble":"type"===d&&(g=a.field?this.layer.getField(a.field).type:"esriFieldTypeString");b.push(new u({name:r.getClusterField(a,d),type:g}))},this);return b},_createInfoTemplate:function(){var b=this._statisticInfos,d=this._renderer,
g=[{fieldName:"cluster_count",label:x,visible:!0,format:{digitSeparator:!0,places:0}}],e=[],p=[c.substitute({count:"{cluster_count}"},y.countSummary)],h=this._isUVRenderer(d)?d.infos:[];n.forEach(b,function(a){var b,d,c=a.statisticType,u=a.attributeInfo,f=r.getClusterField(u,c),k=this._getFieldLabel(a);"avg"===c?(b={fieldName:f,label:k,visible:!0,format:"date"===u.attributeType?{dateFormat:"shortDateShortTime"}:{digitSeparator:!0,places:1}},d=this._getFieldSummary(a,f)):"type"===c&&(d="expression/"+
f,b={fieldName:d,visible:!0},e.push({name:f,title:k,returnType:"string",expression:this._getExpression(h,f)}),d=this._getFieldSummary(a,d));b&&g.push(b);d&&p.push(d)},this);return new a({fieldInfos:g,expressionInfos:e,description:p.join("\x3cbr/\x3e\x3cbr/\x3e")})},_updateInfoTemplate:function(b){var d=b.toJson(),g=this._isUVRenderer(this._renderer)?this._renderer.infos:[];n.forEach(this._statisticInfos,function(a){var b=a.statisticType;a=r.getClusterField(a.attributeInfo,b);"type"===b&&(b=this._findExpressionInfo(a,
d))&&(b.expression=this._getExpression(g,a))},this);return new a(d)},_findExpressionInfo:function(a,b){var d;n.some(b.expressionInfos,function(b){b.name===a&&(d=b);return!!d});return d},_escapeDoubleQuotes:function(a){return a?a.replace(/"/g,'\\"'):""},_getExpression:function(a,b){return["var uvInfos \x3d ["+this._getObjects(a).join(", ")+"];",'var predominantType \x3d Text($feature["'+b+'"]);','var label \x3d "'+this._escapeDoubleQuotes(y.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 n.map(a,function(a){return'{"value": "'+String(a.value)+'","label": "'+this._escapeDoubleQuotes(String(a.label))+'"}'},this)},_getFieldLabel:function(a){var b=a.statisticType,d=a.attributeInfo,g=d.field;a=d.normalizationField;var e="",p;"avg"===b?p=a?y.avgNormFieldLabel:y.avgFieldLabel:"type"===b&&(p=y.predominantFieldLabel);p&&(b=d.valueExpression?d.valueExpressionTitle:this.layer.getFieldLabel(g),a=a&&this.layer.getFieldLabel(a),e=c.substitute({fieldLabel:b||"",normFieldLabel:a||
""},p));return e},_getFieldSummary:function(a,b){var d=a.statisticType,g=a.attributeInfo,e=g.field,p=g.normalizationField,h="",r;"avg"===d?r=p?y.avgNormFieldSummary:y.avgFieldSummary:"type"===d&&(r=y.predominantFieldSummary);r&&(d=g.valueExpression?g.valueExpressionTitle:this.layer.getFieldLabel(e),p=p&&this.layer.getFieldLabel(p),h=c.substitute({fieldLabel:d||"",normFieldLabel:p||"",fieldValue:"{"+b+"}"},r));return h},_removeFromPopup:function(a){var b=this._map.infoWindow,d=b.features;if(d&&d.length){var g=
n.filter(d,function(b){return b.getLayer()!==a});g.length<d.length&&(g.length?b.setFeatures(g):(b.clearFeatures(),b.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,b){var d=b.clusterFillSymbol;d&&(d=new d.constructor(d.toJson()));d=new k(a,d);this._map.graphics.add(d);
this._clusterBoundary=d},_removeClusterBoundary:function(){this._map.graphics.remove(this._clusterBoundary);this._clusterBoundary=null},_createBrowseFeaturesAction:function(){return this._map.infoWindow.addActions([{title:B.NLS_browseFeatures,className:"browseFeatures",callback:m.hitch(this,function(a){a.preventDefault();a=this._map.infoWindow;var d=a.getSelectedFeature(),g=d.getChildGraphics(),c=a.getCurrentAnchor();a.setFeatures(g,{anchor:c});if(g=b.graphicsExtent(g))this._addClusterBoundary(g,
a),a.show(this._getPopupLocation(g,c));this._popupClusterGraphic=d})}])[0]},_getPopupLocation:function(a,b){var d=a.getCenter();b=b.toLowerCase();-1<b.indexOf("top")?d.update(d.x,a.ymax):-1<b.indexOf("bottom")?d.update(d.x,a.ymin):-1<b.indexOf("left")?d.update(a.xmin,d.y):d.update(a.xmax,d.y);return d},_createViewSummaryAction:function(){return this._map.infoWindow.addActions([{title:B.NLS_viewSummary,className:"viewSummary",callback:m.hitch(this,function(a){a.preventDefault();a=this._popupClusterGraphic;
var b=this._map.infoWindow;b.setFeatures([a]);b.show(a.geometry);this._popupClusterGraphic=null})}])[0]},_initClusterUpdates:function(){this._updateSizeVariable();this._updateClusterGraphics();this._eventHandles.push(this._clusterGenerator.on("update-end",m.hitch(this,function(a){a.mapLevelChange&&this._updateSizeVariable();this._updateClusterGraphics()})),this._clusterGenerator.on("index-complete",m.hitch(this,function(){this._updateSizeVariable()})))},_updateClusterGraphics:function(){this._hideSingleGraphics();
var a=[],b=[];n.forEach(this._clusterGenerator.clusters,function(d){var g=new k(d.centroid);g.setAggregationSourceLayer(this.layer);g.setAggregationInfo(d);this._applyClusterAttributes(g,d);1===d.count?(d=this._getSingleGraphic(g),b.push(d)):a.push(g)},this);this._showSingleGraphics(b);this._addGraphics(a)},_addGraphics:function(a){var b=this.container;b.clear();n.forEach(a,function(a){b.add(a)})},_getSingleGraphic:function(a){var b=this._clusterGenerator.getCell(a.getAggregationInfo().primary).features[0],
d=this.layer.renderer,d=d&&d.getSymbol(b),g=this._getSizeByCountVariable(this._renderer);d&&g&&(a=g?this._renderer.getSize(a,{sizeInfo:g,shape:d.style,resolution:this._map.getResolutionInMeters(),scale:this._map.getScale()}):null,b.setSize(a));return b},_showSingleGraphics:function(a){n.forEach(a,this._showSingleGraphic);this._singleGraphics=a},_hideSingleGraphics:function(){n.forEach(this._singleGraphics,function(a){a.setSize(null);this._hideSingleGraphic(a)},this);this._singleGraphics=null},_clearSingleGraphics:function(){n.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,b){a.setAttributes(b.attributes)},_createLayerEventListeners:function(){var a=this.layer;this._eventHandles.push(a.on("visibility-change",m.hitch(this,
function(a){this.container.setVisibility(a.visible)})),a.on("scale-range-change",m.hitch(this,function(){this.container.setScaleRange(this.layer.minScale,this.layer.maxScale)})),a.on("renderer-change",m.hitch(this,function(){this._applyRenderer()})),a.on("info-template-change",m.hitch(this,function(){this._applyInfoTemplate()})))},_createMapEventListeners:function(){this._eventHandles.push(this._map.on("zoom-start",m.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",m.hitch(this,function(){this._resetClusterNavPartial();var a=this._map.infoWindow.getSelectedFeature(),b=a&&a.getLayer();if(b){var d;b===this.container?(this._removeClusterBoundary(),d=this._createBrowseFeaturesAction()):b===this.layer&&a._suspended?(d=this._createViewSummaryAction(),
this._popupSingleGraphic=a,this._showSingleGraphic(a)):this._removeClusterBoundary();this._popupActions=d?[d]:null}})),a.on("clear-features",m.hitch(this,function(a){this._resetClusterNav();a.isIntermediate||this._removeClusterBoundary()})),a.on("hide",m.hitch(this,function(){this._popupSingleGraphic&&this._popupSingleGraphic.hide();this._clusterBoundary&&this._clusterBoundary.hide()})),a.on("show",m.hitch(this,function(){this._popupSingleGraphic&&this._popupSingleGraphic.show();this._clusterBoundary&&
this._clusterBoundary.show()})))},_destroyEventListeners:function(){n.forEach(this._eventHandles,function(a){a.remove()})}});l("extend-esri")&&m.setObject("layers.clustering.ClusterManager",q,f);return q})},"esri/dijit/PopupTemplate":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dojo/dom-construct ../kernel ../InfoTemplate ../PopupInfo ./PopupRenderer".split(" "),function(q,m,n,l,f,e,k,c){q=q([e,k],{declaredClass:"esri.dijit.PopupTemplate","-chains-":{constructor:"manual"},chartTheme:null,
constructor:function(c,b){m.mixin(this,b);this.initialize(c,b)},getTitle:function(c){var b;this.info&&(b=this.titleHasRelatedFields?"":this._getPopupValues(c,null,!0).title);return b||""},getContent:function(e){return this.info?(new c({template:this,graphic:e,chartTheme:this.chartTheme},l.create("div"))).domNode:""}});n("extend-esri")&&m.setObject("dijit.PopupTemplate",q,f);return q})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A,y,B){q=q(null,{declaredClass:"esri.PopupInfo",_reExprField:/^\s*expression\//i,_exprPrefix:"expression/",_relatedFieldPrefix:"relationships/",initialize:function(a,b){if(a){m.mixin(this,b);this.info=a;this.title=this.getTitle;this.content=this.getContent;this._exprCache=this._compileExpressions(this.info.expressionInfos);var d=this._fieldLabels={},g=this._fieldsMap={};this.info.fieldInfos&&n.forEach(this.info.fieldInfos,function(a){var b=a.fieldName.toLowerCase(),
c=this._isExpressionField(b)?this.getExpressionInfo(b):null;d[b]=c?c.title:a.label;g[b]=a},this);this.titleHasRelatedFields=!(!this.info.title||-1===this.info.title.indexOf("{"+this._relatedFieldPrefix))}},toJson:function(){return l.fromJson(l.toJson(this.info))},getTitle:function(){},getContent:function(){},getFieldInfo:function(a){var b;n.some(this.info&&this.info.fieldInfos,function(d){d.fieldName===a&&(b=d);return!!b});return b},getExpressionInfo:function(a){if(this._isExpressionField(a)){a=a.replace(this._reExprField,
"");a=a.toLowerCase();var b;n.some(this.info.expressionInfos,function(d){d.name.toLowerCase()===a&&(b=d);return!!b});return b}},hasGeometryOperations:function(){return n.some(this.info.expressionInfos,function(a){return A.hasGeometryOperations(a.expression)})},getComponents:function(a){var b=this.info,d={};b.fieldInfos&&(b=n.filter(b.fieldInfos,function(a){return-1!==a.fieldName.indexOf(this._relatedFieldPrefix)},this))&&0<b.length&&(d.relatedInfo=this._getRelatedRecords({graphic:a,fieldsInfo:b}));
this._needFullResolutionFeature(a)&&(d.fullResolutionFeature=this._getFullResolutionFeature(a));return v(d).then(m.hitch(this,function(b){return this._getPopupValues(a,b.fullResolutionFeature)}))},getAttachments:function(a){var b=a.getSourceLayer();a=a.attributes;if(this.info.showAttachments&&b&&b.hasAttachments&&b.objectIdField&&(a=a&&a[b.objectIdField]))return b.queryAttachmentInfos(a)},_needFullResolutionFeature:function(a){return(a=a.getSourceLayer())?"esriGeometryPoint"!==a.geometryType&&"function"===
typeof a.getMaxAllowableOffset&&0<a.getMaxAllowableOffset()&&this.hasGeometryOperations():!1},_getFullResolutionFeature:function(a){var b=a.getSourceLayer(),d=b.objectIdField;a=(a=a.attributes)&&d&&a[d];if(null==a)return null;var c=new g;c.objectIds=[a];c.maxAllowableOffset=0;c.outFields=[d];return b.queryFeatures(c).then(function(a){return a.features&&a.features[0]})},_isExpressionField:function(a){return this._reExprField.test(a)},_compileExpressions:function(a){var b={};n.forEach(a,function(a){var d=
a.returnType&&a.returnType.toLowerCase();b[a.name]=y.createAttributeCache({valueExpression:a.expression},"number"!==d)});return b},_fetchAttributes:function(a,d){var g=m.clone(a.attributes)||{},c=d&&d.geometry,e=this._exprPrefix,p=this._exprCache;n.forEach(this.info.expressionInfos,function(d){var h=e+d.name;d=(d=p[d.name])?a._getDataValue(d.attributeInfo,d,A,null,c):null;"string"===typeof d&&(d=b.encode(d));g[h]=d});return g},_getPopupValues:function(b,d,g){var c=this.info,e=b.getSourceLayer(),p=
this._fetchAttributes(b,d),h=m.clone(p);d=c.fieldInfos;var r="",u="",f,k,t,v,l,A=e&&e._getDateOpts&&e._getDateOpts().properties,A=A&&A.slice(0),w={dateFormat:{properties:A,formatter:"DateFormat"+this._insertOffset(this._dateFormats.shortDateShortTime)}};if(this._relatedInfo)for(v in this._relatedInfo)if(this._relatedInfo.hasOwnProperty(v)){var x=this._relatedInfo[v],y=this._relatedLayersInfo[v];x&&(n.forEach(x.relatedFeatures,function(a){for(l in a.attributes)if(a.attributes.hasOwnProperty(l)&&"esriRelCardinalityOneToOne"===
y.relation.cardinality){var b=this._toRelatedFieldName([y.relation.id,l]);p[b]=h[b]=a.attributes[l]}},this),n.forEach(x.relatedStatsFeatures,function(a){for(l in a.attributes)if(a.attributes.hasOwnProperty(l)){var b=this._toRelatedFieldName([y.relation.id,l]);p[b]=h[b]=a.attributes[l]}},this))}d&&n.forEach(d,function(a){k=a.fieldName;var b=this._getLayerFieldInfo(e,k);b&&(k=a.fieldName=b.name);h[k]=this._formatValue(h[k],k,w);A&&a.format&&a.format.dateFormat&&(a=n.indexOf(A,k),-1<a&&A.splice(a,1))},
this);if(e){v=e.types;var q=(x=e.typeIdField)&&p[x];for(k in p)if(p.hasOwnProperty(k)&&-1===k.indexOf(this._relatedFieldPrefix)&&(t=p[k],a.isDefined(t))){var z=this._getDomainName(e,b,v,q,k,t);a.isDefined(z)?h[k]=z:k===x&&(z=this._getTypeName(e,b,t),a.isDefined(z)&&(h[k]=z))}}c.title&&(r=this._processFieldsInLinks(this._fixTokens(c.title,e),p),r=m.trim(a.substitute(h,r,w)||""));if(g)return{title:r};c.description&&(u=this._processFieldsInLinks(this._fixTokens(c.description,e),p),u=m.trim(a.substitute(h,
u,w)||""));d&&(f=[],n.forEach(d,function(b){(k=b.fieldName)&&b.visible&&f.push([this._fieldLabels[k.toLowerCase()]||k,a.substitute(h,"${"+k+"}",w)||""])},this));var B,Q;c.mediaInfos&&(B=[],n.forEach(c.mediaInfos,function(b){Q=0;t=b.value;switch(b.type){case "image":var d=t.sourceURL,d=d&&m.trim(a.substitute(p,this._fixTokens(d,e)));Q=!!d;break;case "piechart":case "linechart":case "columnchart":case "barchart":var g,d=t.normalizeField;t.fields=n.map(t.fields,function(a){return(g=this._getLayerFieldInfo(e,
a))?g.name:a},this);d&&(g=this._getLayerFieldInfo(e,d),t.normalizeField=g?g.name:d);Q=n.some(t.fields,function(b){return a.isDefined(p[b])||-1!==b.indexOf(this._relatedFieldPrefix)&&this._relatedInfo},this);break;default:return}if(Q){b=m.clone(b);t=b.value;var d=b.title?this._processFieldsInLinks(this._fixTokens(b.title,e),p):"",c=b.caption?this._processFieldsInLinks(this._fixTokens(b.caption,e),p):"";b.title=d?m.trim(a.substitute(h,d,w)||""):"";b.caption=c?m.trim(a.substitute(h,c,w)||""):"";if("image"===
b.type)t.sourceURL=a.substitute(p,this._fixTokens(t.sourceURL,e)),t.linkURL&&(t.linkURL=m.trim(a.substitute(p,this._fixTokens(t.linkURL,e))||""));else{var r,u;n.forEach(t.fields,function(a,b){if(-1!==a.indexOf(this._relatedFieldPrefix))u=this._getRelatedChartInfos(a,t,p,w),u instanceof Array?t.fields=u:t.fields[b]=u;else{var d=p[a],d=void 0===d?null:d;r=p[t.normalizeField]||0;d&&r&&(d/=r);t.fields[b]={y:d,tooltip:(this._fieldLabels[a.toLowerCase()]||a)+":\x3cbr/\x3e"+this._formatValue(d,a,w,!!r)}}},
this)}B.push(b)}},this));return{title:r,description:u,hasDescription:!!c.description,fields:f&&f.length?f:null,mediaInfos:B&&B.length?B:null,formatted:h,editSummary:e&&e.getEditSummary?e.getEditSummary(b):""}},_getRelatedChartInfos:function(b,d,g,c){var e,p,h,r,u,f;e=[];f=this._fromRelatedFieldName(b);u=f[0];p=this._relatedInfo[u];u=this._relatedLayersInfo[u];p&&n.forEach(p.relatedFeatures,function(p){p=p.attributes;var u,k;for(k in p)if(p.hasOwnProperty(k)&&k===f[1]){u={};r=p[k];d.normalizeField&&
(h=-1!==d.normalizeField.indexOf(this._relatedFieldPrefix)?p[this._fromRelatedFieldName(d.normalizeField)[1]]:g[d.normalizeField]);r&&h&&(r/=h);if(d.tooltipField)if(-1!==d.tooltipField.indexOf(this._relatedFieldPrefix)){var t=this._fromRelatedFieldName(d.tooltipField)[1],v=a.isDefined(p[t])?p[t]:t;u.tooltip=v+":\x3cbr/\x3e"+this._formatValue(r,t,c,!!h)}else u.tooltip=(this._fieldLabels[b.toLowerCase()]||b)+":\x3cbr/\x3e"+this._formatValue(r,d.tooltipField,c,!!h);else u.tooltip=r;u.y=r;e.push(u)}},
this);return"esriRelCardinalityOneToMany"===u.relation.cardinality||"esriRelCardinalityManyToMany"===u.relation.cardinality?e:e[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,b){var d=this;return a.replace(/(\{([^\{\r\n]+)\})/g,function(a,g,c){a=
d._getLayerFieldInfo(b,c);return"$"+(a?"{"+a.name+"}":g)})},_encodeAttributes:function(a){a=m.clone(a)||{};var b,d;for(b in a)(d=a[b])&&"string"===typeof d&&(d=encodeURIComponent(d).replace(/\'/g,"\x26apos;"),a[b]=d);return a},_processFieldsInLinks:function(a,b){var d=this._encodeAttributes(b),d=m.hitch(this,this._addValuesToHref,b,d);a&&(a=a.replace(this._reHref,d).replace(this._reHrefApos,d));return a},_addValuesToHref:function(b,d,g,c){c=c&&m.trim(c);g=a.substitute(c&&0===c.indexOf("${")?b:d,g);
this._reEmptyHref.test(g)?g='href\x3d"about:blank"':this._reEmptyHrefApos.test(g)&&(g="href\x3d'about:blank'");return g},_getLayerFieldInfo:function(a,b){return a&&a.getField?a.getField(b):null},_formatValue:function(b,d,g,c){var e=this._fieldsMap[d.toLowerCase()],p=e&&e.format;d=-1!==n.indexOf(g.dateFormat.properties,d);var h="number"===typeof b&&!d&&(!p||!p.dateFormat);if(!a.isDefined(b)||!e||!a.isDefined(p))return h?this._forceLTR(b):b;var r="",e=[],u=p.hasOwnProperty("places")||p.hasOwnProperty("digitSeparator"),
f=p.hasOwnProperty("digitSeparator")?p.digitSeparator:!0;if(u&&!d)r="NumberFormat",e.push("places: "+(a.isDefined(p.places)&&(!c||0<p.places)?Number(p.places):"Infinity")),e.length&&(r+="("+e.join(",")+")");else if(p.dateFormat)r="DateFormat"+this._insertOffset(this._dateFormats[p.dateFormat]||this._dateFormats.shortDateShortTime);else return h?this._forceLTR(b):b;var k=this._applyFormatting(b,r,g);u&&-1<b.constructor.toString().indexOf("Array")&&(k="",n.forEach(b,m.hitch(this,function(a,b){b&&(k+=
" ");k+=this._applyFormatting(a,r,g)})));u&&!f&&B.group&&(k=k.replace(new RegExp("\\"+B.group,"g"),""));d&&(k='\x3cspan class\x3d"esriDateValue"\x3e'+k+"\x3c/span\x3e");return h?this._forceLTR(k):k},_applyFormatting:function(b,d,g){return a.substitute({myKey:b},"${myKey:"+d+"}",g)||""},_forceLTR:function(a){var b=c("ie");return b&&10>=b?a:"\x3cspan class\x3d'esriNumericValue'\x3e"+a+"\x3c/span\x3e"},_insertOffset:function(b){b&&(b=a.isDefined(this.utcOffset)?b.replace(/\)\s*$/,", utcOffset:"+this.utcOffset+
")"):b);return b},_getDomainName:function(a,b,d,g,c,e){return(a=a.getDomain&&a.getDomain(c,{feature:b}))&&a.codedValues?a.getName(e):null},_getTypeName:function(a,b,d){return(a=a.getType&&a.getType(b))&&a.name},_getRelatedRecords:function(a){var b=a.graphic,d;this._relatedLayersInfoPromise||(this._relatedLayersInfoPromise=this._getRelatedLayersInfo(a).then(m.hitch(this,function(a){for(d in a)a.hasOwnProperty(d)&&a[d]&&(this._relatedLayersInfo[d].relatedLayerInfo=a[d])})));return this._relatedLayersInfoPromise.then(m.hitch(this,
function(){return this._queryRelatedLayers(b)})).then(m.hitch(this,function(a){this._setRelatedRecords(b,a);return a}))},_getRelatedLayersInfo:function(a){var b=a.fieldsInfo,d,g,c={};d=a.graphic.getSourceLayer();this._relatedLayersInfo||(this._relatedLayersInfo={});n.forEach(b,function(a){var b,g,c,e;b=this._fromRelatedFieldName(a.fieldName);g=b[0];b=b[1];g&&(!this._relatedLayersInfo[g]&&d&&d.relationships&&(n.some(d.relationships,function(a){if(a.id==g)return e=a,!0}),e&&(this._relatedLayersInfo[g]=
{relation:e,relatedFields:[],outStatistics:[]})),this._relatedLayersInfo[g]&&(this._relatedLayersInfo[g].relatedFields.push(b),a.statisticType&&(c=new r,c.statisticType=a.statisticType,c.onStatisticField=b,c.outStatisticFieldName=b,this._relatedLayersInfo[g].outStatistics.push(c))))},this);for(g in this._relatedLayersInfo)this._relatedLayersInfo.hasOwnProperty(g)&&this._relatedLayersInfo[g]&&(a=this._relatedLayersInfo[g].relation,a=d.url.replace(/[0-9]+$/,a.relatedTableId),this._relatedLayersInfo[g].relatedLayerUrl=
a,c[g]=t({url:a,content:{f:"json"},callbackParamName:"callback"}));return h(c)},_queryRelatedLayers:function(a){var b={},d;for(d in this._relatedLayersInfo)this._relatedLayersInfo.hasOwnProperty(d)&&(b[d]=this._queryRelatedLayer({graphic:a,relatedInfo:this._relatedLayersInfo[d]}));return h(b)},_queryRelatedLayer:function(a){var b,d,c,e,p,r,f,t,v,l,A,y,x;b=a.graphic;d=b.getSourceLayer();c=d.url.match(/[0-9]+$/g)[0];A=a.relatedInfo;l=A.relatedLayerInfo;y=A.relatedLayerUrl;a=A.relation;n.some(l.relationships,
function(a){if(a.relatedTableId===parseInt(c,10))return e=a,!0},this);e&&(p=new g,n.some(l.fields,function(a){if(a.name===e.keyField)return t=-1!==n.indexOf(["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble"],a.type)?"number":"string",!0}),e.relationshipTableId&&e.keyFieldInRelationshipTable?(x=new k,this._queryRelatedRecords(b,e).then(m.hitch(this,function(a){var c;(c=a[b.attributes[d.objectIdField]])?(a=n.map(c.features,function(a){return a.attributes[l.objectIdField]},
this),A.outStatistics&&0<A.outStatistics.length&&l.supportsStatistics&&(v=new g,v.objectIds=a,v.outFields=p.outFields,v.outStatistics=A.outStatistics),v&&(r=new u(y),r.execute(v).then(m.hitch(this,function(a){var b=[];b.push(c);b.push(a);x.resolve(b)})))):x.resolve()}))):(f="string"===t?e.keyField+"\x3d'"+b.attributes[a.keyField]+"'":e.keyField+"\x3d"+b.attributes[a.keyField],p.where=f,p.outFields=A.relatedFields,A.outStatistics&&0<A.outStatistics.length&&l.supportsStatistics&&(v=new g,v.where=p.where,
v.outFields=p.outFields,v.outStatistics=A.outStatistics),r=new u(y),f=[],f.push(r.execute(p)),v&&f.push(r.execute(v))));return f?h(f):x?x.promise:void 0},_setRelatedRecords:function(b,d){this._relatedInfo=[];for(var g in d)if(d.hasOwnProperty(g)&&d[g]){var c=d[g];this._relatedInfo[g]={};this._relatedInfo[g].relatedFeatures=c[0].features;a.isDefined(c[1])&&(this._relatedInfo[g].relatedStatsFeatures=c[1].features)}},_handlerErrorResponse:function(a,b){a.reject(b)},_fromRelatedFieldName:function(a){var b=
[];-1!==a.indexOf(this._relatedFieldPrefix)&&(a=a.split("/"),b=a.slice(1));return b},_toRelatedFieldName:function(a){var b="";a&&0<a.length&&(b=this._relatedFieldPrefix+a[0]+"/"+a[1]);return b},_queryRelatedRecords:function(a,b){var d=a.getSourceLayer(),g=new p;g.outFields=["*"];g.relationshipId=b.id;g.objectIds=[a.attributes[d.objectIdField]];return d.queryRelatedFeatures(g)}});e("extend-esri")&&(d.PopupInfo=d.PopupInfoTemplate=q);return q})},"dojox/html/entities":function(){define(["dojo/_base/lang"],
function(q){var m=q.getObject("dojox.html.entities",!0),n=function(f,e){var k,c;if(e._encCache&&e._encCache.regexp&&e._encCache.mapper&&e.length==e._encCache.length)k=e._encCache.mapper,c=e._encCache.regexp;else{k={};c=["["];var h;for(h=0;h<e.length;h++)k[e[h][0]]="\x26"+e[h][1]+";",c.push(e[h][0]);c.push("]");c=new RegExp(c.join(""),"g");e._encCache={mapper:k,regexp:c,length:e.length}}return f=f.replace(c,function(b){return k[b]})},l=function(f,e){var k,c;if(e._decCache&&e._decCache.regexp&&e._decCache.mapper&&
e.length==e._decCache.length)k=e._decCache.mapper,c=e._decCache.regexp;else{k={};c=["("];var h;for(h=0;h<e.length;h++){var b="\x26"+e[h][1]+";";h&&c.push("|");k[b]=e[h][0];c.push(b)}c.push(")");c=new RegExp(c.join(""),"g");e._decCache={mapper:k,regexp:c,length:e.length}}return f=f.replace(c,function(a){return k[a]})};m.html=[["\x26","amp"],['"',"quot"],["\x3c","lt"],["\x3e","gt"],["\u00a0","nbsp"]];m.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"]];m.encode=function(f,e){f&&(e?
f=n(f,e):(f=n(f,m.html),f=n(f,m.latin)));return f};m.decode=function(f,e){f&&(e?f=l(f,e):(f=l(f,m.html),f=l(f,m.latin)));return f};return m})},"esri/tasks/RelationshipQuery":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/_base/json","dojo/has","../kernel"],function(q,m,n,l,f){q=q(null,{declaredClass:"esri.tasks.RelationshipQuery",definitionExpression:"",relationshipId:null,returnGeometry:!1,objectIds:null,outSpatialReference:null,outFields:null,toJson:function(){var e={definitionExpression:this.definitionExpression,
relationshipId:this.relationshipId,returnGeometry:this.returnGeometry,maxAllowableOffset:this.maxAllowableOffset,geometryPrecision:this.geometryPrecision},f=this.objectIds,c=this.outFields,h=this.outSpatialReference;f&&(e.objectIds=f.join(","));c&&(e.outFields=c.join(","));h&&(e.outSR=h.wkid||n.toJson(h.toJson()));e._ts=this._ts;return e}});l("extend-esri")&&m.setObject("tasks.RelationshipQuery",q,f);return q})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A,y,B){var x=0,w=B.widgets.popup,z=B.widgets.templatePicker;m=m([y,g,u],{declaredClass:"esri.dijit._PopupRenderer",constructor:function(){this._nls=l.mixin({},w)},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(z.loading);this._contentDfd=this.template.getComponents(this.graphic).then(l.hitch(this,this._handleComponentsSuccess)).otherwise(l.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 d=this._mediaInfos,g=d.length,c=this.domNode,p=this._prevMedia,h=this._nextMedia;if(1<g){var r=0,u=0;f.forEach(d,function(a){"image"===a.type?r++:-1!==a.type.indexOf("chart")&&u++});r&&(b.set(this._imageCount,"innerHTML",r),e.query(".summary .image",
c).removeClass("hidden"));u&&(b.set(this._chartCount,"innerHTML",u),e.query(".summary .chart",c).removeClass("hidden"))}else e.query(".summary",c).addClass("hidden"),a.add(p,"hidden"),a.add(h,"hidden");d=this._mediaPtr;0===d?a.add(p,"hidden"):a.remove(p,"hidden");d===g-1?a.add(h,"hidden"):a.remove(h,"hidden");this._destroyFrame()},_displayMedia:function(){var d=this._mediaInfos[this._mediaPtr],g=d.title,c=d.caption,p=e.query(".mediaSection .hzLine",this.domNode)[0];b.set(this._mediaTitle,"innerHTML",
g);a[g?"remove":"add"](this._mediaTitle,"hidden");b.set(this._mediaCaption,"innerHTML",c);a[c?"remove":"add"](this._mediaCaption,"hidden");a[g&&c?"remove":"add"](p,"hidden");this._rid=null;if("image"===d.type)this._showImage(d);else{var h=this,g=["dojox/charting/Chart2D","dojox/charting/action2d/Tooltip"],c=d.value.theme||this.chartTheme;l.isString(c)&&(c=c.replace(/\./gi,"/"),-1===c.indexOf("/")&&(c="dojox/charting/themes/"+c));c||(c="./Rainbow");g.push(c);try{var r=this._rid=x++;q(g,function(a,
b,g){r===h._rid&&(h._rid=null,h._showChart(d.type,d.value,a,b,g))})}catch(N){console.log("PopupRenderer: error loading modules")}}},_preventNewTab:function(a){return(a=a&&l.trim(a).toLowerCase())&&(0===a.indexOf("mailto:")||0===a.indexOf("tel:"))},_showImage:function(b){a.add(this._mediaFrame,"image");var g=t.get(this._gallery,"height"),c=b.value,p;c.linkURL&&(p=d.create("a",{href:c.linkURL,target:this._preventNewTab(c.linkURL)?"":"_blank"},this._mediaFrame));c=b.refreshInterval?this._addURLParameter(c.sourceURL,
"timestamp",Date.now()):c.sourceURL;d.create("img",{className:"esriPopupMediaImage",src:c},p||this._mediaFrame);var h=e.query(".esriPopupMediaImage",this._mediaFrame)[0];this._imageLoadHandle=n.connect(h,"onload",this,function(){this._clearImageHandles();this._imageLoaded(h,g);this._initImageRefresh(b)})},_addURLParameter:function(a,b,d){var g=-1===a.indexOf("?")?"?":"\x26";return a+g+b+"\x3d"+d},_initImageRefresh:function(a){if(a.refreshInterval){var b=6E4*a.refreshInterval;this._imageRefreshHandle=
setTimeout(l.hitch(this,function(){this._destroyFrame();this._showImage(a)}),b)}},_clearImageHandles:function(){n.disconnect(this._imageLoadHandle);this._imageLoadHandle=null;clearTimeout(this._imageRefreshHandle);this._imageRefreshHandle=null},_showChart:function(b,g,c,e,p){a.remove(this._mediaFrame,"image");c=this._chart=new c(d.create("div",{"class":"chart"},this._mediaFrame),{margins:{l:4,t:4,r:4,b:4}});p&&c.setTheme(p);switch(b){case "piechart":c.addPlot("default",{type:"Pie",labels:!1});c.addSeries("Series A",
g.fields);break;case "linechart":c.addPlot("default",{type:"Markers"});c.addAxis("x",{min:0,majorTicks:!1,minorTicks:!1,majorLabels:!1,minorLabels:!1});c.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});f.forEach(g.fields,function(a,b){a.x=b+1});c.addSeries("Series A",g.fields);break;case "columnchart":c.addPlot("default",{type:"Columns",gap:3});c.addAxis("y",{includeZero:!0,vertical:!0,fixUpper:"minor"});c.addSeries("Series A",g.fields);break;case "barchart":c.addPlot("default",{type:"Bars",
gap:3}),c.addAxis("x",{includeZero:!0,fixUpper:"minor",minorLabels:!1}),c.addAxis("y",{vertical:!0,majorTicks:!1,minorTicks:!1,majorLabels:!1,minorLabels:!1}),c.addSeries("Series A",g.fields)}this._action=new e(c);c.render()},_destroyFrame:function(){this._rid=null;this._clearImageHandles();this._chart&&(this._chart.destroy(),this._chart=null);this._action&&(this._action.destroy(),this._action=null);b.set(this._mediaFrame,"innerHTML","")},_imageLoaded:function(a,b){var d=a.height;d<b&&t.set(a,"marginTop",
Math.round((b-d)/2)+"px")},_attListHandler:function(a,d){if(a===this._attachmentsDfd){this._attachmentsDfd=null;var g="";d instanceof Error||!d||!d.length||f.forEach(d,function(a){g+="\x3cli\x3e";g+="\x3ca href\x3d'"+A.addProxy(a.url)+"' target\x3d'_blank'\x3e"+(a.name||"[No name]")+"\x3c/a\x3e";g+="\x3c/li\x3e"});b.set(this._attachmentsList,"innerHTML",g||"\x3cli\x3e"+this._nls.NLS_noAttach+"\x3c/li\x3e")}},_supportedURIInfos:[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,label:w.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:w.NLS_openLinkInApp},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,appName:"Collector",label:w.NLS_openLinkInApp},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,appName:"Explorer",label:w.NLS_openLinkInApp},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,appName:"Navigator",label:w.NLS_openLinkInApp},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,
appName:"Survey123",label:w.NLS_openLinkInApp},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,appName:"Trek2There",label:w.NLS_openLinkInApp},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,appName:"Workforce",label:w.NLS_openLinkInApp},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,appName:"iForm",label:w.NLS_openLinkInApp},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,appName:"FlowFinity",label:w.NLS_openLinkInApp},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,appName:"Laserfische",label:w.NLS_openLinkInApp},
{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,appName:"Microsoft Power BI",label:w.NLS_openLinkInApp}],_findURIInfo:function(a){var b;f.some(this._supportedURIInfos,function(d){d.pattern.test(a)&&(b=d);return!!b});return b},_createLinkIfURI:function(a){var b=this._findURIInfo(a);if(b){var d=a.match(b.pattern);return a.replace(b.pattern,"\x3ca target\x3d'_blank' href\x3d'$1' title\x3d'$1'\x3e"+r.substitute({appName:b.appName,hierPart:d&&d[2]},b.label)+"\x3c/a\x3e")}return a},_showStatus:function(d){b.set(this._status,
"innerHTML",d);a.remove(this._status,"hidden");e.query(".mainSection",this.domNode).addClass("hidden")},_hideStatus:function(){b.set(this._status,"innerHTML","");a.add(this._status,"hidden");e.query(".mainSection",this.domNode).removeClass("hidden")},_handleComponentsSuccess:function(d){if(d){this._hideStatus();var g=this.showTitle?d.title:"",c=d.description,p=d.fields,r=d.mediaInfos,u=this.domNode,k=this._nls,t=this,A=this.template,m=this.graphic;this._prevMedia.title=k.NLS_prevMedia;this._nextMedia.title=
k.NLS_nextMedia;b.set(this._title,"innerHTML",g);g||a.add(this._title,"hidden");!d.hasDescription&&p&&(c="",f.forEach(p,function(a){c+="\x3ctr valign\x3d'top'\x3e";c+="\x3ctd class\x3d'attrName'\x3e"+v.encode(a[0])+"\x3c/td\x3e";c+="\x3ctd class\x3d'attrValue'\x3e"+this._createLinkIfURI(a[1])+"\x3c/td\x3e";c+="\x3c/tr\x3e"},this),c&&(c="\x3ctable class\x3d'attrTable' cellpadding\x3d'0px' cellspacing\x3d'0px'\x3e"+c+"\x3c/table\x3e"));b.set(this._description,"innerHTML",c);c||a.add(this._description,
"hidden");e.query("a",this._description).forEach(function(a){t._preventNewTab(a.href)?"_blank"===a.target&&b.remove(a,"target"):b.set(a,"target","_blank")});g&&c?e.query(".mainSection .hzLine",u).removeClass("hidden"):g||c?e.query(".mainSection .hzLine",u).addClass("hidden"):e.query(".mainSection",u).addClass("hidden");if(g=this._attachmentsDfd=A.getAttachments(m))g.addBoth(l.hitch(this,this._attListHandler,g)),b.set(this._attachmentsList,"innerHTML","\x3cli\x3e"+k.NLS_searching+"...\x3c/li\x3e"),
e.query(".attachmentsSection",u).removeClass("hidden");r&&r.length&&(e.query(".mediaSection",u).removeClass("hidden"),h.setSelectable(this._mediaFrame,!1),this._mediaInfos=r,this._mediaPtr=0,this._updateUI(),this._displayMedia());d.editSummary&&(b.set(this._editSummary,"innerHTML",d.editSummary),r&&r.length&&a.remove(this._mediaBreak,"hidden"),a.remove(this._editSummarySection,"hidden"));this.emit("content-update")}else this._showStatus(w.NLS_noInfo)},_handleComponentsError:function(a){a&&"cancel"===
a.dojoType||(console.log("PopupRenderer: error loading template",a),this._showStatus(w.NLS_noInfo))}});k("extend-esri")&&l.setObject("dijit._PopupRenderer",m,p);return m})},"esri/dijit/_EventedWidget":function(){define("dojo/_base/declare dojo/_base/lang dojo/aspect dojo/on ../Evented dijit/_WidgetBase".split(" "),function(q,m,n,l,f,e){return q([e,f],{_onMap:function(e){var c=this.constructor._onMap,h;c&&c.FINAL||(delete this.constructor._onMap,c=this.registerConnectEvents(),c.FINAL=!0);e=e.toLowerCase();
c[e]?h=this[c[e].method]:(e=this._onCamelCase(e),this[e]&&(h=e));return h},on:function(e,c){var h=this._onMap(e),b=e.replace(/\-/g,""),a="on"+b in this.domNode;return h||!a?this.inherited(arguments):this.own(l(this.domNode,b,c))[0]},emit:function(e,c,h){var b,a,d,f=e.toLowerCase(),k=this.constructor._onMap||this.registerConnectEvents();a=this[this._onMap(f)];c=c||{};c.target||(c.target=this);a&&k&&k[f]&&(this._onObj2Arr(function(){b=Array.prototype.slice.call(arguments)},k[f].argKeys)(c),d=m.mixin({},
arguments),d[2]=b,d[0]=k[f].name.replace(/^on/,""));return this.inherited(d||arguments)}})})},"esri/dijit/Legend/utils":function(){define(["dojo/_base/lang","../../lang","dojo/i18n!../../nls/jsapi"],function(q,m,n){var l=n.widgets.legend;return{getVisualVariableTitle:function(f,e){var k,c=f.field,h=f.normalizationField,b=!1,a=!1,d=!1,t,c=q.isFunction(c)?null:c,h=q.isFunction(h)?null:h;if(f.legendOptions&&f.legendOptions.title)k=f.legendOptions.title;else if(f.valueExpressionTitle)k=f.valueExpressionTitle;
else{if(e.renderer&&e.renderer.authoringInfo&&e.renderer.authoringInfo.visualVariables){var v=e.renderer.authoringInfo.visualVariables;for(t=0;t<v.length;t++){var g=v[t];if("colorInfo"===g.type&&"ratio"===g.style){b=!0;break}else if("colorInfo"===g.type&&"percent"===g.style){a=!0;break}else if("colorInfo"===g.type&&"percentTotal"===g.style){d=!0;break}}}(b=d&&"showRatioPercentTotal"||a&&"showRatioPercent"||b&&"showRatio"||h&&"showNormField"||c&&"showField"||null)&&(k=m.substitute({field:c&&e.getFieldLabel(c),
normField:h&&e.getFieldLabel(h)},l[b]))}return k},getRendererTitle:function(f,e){var k;if(f){var c,h,b;"esri.renderer.ClassBreaksRenderer"===f.declaredClass&&(c=f.attributeField,h=f.normalizationField,b="percent-of-total"===f.normalizationType);c=q.isFunction(c)?null:c;h=q.isFunction(h)?null:h;f.legendOptions&&f.legendOptions.title?k=f.legendOptions.title:f.valueExpressionTitle?k=f.valueExpressionTitle:(b=h&&"showNormField"||(b?"showNormPct":null)||c&&"showField"||null)&&(k=m.substitute({field:c&&
e.getFieldLabel(c),normField:h&&e.getFieldLabel(h)},l[b]))}return k}}})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t,v){m=m(e,{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=n.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",n.hitch(this,this._startup)))},destroy:function(b){this._displayFeatures(!0,b);l.forEach(this._eventHandles,function(a){a.remove()});a.clearTimeout(this._updateHandle);this._cellIndex=this._globalIndex=this._eventHandles=this._updateHandle=this.map=this.layer=this.clusters=null},setLod:function(a){var b=
this.lod;this.lod=a||this.defaults.lod;b!==this.lod&&this.update()},setTolerance:function(a){var b=this.tolerance;this.tolerance=a||this.defaults.tolerance;b!==this.tolerance&&this.update()},setClusterMode:function(a){var b=this.clusterMode;this.clusterMode=a||this.defaults.clusterMode;this._evalClusterParams();b!==this.clusterMode&&this.update()},setClusterRadius:function(a){var b=this.clusterRadius;this.clusterRadius=null!=a?a:this.defaults.clusterRadius;this._evalClusterParams();b!==this.clusterRadius&&
this.update()},setSortEnabled:function(a){var b=this.sortEnabled;this.sortEnabled=null!=a?!!a:this.defaults.sortEnabled;b!==this.sortEnabled&&this.update()},setFilterEnabled:function(a){var b=this.filterEnabled;this.filterEnabled=null!=a?!!a:this.defaults.filterEnabled;b!==this.filterEnabled&&this.update()},setBufferEnabled:function(a){var b=this.bufferEnabled;this.bufferEnabled=null!=a?!!a:this.defaults.bufferEnabled;b!==this.bufferEnabled&&this.update()},setUpdateEnabled:function(a){var b=this.updateEnabled;
(this.updateEnabled=null!=a?!!a:this.defaults.updateEnabled)&&b!==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=a.setTimeout(this._update,a.priority.HIGH))},isUpdateScheduled:function(){return null!=this._updateHandle},getCell:function(a){return this._cellIndex[a.length][a]},getCluster:function(a){var b;
l.some(this.clusters,function(d){-1<l.indexOf(d.geohashes,a)&&(b=d);return!!b});return b},getCellsInCluster:function(a){var b=[];l.forEach(a&&a.geohashes,function(a){(a=this.getCell(a))&&b.push(a)},this);return b},getFeaturesInCluster:function(a){var b=[];a=this.getCellsInCluster(a);l.forEach(a,function(a){Array.prototype.push.apply(b,a.features)});return b},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 c(a):null},_load:function(){this._displayFeatures(!1);this._checkLoadStatus();this.map.loaded||this._eventHandles.push(this.map.on("load",n.hitch(this,this._checkLoadStatus)));this.layer.loaded||this._eventHandles.push(this.layer.on("load",n.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 b=this.map.spatialReference;b.isWebMercator()||4326===b.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",n.hitch(this,this._processFeatures)),this.layer.on("edits-complete",n.hitch(this,this._processFeatures)),
this.layer.on("graphics-clear",n.hitch(this,this._processFeatures)),this.layer.on("suspend",n.hitch(this,this._evalUpdateStatus)),this.layer.on("resume",n.hitch(this,this._evalUpdateStatus)),this.map.on("extent-change",n.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 b=this._getIntersectingCells(a),a=this._getClusters(b.cells,a);this.clusters=a.clusters;this._applyStatInfosToClusters();var b=b.profile,a=a.profile,d=b.total+a.total;b.total=this._getElapsedTime(b.total);a.total=this._getElapsedTime(a.total);var c=this._perfProfile.lastUpdate={};c.cells=b;c.clusters=a;c.total=this._getElapsedTime(d)}}else this.clusters=
[],this._perfProfile.lastUpdate=null;b=this._mapLevelChange;this._mapLevelChange=!1;this.emit("update-end",{levelChange:this._levelChange,mapLevelChange:b})}},_displayFeatures:function(a,b){var d=this.layer,c=!a;d.suspendGraphics(c);!1!==b&&(c?d.clearNodes():d.redraw())},_indexFeatures:function(){var a=this._getTime();this._initializeIndexing();var b=0,d=this._globalIndex.fullExtent;l.forEach(this.layer.graphics,function(a){if(a.visible){var c=a.geometry,g=this._getLngLat(c),e;g&&(e=c.getCacheValue("_geohash"),
void 0===e&&(e=t.pointToGeohash(g),c.setCacheValue("_geohash",e||null)));e&&(this._addGeohashToIndex(e,a,g),b++,this._updateExtent(d,g))}},this);this._applyStatInfosToIndex();this._globalIndex.numFeatures=b;for(var c=this._globalIndex.lodStats,e=1;e<=this._maxGeohashLength;e++)c[e]=this._getLODStats(e,b);this._perfProfile.lastIndex.total=this._getElapsedTime(a,this._getTime());this._perfProfile.lastIndex.numFeatures=b;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=[],b=1;b<=this._maxGeohashLength;b++)a[b]={}},_getLngLat:function(a){if(a){var b=a.getLongitude();a=a.getLatitude();a=null!=b&&null!=a?{x:b,y:a}:null}return a},_addGeohashToIndex:function(a,b,d){for(var c=this._cellIndex,g="",e=0;e<this._maxGeohashLength;e++){var g=g+a[e],p=c[g.length],h=p[g];h||(h=p[g]={count:0,centroid:{x:null,y:null},extent:{xmin:Infinity,ymin:Infinity,xmax:-Infinity,ymax:-Infinity},
features:[],geohash:g,statistics:null});this._updateItem(h,1,d,!0);h.features.push(b)}},_getLODStats:function(a,b){var d=this._cellIndex[a],c=0,g=Infinity,e=-Infinity,h=null,u;for(u in d){var f=d[u];c++;f.count<g&&(g=f.count);f.count>e&&(e=f.count)}0<c&&(h=Number((b/c).toFixed(2)));return{lod:a,count:c,min:Infinity===g?null:g,max:-Infinity===e?null:e,avg:h}},_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,b,d){b<d&&(b=d);a=Math.ceil(a*b);b=this._getClosestLODRange(a).max;do d=this._getCellSize(b),(d=a>=this._cellSizeScaleFactor*d||1===d)||(b+=1);while(!d);d=a/this._getCellSize(b);return{lod:b,tolerance:a,multiplier:Number(d.toFixed(2))}},_getClosestLODRange:function(a){for(var b,d=this._maxGeohashLength;1<=d;d--)if(this._getCellSize(d)>=a){b=d;break}null==b&&(b=1);a=b+
1;a>this._maxGeohashLength&&(a=this._maxGeohashLength);return{min:b,max:a}},_getCellSize:function(a){a=t.getCellSizeInMeters(a);return Math.ceil(Math.min(a.width,a.height))},_sorter:function(a,b){var d=a.centroid,c=b.centroid;return a.count>b.count?-1:a.count<b.count?1:d.x>c.x?-1:d.x<c.x?1:0},_getIntersectingCells:function(a){var b=this._getTime();a=a.expand(this._extentScaleFactor);var d=t.getIntersecting(a,this.lod,this.bufferEnabled?this.tolerance:0);a=this._getTime();var c=[],g=this.tolerance,
e=this.sortEnabled;l.forEach(d,function(a){(a=this.getCell(a))&&c.push(a)},this);g&&e&&c.sort(this._sorter);d=this._getTime();return{cells:c,profile:{findCells:this._getElapsedTime(b,a),scanAndSortCells:this._getElapsedTime(a,d),total:d-b}}},_getClusters:function(a,b){var d=this._getTime(),c=[],g={},e={findCells:0};l.forEach(a,function(a,b){var d=this._createCluster(a,g,e);d&&c.push(d)},this);this._markIntersecting(c,b);this.filterEnabled&&(c=this._getIntersectingClusters(c));var h=this._getTime();
return{clusters:c,profile:{findCellsInCluster:this._getElapsedTime(e.findCells),total:h-d}}},_markIntersecting:function(a,b){var d=b.normalize();l.forEach(a,function(a){var b=a.centroid.x,c=a.centroid.y;a.isIntersecting=l.some(d,function(a){return b>=a.xmin&&b<=a.xmax&&c>=a.ymin&&c<=a.ymax})})},_getIntersectingClusters:function(a){return l.filter(a,function(a){return a.isIntersecting})},_createCluster:function(a,b,d){if(!b[a.geohash]){var c=[{cell:a,distance:0}];if(this.tolerance){var g=this._getTime(),
e=t.getNeighborsWithinDistance(a.centroid,this.lod,this.tolerance);d.findCells+=this._getTime()-g;l.forEach(e,function(b){if(b!==a.geohash&&(b=this.getCell(b))){var d=this._calculateDistance(a.centroid,b.centroid);d<=this.tolerance&&c.push({cell:b,distance:d})}},this)}return this._mergeCells(c,b)}},_calculateDistance:function(a,b){return h.getLength(t.geographicToWebMercator(a),t.geographicToWebMercator(b))},_mergeCells:function(a,b){var d=this._initializeCluster({},a[0].cell.geohash);l.forEach(a,
function(a){var c=a.cell,g=c.geohash;a=a.distance;var e=b[g];if(e)if(a<e.distance)this._removeCellFromCluster(g,b);else return;b[g]={cluster:d,distance:a};this._updateItem(d,c.count,c.centroid);d.geohashes.push(g)},this);return d},_removeCellFromCluster:function(a,b){var d=b[a].cluster;delete b[a];var c=l.indexOf(d.geohashes,a);-1<c&&d.geohashes.splice(c,1);this._reevaluateCluster(d)},_reevaluateCluster:function(a){var b=a.geohashes;a=this._initializeCluster(a,a.primary);l.forEach(b,function(b){var d=
this.getCell(b);d&&(this._updateItem(a,d.count,d.centroid),a.geohashes.push(b))},this)},_initializeCluster:function(a,b){a.count=0;a.centroid=new k(null,null);a.geohashes=[];a.primary=b;a.statistics=null;return a},_applyStatInfos:function(a){a=this._getValidStatInfos(a);this._applyStatInfosToIndex(a);this._applyStatInfosToClusters(a)},_getValidStatInfos:function(a){var b=[];l.forEach(a,function(a){var c=a.attributeInfo;a=a.statisticType;var g="angle"===c.attributeType;if(v.isSupportedStatisticType(a)&&
(!g||"avg"===a)){var e="arithmetic"===c.rotationType;b.push({attributeCache:d.createAttributeCache(c,"type"===a),identifier:v.getStatisticId(c,a),statFunctions:v.getStatisticFunctions(a),isAngular:g,isDate:"date"===c.attributeType,isArithmetic:e})}});return b},_applyStatInfosToIndex:function(a){a=a||this._getValidStatInfos(this.statisticInfos);var b=this._cellIndex;if(b)for(var d=1;d<=this._maxGeohashLength;d++){var c=b[d],g;for(g in c)this._applyStatInfosToCell(c[g],a)}},_applyStatInfosToCell:function(a,
b){var d=this._initializeStats(a,b);l.forEach(a.features,function(a){this._calcFeatureStats(a,b,d)},this);this._summarizeStats(a,d,b)},_calcFeatureStats:function(a,d,c){a.attributes&&l.forEach(d,function(d){var g=c[d.identifier],e=d.attributeCache,e=e?a._getDataValue(e.attributeInfo,e,b):null;d.statFunctions.updateCellStat(g,e,d)})},_applyStatInfosToClusters:function(a){a=a||this._getValidStatInfos(this.statisticInfos);var b=this._clusterFieldPrefix;l.forEach(this.clusters,function(d){var c=this._initializeStats(d,
a);l.forEach(this.getCellsInCluster(d),function(b){this._calcCellStats(b,a,c)},this);this._summarizeStats(d,c,a,b);d.attributes[b+"id"]=d.primary},this)},_calcCellStats:function(a,b,d){var c=a.statistics;l.forEach(b,function(a){var b=a.identifier;a.statFunctions.updateClusterStat(d[b],c[b],a)})},_initializeStats:function(a,b){var d=a.statistics={};l.forEach(b,function(a){d[a.identifier]=a.statFunctions.initialize(a)});return d},_summarizeStats:function(a,b,d,c){var g=a.attributes={};c=c||"";g[c+"count"]=
a.count;l.forEach(d,function(a){var d=this._getStatFieldName(a,c);g[d]=a.statFunctions.summarize(b[a.identifier],a)},this)},_getStatFieldName:function(a,b){return(b||"")+a.identifier},_updateItem:function(a,b,d,c){var g=d.y,e=a.centroid,h=a.count;e.x=(h*e.x+b*d.x)/(h+b);e.y=(h*e.y+b*g)/(h+b);a.count+=b;c&&this._updateExtent(a.extent,d)},_updateExtent:function(a,b){var d=b.x,c=b.y;d<a.xmin&&(a.xmin=d);d>a.xmax&&(a.xmax=d);c<a.ymin&&(a.ymin=c);c>a.ymax&&(a.ymax=c)},_getTime:function(){return window.performance?
window.performance.now():(new Date).getTime()},_getElapsedTime:function(a,b){var d,c;c=null!=a&&null!=b?b-a:a;null!=c&&(d="millisecond",1E3<=c&&(c/=1E3,d="second",60<=c&&(c/=60,d="minute")),d={value:Number(c.toFixed(2)),unit:d});return d}});q("extend-esri")&&n.setObject("layers.clustering.GeohashAggregation",m,f);return m})},"esri/core/timerUtils":function(){define([],function(){function q(e){var f,c=e.length;for(f=0;f<c;f++)e[f]()}var m={LOW:1,HIGH:2},n,l={};l[m.LOW]=[];l[m.HIGH]=[];var f=function(){clearTimeout(n);
n=null;var e=l[m.HIGH];l[m.HIGH]=[];q(e);e=l[m.LOW];l[m.LOW]=[];q(e)};return{priority:m,callbackQueue:l,setTimeout:function(e,k){var c=[k,l[k].push(e)-1];n||(n=setTimeout(f,0));return c},clearTimeout:function(e){e&&l[e[0]].splice(e[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(q,m,n,l,f,e,k,c,
h){function b(a){var b=a.spatialReference;if(!b)return{x:a.x,y:a.y};var d=b.isWebMercator(),c;4326===b.wkid?c={x:a.x,y:a.y}:d&&(c={x:a.getLongitude(),y:a.getLatitude()});return c}function a(a){var b=a.spatialReference,d=!(!b||!b.isWebMercator()),c;b&&4326===b.wkid?c=new k(a.toJson()):d&&(c=h.webMercatorToGeographic(a,!0));return c}function d(a,b){b.x=e.prototype._normalizeX(a.x,c.prototype._info[4326]);b.y=a.y;return b}function t(a){a=F.decimals[a].toString(2);return m.pad(a,F.bitsPerBase32Char,"0")}
function v(a,b){var d;b=b.slice();b.splice(1,0,0);for(var c=b[0],g=b[2],e=0;e<a.length;e++)Number(a[e])?b[0]=b[1]:b[2]=b[1],d=b[1]=(b[0]+b[2])/2,c=b[0],g=b[2];return{value:d,min:c,max:g}}function g(a,b,d){var c=[];b=b.slice();b.splice(1,0,0);for(var g=b[0],e=b[2],h=0;h<d;h++)a>=b[1]?(b[0]=b[1],g=1):(b[2]=b[1],g=0),b[1]=(b[0]+b[2])/2,c.push(g),g=b[0],e=b[2];return{value:c.join(""),min:g,max:e}}function u(a){var b=a*F.bitsPerBase32Char;0===b%2?a=b/=2:(a=(b+1)/2,b-=a);return{lon:a,lat:b}}function p(a){var b=
0;a=a.split("").reverse().join("");for(var d=0;d<a.length;d++)b+=Number(a[d])*Math.pow(2,d);return F.base32[b]}function r(a,b){var d={x:a.xmin,y:a.ymax},c={x:a.xmax,y:a.ymin},g={x:a.xmax,y:a.ymax};return{sw:G.pointToGeohash({x:a.xmin,y:a.ymin},b),nw:G.pointToGeohash(d,b),se:G.pointToGeohash(c,b),ne:G.pointToGeohash(g,b)}}function A(a,b,d,c,g){var e=a;do g[e]||(g[e]=!0,c.push(e)),(a=e===b)||(e=D(e,d));while(!a)}function y(a,b,d,c){var g=r(a,b);a=[];A(g.sw,g.nw,"n",a,{});b=[];A(g.se,g.ne,"n",b,{});
for(g=0;g<a.length;g++)A(a[g],b[g],"e",d,c)}function B(a){return l.filter(a,function(a){return 180===a.xmax?!0:!1})[0]}function x(a){return l.filter(a,function(a){return-180===a.xmin?!0:!1})[0]}function w(a,b,d,c){var g=G.geographicToWebMercator(a);a={x:g.x-b,y:g.y-b};b=G.webMercatorToGeographic({x:g.x+b,y:g.y+b},!0);a=G.webMercatorToGeographic(a,!0);return new k(null!=d?d:a.x,a.y,null!=c?c:b.x,b.y)}function z(a,b,d,c){var g;a=r(a,b);var e,h;"min"===c?h=180:"max"===c&&(e=-180);var p=e;c=h;g=G.geohashToCell(a.sw).extent;
b=G.geohashToCell(a.ne).extent;a=null!=p?p:g.xmin;g=g.ymin;c=null!=c?c:b.xmax;b=b.ymax;a=w({x:a,y:g},d,e,h);d=w({x:c,y:b},d,e,h);return new k(a.xmin,a.ymin,d.xmax,d.ymax)}function E(a,b,d){var c=a,g=0;do g++,(a=c===b)||(c=D(c,d));while(!a);return g}function C(a,b){var d=r(a,b),c=E(d.nw,d.ne,"e");return{rows:E(d.nw,d.sw,"s"),cols:c}}function D(a,b){var d=a.length%2,c=a.slice(-1),g=F.decimals[c],e=a.slice(0,-1);-1!=F.borders[b][d].indexOf(c)&&e&&(e=D(e,b));return e+F.neighbors[b][d][g]}var F={base32:"0123456789bcdefghjkmnpqrstuvwxyz",
decimals:function(){for(var a={},b=0;32>b;b++)a["0123456789bcdefghjkmnpqrstuvwxyz"[b]]=b;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]};F.neighbors.n[0]="14365h7k9dcfesgujnmqp0r2twvyx8zb";
F.neighbors.s[0]="p0r21436x8zb9dcf5h7kjnmqesgutwvy";F.neighbors.e[0]="238967debc01fg45kmstqrwxuvhjyznp";F.neighbors.w[0]="bc01fg45238967deuvhjyznpkmstqrwx";F.borders.n[0]="prxz";F.borders.s[0]="028b";F.borders.e[0]="bcfguvyz";F.borders.w[0]="0145hjnp";var G={geographicToWebMercator:function(a){a=e.lngLatToXY(a.x,a.y);return{x:a[0],y:a[1]}},webMercatorToGeographic:function(a,b){var d=e.xyToLngLat(a.x,a.y,b);return{x:d[0],y:d[1]}},geohashToCell:function(a){for(var b=[],d=0;d<a.length;d++)b.push(t(a[d]));
for(var b=b.join(""),d=[],c=[],g=0;g<b.length;g++)0===g%2?d.push(b[g]):c.push(b[g]);d=d.join("");c=c.join("");d=[d,c];b=v(d[0],F.longitudeRange);d=v(d[1],F.latitudeRange);return{point:{x:b.value,y:d.value},extent:{xmin:b.min,xmax:b.max,ymin:d.min,ymax:d.max},geohash:a}},pointToCell:function(a,c){var e,h,r;c=c||F.maxGeohashLength;var f=b(a);if(f){f=d(f,f);e=u(c);r=g(f.x,F.longitudeRange,e.lon);var k=g(f.y,F.latitudeRange,e.lat);e=r.value;h=k.value;r={xmin:r.min,xmax:r.max,ymin:k.min,ymax:k.max};for(var k=
[],t=Math.ceil((e.length+h.length)/F.bitsPerBase32Char),v=0,l=0,A=0;A<t*F.bitsPerBase32Char;A++){var m=0===A%2?e[v++]:h[l++];null==m&&(m=0);k.push(m)}e=k.join("");h=F.bitsPerBase32Char;k=e.length/h;t=[];for(v=0;v<k;v++)l=e.substr(v*h,h),t.push(p(l));e=t.join("");return{point:f,extent:r,geohash:e}}},geohashToPoint:function(a){return G.geohashToCell(a).point},pointToGeohash:function(a,b){var d=G.pointToCell(a,b);return d&&d.geohash},getCells:function(a){return l.map(a,function(a){return G.geohashToCell(a)})},
getCellSize:function(a){var b=F.longitudeRange,d=F.latitudeRange,b=Math.abs(b[1]-b[0]),d=Math.abs(d[1]-d[0]);a=u(a||1);return{width:b/Math.pow(2,a.lon),height:d/Math.pow(2,a.lat)}},getCellSizeInMeters:function(a){a=G.getCellSize(a);var b=h.metersPerDegree;a.width*=b;a.height*=b;return a},getIntersecting:function(b,d,c){d=d||1;c=c||0;var g=[],e=a(b);if(e){c&&(e=G.expandExtent(b,d,c));b=e.normalize();var h={};l.forEach(b,function(a){y(a,d,g,h)})}return g},countIntersecting:function(b,c,g){c=c||1;g=
g||0;var e=0,h=a(b);if(h){g&&(h=G.expandExtent(b,c,g));b=h.normalize();if(2===b.length){e=B(b);h=x(b);g=C(e,c);var p=C(h,c);b=g.rows;g=g.cols+p.cols;e={x:e.xmin,y:e.ymax};h={x:h.xmax,y:h.ymax};e=d(e,{});h=d(h,{});e=G.pointToGeohash(e,c);c=G.pointToGeohash(h,c);e===c&&g--;c={rows:b,cols:g}}else c=C(b[0],c);e=c.cols*c.rows}return e},getChildren:function(a){a=a||"";var b=[],d;for(d in F.decimals)b.push(a+d);return b},getNeighbors:function(a){var b=D(a,"n"),d=D(a,"s");return[b,D(b,"e"),D(b,"w"),d,D(d,
"e"),D(d,"w"),D(a,"e"),D(a,"w")]},getExtentFromDistance:function(a,d){d=d||1E3;var c,g=b(a);g&&(c=w(g,d));return c},expandExtent:function(b,d,c){d=d||1;c=c||0;if(b=a(b)){if(c){b=b.normalize();if(2===b.length){var g=c;c=B(b);b=x(b);c=z(c,d,g,"min");b=z(b,d,g,"max");360<=c.getWidth()+b.getWidth()?(d=-180,b=180):(d=c.xmin,b=b.xmax);return new k(d,c.ymin,b,c.ymax)}return z(b[0],d,c)}return b}},getNeighborsWithinDistance:function(a,d,c){c=c||1E3;d=d||1;var g=[];if(a=b(a)){c=w(a,c).normalize();var e={};
l.forEach(c,function(a){y(a,d,g,e)})}return g}};q("extend-esri")&&n.setObject("layers.clustering.geohashUtils",G,f);return G})},"esri/layers/clustering/statUtils":function(){define(["dojo/_base/lang","../support/attributeUtils"],function(q,m){function n(e){return"number"===typeof e&&!isNaN(e)&&Infinity!==e&&-Infinity!==e}var l={sum:{initialize:function(){return{count:0,sum:null}},updateCellStat:function(e,f){n(f)&&(e.count++,e.sum+=f)},updateClusterStat:function(e,f){f.count&&(e.count+=f.count,e.sum+=
f.sum)},summarize:function(e){return e.sum}},avg:{initialize:function(e){return{count:0,sum:null,avg:null,sum_cosine:null,sum_sine:null}},updateCellStat:function(e,f,c){n(f)&&(e.count++,c.isAngular?(c.isArithmetic||(f=-1*f+90),e.sum_cosine+=Math.cos(f*Math.PI/180),e.sum_sine+=Math.sin(f*Math.PI/180)):e.sum+=f)},updateClusterStat:function(e,f,c){f.count&&(e.count+=f.count,c.isAngular?(e.sum_cosine+=f.sum_cosine,e.sum_sine+=f.sum_sine):e.sum+=f.sum)},summarize:function(e,f){if(0<e.count){var c=e.count;
f.isAngular?(c=180*Math.atan2(e.sum_sine/c,e.sum_cosine/c)/Math.PI,f.isArithmetic||(c=-1*(c-90)),e.avg=0>c?c+360:c):(e.avg=e.sum/c,f.isDate&&(e.avg=Math.ceil(e.avg)))}return e.avg}},type:{initialize:function(){return{uvInfos:{}}},updateCellStat:function(e,f){if(null==f||""===f||"string"===typeof f&&""===q.trim(f))f=null;var c=e.uvInfos;null==c[f]?c[f]={count:1,value:f}:c[f].count++},updateClusterStat:function(e,f){var c=e.uvInfos,h=f.uvInfos,b;for(b in h){var a=h[b];null==c[b]?c[b]={count:a.count,
value:a.value}:c[b].count+=a.count}},summarize:function(e){e=e.uvInfos;var f,c=-Infinity,h;for(f in e){var b=e[f];b.count>c?(c=b.count,h=b.value):b.count===c&&(h=null)}return h}}},f={isSupportedStatisticType:function(e){return l.hasOwnProperty(e)},getStatisticFunctions:function(e){return l[e]},getStatisticId:function(e,f){var c=m.getAttributeIdSource(e),c=c&&m.getAttributeId(c)||e.field;return f+"_"+c},getClusterField:function(e,k){return"cluster_"+f.getStatisticId(e,k)},getStatisticHash:function(e,
k){var c=[f.getStatisticId(e,k)];e.attributeType&&c.push(e.attributeType.toLowerCase());e.rotationType&&c.push(e.rotationType.toLowerCase());return c.join("_")}};return f})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A,y,B,x,w,z,E,C){var D=q(g,{declaredClass:"esri.toolbars.Draw",_eventMap:{"draw-complete":!0,"draw-end":["geometry"]},constructor:function(a,b){this.markerSymbol=new u(u.STYLE_SOLID,10,new p(p.STYLE_SOLID,new f([255,0,0]),2),new f([0,0,0,.25]));this.lineSymbol=new p(p.STYLE_SOLID,new f([255,0,0]),2);this.fillSymbol=new r(r.STYLE_SOLID,new p(p.STYLE_SOLID,new f([255,0,0]),2),new f([0,0,0,.25]));this._points=[];this._mouse=!k("esri-touch")&&!k("esri-pointer");
this._defaultOptions={showTooltips:!0,drawTime:75,tolerance:8,tooltipOffset:15};this._options=m.mixin(m.mixin({},this._defaultOptions),b||{});if(c("ios")||c("android"))this._options.showTooltips=!1;this._onKeyDownHandler=m.hitch(this,this._onKeyDownHandler);this._onMouseDownHandler=m.hitch(this,this._onMouseDownHandler);this._onMouseUpHandler=m.hitch(this,this._onMouseUpHandler);this._onClickHandler=m.hitch(this,this._onClickHandler);this._onMouseMoveHandler=m.hitch(this,this._onMouseMoveHandler);
this._onMouseDragHandler=m.hitch(this,this._onMouseDragHandler);this._onDblClickHandler=m.hitch(this,this._onDblClickHandler);this._updateTooltip=m.hitch(this,this._updateTooltip);this._hideTooltip=m.hitch(this,this._hideTooltip);this._redrawGraphic=m.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,b){this._geometryType&&this.deactivate();var d=this.map,c=l.connect,g=D;this._options=m.mixin(m.mixin({},this._options),b||{});d.navigationManager.setImmediateClick(!1);switch(a){case g.ARROW:case g.LEFT_ARROW:case g.RIGHT_ARROW:case g.UP_ARROW:case g.DOWN_ARROW:case g.TRIANGLE:case g.CIRCLE:case g.ELLIPSE:case g.RECTANGLE:this._deactivateMapTools(!0,!1,!1,!0);this._onClickHandler_connect=c(d,"onClick",this._onClickHandler);this._mouse?
(this._onMouseDownHandler_connect=c(d,"onMouseDown",this._onMouseDownHandler),this._onMouseDragHandler_connect=c(d,"onMouseDrag",this._onMouseDragHandler),this._onMouseUpHandler_connect=c(d,"onMouseUp",this._onMouseUpHandler)):(this._onMouseDownHandler2_connect=c(d,"onMouseDragStart",this._onMouseDownHandler),this._onMouseDragHandler2_connect=c(d,"onMouseDrag",this._onMouseDragHandler),this._onMouseUpHandler2_connect=c(d,"onMouseDragEnd",this._onMouseUpHandler));k("esri-touch")&&!k("esri-pointer")&&
(this._onMouseDownHandler2_connect=c(d,"onSwipeStart",this._onMouseDownHandler),this._onMouseDragHandler2_connect=c(d,"onSwipeMove",this._onMouseDragHandler),this._onMouseUpHandler2_connect=c(d,"onSwipeEnd",this._onMouseUpHandler));break;case g.POINT:this._onClickHandler_connect=c(d,"onClick",this._onClickHandler);break;case g.LINE:case g.EXTENT:case g.FREEHAND_POLYLINE:case g.FREEHAND_POLYGON:this._deactivateMapTools(!0,!1,!1,!0);this._mouse?(this._onMouseDownHandler_connect=c(d,"onMouseDown",this._onMouseDownHandler),
this._onMouseDragHandler_connect=c(d,"onMouseDrag",this._onMouseDragHandler),this._onMouseUpHandler_connect=c(d,"onMouseUp",this._onMouseUpHandler)):(this._onMouseDownHandler_connect=c(d,"onMouseDragStart",this._onMouseDownHandler),this._onMouseDragHandler_connect=c(d,"onMouseDrag",this._onMouseDragHandler),this._onMouseUpHandler_connect=c(d,"onMouseDragEnd",this._onMouseUpHandler));k("esri-touch")&&!k("esri-pointer")&&(this._onMouseDownHandler2_connect=c(d,"onSwipeStart",this._onMouseDownHandler),
this._onMouseDragHandler2_connect=c(d,"onSwipeMove",this._onMouseDragHandler),this._onMouseUpHandler2_connect=c(d,"onSwipeEnd",this._onMouseUpHandler));break;case g.POLYLINE:case g.POLYGON:case g.MULTI_POINT:d.navigationManager.setImmediateClick(!0);this._onClickHandler_connect=c(d,"onClick",this._onClickHandler);this._onDblClickHandler_connect=c(d,"onDblClick",this._onDblClickHandler);this._dblClickZoom=d.isDoubleClickZoom;d.disableDoubleClickZoom();break;default:console.error("Unsupported geometry type: "+
a);return}this._onKeyDown_connect=c(d,"onKeyDown",this._onKeyDownHandler);this._redrawConnect=c(d,"onExtentChange",this._redrawGraphic);this._geometryType=a;this._toggleTooltip(!0);d.snappingManager&&"freehandpolyline"!==this._geometryType&&"freehandpolygon"!==this._geometryType&&(d.snappingManager._startSelectionLayerQuery(),d.snappingManager._setUpSnapping());this.onActivate(this._geometryType)},deactivate:function(){var a=this.map;this._clear();var b=l.disconnect;b(this._onMouseMoveHandler_connect);
b(this._onMouseDownHandler_connect);b(this._onMouseDragHandler_connect);b(this._onMouseUpHandler_connect);b(this._onMouseDownHandler2_connect);b(this._onMouseDragHandler2_connect);b(this._onMouseUpHandler2_connect);b(this._onClickHandler_connect);b(this._onDblClickHandler_connect);b(this._onKeyDown_connect);b(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 D.CIRCLE:case D.ELLIPSE:case D.TRIANGLE:case D.ARROW:case D.LEFT_ARROW:case D.RIGHT_ARROW:case D.UP_ARROW:case D.DOWN_ARROW:case D.RECTANGLE:case D.LINE:case D.EXTENT:case D.FREEHAND_POLYLINE:case D.FREEHAND_POLYGON:this._activateMapTools(!0,
!1,!1,!0);break;case D.POLYLINE:case D.POLYGON:case D.MULTI_POINT:this._dblClickZoom&&a.enableDoubleClickZoom()}b=this._geometryType;this._geometryType=null;a.navigationManager.setImmediateClick(!1);this._toggleTooltip(!1);this.onDeactivate(b)},_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,b=this._points,d=this.map.spatialReference,c=D,b=b.slice(0,b.length);switch(this._geometryType){case c.POLYLINE:if(!this._graphic||2>b.length)return;a=new x(d);a.addPath([].concat(b));break;case c.POLYGON:if(!this._graphic||3>b.length)return;a=new w(d);b=[].concat(b,[b[0].offset(0,0)]);w.prototype.isClockwise(b)||this.respectDrawingVertexOrder||(console.debug(this.declaredClass+" :  Polygons drawn in anti-clockwise direction will be reversed to be clockwise."),b.reverse());
a.addRing(b);break;case c.MULTI_POINT:a=new z(d),n.forEach(b,function(b){a.addPoint(b)})}l.disconnect(this._onMouseMoveHandler_connect);this._clear();this._setTooltipMessage(0);this._drawEnd(a)},_drawEnd:function(a){if(a){var b=this.map.spatialReference,d;this.onDrawEnd(a);b&&(b.isWebMercator()?d=B.webMercatorToGeographic(a,!0):4326===b.wkid&&(d=y.fromJson(a.toJson())));this.onDrawComplete({geometry:a,geographicGeometry:d})}},_normalizeRect:function(a,b,d){var c=a.x;a=a.y;var g=b.x;b=b.y;return{x:Math.min(c,
g),y:Math.max(a,b),width:Math.abs(c-g),height:Math.abs(a-b),spatialReference:d}},_onMouseDownHandler:function(a){this._dragged=!1;var b;this.map.snappingManager&&(b=this.map.snappingManager._snappingPoint);var d=b||a.mapPoint,c=D;b=this.map;var g=b.spatialReference;this._points.push(d.offset(0,0));switch(this._geometryType){case c.LINE:this._graphic=b.graphics.add(new A(new x({paths:[[[d.x,d.y],[d.x,d.y]]],spatialReference:g}),this.lineSymbol),!0);b.snappingManager&&b.snappingManager._setGraphic(this._graphic);
break;case c.FREEHAND_POLYLINE:this._oldPoint=a.screenPoint;d=new x(g);d.addPath(this._points);this._graphic=b.graphics.add(new A(d,this.lineSymbol),!0);b.snappingManager&&b.snappingManager._setGraphic(this._graphic);break;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.FREEHAND_POLYGON:this._oldPoint=a.screenPoint,d=new w(g),d.addRing(this._points),this._graphic=b.graphics.add(new A(d,this.fillSymbol),
!0),b.snappingManager&&b.snappingManager._setGraphic(this._graphic)}k("esri-touch")&&a.preventDefault();if(1===this._points.length)this.onDrawStart()},_onMouseMoveHandler:function(a){var b;this.map.snappingManager&&(b=this.map.snappingManager._snappingPoint);var d=this._points[this._points.length-1];a=b||a.mapPoint;b=this._tGraphic;var c=b.geometry;switch(this._geometryType){case D.POLYLINE:case D.POLYGON:c.setPoint(0,0,{x:d.x,y:d.y}),c.setPoint(0,1,{x:a.x,y:a.y}),b.setGeometry(c)}},_onMouseDragHandler:function(a){if(this._graphic||
this._points.length)if(k("esri-touch")&&!this._points.length)a.preventDefault();else{this._dragged=!0;var b;this.map.snappingManager&&(b=this.map.snappingManager._snappingPoint);var d=this._points[0],c=b||a.mapPoint,g=this.map,e=g.spatialReference;b=this._graphic;var h=D,p=g.toScreen(d),f=g.toScreen(c),r=[],r=f.x-p.x,f=f.y-p.y,u=Math.sqrt(r*r+f*f);switch(this._geometryType){case h.CIRCLE:this._hideTooltip();b.geometry=w.createCircle({center:p,r:u,numberOfPoints:60,map:g});b.setGeometry(b.geometry);
break;case h.ELLIPSE:this._hideTooltip();b.geometry=w.createEllipse({center:p,longAxis:r,shortAxis:f,numberOfPoints:60,map:g});b.setGeometry(b.geometry);break;case h.TRIANGLE:this._hideTooltip();r=[[0,-u],[.8660254037844386*u,.5*u],[-.8660254037844386*u,.5*u],[0,-u]];b.geometry=this._toPolygon(r,p.x,p.y);b.setGeometry(b.geometry);break;case h.ARROW:this._hideTooltip();d=f/u;g=r/u;c=.25*g*u;e=.25*u/(f/r);u*=.25*d;r=[[r,f],[r-c*(1+24/e),f+24*g-u],[r-c*(1+12/e),f+12*g-u],[-12*d,12*g],[12*d,-12*g],[r-
c*(1-12/e),f-12*g-u],[r-c*(1-24/e),f-24*g-u],[r,f]];b.geometry=this._toPolygon(r,p.x,p.y);b.setGeometry(b.geometry);break;case h.LEFT_ARROW:this._hideTooltip();r=0>=r?[[r,0],[.75*r,f],[.75*r,.5*f],[0,.5*f],[0,-.5*f],[.75*r,-.5*f],[.75*r,-f],[r,0]]:[[0,0],[.25*r,f],[.25*r,.5*f],[r,.5*f],[r,-.5*f],[.25*r,-.5*f],[.25*r,-f],[0,0]];b.geometry=this._toPolygon(r,p.x,p.y);b.setGeometry(b.geometry);break;case h.RIGHT_ARROW:this._hideTooltip();r=0<=r?[[r,0],[.75*r,f],[.75*r,.5*f],[0,.5*f],[0,-.5*f],[.75*r,
-.5*f],[.75*r,-f],[r,0]]:[[0,0],[.25*r,f],[.25*r,.5*f],[r,.5*f],[r,-.5*f],[.25*r,-.5*f],[.25*r,-f],[0,0]];b.geometry=this._toPolygon(r,p.x,p.y);b.setGeometry(b.geometry);break;case h.UP_ARROW:this._hideTooltip();r=0>=f?[[0,f],[-r,.75*f],[-.5*r,.75*f],[-.5*r,0],[.5*r,0],[.5*r,.75*f],[r,.75*f],[0,f]]:[[0,0],[-r,.25*f],[-.5*r,.25*f],[-.5*r,f],[.5*r,f],[.5*r,.25*f],[r,.25*f],[0,0]];b.geometry=this._toPolygon(r,p.x,p.y);b.setGeometry(b.geometry);break;case h.DOWN_ARROW:this._hideTooltip();r=0<=f?[[0,f],
[-r,.75*f],[-.5*r,.75*f],[-.5*r,0],[.5*r,0],[.5*r,.75*f],[r,.75*f],[0,f]]:[[0,0],[-r,.25*f],[-.5*r,.25*f],[-.5*r,f],[.5*r,f],[.5*r,.25*f],[r,.25*f],[0,0]];b.geometry=this._toPolygon(r,p.x,p.y);b.setGeometry(b.geometry);break;case h.RECTANGLE:this._hideTooltip();r=[[0,0],[r,0],[r,f],[0,f],[0,0]];b.geometry=this._toPolygon(r,p.x,p.y);b.setGeometry(b.geometry);break;case h.LINE:b.setGeometry(m.mixin(b.geometry,{paths:[[[d.x,d.y],[c.x,c.y]]]}));break;case h.EXTENT:b&&g.graphics.remove(b,!0);b=new E(this._normalizeRect(d,
c,e));b._originOnly=!0;this._graphic=g.graphics.add(new A(b,this.fillSymbol),!0);g.snappingManager&&g.snappingManager._setGraphic(this._graphic);break;case h.FREEHAND_POLYLINE:this._hideTooltip();if(!1===this._canDrawFreehandPoint(a)){k("esri-touch")&&a.preventDefault();return}this._points.push(a.mapPoint.offset(0,0));b.geometry._insertPoints([c.offset(0,0)],0);b.setGeometry(b.geometry);break;case h.FREEHAND_POLYGON:this._hideTooltip();if(!1===this._canDrawFreehandPoint(a)){k("esri-touch")&&a.preventDefault();
return}this._points.push(a.mapPoint.offset(0,0));b.geometry._insertPoints([c.offset(0,0)],0);b.setGeometry(b.geometry)}k("esri-touch")&&a.preventDefault()}},_canDrawFreehandPoint:function(a){if(!this._oldPoint)return!1;var b=this._oldPoint.x-a.screenPoint.x,d=this._oldPoint.y-a.screenPoint.y,c=this._options.tolerance;if((0>b?-1*b:b)<c&&(0>d?-1*d:d)<c)return!1;b=new Date;if(b-this._startTime<this._options.drawTime)return!1;this._startTime=b;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 b;this.map.snappingManager&&(b=this.map.snappingManager._snappingPoint);var d=this._points[0];b=b||a.mapPoint;var c=this.map.spatialReference,g=D,e;switch(this._geometryType){case g.CIRCLE:case g.ELLIPSE:case g.TRIANGLE:case g.ARROW:case g.LEFT_ARROW:case g.RIGHT_ARROW:case g.UP_ARROW:case g.DOWN_ARROW:case g.RECTANGLE:e=this._graphic.geometry;break;case g.LINE:e=new x({paths:[[[d.x,d.y],[b.x,b.y]]],spatialReference:c});
break;case g.EXTENT:e=(new E(this._normalizeRect(d,b,c))).getExtent();break;case g.FREEHAND_POLYLINE:e=new x(c);e.addPath([].concat(this._points,[b.offset(0,0)]));break;case g.FREEHAND_POLYGON:e=new w(c),d=[].concat(this._points,[b.offset(0,0),this._points[0].offset(0,0)]),w.prototype.isClockwise(d)||this.respectDrawingVertexOrder||(console.debug(this.declaredClass+" :  Polygons drawn in anti-clockwise direction will be reversed to be clockwise."),d.reverse()),e.addRing(d)}k("esri-touch")&&a.preventDefault();
this._clear();this._drawEnd(e)}else this._clear()},_onClickHandler:function(a){var b;this.map.snappingManager&&(b=this.map.snappingManager._snappingPoint);a=b||a.mapPoint;b=this.map;var d=b.toScreen(a),c=D;this._points.push(a.offset(0,0));switch(this._geometryType){case c.POINT:this.onDrawStart();this._drawEnd(a.offset(0,0));this._setTooltipMessage(0);break;case c.POLYLINE:1===this._points.length?(d=new x(b.spatialReference),d.addPath(this._points),this._graphic=b.graphics.add(new A(d,this.lineSymbol),
!0),b.snappingManager&&b.snappingManager._setGraphic(this._graphic),this._onMouseMoveHandler_connect=l.connect(b,"onMouseMove",this._onMouseMoveHandler),this._tGraphic=b.graphics.add(new A(new x({paths:[[[a.x,a.y],[a.x,a.y]]],spatialReference:b.spatialReference}),this.lineSymbol),!0),this.onDrawStart()):(this._graphic.geometry._insertPoints([a.offset(0,0)],0),this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.lineSymbol),b=this._tGraphic,d=b.geometry,d.setPoint(0,0,a.offset(0,0)),d.setPoint(0,
1,a.offset(0,0)),b.setGeometry(d));break;case c.POLYGON:1===this._points.length?(d=new w(b.spatialReference),d.addRing(this._points),this._graphic=b.graphics.add(new A(d,this.fillSymbol),!0),b.snappingManager&&b.snappingManager._setGraphic(this._graphic),this._onMouseMoveHandler_connect=l.connect(b,"onMouseMove",this._onMouseMoveHandler),this._tGraphic=b.graphics.add(new A(new x({paths:[[[a.x,a.y],[a.x,a.y]]],spatialReference:b.spatialReference}),this.fillSymbol),!0),this.onDrawStart()):(this._graphic.geometry._insertPoints([a.offset(0,
0)],0),this._graphic.setGeometry(this._graphic.geometry).setSymbol(this.fillSymbol),b=this._tGraphic,d=b.geometry,d.setPoint(0,0,a.offset(0,0)),d.setPoint(0,1,a.offset(0,0)),b.setGeometry(d));break;case c.MULTI_POINT:a=this._points;1===a.length?(d=new z(b.spatialReference),d.addPoint(a[a.length-1]),this._graphic=b.graphics.add(new A(d,this.markerSymbol),!0),b.snappingManager&&b.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 c.ARROW:this._addShape([[0,0],[-24,24],[-24,12],[-96,12],[-96,-12],[-24,-12],[-24,-24],[0,0]],d.x,d.y);break;case c.LEFT_ARROW:this._addShape([[0,0],[24,24],[24,12],[96,12],[96,-12],[24,-12],[24,-24],[0,0]],d.x,d.y);break;case c.RIGHT_ARROW:this._addShape([[0,0],[-24,24],[-24,12],[-96,12],[-96,-12],[-24,-12],[-24,-24],[0,0]],d.x,d.y);break;case c.UP_ARROW:this._addShape([[0,0],[-24,24],[-12,24],[-12,96],[12,96],[12,24],[24,24],[0,0]],d.x,d.y);break;case c.DOWN_ARROW:this._addShape([[0,
0],[-24,-24],[-12,-24],[-12,-96],[12,-96],[12,-24],[24,-24],[0,0]],d.x,d.y);break;case c.TRIANGLE:this._addShape([[0,-48],[41.56921938165306,24],[-41.56921938165306,24],[0,-48]],d.x,d.y);break;case c.RECTANGLE:this._addShape([[0,-96],[96,-96],[96,0],[0,0],[0,-96]],d.x-48,d.y+48);break;case c.CIRCLE:this._clear();this.onDrawStart();this._drawEnd(w.createCircle({center:d,r:48,numberOfPoints:60,map:b}));break;case c.ELLIPSE:this._clear(),this.onDrawStart(),this._drawEnd(w.createEllipse({center:d,longAxis:48,
shortAxis:24,numberOfPoints:60,map:b}))}this._setTooltipMessage(this._points.length)},_addShape:function(a,b,d){this._setTooltipMessage(0);this._clear();this.onDrawStart();this._drawEnd(this._toPolygon(a,b,d))},_toPolygon:function(a,b,d){var c=this.map,g=new w(c.spatialReference);g.addRing(n.map(a,function(a){return c.toMap({x:a[0]+b,y:a[1]+d})}));return g},_onDblClickHandler:function(a){var b,d=this._points,c=this.map.spatialReference,g=D;k("esri-touch")&&d.push(a.mapPoint);var e=d[d.length-1],h=
d[d.length-2],d=e&&h&&e.x===h.x&&e.y===h.y?d.slice(0,d.length-1):d.slice(0,d.length);switch(this._geometryType){case g.POLYLINE:if(!this._graphic||2>d.length){l.disconnect(this._onMouseMoveHandler_connect);this._clear();this._onClickHandler(a);return}b=new x(c);b.addPath([].concat(d));break;case g.POLYGON:if(!this._graphic||2>d.length){l.disconnect(this._onMouseMoveHandler_connect);this._clear();this._onClickHandler(a);return}b=new w(c);a=[].concat(d,[d[0].offset(0,0)]);w.prototype.isClockwise(a)||
this.respectDrawingVertexOrder||(console.debug(this.declaredClass+" :  Polygons drawn in anti-clockwise direction will be reversed to be clockwise."),a.reverse());b.addRing(a);break;case g.MULTI_POINT:b=new z(c),n.forEach(d,function(a){b.addPoint(a)})}l.disconnect(this._onMouseMoveHandler_connect);this._clear();this._setTooltipMessage(0);this._drawEnd(b)},_onKeyDownHandler:function(a){a.keyCode===h.ESCAPE&&(l.disconnect(this._onMouseMoveHandler_connect),this._clear(),this._setTooltipMessage(0))},
_toggleTooltip:function(c){this._options.showTooltips&&(c?this._tooltip||(this._tooltip=b.create("div",{"class":"esriMapTooltip"},this.map.container),d.isBodyLtr()||a.set(this._tooltip,"direction","rtl"),this._tooltip.style.display="none",this._tooltip.style.position="fixed",this._setTooltipMessage(0),this._onTooltipMouseEnterHandler_connect=l.connect(this.map,"onMouseOver",this._updateTooltip),this._onTooltipMouseLeaveHandler_connect=l.connect(this.map,"onMouseOut",this._hideTooltip),this._onTooltipMouseMoveHandler_connect=
l.connect(this.map,"onMouseMove",this._updateTooltip)):this._tooltip&&(l.disconnect(this._onTooltipMouseEnterHandler_connect),l.disconnect(this._onTooltipMouseLeaveHandler_connect),l.disconnect(this._onTooltipMouseMoveHandler_connect),b.destroy(this._tooltip),this._tooltip=null))},_hideTooltip:function(){var a=this._tooltip;a&&(a.style.display="none")},_setTooltipMessage:function(a){var b=this._tooltip;if(b){var d="";switch(this._geometryType){case D.POINT:d=C.toolbars.draw.addPoint;break;case D.ARROW:case D.LEFT_ARROW:case D.RIGHT_ARROW:case D.UP_ARROW:case D.DOWN_ARROW:case D.TRIANGLE:case D.RECTANGLE:case D.CIRCLE:case D.ELLIPSE:d=
C.toolbars.draw.addShape;break;case D.LINE:case D.EXTENT:case D.FREEHAND_POLYLINE:case D.FREEHAND_POLYGON:d=C.toolbars.draw.freehand;break;case D.POLYLINE:case D.POLYGON:d=C.toolbars.draw.start;1===a?d=C.toolbars.draw.resume:2<=a&&(d=C.toolbars.draw.complete);break;case D.MULTI_POINT:d=C.toolbars.draw.addMultipoint,1<=a&&(d=C.toolbars.draw.finish)}b.innerHTML=d}},_updateTooltip:function(b){var d=this._tooltip;if(d){var c;b.clientX||b.pageY?(c=b.clientX,b=b.clientY):(c=b.clientX+e.body().scrollLeft-
e.body().clientLeft,b=b.clientY+e.body().scrollTop-e.body().clientTop);d.style.display="none";a.set(d,{left:c+this._options.tooltipOffset+"px",top:b+"px"});d.style.display=""}},_redrawGraphic:function(a,b,d,c){if(d||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(){}});m.mixin(D,{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"});k("extend-esri")&&m.setObject("toolbars.Draw",D,t);return D})},"esri/toolbars/_toolbar":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../kernel","../Evented"],
function(q,m,n,l,f){q=q([f],{declaredClass:"esri.toolbars._Toolbar",constructor:function(e){this.map=e},_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(e,f,c,h){var b=this.map;e&&(this._mapNavState={isDoubleClickZoom:b.isDoubleClickZoom,isClickRecenter:b.isClickRecenter,isPan:b.isPan,isRubberBandZoom:b.isRubberBandZoom,
isKeyboardNavigation:b.isKeyboardNavigation,isScrollWheelZoom:b.isScrollWheelZoom},b.disableDoubleClickZoom(),b.disableClickRecenter(),b.disablePan(),b.disableRubberBandZoom(),b.disableKeyboardNavigation());f&&b.hideZoomSlider();c&&b.hidePanArrows();h&&b.graphics.disableMouseEvents()},_activateMapTools:function(e,f,c,h){var b=this.map,a=this._mapNavState;e&&a&&(a.isDoubleClickZoom&&b.enableDoubleClickZoom(),a.isClickRecenter&&b.enableClickRecenter(),a.isPan&&b.enablePan(),a.isRubberBandZoom&&b.enableRubberBandZoom(),
a.isKeyboardNavigation&&b.enableKeyboardNavigation(),a.isScrollWheelZoom&&b.enableScrollWheelZoom());f&&b.showZoomSlider();c&&b.showPanArrows();h&&b.graphics.enableMouseEvents()},_deactivateScrollWheel:function(){var e=this.map;this._scrollWheelState={isScrollWheelZoom:e.isScrollWheelZoom,isScrollWheelPan:e.isScrollWheelPan};e.disableScrollWheelZoom();e.disableScrollWheelPan()},_activateScrollWheel:function(){var e=this.map,f=this._scrollWheelState;f&&(f.isScrollWheelZoom&&e.enableScrollWheelZoom(),
f.isScrollWheelPan&&e.enableScrollWheelPan())}});n("extend-esri")&&m.setObject("toolbars._Toolbar",q,l);return q})},"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(q,m,
n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A,y,B){var x=m(t,{declaredClass:"esri.toolbars.Edit",constructor:function(a,b){this._map=a;this._tool=0;if(this._map.loaded)this._scratchGL=a.graphics;else var d=l.connect(this._map,"onLoad",this,function(){l.disconnect(d);d=null;this._scratchGL=this._map.graphics});var c=k("esri-mobile");this._defaultOptions=n.mixin({vertexSymbol:new r(r.STYLE_CIRCLE,c?20:12,new A(A.STYLE_SOLID,new e([0,0,0,.5]),1),new e([128,128,128])),ghostVertexSymbol:new r(r.STYLE_CIRCLE,c?18:
10,new A(A.STYLE_SOLID,new e([0,0,0,.5]),1),new e([255,255,255,.75])),ghostLineSymbol:new A(A.STYLE_DOT,new e([128,128,128]),2),allowDeleteVertices:!0,allowAddVertices:!0,rotateHandleOffset:c?24:16,boxLineSymbol:new A(A.STYLE_DASH,new e([64,64,64]),1),boxHandleSymbol:new r(r.STYLE_SQUARE,c?16:9,new A(A.STYLE_SOLID,new e([0,0,0,.5]),1),new e([255,255,255,.75])),textAnchorSymbol:new r(r.STYLE_CIRCLE,10,null,new e([255,0,0]))},b||{})},activate:function(a,b,d){this.deactivate();this._graphic=b;this._options=
n.mixin(n.mixin({},this._defaultOptions),d||{});var c=x.MOVE;d=x.EDIT_VERTICES;var g=x.SCALE,e=x.ROTATE,h=x.EDIT_TEXT,p=!1,f=!1,r=!1,u=this._map,k=u.spatialReference,t=b.geometry.spatialReference;this._geo=!(!k||!t||k.equals(t)||!k.isWebMercator()||4326!==t.wkid);this._isTextPoint=this._prepareTextSymbolEditing(b,a);(a&c)===c&&(p=this._enableMove(b));c=(a&g)===g;e=(a&e)===e;if(c||e)r=this._enableBoxEditing(b,c,e);(a&d)===d&&(f=this._enableVertexEditing(b));(a&h)===h&&this._enableTextEditing(b);if(!(p||
f||r))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=l.connect(u,"onPanEnd",this,this._mapPanEndHandler),this._mapExtChgHandle=l.connect(u,"onExtentChange",this,this._mapExtentChangeHandler),this.onActivate(this._tool,b);u.snappingManager&&(p||f)&&u.snappingManager._startSelectionLayerQuery()},deactivate:function(){this._isTextPoint=null;var a=this._tool,b=this._graphic;if(a){var d=
!!this._modified;this._clear();l.disconnect(this._mapPanEndHandle);l.disconnect(this._mapExtChgHandle);this._graphic=this._geo=this._mapPanEndHandle=this._mapExtChgHandle=null;this.onDeactivate(a,b,{isModified:d});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,b){},onDeactivate:function(a,b,d){},
onGraphicMoveStart:function(a){},onGraphicFirstMove:function(a){this._modified=!0},onGraphicMove:function(a,b){},onGraphicMoveStop:function(a,b){},onGraphicClick:function(a,b){},onVertexMoveStart:function(a,b){},onVertexFirstMove:function(a,b){this._modified=!0},onVertexMove:function(a,b,d){},onVertexMoveStop:function(a,b,d){},onVertexAdd:function(a,b){this._modified=!0},onVertexClick:function(a,b){},onVertexMouseOver:function(a,b){},onVertexMouseOut:function(a,b){},onVertexDelete:function(a,b){this._modified=
!0},onTextEditStart:function(a,b){},onTextEditEnd:function(a){},onScaleStart:function(a){},onScaleFirstMove:function(a){this._modified=!0},onScale:function(a,b){},onScaleStop:function(a,b){},onRotateStart:function(a){},onRotateFirstMove:function(a){this._modified=!0},onRotate:function(a,b){},onRotateStop:function(a,b){},_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,b){if("point"===a.geometry.type||"multipoint"===a.geometry.type){var d=a.getLayer(),g=d.renderer,d=a.symbol||d._getSymbol(a);!d&&(g.hasVisualVariables("sizeInfo",!1)||g.hasVisualVariables("colorInfo",!1)||g.hasVisualVariables("opacityInfo",!1))&&g.addBreak&&
g.infos&&1===g.infos.length&&(d=g.infos[0].symbol||g.defaultSymbol);if(d&&"textsymbol"===d.type){if((b&x.SCALE)===x.SCALE||(b&x.ROTATE)===x.ROTATE||(b&x.EDIT_TEXT)===x.EDIT_TEXT){a.setSymbol(new y(d.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()})):
q(["../dijit/SymbolEditor"],function(b){if(!e._textSymbolEditor){var d;d=e._options.textSymbolEditorHolder?c.create("div",null,e._options.textSymbolEditorHolder):c.create("div",null,e._map.root);e._textSymbolEditor=new b({graphic:a},d);b=e._textSymbolEditor.domNode.parentNode.id;h.set(e._textSymbolEditor.domNode,{position:"map_root"===b?"absolute":"relative",left:"map_root"===b?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((b&x.MOVE)===x.MOVE||(b&x.ROTATE)===x.ROTATE||(b&x.SCALE)===x.SCALE)this._textAnchor=new B(a.geometry,this._options.textAnchorSymbol),this._scratchGL.add(this._textAnchor);return!0}}return!1},_enableMove:function(a){var b=this._map;switch(a.geometry.type){case "point":case "polyline":case "polygon":return this._graphicMover=new g(a,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=u.create(a,b,this),!0}return!1},_enableBoxEditing:function(a,b,d){var c=this._map,g=a.geometry.type;return"polyline"===g||"polygon"===g||this._isTextPoint?(this._boxEditor=new v(a,c,this,b,d,this._options.uniformScaling,this._isTextPoint),!0):!1},_enableTextEditing:function(a){return this._isTextPoint?(this._textEditor=new p(a,this._map,this),l.connect(this._textEditor,"onEditStart",n.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,b,d){d&&this._refreshMoveables()},_refreshMoveables:function(b){var d=f.filter([this._graphicMover,this._vertexEditor,this._boxEditor],a.isDefined);f.forEach(d,function(a){a.refresh(b)})},_beginOperation:function(a){f.forEach(this._getAffectedTools(a),function(a){a.suspend()})},_endOperation:function(a){f.forEach(this._getAffectedTools(a),function(a){a.resume()})},_getAffectedTools:function(b){var d=[];switch(b){case "MOVE":d=[this._vertexEditor,this._boxEditor];
break;case "VERTICES":d=[this._boxEditor];break;case "BOX":d=[this._vertexEditor]}return d=f.filter(d,a.isDefined)}});n.mixin(x,{MOVE:1,EDIT_VERTICES:2,SCALE:4,ROTATE:8,EDIT_TEXT:16});k("extend-esri")&&n.setObject("toolbars.Edit",x,b);return x})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p){q=q(null,{declaredClass:"esri.toolbars._Box",constructor:function(a,b,d,c,g,e,h){this._graphic=a;this._map=b;this._toolbar=d;this._scale=c;this._rotate=g;this._defaultEventArgs={};this._scaleEvent="Scale";this._rotateEvent="Rotate";this._uniformScaling=e;a=d._options;this._markerSymbol=a.boxHandleSymbol;this._lineSymbol=a.boxLineSymbol;this._moveStartHandler=m.hitch(this,this._moveStartHandler);this._firstMoveHandler=m.hitch(this,this._firstMoveHandler);
this._moveStopHandler=m.hitch(this,this._moveStopHandler);this._moveHandler=m.hitch(this,this._moveHandler);this._isTextPoint=h;this._init()},destroy:function(){this._cleanUp();this._graphic=this._map=this._toolbar=this._markerSymbol=this._lineSymbol=null},refresh:function(){this._draw()},suspend:function(){n.forEach(this._getAllGraphics(),function(a){a.hide()})},resume:function(){n.forEach(this._getAllGraphics(),function(a){a.show()});this._draw()},_init:function(){this._draw()},_cleanUp:function(){this._connects&&
n.forEach(this._connects,l.disconnect);var a=this._toolbar._scratchGL;this._anchors&&n.forEach(this._anchors,function(b){a.remove(b.graphic);(b=b.moveable)&&b.destroy()});this._box&&a.remove(this._box);this._box=this._anchors=this._connects=null},_draw:function(){if(this._graphic.getDojoShape()){var a=this._map,b=this._toolbar._scratchGL,c=this._getBoxCoords(),g=new t(a.spatialReference),e=m.clone(n.filter(c,function(a,b){return 8!==b&&0===b%2}));e[0]&&e.push([e[0][0],e[0][1]]);g.addPath(e);this._rotate&&
g.addPath([c[1],c[8]]);this._box?this._box.setGeometry(g):(this._box=new p(g,this._lineSymbol),b.add(this._box));this._anchors?n.forEach(this._anchors,function(b,g){this._scale||(g=8);var e=new d(c[g],a.spatialReference);b.graphic.setGeometry(e);var e=b.moveable,h=b.graphic.getDojoShape();h&&(e?h!==e.shape&&(e.destroy(),b.moveable=this._getMoveable(b.graphic,g)):b.moveable=this._getMoveable(b.graphic,g))},this):(this._anchors=[],this._connects=[],n.forEach(c,function(c,g){if(this._scale||!(8>g)){c=
new d(c,a.spatialReference);var e=new p(c,this._markerSymbol);this._isTextPoint&&1===g%2&&e.hide();b.add(e);this._anchors.push({graphic:e,moveable:this._getMoveable(e,g)})}},this))}else this._cleanUp()},_getBoxCoords:function(a){var b=this._map,d,c=[],g,e,h;if(this._isTextPoint){d=this._graphic.getNode().getBoundingClientRect();var p=b.__container.getBoundingClientRect();d=[{x:d.left-p.left,y:d.top-p.top},{x:d.right-p.left,y:d.top-p.top},{x:d.right-p.left,y:d.bottom-p.top},{x:d.left-p.left,y:d.bottom-
p.top}]}else d=this._getTransformedBoundingBox(this._graphic);n.forEach(d,function(d,p,f){g=d;(e=f[p+1])||(e=f[0]);h={x:(g.x+e.x)/2,y:(g.y+e.y)/2};a||(g=b.toMap(g),h=b.toMap(h));c.push([g.x,g.y]);c.push([h.x,h.y])});this._rotate&&(d=m.clone(c[1]),d=a?{x:d[0],y:d[1]}:b.toScreen({x:d[0],y:d[1],spatialReference:b.spatialReference}),d.y-=this._toolbar._options.rotateHandleOffset,a||(d=b.toMap(d)),c.push([d.x,d.y]));return c},_getTransformedBoundingBox:function(a){var b=this._map,c=a.geometry.getExtent(),
g=a.geometry.spatialReference;a=new d(c.xmin,c.ymax,g);c=new d(c.xmax,c.ymin,g);a=b.toScreen(a);c=b.toScreen(c);return[{x:a.x,y:a.y},{x:c.x,y:a.y},{x:c.x,y:c.y},{x:a.x,y:c.y}]},_getAllGraphics:function(){var b=[this._box];this._anchors&&n.forEach(this._anchors,function(a){b.push(a.graphic)});return b=n.filter(b,a.isDefined)},_getMoveable:function(a,b){var d=a.getDojoShape();if(d){var g=new c(d);g._index=b;this._connects.push(l.connect(g,"onMoveStart",this._moveStartHandler));this._connects.push(l.connect(g,
"onFirstMove",this._firstMoveHandler));this._connects.push(l.connect(g,"onMoveStop",this._moveStopHandler));g.onMove=this._moveHandler;(d=d.getEventSource())&&k.set(d,"cursor",this._toolbar._cursors["box"+b]);return g}},_moveStartHandler:function(a){this._toolbar["on"+(8===a.host._index?this._rotateEvent:this._scaleEvent)+"Start"](this._graphic)},_firstMoveHandler:function(a){this._toolbar._deactivateScrollWheel();var b=a.host._index,d=this._wrapOffset=a.host.shape._wrapOffsets[0]||0,c=this._graphic.getLayer()._getTransform(),
g;a=n.map(this._getBoxCoords(!0),function(a){return{x:a[0]+d,y:a[1]}});g=this._isTextPoint?this._map.toScreen(this._graphic.geometry):{x:a[1].x,y:a[3].y};this._centerCoord=h.multiplyPoint(h.invert(c),g);if(8===b)g=h.multiplyPoint(h.invert(c),a[1]),this._isTextPoint&&(this._centerCoord=this._deNormalizePoint(this._centerCoord,g)),this._startLine=[this._centerCoord,g],this._moveLine=m.clone(this._startLine);else if(g=h.multiplyPoint(h.invert(c),a[b]),c=h.multiplyPoint(h.invert(c),a[(b+4)%8]),this._isTextPoint&&
(this._centerCoord=this._deNormalizePoint(this._centerCoord,g)),this._firstMoverToAnchor=Math.sqrt((g.x-this._centerCoord.x)*(g.x-this._centerCoord.x)+(g.y-this._centerCoord.y)*(g.y-this._centerCoord.y)),this._startBox=c,this._startBox.width=a[4].x-a[0].x,this._startBox.height=a[4].y-a[0].y,this._moveBox=m.clone(this._startBox),this._xfactor=g.x>c.x?1:-1,this._yfactor=g.y>c.y?1:-1,1===b||5===b)this._xfactor=0;else if(3===b||7===b)this._yfactor=0;this._toolbar._beginOperation("BOX");this._toolbar["on"+
(8===b?this._rotateEvent:this._scaleEvent)+"FirstMove"](this._graphic)},_moveHandler:function(a,b){var d=a.host._index,c=this._defaultEventArgs,g,e,p,f;c.angle=0;c.scaleX=1;c.scaleY=1;if(8===d)g=this._startLine,e=this._moveLine,p=e[1],p.x+=b.dx,p.y+=b.dy,p=this._getAngle(g,e),this._isTextPoint&&(p+=this._graphic.symbol.angle),e=h.rotategAt(p,g[0]),this._graphic.getDojoShape().setTransform(e),c.transform=e,c.angle=p,c.around=g[0];else{g=this._startBox;e=this._moveBox;e.width+=b.dx*this._xfactor;e.height+=
b.dy*this._yfactor;this._uniformScaling||this._isTextPoint?(g=e.x+this._xfactor*e.width,e=e.y+this._yfactor*e.height,g=Math.sqrt((g-this._centerCoord.x)*(g-this._centerCoord.x)+(e-this._centerCoord.y)*(e-this._centerCoord.y)),this._scaleRatio=p=f=g/this._firstMoverToAnchor,g=this._centerCoord):(p=e.width/g.width,f=e.height/g.height,g={x:g.x,y:g.y});if(isNaN(p)||Infinity===p||-Infinity===p)p=1;if(isNaN(f)||Infinity===f||-Infinity===f)f=1;e=h.scaleAt(p,f,g);if(this._isTextPoint){var r=h.rotategAt(this._graphic.symbol.angle,
g);this._graphic.getDojoShape().setTransform([r,e])}else this._graphic.getDojoShape().setTransform(e);c.transform=e;c.scaleX=p;c.scaleY=f;c.around=g}this._toolbar["on"+(8===d?this._rotateEvent:this._scaleEvent)](this._graphic,c)},_moveStopHandler:function(a){this._toolbar._activateScrollWheel();var b=this._graphic,d=this._toolbar,c=d._geo?g.geographicToWebMercator(b.geometry):b.geometry,e=c.spatialReference,h=b.getDojoShape(),p=h.getTransform(),f=b.getLayer()._getTransform();this._isTextPoint?(b=
this._graphic.symbol,8===a.host._index?b.angle+=this._getAngle(this._startLine,this._moveLine):b.font.setSize(Math.round(b.font.size*this._scaleRatio*100)/100),this._graphic.setSymbol(b)):(c=c.toJson(),this._updateSegments(c.paths||c.rings,p,f,e),h.setTransform(null),c=u.fromJson(c),b.setGeometry(d._geo?g.webMercatorToGeographic(c,!0):c));this._draw();this._startLine=this._moveLine=this._startBox=this._moveBox=this._xfactor=this._yfactor=null;d._endOperation("BOX");this._defaultEventArgs.transform=
p;d["on"+(8===a.host._index?this._rotateEvent:this._scaleEvent)+"Stop"](this._graphic,this._defaultEventArgs)},_updateSegments:function(a,b,d,c){var g=this._map,e=this._wrapOffset||0;n.forEach(a,function(a){n.forEach(a,function(a){this._updatePoint(a,c,e,h,g,d,b)},this)},this)},_updatePoint:function(a,b,d,c,g,e,h){b=g.toScreen({x:a[0],y:a[1],spatialReference:b},!0);b.x+=d;b=c.multiplyPoint([e,h,c.invert(e)],b);b.x-=d;d=g.toMap(b);a[0]=d.x;a[1]=d.y},_getAngle:function(a,b){return 180*Math.atan2(b[0].y-
b[1].y,b[0].x-b[1].x)/Math.PI-180*Math.atan2(a[0].y-a[1].y,a[0].x-a[1].x)/Math.PI},_deNormalizePoint:function(a,b){var d=this._map._getFrameWidth();if(-1===d)return a;for(var c={x:a.x,y:a.y};Math.abs(c.x-b.x)>=d;)c.x=c.x<b.x?c.x+d:c.x-d;var g=Math.abs(c.x-b.x);Math.abs(c.x-b.x+d)<g?c.x+=d:Math.abs(c.x-b.x-d)<g&&(c.x-=d);return c}});e("extend-esri")&&m.setObject("toolbars._Box",q,b);return q})},"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(q,m,n,l,f,e,k,c,h,b){return m("dojox.gfx.Moveable",null,{constructor:function(a,b){this.shape=a;this.delay=b&&0<b.delay?b.delay:0;this.mover=b&&b.mover?b.mover:h;this.leftButtonOnly=b&&b.leftButtonOnly;this.events=[this.shape.on(e.press,q.hitch(this,"onMouseDown"))]},destroy:function(){n.forEach(this.events,function(a){a.remove()});this.events=this.shape=null},onMouseDown:function(a){this.delay?(this.events.push(this.shape.on(e.move,q.hitch(this,"onMouseMove")),this.shape.on(e.release,q.hitch(this,
"onMouseUp"))),this._lastX=a.clientX,this._lastY=a.clientY):this.leftButtonOnly&&!b.isLeft(a)||new this.mover(this.shape,a,this);l.stop(a)},onMouseMove:function(a){var b=a.clientY;if(Math.abs(a.clientX-this._lastX)>this.delay||Math.abs(b-this._lastY)>this.delay)this.onMouseUp(a),new this.mover(this.shape,a,this);l.stop(a)},onMouseUp:function(a){this.events.pop().remove()},onMoveStart:function(a){f.publish("/gfx/move/start",a);k.add(c.body(),"dojoMove")},onMoveStop:function(a){f.publish("/gfx/move/stop",
a);k.remove(c.body(),"dojoMove")},onFirstMove:function(a){},onMove:function(a,b,c){this.onMoving(a,b,c);this.shape.applyLeftTransform(b);this.onMoved(a,b)},onMoving:function(a,b){},onMoved:function(a,b){}})})},"dojox/gfx/Mover":function(){define("dojo/_base/lang dojo/_base/array dojo/_base/declare dojo/on dojo/touch dojo/_base/event".split(" "),function(q,m,n,l,f,e){return n("dojox.gfx.Mover",null,{constructor:function(k,c,h){this.shape=k;this.lastX=c.clientX;this.lastY=c.clientY;k=this.host=h;c=
document;h=l(c,f.move,q.hitch(this,"onFirstMove"));this.events=[l(c,f.move,q.hitch(this,"onMouseMove")),l(c,f.release,q.hitch(this,"destroy")),l(c,"dragstart",q.hitch(e,"stop")),l(c,"selectstart",q.hitch(e,"stop")),h];if(k&&k.onMoveStart)k.onMoveStart(this)},onMouseMove:function(f){var c=f.clientX,h=f.clientY;this.host.onMove(this,{dx:c-this.lastX,dy:h-this.lastY},f);this.lastX=c;this.lastY=h;e.stop(f)},onFirstMove:function(){this.host.onFirstMove(this);this.events.pop().remove()},destroy:function(){m.forEach(this.events,
function(c){c.remove()});var e=this.host;if(e&&e.onMoveStop)e.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(q,m,n,l,f,e,k,c,h,b,a,d,t,v){var g=q(null,{declaredClass:"esri.toolbars._GraphicMover",
constructor:function(a,b,d,c){this.graphic=a;this.map=b;this.toolbar=d;this.tempPt=c;this._enableGraphicMover();this._moved=!1},refresh:function(a){var b=this.graphic.getDojoShape();!b||!a&&b._hostGraphic||(this._disableGraphicMover(),this._enableGraphicMover())},destroy:function(){this._disableGraphicMover()},hasMoved:function(){return this._moved},_enableGraphicMover:function(){var a=this.graphic,b=a.getDojoShape();b&&(b._hostGraphic=a,this._moveable=new e(b,{mover:g.Mover}),this._moveStartHandle=
n.connect(this._moveable,"onMoveStart",this,this._moveStartHandler),this._firstMoveHandle=n.connect(this._moveable,"onFirstMove",this,this._firstMoveHandler),this._movingHandle=n.connect(this._moveable,"onMoving",this,this._movingHandler),this._moveStopHandle=n.connect(this._moveable,"onMoveStop",this,this._moveStopHandler),(a=b.getEventSource())&&f.set(a,"cursor",this.toolbar._cursors.move))},_disableGraphicMover:function(){var a=this._moveable;if(a){n.disconnect(this._moveStartHandle);n.disconnect(this._firstMoveHandle);
n.disconnect(this._movingHandle);n.disconnect(this._moveStopHandle);var b=a.shape;b&&(b._hostGraphic=null,(b=b.getEventSource())&&f.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(d,c,g){d=d.shape.getTransform();c=this.map;var e;a("esri-pointer")?e=c.navigationManager.pointerEvents._processTouchEvent(g,g):g&&"pointermove"===g.type&&(e=b.prototype._processTouchEvent.call({map:c},g,g));e&&c.snappingManager&&c.snappingManager._onSnappingMouseMoveHandler(e);this.tempPt&&this.tempPt.getDojoShape().setTransform(d);this.toolbar.onGraphicMove(this.graphic,d)},_moveStopHandler:function(a){var b=this.graphic,g=this.toolbar,e=this.map,h=g._geo?d.geographicToWebMercator(b.geometry):
b.geometry,f=h.type,u=b.getDojoShape(),k=u.getTransform();if(l.toJson(k)!==l.toJson(this._startTx)){this._moved=!0;switch(f){case "point":var f=[k,c.invert(this._startTx)],m;e.snappingManager&&(m=e.snappingManager._snappingPoint);h=m||e.toMap(c.multiplyPoint(f,e.toScreen(h,!0)));e.snappingManager&&e.snappingManager._killOffSnapping();break;case "polyline":h=this._updatePolyGeometry(h,h.paths,k);break;case "polygon":h=this._updatePolyGeometry(h,h.rings,k)}u.setTransform(null);b.setGeometry(g._geo?
d.webMercatorToGeographic(h,!0):h);this.tempPt&&this.tempPt.setGeometry(new v(b.geometry.toJson()))}else this._moved=!1;g._endOperation("MOVE");g.onGraphicMoveStop(b,k);this._moved||(a=a.__e,e=this.map.position,a=new t(a.pageX-e.x,a.pageY-e.y),g.onGraphicClick(b,{screenPoint:a,mapPoint:this.map.toMap(a)}))},_updatePolyGeometry:function(a,b,d){var c=this.map,g=a.getPoint(0,0),c=c.toMap(c.toScreen(g).offset(d.dx,d.dy));d=c.x-g.x;for(var g=c.y-g.y,e,h,f,c=0;c<b.length;c++)for(h=b[c],e=0;e<h.length;e++)f=
a.getPoint(c,e),a.setPoint(c,e,f.offset(d,g));return a}});g.Mover=q(k,{declaredClass:"esri.toolbars._Mover",constructor:function(a,b,d){this.__e=b}});a("extend-esri")&&(m.setObject("toolbars._GraphicMover",g,h),m.setObject("toolbars._Mover",g.Mover,h));return g})},"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(q,m,n,l,f,e,k,c,h,b,a,d){var t=q(null,{declaredClass:"esri.toolbars._GraphicVertexEditor",constructor:function(a,b,d){this.graphic=a;this.map=b;this.toolbar=d;a=d._options;this._symbol1=a.vertexSymbol;this._symbol2=a.ghostVertexSymbol;b=a.ghostLineSymbol;this._lineStroke={style:b.style,width:b.width,color:b.color};this._canDel=a.allowDeleteVertices;this._canAdd=a.allowAddVertices;this._addControllers()},destroy:function(){this._removeControllers()},refresh:function(a){a?(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=n.connect(h,"onFirstMove",this,this._firstMoveHandler);this._moveStopHandle=n.connect(h,"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 a=this._getGraphicsLayer();this._mouseOverHandle=n.connect(a,"onMouseOver",this,this._mouseOverHandler);this._mouseOutHandle=n.connect(a,"onMouseOut",this,this._mouseOutHandler);this._canDel&&(this._ctxMenu=new e({style:"font-size: 12px; margin-left: 5px; margin-top: 5px;"}),a=this._ctxDelete=new k({label:d.toolbars.edit.deleteLabel,iconClass:"vertexDeleteIcon",style:"outline: none;"}),
this._deleteHandle=n.connect(a,"onClick",this,this._deleteHandler),this._ctxMenu.addChild(a),this._ctxMenu.startup())},_removeControllers:function(){n.disconnect(this._firstMoveHandle);n.disconnect(this._moveStopHandle);n.disconnect(this._mouseOverHandle);n.disconnect(this._mouseOutHandle);n.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(a,b,d){var c,g,e=this.graphic,f=[];for(c=0;c<a.length;c++){var u=a[c],k=[];for(g=0;g<u.length;g++)k.push(new h(u[g],b,e,c,g,u.length,this,d));f.push(k)}return f},_remove:function(a){a&&l.forEach(a,function(a){l.forEach(a,function(a){a.destroy()})})},_refresh:function(a){a&&l.forEach(a,function(a){l.forEach(a,function(a){a.refresh()})})},_isNew:function(a){return-1===l.indexOf(this._vertexMovers[a.segIndex],a)?!0:!1},_getGraphicsLayer:function(){return this.toolbar._scratchGL},
_deleteHandler:function(a){a=this._selectedMover;this._updateRelatedGraphic(a,a.relatedGraphic,a.graphic.geometry,a.segIndex,a.ptIndex,a.segLength,!1,!0);this._canAdd&&this._deleteMidpoints(a);this._deleteVertex(a);this.toolbar._endOperation("VERTICES")},_mouseOverHandler:function(a){a=a.graphic;var b=this._findMover(a);b&&(this.toolbar.onVertexMouseOver(this.graphic,b._getInfo()),b._placeholder||(this._selectedMover=b,this._canDel&&this._bindCtxNode(a.getDojoShape().getNode())))},_mouseOutHandler:function(a){if(a=
this._findMover(a.graphic))this.toolbar.onVertexMouseOut(this.graphic,a._getInfo())},_bindCtxNode:function(a){this._unbindCtxNode();this._ctxDelete.set("disabled",this._selectedMover.segLength<=this.minLength?!0:!1);this._ctxMenu.bindDomNode(a);this._bindNode=a},_unbindCtxNode:function(){var a=this._bindNode;a&&this._ctxMenu.unBindDomNode(a)},_findMover:function(a){var b,d=[];b=this._mpVertexMovers;l.forEach(this._vertexMovers,function(a){d=d.concat(a)});b&&l.forEach(b,function(a){d=d.concat(a)});
for(b=0;b<d.length;b++){var c=d[b];if(c.graphic===a)return c}},_firstMoveHandler:function(a){!this._isNew(a)&&this._canAdd&&this._hideRelatedMidpoints(a);this.toolbar._beginOperation("VERTICES")},_moveStopHandler:function(a,b){var d=this._isNew(a);b&&(b.dx||b.dy)?(this._updateRelatedGraphic(a,a.relatedGraphic,a.graphic.geometry,a.segIndex,a.ptIndex,a.segLength,d),this._canAdd&&(d?this._addMidpoints(a):(this._repositionRelatedMidpoints(a),this._showRelatedMidpoints(a))),this.toolbar._endOperation("VERTICES")):
!d&&this._canAdd&&this._showRelatedMidpoints(a)},_showRelatedMidpoints:function(a){var b=this._getAdjacentMidpoints(a.ptIndex,a.segLength),d=this._mpVertexMovers[a.segIndex];for(a=0;a<b.length;a++){var c=d[b[a]];c.graphic.show();c.refresh()}},_hideRelatedMidpoints:function(a){var b=this._getAdjacentMidpoints(a.ptIndex,a.segLength),d=this._mpVertexMovers[a.segIndex];for(a=0;a<b.length;a++)d[b[a]].graphic.hide()},_repositionRelatedMidpoints:function(a){var d,c=this._getAdjacentMidpoints(a.ptIndex,a.segLength),
e=this._mpVertexMovers[a.segIndex];for(d=0;d<c.length;d++){var h=this._getAdjacentVertices(c[d],a.segLength),f=a.relatedGraphic.geometry.getPoint(a.segIndex,h[0]),h=a.relatedGraphic.geometry.getPoint(a.segIndex,h[1]),f=new b({x:(f.x+h.x)/2,y:(f.y+h.y)/2,spatialReference:f.spatialReference.toJson()});e[c[d]].graphic.setGeometry(f)}},_addMidpoints:function(a){var d=a.segIndex,c=a.ptIndex,e=a.segLength,f=c+1,k,t=e+1;this._mpVertexMovers[d].splice(c,1);var v=this._vertexMovers[d];for(k=0;k<f;k++)v[k].segLength+=
1;for(k=f;k<v.length;k++)v[k].ptIndex+=1,v[k].segLength+=1;a.ptIndex=f;a.segLength=v.length+1;v.splice(f,0,a);a.graphic.setSymbol(this._symbol1);v=this._mpVertexMovers[d];for(k=0;k<c;k++)v[k].segLength+=1;for(k=c;k<e-1;k++)v[k].ptIndex+=1,v[k].segLength+=1;f=this._getAdjacentVertices(c,t);d=this._getAdjacentVertices(c+1,t);e=a.relatedGraphic.geometry.getPoint(a.segIndex,f[0]);k=a.relatedGraphic.geometry.getPoint(a.segIndex,f[1]);f=new b({x:(e.x+k.x)/2,y:(e.y+k.y)/2,spatialReference:e.spatialReference.toJson()});
e=a.relatedGraphic.geometry.getPoint(a.segIndex,d[0]);k=a.relatedGraphic.geometry.getPoint(a.segIndex,d[1]);d=new b({x:(e.x+k.x)/2,y:(e.y+k.y)/2,spatialReference:e.spatialReference.toJson()});e=new h(f,this._symbol2,this.graphic,a.segIndex,c,t,this,!0);a=new h(d,this._symbol2,this.graphic,a.segIndex,c+1,t,this,!0);v.splice(c,0,e,a)},_deleteVertex:function(a){var b,d=a.ptIndex,c=this._vertexMovers[a.segIndex];for(b=0;b<d;b++)--c[b].segLength;for(b=d+1;b<c.length;b++){var e=c[b];--e.ptIndex;--e.segLength}c.splice(d,
1);b=a._getInfo();a.destroy();this.toolbar.onVertexDelete(this.graphic,b)}});m.mixin(t,{create:function(a,b,d){switch(a.geometry.type){case "multipoint":return new t.MultipointVertexEditor(a,b,d);case "polyline":return new t.PolylineVertexEditor(a,b,d);case "polygon":return new t.PolygonVertexEditor(a,b,d)}}});t.MultipointVertexEditor=q(t,{declaredClass:"esri.toolbars._MultipointVertexEditor",minLength:1,constructor:function(){this._moveStartHandle=n.connect(h,"onMoveStart",this,this._moveStartHandler);
n.disconnect(this._firstMoveHandle)},destroy:function(){this.inherited(arguments);n.disconnect(this._moveStartHandle)},_getSegments:function(a){var d=a.points,c=[],e=a.spatialReference;for(a=0;a<d.length;a++){var h=d[a];c.push(new b({x:h[0],y:h[1],spatialReference:e.toJson()}))}return[c]},_getMidpointSegments:function(a){return[]},_getControlPoints:function(a,b,d,c,e){return[]},_getGraphicsLayer:function(){return this.graphic._graphicsLayer},_mouseOverHandler:function(a){var b=a.graphic;if(a=this._findMover(a))this.toolbar.onVertexMouseOver(b,
a._getInfo()),this._selectedMover=a,this._canDel&&this._bindCtxNode(a.graphic.getDojoShape().getNode())},_mouseOutHandler:function(a){var b=a.graphic;if(a=this._findMover(a))this.toolbar.onVertexMouseOut(b,a._getInfo())},_findMover:function(a){var b=[].concat(this._vertexMovers[0]),d=a.target;for(a=0;a<b.length;a++){var c=b[a];if(c.graphic.getDojoShape().getNode()===d)return c}},_moveStartHandler:function(a){var b=a.ptIndex,d=a.segLength-1,c=a.relatedGraphic.geometry.points;a=c.splice(b,1);c.push(a[0]);
c=this._vertexMovers[0];for(a=d;a>b;a--)--c[a].ptIndex;a=c.splice(b,1);c.push(a[0]);a[0].ptIndex=d},_moveStopHandler:function(a){this._updateRelatedGraphic(a,a.relatedGraphic,a.graphic.geometry,a.segIndex,a.ptIndex,a.segLength);this.toolbar._endOperation("VERTICES")},_updateRelatedGraphic:function(a,b,d,c,e,h,f,k){a=b.geometry;k?a.removePoint(e):a.setPoint(e,d);b.setGeometry(a)},_deleteMidpoints:function(a){}});t.PolylineVertexEditor=q(t,{declaredClass:"esri.toolbars._PolylineVertexEditor",minLength:2,
_getSegments:function(a){var b,d,c=a.paths,e=[];for(b=0;b<c.length;b++){var h=c[b],f=[];for(d=0;d<h.length;d++)f.push(a.getPoint(b,d));e.push(f)}return e},_getMidpointSegments:function(a){var d,c,e=a.paths,h=[],f=a.spatialReference;for(d=0;d<e.length;d++){var k=e[d],t=[];for(c=0;c<k.length-1;c++){var v=a.getPoint(d,c),l=a.getPoint(d,c+1),v=new b({x:(v.x+l.x)/2,y:(v.y+l.y)/2,spatialReference:f.toJson()});t.push(v)}h.push(t)}return h},_getControlPoints:function(a,b,d,c,e){var g=this.map,h,f;this._isNew(a)?
(a=c,c+=1,0<=a&&(h=g.toScreen(b.getPoint(d,a))),c<=e&&(f=g.toScreen(b.getPoint(d,c)))):(a=c-1,c+=1,0<=a&&(h=g.toScreen(b.getPoint(d,a))),c<e&&(f=g.toScreen(b.getPoint(d,c))));return[h,f]},_getAdjacentMidpoints:function(a,b){var d=[],c=a-1;0<=c&&d.push(c);a<b-1&&d.push(a);return d},_getAdjacentVertices:function(a,b){return[a,a+1]},_deleteMidpoints:function(a){var d=this._mpVertexMovers[a.segIndex],c=d.length-1,e=this._getAdjacentMidpoints(a.ptIndex,a.segLength).sort(),f,k=e[0];for(f=0;f<k;f++)--d[f].segLength;
for(f=k+1;f<d.length;f++){var t=d[f];--t.ptIndex;--t.segLength}if(1===e.length)d.splice(k,1)[0].destroy();else for(t=this._getAdjacentVertices(k,c),f=a.relatedGraphic.geometry.getPoint(a.segIndex,t[0]),t=a.relatedGraphic.geometry.getPoint(a.segIndex,t[1]),f=new b({x:(f.x+t.x)/2,y:(f.y+t.y)/2,spatialReference:f.spatialReference.toJson()}),a=new h(f,this._symbol2,this.graphic,a.segIndex,k,c,this,!0),d=d.splice(k,e.length,a),f=0;f<d.length;f++)d[f].destroy()},_updateRelatedGraphic:function(b,d,c,e,h,
f,k,t){b=d.geometry;k?b.insertPoint(e,h+1,a.fromJson(c.toJson())):t?b.removePoint(e,h):b.setPoint(e,h,a.fromJson(c.toJson()));d.setGeometry(b)}});t.PolygonVertexEditor=q(t,{declaredClass:"esri.toolbars._PolygonVertexEditor",minLength:3,_getSegments:function(a){var b,d,c=a.rings,e=[];for(b=0;b<c.length;b++){var h=c[b],f=[];for(d=0;d<h.length-1;d++)f.push(a.getPoint(b,d));e.push(f)}return e},_getMidpointSegments:function(a){var d,c,e=a.rings,h=[],f=a.spatialReference;for(d=0;d<e.length;d++){var k=e[d],
t=[];for(c=0;c<k.length-1;c++){var v=a.getPoint(d,c),l=a.getPoint(d,c+1),v=new b({x:(v.x+l.x)/2,y:(v.y+l.y)/2,spatialReference:f.toJson()});t.push(v)}h.push(t)}return h},_getControlPoints:function(a,b,d,c,e){var g=this.map;this._isNew(a)?a=c:(a=c-1,a=0>a?(e+a)%e:a);c=(c+1)%e;e=g.toScreen(b.getPoint(d,a));b=g.toScreen(b.getPoint(d,c));return[e,b]},_getAdjacentMidpoints:function(a,b){var d=a-1;return[0>d?(b+d)%b:d,a]},_getAdjacentVertices:function(a,b){return[a,(a+1)%b]},_deleteMidpoints:function(a){var d=
a.ptIndex,c=this._mpVertexMovers[a.segIndex],e=c.length-1,f=this._getAdjacentMidpoints(d,a.segLength).sort(),k,t;t=f[0];var l=f[f.length-1];if(0===d)for(k=this._getAdjacentVertices(e-1,e),d=a.relatedGraphic.geometry.getPoint(a.segIndex,k[0]),k=a.relatedGraphic.geometry.getPoint(a.segIndex,k[1]),d=new b({x:(d.x+k.x)/2,y:(d.y+k.y)/2,spatialReference:d.spatialReference.toJson()}),a=new h(d,this._symbol2,this.graphic,a.segIndex,e-1,e,this,!0),c.splice(l,1,a)[0].destroy(),c.splice(t,1)[0].destroy(),f=
0;f<c.length-1;f++)t=c[f],--t.ptIndex,--t.segLength;else{k=this._getAdjacentVertices(t,e);d=a.relatedGraphic.geometry.getPoint(a.segIndex,k[0]);k=a.relatedGraphic.geometry.getPoint(a.segIndex,k[1]);d=new b({x:(d.x+k.x)/2,y:(d.y+k.y)/2,spatialReference:d.spatialReference.toJson()});a=new h(d,this._symbol2,this.graphic,a.segIndex,t,e,this,!0);l=c.splice(t,f.length,a);for(f=0;f<l.length;f++)l[f].destroy();for(f=0;f<t;f++)--c[f].segLength;for(f=t+1;f<c.length;f++)t=c[f],--t.ptIndex,--t.segLength}},_updateRelatedGraphic:function(b,
d,c,e,h,f,k,t){b=d.geometry;k?b.insertPoint(e,h+1,a.fromJson(c.toJson())):t?(b.removePoint(e,h),0===h&&b.setPoint(e,f-1,a.fromJson(b.getPoint(e,0).toJson()))):(b.setPoint(e,h,a.fromJson(c.toJson())),0===h&&b.setPoint(e,f,a.fromJson(c.toJson())));d.setGeometry(b)}});f("extend-esri")&&(m.setObject("toolbars._GraphicVertexEditor",t,c),m.setObject("toolbars._MultipointVertexEditor",t.MultipointVertexEditor,c),m.setObject("toolbars._PolylineVertexEditor",t.PolylineVertexEditor,c),m.setObject("toolbars._PolygonVertexEditor",
t.PolygonVertexEditor,c));return t})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u){a("dijit-legacy-requires")&&u(0,function(){q(["dijit/MenuItem","dijit/PopupMenuItem","dijit/CheckedMenuItem","dijit/MenuSeparator"])});return n("dijit.Menu",g,{constructor:function(){this._bindings=
[]},targetNodeIds:[],selector:"",contextMenuForWindow:!1,leftClickToOpen:!1,refocus:!0,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(this.ownerDocumentBody):m.forEach(this.targetNodeIds,this.bindDomNode,this);this.inherited(arguments)},_iframeContentWindow:function(a){return t.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=l.byId(a,this.ownerDocument);var e;if("iframe"==a.tagName.toLowerCase()){var g=a;e=this._iframeContentWindow(g);e=d.body(e.document)}else e=a==d.body(this.ownerDocument)?this.ownerDocument.documentElement:a;var p={node:a,iframe:g};f.set(a,"_dijitMenu"+this.id,this._bindings.push(p));var k=h.hitch(this,function(a){var d=this.selector,e=d?function(a){return b.selector(d,a)}:function(a){return a},h=this;
return[b(a,e(this.leftClickToOpen?"click":"contextmenu"),function(a){a.stopPropagation();a.preventDefault();(new Date).getTime()<h._lastKeyDown+500||h._scheduleOpen(this,g,{x:a.pageX,y:a.pageY},a.target)}),b(a,e("keydown"),function(a){if(93==a.keyCode||a.shiftKey&&a.keyCode==c.F10||h.leftClickToOpen&&a.keyCode==c.SPACE)a.stopPropagation(),a.preventDefault(),h._scheduleOpen(this,g,null,a.target),h._lastKeyDown=(new Date).getTime()})]});p.connects=e?k(e):[];g&&(p.onloadHandler=h.hitch(this,function(){var a=
this._iframeContentWindow(g),a=d.body(a.document);p.connects=k(a)}),g.addEventListener?g.addEventListener("load",p.onloadHandler,!1):g.attachEvent("onload",p.onloadHandler))},unBindDomNode:function(a){var b;try{b=l.byId(a,this.ownerDocument)}catch(x){return}a="_dijitMenu"+this.id;if(b&&f.has(b,a)){for(var d=f.get(b,a)-1,c=this._bindings[d],e;e=c.connects.pop();)e.remove();(e=c.iframe)&&(e.removeEventListener?e.removeEventListener("load",c.onloadHandler,!1):e.detachEvent("onload",c.onloadHandler));
f.remove(b,a);delete this._bindings[d]}},_scheduleOpen:function(a,b,d,c){this._openTimer||(this._openTimer=this.defer(function(){delete this._openTimer;this._openMyself({target:c,delegatedTarget:a,iframe:b,coords:d})},1))},_openMyself:function(b){function d(){m.refocus&&n&&n.focus();v.close(m)}var c=b.target,g=b.iframe,h=b.coords,f=!h;this.currentTarget=b.delegatedTarget;if(h){if(g){b=e.position(g,!0);var c=this._iframeContentWindow(g),c=e.docScroll(c.document),p=k.getComputedStyle(g),t=k.toPixelValue,
u=(a("ie")&&a("quirks")?0:t(g,p.paddingLeft))+(a("ie")&&a("quirks")?t(g,p.borderLeftWidth):0),g=(a("ie")&&a("quirks")?0:t(g,p.paddingTop))+(a("ie")&&a("quirks")?t(g,p.borderTopWidth):0);h.x+=b.x+u-c.x;h.y+=b.y+g-c.y}}else h=e.position(c,!0),h.x+=10,h.y+=10;var m=this,g=this._focusManager.get("prevNode");b=this._focusManager.get("curNode");var n=!b||l.isDescendant(b,this.domNode)?g:b;v.open({popup:this,x:h.x,y:h.y,onExecute:d,onCancel:d,orient:this.isLeftToRight()?"L":"R"});this.focus();f||this.defer(function(){this._cleanUp(!0)});
this._onBlur=function(){this.inherited("_onBlur",arguments);v.close(this)}},destroy:function(){m.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(q,m,n,l,f,e,k,c,h,b,a,d,
t,v,g,u){function p(){this._popupWrapper&&(e.destroy(this._popupWrapper),delete this._popupWrapper)}n=n(null,{_stack:[],_beginZIndex:1E3,_idGen:1,_repositionAll:function(){if(this._firstAroundNode){var b=this._firstAroundPosition,d=k.position(this._firstAroundNode,!0),c=d.x-b.x,b=d.y-b.y;if(c||b)for(this._firstAroundPosition=d,d=0;d<this._stack.length;d++){var e=this._stack[d].wrapper.style;e.top=parseFloat(e.top)+b+"px";"auto"==e.right?e.left=parseFloat(e.left)+c+"px":e.right=parseFloat(e.right)-
c+"px"}this._aroundMoveListener=setTimeout(a.hitch(this,"_repositionAll"),c||b?10:50)}},_createWrapper:function(a){var b=a._popupWrapper,c=a.domNode;b||(b=e.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,m.after(a,"destroy",p,!0),"ontouchend"in document&&d(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=k.isBodyLtr(a.ownerDocument);var d={visibility:"hidden",top:"-9999px",display:""};d[a?"left":"right"]="-9999px";d[a?"right":"left"]="auto";c.set(b,d);return b},hide:function(a){var b=this._createWrapper(a);c.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(e){for(var p=this._stack,u=e.popup,r=u.domNode,m=e.orient||["below","below-alt","above","above-alt"],n=e.parent?e.parent.isLeftToRight():k.isBodyLtr(u.ownerDocument),q=e.around,E=e.around&&e.around.id?e.around.id+"_dropdown":"popup_"+this._idGen++;p.length&&(!e.parent||!l.isDescendant(e.parent.domNode,p[p.length-1].widget.domNode));)this.close(p[p.length-1].widget);var C=this.moveOffScreen(u);u.startup&&!u._started&&u.startup();var D,
F=k.position(r);if("maxHeight"in e&&-1!=e.maxHeight)D=e.maxHeight||Infinity;else{D=g.getEffectiveBox(this.ownerDocument);var G=q?k.position(q,!1):{y:e.y-(e.padding||0),h:2*(e.padding||0)};D=Math.floor(Math.max(G.y,D.h-(G.y+G.h)))}F.h>D&&(F=c.getComputedStyle(r),c.set(C,{overflowY:"scroll",height:D+"px",border:F.borderLeftWidth+" "+F.borderLeftStyle+" "+F.borderLeftColor}),r._originalStyle=r.style.cssText,r.style.border="none");f.set(C,{id:E,style:{zIndex:this._beginZIndex+p.length},"class":"dijitPopup "+
(u.baseClass||u["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:e.parent?e.parent.id:""});0==p.length&&q&&(this._firstAroundNode=q,this._firstAroundPosition=k.position(q,!0),this._aroundMoveListener=setTimeout(a.hitch(this,"_repositionAll"),50));h("config-bgIframe")&&!u.bgIframe&&(u.bgIframe=new v(C));E=u.orient?a.hitch(u,"orient"):null;m=q?t.around(C,q,m,n,E):t.at(C,e,"R"==m?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],e.padding,E);C.style.visibility="visible";r.style.visibility="visible";r=
[];r.push(d(C,"keydown",a.hitch(this,function(a){if(a.keyCode==b.ESCAPE&&e.onCancel)a.stopPropagation(),a.preventDefault(),e.onCancel();else if(a.keyCode==b.TAB&&(a.stopPropagation(),a.preventDefault(),(a=this.getTopPopup())&&a.onCancel))a.onCancel()})));u.onCancel&&e.onCancel&&r.push(u.on("cancel",e.onCancel));r.push(u.on(u.onExecute?"execute":"change",a.hitch(this,function(){var a=this.getTopPopup();if(a&&a.onExecute)a.onExecute()})));p.push({widget:u,wrapper:C,parent:e.parent,onExecute:e.onExecute,
onCancel:e.onCancel,onClose:e.onClose,handlers:r});if(u.onOpen)u.onOpen(m);return m},close:function(a){for(var b=this._stack;a&&q.some(b,function(b){return b.widget==a})||!a&&b.length;){var d=b.pop(),c=d.widget,e=d.onClose;c.bgIframe&&(c.bgIframe.destroy(),delete c.bgIframe);if(c.onClose)c.onClose();for(var g;g=d.handlers.pop();)g.remove();c&&c.domNode&&this.hide(c);e&&e()}0==b.length&&this._aroundMoveListener&&(clearTimeout(this._aroundMoveListener),this._firstAroundNode=this._firstAroundPosition=
this._aroundMoveListener=null)}});return u.popup=new n})},"dijit/place":function(){define("dojo/_base/array dojo/dom-geometry dojo/dom-style dojo/_base/kernel dojo/_base/window ./Viewport ./main".split(" "),function(q,m,n,l,f,e,k){function c(b,a,d,c){var h=e.getEffectiveBox(b.ownerDocument);b.parentNode&&"body"==String(b.parentNode.tagName).toLowerCase()||f.body(b.ownerDocument).appendChild(b);var g=null;q.some(a,function(a){var e=a.corner,f=a.pos,p=0,k={w:{L:h.l+h.w-f.x,R:f.x-h.l,M:h.w}[e.charAt(1)],
h:{T:h.t+h.h-f.y,B:f.y-h.t,M:h.h}[e.charAt(0)]},t=b.style;t.left=t.right="auto";d&&(p=d(b,a.aroundCorner,e,k,c),p="undefined"==typeof p?0:p);var u=b.style,r=u.display,l=u.visibility;"none"==u.display&&(u.visibility="hidden",u.display="");t=m.position(b);u.display=r;u.visibility=l;r={L:f.x,R:f.x-t.w,M:Math.max(h.l,Math.min(h.l+h.w,f.x+(t.w>>1))-t.w)}[e.charAt(1)];l={T:f.y,B:f.y-t.h,M:Math.max(h.t,Math.min(h.t+h.h,f.y+(t.h>>1))-t.h)}[e.charAt(0)];f=Math.max(h.l,r);u=Math.max(h.t,l);r=Math.min(h.l+h.w,
r+t.w)-f;l=Math.min(h.t+h.h,l+t.h)-u;p+=t.w-r+(t.h-l);if(null==g||p<g.overflow)g={corner:e,aroundCorner:a.aroundCorner,x:f,y:u,w:r,h:l,overflow:p,spaceAvailable:k};return!p});g.overflow&&d&&d(b,g.aroundCorner,g.corner,g.spaceAvailable,c);a=g.y;var k=g.x,p=f.body(b.ownerDocument);/relative|absolute/.test(n.get(p,"position"))&&(a-=n.get(p,"marginTop"),k-=n.get(p,"marginLeft"));p=b.style;p.top=a+"px";p.left=k+"px";p.right="auto";return g}var h={TL:"BR",TR:"BL",BL:"TR",BR:"TL"};return k.place={at:function(b,
a,d,e,f){d=q.map(d,function(b){var d={corner:b,aroundCorner:h[b],pos:{x:a.x,y:a.y}};e&&(d.pos.x+="L"==b.charAt(1)?e.x:-e.x,d.pos.y+="T"==b.charAt(0)?e.y:-e.y);return d});return c(b,d,f)},around:function(b,a,d,e,h){function g(a,b){C.push({aroundCorner:a,corner:b,pos:{x:{L:x,R:x+z,M:x+(z>>1)}[a.charAt(1)],y:{T:w,B:w+E,M:w+(E>>1)}[a.charAt(0)]}})}var f;if("string"==typeof a||"offsetWidth"in a||"ownerSVGElement"in a){if(f=m.position(a,!0),/^(above|below)/.test(d[0])){var p=m.getBorderExtents(a),k=a.firstChild?
m.getBorderExtents(a.firstChild):{t:0,l:0,b:0,r:0},t=m.getBorderExtents(b),v=b.firstChild?m.getBorderExtents(b.firstChild):{t:0,l:0,b:0,r:0};f.y+=Math.min(p.t+k.t,t.t+v.t);f.h-=Math.min(p.t+k.t,t.t+v.t)+Math.min(p.b+k.b,t.b+v.b)}}else f=a;if(a.parentNode)for(p="absolute"==n.getComputedStyle(a).position,a=a.parentNode;a&&1==a.nodeType&&"BODY"!=a.nodeName;){k=m.position(a,!0);t=n.getComputedStyle(a);/relative|absolute/.test(t.position)&&(p=!1);if(!p&&/hidden|auto|scroll/.test(t.overflow)){var v=Math.min(f.y+
f.h,k.y+k.h),B=Math.min(f.x+f.w,k.x+k.w);f.x=Math.max(f.x,k.x);f.y=Math.max(f.y,k.y);f.h=v-f.y;f.w=B-f.x}"absolute"==t.position&&(p=!0);a=a.parentNode}var x=f.x,w=f.y,z="w"in f?f.w:f.w=f.width,E="h"in f?f.h:(l.deprecated("place.around: dijit/place.__Rectangle: { x:"+x+", y:"+w+", height:"+f.height+", width:"+z+" } has been deprecated.  Please use { x:"+x+", y:"+w+", h:"+f.height+", w:"+z+" }","","2.0"),f.h=f.height),C=[];q.forEach(d,function(a){var b=e;switch(a){case "above-centered":g("TM","BM");
break;case "below-centered":g("BM","TM");break;case "after-centered":b=!b;case "before-centered":g(b?"ML":"MR",b?"MR":"ML");break;case "after":b=!b;case "before":g(b?"TL":"TR",b?"TR":"TL");g(b?"BL":"BR",b?"BR":"BL");break;case "below-alt":b=!b;case "below":g(b?"BL":"BR",b?"TL":"TR");g(b?"BR":"BL",b?"TR":"TL");break;case "above-alt":b=!b;case "above":g(b?"TL":"TR",b?"BL":"BR");g(b?"TR":"TL",b?"BR":"BL");break;default:g(a.aroundCorner,a.corner)}});b=c(b,C,h,{w:z,h:E});b.aroundNodePos=f;return b}}})},
"dijit/Viewport":function(){define(["dojo/Evented","dojo/on","dojo/domReady","dojo/sniff","dojo/window"],function(q,m,n,l,f){var e=new q,k;n(function(){var c=f.getBox();e._rlh=m(window,"resize",function(){var b=f.getBox();if(c.h!=b.h||c.w!=b.w)c=b,e.emit("resize")});if(8==l("ie")){var h=screen.deviceXDPI;setInterval(function(){screen.deviceXDPI!=h&&(h=screen.deviceXDPI,e.emit("resize"))},500)}l("ios")&&(m(document,"focusin",function(b){k=b.target}),m(document,"focusout",function(b){k=null}))});e.getEffectiveBox=
function(c){c=f.getBox(c);var e=k&&k.tagName&&k.tagName.toLowerCase();l("ios")&&k&&!k.readOnly&&("textarea"==e||"input"==e&&/^(color|email|number|password|search|tel|text|url)$/.test(k.type))&&(c.h*=0==orientation||180==orientation?.66:.4,e=k.getBoundingClientRect(),c.h=Math.max(c.h,e.top+e.height));return c};return e})},"dijit/BackgroundIframe":function(){define("require ./main dojo/_base/config dojo/dom-construct dojo/dom-style dojo/_base/lang dojo/on dojo/sniff".split(" "),function(q,m,n,l,f,e,
k,c){c.add("config-bgIframe",(c("ie")||c("trident"))&&!/IEMobile\/10\.0/.test(navigator.userAgent));var h=new function(){var b=[];this.pop=function(){var a;b.length?(a=b.pop(),a.style.display=""):(9>c("ie")?(a=n.dojoBlankHtmlUrl||q.toUrl("dojo/resources/blank.html")||'javascript:""',a=document.createElement("\x3ciframe src\x3d'"+a+"' role\x3d'presentation' style\x3d'position: absolute; left: 0px; top: 0px;z-index: -1; filter:Alpha(Opacity\x3d\"0\");'\x3e")):(a=l.create("iframe"),a.src='javascript:""',
a.className="dijitBackgroundIframe",a.setAttribute("role","presentation"),f.set(a,"opacity",.1)),a.tabIndex=-1);return a};this.push=function(a){a.style.display="none";b.push(a)}};m.BackgroundIframe=function(b){if(!b.id)throw Error("no id");if(c("config-bgIframe")){var a=this.iframe=h.pop();b.appendChild(a);7>c("ie")||c("quirks")?(this.resize(b),this._conn=k(b,"resize",e.hitch(this,"resize",b))):f.set(a,{width:"100%",height:"100%"})}};e.extend(m.BackgroundIframe,{resize:function(b){this.iframe&&f.set(this.iframe,
{width:b.offsetWidth+"px",height:b.offsetHeight+"px"})},destroy:function(){this._conn&&(this._conn.remove(),this._conn=null);this.iframe&&(this.iframe.parentNode.removeChild(this.iframe),h.push(this.iframe),delete this.iframe)}});return m.BackgroundIframe})},"dijit/DropDownMenu":function(){define(["dojo/_base/declare","dojo/keys","dojo/text!./templates/Menu.html","./_MenuBase"],function(q,m,n,l){return q("dijit.DropDownMenu",l,{templateString:n,baseClass:"dijitMenu",_onUpArrow:function(){this.focusPrev()},
_onDownArrow:function(){this.focusNext()},_onRightArrow:function(f){this._moveToPopup(f);f.stopPropagation();f.preventDefault()},_onLeftArrow:function(f){if(this.parentMenu)if(this.parentMenu._isMenuBar)this.parentMenu.focusPrev();else this.onCancel(!1);else f.stopPropagation(),f.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(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g){return m("dijit._MenuBase",[d,g,v,t],{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){f.toggle(this.domNode,"dijitMenuActive",a);f.toggle(this.domNode,"dijitMenuPassive",!a);this._set("activated",a)},parentMenu:null,popupDelay:500,passivePopupDelay:Infinity,autoFocus:!1,
childSelector:function(b){var d=a.byNode(b);return b.parentNode==this.containerNode&&d&&d.focus},postCreate:function(){var d=this,g="string"==typeof this.childSelector?this.childSelector:e.hitch(this,"childSelector");this.own(c(this.containerNode,c.selector(g,k.enter),function(){d.onItemHover(a.byNode(this))}),c(this.containerNode,c.selector(g,k.leave),function(){d.onItemUnhover(a.byNode(this))}),c(this.containerNode,c.selector(g,b),function(b){d.onItemClick(a.byNode(this),b);b.stopPropagation()}),
c(this.containerNode,c.selector(g,"focusin"),function(){d._onItemFocus(a.byNode(this))}));this.inherited(arguments)},onKeyboardSearch:function(a,b,d,c){this.inherited(arguments);if(a&&(-1==c||a.popup&&1==c))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 d=/^key/.test(b._origType||
b.type)||0==b.clientX&&0==b.clientY;this._openItemPopup(a,d)}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 d=a.popup;d.parentMenu=this;this.own(this._mouseoverHandle=c.once(d.domNode,"mouseover",e.hitch(this,"_onPopupHover")));var g=this;a._openPopup({parent:this,orient:this._orient||["after","before"],onCancel:function(){b&&
g.focusChild(a);g._cleanUp()},onExecute:e.hitch(this,"_cleanUp",!0),onClose:function(){g._mouseoverHandle&&(g._mouseoverHandle.remove(),delete g._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&&(l.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(q,m,n,l,f,e,k,c,h,b,a,d){m=m("dijit._CssStateMixin",[],{hovering:!1,active:!1,_applyAttributes:function(){this.inherited(arguments);q.forEach("disabled readOnly checked selected focused state hovering active _opened".split(" "),function(a){this.watch(a,e.hitch(this,"_setStateClass"))},this);for(var a in this.cssStateNodes||{})this._trackMouseState(this[a],this.cssStateNodes[a]);this._trackMouseState(this.domNode,this.baseClass);this._setStateClass()},_cssMouseEvent:function(a){if(!this.disabled)switch(a.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 a(a){b=b.concat(q.map(b,function(b){return b+a}),"dijit"+a)}var b=this.baseClass.split(" ");
this.isLeftToRight()||a("Rtl");var d="mixed"==this.checked?"Mixed":this.checked?"Checked":"";this.checked&&a(d);this.state&&a(this.state);this.selected&&a("Selected");this._opened&&a("Opened");this.disabled?a("Disabled"):this.readOnly?a("ReadOnly"):this.active?a("Active"):this.hovering&&a("Hover");this.focused&&a("Focused");var d=this.stateNode||this.domNode,c={};q.forEach(d.className.split(" "),function(a){c[a]=!0});"_stateClasses"in this&&q.forEach(this._stateClasses,function(a){delete c[a]});q.forEach(b,
function(a){c[a]=!0});var e=[],h;for(h in c)e.push(h);d.className=e.join(" ");this._stateClasses=b},_subnodeCssMouseEvent:function(a,b,d){function c(d){l.toggle(a,b+"Active",d)}if(!this.disabled&&!this.readOnly)switch(d.type){case "mouseover":case "MSPointerOver":case "pointerover":l.toggle(a,b+"Hover",!0);break;case "mouseout":case "MSPointerOut":case "pointerout":l.toggle(a,b+"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":l.toggle(a,b+"Focused",!0);break;case "blur":case "focusout":l.toggle(a,b+"Focused",!1)}},_trackMouseState:function(a,b){a._cssState=b}});c(function(){function c(a,b,c){if(!c||!n.isDescendant(c,b))for(;b&&b!=c;b=b.parentNode)if(b._cssState){var e=d.getEnclosingWidget(b);e&&(b==e.domNode?e._cssMouseEvent(a):e._subnodeCssMouseEvent(b,b._cssState,a))}}var e=b.body(),g;k(e,
h.over,function(a){c(a,a.target,a.relatedTarget)});k(e,h.out,function(a){c(a,a.target,a.relatedTarget)});k(e,a.press,function(a){g=a.target;c(a,g)});k(e,a.release,function(a){c(a,g);g=null});k(e,"focusin, focusout",function(a){var b=a.target;if(b._cssState&&!b.getAttribute("widgetId")){var c=d.getEnclosingWidget(b);c&&c._subnodeCssMouseEvent(b,b._cssState,a)}})});return m})},"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(q,m,n,l,f,e,k,c,h,b){return m("dijit._KeyNavContainer",[h,b,c],{connectKeyNavHandlers:function(a,b){var d=this._keyNavCodes={},c=e.hitch(this,"focusPrev"),g=e.hitch(this,"focusNext");q.forEach(a,function(a){d[a]=c});q.forEach(b,function(a){d[a]=g});d[f.HOME]=e.hitch(this,"focusFirstChild");d[f.END]=e.hitch(this,"focusLastChild")},startupKeyNavChildren:function(){l.deprecated("startupKeyNavChildren() call no longer needed","","2.0")},startup:function(){this.inherited(arguments);q.forEach(this.getChildren(),
e.hitch(this,"_startupChild"))},addChild:function(a,b){this.inherited(arguments);this._startupChild(a)},_startupChild:function(a){a.set("tabIndex","-1")},_getFirst:function(){var a=this.getChildren();return a.length?a[0]:null},_getLast:function(){var a=this.getChildren();return a.length?a[a.length-1]:null},focusNext:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,1))},focusPrev:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,-1),!0)},childSelector:function(a){return(a=
k.byNode(a))&&a.getParent()==this}})})},"dijit/_Container":function(){define(["dojo/_base/array","dojo/_base/declare","dojo/dom-construct","dojo/_base/kernel"],function(q,m,n,l){return m("dijit._Container",null,{buildRendering:function(){this.inherited(arguments);this.containerNode||(this.containerNode=this.domNode)},addChild:function(f,e){var k=this.containerNode;if(0<e){for(k=k.firstChild;0<e;)1==k.nodeType&&e--,k=k.nextSibling;k?e="before":(k=this.containerNode,e="last")}n.place(f.domNode,k,e);
this._started&&!f._started&&f.startup()},removeChild:function(f){"number"==typeof f&&(f=this.getChildren()[f]);f&&(f=f.domNode)&&f.parentNode&&f.parentNode.removeChild(f)},hasChildren:function(){return 0<this.getChildren().length},_getSiblingOfChild:function(f,e){var k=this.getChildren(),c=q.indexOf(k,f);return k[c+e]},getIndexOfChild:function(f){return q.indexOf(this.getChildren(),f)}})})},"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(q,m,n,l,f,e,k,c){return m("dijit._KeyNavMixin",c,{tabIndex:"0",childSelector:null,postCreate:function(){this.inherited(arguments);n.set(this.domNode,"tabIndex",this.tabIndex);if(!this._keyNavCodes){var c=this._keyNavCodes={};c[l.HOME]=f.hitch(this,"focusFirstChild");c[l.END]=f.hitch(this,"focusLastChild");c[this.isLeftToRight()?l.LEFT_ARROW:l.RIGHT_ARROW]=f.hitch(this,"_onLeftArrow");c[this.isLeftToRight()?l.RIGHT_ARROW:l.LEFT_ARROW]=f.hitch(this,"_onRightArrow");c[l.UP_ARROW]=f.hitch(this,
"_onUpArrow");c[l.DOWN_ARROW]=f.hitch(this,"_onDownArrow")}var b=this,c="string"==typeof this.childSelector?this.childSelector:f.hitch(this,"childSelector");this.own(e(this.domNode,"keypress",f.hitch(this,"_onContainerKeypress")),e(this.domNode,"keydown",f.hitch(this,"_onContainerKeydown")),e(this.domNode,"focus",f.hitch(this,"_onContainerFocus")),e(this.containerNode,e.selector(c,"focusin"),function(a){b._onChildFocus(k.getEnclosingWidget(this),a)}))},_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(c,b){c&&(this.focusedChild&&c!==this.focusedChild&&this._onChildBlur(this.focusedChild),
c.set("tabIndex",this.tabIndex),c.focus(b?"end":"start"))},_onContainerFocus:function(c){c.target!==this.domNode||this.focusedChild||this.focus()},_onFocus:function(){n.set(this.domNode,"tabIndex","-1");this.inherited(arguments)},_onBlur:function(c){n.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(c){c&&c!=this.focusedChild&&
(this.focusedChild&&!this.focusedChild._destroyed&&this.focusedChild.set("tabIndex","-1"),c.set("tabIndex",this.tabIndex),this.lastFocused=c,this._set("focusedChild",c))},_searchString:"",multiCharSearchDuration:1E3,onKeyboardSearch:function(c,b,a,d){c&&this.focusChild(c)},_keyboardSearchCompare:function(c,b){var a=c.domNode,a=(c.label||(a.focusNode?a.focusNode.label:"")||a.innerText||a.textContent||"").replace(/^\s+/,"").substr(0,b.length).toLowerCase();return b.length&&a==b?-1:0},_isFormElement:function(c){return"INPUT"===
c.tagName||"TEXTAREA"===c.tagName||"SELECT"===c.tagName||"BUTTON"===c.tagName},_onContainerKeydown:function(c){if(!this._isFormElement(document.activeElement)){var b=this._keyNavCodes[c.keyCode];b?(b(c,this.focusedChild),c.stopPropagation(),c.preventDefault(),this._searchString=""):c.keyCode!=l.SPACE||!this._searchTimer||c.ctrlKey||c.altKey||c.metaKey||(c.stopImmediatePropagation(),c.preventDefault(),this._keyboardSearch(c," "))}},_onContainerKeypress:function(c){this._isFormElement(document.activeElement)||
c.charCode<=l.SPACE||c.ctrlKey||c.altKey||c.metaKey||(c.preventDefault(),c.stopPropagation(),this._keyboardSearch(c,String.fromCharCode(c.charCode).toLowerCase()))},_keyboardSearch:function(c,b){var a=null,d,e=0;f.hitch(this,function(){this._searchTimer&&this._searchTimer.remove();this._searchString+=b;var c=/^(.)\1*$/.test(this._searchString)?1:this._searchString.length;d=this._searchString.substr(0,c);this._searchTimer=this.defer(function(){this._searchTimer=null;this._searchString=""},this.multiCharSearchDuration);
var g=this.focusedChild||null;if(1==c||!g)if(g=this._getNextFocusableChild(g,1),!g)return;c=g;do{var f=this._keyboardSearchCompare(g,d);f&&0==e++&&(a=g);if(-1==f){e=-1;break}g=this._getNextFocusableChild(g,1)}while(g&&g!=c)})();this.onKeyboardSearch(a,c,d,e)},_onChildBlur:function(){},_getNextFocusableChild:function(c,b){var a=c;do{if(c)c=this._getNext(c,b);else if(c=this[0<b?"_getFirst":"_getLast"](),!c)break;if(null!=c&&c!=a&&c.isFocusable())return c}while(c!=a);return null},_getFirst:function(){return null},
_getLast:function(){return null},_getNext:function(c,b){if(c)for(c=c.domNode;c;)if((c=c[0>b?"previousSibling":"nextSibling"])&&"getAttribute"in c){var a=k.byNode(c);if(a)return a}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(q,m,n,l,f,e,k,c,h,b,a,d){k=q("dijit.MenuItem"+(e("dojo-bidi")?
"_NoBidi":""),[c,h,b,a],{templateString:d,baseClass:"dijitMenuItem",label:"",_setLabelAttr:function(a){this._set("label",a);var b="",d;d=a.search(/{\S}/);if(0<=d){var b=a.charAt(d+1),c=a.substr(0,d);a=a.substr(d+3);d=c+b+a;a=c+'\x3cspan class\x3d"dijitMenuItemShortcutKey"\x3e'+b+"\x3c/span\x3e"+a}else d=a;this.domNode.setAttribute("aria-label",d+" "+this.accelKey);this.containerNode.innerHTML=a;this._set("shortcutKey",b)},iconClass:"dijitNoIcon",_setIconClassAttr:{node:"iconNode",type:"class"},accelKey:"",
disabled:!1,_fillContent:function(a){!a||"label"in this.params||this._set("label",a.innerHTML)},buildRendering:function(){this.inherited(arguments);n.set(this.containerNode,"id",this.id+"_text");this.accelKeyNode&&n.set(this.accelKeyNode,"id",this.id+"_accel");m.setSelectable(this.domNode,!1)},onClick:function(){},focus:function(){try{8==e("ie")&&this.containerNode.focus(),this.focusNode.focus()}catch(t){}},_setSelected:function(a){l.toggle(this.domNode,"dijitMenuItemSelected",a)},setLabel:function(a){f.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.",
"","2.0");this.set("label",a)},setDisabled:function(a){f.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",a)},_setDisabledAttr:function(a){this.focusNode.setAttribute("aria-disabled",a?"true":"false");this._set("disabled",a)},_setAccelKeyAttr:function(a){this.accelKeyNode&&(this.accelKeyNode.style.display=a?"":"none",this.accelKeyNode.innerHTML=a,n.set(this.containerNode,"colSpan",a?"1":"2"));this._set("accelKey",a)}});e("dojo-bidi")&&
(k=q("dijit.MenuItem",k,{_setLabelAttr:function(a){this.inherited(arguments);"auto"===this.textDir&&this.applyTextDir(this.textDirNode)}}));return k})},"dijit/_Contained":function(){define(["dojo/_base/declare","./registry"],function(q,m){return q("dijit._Contained",null,{_getSibling:function(m){var l=this.getParent();return l&&l._getSiblingOfChild&&l._getSiblingOfChild(this,"previous"==m?-1:1)||null},getPreviousSibling:function(){return this._getSibling("previous")},getNextSibling:function(){return this._getSibling("next")},
getIndexInParent:function(){var m=this.getParent();return m&&m.getIndexOfChild?m.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(q,m,n,l,f,e,k,c,h,b,a,d){q=q(null,{declaredClass:"esri.toolbars.VertexMover",constructor:function(a,b,d,c,e,f,h,k){this.point=a;
this.symbol=b;this.relatedGraphic=d;this.segIndex=c;this.ptIndex=e;this.segLength=f;this.editor=h;this.map=h.map;this._scratchGL=h.toolbar._scratchGL;this._placeholder=k||!1;this._type=d.geometry.type;this._init();this._enable()},refresh:function(a){if(a||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 b(this.point.toJson()),d=new a(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 a=this.graphic.getDojoShape();a&&(a._hasMover=!0,this._moveable=this._getMoveable(a),(a=a.getEventSource())&&f.set(a,"cursor",this.editor.toolbar._cursors[this._placeholder?"move-gv":"move-v"]))},
_disable:function(){var a=this._moveable;if(a){n.disconnect(this._startHandle);n.disconnect(this._firstHandle);n.disconnect(this._movingHandle);n.disconnect(this._stopHandle);var b=a.shape;b&&(b=b.getEventSource())&&f.set(b,"cursor","inherit");a.destroy();this._moveable=null}},_needRefresh:function(){var a=this.graphic.getDojoShape(),b=!1;if(a)switch(this._type){case "multipoint":var d=this.relatedGraphic.getDojoShape();d&&(d=d.children[this.ptIndex],a!==d&&(this.graphic._shape=d,b=!0));break;case "polyline":case "polygon":b=
!a._hasMover}return b},_getMoveable:function(a){a=new e(a,l("mac")&&l("ff")&&!h("esri-touch")&&{leftButtonOnly:!0});this._startHandle=n.connect(a,"onMoveStart",this,this._moveStartHandler);this._firstHandle=n.connect(a,"onFirstMove",this,this._firstMoveHandler);this._movingHandle=n.connect(a,"onMoving",this,this._movingHandler);this._stopHandle=n.connect(a,"onMoveStop",this,this._moveStopHandler);return a},_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(a){var b=this.map;b.snappingManager&&b.snappingManager._setUpSnapping();this.editor.toolbar._deactivateScrollWheel();a.shape.moveToFront();this.constructor.onMoveStart(this);this.editor.toolbar.onVertexMoveStart(this.relatedGraphic,this._getInfo())},_firstMoveHandler:function(a){var b=a.shape,d=this._getControlEdges(),c=this._scratchGL._div,e,f=[],h=a.host.shape._wrapOffsets[0]||0;for(e=
0;e<d.length;e++){var k=d[e];k.x1+=h;k.x2+=h;f.push([c.createLine({x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2}).setStroke(this.editor._lineStroke),k.x1,k.y1,k.x2,k.y2])}b._lines=f;a.shape.moveToFront();this.constructor.onFirstMove(this);this.editor.toolbar.onVertexFirstMove(this.relatedGraphic,this._getInfo())},_movingHandler:function(a,b,d){b=this.map;var e;h("esri-pointer")?e=b.navigationManager.pointerEvents._processTouchEvent(d,d):d&&"pointermove"===d.type&&(e=c.prototype._processTouchEvent.call({map:b},
d,d));e&&b.snappingManager&&b.snappingManager._onSnappingMouseMoveHandler(e);d=a.shape;a=d.getTransform();d=d._lines;for(e=0;e<d.length;e++)b=d[e],b[0].setShape({x1:b[1]+a.dx,y1:b[2]+a.dy,x2:b[3],y2:b[4]});this.editor.toolbar.onVertexMove(this.relatedGraphic,this._getInfo(),a)},_moveStopHandler:function(a){a=a.shape;var b=this.editor.toolbar,c=a.getTransform(),e=this.map,f=this.graphic,h=b._geo?d.geographicToWebMercator(f.geometry):f.geometry;b._activateScrollWheel();var k,t=a._lines;if(t){for(k=
0;k<t.length;k++)t[k][0].removeShape();a._lines=null}k=!1;var t=!0,l=this._getInfo();c&&(c.dx||c.dy)?this._placeholder&&(this._placeholder=!1,k=!0):t=!1;var m;e.snappingManager&&(m=e.snappingManager._snappingPoint);m=m||e.toMap(e.toScreen(h).offset(c.dx,c.dy));e.snappingManager&&e.snappingManager._killOffSnapping();a.setTransform(null);f.setGeometry(b._geo?d.webMercatorToGeographic(m,!0):m);this.constructor.onMoveStop(this,c);b.onVertexMoveStop(this.relatedGraphic,l,c);if(!t)b.onVertexClick(this.relatedGraphic,
l);if(k)b.onVertexAdd(this.relatedGraphic,this._getInfo())},_getControlEdges:function(){var a=this.map,b=this.relatedGraphic.geometry,d=this.segIndex,c=this.ptIndex,e=this.segLength,f=this._scratchGL._getTransform(),h=f.dx,f=f.dy,k=a.toScreen(this.graphic.geometry),a=k.x-h,k=k.y-f,l=[],b=this.editor._getControlPoints(this,b,d,c,e);b[0]&&l.push({x1:a,y1:k,x2:b[0].x-h,y2:b[0].y-f});b[1]&&l.push({x1:a,y1:k,x2:b[1].x-h,y2:b[1].y-f});return l}});h("extend-esri")&&m.setObject("toolbars.VertexMover",q,k);
m.mixin(q,{onMoveStart:function(){},onFirstMove:function(){},onMoveStop:function(){}});return q})},"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(q,m,n,l,f,e,k,c,h,b){q=q(null,{declaredClass:"esri.toolbars.TextEditor",constructor:function(a,b,c){this._graphic=a;this._map=b;this._toolbar=c;this._enable(this._graphic)},destroy:function(){this._disable()},
onEditStart:function(){},onEditEnd:function(){},_enable:function(a){this._editBox?(n.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null):(this._map.navigationManager.setImmediateClick(!0),this._addEditBoxHandler=n.connect(a.getLayer(),"onDblClick",this,function(b){this._map.navigationManager.setImmediateClick(!1);b.graphic==a&&(l.stop(b),n.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null,this._addTextBox(a))}))},_disable:function(){this._applyEdit();this._addEditBoxHandler&&
(n.disconnect(this._addEditBoxHandler),this._addEditBoxHandler=null);this._removeTextBox();this.onEditEnd(this._graphic);this._toolbar.onTextEditEnd(this._graphic)},_addTextBox:function(a,b){if(!this._editBox){var d;a.symbol.text||(a.symbol.text="Tempt text",a.setSymbol(a.symbol),d="");var f=this._createInputTextStyle(a,this._map);""!==d&&(d=b||a.symbol.text);this._editBox=e.create("input",{type:"text",value:d});c.set(this._editBox,f);k.add(this._editBox,"esriTextEditorInput");this._map.container.appendChild(this._editBox);
this._editBox.focus();this._editBoxKeyHandler=n.connect(this._editBox,"onkeyup",m.hitch(this,function(a){a.keyCode!=h.ENTER&&a.keyCode!==h.TAB||this._disable()}));this._editBoxBlurHandler=n.connect(this._editBox,"onblur",m.hitch(this,function(a){this._disable()}));a.symbol.text="";a.setSymbol(a.symbol);a.hide();var g=this._editBox;this._disableBoxHandler||(this._disableBoxHandler=this._map.on("zoom-start",m.hitch(this,function(){this._disable()})));this._moveBoxHandler=this._map.on("pan",function(a){c.set(g,
{left:this._editBoxLeft+a.delta.x+"px",top:this._editBoxTop+a.delta.y+"px"})});this._moveBoxStartHandler=this._map.on("pan-start",function(){this._editBoxLeft=parseFloat(c.get(g,"left"));this._editBoxTop=parseFloat(c.get(g,"top"))});this.onEditStart(a,this._editBox);this._toolbar.onTextEditStart(a,this._editBox)}},_removeTextBox:function(){this._editBoxBlurHandler&&(n.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&&(n.disconnect(this._editBoxKeyHandler),this._editBoxKeyHandler=null)},_createInputTextStyle:function(a,b){var d=a.getDojoShape().getTransformedBoundingBox(),c=a.symbol.font;return{"font-family":c.family,
"font-size":c.size+"px","font-style":c.style,"font-variant":c.variant,"font-weight":c.weight,left:d[0].x+"px",top:d[0].y+"px",width:Math.abs(d[0].x-d[1].x)/Math.cos(a.symbol.angle/180*Math.PI)+"px"}},_applyEdit:function(){if(this._editBox)if(this._editBox.value){this._graphic.show();var a=this._graphic.symbol;a.text=this._editBox.value;this._graphic.setSymbol(a)}else this._graphic.getLayer().remove(this._graphic)}});f("extend-esri")&&m.setObject("toolbars.TextEditor",q,b);return q})},"esri/dijit/AttributeInspector":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/sniff dojo/_base/kernel dojo/has dojo/dom-style dojo/dom-construct ../kernel ../lang ../domUtils ../layers/InheritedDomain ../layers/FeatureLayer dojo/i18n!../nls/jsapi dojo/fx dojox/gfx dijit/_Widget dijit/_Templated dijit/Editor dijit/_editor/plugins/LinkDialog dijit/_editor/plugins/TextColor ./_EventedWidget ./editing/AttachmentEditor ./editing/Util ../tasks/query dijit/form/DateTextBox dijit/form/TextBox dijit/form/NumberTextBox dijit/form/FilteringSelect dijit/form/NumberSpinner dijit/form/Button dijit/form/SimpleTextarea dijit/form/ValidationTextBox dijit/form/TimeTextBox dijit/Tooltip dojo/data/ItemFileReadStore dojox/date/islamic dojox/date/islamic/Date dojox/date/islamic/locale dojo/text!./templates/AttributeInspector.html".split(" "),
function(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A,y,B,x,w,z,E,C,D,F,G,I,N,M,P,U,V,W,T,K,J,O,S){var L=q([w,r,A],{declaredClass:"esri.dijit.AttributeInspector",widgetsInTemplate:!0,templateString:S,onUpdate:function(){},onDelete:function(){},onAttributeChange:function(){},onNext:function(){},onReset:function(){},onCancel:function(){},_navMessage:"( ${idx} ${of} ${numFeatures} )",_currentAttributeFieldName:null,_aiConnects:[],_selection:[],_toolTips:[],_numFeatures:0,_featureIdx:0,_currentLInfo:null,_currentFeature:null,
_rollbackInfo:null,_eventMap:{update:!0,"delete":["feature"],"attribute-change":["feature","fieldName","fieldValue"],next:["feature"],reset:!0,cancel:!0},_defaultRichTextPlugins:"bold italic underline foreColor hiliteColor | justifyLeft justifyCenter justifyRight justifyFull | insertOrderedList insertUnorderedList indent outdent | createLink".split(" "),css:{label:"atiLabel",field:"atiField",textArea:"atiTextAreaField",richText:"atiRichTextField",attachmentEditor:"atiAttachmentEditor",red:"atiRequiredField"},
constructor:function(a,b){m.mixin(this,g.widgets.attributeInspector);a=a||{};a.featureLayer||a.layerInfos||console.error("esri.AttributeInspector: please provide correct parameter in the constructor");this._datePackage=this._getDatePackage(a);this._layerInfos=a.layerInfos||[{featureLayer:a.featureLayer,options:a.options||[]}];this._layerInfos=n.filter(this._layerInfos,function(a){return!a.disableAttributeUpdate});this._hideNavButtons=a.hideNavButtons||!1},postCreate:function(){if(n.every(this._layerInfos,
function(a){return a.featureLayer.loaded}))this._initLayerInfos(),this._createAttachmentEditor(),this.onFirstFeature();else{var a=this._layerInfos.length;n.forEach(this._layerInfos,function(b){b=b.featureLayer;if(b.loaded)a--;else var d=l.connect(b,"onLoad",this,function(b){l.disconnect(d);d=null;a--;a||(this._initLayerInfos(),this._createAttachmentEditor(),this.onFirstFeature())})},this)}},destroy:function(){this._destroyAttributeTable();n.forEach(this._aiConnects,l.disconnect);delete this._aiConnects;
this._attachmentEditor&&(this._attachmentEditor.destroy(),delete this._attachmentEditor);delete this._layerInfos;this._selection=this._currentFeature=this._currentLInfo=this._attributes=this._layerInfos=null;this.inherited(arguments)},refresh:function(){this._updateSelection()},first:function(){this.onFirstFeature()},last:function(){this.onLastFeature()},next:function(){this.onNextFeature()},previous:function(){this.onPreviousFeature()},showFeature:function(a,b){b&&(this._createOnlyFirstTime=!0);
this._updateSelection([a],b);this._updateUI()},onLayerSelectionChange:function(a,b,d){this._createOnlyFirstTime=!1;this._featureIdx=d===v.SELECTION_NEW?0:this._featureIdx;this._updateSelection();this._updateUI()},onLayerSelectionClear:function(){!this._selection||0>=this._selection.length||(this._featureIdx=this._numFeatures=0,this._selection=[],this._currentLInfo=this._currentFeature=null,this._updateUI())},onLayerUpdateEnd:function(a,b,d,c){},onLayerError:function(a,b,d,c){},onLayerEditsError:function(a,
b,d,c){},onLayerEditsComplete:function(a,b,d,c){c=c||[];if(c.length){var e=this._selection,g=a.featureLayer.objectIdField;n.forEach(c,m.hitch(this,function(a){n.some(e,m.hitch(this,function(b,d){if(b.attributes[g]!==a.objectId)return!1;this._selection.splice(d,1);return!0}))}))}b=b||[];b.length&&(this._selection=E.findFeatures(b,a.featureLayer),this._featureIdx=0);c=this._numFeatures=(this._selection=E.sortFeaturesById(this._layerInfos,this._selection))?this._selection.length:0;if(b.length){if(b=
c?this._selection[this._featureIdx]:null)c=b.getLayer().getEditCapabilities(),c.canCreate&&!c.canUpdate||this._showFeature(b);this._updateUI()}d=d||[];if(d.length){var f=this._rollbackInfo;n.forEach(d,function(b){var c=E.findFeatures(d,a.featureLayer)[0];if(!b.success&&c.attributes[a.featureLayer.objectIdField]===b.objectId&&f){var e=f.field;b=f.graphic.attributes[e.name];var g=n.filter(this._currentLInfo.fieldInfos,function(a){return a.fieldName===e.name},this)[0].dijit;c.attributes[e.name]=b;"esriFieldTypeDate"===
e.type&&(b=new Date(b));this._setValue(g,b)}},this)}this._rollbackInfo=null},onFieldValueChange:function(a,b){var d=a.field,c=a.dijit,e=this._currentFeature,g=this._currentLInfo,f=d.name,h;if(""===c.displayedValue||"dijit.form.ValidationTextBox"!==c.declaredClass||c.isValid())if(""!==c.displayedValue&&c.displayedValue!==b&&c.isValid&&!c.isValid())this._setValue(c,e.attributes[d.name]);else{if(h=!("esriFieldTypeInteger"!==d.type&&"esriFieldTypeSmallInteger"!==d.type&&"esriFieldTypeSingle"!==d.type&&
"esriFieldTypeDouble"!==d.type),b=""===b&&h||"undefined"===typeof b?null:b,h&&null!==b&&(b=Number(b)),"esriFieldTypeDate"===d.type&&(c instanceof Array?(h=c[0].getValue(),c=c[1].getValue(),b=h&&c?new Date(h.getFullYear(),h.getMonth(),h.getDate(),c.getHours(),c.getMinutes(),c.getSeconds(),c.getMilliseconds()):h||c||null):(b=c.getValue(),d.domain&&(b=Number(b))),b=b&&b.getTime?b.getTime():b&&b.toGregorian?b.toGregorian().getTime():b),this._currentFeature.attributes[d.name]!==b){if(f===g.typeIdField){var k=
this._findFirst(g.types,"id",b);n.forEach(g.fieldInfos,function(a){(d=a.field)&&d.name!==g.typeIdField&&(a=a.dijit,this._setFieldDomain(a,k,d)&&a&&(this._setValue(a,e.attributes[d.name]+""),!1===a.isValid()&&this._setValue(a,null)))},this)}this.onAttributeChange(e,f,b)}}else this._setValue(c,e.attributes[d.name])},onDeleteBtn:function(a){this._deleteFeature()},onNextFeature:function(a){this._onNextFeature(1)},onPreviousFeature:function(a){this._onNextFeature(-1)},onFirstFeature:function(a){this._onNextFeature(-1*
this._featureIdx)},onLastFeature:function(a){this._onNextFeature(this._numFeatures-1-this._featureIdx)},_initLayerInfos:function(){var a=this._layerInfos;this._editorTrackingInfos={};n.forEach(a,this._initLayerInfo,this)},_initLayerInfo:function(b){var d=b.featureLayer,c,e;this._userIds={};e=d.id;d.credential&&(this._userIds[e]=d.credential.userId);b.userId&&(this._userIds[e]=b.userId);this._connect(d,"onSelectionComplete",m.hitch(this,"onLayerSelectionChange",b));this._connect(d,"onSelectionClear",
m.hitch(this,"onLayerSelectionClear",b));this._connect(d,"onEditsComplete",m.hitch(this,"onLayerEditsComplete",b));this._connect(d,"error",m.hitch(this,"onLayerError",b));this._connect(d,"onUpdateEnd",m.hitch(this,"onLayerUpdateEnd",b));b.showAttachments=d.hasAttachments?a.isDefined(b.showAttachments)?b.showAttachments:!0:!1;b.hideFields=b.hideFields||[];b.htmlFields=b.htmlFields||[];b.isEditable=d.isEditable()?a.isDefined(b.isEditable)?b.isEditable:!0:!1;b.typeIdField=d.typeIdField;b.layerId=d.id;
b.types=d.types;d.globalIdField&&((c=this._findFirst(b.fieldInfos,"fieldName",d.globalIdField))||b.showGlobalID||b.hideFields.push(d.globalIdField));(e=this._findFirst(b.fieldInfos,"fieldName",d.objectIdField))||b.showObjectID||b.hideFields.push(d.objectIdField);var g=this._getFields(b.featureLayer);if(g){var f=b.fieldInfos||[],f=n.map(f,function(a){return m.mixin({},a)});f.length?b.fieldInfos=n.filter(n.map(f,m.hitch(this,function(a){var d=a.stringFieldOption||(this._isInFields(a.fieldName,b.htmlFields)?
L.STRING_FIELD_OPTION_RICHTEXT:L.STRING_FIELD_OPTION_TEXTBOX);return m.mixin(a,{field:this._findFirst(g,"name",a.fieldName),stringFieldOption:d})})),"return item.field;"):(g=n.filter(g,m.hitch(this,function(a){return!this._isInFields(a.name,b.hideFields)})),b.fieldInfos=n.map(g,m.hitch(this,function(a){var d=this._isInFields(a.name,b.htmlFields)?L.STRING_FIELD_OPTION_RICHTEXT:L.STRING_FIELD_OPTION_TEXTBOX;return{fieldName:a.name,field:a,stringFieldOption:d}})));b.showGlobalID&&!c&&f.push(this._findFirst(g,
"name",d.globalIdField));b.showObjectID&&!e&&f.push(this._findFirst(g,"name",d.objectIdField));c=[];d.editFieldsInfo&&(d.editFieldsInfo.creatorField&&c.push(d.editFieldsInfo.creatorField),d.editFieldsInfo.creationDateField&&c.push(d.editFieldsInfo.creationDateField),d.editFieldsInfo.editorField&&c.push(d.editFieldsInfo.editorField),d.editFieldsInfo.editDateField&&c.push(d.editFieldsInfo.editDateField));this._editorTrackingInfos[d.id]=c}},_createAttachmentEditor:function(){this._attachmentEditor=null;
var a=n.filter(this._layerInfos,function(a){return a.showAttachments});a&&a.length&&(this._attachmentEditor=new z({"class":this.css.attachmentEditor},this.attachmentEditor),this._attachmentEditor.startup())},_setCurrentLInfo:function(a){var b=this._currentLInfo?this._currentLInfo.featureLayer:null,d=a.featureLayer;if(b&&b.id===d.id&&!b.ownershipBasedAccessControlForFeatures&&(b=d.getEditCapabilities(),!b.canCreate||b.canUpdate))return;this._currentLInfo=a;this._createTable()},_updateSelection:function(a,
b){this._selection=a||[];n.forEach(this._layerInfos,this._getSelection,this);this._selection=E.sortFeaturesById(this._layerInfos,this._selection);this._numFeatures=this._selection.length;this._showFeature(this._numFeatures?this._selection[this._featureIdx]:null,b)},_getSelection:function(a){a=a.featureLayer.getSelectedFeatures();this._selection=this._selection.concat(a)},_updateUI:function(){var b=this._numFeatures,d=this._currentLInfo;this.layerName.innerHTML=d&&0!==b?d.featureLayer?d.featureLayer.name:
"":this.NLS_noFeaturesSelected;c.set(this.attributeTable,"display",b?"":"none");c.set(this.editButtons,"display",b?"":"none");c.set(this.navButtons,"display",!this._hideNavButtons&&1<b?"":"none");this.navMessage.innerHTML=a.substitute({idx:this._featureIdx+1,of:this.NLS_of,numFeatures:this._numFeatures},this._navMessage);this._attachmentEditor&&c.set(this._attachmentEditor.domNode,"display",d&&d.showAttachments&&b?"":"none");c.set(this.deleteBtn.domNode,"display",d&&!1===d.showDeleteButton||!this._canDelete?
"none":"");this.domNode.parentNode&&0<this.domNode.parentNode.scrollTop&&(this.domNode.parentNode.scrollTop=0)},_onNextFeature:function(a){this._featureIdx+=a;0>this._featureIdx?this._featureIdx=this._numFeatures-1:this._featureIdx>=this._numFeatures&&(this._featureIdx=0);a=this._selection.length?this._selection[this._featureIdx]:null;this._showFeature(a);this._updateUI();this.onNext(a)},_deleteFeature:function(){this.onDelete(this._currentFeature)},_showFeature:function(b,c){if(b){this._currentFeature=
b;var e=c?c:b.getLayer(),g=e.getEditCapabilities({feature:b,userId:this._userIds[e.id]});this._canUpdate=g.canUpdate;this._canDelete=g.canDelete;if(g=this._getLInfoFromFeatureLayer(e)){this._setCurrentLInfo(g);var f=b.attributes,h=this._findFirst(g.types,"id",f[g.typeIdField]),k=null;n.forEach(g.fieldInfos,function(b){k=b.field;var d=[];b.dijit&&1<b.dijit.length?n.forEach(b.dijit,function(a){d.push(a)}):d.push(b.dijit);n.forEach(d,m.hitch(this,function(b){if(b){var d=this._setFieldDomain(b,h,k),c=
f[k.name],c=c&&d&&d.codedValues&&d.codedValues.length?d.codedValues[c]?d.codedValues[c].name:c:c;a.isDefined(c)||(c="");"dijit.form.DateTextBox"===b.declaredClass||"dijit.form.TimeTextBox"===b.declaredClass?c=""===c?null:new Date(c):"dijit.form.FilteringSelect"===b.declaredClass&&(b._lastValueReported=null,c=f[k.name]+"");try{this._setValue(b,c),"dijit.form.FilteringSelect"===b.declaredClass&&!1===b.isValid()&&this._setValue(b,null)}catch(H){b.set("displayedValue",this.NLS_errorInvalid,!1)}}}))},
this);this._attachmentEditor&&g.showAttachments&&this._attachmentEditor.showAttachments(this._currentFeature,e);(e=e.getEditSummary(b))?(this.editorTrackingInfoDiv.innerHTML=e,d.show(this.editorTrackingInfoDiv)):d.hide(this.editorTrackingInfoDiv)}}},_setFieldDomain:function(b,d,c){if(!b)return null;var e=c.domain;d&&d.domains&&d.domains[c.name]&&!1===d.domains[c.name]instanceof t&&(e=d.domains[c.name]);if(!e)return null;e.codedValues&&0<e.codedValues.length?(b.set("store",this._toStore(n.map(e.codedValues,
function(a){return{id:a.code+="",name:a.name}}))),this._setValue(b,e.codedValues[0].code)):(b.constraints={min:a.isDefined(e.minValue)?e.minValue:Number.MIN_VALUE,max:a.isDefined(e.maxValue)?e.maxValue:Number.MAX_VALUE},this._setValue(b,b.constraints.min));return e},_setValue:function(a,b){a.set&&(a._onChangeActive=!1,a.set("value",b,!0),a._onChangeActive=!0)},_getFields:function(b){var d=b._getOutFields();if(!d)return null;b=b.fields;return"*"==d?b:n.filter(n.map(d,m.hitch(this,"_findFirst",b,"name")),
a.isDefined)},_isInFields:function(a,b){return a&&(b||b.length)?n.some(b,function(b){return b.toLowerCase()===a.toLowerCase()}):!1},_isFieldNullable:function(a,b){return!(!1===a.nullable||b.field&&!1===b.field.nullable)},_isFieldRequired:function(a,b){return!1!==a.editable&&!1!==b.isEditable&&!this._isFieldNullable(a,b)},_findFirst:function(a,b,d){return(a=n.filter(a,function(a){return a.hasOwnProperty(b)&&a[b]===d}))&&a.length?a[0]:null},_getLInfoFromFeatureLayer:function(a){return this._findFirst(this._layerInfos,
"layerId",a?a.id:null)},_createTable:function(){this._destroyAttributeTable();this.attributeTable.innerHTML="";this._attributes=h.create("table",{cellspacing:"0",cellpadding:"0"},this.attributeTable);var a=h.create("tbody",null,this._attributes),b=this._currentLInfo,d=this._findFirst(b.types,"id",this._currentFeature.attributes[b.typeIdField]);n.forEach(b.fieldInfos,m.hitch(this,"_createField",d,a),this);this._createOnlyFirstTime=!1},_createField:function(a,b,d){var c=this._currentLInfo,e=d.field;
if(!this._isInFields(e.name,c.hideFields)&&!this._isInFields(e.name,this._editorTrackingInfos[c.featureLayer.id])){var g=!1,f,k,p;b=h.create("tr",null,b);f=h.create("td",{innerHTML:d.label||e.alias||e.name,"class":this.css.label,"data-fieldname":e.name},b);this._isFieldRequired(e,d)&&h.create("span",{"class":this.css.red,innerHTML:" *"},f);b=h.create("td",null,b);if(d.customField)h.place(d.customField.domNode||d.customField,h.create("div",null,b),"first"),k=d.customField;else if(!1===c.isEditable||
!1===e.editable||!1===d.isEditable||"esriFieldTypeOID"===e.type||"esriFieldTypeGlobalID"===e.type||!this._canUpdate&&!this._createOnlyFirstTime)g=!0;c=c.typeIdField&&e.name.toLowerCase()==c.typeIdField.toLowerCase();f=!!this._getDomainForField(e,a);!k&&c?k=this._createTypeField(e,d,b):!k&&f&&(k=this._createDomainField(e,d,a,b));if(!k)switch(e.type){case "esriFieldTypeString":k=this._createStringField(e,d,b);break;case "esriFieldTypeDate":k=this._createDateField(e,d,b);d.format&&d.format.time&&(p=
this._createTimeField(e,d,b));break;case "esriFieldTypeInteger":case "esriFieldTypeSmallInteger":k=this._createIntField(e,d,b);break;case "esriFieldTypeSingle":case "esriFieldTypeDouble":k=this._createFltField(e,d,b);break;default:k=this._createStringField(e,d,b)}d.tooltip&&d.tooltip.length&&this._toolTips.push(new W({connectId:[k.id],label:d.tooltip}));k.onChange=m.hitch(this,"onFieldValueChange",d);k.set("disabled",g);p?(d.dijit=[k,p],p.onChange=m.hitch(this,"onFieldValueChange",d),p.set("disabled",
g)):d.dijit=k}},_createTypeField:function(a,b,d){d=h.create("div",null,d);var c=a.domain;return c&&"range"===c.type&&c.minValue===c.maxValue?new U({"class":this.css.field,trim:!0,maxLength:a.length,name:a.alias||a.name,required:this._isFieldRequired(a,b)},d):new I({"class":this.css.field,name:a.alias||a.name,required:this._isFieldRequired(a,b),store:this._toStore(n.map(this._currentLInfo.types,function(a){return{id:a.id,name:a.name}})),searchAttr:"name"},d)},_getDomainForField:function(a,b){var d=
a.domain,c=a.name;c&&b&&b.domains&&b.domains[c]&&!1===b.domains[c]instanceof t&&(d=b.domains[c]);return d||null},_createDomainField:function(a,b,d,c){d=this._getDomainForField(a,d);c=h.create("div",null,c);return d.codedValues?new I({"class":this.css.field,name:a.alias||a.name,searchAttr:"name",required:this._isFieldRequired(a,b)},c):new N({"class":this.css.field},c)},_createStringField:function(a,b,d){d=h.create("div",null,d);var c={trim:!0,maxLength:a.length,required:this._isFieldRequired(a,b)};
if(b.stringFieldOption===L.STRING_FIELD_OPTION_TEXTAREA)return c["class"]=this.css.field+" "+this.css.textArea,new P(c,d);if(b.stringFieldOption===L.STRING_FIELD_OPTION_RICHTEXT)return c["class"]=this.css.field+" "+this.css.richText,c.height="100%",c.width="100%",c.plugins=b.richTextPlugins||this._defaultRichTextPlugins,d=new y(c,d),d.startup(),d;var e=this;c.validator=function(d,c){this._maskValidSubsetError=!1;this._hasBeenBlurred=!0;return e._isFieldNullable(a,b)||!(""===d||null===d)};return new U(c,
d)},_createTimeField:function(a,b,d){d=h.create("div",null,d);a={"class":this.css.field,trim:!0,required:this._isFieldRequired(a,b),constraints:{formatLength:"medium"}};this._datePackage&&(a.datePackage=this._datePackage);return new V(a,d)},_createDateField:function(a,b,d){d=h.create("div",null,d);a={"class":this.css.field,trim:!0,required:this._isFieldRequired(a,b)};this._datePackage&&(a.datePackage=this._datePackage);return new D(a,d)},_createIntField:function(a,b,d){d=h.create("div",null,d);return new G({"class":this.css.field,
constraints:"esriFieldTypeSmallInteger"===a.type?{min:-32768,max:32767,places:0}:{places:0},trim:!0,invalidMessage:this.NLS_validationInt,required:this._isFieldRequired(a,b)},d)},_createFltField:function(a,b,d){d=h.create("div",null,d);return new G({"class":this.css.field,constraints:{max:Infinity,min:-Infinity,places:"0,20"},trim:!0,invalidMessage:this.NLS_validationFlt,required:this._isFieldRequired(a,b)},d)},_toStore:function(a){return new T({data:{identifier:"id",label:"name",items:a}})},_connect:function(a,
b,d){this._aiConnects.push(l.connect(a,b,d))},_getDatePackage:function(a){return null===a.datePackage?null:a.datePackage?a.datePackage:"ar"===e.locale?"dojox.date.islamic":null},_destroyAttributeTable:function(){n.forEach(this._layerInfos,function(a){n.forEach(a.fieldInfos,function(a){var b=a.dijit;if(b){b._onChangeHandle=null;if(a.customField)return;b instanceof Array?n.forEach(b,m.hitch(this,function(a){a.destroyRecursive?a.destroyRecursive():a.destroy&&a.destroy();a._onChangeHandle=null})):b.destroyRecursive?
b.destroyRecursive():b.destroy&&b.destroy()}a.dijit=null},this)},this);n.forEach(this._toolTips,function(a){a.destroy()});this._toolTips=[];this._attributes&&h.destroy(this._attributes)}});m.mixin(L,{STRING_FIELD_OPTION_RICHTEXT:"richtext",STRING_FIELD_OPTION_TEXTAREA:"textarea",STRING_FIELD_OPTION_TEXTBOX:"textbox"});k("extend-esri")&&m.setObject("dijit.AttributeInspector",L,b);return L})},"dijit/Editor":function(){define("require dojo/_base/array dojo/_base/declare dojo/Deferred dojo/i18n dojo/dom-attr dojo/dom-class dojo/dom-geometry dojo/dom-style dojo/keys dojo/_base/lang dojo/sniff dojo/string dojo/topic ./_Container ./Toolbar ./ToolbarSeparator ./layout/_LayoutWidget ./form/ToggleButton ./_editor/_Plugin ./_editor/plugins/EnterKeyHandling ./_editor/html ./_editor/range ./_editor/RichText ./main dojo/i18n!./_editor/nls/commands".split(" "),
function(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A,y,B,x,w,z,E){function C(a){return new y({command:a.name})}function D(a){return new y({buttonClass:A,command:a.name})}n=n("dijit.Editor",z,{plugins:null,extraPlugins:null,constructor:function(){a.isArray(this.plugins)||(this.plugins=["undo","redo","|","cut","copy","paste","|","bold","italic","underline","strikethrough","|","insertOrderedList","insertUnorderedList","indent","outdent","|","justifyLeft","justifyRight","justifyCenter","justifyFull",B]);this._plugins=
[];this._editInterval=1E3*this.editActionInterval;if(d("ie")||d("trident")||d("edge"))this.events.push("onBeforeDeactivate"),this.events.push("onBeforeActivate")},postMixInProperties:function(){this.setValueDeferred=new l;this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this._steps=this._steps.slice(0);this._undoedSteps=this._undoedSteps.slice(0);a.isArray(this.extraPlugins)&&(this.plugins=this.plugins.concat(this.extraPlugins));this.commands=f.getLocalization("dijit._editor",
"commands",this.lang);d("webkit")&&h.set(this.domNode,"KhtmlUserSelect","none")},startup:function(){this.inherited(arguments);this.toolbar||(this.toolbar=new u({ownerDocument:this.ownerDocument,dir:this.dir,lang:this.lang,"aria-label":this.id}),this.header.appendChild(this.toolbar.domNode));m.forEach(this.plugins,this.addPlugin,this);this.setValueDeferred.resolve(!0);k.add(this.iframe.parentNode,"dijitEditorIFrameContainer");k.add(this.iframe,"dijitEditorIFrame");e.set(this.iframe,"allowTransparency",
!0);this.toolbar.startup();this.onNormalizedDisplayChanged()},destroy:function(){m.forEach(this._plugins,function(a){a&&a.destroy&&a.destroy()});this._plugins=[];this.toolbar.destroyRecursive();delete this.toolbar;this.inherited(arguments)},addPlugin:function(b,d){var c=a.isString(b)?{name:b}:a.isFunction(b)?{ctor:b}:b;if(!c.setEditor){var e={args:c,plugin:null,editor:this};c.name&&(y.registry[c.name]?e.plugin=y.registry[c.name](c):v.publish(E._scopeName+".Editor.getPlugin",e));if(!e.plugin)try{var g=
c.ctor||a.getObject(c.name)||q(c.name);g&&(e.plugin=new g(c))}catch(P){throw Error(this.id+": cannot find plugin ["+c.name+"]");}if(!e.plugin)throw Error(this.id+": cannot find plugin ["+c.name+"]");b=e.plugin}1<arguments.length?this._plugins[d]=b:this._plugins.push(b);b.setEditor(this);a.isFunction(b.setToolbar)&&b.setToolbar(this.toolbar)},resize:function(a){a&&r.prototype.resize.apply(this,arguments)},layout:function(){var a=this._contentBox.h-(this.getHeaderHeight()+this.getFooterHeight()+c.getPadBorderExtents(this.iframe.parentNode).h+
c.getMarginExtents(this.iframe.parentNode).h);this.editingArea.style.height=a+"px";this.iframe&&(this.iframe.style.height="100%");this._layoutMode=!0},_onIEMouseDown:function(a){var b,d=this.document.body,c=d.clientWidth,e=d.clientHeight,g=d.clientLeft,f=d.offsetWidth,h=d.offsetHeight,k=d.offsetLeft;/^rtl$/i.test(d.dir||"")?c<f&&a.x>c&&a.x<f&&(b=!0):a.x<g&&a.x>k&&(b=!0);b||e<h&&a.y>e&&a.y<h&&(b=!0);b||(delete this._cursorToStart,delete this._savedSelection,"BODY"==a.target.tagName&&this.defer("placeCursorAtEnd"),
this.inherited(arguments))},onBeforeActivate:function(){this._restoreSelection()},onBeforeDeactivate:function(a){this.customUndo&&this.endEditing(!0);"BODY"!=a.target.tagName&&this._saveSelection()},customUndo:!0,editActionInterval:3,beginEditing:function(a){this._inEditing||(this._inEditing=!0,this._beginEditing(a));0<this.editActionInterval&&(this._editTimer&&this._editTimer.remove(),this._editTimer=this.defer("endEditing",this._editInterval))},_steps:[],_undoedSteps:[],execCommand:function(a){if(!this.customUndo||
"undo"!=a&&"redo"!=a){this.customUndo&&(this.endEditing(),this._beginEditing());var b=this.inherited(arguments);this.customUndo&&this._endEditing();return b}return this[a]()},_pasteImpl:function(){return this._clipboardCommand("paste")},_cutImpl:function(){return this._clipboardCommand("cut")},_copyImpl:function(){return this._clipboardCommand("copy")},_clipboardCommand:function(a){var b;try{if(b=this.document.execCommand(a,!1,null),d("webkit")&&!b)throw{};}catch(I){b=t.substitute,alert(b(this.commands.systemShortcut,
[this.commands[a],b(this.commands[d("mac")?"appleKey":"ctrlKey"],[{cut:"X",copy:"C",paste:"V"}[a]])])),b=!1}return b},queryCommandEnabled:function(a){return!this.customUndo||"undo"!=a&&"redo"!=a?this.inherited(arguments):"undo"==a?1<this._steps.length:0<this._undoedSteps.length},_moveToBookmark:function(b){var c=b.mark,e=b.mark;b=b.isCollapsed;var g,f,h;e&&(9>d("ie")||9===d("ie")&&d("quirks")?a.isArray(e)?(c=[],m.forEach(e,function(a){c.push(w.getNode(a,this.editNode))},this),this.selection.moveToBookmark({mark:c,
isCollapsed:b})):e.startContainer&&e.endContainer&&(h=w.getSelection(this.window))&&h.removeAllRanges&&(h.removeAllRanges(),b=w.create(this.window),g=w.getNode(e.startContainer,this.editNode),f=w.getNode(e.endContainer,this.editNode),g&&f&&(b.setStart(g,e.startOffset),b.setEnd(f,e.endOffset),h.addRange(b))):(h=w.getSelection(this.window))&&h.removeAllRanges&&(h.removeAllRanges(),b=w.create(this.window),g=w.getNode(e.startContainer,this.editNode),f=w.getNode(e.endContainer,this.editNode),g&&f&&(b.setStart(g,
e.startOffset),b.setEnd(f,e.endOffset),h.addRange(b))))},_changeToStep:function(a,b){this.setValue(b.text);var d=b.bookmark;d&&this._moveToBookmark(d)},undo:function(){var a=!1;if(!this._undoRedoActive){this._undoRedoActive=!0;this.endEditing(!0);var b=this._steps.pop();b&&0<this._steps.length&&(this.focus(),this._changeToStep(b,this._steps[this._steps.length-1]),this._undoedSteps.push(b),this.onDisplayChanged(),delete this._undoRedoActive,a=!0);delete this._undoRedoActive}return a},redo:function(){var a=
!1;if(!this._undoRedoActive){this._undoRedoActive=!0;this.endEditing(!0);var b=this._undoedSteps.pop();b&&0<this._steps.length&&(this.focus(),this._changeToStep(this._steps[this._steps.length-1],b),this._steps.push(b),this.onDisplayChanged(),a=!0);delete this._undoRedoActive}return a},endEditing:function(a){this._editTimer&&(this._editTimer=this._editTimer.remove());this._inEditing&&(this._endEditing(a),this._inEditing=!1)},_getBookmark:function(){var b=this.selection.getBookmark(),c=[];if(b&&b.mark){var e=
b.mark;if(9>d("ie")||9===d("ie")&&d("quirks")){var g=w.getSelection(this.window);if(a.isArray(e))m.forEach(b.mark,function(a){c.push(w.getIndex(a,this.editNode).o)},this),b.mark=c;else if(g){var f;g.rangeCount&&(f=g.getRangeAt(0));b.mark=f?f.cloneRange():this.selection.getBookmark()}}try{b.mark&&b.mark.startContainer&&(c=w.getIndex(b.mark.startContainer,this.editNode).o,b.mark={startContainer:c,startOffset:b.mark.startOffset,endContainer:b.mark.endContainer===b.mark.startContainer?c:w.getIndex(b.mark.endContainer,
this.editNode).o,endOffset:b.mark.endOffset})}catch(P){b.mark=null}}return b},_beginEditing:function(){0===this._steps.length&&this._steps.push({text:x.getChildrenHtml(this.editNode),bookmark:this._getBookmark()})},_endEditing:function(){var a=x.getChildrenHtml(this.editNode);this._undoedSteps=[];this._steps.push({text:a,bookmark:this._getBookmark()})},onKeyDown:function(a){d("ie")||this.iframe||a.keyCode!=b.TAB||this.tabIndent||this._saveSelection();if(this.customUndo){var c=a.keyCode;if(a.ctrlKey&&
!a.shiftKey&&!a.altKey){if(90==c||122==c){a.stopPropagation();a.preventDefault();this.undo();return}if(89==c||121==c){a.stopPropagation();a.preventDefault();this.redo();return}}this.inherited(arguments);switch(c){case b.ENTER:case b.BACKSPACE:case b.DELETE:this.beginEditing();break;case 88:case 86:if(a.ctrlKey&&!a.altKey&&!a.metaKey){this.endEditing();88==a.keyCode?this.beginEditing("cut"):this.beginEditing("paste");this.defer("endEditing",1);break}default:if(!a.ctrlKey&&!a.altKey&&!a.metaKey&&(a.keyCode<
b.F1||a.keyCode>b.F15)){this.beginEditing();break}case b.ALT:this.endEditing();break;case b.UP_ARROW:case b.DOWN_ARROW:case b.LEFT_ARROW:case b.RIGHT_ARROW:case b.HOME:case b.END:case b.PAGE_UP:case b.PAGE_DOWN:this.endEditing(!0);case b.CTRL:case b.SHIFT:case b.TAB:}}else this.inherited(arguments)},_onBlur:function(){this.inherited(arguments);this.endEditing(!0)},_saveSelection:function(){try{this._savedSelection=this._getBookmark()}catch(F){}},_restoreSelection:function(){this._savedSelection&&
(delete this._cursorToStart,this.selection.isCollapsed()&&this._moveToBookmark(this._savedSelection),delete this._savedSelection)},onClick:function(){this.endEditing(!0);this.inherited(arguments)},replaceValue:function(a){this.customUndo?this.isClosed?this.setValue(a):(this.beginEditing(),a||(a="\x26#160;"),this.setValue(a),this.endEditing()):this.inherited(arguments)},_setDisabledAttr:function(b){this.setValueDeferred.then(a.hitch(this,function(){!this.disabled&&b||!this._buttonEnabledPlugins&&b?
m.forEach(this._plugins,function(a){a.set("disabled",!0)}):this.disabled&&!b&&m.forEach(this._plugins,function(a){a.set("disabled",!1)})}));this.inherited(arguments)},_setStateClass:function(){try{this.inherited(arguments),this.document&&this.document.body&&h.set(this.document.body,"color",h.get(this.iframe,"color"))}catch(F){}}});a.mixin(y.registry,{undo:C,redo:C,cut:C,copy:C,paste:C,insertOrderedList:C,insertUnorderedList:C,indent:C,outdent:C,justifyCenter:C,justifyFull:C,justifyLeft:C,justifyRight:C,
"delete":C,selectAll:C,removeFormat:C,unlink:C,insertHorizontalRule:C,bold:D,italic:D,underline:D,strikethrough:D,subscript:D,superscript:D,"|":function(){return new y({setEditor:function(a){this.editor=a;this.button=new p({ownerDocument:a.ownerDocument})}})}});return n})},"dijit/Toolbar":function(){define("require dojo/_base/declare dojo/has dojo/keys dojo/ready ./_Widget ./_KeyNavContainer ./_TemplatedMixin".split(" "),function(q,m,n,l,f,e,k,c){n("dijit-legacy-requires")&&f(0,function(){q(["dijit/ToolbarSeparator"])});
return m("dijit.Toolbar",[e,c,k],{templateString:'\x3cdiv class\x3d"dijit" role\x3d"toolbar" tabIndex\x3d"${tabIndex}" data-dojo-attach-point\x3d"containerNode"\x3e\x3c/div\x3e',baseClass:"dijitToolbar",_onLeftArrow:function(){this.focusPrev()},_onRightArrow:function(){this.focusNext()}})})},"dijit/ToolbarSeparator":function(){define(["dojo/_base/declare","dojo/dom","./_Widget","./_TemplatedMixin"],function(q,m,n,l){return q("dijit.ToolbarSeparator",[n,l],{templateString:'\x3cdiv class\x3d"dijitToolbarSeparator dijitInline" role\x3d"presentation"\x3e\x3c/div\x3e',
buildRendering:function(){this.inherited(arguments);m.setSelectable(this.domNode,!1)},isFocusable:function(){return!1}})})},"dijit/layout/_LayoutWidget":function(){define("dojo/_base/lang ../_Widget ../_Container ../_Contained ../Viewport dojo/_base/declare dojo/dom-class dojo/dom-geometry dojo/dom-style".split(" "),function(q,m,n,l,f,e,k,c,h){return e("dijit.layout._LayoutWidget",[m,n,l],{baseClass:"dijitLayoutContainer",isLayoutContainer:!0,_setTitleAttr:null,buildRendering:function(){this.inherited(arguments);
k.add(this.domNode,"dijitContainer")},startup:function(){if(!this._started){this.inherited(arguments);var b=this.getParent&&this.getParent();b&&b.isLayoutContainer||(this.resize(),this.own(f.on("resize",q.hitch(this,"resize"))))}},resize:function(b,a){var d=this.domNode;b&&c.setMarginBox(d,b);var e=a||{};q.mixin(e,b||{});"h"in e&&"w"in e||(e=q.mixin(c.getMarginBox(d),e));var f=h.getComputedStyle(d),g=c.getMarginExtents(d,f),k=c.getBorderExtents(d,f),e=this._borderBox={w:e.w-(g.w+k.w),h:e.h-(g.h+k.h)},
g=c.getPadExtents(d,f);this._contentBox={l:h.toPixelValue(d,f.paddingLeft),t:h.toPixelValue(d,f.paddingTop),w:e.w-g.w,h:e.h-g.h};this.layout()},layout:function(){},_setupChild:function(b){k.add(b.domNode,this.baseClass+"-child "+(b.baseClass?this.baseClass+"-"+b.baseClass:""))},addChild:function(b,a){this.inherited(arguments);this._started&&this._setupChild(b)},removeChild:function(b){k.remove(b.domNode,this.baseClass+"-child"+(b.baseClass?" "+this.baseClass+"-"+b.baseClass:""));this.inherited(arguments)}})})},
"dijit/form/ToggleButton":function(){define(["dojo/_base/declare","dojo/_base/kernel","./Button","./_ToggleButtonMixin"],function(q,m,n,l){return q("dijit.form.ToggleButton",[n,l],{baseClass:"dijitToggleButton",setChecked:function(f){m.deprecated("setChecked("+f+") is deprecated. Use set('checked',"+f+") instead.","","2.0");this.set("checked",f)}})})},"dijit/form/Button":function(){define("require dojo/_base/declare dojo/dom-class dojo/has dojo/_base/kernel dojo/_base/lang dojo/ready ./_FormWidget ./_ButtonMixin dojo/text!./templates/Button.html ../a11yclick".split(" "),
function(q,m,n,l,f,e,k,c,h,b){l("dijit-legacy-requires")&&k(0,function(){q(["dijit/form/DropDownButton","dijit/form/ComboButton","dijit/form/ToggleButton"])});k=m("dijit.form.Button"+(l("dojo-bidi")?"_NoBidi":""),[c,h],{showLabel:!0,iconClass:"dijitNoIcon",_setIconClassAttr:{node:"iconNode",type:"class"},baseClass:"dijitButton",templateString:b,_setValueAttr:"valueNode",_setNameAttr:function(a){this.valueNode&&this.valueNode.setAttribute("name",a)},postCreate:function(){this.inherited(arguments);
this._setLabelFromContainer()},_setLabelFromContainer:function(){this.containerNode&&!this.label&&(this.label=e.trim(this.containerNode.innerHTML),this.onLabelSet())},_setShowLabelAttr:function(a){this.containerNode&&n.toggle(this.containerNode,"dijitDisplayNone",!a);this._set("showLabel",a)},setLabel:function(a){f.deprecated("dijit.form.Button.setLabel() is deprecated.  Use set('label', ...) instead.","","2.0");this.set("label",a)},onLabelSet:function(){this.inherited(arguments);this.showLabel||
"title"in this.params||(this.titleNode.title=e.trim(this.containerNode.innerText||this.containerNode.textContent||""))}});l("dojo-bidi")&&(k=m("dijit.form.Button",k,{onLabelSet:function(){this.inherited(arguments);this.titleNode.title&&this.applyTextDir(this.titleNode,this.titleNode.title)},_setTextDirAttr:function(a){this._created&&this.textDir!=a&&(this._set("textDir",a),this._setLabelAttr(this.label))}}));return k})},"dijit/form/_FormWidget":function(){define("dojo/_base/declare dojo/sniff dojo/_base/kernel dojo/ready ../_Widget ../_CssStateMixin ../_TemplatedMixin ./_FormWidgetMixin".split(" "),
function(q,m,n,l,f,e,k,c){m("dijit-legacy-requires")&&l(0,function(){require(["dijit/form/_FormValueWidget"])});return q("dijit.form._FormWidget",[f,k,e,c],{setDisabled:function(c){n.deprecated("setDisabled("+c+") is deprecated. Use set('disabled',"+c+") instead.","","2.0");this.set("disabled",c)},setValue:function(c){n.deprecated("dijit.form._FormWidget:setValue("+c+") is deprecated.  Use set('value',"+c+") instead.","","2.0");this.set("value",c)},getValue:function(){n.deprecated(this.declaredClass+
"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},postMixInProperties:function(){this.nameAttrSetting=this.name&&!m("msapp")?'name\x3d"'+this.name.replace(/"/g,"\x26quot;")+'"':"";this.inherited(arguments)}})})},"dijit/form/_FormWidgetMixin":function(){define("dojo/_base/array dojo/_base/declare dojo/dom-attr dojo/dom-style dojo/_base/lang dojo/mouse dojo/on dojo/sniff dojo/window ../a11y".split(" "),function(q,m,n,l,f,e,k,c,h,b){return m("dijit.form._FormWidgetMixin",
null,{name:"",alt:"",value:"",type:"text","aria-label":"focusNode",tabIndex:"0",_setTabIndexAttr:"focusNode",disabled:!1,intermediateChanges:!1,scrollOnFocus:!0,_setIdAttr:"focusNode",_setDisabledAttr:function(a){this._set("disabled",a);/^(button|input|select|textarea|optgroup|option|fieldset)$/i.test(this.focusNode.tagName)?n.set(this.focusNode,"disabled",a):this.focusNode.setAttribute("aria-disabled",a?"true":"false");this.valueNode&&n.set(this.valueNode,"disabled",a);a?(this._set("hovering",!1),
this._set("active",!1),a="tabIndex"in this.attributeMap?this.attributeMap.tabIndex:"_setTabIndexAttr"in this?this._setTabIndexAttr:"focusNode",q.forEach(f.isArray(a)?a:[a],function(a){a=this[a];c("webkit")||b.hasDefaultTabStop(a)?a.setAttribute("tabIndex","-1"):a.removeAttribute("tabIndex")},this)):""!=this.tabIndex&&this.set("tabIndex",this.tabIndex)},_onFocus:function(a){if("mouse"==a&&this.isFocusable())var b=this.own(k(this.focusNode,"focus",function(){l.remove();b.remove()}))[0],e=c("pointer-events")?
"pointerup":c("MSPointer")?"MSPointerUp":c("touch-events")?"touchend, mouseup":"mouseup",l=this.own(k(this.ownerDocumentBody,e,f.hitch(this,function(a){l.remove();b.remove();this.focused&&("touchend"==a.type?this.defer("focus"):this.focus())})))[0];this.scrollOnFocus&&this.defer(function(){h.scrollIntoView(this.domNode)});this.inherited(arguments)},isFocusable:function(){return!this.disabled&&this.focusNode&&"none"!=l.get(this.domNode,"display")},focus:function(){if(!this.disabled&&this.focusNode.focus)try{this.focusNode.focus()}catch(a){}},
compare:function(a,b){return"number"==typeof a&&"number"==typeof b?isNaN(a)&&isNaN(b)?0:a-b:a>b?1:a<b?-1:0},onChange:function(){},_onChangeActive:!1,_handleOnChange:function(a,b){void 0!=this._lastValueReported||null!==b&&this._onChangeActive||(this._resetValue=this._lastValueReported=a);this._pendingOnChange=this._pendingOnChange||typeof a!=typeof this._lastValueReported||0!=this.compare(a,this._lastValueReported);(this.intermediateChanges||b||void 0===b)&&this._pendingOnChange&&(this._lastValueReported=
a,this._pendingOnChange=!1,this._onChangeActive&&(this._onChangeHandle&&this._onChangeHandle.remove(),this._onChangeHandle=this.defer(function(){this._onChangeHandle=null;this.onChange(a)})))},create:function(){this.inherited(arguments);this._onChangeActive=!0},destroy:function(){this._onChangeHandle&&(this._onChangeHandle.remove(),this.onChange(this._lastValueReported));this.inherited(arguments)}})})},"dijit/form/_ButtonMixin":function(){define(["dojo/_base/declare","dojo/dom","dojo/has","../registry"],
function(q,m,n,l){var f=q("dijit.form._ButtonMixin"+(n("dojo-bidi")?"_NoBidi":""),null,{label:"",type:"button",__onClick:function(e){e.stopPropagation();e.preventDefault();this.disabled||this.valueNode.click(e);return!1},_onClick:function(e){if(this.disabled)return e.stopPropagation(),e.preventDefault(),!1;!1===this.onClick(e)&&e.preventDefault();var f=e.defaultPrevented;if(!f&&"submit"==this.type&&!(this.valueNode||this.focusNode).form)for(var c=this.domNode;c.parentNode;c=c.parentNode){var h=l.byNode(c);
if(h&&"function"==typeof h._onSubmit){h._onSubmit(e);e.preventDefault();f=!0;break}}return!f},postCreate:function(){this.inherited(arguments);m.setSelectable(this.focusNode,!1)},onClick:function(){return!0},_setLabelAttr:function(e){this._set("label",e);(this.containerNode||this.focusNode).innerHTML=e;this.onLabelSet()},onLabelSet:function(){}});n("dojo-bidi")&&(f=q("dijit.form._ButtonMixin",f,{onLabelSet:function(){this.inherited(arguments);this.applyTextDir(this.containerNode||this.focusNode)}}));
return f})},"dijit/form/_ToggleButtonMixin":function(){define(["dojo/_base/declare","dojo/dom-attr"],function(q,m){return q("dijit.form._ToggleButtonMixin",null,{checked:!1,_aria_attr:"aria-pressed",_onClick:function(m){var l=this.checked;this._set("checked",!l);var f=this.inherited(arguments);this.set("checked",f?this.checked:l);return f},_setCheckedAttr:function(n,l){this._set("checked",n);var f=this.focusNode||this.domNode;this._created&&m.get(f,"checked")!=!!n&&m.set(f,"checked",!!n);f.setAttribute(this._aria_attr,
String(n));this._handleOnChange(n,l)},postCreate:function(){this.inherited(arguments);var m=this.focusNode||this.domNode;this.checked&&m.setAttribute("checked","checked");void 0===this._resetValue&&(this._lastValueReported=this._resetValue=this.checked)},reset:function(){this._hasBeenBlurred=!1;this.set("checked",this.params.checked||!1)}})})},"dijit/_editor/_Plugin":function(){define(["dojo/_base/connect","dojo/_base/declare","dojo/_base/lang","../Destroyable","../form/Button"],function(q,m,n,l,
f){m=m("dijit._editor._Plugin",l,{constructor:function(e){this.params=e||{};n.mixin(this,this.params);this._attrPairNames={}},editor:null,iconClassPrefix:"dijitEditorIcon",button:null,command:"",useDefaultCommand:!0,buttonClass:f,disabled:!1,getLabel:function(e){return this.editor.commands[e]},_initButton:function(){if(this.command.length){var e=this.getLabel(this.command),f=this.editor,c=this.iconClassPrefix+" "+this.iconClassPrefix+this.command.charAt(0).toUpperCase()+this.command.substr(1);this.button||
(e=n.mixin({label:e,ownerDocument:f.ownerDocument,dir:f.dir,lang:f.lang,showLabel:!1,iconClass:c,dropDown:this.dropDown,tabIndex:"-1"},this.params||{}),delete e.name,this.button=new this.buttonClass(e))}this.get("disabled")&&this.button&&this.button.set("disabled",this.get("disabled"))},destroy:function(){this.dropDown&&this.dropDown.destroyRecursive();this.inherited(arguments)},connect:function(e,f,c){this.own(q.connect(e,f,this,c))},updateState:function(){var e=this.editor,f=this.command,c,h;if(e&&
e.isLoaded&&f.length){var b=this.get("disabled");if(this.button)try{h=!b&&e.queryCommandEnabled(f),this.enabled!==h&&(this.enabled=h,this.button.set("disabled",!h)),h&&"boolean"==typeof this.button.checked&&(c=e.queryCommandState(f),this.checked!==c&&(this.checked=c,this.button.set("checked",e.queryCommandState(f))))}catch(a){console.log(a)}}},setEditor:function(e){this.editor=e;this._initButton();this.button&&this.useDefaultCommand&&(this.editor.queryCommandAvailable(this.command)?this.own(this.button.on("click",
n.hitch(this.editor,"execCommand",this.command,this.commandArg))):this.button.domNode.style.display="none");this.own(this.editor.on("NormalizedDisplayChanged",n.hitch(this,"updateState")))},setToolbar:function(e){this.button&&e.addChild(this.button)},set:function(e,f){if("object"===typeof e){for(var c in e)this.set(c,e[c]);return this}c=this._getAttrNames(e);if(this[c.s])var h=this[c.s].apply(this,Array.prototype.slice.call(arguments,1));else this._set(e,f);return h||this},get:function(e){var f=this._getAttrNames(e);
return this[f.g]?this[f.g]():this[e]},_setDisabledAttr:function(e){this._set("disabled",e);this.updateState()},_getAttrNames:function(e){var f=this._attrPairNames;if(f[e])return f[e];var c=e.charAt(0).toUpperCase()+e.substr(1);return f[e]={s:"_set"+c+"Attr",g:"_get"+c+"Attr"}},_set:function(e,f){this[e]=f}});m.registry={};return m})},"dijit/_editor/plugins/EnterKeyHandling":function(){define("dojo/_base/declare dojo/dom-construct dojo/keys dojo/_base/lang dojo/on dojo/sniff dojo/_base/window dojo/window ../_Plugin ../RichText ../range".split(" "),
function(q,m,n,l,f,e,k,c,h,b,a){return q("dijit._editor.plugins.EnterKeyHandling",h,{blockNodeForEnter:"BR",constructor:function(a){a&&("blockNodeForEnter"in a&&(a.blockNodeForEnter=a.blockNodeForEnter.toUpperCase()),l.mixin(this,a))},setEditor:function(a){if(this.editor!==a)if(this.editor=a,"BR"==this.blockNodeForEnter)this.editor.customUndo=!0,a.onLoadDeferred.then(l.hitch(this,function(b){this.own(f(a.document,"keydown",l.hitch(this,function(a){if(a.keyCode==n.ENTER){var b=l.mixin({},a);b.shiftKey=
!0;this.handleEnterKey(b)||(a.stopPropagation(),a.preventDefault())}})));9<=e("ie")&&10>=e("ie")&&this.own(f(a.document,"paste",l.hitch(this,function(a){setTimeout(l.hitch(this,function(){var a=this.editor.document.selection.createRange();a.move("character",-1);a.select();a.move("character",1);a.select()}),0)})));return b}));else if(this.blockNodeForEnter){var b=l.hitch(this,"handleEnterKey");a.addKeyHandler(13,0,0,b);a.addKeyHandler(13,0,1,b);this.own(this.editor.on("KeyPressed",l.hitch(this,"onKeyPressed")))}},
onKeyPressed:function(){if(this._checkListLater){if(this.editor.selection.isCollapsed()){var d=this.editor.selection.getAncestorElement("LI");if(d){e("mozilla")&&"LI"==d.parentNode.parentNode.nodeName&&(d=d.parentNode.parentNode);var c=d.firstChild;!c||1!=c.nodeType||"UL"!=c.nodeName&&"OL"!=c.nodeName||(d.insertBefore(c.ownerDocument.createTextNode("\u00a0"),c),c=a.create(this.editor.window),c.setStart(d.firstChild,0),d=a.getSelection(this.editor.window,!0),d.removeAllRanges(),d.addRange(c))}else b.prototype.execCommand.call(this.editor,
"formatblock",this.blockNodeForEnter),(d=this.editor.selection.getAncestorElement(this.blockNodeForEnter))?(d.innerHTML=this.bogusHtmlContent,9>=e("ie")&&(d=this.editor.document.selection.createRange(),d.move("character",-1),d.select())):console.error("onKeyPressed: Cannot find the new block node")}this._checkListLater=!1}this._pressedEnterInBlock&&(this._pressedEnterInBlock.previousSibling&&this.removeTrailingBr(this._pressedEnterInBlock.previousSibling),delete this._pressedEnterInBlock)},bogusHtmlContent:"\x26#160;",
blockNodes:/^(?:P|H1|H2|H3|H4|H5|H6|LI)$/,handleEnterKey:function(d){var f,h,g,k,p=this.editor.document,r,l,n;if(d.shiftKey){d=this.editor.selection.getParentElement();if(k=a.getAncestor(d,this.blockNodes)){if("LI"==k.tagName)return!0;d=a.getSelection(this.editor.window);f=d.getRangeAt(0);f.collapsed||(f.deleteContents(),d=a.getSelection(this.editor.window),f=d.getRangeAt(0));if(a.atBeginningOfContainer(k,f.startContainer,f.startOffset))r=p.createElement("br"),f=a.create(this.editor.window),k.insertBefore(r,
k.firstChild),f.setStartAfter(r),d.removeAllRanges(),d.addRange(f);else if(a.atEndOfContainer(k,f.startContainer,f.startOffset))f=a.create(this.editor.window),r=p.createElement("br"),k.appendChild(r),k.appendChild(p.createTextNode("\u00a0")),f.setStart(k.lastChild,0),d.removeAllRanges(),d.addRange(f);else return(l=f.startContainer)&&3==l.nodeType?(n=l.nodeValue,h=p.createTextNode(n.substring(0,f.startOffset)),g=p.createTextNode(n.substring(f.startOffset)),k=p.createElement("br"),""==g.nodeValue&&
e("webkit")&&(g=p.createTextNode("\u00a0")),m.place(h,l,"after"),m.place(k,h,"after"),m.place(g,k,"after"),m.destroy(l),f=a.create(this.editor.window),f.setStart(g,0),d.removeAllRanges(),d.addRange(f),!1):!0}else d=a.getSelection(this.editor.window),d.rangeCount?(f=d.getRangeAt(0))&&f.startContainer&&(f.collapsed||(f.deleteContents(),d=a.getSelection(this.editor.window),f=d.getRangeAt(0)),(l=f.startContainer)&&3==l.nodeType?(k=f.startOffset,l.length<k&&(g=this._adjustNodeAndOffset(l,k),l=g.node,k=
g.offset),n=l.nodeValue,h=p.createTextNode(n.substring(0,k)),g=p.createTextNode(n.substring(k)),k=p.createElement("br"),g.length||(g=p.createTextNode("\u00a0")),h.length?m.place(h,l,"after"):h=l,m.place(k,h,"after"),m.place(g,k,"after"),m.destroy(l)):(0<=f.startOffset&&(r=l.childNodes[f.startOffset]),k=p.createElement("br"),g=p.createTextNode("\u00a0"),r?(m.place(k,r,"before"),m.place(g,k,"after")):(l.appendChild(k),l.appendChild(g))),f=a.create(this.editor.window),f.setStart(g,0),f.setEnd(g,g.length),
d.removeAllRanges(),d.addRange(f),this.editor.selection.collapse(!0)):b.prototype.execCommand.call(this.editor,"inserthtml","\x3cbr\x3e");return!1}var q=!0;d=a.getSelection(this.editor.window);f=d.getRangeAt(0);f.collapsed||(f.deleteContents(),d=a.getSelection(this.editor.window),f=d.getRangeAt(0));r=a.getBlockAncestor(f.endContainer,null,this.editor.editNode);var x=r.blockNode;if(this._checkListLater=x&&("LI"==x.nodeName||"LI"==x.parentNode.nodeName))return e("mozilla")&&(this._pressedEnterInBlock=
x),/^(\s|&nbsp;|&#160;|\xA0|<span\b[^>]*\bclass=['"]Apple-style-span['"][^>]*>(\s|&nbsp;|&#160;|\xA0)<\/span>)?(<br>)?$/.test(x.innerHTML)&&(x.innerHTML="",e("webkit")&&(f=a.create(this.editor.window),f.setStart(x,0),d.removeAllRanges(),d.addRange(f)),this._checkListLater=!1),!0;if(!r.blockNode||r.blockNode===this.editor.editNode){try{b.prototype.execCommand.call(this.editor,"formatblock",this.blockNodeForEnter)}catch(w){}r={blockNode:this.editor.selection.getAncestorElement(this.blockNodeForEnter),
blockContainer:this.editor.editNode};if(r.blockNode){if(r.blockNode!=this.editor.editNode&&!(r.blockNode.textContent||r.blockNode.innerHTML).replace(/^\s+|\s+$/g,"").length)return this.removeTrailingBr(r.blockNode),!1}else r.blockNode=this.editor.editNode;d=a.getSelection(this.editor.window);f=d.getRangeAt(0)}x=p.createElement(this.blockNodeForEnter);x.innerHTML=this.bogusHtmlContent;this.removeTrailingBr(r.blockNode);g=f.endOffset;q=f.endContainer;q.length<g&&(g=this._adjustNodeAndOffset(q,g),q=
g.node,g=g.offset);if(a.atEndOfContainer(r.blockNode,q,g))r.blockNode===r.blockContainer?r.blockNode.appendChild(x):m.place(x,r.blockNode,"after"),q=!1,f=a.create(this.editor.window),f.setStart(x,0),d.removeAllRanges(),d.addRange(f),this.editor.height&&c.scrollIntoView(x);else if(a.atBeginningOfContainer(r.blockNode,f.startContainer,f.startOffset))m.place(x,r.blockNode,r.blockNode===r.blockContainer?"first":"before"),x.nextSibling&&this.editor.height&&(f=a.create(this.editor.window),f.setStart(x.nextSibling,
0),d.removeAllRanges(),d.addRange(f),c.scrollIntoView(x.nextSibling)),q=!1;else{r.blockNode===r.blockContainer?r.blockNode.appendChild(x):m.place(x,r.blockNode,"after");q=!1;r.blockNode.style&&x.style&&r.blockNode.style.cssText&&(x.style.cssText=r.blockNode.style.cssText);if((l=f.startContainer)&&3==l.nodeType){g=f.endOffset;l.length<g&&(g=this._adjustNodeAndOffset(l,g),l=g.node,g=g.offset);n=l.nodeValue;h=p.createTextNode(n.substring(0,g));g=p.createTextNode(n.substring(g,n.length));m.place(h,l,
"before");m.place(g,l,"after");m.destroy(l);for(f=h.parentNode;f!==r.blockNode;){n=p.createElement(f.tagName);f.style&&n.style&&f.style.cssText&&(n.style.cssText=f.style.cssText);"FONT"===f.tagName&&(f.color&&(n.color=f.color),f.face&&(n.face=f.face),f.size&&(n.size=f.size));for(;g;)l=g.nextSibling,n.appendChild(g),g=l;m.place(n,f,"after");h=f;g=n;f=f.parentNode}if(1==g.nodeType||3==g.nodeType&&g.nodeValue)x.innerHTML="";for(h=g;g;)l=g.nextSibling,x.appendChild(g),g=l}f=a.create(this.editor.window);
p=h;if("BR"!==this.blockNodeForEnter){for(;p;)k=p,p=l=p.firstChild;k&&k.parentNode?(x=k.parentNode,f.setStart(x,0),d.removeAllRanges(),d.addRange(f),this.editor.height&&c.scrollIntoView(x),e("mozilla")&&(this._pressedEnterInBlock=r.blockNode)):q=!0}else f.setStart(x,0),d.removeAllRanges(),d.addRange(f),this.editor.height&&c.scrollIntoView(x),e("mozilla")&&(this._pressedEnterInBlock=r.blockNode)}return q},_adjustNodeAndOffset:function(a,b){for(;a.length<b&&a.nextSibling&&3==a.nextSibling.nodeType;)b-=
a.length,a=a.nextSibling;return{node:a,offset:b}},removeTrailingBr:function(a){if(a=/P|DIV|LI/i.test(a.tagName)?a:this.editor.selection.getParentOfType(a,["P","DIV","LI"]))a.lastChild&&(1<a.childNodes.length&&3==a.lastChild.nodeType&&/^[\s\xAD]*$/.test(a.lastChild.nodeValue)||"BR"==a.lastChild.tagName)&&m.destroy(a.lastChild),a.childNodes.length||(a.innerHTML=this.bogusHtmlContent)}})})},"dijit/_editor/RichText":function(){define("dojo/_base/array dojo/_base/config dojo/_base/declare dojo/_base/Deferred dojo/dom dojo/dom-attr dojo/dom-class dojo/dom-construct dojo/dom-geometry dojo/dom-style dojo/_base/kernel dojo/keys dojo/_base/lang dojo/on dojo/query dojo/domReady dojo/sniff dojo/string dojo/topic dojo/_base/unload dojo/_base/url dojo/window ../_Widget ../_CssStateMixin ../selection ./range ./html ../focus ../main".split(" "),
function(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A,y,B,x,w,z,E,C,D,F,G){var I=n("dijit._editor.RichText",[w,z],{constructor:function(a){this.contentPreFilters=[];this.contentPostFilters=[];this.contentDomPreFilters=[];this.contentDomPostFilters=[];this.editingAreaStyleSheets=[];this.events=[].concat(this.events);this._keyHandlers={};a&&t.isString(a.value)&&(this.value=a.value);this.onLoadDeferred=new l},baseClass:"dijitEditor",inheritWidth:!1,focusOnLoad:!1,name:"",styleSheets:"",height:"300px",minHeight:"1em",
isClosed:!0,isLoaded:!1,_SEPARATOR:"@@**%%__RICHTEXTBOUNDRY__%%**@@",_NAME_CONTENT_SEP:"@@**%%:%%**@@",onLoadDeferred:null,isTabIndent:!1,disableSpellCheck:!1,postCreate:function(){"textarea"===this.domNode.tagName.toLowerCase()&&console.warn("RichText should not be used with the TEXTAREA tag.  See dijit._editor.RichText docs.");this.contentPreFilters=[t.trim,t.hitch(this,"_preFixUrlAttributes")].concat(this.contentPreFilters);p("mozilla")&&(this.contentPreFilters=[this._normalizeFontStyle].concat(this.contentPreFilters),
this.contentPostFilters=[this._removeMozBogus].concat(this.contentPostFilters));p("webkit")&&(this.contentPreFilters=[this._removeWebkitBogus].concat(this.contentPreFilters),this.contentPostFilters=[this._removeWebkitBogus].concat(this.contentPostFilters));if(p("ie")||p("trident"))this.contentPostFilters=[this._normalizeFontStyle].concat(this.contentPostFilters),this.contentDomPostFilters=[t.hitch(this,"_stripBreakerNodes")].concat(this.contentDomPostFilters);this.contentDomPostFilters=[t.hitch(this,
"_stripTrailingEmptyNodes")].concat(this.contentDomPostFilters);this.inherited(arguments);A.publish(G._scopeName+"._editor.RichText::init",this)},startup:function(){this.inherited(arguments);this.open();this.setupDefaultShortcuts()},setupDefaultShortcuts:function(){var a=t.hitch(this,function(a,b){return function(){return!this.execCommand(a,b)}}),b={b:a("bold"),i:a("italic"),u:a("underline"),a:a("selectall"),s:function(){this.save(!0)},m:function(){this.isTabIndent=!this.isTabIndent},1:a("formatblock",
"h1"),2:a("formatblock","h2"),3:a("formatblock","h3"),4:a("formatblock","h4"),"\\":a("insertunorderedlist")};p("ie")||(b.Z=a("redo"));for(var d in b)this.addKeyHandler(d,!0,!1,b[d])},events:["onKeyDown","onKeyUp"],captureEvents:[],_editorCommandsLocalized:!1,_localizeEditorCommands:function(){if(I._editorCommandsLocalized)this._local2NativeFormatNames=I._local2NativeFormatNames,this._native2LocalFormatNames=I._native2LocalFormatNames;else{I._editorCommandsLocalized=!0;I._local2NativeFormatNames={};
I._native2LocalFormatNames={};this._local2NativeFormatNames=I._local2NativeFormatNames;this._native2LocalFormatNames=I._native2LocalFormatNames;for(var a="div p pre h1 h2 h3 h4 h5 h6 ol ul address".split(" "),b="",d,e=0;d=a[e++];)b="l"!==d.charAt(1)?b+("\x3c"+d+"\x3e\x3cspan\x3econtent\x3c/span\x3e\x3c/"+d+"\x3e\x3cbr/\x3e"):b+("\x3c"+d+"\x3e\x3cli\x3econtent\x3c/li\x3e\x3c/"+d+"\x3e\x3cbr/\x3e");var g=c.create("div",{style:{position:"absolute",top:"0px",zIndex:10,opacity:.01},innerHTML:b});this.ownerDocumentBody.appendChild(g);
a=t.hitch(this,function(){for(var a=g.firstChild;a;)try{this.selection.selectElement(a.firstChild);var b=a.tagName.toLowerCase();this._local2NativeFormatNames[b]=document.queryCommandValue("formatblock");this._native2LocalFormatNames[this._local2NativeFormatNames[b]]=b;a=a.nextSibling.nextSibling}catch(K){}c.destroy(g)});this.defer(a)}},open:function(a){if(!this.onLoadDeferred||0<=this.onLoadDeferred.fired)this.onLoadDeferred=new l;this.isClosed||this.close();A.publish(G._scopeName+"._editor.RichText::open",
this);1===arguments.length&&a.nodeName&&(this.domNode=a);var d=this.domNode,g;if(t.isString(this.value))g=this.value,d.innerHTML="";else if(d.nodeName&&"textarea"==d.nodeName.toLowerCase()){var h=this.textarea=d;this.name=h.name;g=h.value;d=this.domNode=this.ownerDocument.createElement("div");d.setAttribute("widgetId",this.id);h.removeAttribute("widgetId");d.cssText=h.cssText;d.className+=" "+h.className;c.place(d,h,"before");var r=t.hitch(this,function(){b.set(h,{display:"block",position:"absolute",
top:"-1000px"});if(p("ie")){var a=h.style;this.__overflow=a.overflow;a.overflow="hidden"}});p("ie")?this.defer(r,10):r();if(h.form){var u=h.value;this.reset=function(){this.getValue()!==u&&this.replaceValue(u)};v(h.form,"submit",t.hitch(this,function(){e.set(h,"disabled",this.disabled);h.value=this.getValue()}))}}else g=D.getChildrenHtml(d),d.innerHTML="";this.value=g;d.nodeName&&"LI"===d.nodeName&&(d.innerHTML=" \x3cbr\x3e");this.header=d.ownerDocument.createElement("div");d.appendChild(this.header);
this.editingArea=d.ownerDocument.createElement("div");d.appendChild(this.editingArea);this.footer=d.ownerDocument.createElement("div");d.appendChild(this.footer);this.name||(this.name=this.id+"_AUTOGEN");if(""!==this.name&&(!m.useXDomain||m.allowXdRichTextSave)){if((g=f.byId(G._scopeName+"._editor.RichText.value"))&&""!==g.value)for(var r=g.value.split(this._SEPARATOR),n=0,q;q=r[n++];)if(q=q.split(this._NAME_CONTENT_SEP),q[0]===this.name){this.value=q[1];r=r.splice(n,1);g.value=r.join(this._SEPARATOR);
break}I._globalSaveHandler||(I._globalSaveHandler={},y.addOnUnload(function(){for(var a in I._globalSaveHandler){var b=I._globalSaveHandler[a];t.isFunction(b)&&b()}}));I._globalSaveHandler[this.id]=t.hitch(this,"_saveContent")}this.isClosed=!1;g=this.editorObject=this.iframe=this.ownerDocument.createElement("iframe");g.id=this.id+"_iframe";g.style.border="none";g.style.width="100%";this._layoutMode?g.style.height="100%":7<=p("ie")?(this.height&&(g.style.height=this.height),this.minHeight&&(g.style.minHeight=
this.minHeight)):g.style.height=this.height?this.height:this.minHeight;g.frameBorder=0;g._loadFunc=t.hitch(this,function(a){this.window=a;this.document=a.document;this.selection=new E.SelectionManager(a);p("ie")&&this._localizeEditorCommands();this.onLoad(this.get("value"))});r=this._getIframeDocTxt().replace(/\\/g,"\\\\").replace(/'/g,"\\'");r=11>p("ie")?'javascript:document.open();try{parent.window;}catch(e){document.domain\x3d"'+document.domain+"\";}document.write('"+r+"');document.close()":"javascript: '"+
r+"'";this.editingArea.appendChild(g);g.src=r;"LI"===d.nodeName&&(d.lastChild.style.marginTop="-1.2em");k.add(this.domNode,this.baseClass)},_local2NativeFormatNames:{},_native2LocalFormatNames:{},_getIframeDocTxt:function(){var d=b.getComputedStyle(this.domNode),c;if(this["aria-label"])c=this["aria-label"];else{var e=g('label[for\x3d"'+this.id+'"]',this.ownerDocument)[0]||f.byId(this["aria-labelledby"],this.ownerDocument);e&&(c=e.textContent||e.innerHTML||"")}var e="\x3cdiv id\x3d'dijitEditorBody' role\x3d'textbox' aria-multiline\x3d'true' "+
(c?" aria-label\x3d'"+r.escape(c)+"'":"")+"\x3e\x3c/div\x3e",h=[d.fontWeight,d.fontSize,d.fontFamily].join(" "),k=d.lineHeight,k=0<=k.indexOf("px")?parseFloat(k)/parseFloat(d.fontSize):0<=k.indexOf("em")?parseFloat(k):"normal",l="",u=this;this.style.replace(/(^|;)\s*(line-|font-?)[^;]+/ig,function(a){a=a.replace(/^;/ig,"")+";";var d=a.split(":")[0];if(d){var d=t.trim(d),d=d.toLowerCase(),c,e="";for(c=0;c<d.length;c++){var g=d.charAt(c);switch(g){case "-":c++,g=d.charAt(c).toUpperCase();default:e+=
g}}b.set(u.domNode,e,"")}l+=a+";"});this.iframe.setAttribute("title",c);return["\x3c!DOCTYPE html\x3e","\x3chtml lang\x3d'"+(this.lang||a.locale.replace(/-.*/,""))+"'"+(this.isLeftToRight()?"":" dir\x3d'rtl'")+"\x3e\n","\x3chead\x3e\n\x3cmeta http-equiv\x3d'Content-Type' content\x3d'text/html'\x3e\n",c?"\x3ctitle\x3e"+r.escape(c)+"\x3c/title\x3e":"","\x3cstyle\x3e\n\tbody,html {\n\t\tbackground:transparent;\n\t\tpadding: 1px 0 0 0;\n\t\tmargin: -1px 0 0 0;\n\t}\n\tbody,html,#dijitEditorBody { outline: none; }html { height: 100%; width: 100%; overflow: hidden; }\n",
this.height?"\tbody,#dijitEditorBody { height: 100%; width: 100%; overflow: auto; }\n":"\tbody,#dijitEditorBody { min-height: "+this.minHeight+"; width: 100%; overflow-x: auto; overflow-y: hidden; }\n","\tbody{\n\t\ttop:0px;\n\t\tleft:0px;\n\t\tright:0px;\n\t\tfont:",h,";\n",this.height||p("opera")?"":"\t\tposition: fixed;\n","\t\tline-height:",k,";\n\t}\n\tp{ margin: 1em 0; }\n\tli \x3e ul:-moz-first-node, li \x3e ol:-moz-first-node{ padding-top: 1.2em; }\n",p("ie")||p("trident")||p("edge")?"":"\tli{ min-height:1.2em; }\n",
"\x3c/style\x3e\n",this._applyEditingAreaStyleSheets(),"\n\x3c/head\x3e\n\x3cbody role\x3d'application'",c?" aria-label\x3d'"+r.escape(c)+"'":"","onload\x3d'try{frameElement \x26\x26 frameElement._loadFunc(window,document)}catch(e){document.domain\x3d\""+document.domain+"\";frameElement._loadFunc(window,document)}' ","style\x3d'"+l+"'\x3e",e,"\x3c/body\x3e\n\x3c/html\x3e"].join("")},_applyEditingAreaStyleSheets:function(){var a=[];this.styleSheets&&(a=this.styleSheets.split(";"),this.styleSheets=
"");a=a.concat(this.editingAreaStyleSheets);this.editingAreaStyleSheets=[];for(var b="",d=0,c,e=x.get(this.ownerDocument);c=a[d++];)c=(new B(e.location,c)).toString(),this.editingAreaStyleSheets.push(c),b+='\x3clink rel\x3d"stylesheet" type\x3d"text/css" href\x3d"'+c+'"/\x3e';return b},addStyleSheet:function(a){var b=a.toString(),d=x.get(this.ownerDocument);if("."===b.charAt(0)||"/"!==b.charAt(0)&&!a.host)b=(new B(d.location,b)).toString();-1<q.indexOf(this.editingAreaStyleSheets,b)||(this.editingAreaStyleSheets.push(b),
this.onLoadDeferred.then(t.hitch(this,function(){if(this.document.createStyleSheet)this.document.createStyleSheet(b);else{var a=this.document.getElementsByTagName("head")[0],d=this.document.createElement("link");d.rel="stylesheet";d.type="text/css";d.href=b;a.appendChild(d)}})))},removeStyleSheet:function(a){var b=a.toString(),d=x.get(this.ownerDocument);if("."===b.charAt(0)||"/"!==b.charAt(0)&&!a.host)b=(new B(d.location,b)).toString();a=q.indexOf(this.editingAreaStyleSheets,b);-1!==a&&(delete this.editingAreaStyleSheets[a],
g('link[href\x3d"'+b+'"]',this.window.document).orphan())},disabled:!1,_mozSettingProps:{styleWithCSS:!1},_setDisabledAttr:function(a){a=!!a;this._set("disabled",a);if(this.isLoaded){var b=p("ie")&&(this.isLoaded||!this.focusOnLoad);b&&(this.editNode.unselectable="on");this.editNode.contentEditable=!a;this.editNode.tabIndex=a?"-1":this.tabIndex;b&&this.defer(function(){this.editNode&&(this.editNode.unselectable="off")});if(p("mozilla")&&!a&&this._mozSettingProps){a=this._mozSettingProps;for(var d in a)if(a.hasOwnProperty(d))try{this.document.execCommand(d,
!1,a[d])}catch(U){}}this._disabledOK=!0}},onLoad:function(a){this.window.__registeredWindow||(this.window.__registeredWindow=!0,this._iframeRegHandle=F.registerIframe(this.iframe));this.editNode=this.document.body.firstChild;var b=this;this.beforeIframeNode=c.place("\x3cdiv tabIndex\x3d-1\x3e\x3c/div\x3e",this.iframe,"before");this.afterIframeNode=c.place("\x3cdiv tabIndex\x3d-1\x3e\x3c/div\x3e",this.iframe,"after");this.iframe.onfocus=this.document.onfocus=function(){b.editNode.focus()};this.focusNode=
this.editNode;var d=this.events.concat(this.captureEvents),e=this.iframe?this.document:this.editNode;this.own.apply(this,q.map(d,function(a){var b=a.toLowerCase().replace(/^on/,"");return v(e,b,t.hitch(this,a))},this));this.own(v(e,"mouseup",t.hitch(this,"onClick")));p("ie")&&(this.own(v(this.document,"mousedown",t.hitch(this,"_onIEMouseDown"))),this.editNode.style.zoom=1);p("webkit")&&(this._webkitListener=this.own(v(this.document,"mouseup",t.hitch(this,"onDisplayChanged")))[0],this.own(v(this.document,
"mousedown",t.hitch(this,function(a){a=a.target;!a||a!==this.document.body&&a!==this.document||this.defer("placeCursorAtEnd")}))));if(p("ie"))try{this.document.execCommand("RespectVisibilityInDesign",!0,null)}catch(V){}this.isLoaded=!0;this.set("disabled",this.disabled);d=t.hitch(this,function(){this.setValue(a);this.onLoadDeferred&&!this.onLoadDeferred.isFulfilled()&&this.onLoadDeferred.resolve(!0);this.onDisplayChanged();this.focusOnLoad&&u(t.hitch(this,"defer","focus",this.updateInterval));this.value=
this.getValue(!0)});this.setValueDeferred?this.setValueDeferred.then(d):d()},onKeyDown:function(a){if(a.keyCode===d.SHIFT||a.keyCode===d.ALT||a.keyCode===d.META||a.keyCode===d.CTRL)return!0;a.keyCode===d.TAB&&this.isTabIndent&&(a.stopPropagation(),a.preventDefault(),this.queryCommandEnabled(a.shiftKey?"outdent":"indent")&&this.execCommand(a.shiftKey?"outdent":"indent"));if(a.keyCode==d.TAB&&!this.isTabIndent&&!a.ctrlKey&&!a.altKey)return a.shiftKey?this.beforeIframeNode.focus():this.afterIframeNode.focus(),
!0;9>p("ie")&&a.keyCode===d.BACKSPACE&&"Control"===this.document.selection.type&&(a.stopPropagation(),a.preventDefault(),this.execCommand("delete"));p("ff")&&(a.keyCode===d.PAGE_UP||a.keyCode===d.PAGE_DOWN)&&this.editNode.clientHeight>=this.editNode.scrollHeight&&a.preventDefault();var b=this._keyHandlers[a.keyCode],c=arguments;b&&!a.altKey&&q.some(b,function(b){if(!(b.shift^a.shiftKey||b.ctrl^(a.ctrlKey||a.metaKey)))return b.handler.apply(this,c)||a.preventDefault(),!0},this);this.defer("onKeyPressed",
1);return!0},onKeyUp:function(){},setDisabled:function(b){a.deprecated("dijit.Editor::setDisabled is deprecated",'use dijit.Editor::attr("disabled",boolean) instead',2);this.set("disabled",b)},_setValueAttr:function(a){this.setValue(a)},_setDisableSpellCheckAttr:function(a){this.document?e.set(this.document.body,"spellcheck",!a):this.onLoadDeferred.then(t.hitch(this,function(){e.set(this.document.body,"spellcheck",!a)}));this._set("disableSpellCheck",a)},addKeyHandler:function(a,b,d,c){"string"==
typeof a&&(a=a.toUpperCase().charCodeAt(0));t.isArray(this._keyHandlers[a])||(this._keyHandlers[a]=[]);this._keyHandlers[a].push({shift:d||!1,ctrl:b||!1,handler:c})},onKeyPressed:function(){this.onDisplayChanged()},onClick:function(a){this.onDisplayChanged(a)},_onIEMouseDown:function(){this.focused||this.disabled||this.focus()},_onBlur:function(a){(p("ie")||p("trident"))&&this.defer(function(){F.curNode||this.ownerDocumentBody.focus()});this.inherited(arguments);var b=this.getValue(!0);if(b!==this.value)this.onChange(b);
this._set("value",b)},_onFocus:function(a){this.disabled||(this._disabledOK||this.set("disabled",!1),this.inherited(arguments))},blur:function(){!p("ie")&&this.window.document.documentElement&&this.window.document.documentElement.focus?this.window.document.documentElement.focus():this.ownerDocumentBody.focus&&this.ownerDocumentBody.focus()},focus:function(){this.isLoaded?9>p("ie")?this.iframe.fireEvent("onfocus",document.createEventObject()):this.editNode.focus():this.focusOnLoad=!0},updateInterval:200,
_updateTimer:null,onDisplayChanged:function(){this._updateTimer&&this._updateTimer.remove();this._updateTimer=this.defer("onNormalizedDisplayChanged",this.updateInterval)},onNormalizedDisplayChanged:function(){delete this._updateTimer},onChange:function(){},_normalizeCommand:function(a,b){var d=a.toLowerCase();"formatblock"===d?p("safari")&&void 0===b&&(d="heading"):"hilitecolor"!==d||p("mozilla")||(d="backcolor");return d},_qcaCache:{},queryCommandAvailable:function(a){var b=this._qcaCache[a];return void 0!==
b?b:this._qcaCache[a]=this._queryCommandAvailable(a)},_queryCommandAvailable:function(a){switch(a.toLowerCase()){case "bold":case "italic":case "underline":case "subscript":case "superscript":case "fontname":case "fontsize":case "forecolor":case "hilitecolor":case "justifycenter":case "justifyfull":case "justifyleft":case "justifyright":case "delete":case "selectall":case "toggledir":case "createlink":case "unlink":case "removeformat":case "inserthorizontalrule":case "insertimage":case "insertorderedlist":case "insertunorderedlist":case "indent":case "outdent":case "formatblock":case "inserthtml":case "undo":case "redo":case "strikethrough":case "tabindent":case "cut":case "copy":case "paste":return!0;
case "blockdirltr":case "blockdirrtl":case "dirltr":case "dirrtl":case "inlinedirltr":case "inlinedirrtl":return p("ie")||p("trident")||p("edge");case "inserttable":case "insertcell":case "insertcol":case "insertrow":case "deletecells":case "deletecols":case "deleterows":case "mergecells":case "splitcell":return!p("webkit");default:return!1}},execCommand:function(a,b){var d;this.focused&&this.focus();a=this._normalizeCommand(a,b);if(void 0!==b){if("heading"===a)throw Error("unimplemented");"formatblock"===
a&&(p("ie")||p("trident"))&&(b="\x3c"+b+"\x3e")}var c="_"+a+"Impl";if(this[c])d=this[c](b);else if((b=1<arguments.length?b:null)||"createlink"!==a)d=this.document.execCommand(a,!1,b);this.onDisplayChanged();return d},queryCommandEnabled:function(a){if(this.disabled||!this._disabledOK)return!1;a=this._normalizeCommand(a);var b="_"+a+"EnabledImpl";return this[b]?this[b](a):this._browserQueryCommandEnabled(a)},queryCommandState:function(a){if(this.disabled||!this._disabledOK)return!1;a=this._normalizeCommand(a);
try{return this.document.queryCommandState(a)}catch(M){return!1}},queryCommandValue:function(a){if(this.disabled||!this._disabledOK)return!1;a=this._normalizeCommand(a);if(p("ie")&&"formatblock"===a)a=this._native2LocalFormatNames[this.document.queryCommandValue(a)];else if(p("mozilla")&&"hilitecolor"===a){var b;try{b=this.document.queryCommandValue("styleWithCSS")}catch(P){b=!1}this.document.execCommand("styleWithCSS",!1,!0);a=this.document.queryCommandValue(a);this.document.execCommand("styleWithCSS",
!1,b)}else a=this.document.queryCommandValue(a);return a},_sCall:function(a,b){return this.selection[a].apply(this.selection,b)},placeCursorAtStart:function(){this.focus();var a=!1;if(p("mozilla"))for(var b=this.editNode.firstChild;b;){if(3===b.nodeType){if(0<b.nodeValue.replace(/^\s+|\s+$/g,"").length){a=!0;this.selection.selectElement(b);break}}else if(1===b.nodeType){var a=!0,d=b.tagName?b.tagName.toLowerCase():"";/br|input|img|base|meta|area|basefont|hr|link/.test(d)?this.selection.selectElement(b):
this.selection.selectElementChildren(b);break}b=b.nextSibling}else a=!0,this.selection.selectElementChildren(this.editNode);a&&this.selection.collapse(!0)},placeCursorAtEnd:function(){this.focus();var a=!1;if(p("mozilla"))for(var b=this.editNode.lastChild;b;){if(3===b.nodeType){if(0<b.nodeValue.replace(/^\s+|\s+$/g,"").length){a=!0;this.selection.selectElement(b);break}}else if(1===b.nodeType){a=!0;this.selection.selectElement(b.lastChild||b);break}b=b.previousSibling}else a=!0,this.selection.selectElementChildren(this.editNode);
a&&this.selection.collapse(!1)},getValue:function(a){return!this.textarea||!this.isClosed&&this.isLoaded?this.isLoaded?this._postFilterContent(null,a):this.value:this.textarea.value},_getValueAttr:function(){return this.getValue(!0)},setValue:function(a){if(this.isLoaded){if(!this.textarea||!this.isClosed&&this.isLoaded){a=this._preFilterContent(a);var b=this.isClosed?this.domNode:this.editNode;b.innerHTML=a;this._preDomFilterContent(b)}else this.textarea.value=a;this.onDisplayChanged();this._set("value",
this.getValue(!0))}else this.onLoadDeferred.then(t.hitch(this,function(){this.setValue(a)}))},replaceValue:function(a){this.isClosed?this.setValue(a):this.window&&this.window.getSelection&&!p("mozilla")?this.setValue(a):this.window&&this.window.getSelection?(a=this._preFilterContent(a),this.execCommand("selectall"),this.execCommand("inserthtml",a),this._preDomFilterContent(this.editNode)):this.document&&this.document.selection&&this.setValue(a);this._set("value",this.getValue(!0))},_preFilterContent:function(a){var b=
a;q.forEach(this.contentPreFilters,function(a){a&&(b=a(b))});return b},_preDomFilterContent:function(a){a=a||this.editNode;q.forEach(this.contentDomPreFilters,function(b){b&&t.isFunction(b)&&b(a)},this)},_postFilterContent:function(a,b){var d;t.isString(a)?d=a:(a=a||this.editNode,this.contentDomPostFilters.length&&(b&&(a=t.clone(a)),q.forEach(this.contentDomPostFilters,function(b){a=b(a)})),d=D.getChildrenHtml(a));t.trim(d.replace(/^\xA0\xA0*/,"").replace(/\xA0\xA0*$/,"")).length||(d="");q.forEach(this.contentPostFilters,
function(a){d=a(d)});return d},_saveContent:function(){var a=f.byId(G._scopeName+"._editor.RichText.value");a&&(a.value&&(a.value+=this._SEPARATOR),a.value+=this.name+this._NAME_CONTENT_SEP+this.getValue(!0))},escapeXml:function(a,b){a=a.replace(/&/gm,"\x26amp;").replace(/</gm,"\x26lt;").replace(/>/gm,"\x26gt;").replace(/"/gm,"\x26quot;");b||(a=a.replace(/'/gm,"\x26#39;"));return a},getNodeHtml:function(b){a.deprecated("dijit.Editor::getNodeHtml is deprecated","use dijit/_editor/html::getNodeHtml instead",
2);return D.getNodeHtml(b)},getNodeChildrenHtml:function(b){a.deprecated("dijit.Editor::getNodeChildrenHtml is deprecated","use dijit/_editor/html::getChildrenHtml instead",2);return D.getChildrenHtml(b)},close:function(a){if(!this.isClosed){arguments.length||(a=!0);a&&this._set("value",this.getValue(!0));this.interval&&clearInterval(this.interval);this._webkitListener&&(this._webkitListener.remove(),delete this._webkitListener);p("ie")&&(this.iframe.onfocus=null);this.iframe._loadFunc=null;this._iframeRegHandle&&
(this._iframeRegHandle.remove(),delete this._iframeRegHandle);if(this.textarea){var b=this.textarea.style;b.position="";b.left=b.top="";p("ie")&&(b.overflow=this.__overflow,this.__overflow=null);this.textarea.value=this.value;c.destroy(this.domNode);this.domNode=this.textarea}else this.domNode.innerHTML=this.value;delete this.iframe;k.remove(this.domNode,this.baseClass);this.isClosed=!0;this.isLoaded=!1;delete this.editNode;delete this.focusNode;this.window&&this.window._frameElement&&(this.window._frameElement=
null);this.editorObject=this.editingArea=this.document=this.window=null}},destroy:function(){this.isClosed||this.close(!1);this._updateTimer&&this._updateTimer.remove();this.inherited(arguments);I._globalSaveHandler&&delete I._globalSaveHandler[this.id]},_removeMozBogus:function(a){return a.replace(/\stype="_moz"/gi,"").replace(/\s_moz_dirty=""/gi,"").replace(/_moz_resizing="(true|false)"/gi,"")},_removeWebkitBogus:function(a){a=a.replace(/\sclass="webkit-block-placeholder"/gi,"");a=a.replace(/\sclass="apple-style-span"/gi,
"");return a=a.replace(/<meta charset=\"utf-8\" \/>/gi,"")},_normalizeFontStyle:function(a){return a.replace(/<(\/)?strong([ \>])/gi,"\x3c$1b$2").replace(/<(\/)?em([ \>])/gi,"\x3c$1i$2")},_preFixUrlAttributes:function(a){return a.replace(/(?:(<a(?=\s).*?\shref=)("|')(.*?)\2)|(?:(<a\s.*?href=)([^"'][^ >]+))/gi,"$1$4$2$3$5$2 _djrealurl\x3d$2$3$5$2").replace(/(?:(<img(?=\s).*?\ssrc=)("|')(.*?)\2)|(?:(<img\s.*?src=)([^"'][^ >]+))/gi,"$1$4$2$3$5$2 _djrealurl\x3d$2$3$5$2")},_browserQueryCommandEnabled:function(a){if(!a)return!1;
if(p("ie")||p("trident")||p("edge"))return this.focused&&!this.disabled;var b=9>p("ie")?this.document.selection.createRange():this.document;try{return b.queryCommandEnabled(a)}catch(P){return!1}},_createlinkEnabledImpl:function(){var a=!0;return a=p("opera")?this.window.getSelection().isCollapsed?!0:this.document.queryCommandEnabled("createlink"):this._browserQueryCommandEnabled("createlink")},_unlinkEnabledImpl:function(){var a=!0;return a=p("mozilla")||p("webkit")||p("ie")||p("trident")||p("edge")?
this.selection.hasAncestorElement("a"):this._browserQueryCommandEnabled("unlink")},_inserttableEnabledImpl:function(){var a=!0;return a=p("mozilla")||p("webkit")?!0:this._browserQueryCommandEnabled("inserttable")},_cutEnabledImpl:function(){var a=!0;p("webkit")?((a=this.window.getSelection())&&(a=a.toString()),a=!!a):a=this._browserQueryCommandEnabled("cut");return a},_copyEnabledImpl:function(){var a=!0;p("webkit")?((a=this.window.getSelection())&&(a=a.toString()),a=!!a):a=this._browserQueryCommandEnabled("copy");
return a},_pasteEnabledImpl:function(){var a=!0;return p("webkit")?!0:a=this._browserQueryCommandEnabled("paste")},_inserthorizontalruleImpl:function(a){return p("ie")?this._inserthtmlImpl("\x3chr\x3e"):this.document.execCommand("inserthorizontalrule",!1,a)},_unlinkImpl:function(a){return this.queryCommandEnabled("unlink")&&(p("mozilla")||p("webkit"))?(a=this.selection.getAncestorElement("a"),this.selection.selectElement(a),this.document.execCommand("unlink",!1,null)):this.document.execCommand("unlink",
!1,a)},_hilitecolorImpl:function(a){var b;this._handleTextColorOrProperties("hilitecolor",a)||(p("mozilla")?(this.document.execCommand("styleWithCSS",!1,!0),console.log("Executing color command."),b=this.document.execCommand("hilitecolor",!1,a),this.document.execCommand("styleWithCSS",!1,!1)):b=this.document.execCommand("hilitecolor",!1,a));return b},_backcolorImpl:function(a){p("ie")&&(a=a?a:null);var b=this._handleTextColorOrProperties("backcolor",a);b||(b=this.document.execCommand("backcolor",
!1,a));return b},_forecolorImpl:function(a){p("ie")&&(a=a?a:null);var b=!1;(b=this._handleTextColorOrProperties("forecolor",a))||(b=this.document.execCommand("forecolor",!1,a));return b},_inserthtmlImpl:function(a){a=this._preFilterContent(a);var b=!0;if(9>p("ie")){var d=this.document.selection.createRange();if("CONTROL"===this.document.selection.type.toUpperCase()){for(var e=d.item(0);d.length;)d.remove(d.item(0));e.outerHTML=a}else d.pasteHTML(a);d.select()}else if(8>p("trident")){var g=C.getSelection(this.window);
if(g&&g.rangeCount&&g.getRangeAt){d=g.getRangeAt(0);d.deleteContents();var f=c.create("div");f.innerHTML=a;for(var h,e=this.document.createDocumentFragment();a=f.firstChild;)h=e.appendChild(a);d.insertNode(e);h&&(d=d.cloneRange(),d.setStartAfter(h),d.collapse(!1),g.removeAllRanges(),g.addRange(d))}}else p("mozilla")&&!a.length?this.selection.remove():b=this.document.execCommand("inserthtml",!1,a);return b},_boldImpl:function(a){var b=!1;if(p("ie")||p("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("bold");
b||(b=this.document.execCommand("bold",!1,a));return b},_italicImpl:function(a){var b=!1;if(p("ie")||p("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("italic");b||(b=this.document.execCommand("italic",!1,a));return b},_underlineImpl:function(a){var b=!1;if(p("ie")||p("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("underline");b||(b=this.document.execCommand("underline",!1,a));return b},_strikethroughImpl:function(a){var b=!1;if(p("ie")||p("trident"))this._adaptIESelection(),
b=this._adaptIEFormatAreaAndExec("strikethrough");b||(b=this.document.execCommand("strikethrough",!1,a));return b},_superscriptImpl:function(a){var b=!1;if(p("ie")||p("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("superscript");b||(b=this.document.execCommand("superscript",!1,a));return b},_subscriptImpl:function(a){var b=!1;if(p("ie")||p("trident"))this._adaptIESelection(),b=this._adaptIEFormatAreaAndExec("subscript");b||(b=this.document.execCommand("subscript",!1,a));return b},
_fontnameImpl:function(a){var b;if(p("ie")||p("trident"))b=this._handleTextColorOrProperties("fontname",a);b||(b=this.document.execCommand("fontname",!1,a));return b},_fontsizeImpl:function(a){var b;if(p("ie")||p("trident"))b=this._handleTextColorOrProperties("fontsize",a);b||(b=this.document.execCommand("fontsize",!1,a));return b},_insertorderedlistImpl:function(a){var b=!1;if(p("ie")||p("trident")||p("edge"))b=this._adaptIEList("insertorderedlist",a);b||(b=this.document.execCommand("insertorderedlist",
!1,a));return b},_insertunorderedlistImpl:function(a){var b=!1;if(p("ie")||p("trident")||p("edge"))b=this._adaptIEList("insertunorderedlist",a);b||(b=this.document.execCommand("insertunorderedlist",!1,a));return b},getHeaderHeight:function(){return this._getNodeChildrenHeight(this.header)},getFooterHeight:function(){return this._getNodeChildrenHeight(this.footer)},_getNodeChildrenHeight:function(a){var b=0;if(a&&a.childNodes){var d;for(d=0;d<a.childNodes.length;d++)var c=h.position(a.childNodes[d]),
b=b+c.h}return b},_isNodeEmpty:function(a,b){return 1===a.nodeType?0<a.childNodes.length?this._isNodeEmpty(a.childNodes[0],b):!0:3===a.nodeType?""===a.nodeValue.substring(b):!1},_removeStartingRangeFromRange:function(a,b){if(a.nextSibling)b.setStart(a.nextSibling,0);else{for(var d=a.parentNode;d&&null==d.nextSibling;)d=d.parentNode;d&&b.setStart(d.nextSibling,0)}return b},_adaptIESelection:function(){var a=C.getSelection(this.window);if(a&&a.rangeCount&&!a.isCollapsed){for(var b=a.getRangeAt(0),d=
b.startContainer,c=b.startOffset;3===d.nodeType&&c>=d.length&&d.nextSibling;)c-=d.length,d=d.nextSibling;for(var e=null;this._isNodeEmpty(d,c)&&d!==e;)e=d,b=this._removeStartingRangeFromRange(d,b),d=b.startContainer,c=0;a.removeAllRanges();a.addRange(b)}},_adaptIEFormatAreaAndExec:function(a){var b=C.getSelection(this.window),d=this.document,e,g,f,h,k,p,r;if(a&&b&&b.isCollapsed){if(this.queryCommandValue(a)){a=this._tagNamesForCommand(a);f=b.getRangeAt(0);h=f.startContainer;3===h.nodeType&&(g=f.endOffset,
h.length<g&&(g=this._adjustNodeAndOffset(e,g),h=g.node,g=g.offset));for(;h&&h!==this.editNode;){e=h.tagName?h.tagName.toLowerCase():"";if(-1<q.indexOf(a,e)){r=h;break}h=h.parentNode}if(r&&(e=f.startContainer,a=d.createElement(r.tagName),c.place(a,r,"after"),e&&3===e.nodeType)){g=f.endOffset;e.length<g&&(g=this._adjustNodeAndOffset(e,g),e=g.node,g=g.offset);h=e.nodeValue;f=d.createTextNode(h.substring(0,g));var t=h.substring(g,h.length);t&&(k=d.createTextNode(t));c.place(f,e,"before");k&&(p=d.createElement("span"),
p.className="ieFormatBreakerSpan",c.place(p,e,"after"),c.place(k,p,"after"),k=p);c.destroy(e);g=f.parentNode;for(e=[];g!==r;){h=g.tagName;f={tagName:h};e.push(f);h=d.createElement(h);g.style&&h.style&&g.style.cssText&&(h.style.cssText=g.style.cssText,f.cssText=g.style.cssText);"FONT"===g.tagName&&(g.color&&(h.color=g.color,f.color=g.color),g.face&&(h.face=g.face,f.face=g.face),g.size&&(h.size=g.size,f.size=g.size));g.className&&(h.className=g.className,f.className=g.className);if(k)for(;k;)f=k.nextSibling,
h.appendChild(k),k=f;h.tagName==g.tagName?(p=d.createElement("span"),p.className="ieFormatBreakerSpan",c.place(p,g,"after"),c.place(h,p,"after")):c.place(h,g,"after");f=g;k=h;g=g.parentNode}if(k){if(1===k.nodeType||3===k.nodeType&&k.nodeValue)a.innerHTML="";for(;k;)f=k.nextSibling,a.appendChild(k),k=f}if(e.length){f=e.pop();k=d.createElement(f.tagName);f.cssText&&k.style&&(k.style.cssText=f.cssText);f.className&&(k.className=f.className);"FONT"===f.tagName&&(f.color&&(k.color=f.color),f.face&&(k.face=
f.face),f.size&&(k.size=f.size));for(c.place(k,a,"before");e.length;)f=e.pop(),r=d.createElement(f.tagName),f.cssText&&r.style&&(r.style.cssText=f.cssText),f.className&&(r.className=f.className),"FONT"===f.tagName&&(f.color&&(r.color=f.color),f.face&&(r.face=f.face),f.size&&(r.size=f.size)),k.appendChild(r),k=r;r=d.createTextNode(".");p.appendChild(r);k.appendChild(r)}else p=d.createElement("span"),p.className="ieFormatBreakerSpan",r=d.createTextNode("."),p.appendChild(r),c.place(p,a,"before");k=
C.create(this.window);k.setStart(r,0);k.setEnd(r,r.length);b.removeAllRanges();b.addRange(k);this.selection.collapse(!1);r.parentNode.innerHTML="";a.firstChild||c.destroy(a);return!0}return!1}f=b.getRangeAt(0);if((e=f.startContainer)&&3===e.nodeType)return g=f.startOffset,e.length<g&&(g=this._adjustNodeAndOffset(e,g),e=g.node,g=g.offset),h=e.nodeValue,f=d.createTextNode(h.substring(0,g)),t=h.substring(g),""!==t&&(k=d.createTextNode(h.substring(g))),p=d.createElement("span"),r=d.createTextNode("."),
p.appendChild(r),f.length?c.place(f,e,"after"):f=e,c.place(p,f,"after"),k&&c.place(k,p,"after"),c.destroy(e),k=C.create(this.window),k.setStart(r,0),k.setEnd(r,r.length),b.removeAllRanges(),b.addRange(k),d.execCommand(a),c.place(p.firstChild,p,"before"),c.destroy(p),k.setStart(r,0),k.setEnd(r,r.length),b.removeAllRanges(),b.addRange(k),this.selection.collapse(!1),r.parentNode.innerHTML="",!0}else return!1},_adaptIEList:function(a){var b=C.getSelection(this.window);if(b.isCollapsed&&b.rangeCount&&
!this.queryCommandValue(a)){var d=b.getRangeAt(0),e=d.startContainer;if(e&&3==e.nodeType&&!d.startOffset)return d="ul","insertorderedlist"===a&&(d="ol"),a=this.document.createElement(d),d=c.create("li",null,a),c.place(a,e,"before"),d.appendChild(e),c.create("br",null,a,"after"),a=C.create(this.window),a.setStart(e,0),a.setEnd(e,e.length),b.removeAllRanges(),b.addRange(a),this.selection.collapse(!0),!0}return!1},_handleTextColorOrProperties:function(a,d){var e=C.getSelection(this.window),g=this.document,
f,h,k,r,t;d=d||null;if(a&&e&&e.isCollapsed&&e.rangeCount&&(h=e.getRangeAt(0),(f=h.startContainer)&&3===f.nodeType)){t=h.startOffset;f.length<t&&(h=this._adjustNodeAndOffset(f,t),f=h.node,t=h.offset);k=f.nodeValue;h=g.createTextNode(k.substring(0,t));""!==k.substring(t)&&(r=g.createTextNode(k.substring(t)));k=g.createElement("span");t=g.createTextNode(".");k.appendChild(t);g=g.createElement("span");k.appendChild(g);h.length?c.place(h,f,"after"):h=f;c.place(k,h,"after");r&&c.place(r,k,"after");c.destroy(f);
f=C.create(this.window);f.setStart(t,0);f.setEnd(t,t.length);e.removeAllRanges();e.addRange(f);if(p("webkit")){e="color";if("hilitecolor"===a||"backcolor"===a)e="backgroundColor";b.set(k,e,d);this.selection.remove();c.destroy(g);k.innerHTML="\x26#160;";this.selection.selectElement(k);this.focus()}else this.execCommand(a,d),c.place(k.firstChild,k,"before"),c.destroy(k),f.setStart(t,0),f.setEnd(t,t.length),e.removeAllRanges(),e.addRange(f),this.selection.collapse(!1),t.parentNode.removeChild(t);return!0}return!1},
_adjustNodeAndOffset:function(a,b){for(;a.length<b&&a.nextSibling&&3===a.nextSibling.nodeType;)b-=a.length,a=a.nextSibling;return{node:a,offset:b}},_tagNamesForCommand:function(a){return"bold"===a?["b","strong"]:"italic"===a?["i","em"]:"strikethrough"===a?["s","strike"]:"superscript"===a?["sup"]:"subscript"===a?["sub"]:"underline"===a?["u"]:[]},_stripBreakerNodes:function(a){if(this.isLoaded)return g(".ieFormatBreakerSpan",a).forEach(function(a){for(;a.firstChild;)c.place(a.firstChild,a,"before");
c.destroy(a)}),a},_stripTrailingEmptyNodes:function(a){function b(a){return/^(p|div|br)$/i.test(a.nodeName)&&0==a.children.length&&/^[\s\xA0]*$/.test(a.textContent||a.innerText||"")||3===a.nodeType&&/^[\s\xA0]*$/.test(a.nodeValue)}for(;a.lastChild&&b(a.lastChild);)c.destroy(a.lastChild);return a},_setTextDirAttr:function(a){this._set("textDir",a);this.onLoadDeferred.then(t.hitch(this,function(){this.editNode.dir=a}))}});return I})},"dijit/selection":function(){define("dojo/_base/array dojo/dom dojo/_base/lang dojo/sniff dojo/_base/window dijit/focus".split(" "),
function(q,m,n,l,f,e){var k=function(c){var b=c.document;this.getType=function(){if(b.getSelection){var a="text",d;try{d=c.getSelection()}catch(t){}d&&1==d.rangeCount&&(d=d.getRangeAt(0),d.startContainer==d.endContainer&&1==d.endOffset-d.startOffset&&3!=d.startContainer.nodeType&&(a="control"));return a}return b.selection.type.toLowerCase()};this.getSelectedText=function(){if(b.getSelection){var a=c.getSelection();return a?a.toString():""}return"control"==this.getType()?null:b.selection.createRange().text};
this.getSelectedHtml=function(){if(b.getSelection){var a=c.getSelection();if(a&&a.rangeCount){var d,e="";for(d=0;d<a.rangeCount;d++){var f=a.getRangeAt(d).cloneContents(),g=b.createElement("div");g.appendChild(f);e+=g.innerHTML}return e}return null}return"control"==this.getType()?null:b.selection.createRange().htmlText};this.getSelectedElement=function(){if("control"==this.getType()){if(b.getSelection){var a=c.getSelection();return a.anchorNode.childNodes[a.anchorOffset]}if((a=b.selection.createRange())&&
a.item)return b.selection.createRange().item(0)}return null};this.getParentElement=function(){if("control"==this.getType()){var a=this.getSelectedElement();if(a)return a.parentNode}else if(b.getSelection){if(a=b.getSelection()){for(a=a.anchorNode;a&&1!=a.nodeType;)a=a.parentNode;return a}}else return a=b.selection.createRange(),a.collapse(!0),a.parentElement();return null};this.hasAncestorElement=function(a){return null!=this.getAncestorElement.apply(this,arguments)};this.getAncestorElement=function(a){var b=
this.getSelectedElement()||this.getParentElement();return this.getParentOfType(b,arguments)};this.isTag=function(a,b){if(a&&a.tagName)for(var d=a.tagName.toLowerCase(),c=0;c<b.length;c++){var e=String(b[c]).toLowerCase();if(d==e)return e}return""};this.getParentOfType=function(a,b){for(;a;){if(this.isTag(a,b).length)return a;a=a.parentNode}return null};this.collapse=function(a){if(b.getSelection){var d=c.getSelection();d.removeAllRanges?a?d.collapseToStart():d.collapseToEnd():d.collapse(a)}else d=
b.selection.createRange(),d.collapse(a),d.select()};this.remove=function(){var a=b.selection;b.getSelection?(a=c.getSelection(),a.deleteFromDocument()):"none"!=a.type.toLowerCase()&&a.clear();return a};this.selectElementChildren=function(a,d){var e;a=m.byId(a);if(b.getSelection){var f=c.getSelection();l("opera")?(e=f.rangeCount?f.getRangeAt(0):b.createRange(),e.setStart(a,0),e.setEnd(a,3==a.nodeType?a.length:a.childNodes.length),f.addRange(e)):f.selectAllChildren(a)}else if(e=a.ownerDocument.body.createTextRange(),
e.moveToElementText(a),!d)try{e.select()}catch(g){}};this.selectElement=function(a,d){var c;a=m.byId(a);if(b.getSelection){var e=b.getSelection();c=b.createRange();e.removeAllRanges&&(l("opera")&&e.getRangeAt(0)&&(c=e.getRangeAt(0)),c.selectNode(a),e.removeAllRanges(),e.addRange(c))}else try{e=a.tagName?a.tagName.toLowerCase():"",c="img"===e||"table"===e?f.body(b).createControlRange():f.body(b).createRange(),c.addElement(a),d||c.select()}catch(g){this.selectElementChildren(a,d)}};this.inSelection=
function(a){if(a){var d,e;if(b.getSelection){var f=c.getSelection();f&&0<f.rangeCount&&(e=f.getRangeAt(0));if(e&&e.compareBoundaryPoints&&b.createRange)try{if(d=b.createRange(),d.setStart(a,0),1===e.compareBoundaryPoints(e.START_TO_END,d))return!0}catch(g){}}else{e=b.selection.createRange();try{d=a.ownerDocument.body.createTextRange(),d.moveToElementText(a)}catch(g){}if(e&&d&&1===e.compareEndPoints("EndToStart",d))return!0}}return!1};this.getBookmark=function(){var a,d,f=b.selection,h=e.curNode;if(b.getSelection){if(f=
c.getSelection())if(f.isCollapsed){if(a=h?h.tagName:"")if(a=a.toLowerCase(),"textarea"==a||"input"==a&&(!h.type||"text"==h.type.toLowerCase()))return f={start:h.selectionStart,end:h.selectionEnd,node:h,pRange:!0},{isCollapsed:f.end<=f.start,mark:f};a={isCollapsed:!0};f.rangeCount&&(a.mark=f.getRangeAt(0).cloneRange())}else d=f.getRangeAt(0),a={isCollapsed:!1,mark:d.cloneRange()}}else if(f){a=h?h.tagName:"";a=a.toLowerCase();if(h&&a&&("button"==a||"textarea"==a||"input"==a)){if(f.type&&"none"==f.type.toLowerCase())return{isCollapsed:!0,
mark:null};d=f.createRange();return{isCollapsed:d.text&&d.text.length?!1:!0,mark:{range:d,pRange:!0}}}a={};try{d=f.createRange(),a.isCollapsed=!("Text"==f.type?d.htmlText.length:d.length)}catch(g){return a.isCollapsed=!0,a}if("CONTROL"==f.type.toUpperCase())if(d.length)for(a.mark=[],f=0,h=d.length;f<h;)a.mark.push(d.item(f++));else a.isCollapsed=!0,a.mark=null;else a.mark=d.getBookmark()}else console.warn("No idea how to store the current selection for this browser!");return a};this.moveToBookmark=
function(a){if(a=a.mark)if(b.getSelection){var d=c.getSelection();d&&d.removeAllRanges?a.pRange?(d=a.node,d.selectionStart=a.start,d.selectionEnd=a.end):(d.removeAllRanges(),d.addRange(a)):console.warn("No idea how to restore selection for this browser!")}else if(b.selection&&a){var e;a.pRange?e=a.range:n.isArray(a)?(e=b.body.createControlRange(),q.forEach(a,function(a){e.addElement(a)})):(e=b.body.createTextRange(),e.moveToBookmark(a));e.select()}};this.isCollapsed=function(){return this.getBookmark().isCollapsed}},
c=new k(window);c.SelectionManager=k;return c})},"dijit/_editor/range":function(){define(["dojo/_base/array","dojo/_base/declare","dojo/_base/lang"],function(q,m,n){var l={getIndex:function(e,c){for(var f=[],b=[],a=e,d,k;e!=c;){var l=0;for(d=e.parentNode;k=d.childNodes[l++];)if(k===e){--l;break}f.unshift(l);b.unshift(l-d.childNodes.length);e=d}if(0<f.length&&3==a.nodeType){for(k=a.previousSibling;k&&3==k.nodeType;)f[f.length-1]--,k=k.previousSibling;for(k=a.nextSibling;k&&3==k.nodeType;)b[b.length-
1]++,k=k.nextSibling}return{o:f,r:b}},getNode:function(e,c){if(!n.isArray(e)||0==e.length)return c;var f=c;q.every(e,function(b){if(0<=b&&b<f.childNodes.length)f=f.childNodes[b];else return f=null,!1;return!0});return f},getCommonAncestor:function(e,c,f){f=f||e.ownerDocument.body;var b=function(a){for(var b=[];a;)if(b.unshift(a),a!==f)a=a.parentNode;else break;return b};e=b(e);c=b(c);for(var b=Math.min(e.length,c.length),a=e[0],d=1;d<b;d++)if(e[d]===c[d])a=e[d];else break;return a},getAncestor:function(e,
c,f){for(f=f||e.ownerDocument.body;e&&e!==f;){var b=e.nodeName.toUpperCase();if(c.test(b))return e;e=e.parentNode}return null},BlockTagNames:/^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DT|DE)$/,getBlockAncestor:function(e,c,f){f=f||e.ownerDocument.body;c=c||l.BlockTagNames;for(var b=null,a;e&&e!==f;){var d=e.nodeName.toUpperCase();!b&&c.test(d)&&(b=e);!a&&/^(?:BODY|TD|TH|CAPTION)$/.test(d)&&(a=e);e=e.parentNode}return{blockNode:b,blockContainer:a||e.ownerDocument.body}},atBeginningOfContainer:function(e,
c,f){var b=!1,a=0==f;a||3!=c.nodeType||/^[\s\xA0]+$/.test(c.nodeValue.substr(0,f))&&(a=!0);if(a)for(b=!0;c&&c!==e;){if(c.previousSibling){b=!1;break}c=c.parentNode}return b},atEndOfContainer:function(e,c,f){var b=!1,a=f==(c.length||c.childNodes.length);a||3!=c.nodeType||/^[\s\xA0]+$/.test(c.nodeValue.substr(f))&&(a=!0);if(a)for(b=!0;c&&c!==e;){if(c.nextSibling){b=!1;break}c=c.parentNode}return b},adjacentNoneTextNode:function(e,c){for(var f=e,b=0-e.length||0,a=c?"nextSibling":"previousSibling";f&&
3==f.nodeType;)b+=f.length,f=f[a];return[f,b]},create:function(f){f=f||window;return f.getSelection?f.document.createRange():new e},getSelection:function(e,c){if(e.getSelection)return e.getSelection();var h=new f.selection(e);c||h._getCurrentSelection();return h}};if(!window.getSelection)var f=l.ie={cachedSelection:{},selection:function(k){this._ranges=[];this.addRange=function(c,e){this._ranges.push(c);e||c._select();this.rangeCount=this._ranges.length};this.removeAllRanges=function(){this._ranges=
[];this.rangeCount=0};this.getRangeAt=function(c){return this._ranges[c]};this._getCurrentSelection=function(){this.removeAllRanges();var c;c=k.document.selection.createRange();c="CONTROL"==k.document.selection.type.toUpperCase()?new e(f.decomposeControlRange(c)):new e(f.decomposeTextRange(c));this.addRange(c,!0),this.isCollapsed=c.collapsed}},decomposeControlRange:function(e){var c=e.item(0),f=e.item(e.length-1);e=c.parentNode;var b=f.parentNode,c=l.getIndex(c,e).o[0],f=l.getIndex(f,b).o[0]+1;return[e,
c,b,f]},getEndPoint:function(e,c){var f=e.duplicate();f.collapse(!c);var b="EndTo"+(c?"End":"Start"),a=f.parentElement(),d,k,m;0<a.childNodes.length?q.every(a.childNodes,function(c,g){var h;if(3!=c.nodeType)if(f.moveToElementText(c),0<f.compareEndPoints(b,e))if(m&&3==m.nodeType)d=m,h=!0;else return d=a,k=g,!1;else{if(g==a.childNodes.length-1)return d=a,k=a.childNodes.length,!1}else g==a.childNodes.length-1&&(d=c,h=!0);if(h&&d){d=(h=l.adjacentNoneTextNode(d)[0])?h.nextSibling:a.firstChild;var p=l.adjacentNoneTextNode(d);
h=p[0];p=p[1];h?(f.moveToElementText(h),f.collapse(!1)):f.moveToElementText(a);f.setEndPoint(b,e);k=f.text.length-p;return!1}m=c;return!0}):(d=a,k=0);if(!c&&1==d.nodeType&&k==d.childNodes.length){var g=d.nextSibling;g&&3==g.nodeType&&(d=g,k=0)}return[d,k]},setEndPoint:function(e,c,f){e=e.duplicate();var b;if(3!=c.nodeType)if(0<f){if(b=c.childNodes[f-1])if(3==b.nodeType)c=b,f=b.length;else if(b.nextSibling&&3==b.nextSibling.nodeType)c=b.nextSibling,f=0;else{e.moveToElementText(b.nextSibling?b:c);var a=
b.parentNode;b=a.insertBefore(b.ownerDocument.createTextNode(" "),b.nextSibling);e.collapse(!1);a.removeChild(b)}}else e.moveToElementText(c),e.collapse(!0);3==c.nodeType&&(b=l.adjacentNoneTextNode(c),a=b[0],b=b[1],a?(e.moveToElementText(a),e.collapse(!1),"inherit"!=a.contentEditable&&b++):(e.moveToElementText(c.parentNode),e.collapse(!0),e.move("character",1),e.move("character",-1)),f+=b,0<f&&e.move("character",f)!=f&&console.error("Error when moving!"));return e},decomposeTextRange:function(e){var c=
f.getEndPoint(e),h=c[0],b=c[1],a=c[0],c=c[1];e.htmlText.length&&(e.htmlText==e.text?c=b+e.text.length:(c=f.getEndPoint(e,!0),a=c[0],c=c[1]));return[h,b,a,c]},setRange:function(e,c,h,b,a,d){c=f.setEndPoint(e,c,h);e.setEndPoint("StartToStart",c);if(!d)var k=f.setEndPoint(e,b,a);e.setEndPoint("EndToEnd",k||c);return e}},e=l.W3CRange=m(null,{constructor:function(){0<arguments.length?(this.setStart(arguments[0][0],arguments[0][1]),this.setEnd(arguments[0][2],arguments[0][3])):(this.startContainer=this.commonAncestorContainer=
null,this.startOffset=0,this.endContainer=null,this.endOffset=0,this.collapsed=!0)},_updateInternal:function(){this.commonAncestorContainer=this.startContainer!==this.endContainer?l.getCommonAncestor(this.startContainer,this.endContainer):this.startContainer;this.collapsed=this.startContainer===this.endContainer&&this.startOffset==this.endOffset},setStart:function(e,c){c=parseInt(c);if(this.startContainer!==e||this.startOffset!=c)delete this._cachedBookmark,this.startContainer=e,this.startOffset=
c,this.endContainer?this._updateInternal():this.setEnd(e,c)},setEnd:function(e,c){c=parseInt(c);if(this.endContainer!==e||this.endOffset!=c)delete this._cachedBookmark,this.endContainer=e,this.endOffset=c,this.startContainer?this._updateInternal():this.setStart(e,c)},setStartAfter:function(e,c){this._setPoint("setStart",e,c,1)},setStartBefore:function(e,c){this._setPoint("setStart",e,c,0)},setEndAfter:function(e,c){this._setPoint("setEnd",e,c,1)},setEndBefore:function(e,c){this._setPoint("setEnd",
e,c,0)},_setPoint:function(e,c,f,b){f=l.getIndex(c,c.parentNode).o;this[e](c.parentNode,f.pop()+b)},_getIERange:function(){var e=(this._body||this.endContainer.ownerDocument.body).createTextRange();f.setRange(e,this.startContainer,this.startOffset,this.endContainer,this.endOffset,this.collapsed);return e},getBookmark:function(){this._getIERange();return this._cachedBookmark},_select:function(){this._getIERange().select()},deleteContents:function(){var e=this.startContainer,c=this._getIERange();3!==
e.nodeType||this.startOffset||this.setStartBefore(e);c.pasteHTML("");this.endContainer=this.startContainer;this.endOffset=this.startOffset;this.collapsed=!0},cloneRange:function(){var f=new e([this.startContainer,this.startOffset,this.endContainer,this.endOffset]);f._body=this._body;return f},detach:function(){this.startContainer=this.commonAncestorContainer=this._body=null;this.startOffset=0;this.endContainer=null;this.endOffset=0;this.collapsed=!0}});n.setObject("dijit.range",l);return l})},"dijit/_editor/html":function(){define(["dojo/_base/array",
"dojo/_base/lang","dojo/sniff"],function(q,m,n){var l={};m.setObject("dijit._editor.html",l);var f=l.escapeXml=function(e,f){e=e.replace(/&/gm,"\x26amp;").replace(/</gm,"\x26lt;").replace(/>/gm,"\x26gt;").replace(/"/gm,"\x26quot;");f||(e=e.replace(/'/gm,"\x26#39;"));return e};l.getNodeHtml=function(e){var f=[];l.getNodeHtmlHelper(e,f);return f.join("")};l.getNodeHtmlHelper=function(e,k){switch(e.nodeType){case 1:var c=e.nodeName.toLowerCase();if(!c||"/"==c.charAt(0))return"";k.push("\x3c",c);var h=
[],b={},a;if(n("dom-attributes-explicit")||n("dom-attributes-specified-flag"))for(var d=0;a=e.attributes[d++];){var t=a.name;"_dj"===t.substr(0,3)||n("dom-attributes-specified-flag")&&!a.specified||t in b||(a=a.value,("src"==t||"href"==t)&&e.getAttribute("_djrealurl")&&(a=e.getAttribute("_djrealurl")),8===n("ie")&&"style"===t&&(a=a.replace("HEIGHT:","height:").replace("WIDTH:","width:")),h.push([t,a]),b[t]=a)}else{var m=(/^input$|^img$/i.test(e.nodeName)?e:e.cloneNode(!1)).outerHTML,b=m.match(/[\w-]+=("[^"]*"|'[^']*'|\S*)/gi),
m=m.substr(0,m.indexOf("\x3e"));q.forEach(b,function(a){if(a){var b=a.indexOf("\x3d");if(0<b&&(a=a.substring(0,b),"_dj"!=a.substr(0,3)))if("src"!=a&&"href"!=a||!e.getAttribute("_djrealurl")){var d;switch(a){case "style":d=e.style.cssText.toLowerCase();break;case "class":d=e.className;break;case "width":if("img"===c){(b=/width=(\S+)/i.exec(m))&&(d=b[1]);break}case "height":if("img"===c){(b=/height=(\S+)/i.exec(m))&&(d=b[1]);break}default:d=e.getAttribute(a)}null!=d&&h.push([a,d.toString()])}else h.push([a,
e.getAttribute("_djrealurl")])}},this)}h.sort(function(a,b){return a[0]<b[0]?-1:a[0]==b[0]?0:1});for(b=0;a=h[b++];)k.push(" ",a[0],'\x3d"',"string"===typeof a[1]?f(a[1],!0):a[1],'"');switch(c){case "br":case "hr":case "img":case "input":case "base":case "meta":case "area":case "basefont":k.push(" /\x3e");break;case "script":k.push("\x3e",e.innerHTML,"\x3c/",c,"\x3e");break;default:k.push("\x3e"),e.hasChildNodes()&&l.getChildrenHtmlHelper(e,k),k.push("\x3c/",c,"\x3e")}break;case 4:case 3:k.push(f(e.nodeValue,
!0));break;case 8:k.push("\x3c!--",f(e.nodeValue,!0),"--\x3e");break;default:k.push("\x3c!-- Element not recognized - Type: ",e.nodeType," Name: ",e.nodeName,"--\x3e")}};l.getChildrenHtml=function(e){var f=[];l.getChildrenHtmlHelper(e,f);return f.join("")};l.getChildrenHtmlHelper=function(e,f){if(e)for(var c=e.childNodes||e,h=!n("ie")||c!==e,b,a=0;b=c[a++];)h&&b.parentNode!=e||l.getNodeHtmlHelper(b,f)};return l})},"dijit/_editor/plugins/LinkDialog":function(){define("require dojo/_base/declare dojo/dom-attr dojo/keys dojo/_base/lang dojo/on dojo/sniff dojo/query dojo/string ../_Plugin ../../form/DropDownButton ../range".split(" "),
function(q,m,n,l,f,e,k,c,h,b,a,d){var t=m("dijit._editor.plugins.LinkDialog",b,{buttonClass:a,useDefaultCommand:!1,urlRegExp:"((https?|ftps?|file)\\://|./|../|/|)(/[a-zA-Z]{1,1}:/|)(((?:(?:[\\da-zA-Z](?:[-\\da-zA-Z]{0,61}[\\da-zA-Z])?)\\.)*(?:[a-zA-Z](?:[-\\da-zA-Z]{0,80}[\\da-zA-Z])?)\\.?)|(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])|(0[xX]0*[\\da-fA-F]?[\\da-fA-F]\\.){3}0[xX]0*[\\da-fA-F]?[\\da-fA-F]|(0+[0-3][0-7][0-7]\\.){3}0+[0-3][0-7][0-7]|(0|[1-9]\\d{0,8}|[1-3]\\d{9}|4[01]\\d{8}|42[0-8]\\d{7}|429[0-3]\\d{6}|4294[0-8]\\d{5}|42949[0-5]\\d{4}|429496[0-6]\\d{3}|4294967[01]\\d{2}|42949672[0-8]\\d|429496729[0-5])|0[xX]0*[\\da-fA-F]{1,8}|([\\da-fA-F]{1,4}\\:){7}[\\da-fA-F]{1,4}|([\\da-fA-F]{1,4}\\:){6}((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])))(\\:\\d+)?(/(?:[^?#\\s/]+/)*(?:[^?#\\s/]{0,}(?:\\?[^?#\\s/]*)?(?:#.*)?)?)?",
emailRegExp:"\x3c?(mailto\\:)([!#-'*+\\-\\/-9\x3d?A-Z^-~]+[.])*[!#-'*+\\-\\/-9\x3d?A-Z^-~]+@((?:(?:[\\da-zA-Z](?:[-\\da-zA-Z]{0,61}[\\da-zA-Z])?)\\.)+(?:[a-zA-Z](?:[-\\da-zA-Z]{0,6}[\\da-zA-Z])?)\\.?)|localhost|^[^-][a-zA-Z0-9_-]*\x3e?",htmlTemplate:'\x3ca href\x3d"${urlInput}" _djrealurl\x3d"${urlInput}" target\x3d"${targetSelect}"\x3e${textInput}\x3c/a\x3e',tag:"a",_hostRxp:/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/,_userAtRxp:/^([!#-'*+\-\/-9=?A-Z^-~]+[.])*[!#-'*+\-\/-9=?A-Z^-~]+@/i,
linkDialogTemplate:"\x3ctable role\x3d'presentation'\x3e\x3ctr\x3e\x3ctd\x3e\x3clabel for\x3d'${id}_urlInput'\x3e${url}\x3c/label\x3e\x3c/td\x3e\x3ctd\x3e\x3cinput data-dojo-type\x3d'dijit.form.ValidationTextBox' required\x3d'true' id\x3d'${id}_urlInput' name\x3d'urlInput' data-dojo-props\x3d'intermediateChanges:true'/\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x3clabel for\x3d'${id}_textInput'\x3e${text}\x3c/label\x3e\x3c/td\x3e\x3ctd\x3e\x3cinput data-dojo-type\x3d'dijit.form.ValidationTextBox' required\x3d'true' id\x3d'${id}_textInput' name\x3d'textInput' data-dojo-props\x3d'intermediateChanges:true'/\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x3clabel for\x3d'${id}_targetSelect'\x3e${target}\x3c/label\x3e\x3c/td\x3e\x3ctd\x3e\x3cselect id\x3d'${id}_targetSelect' name\x3d'targetSelect' data-dojo-type\x3d'dijit.form.Select'\x3e\x3coption selected\x3d'selected' value\x3d'_self'\x3e${currentWindow}\x3c/option\x3e\x3coption value\x3d'_blank'\x3e${newWindow}\x3c/option\x3e\x3coption value\x3d'_top'\x3e${topWindow}\x3c/option\x3e\x3coption value\x3d'_parent'\x3e${parentWindow}\x3c/option\x3e\x3c/select\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d'2'\x3e\x3cbutton data-dojo-type\x3d'dijit.form.Button' type\x3d'submit' id\x3d'${id}_setButton'\x3e${set}\x3c/button\x3e\x3cbutton data-dojo-type\x3d'dijit.form.Button' type\x3d'button' id\x3d'${id}_cancelButton'\x3e${buttonCancel}\x3c/button\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e",
_initButton:function(){this.inherited(arguments);this.button.loadDropDown=f.hitch(this,"_loadDropDown");this._connectTagEvents()},_loadDropDown:function(a){q("dojo/i18n ../../TooltipDialog ../../registry ../../form/Button ../../form/Select ../../form/ValidationTextBox dojo/i18n!../../nls/common dojo/i18n!../nls/LinkDialog".split(" "),f.hitch(this,function(b,d,c){var g=this;this.tag="insertImage"==this.command?"img":"a";b=f.delegate(b.getLocalization("dijit","common",this.lang),b.getLocalization("dijit._editor",
"LinkDialog",this.lang));var k=this.dropDown=this.button.dropDown=new d({title:b[this.command+"Title"],ownerDocument:this.editor.ownerDocument,dir:this.editor.dir,execute:f.hitch(this,"setValue"),onOpen:function(){g._onOpenDialog();d.prototype.onOpen.apply(this,arguments)},onCancel:function(){setTimeout(f.hitch(g,"_onCloseDialog"),0)}});b.urlRegExp=this.urlRegExp;b.id=c.getUniqueId(this.editor.id);this._uniqueId=b.id;this._setContent(k.title+"\x3cdiv style\x3d'border-bottom: 1px black solid;padding-bottom:2pt;margin-bottom:4pt'\x3e\x3c/div\x3e"+
h.substitute(this.linkDialogTemplate,b));k.startup();this._urlInput=c.byId(this._uniqueId+"_urlInput");this._textInput=c.byId(this._uniqueId+"_textInput");this._setButton=c.byId(this._uniqueId+"_setButton");this.own(c.byId(this._uniqueId+"_cancelButton").on("click",f.hitch(this.dropDown,"onCancel")));this._urlInput&&this.own(this._urlInput.on("change",f.hitch(this,"_checkAndFixInput")));this._textInput&&this.own(this._textInput.on("change",f.hitch(this,"_checkAndFixInput")));this._urlRegExp=new RegExp("^"+
this.urlRegExp+"$","i");this._emailRegExp=new RegExp("^"+this.emailRegExp+"$","i");this._urlInput.isValid=f.hitch(this,function(){var a=this._urlInput.get("value");return this._urlRegExp.test(a)||this._emailRegExp.test(a)});this.own(e(k.domNode,"keydown",f.hitch(this,f.hitch(this,function(a){!a||a.keyCode!=l.ENTER||a.shiftKey||a.metaKey||a.ctrlKey||a.altKey||this._setButton.get("disabled")||(k.onExecute(),k.execute(k.get("value")))}))));a()}))},_checkAndFixInput:function(){var a=this,b=this._urlInput.get("value");
this._delayedCheck&&(clearTimeout(this._delayedCheck),this._delayedCheck=null);this._delayedCheck=setTimeout(function(){var d=b,c=!1,e=!1;d&&1<d.length&&(d=f.trim(d),0!==d.indexOf("mailto:")&&(0<d.indexOf("/")?-1===d.indexOf("://")&&"/"!==d.charAt(0)&&d.indexOf("./")&&0!==d.indexOf("../")&&a._hostRxp.test(d)&&(c=!0):a._userAtRxp.test(d)&&(e=!0)));c&&a._urlInput.set("value","http://"+d);e&&a._urlInput.set("value","mailto:"+d);a._setButton.set("disabled",!a._isValid())},250)},_connectTagEvents:function(){this.editor.onLoadDeferred.then(f.hitch(this,
function(){this.own(e(this.editor.editNode,"dblclick",f.hitch(this,"_onDblClick")))}))},_isValid:function(){return this._urlInput.isValid()&&this._textInput.isValid()},_setContent:function(a){this.dropDown.set({parserScope:"dojo",content:a})},_checkValues:function(a){a&&a.urlInput&&(a.urlInput=a.urlInput.replace(/"/g,"\x26quot;"));return a},setValue:function(a){this._onCloseDialog();if(9>k("ie")){var b=d.getSelection(this.editor.window).getRangeAt(0).endContainer;3===b.nodeType&&(b=b.parentNode);
b&&b.nodeName&&b.nodeName.toLowerCase()!==this.tag&&(b=this.editor.selection.getSelectedElement(this.tag));b&&b.nodeName&&b.nodeName.toLowerCase()===this.tag&&this.editor.queryCommandEnabled("unlink")&&(this.editor.selection.selectElementChildren(b),this.editor.execCommand("unlink"))}a=this._checkValues(a);this.editor.execCommand("inserthtml",h.substitute(this.htmlTemplate,a));c("a",this.editor.document).forEach(function(a){a.innerHTML||n.has(a,"name")||a.parentNode.removeChild(a)},this)},_onCloseDialog:function(){this.editor.focused&&
this.editor.focus()},_getCurrentValues:function(a){var b,d,c;a&&a.tagName.toLowerCase()===this.tag?(b=a.getAttribute("_djrealurl")||a.getAttribute("href"),c=a.getAttribute("target")||"_self",d=a.textContent||a.innerText,this.editor.selection.selectElement(a,!0)):d=this.editor.selection.getSelectedText();return{urlInput:b||"",textInput:d||"",targetSelect:c||""}},_onOpenDialog:function(){var a,b;if(k("ie")){if(b=d.getSelection(this.editor.window),b.rangeCount){var c=b.getRangeAt(0);a=c.endContainer;
3===a.nodeType&&(a=a.parentNode);a&&a.nodeName&&a.nodeName.toLowerCase()!==this.tag&&(a=this.editor.selection.getSelectedElement(this.tag));if(!a||a.nodeName&&a.nodeName.toLowerCase()!==this.tag)(b=this.editor.selection.getAncestorElement(this.tag))&&b.nodeName&&b.nodeName.toLowerCase()==this.tag?(a=b,this.editor.selection.selectElement(a)):c.startContainer===c.endContainer&&(b=c.startContainer.firstChild)&&b.nodeName&&b.nodeName.toLowerCase()==this.tag&&(a=b,this.editor.selection.selectElement(a))}}else a=
this.editor.selection.getAncestorElement(this.tag);this.dropDown.reset();this._setButton.set("disabled",!0);this.dropDown.set("value",this._getCurrentValues(a))},_onDblClick:function(a){if(a&&a.target&&(a=a.target,(a.tagName?a.tagName.toLowerCase():"")===this.tag&&n.get(a,"href"))){var b=this.editor;this.editor.selection.selectElement(a);b.onDisplayChanged();b._updateTimer&&(b._updateTimer.remove(),delete b._updateTimer);b.onNormalizedDisplayChanged();var d=this.button;setTimeout(function(){d.set("disabled",
!1);d.loadAndOpenDropDown().then(function(){d.dropDown.focus&&d.dropDown.focus()})},10)}}}),v=m("dijit._editor.plugins.ImgLinkDialog",[t],{linkDialogTemplate:"\x3ctable role\x3d'presentation'\x3e\x3ctr\x3e\x3ctd\x3e\x3clabel for\x3d'${id}_urlInput'\x3e${url}\x3c/label\x3e\x3c/td\x3e\x3ctd\x3e\x3cinput dojoType\x3d'dijit.form.ValidationTextBox' regExp\x3d'${urlRegExp}' required\x3d'true' id\x3d'${id}_urlInput' name\x3d'urlInput' data-dojo-props\x3d'intermediateChanges:true'/\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x3clabel for\x3d'${id}_textInput'\x3e${text}\x3c/label\x3e\x3c/td\x3e\x3ctd\x3e\x3cinput data-dojo-type\x3d'dijit.form.ValidationTextBox' required\x3d'false' id\x3d'${id}_textInput' name\x3d'textInput' data-dojo-props\x3d'intermediateChanges:true'/\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd\x3e\x3c/td\x3e\x3ctd\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d'2'\x3e\x3cbutton data-dojo-type\x3d'dijit.form.Button' type\x3d'submit' id\x3d'${id}_setButton'\x3e${set}\x3c/button\x3e\x3cbutton data-dojo-type\x3d'dijit.form.Button' type\x3d'button' id\x3d'${id}_cancelButton'\x3e${buttonCancel}\x3c/button\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e",
htmlTemplate:'\x3cimg src\x3d"${urlInput}" _djrealurl\x3d"${urlInput}" alt\x3d"${textInput}" /\x3e',tag:"img",_getCurrentValues:function(a){var b,d;a&&a.tagName.toLowerCase()===this.tag?(b=a.getAttribute("_djrealurl")||a.getAttribute("src"),d=a.getAttribute("alt"),this.editor.selection.selectElement(a,!0)):d=this.editor.selection.getSelectedText();return{urlInput:b||"",textInput:d||""}},_isValid:function(){return this._urlInput.isValid()},_connectTagEvents:function(){this.inherited(arguments);this.editor.onLoadDeferred.then(f.hitch(this,
function(){this.own(e(this.editor.editNode,"mousedown",f.hitch(this,"_selectTag")))}))},_selectTag:function(a){a&&a.target&&(a=a.target,(a.tagName?a.tagName.toLowerCase():"")===this.tag&&this.editor.selection.selectElement(a))},_checkValues:function(a){a&&a.urlInput&&(a.urlInput=a.urlInput.replace(/"/g,"\x26quot;"));a&&a.textInput&&(a.textInput=a.textInput.replace(/"/g,"\x26quot;"));return a},_onDblClick:function(a){if(a&&a.target&&(a=a.target,(a.tagName?a.tagName.toLowerCase():"")===this.tag&&n.get(a,
"src"))){var b=this.editor;this.editor.selection.selectElement(a);b.onDisplayChanged();b._updateTimer&&(b._updateTimer.remove(),delete b._updateTimer);b.onNormalizedDisplayChanged();var d=this.button;setTimeout(function(){d.set("disabled",!1);d.loadAndOpenDropDown().then(function(){d.dropDown.focus&&d.dropDown.focus()})},10)}}});b.registry.createLink=function(){return new t({command:"createLink"})};b.registry.insertImage=function(){return new v({command:"insertImage"})};t.ImgLinkDialog=v;return t})},
"dijit/form/DropDownButton":function(){define("dojo/_base/declare dojo/_base/kernel dojo/_base/lang dojo/query ../registry ../popup ./Button ../_Container ../_HasDropDown dojo/text!./templates/DropDownButton.html ../a11yclick".split(" "),function(q,m,n,l,f,e,k,c,h,b){return q("dijit.form.DropDownButton",[k,c,h],{baseClass:"dijitDropDownButton",templateString:b,_fillContent:function(){var a=this.srcNodeRef,b=this.containerNode;if(a&&b)for(;a.hasChildNodes();){var c=a.firstChild;c.hasAttribute&&(c.hasAttribute("data-dojo-type")||
c.hasAttribute("dojoType")||c.hasAttribute("data-"+m._scopeName+"-type")||c.hasAttribute(m._scopeName+"Type"))?(this.dropDownContainer=this.ownerDocument.createElement("div"),this.dropDownContainer.appendChild(c)):b.appendChild(c)}},startup:function(){this._started||(!this.dropDown&&this.dropDownContainer&&(this.dropDown=f.byNode(this.dropDownContainer.firstChild),delete this.dropDownContainer),this.dropDown&&e.hide(this.dropDown),this.inherited(arguments))},isLoaded:function(){var a=this.dropDown;
return!!a&&(!a.href||a.isLoaded)},loadDropDown:function(a){var b=this.dropDown,c=b.on("load",n.hitch(this,function(){c.remove();a()}));b.refresh()},isFocusable:function(){return this.inherited(arguments)&&!this._mouseDown}})})},"dijit/_HasDropDown":function(){define("dojo/_base/declare dojo/_base/Deferred dojo/dom dojo/dom-attr dojo/dom-class dojo/dom-geometry dojo/dom-style dojo/has dojo/keys dojo/_base/lang dojo/on dojo/touch ./registry ./focus ./popup ./_FocusMixin".split(" "),function(q,m,n,l,
f,e,k,c,h,b,a,d,t,v,g,u){return q("dijit._HasDropDown",u,{_buttonNode:null,_arrowWrapperNode:null,_popupStateNode:null,_aroundNode:null,dropDown:null,autoWidth:!0,forceWidth:!1,maxHeight:-1,dropDownPosition:["below","above"],_stopClickEvents:!0,_onDropDownMouseDown:function(c){this.disabled||this.readOnly||("MSPointerDown"!=c.type&&c.preventDefault(),this.own(a.once(this.ownerDocument,d.release,b.hitch(this,"_onDropDownMouseUp"))),this.toggleDropDown())},_onDropDownMouseUp:function(a){var b=this.dropDown,
d=!1;if(a&&this._opened){var c=e.position(this._buttonNode,!0);if(!(a.pageX>=c.x&&a.pageX<=c.x+c.w&&a.pageY>=c.y&&a.pageY<=c.y+c.h)){for(c=a.target;c&&!d;)f.contains(c,"dijitPopup")?d=!0:c=c.parentNode;if(d){c=a.target;if(b.onItemClick){for(var g;c&&!(g=t.byNode(c));)c=c.parentNode;if(g&&g.onClick&&g.getParent)g.getParent().onItemClick(g,a)}return}}}this._opened?b.focus&&(!1!==b.autoFocus||"mouseup"==a.type&&!this.hovering)&&(this._focusDropDownTimer=this.defer(function(){b.focus();delete this._focusDropDownTimer})):
this.focus&&this.defer("focus")},_onDropDownClick:function(a){this._stopClickEvents&&(a.stopPropagation(),a.preventDefault())},buildRendering:function(){this.inherited(arguments);this._buttonNode=this._buttonNode||this.focusNode||this.domNode;this._popupStateNode=this._popupStateNode||this.focusNode||this._buttonNode;var a={after:this.isLeftToRight()?"Right":"Left",before:this.isLeftToRight()?"Left":"Right",above:"Up",below:"Down",left:"Left",right:"Right"}[this.dropDownPosition[0]]||this.dropDownPosition[0]||
"Down";f.add(this._arrowWrapperNode||this._buttonNode,"dijit"+a+"ArrowButton")},postCreate:function(){this.inherited(arguments);var c=this.focusNode||this.domNode;this.own(a(this._buttonNode,d.press,b.hitch(this,"_onDropDownMouseDown")),a(this._buttonNode,"click",b.hitch(this,"_onDropDownClick")),a(c,"keydown",b.hitch(this,"_onKey")),a(c,"keyup",b.hitch(this,"_onKeyUp")))},destroy:function(){this._opened&&this.closeDropDown(!0);this.dropDown&&(this.dropDown._destroyed||this.dropDown.destroyRecursive(),
delete this.dropDown);this.inherited(arguments)},_onKey:function(a){if(!this.disabled&&!this.readOnly){var b=this.dropDown,d=a.target;b&&this._opened&&b.handleKey&&!1===b.handleKey(a)?(a.stopPropagation(),a.preventDefault()):b&&this._opened&&a.keyCode==h.ESCAPE?(this.closeDropDown(),a.stopPropagation(),a.preventDefault()):!this._opened&&(a.keyCode==h.DOWN_ARROW||(a.keyCode==h.ENTER||a.keyCode==h.SPACE&&(!this._searchTimer||a.ctrlKey||a.altKey||a.metaKey))&&("input"!==(d.tagName||"").toLowerCase()||
d.type&&"text"!==d.type.toLowerCase()))&&(this._toggleOnKeyUp=!0,a.stopPropagation(),a.preventDefault())}},_onKeyUp:function(){if(this._toggleOnKeyUp){delete this._toggleOnKeyUp;this.toggleDropDown();var a=this.dropDown;a&&a.focus&&this.defer(b.hitch(a,"focus"),1)}},_onBlur:function(){this.closeDropDown(!1);this.inherited(arguments)},isLoaded:function(){return!0},loadDropDown:function(a){a()},loadAndOpenDropDown:function(){var a=new m,d=b.hitch(this,function(){this.openDropDown();a.resolve(this.dropDown)});
this.isLoaded()?d():this.loadDropDown(d);return a},toggleDropDown:function(){this.disabled||this.readOnly||(this._opened?this.closeDropDown(!0):this.loadAndOpenDropDown())},openDropDown:function(){var a=this.dropDown,d=a.domNode,c=this._aroundNode||this.domNode,h=this,k=g.open({parent:this,popup:a,around:c,orient:this.dropDownPosition,maxHeight:this.maxHeight,onExecute:function(){h.closeDropDown(!0)},onCancel:function(){h.closeDropDown(!0)},onClose:function(){l.set(h._popupStateNode,"popupActive",
!1);f.remove(h._popupStateNode,"dijitHasDropDownOpen");h._set("_opened",!1)}});if(this.forceWidth||this.autoWidth&&c.offsetWidth>a._popupWrapper.offsetWidth){var c=c.offsetWidth-a._popupWrapper.offsetWidth,t={w:a.domNode.offsetWidth+c};this._origStyle=d.style.cssText;b.isFunction(a.resize)?a.resize(t):e.setMarginBox(d,t);"R"==k.corner[1]&&(a._popupWrapper.style.left=a._popupWrapper.style.left.replace("px","")-c+"px")}l.set(this._popupStateNode,"popupActive","true");f.add(this._popupStateNode,"dijitHasDropDownOpen");
this._set("_opened",!0);this._popupStateNode.setAttribute("aria-expanded","true");this._popupStateNode.setAttribute("aria-owns",a.id);"presentation"===d.getAttribute("role")||d.getAttribute("aria-labelledby")||d.setAttribute("aria-labelledby",this.id);return k},closeDropDown:function(a){this._focusDropDownTimer&&(this._focusDropDownTimer.remove(),delete this._focusDropDownTimer);this._opened&&(this._popupStateNode.setAttribute("aria-expanded","false"),a&&this.focus&&this.focus(),g.close(this.dropDown),
this._opened=!1);this._origStyle&&(this.dropDown.domNode.style.cssText=this._origStyle,delete this._origStyle)}})})},"dijit/_editor/plugins/TextColor":function(){define("require dojo/colors dojo/_base/declare dojo/_base/lang ../_Plugin ../../form/DropDownButton".split(" "),function(q,m,n,l,f,e){var k=n("dijit._editor.plugins.TextColor",f,{buttonClass:e,colorPicker:"dijit/ColorPalette",useDefaultCommand:!1,_initButton:function(){this.command=this.name;this.inherited(arguments);var c=this;this.button.loadDropDown=
function(e){function b(a){c.button.dropDown=new a({dir:c.editor.dir,ownerDocument:c.editor.ownerDocument,value:c.value,onChange:function(a){c.editor.execCommand(c.command,a)},onExecute:function(){c.editor.execCommand(c.command,this.get("value"))}});e()}"string"==typeof c.colorPicker?q([c.colorPicker],b):b(c.colorPicker)}},updateState:function(){var c=this.editor,e=this.command;if(c&&c.isLoaded&&e.length){if(this.button){var b=this.get("disabled");this.button.set("disabled",b);if(b)return;var a;try{a=
c.queryCommandValue(e)||""}catch(d){a=""}}""==a&&(a="#000000");"transparent"==a&&(a="#ffffff");"string"==typeof a?-1<a.indexOf("rgb")&&(a=m.fromRgb(a).toHex()):(a=((a&255)<<16|a&65280|(a&16711680)>>>16).toString(16),a="#000000".slice(0,7-a.length)+a);this.value=a;(c=this.button.dropDown)&&c.get&&a!==c.get("value")&&c.set("value",a,!1)}}});f.registry.foreColor=function(c){return new k(c)};f.registry.hiliteColor=function(c){return new k(c)};return k})},"dojo/colors":function(){define(["./_base/kernel",
"./_base/lang","./_base/Color","./_base/array"],function(q,m,n,l){var f={};m.setObject("dojo.colors",f);var e=function(c,e,b){0>b&&++b;1<b&&--b;var a=6*b;return 1>a?c+(e-c)*a:1>2*b?e:2>3*b?c+(e-c)*(2/3-b)*6:c};q.colorFromRgb=n.fromRgb=function(c,f){var b=c.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(b){var a=b[2].split(/\s*,\s*/),d=a.length,b=b[1];if("rgb"==b&&3==d||"rgba"==b&&4==d)return b=a[0],"%"==b.charAt(b.length-1)?(b=l.map(a,function(a){return 2.56*parseFloat(a)}),4==d&&(b[3]=
a[3]),n.fromArray(b,f)):n.fromArray(a,f);if("hsl"==b&&3==d||"hsla"==b&&4==d){var b=(parseFloat(a[0])%360+360)%360/360,h=parseFloat(a[1])/100,k=parseFloat(a[2])/100,h=.5>=k?k*(h+1):k+h-k*h,k=2*k-h,b=[256*e(k,h,b+1/3),256*e(k,h,b),256*e(k,h,b-1/3),1];4==d&&(b[3]=a[3]);return n.fromArray(b,f)}}return null};var k=function(c,e,b){c=Number(c);return isNaN(c)?b:c<e?e:c>b?b:c};n.prototype.sanitize=function(){this.r=Math.round(k(this.r,0,255));this.g=Math.round(k(this.g,0,255));this.b=Math.round(k(this.b,
0,255));this.a=k(this.a,0,1);return this};f.makeGrey=n.makeGrey=function(c,e){return n.fromArray([c,c,c,e])};m.mixin(n.named,{aliceblue:[240,248,255],antiquewhite:[250,235,215],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],blanchedalmond:[255,235,205],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,
20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,
191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,
205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],mediumaquamarine:[102,205,170],mediumblue:[0,
0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],oldlace:[253,245,230],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,
238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],
tan:[210,180,140],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],whitesmoke:[245,245,245],yellowgreen:[154,205,50]});return n})},"esri/dijit/editing/AttachmentEditor":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/array dojo/_base/kernel dojo/has dojo/query dojo/io-query dojo/dom-attr dijit/_Widget dijit/_Templated dijit/ProgressBar ../../kernel ../../lang ../../domUtils dojo/text!./templates/AttachmentEditor.html dojo/i18n!../../nls/jsapi dojo/NodeList-dom".split(" "),
function(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p){q=q([b,a],{declaredClass:"esri.dijit.editing.AttachmentEditor",widgetsInTemplate:!0,templateString:u,_listHtml:"\x3cspan id\x3d'node_${oid}_${attid}' style\x3d'display: flex;'\x3e\x3ca href\x3d'${href}' target\x3d'_blank'\x3e${name}\x3c/a\x3e",_deleteBtnHtml:"\x3cspan style\x3d'cursor:pointer;color:red;font-weight:bold;padding:0 2px;' class\x3d'deleteAttachment' id\x3d'${attid}');'\x3eX\x3c/span\x3e",_endHtml:"\x3cbr/\x3e\x3c/span\x3e",_aeConnects:[],_layerEditingCapChecked:{},
_layerEditingCap:{},constructor:function(a,b){m.mixin(this,p.widgets.attachmentEditor)},startup:function(){this.inherited(arguments);this._uploadField_connect=n.connect(this._uploadField,"onchange",this,function(){0<this._uploadField.value.length&&this._addAttachment()});this._uploadFieldFocus_connect=n.connect(this._uploadField,"onfocus",m.hitch(this,function(a){g.hide(this._attachmentError)}))},destroy:function(){l.forEach(this._aeConnects,n.disconnect);n.disconnect(this._uploadField_connect);n.disconnect(this._uploadFieldFocus_connect);
this.inherited(arguments)},showAttachments:function(a,b){this._attachmentList.innerHTML=this.NLS_none;this._uploadField.value="";l.forEach(this.domNode.children,function(a,b){g.show(a)});g.hide(this._attachmentError);a&&(this._featureLayer=a.getLayer()||b)&&("esri.layers.FeatureLayer"===this._featureLayer.declaredClass&&this._featureLayer.getEditCapabilities?(this._currentLayerId=this._featureLayer.id,this._layerEditingCapChecked[this._currentLayerId]||(this._layerEditingCap[this._currentLayerId]=
this._featureLayer.getEditCapabilities(),this._layerEditingCapChecked[this._currentLayerId]=!0),this._featureCanUpdate=this._featureLayer.getEditCapabilities({feature:a}).canUpdate,this._oid=a.attributes[this._featureLayer.objectIdField],this._getAttachments(a)):b&&b.getEditCapabilities()||(g.hide(this._uploadForm),l.forEach(this.domNode.children,function(a,b){g.hide(a)})))},_getAttachments:function(a){this._featureLayer&&this._featureLayer.queryAttachmentInfos&&this._featureLayer.queryAttachmentInfos(this._oid,
m.hitch(this,"_onQueryAttachmentInfosComplete"))},_addAttachment:function(){g.hide(this._attachmentError);this._featureLayer&&this._featureLayer.addAttachment?(g.show(this._attachmentProgress),this._featureLayer.addAttachment(this._oid,this._uploadForm,m.hitch(this,"_onAddAttachmentComplete"),m.hitch(this,"_onAddAttachmentError"))):this._tempUpload=this._uploadForm},_chainAttachment:function(a,b){this._tempUpload&&(g.show(this._attachmentProgress),b.addAttachment(a,this._tempUpload,m.hitch(this,"_onAddAttachmentComplete"),
m.hitch(this,"_onAddAttachmentError")));this._tempUpload=null},_deleteAttachment:function(a,b){g.show(this._attachmentProgress);this._featureLayer.deleteAttachments(a,[b],m.hitch(this,"_onDeleteAttachmentComplete"))},_onQueryAttachmentInfosComplete:function(a){var b=this._listHtml+this._deleteBtnHtml+this._endHtml;this._uploadForm.style.display="block";!this._featureCanUpdate&&this._layerEditingCap[this._currentLayerId].canUpdate||!this._layerEditingCap[this._currentLayerId].canCreate&&!this._layerEditingCap[this._currentLayerId].canUpdate?
(b=this._listHtml+this._endHtml,this._uploadForm.style.display="none"):this._layerEditingCap[this._currentLayerId].canCreate&&!this._layerEditingCap[this._currentLayerId].canUpdate&&(b=this._listHtml+this._endHtml);var d=this._attachmentList;a=l.map(a,m.hitch(this,function(a){return v.substitute({href:a.url,name:a.name,oid:a.objectId,attid:a.id},b)}));d.innerHTML=a.join("")||this.NLS_none;this._updateConnects()},_onAddAttachmentComplete:function(a){g.hide(this._attachmentProgress.domNode);var b=this._attachmentList,
d=this._uploadField,e=d.value,f=e.lastIndexOf("\\");-1<f&&(e=e.substring(f+1,e.length));var e=e.replace(/\ /g,"_"),f=c.objectToQuery({gdbVersion:this._featureLayer.gdbVersion,token:this._featureLayer._getToken()}),h=this._listHtml+this._deleteBtnHtml+this._endHtml;this._layerEditingCap[this._currentLayerId].canCreate&&!this._layerEditingCap[this._currentLayerId].canUpdate&&(h=this._listHtml+this._endHtml);a=v.substitute({href:this._featureLayer._url.path+"/"+a.objectId+"/attachments/"+a.attachmentId+
(f?"?"+f:""),name:e,oid:a.objectId,attid:a.attachmentId},h);b.innerHTML=b.innerHTML==this.NLS_none?a:b.innerHTML+a;this._updateConnects();d.value=""},_onAddAttachmentError:function(a){g.hide(this._attachmentProgress.domNode);if(a&&v.isDefined(a.code)){var b=this._attachmentError;h.set(b,"innerHTML",(400===a.code?this.NLS_fileNotSupported:a.message||a.details&&a.details.length&&a.details[0])||this.NLS_error);g.show(b)}},_onDeleteAttachmentComplete:function(a){g.hide(this._attachmentProgress.domNode);
var b=this._attachmentList;l.every(a,function(a){return a.success})&&(f.query("#node_"+a[0].objectId+"_"+a[0].attachmentId).orphan(),b.children&&b.children.length||(b.innerHTML=this.NLS_none))},_updateConnects:function(){l.forEach(this._aeConnects,n.disconnect);f.query(".deleteAttachment").forEach(function(a){this._aeConnects.push(n.connect(a,"onclick",m.hitch(this,"_deleteAttachment",this._oid,a.id)))},this)}});e("extend-esri")&&m.setObject("dijit.editing.AttachmentEditor",q,t);return q})},"dijit/ProgressBar":function(){define("require dojo/_base/declare dojo/dom-class dojo/_base/lang dojo/number ./_Widget ./_TemplatedMixin dojo/text!./templates/ProgressBar.html".split(" "),
function(q,m,n,l,f,e,k,c){return m("dijit.ProgressBar",[e,k],{progress:"0",value:"",maximum:100,places:0,indeterminate:!1,label:"",name:"",templateString:c,_indeterminateHighContrastImagePath:q.toUrl("./themes/a11y/indeterminate_progress.gif"),postMixInProperties:function(){this.inherited(arguments);this.params&&"value"in this.params||(this.value=this.indeterminate?Infinity:this.progress)},buildRendering:function(){this.inherited(arguments);this.indeterminateHighContrastImage.setAttribute("src",this._indeterminateHighContrastImagePath.toString());
this.update()},_setDirAttr:function(c){var b="rtl"==c.toLowerCase();n.toggle(this.domNode,"dijitProgressBarRtl",b);n.toggle(this.domNode,"dijitProgressBarIndeterminateRtl",this.indeterminate&&b);this.inherited(arguments)},update:function(c){l.mixin(this,c||{});c=this.internalProgress;var b=this.domNode,a=1;this.indeterminate?b.removeAttribute("aria-valuenow"):(-1!=String(this.progress).indexOf("%")?(a=Math.min(parseFloat(this.progress)/100,1),this.progress=a*this.maximum):(this.progress=Math.min(this.progress,
this.maximum),a=this.maximum?this.progress/this.maximum:0),b.setAttribute("aria-valuenow",this.progress));b.setAttribute("aria-labelledby",this.labelNode.id);b.setAttribute("aria-valuemin",0);b.setAttribute("aria-valuemax",this.maximum);this.labelNode.innerHTML=this.report(a);n.toggle(this.domNode,"dijitProgressBarIndeterminate",this.indeterminate);n.toggle(this.domNode,"dijitProgressBarIndeterminateRtl",this.indeterminate&&!this.isLeftToRight());c.style.width=100*a+"%";this.onChange()},_setValueAttr:function(c){this._set("value",
c);Infinity==c?this.update({indeterminate:!0}):this.update({indeterminate:!1,progress:c})},_setLabelAttr:function(c){this._set("label",c);this.update()},_setIndeterminateAttr:function(c){this._set("indeterminate",c);this.update()},report:function(c){return this.label?this.label:this.indeterminate?"\x26#160;":f.format(c,{type:"percent",places:this.places,locale:this.lang})},onChange:function(){}})})},"esri/dijit/editing/Util":function(){define(["dojo/_base/lang","dojo/_base/array","dojo/has","../../kernel"],
function(q,m,n,l){var f={},f={findFeatures:function(e,f,c){var h=f.objectIdField;f=m.filter(f.graphics,function(b){return m.some(e,function(a){return b.attributes[h]===a.objectId})});if(c)c(f);else return f},getSelection:function(e){var f=[];m.forEach(e,function(c){c=c.getSelectedFeatures();m.forEach(c,function(c){f.push(c)})});return f},sortFeaturesById:function(e,f){var c=m.map(e,function(c){return c.featureLayer});f.sort(function(e,b){var a=e.getLayer(),d=b.getLayer();if(!a)return-1;if(!d)return 1;
var f=m.indexOf(c,a),d=m.indexOf(c,d),f=f-d;f||(a=a.objectIdField,f=e.attributes[a]-b.attributes[a]);return f});return f}};n("extend-esri")&&q.setObject("dijit.editing.Util.LayerHelper",f,l);return f})},"dijit/form/DateTextBox":function(){define(["dojo/_base/declare","../Calendar","./_DateTimeTextBox"],function(q,m,n){return q("dijit.form.DateTextBox",n,{baseClass:"dijitTextBox dijitComboBox dijitDateTextBox",popupClass:m,_selector:"date",maxHeight:Infinity,value:new Date("")})})},"dijit/Calendar":function(){define("dojo/_base/array dojo/date dojo/date/locale dojo/_base/declare dojo/dom-attr dojo/dom-class dojo/dom-construct dojo/_base/kernel dojo/keys dojo/_base/lang dojo/on dojo/sniff ./CalendarLite ./_Widget ./_CssStateMixin ./_TemplatedMixin ./form/DropDownButton".split(" "),
function(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p){var r=l("dijit.Calendar",[t,v,g],{baseClass:"dijitCalendar",cssStateNodes:{decrementMonth:"dijitCalendarArrow",incrementMonth:"dijitCalendarArrow",previousYearLabelNode:"dijitCalendarPreviousYear",nextYearLabelNode:"dijitCalendarNextYear"},setValue:function(a){c.deprecated("dijit.Calendar:setValue() is deprecated.  Use set('value', ...) instead.","","2.0");this.set("value",a)},_createMonthWidget:function(){return new r._MonthDropDownButton({id:this.id+"_mddb",
tabIndex:-1,onMonthSelect:b.hitch(this,"_onMonthSelect"),lang:this.lang,dateLocaleModule:this.dateLocaleModule},this.monthNode)},postCreate:function(){this.inherited(arguments);this.own(a(this.domNode,"keydown",b.hitch(this,"_onKeyDown")),a(this.dateRowsNode,"mouseover",b.hitch(this,"_onDayMouseOver")),a(this.dateRowsNode,"mouseout",b.hitch(this,"_onDayMouseOut")),a(this.dateRowsNode,"mousedown",b.hitch(this,"_onDayMouseDown")),a(this.dateRowsNode,"mouseup",b.hitch(this,"_onDayMouseUp")))},_onMonthSelect:function(a){var b=
new this.dateClassObj(this.currentFocus);b.setDate(1);b.setMonth(a);a=this.dateModule.getDaysInMonth(b);var d=this.currentFocus.getDate();b.setDate(Math.min(d,a));this._setCurrentFocusAttr(b)},_onDayMouseOver:function(a){(a=e.contains(a.target,"dijitCalendarDateLabel")?a.target.parentNode:a.target)&&(a.dijitDateValue&&!e.contains(a,"dijitCalendarDisabledDate")||a==this.previousYearLabelNode||a==this.nextYearLabelNode)&&(e.add(a,"dijitCalendarHoveredDate"),this._currentNode=a)},_onDayMouseOut:function(a){!this._currentNode||
a.relatedTarget&&a.relatedTarget.parentNode==this._currentNode||(a="dijitCalendarHoveredDate",e.contains(this._currentNode,"dijitCalendarActiveDate")&&(a+=" dijitCalendarActiveDate"),e.remove(this._currentNode,a),this._currentNode=null)},_onDayMouseDown:function(a){(a=a.target.parentNode)&&a.dijitDateValue&&!e.contains(a,"dijitCalendarDisabledDate")&&(e.add(a,"dijitCalendarActiveDate"),this._currentNode=a)},_onDayMouseUp:function(a){(a=a.target.parentNode)&&a.dijitDateValue&&e.remove(a,"dijitCalendarActiveDate")},
handleKey:function(a){var b=-1,d,c=this.currentFocus;switch(a.keyCode){case h.RIGHT_ARROW:b=1;case h.LEFT_ARROW:d="day";this.isLeftToRight()||(b*=-1);break;case h.DOWN_ARROW:b=1;case h.UP_ARROW:d="week";break;case h.PAGE_DOWN:b=1;case h.PAGE_UP:d=a.ctrlKey||a.altKey?"year":"month";break;case h.END:c=this.dateModule.add(c,"month",1),d="day";case h.HOME:c=new this.dateClassObj(c);c.setDate(1);break;default:return!0}d&&(c=this.dateModule.add(c,d,b));this._setCurrentFocusAttr(c);return!1},_onKeyDown:function(a){this.handleKey(a)||
(a.stopPropagation(),a.preventDefault())},onValueSelected:function(){},onChange:function(a){this.onValueSelected(a)},getClassForDate:function(){}});r._MonthDropDownButton=l("dijit.Calendar._MonthDropDownButton",p,{onMonthSelect:function(){},postCreate:function(){this.inherited(arguments);this.dropDown=new r._MonthDropDown({id:this.id+"_mdd",onChange:this.onMonthSelect})},_setMonthAttr:function(a){var b=this.dateLocaleModule.getNames("months","wide","standAlone",this.lang,a);this.dropDown.set("months",
b);this.containerNode.innerHTML=(6==d("ie")?"":"\x3cdiv class\x3d'dijitSpacer'\x3e"+this.dropDown.domNode.innerHTML+"\x3c/div\x3e")+"\x3cdiv class\x3d'dijitCalendarMonthLabel dijitCalendarCurrentMonthLabel'\x3e"+b[a.getMonth()]+"\x3c/div\x3e"}});r._MonthDropDown=l("dijit.Calendar._MonthDropDown",[v,u,g],{months:[],baseClass:"dijitCalendarMonthMenu dijitMenu",templateString:"\x3cdiv data-dojo-attach-event\x3d'ondijitclick:_onClick'\x3e\x3c/div\x3e",_setMonthsAttr:function(a){this.domNode.innerHTML=
"";q.forEach(a,function(a,b){k.create("div",{className:"dijitCalendarMonthLabel",month:b,innerHTML:a},this.domNode)._cssState="dijitCalendarMonthLabel"},this)},_onClick:function(a){this.onChange(f.get(a.target,"month"))},onChange:function(){}});return r})},"dijit/CalendarLite":function(){define("dojo/_base/array dojo/_base/declare dojo/cldr/supplemental dojo/date dojo/date/locale dojo/date/stamp dojo/dom dojo/dom-class dojo/dom-attr dojo/_base/lang dojo/on dojo/sniff dojo/string ./_WidgetBase ./_TemplatedMixin dojo/text!./templates/Calendar.html ./a11yclick ./hccss".split(" "),
function(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u){var p=m("dijit.CalendarLite",[v,g],{templateString:u,dowTemplateString:'\x3cth class\x3d"dijitReset dijitCalendarDayLabelTemplate" role\x3d"columnheader" scope\x3d"col"\x3e\x3cspan class\x3d"dijitCalendarDayLabel"\x3e${d}\x3c/span\x3e\x3c/th\x3e',dateTemplateString:'\x3ctd class\x3d"dijitReset" role\x3d"gridcell" data-dojo-attach-point\x3d"dateCells"\x3e\x3cspan class\x3d"dijitCalendarDateLabel" data-dojo-attach-point\x3d"dateLabels"\x3e\x3c/span\x3e\x3c/td\x3e',
weekTemplateString:'\x3ctr class\x3d"dijitReset dijitCalendarWeekTemplate" role\x3d"row"\x3e${d}${d}${d}${d}${d}${d}${d}\x3c/tr\x3e',value:new Date(""),datePackage:"",dayWidth:"narrow",tabIndex:"0",dayOffset:-1,currentFocus:new Date,_setSummaryAttr:"gridNode",baseClass:"dijitCalendar dijitCalendarLite",_isValidDate:function(a){return a&&!isNaN(a)&&"object"==typeof a&&a.toString()!=this.constructor.prototype.value.toString()},_getValueAttr:function(){var a=this._get("value");if(a&&!isNaN(a)){var b=
new this.dateClassObj(a);b.setHours(0,0,0,0);b.getDate()<a.getDate()&&(b=this.dateModule.add(b,"hour",1));return b}return null},_setValueAttr:function(a,b){"string"==typeof a&&(a=e.fromISOString(a));a=this._patchDate(a);if(this._isValidDate(a)&&!this.isDisabledDate(a,this.lang)){if(this._set("value",a),this.set("currentFocus",a),this._markSelectedDates([a]),this._created&&(b||"undefined"==typeof b))this.onChange(this.get("value"))}else this._set("value",null),this._markSelectedDates([])},_patchDate:function(a){if(a||
0===a)a=new this.dateClassObj(a),a.setHours(1,0,0,0);return a},_setText:function(a,b){for(;a.firstChild;)a.removeChild(a.firstChild);a.appendChild(a.ownerDocument.createTextNode(b))},_populateGrid:function(){var a=new this.dateClassObj(this.currentFocus);a.setDate(1);var a=this._patchDate(a),b=a.getDay(),d=this.dateModule.getDaysInMonth(a),c=this.dateModule.getDaysInMonth(this.dateModule.add(a,"month",-1)),e=new this.dateClassObj,g=0<=this.dayOffset?this.dayOffset:n.getFirstDayOfWeek(this.lang);g>
b&&(g-=7);if(!this.summary){var k=this.dateLocaleModule.getNames("months","wide","standAlone",this.lang,a);this.gridNode.setAttribute("summary",k[a.getMonth()])}this._date2cell={};q.forEach(this.dateCells,function(k,p){var l=p+g,r=new this.dateClassObj(a),t="dijitCalendar",m=0;l<b?(l=c-b+l+1,m=-1,t+="Previous"):l>=b+d?(l=l-b-d+1,m=1,t+="Next"):(l=l-b+1,t+="Current");m&&(r=this.dateModule.add(r,"month",m));r.setDate(l);this.dateModule.compare(r,e,"date")||(t="dijitCalendarCurrentDate "+t);this.isDisabledDate(r,
this.lang)?(t="dijitCalendarDisabledDate "+t,k.setAttribute("aria-disabled","true")):(t="dijitCalendarEnabledDate "+t,k.removeAttribute("aria-disabled"),k.setAttribute("aria-selected","false"));(m=this.getClassForDate(r,this.lang))&&(t=m+" "+t);k.className=t+"Month dijitCalendarDateTemplate";t=r.valueOf();this._date2cell[t]=k;k.dijitDateValue=t;t=r.getDateLocalized?r.getDateLocalized(this.lang):r.getDate();this._setText(this.dateLabels[p],t);h.set(k,"aria-label",f.format(r,{selector:"date",formatLength:"long"}))},
this)},_populateControls:function(){var a=new this.dateClassObj(this.currentFocus);a.setDate(1);this.monthWidget.set("month",a);var b=a.getFullYear()-1,d=new this.dateClassObj;q.forEach(["previous","current","next"],function(a){d.setFullYear(b++);this._setText(this[a+"YearLabelNode"],this.dateLocaleModule.format(d,{selector:"year",locale:this.lang}))},this)},goToToday:function(){this.set("value",new this.dateClassObj)},constructor:function(a){this.dateModule=a.datePackage?b.getObject(a.datePackage,
!1):l;this.dateClassObj=this.dateModule.Date||Date;this.dateLocaleModule=a.datePackage?b.getObject(a.datePackage+".locale",!1):f},_createMonthWidget:function(){return p._MonthWidget({id:this.id+"_mddb",lang:this.lang,dateLocaleModule:this.dateLocaleModule},this.monthNode)},buildRendering:function(){var a=this.dowTemplateString,b=this.dateLocaleModule.getNames("days",this.dayWidth,"standAlone",this.lang),d=0<=this.dayOffset?this.dayOffset:n.getFirstDayOfWeek(this.lang);this.dayCellsHtml=t.substitute([a,
a,a,a,a,a,a].join(""),{d:""},function(){return b[d++%7]});a=t.substitute(this.weekTemplateString,{d:this.dateTemplateString});this.dateRowsHtml=[a,a,a,a,a,a].join("");this.dateCells=[];this.dateLabels=[];this.inherited(arguments);k.setSelectable(this.domNode,!1);a=new this.dateClassObj(this.currentFocus);this.monthWidget=this._createMonthWidget();this.set("currentFocus",a,!1)},postCreate:function(){this.inherited(arguments);this._connectControls()},_connectControls:function(){var d=b.hitch(this,function(d,
c,e){this[d].dojoClick=!0;return a(this[d],"click",b.hitch(this,function(){this._setCurrentFocusAttr(this.dateModule.add(this.currentFocus,c,e))}))});this.own(d("incrementMonth","month",1),d("decrementMonth","month",-1),d("nextYearLabelNode","year",1),d("previousYearLabelNode","year",-1))},_setCurrentFocusAttr:function(a,b){var c=this.currentFocus,e=this._getNodeByDate(c);a=this._patchDate(a);this._set("currentFocus",a);this._date2cell&&0==this.dateModule.difference(c,a,"month")||(this._populateGrid(),
this._populateControls(),this._markSelectedDates([this.value]));c=this._getNodeByDate(a);c.setAttribute("tabIndex",this.tabIndex);(this.focused||b)&&c.focus();e&&e!=c&&(d("webkit")?e.setAttribute("tabIndex","-1"):e.removeAttribute("tabIndex"))},focus:function(){this._setCurrentFocusAttr(this.currentFocus,!0)},_onDayClick:function(a){a.stopPropagation();a.preventDefault();for(a=a.target;a&&!a.dijitDateValue&&0!==a.dijitDateValue;a=a.parentNode);a&&!c.contains(a,"dijitCalendarDisabledDate")&&this.set("value",
a.dijitDateValue)},_getNodeByDate:function(a){return(a=this._patchDate(a))&&this._date2cell?this._date2cell[a.valueOf()]:null},_markSelectedDates:function(a){function d(a,b){c.toggle(b,"dijitCalendarSelectedDate",a);b.setAttribute("aria-selected",a?"true":"false")}q.forEach(this._selectedCells||[],b.partial(d,!1));this._selectedCells=q.filter(q.map(a,this._getNodeByDate,this),function(a){return a});q.forEach(this._selectedCells,b.partial(d,!0))},onChange:function(){},isDisabledDate:function(){},getClassForDate:function(){}});
p._MonthWidget=m("dijit.CalendarLite._MonthWidget",v,{_setMonthAttr:function(a){var b=this.dateLocaleModule.getNames("months","wide","standAlone",this.lang,a),c=6==d("ie")?"":"\x3cdiv class\x3d'dijitSpacer'\x3e"+q.map(b,function(a){return"\x3cdiv\x3e"+a+"\x3c/div\x3e"}).join("")+"\x3c/div\x3e";this.domNode.innerHTML=c+"\x3cdiv class\x3d'dijitCalendarMonthLabel dijitCalendarCurrentMonthLabel'\x3e"+b[a.getMonth()]+"\x3c/div\x3e"}});return p})},"dijit/form/_DateTimeTextBox":function(){define("dojo/date dojo/date/locale dojo/date/stamp dojo/_base/declare dojo/_base/lang ./RangeBoundTextBox ../_HasDropDown dojo/text!./templates/DropDownBox.html".split(" "),
function(q,m,n,l,f,e,k,c){new Date("X");return l("dijit.form._DateTimeTextBox",[e,k],{templateString:c,hasDownArrow:!0,cssStateNodes:{_buttonNode:"dijitDownArrowButton"},_unboundedConstraints:{},pattern:m.regexp,datePackage:"",postMixInProperties:function(){this.inherited(arguments);this._set("type","text")},compare:function(c,b){var a=this._isInvalidDate(c),d=this._isInvalidDate(b);if(a||d)return a&&d?0:a?-1:1;var a=this.format(c,this._unboundedConstraints),d=this.format(b,this._unboundedConstraints),
e=this.parse(a,this._unboundedConstraints),f=this.parse(d,this._unboundedConstraints);return a==d?0:q.compare(e,f,this._selector)},autoWidth:!0,format:function(c,b){return c?this.dateLocaleModule.format(c,b):""},parse:function(c,b){return this.dateLocaleModule.parse(c,b)||(this._isEmpty(c)?null:void 0)},serialize:function(c,b){c.toGregorian&&(c=c.toGregorian());return n.toISOString(c,b)},dropDownDefaultValue:new Date,value:new Date(""),_blankValue:null,popupClass:"",_selector:"",constructor:function(c){c=
c||{};this.dateModule=c.datePackage?f.getObject(c.datePackage,!1):q;this.dateClassObj=this.dateModule.Date||Date;this.dateClassObj instanceof Date||(this.value=new this.dateClassObj(this.value));this.dateLocaleModule=c.datePackage?f.getObject(c.datePackage+".locale",!1):m;this._set("pattern",this.dateLocaleModule.regexp);this._invalidDate=this.constructor.prototype.value.toString()},buildRendering:function(){this.inherited(arguments);this.hasDownArrow||(this._buttonNode.style.display="none");this.hasDownArrow||
(this._buttonNode=this.domNode,this.baseClass+=" dijitComboBoxOpenOnClick")},_setConstraintsAttr:function(c){c.selector=this._selector;c.fullYear=!0;var b=n.fromISOString;"string"==typeof c.min&&(c.min=b(c.min),this.dateClassObj instanceof Date||(c.min=new this.dateClassObj(c.min)));"string"==typeof c.max&&(c.max=b(c.max),this.dateClassObj instanceof Date||(c.max=new this.dateClassObj(c.max)));this.inherited(arguments);this._unboundedConstraints=f.mixin({},this.constraints,{min:null,max:null})},_isInvalidDate:function(c){return!c||
isNaN(c)||"object"!=typeof c||c.toString()==this._invalidDate},_setValueAttr:function(c,b,a){void 0!==c&&("string"==typeof c&&(c=n.fromISOString(c)),this._isInvalidDate(c)&&(c=null),c instanceof Date&&!(this.dateClassObj instanceof Date)&&(c=new this.dateClassObj(c)));this.inherited(arguments,[c,b,a]);this.value instanceof Date&&(this.filterString="");!1!==b&&this.dropDown&&this.dropDown.set("value",c,!1)},_set:function(c,b){if("value"==c){b instanceof Date&&!(this.dateClassObj instanceof Date)&&
(b=new this.dateClassObj(b));var a=this._get("value");if(a instanceof this.dateClassObj&&0==this.compare(b,a))return}this.inherited(arguments)},_setDropDownDefaultValueAttr:function(c){this._isInvalidDate(c)&&(c=new this.dateClassObj);this._set("dropDownDefaultValue",c)},openDropDown:function(c){this.dropDown&&this.dropDown.destroy();var b=f.isString(this.popupClass)?f.getObject(this.popupClass,!1):this.popupClass,a=this,d=this.get("value");this.dropDown=new b({onChange:function(b){a.set("value",
b,!0)},id:this.id+"_popup",dir:a.dir,lang:a.lang,value:d,textDir:a.textDir,currentFocus:this._isInvalidDate(d)?this.dropDownDefaultValue:d,constraints:a.constraints,filterString:a.filterString,datePackage:a.datePackage,isDisabledDate:function(b){return!a.rangeCheck(b,a.constraints)}});this.inherited(arguments)},_getDisplayedValueAttr:function(){return this.textbox.value},_setDisplayedValueAttr:function(c,b){this._setValueAttr(this.parse(c,this.constraints),b,c)}})})},"dijit/form/RangeBoundTextBox":function(){define(["dojo/_base/declare",
"dojo/i18n","./MappedTextBox","dojo/i18n!./nls/validate"],function(q,m,n){return q("dijit.form.RangeBoundTextBox",n,{rangeMessage:"",rangeCheck:function(l,f){return("min"in f?0<=this.compare(l,f.min):!0)&&("max"in f?0>=this.compare(l,f.max):!0)},isInRange:function(){return this.rangeCheck(this.get("value"),this.constraints)},_isDefinitelyOutOfRange:function(){var l=this.get("value");if(null==l)return!1;var f=!1;"min"in this.constraints&&(f=this.constraints.min,f=0>this.compare(l,"number"==typeof f&&
0<=f&&0!=l?0:f));!f&&"max"in this.constraints&&(f=this.constraints.max,f=0<this.compare(l,"number"!=typeof f||0<f?f:0));return f},_isValidSubset:function(){return this.inherited(arguments)&&!this._isDefinitelyOutOfRange()},isValid:function(l){return this.inherited(arguments)&&(this._isEmpty(this.textbox.value)&&!this.required||this.isInRange(l))},getErrorMessage:function(l){var f=this.get("value");return null==f||""===f||"number"==typeof f&&isNaN(f)||this.isInRange(l)?this.inherited(arguments):this.rangeMessage},
postMixInProperties:function(){this.inherited(arguments);this.rangeMessage||(this.messages=m.getLocalization("dijit.form","validate",this.lang),this.rangeMessage=this.messages.rangeMessage)}})})},"dijit/form/MappedTextBox":function(){define(["dojo/_base/declare","dojo/sniff","dojo/dom-construct","./ValidationTextBox"],function(q,m,n,l){return q("dijit.form.MappedTextBox",l,{postMixInProperties:function(){this.inherited(arguments);this.nameAttrSetting=""},_setNameAttr:"valueNode",serialize:function(f){return f.toString?
f.toString():""},toString:function(){var f=this.filter(this.get("value"));return null!=f?"string"==typeof f?f:this.serialize(f,this.constraints):""},validate:function(){this.valueNode.value=this.toString();return this.inherited(arguments)},buildRendering:function(){this.inherited(arguments);this.valueNode=n.place("\x3cinput type\x3d'hidden'"+(this.name&&!m("msapp")?' name\x3d"'+this.name.replace(/"/g,"\x26quot;")+'"':"")+"/\x3e",this.textbox,"after")},reset:function(){this.valueNode.value="";this.inherited(arguments)}})})},
"dijit/form/ValidationTextBox":function(){define("dojo/_base/declare dojo/_base/kernel dojo/_base/lang dojo/i18n ./TextBox ../Tooltip dojo/text!./templates/ValidationTextBox.html dojo/i18n!./nls/validate".split(" "),function(q,m,n,l,f,e,k){var c=q("dijit.form.ValidationTextBox",f,{templateString:k,required:!1,promptMessage:"",invalidMessage:"$_unset_$",missingMessage:"$_unset_$",message:"",constraints:{},pattern:".*",regExp:"",regExpGen:function(){},state:"",tooltipPosition:[],_deprecateRegExp:function(e,
b){b!=c.prototype[e]&&(m.deprecated("ValidationTextBox id\x3d"+this.id+", set('"+e+"', ...) is deprecated.  Use set('pattern', ...) instead.","","2.0"),this.set("pattern",b))},_setRegExpGenAttr:function(c){this._deprecateRegExp("regExpGen",c);this._set("regExpGen",this._computeRegexp)},_setRegExpAttr:function(c){this._deprecateRegExp("regExp",c)},_setValueAttr:function(){this.inherited(arguments);this._refreshState()},validator:function(c,b){return(new RegExp("^(?:"+this._computeRegexp(b)+")"+(this.required?
"":"?")+"$")).test(c)&&(!this.required||!this._isEmpty(c))&&(this._isEmpty(c)||void 0!==this.parse(c,b))},_isValidSubset:function(){return 0==this.textbox.value.search(this._partialre)},isValid:function(){return this.validator(this.textbox.value,this.get("constraints"))},_isEmpty:function(c){return(this.trim?/^\s*$/:/^$/).test(c)},getErrorMessage:function(){var c="$_unset_$"==this.invalidMessage?this.messages.invalidMessage:this.invalidMessage?this.invalidMessage:this.promptMessage,b="$_unset_$"==
this.missingMessage?this.messages.missingMessage:this.missingMessage?this.missingMessage:c;return this.required&&this._isEmpty(this.textbox.value)?b:c},getPromptMessage:function(){return this.promptMessage},_maskValidSubsetError:!0,validate:function(c){var b="",a=this.disabled||this.isValid(c);a&&(this._maskValidSubsetError=!0);var d=this._isEmpty(this.textbox.value),e=!a&&c&&this._isValidSubset();this._set("state",a?"":((!this._hasBeenBlurred||c)&&d||e)&&(this._maskValidSubsetError||e&&!this._hasBeenBlurred&&
c)?"Incomplete":"Error");this.focusNode.setAttribute("aria-invalid","Error"==this.state?"true":"false");"Error"==this.state?(this._maskValidSubsetError=c&&e,b=this.getErrorMessage(c)):"Incomplete"==this.state?(b=this.getPromptMessage(c),this._maskValidSubsetError=!this._hasBeenBlurred||c):d&&(b=this.getPromptMessage(c));this.set("message",b);return a},displayMessage:function(c){c&&this.focused?e.show(c,this.domNode,this.tooltipPosition,!this.isLeftToRight()):e.hide(this.domNode)},_refreshState:function(){this._created&&
this.validate(this.focused);this.inherited(arguments)},constructor:function(c){this.constraints=n.clone(this.constraints);this.baseClass+=" dijitValidationTextBox"},startup:function(){this.inherited(arguments);this._refreshState()},_setConstraintsAttr:function(c){!c.locale&&this.lang&&(c.locale=this.lang);this._set("constraints",c);this._refreshState()},_setPatternAttr:function(c){this._set("pattern",c);this._refreshState()},_computeRegexp:function(c){var b=this.pattern;"function"==typeof b&&(b=b.call(this,
c));if(b!=this._lastRegExp){var a="";this._lastRegExp=b;".*"!=b&&b.replace(/\\.|\[\]|\[.*?[^\\]{1}\]|\{.*?\}|\(\?[=:!]|./g,function(b){switch(b.charAt(0)){case "{":case "+":case "?":case "*":case "^":case "$":case "|":case "(":a+=b;break;case ")":a+="|$)";break;default:a+="(?:"+b+"|$)"}});try{"".search(a)}catch(d){a=this.pattern,console.warn("RegExp error in "+this.declaredClass+": "+this.pattern)}this._partialre="^(?:"+a+")$"}return b},postMixInProperties:function(){this.inherited(arguments);this.messages=
l.getLocalization("dijit.form","validate",this.lang);this._setConstraintsAttr(this.constraints)},_setDisabledAttr:function(c){this.inherited(arguments);this._refreshState()},_setRequiredAttr:function(c){this._set("required",c);this.focusNode.setAttribute("aria-required",c);this._refreshState()},_setMessageAttr:function(c){this._set("message",c);this.displayMessage(c)},reset:function(){this._maskValidSubsetError=!0;this.inherited(arguments)},_onBlur:function(){this.displayMessage("");this.inherited(arguments)},
destroy:function(){e.hide(this.domNode);this.inherited(arguments)}});return c})},"dijit/form/TextBox":function(){define("dojo/_base/declare dojo/dom-construct dojo/dom-style dojo/_base/kernel dojo/_base/lang dojo/on dojo/sniff ./_FormValueWidget ./_TextBoxMixin dojo/text!./templates/TextBox.html ../main".split(" "),function(q,m,n,l,f,e,k,c,h,b,a){c=q("dijit.form.TextBox"+(k("dojo-bidi")?"_NoBidi":""),[c,h],{templateString:b,_singleNodeTemplate:'\x3cinput class\x3d"dijit dijitReset dijitLeft dijitInputField" data-dojo-attach-point\x3d"textbox,focusNode" autocomplete\x3d"off" type\x3d"${type}" ${!nameAttrSetting} /\x3e',
_buttonInputDisabled:k("ie")?"disabled":"",baseClass:"dijitTextBox",postMixInProperties:function(){var a=this.type.toLowerCase();if(this.templateString&&"input"==this.templateString.toLowerCase()||("hidden"==a||"file"==a)&&this.templateString==this.constructor.prototype.templateString)this.templateString=this._singleNodeTemplate;this.inherited(arguments)},postCreate:function(){this.inherited(arguments);9>k("ie")&&this.defer(function(){try{var a=n.getComputedStyle(this.domNode);if(a){var b=a.fontFamily;
if(b){var c=this.domNode.getElementsByTagName("INPUT");if(c)for(a=0;a<c.length;a++)c[a].style.fontFamily=b}}}catch(g){}})},_setPlaceHolderAttr:function(a){this._set("placeHolder",a);this._phspan||(this._attachPoints.push("_phspan"),this._phspan=m.create("span",{className:"dijitPlaceHolder dijitInputField"},this.textbox,"after"),this.own(e(this._phspan,"mousedown",function(a){a.preventDefault()}),e(this._phspan,"touchend, pointerup, MSPointerUp",f.hitch(this,function(){this.focus()}))));this._phspan.innerHTML=
"";this._phspan.appendChild(this._phspan.ownerDocument.createTextNode(a));this._updatePlaceHolder()},_onInput:function(a){this.inherited(arguments);this._updatePlaceHolder()},_updatePlaceHolder:function(){this._phspan&&(this._phspan.style.display=this.placeHolder&&!this.textbox.value?"":"none")},_setValueAttr:function(a,b,c){this.inherited(arguments);this._updatePlaceHolder()},getDisplayedValue:function(){l.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use get('displayedValue') instead.",
"","2.0");return this.get("displayedValue")},setDisplayedValue:function(a){l.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use set('displayedValue', ...) instead.","","2.0");this.set("displayedValue",a)},_onBlur:function(a){this.disabled||(this.inherited(arguments),this._updatePlaceHolder(),k("mozilla")&&this.selectOnClick&&(this.textbox.selectionStart=this.textbox.selectionEnd=void 0))},_onFocus:function(a){this.disabled||this.readOnly||(this.inherited(arguments),this._updatePlaceHolder())}});
9>k("ie")&&(c.prototype._isTextSelected=function(){var a=this.ownerDocument.selection.createRange();return a.parentElement()==this.textbox&&0<a.text.length},a._setSelectionRange=h._setSelectionRange=function(a,b,c){a.createTextRange&&(a=a.createTextRange(),a.collapse(!0),a.moveStart("character",-99999),a.moveStart("character",b),a.moveEnd("character",c-b),a.select())});k("dojo-bidi")&&(c=q("dijit.form.TextBox",c,{_setPlaceHolderAttr:function(a){this.inherited(arguments);this.applyTextDir(this._phspan)}}));
return c})},"dijit/form/_FormValueWidget":function(){define(["dojo/_base/declare","dojo/sniff","./_FormWidget","./_FormValueMixin"],function(q,m,n,l){return q("dijit.form._FormValueWidget",[n,l],{_layoutHackIE7:function(){if(7==m("ie"))for(var f=this.domNode,e=f.parentNode,k=f.firstChild||f,c=k.style.filter,h=this;e&&0==e.clientHeight;)(function(){var b=h.connect(e,"onscroll",function(){h.disconnect(b);k.style.filter=(new Date).getMilliseconds();h.defer(function(){k.style.filter=c})})})(),e=e.parentNode}})})},
"dijit/form/_FormValueMixin":function(){define("dojo/_base/declare dojo/dom-attr dojo/keys dojo/_base/lang dojo/on ./_FormWidgetMixin".split(" "),function(q,m,n,l,f,e){return q("dijit.form._FormValueMixin",e,{readOnly:!1,_setReadOnlyAttr:function(e){m.set(this.focusNode,"readOnly",e);this._set("readOnly",e)},postCreate:function(){this.inherited(arguments);void 0===this._resetValue&&(this._lastValueReported=this._resetValue=this.value)},_setValueAttr:function(e,c){this._handleOnChange(e,c)},_handleOnChange:function(e,
c){this._set("value",e);this.inherited(arguments)},undo:function(){this._setValueAttr(this._lastValueReported,!1)},reset:function(){this._hasBeenBlurred=!1;this._setValueAttr(this._resetValue,!0)}})})},"dijit/form/_TextBoxMixin":function(){define("dojo/_base/array dojo/_base/declare dojo/dom dojo/sniff dojo/keys dojo/_base/lang dojo/on ../main".split(" "),function(q,m,n,l,f,e,k,c){var h=m("dijit.form._TextBoxMixin"+(l("dojo-bidi")?"_NoBidi":""),null,{trim:!1,uppercase:!1,lowercase:!1,propercase:!1,
maxLength:"",selectOnClick:!1,placeHolder:"",_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints)},_setValueAttr:function(b,a,d){var c;void 0!==b&&(c=this.filter(b),"string"!=typeof d&&(d=null===c||"number"==typeof c&&isNaN(c)?"":this.filter(this.format(c,this.constraints)),0!=this.compare(c,this.filter(this.parse(d,this.constraints)))&&(d=null)));null==d||"number"==typeof d&&isNaN(d)||this.textbox.value==d||(this.textbox.value=d,this._set("displayedValue",this.get("displayedValue")));
this.inherited(arguments,[c,a])},displayedValue:"",_getDisplayedValueAttr:function(){return this.filter(this.textbox.value)},_setDisplayedValueAttr:function(b){null==b?b="":"string"!=typeof b&&(b=String(b));this.textbox.value=b;this._setValueAttr(this.get("value"),void 0);this._set("displayedValue",this.get("displayedValue"))},format:function(b){return null==b?"":b.toString?b.toString():b},parse:function(b){return b},_refreshState:function(){},onInput:function(){},_onInput:function(b){this._lastInputEventValue=
this.textbox.value;this._processInput(this._lastInputProducingEvent||b);delete this._lastInputProducingEvent;this.intermediateChanges&&this._handleOnChange(this.get("value"),!1)},_processInput:function(){this._refreshState();this._set("displayedValue",this.get("displayedValue"))},postCreate:function(){this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);this.own(k(this.textbox,"keydown, keypress, paste, cut, compositionend",e.hitch(this,function(b){var a;if("keydown"==b.type&&
229!=b.keyCode){a=b.keyCode;switch(a){case f.SHIFT:case f.ALT:case f.CTRL:case f.META:case f.CAPS_LOCK:case f.NUM_LOCK:case f.SCROLL_LOCK:return}if(!b.ctrlKey&&!b.metaKey&&!b.altKey){switch(a){case f.NUMPAD_0:case f.NUMPAD_1:case f.NUMPAD_2:case f.NUMPAD_3:case f.NUMPAD_4:case f.NUMPAD_5:case f.NUMPAD_6:case f.NUMPAD_7:case f.NUMPAD_8:case f.NUMPAD_9:case f.NUMPAD_MULTIPLY:case f.NUMPAD_PLUS:case f.NUMPAD_ENTER:case f.NUMPAD_MINUS:case f.NUMPAD_PERIOD:case f.NUMPAD_DIVIDE:return}if(65<=a&&90>=a||
48<=a&&57>=a||a==f.SPACE)return;a=!1;for(var d in f)if(f[d]===b.keyCode){a=!0;break}if(!a)return}}(a=32<=b.charCode?String.fromCharCode(b.charCode):b.charCode)||(a=65<=b.keyCode&&90>=b.keyCode||48<=b.keyCode&&57>=b.keyCode||b.keyCode==f.SPACE?String.fromCharCode(b.keyCode):b.keyCode);a||(a=229);if("keypress"==b.type){if("string"!=typeof a)return;if("a"<=a&&"z">=a||"A"<=a&&"Z">=a||"0"<=a&&"9">=a||" "===a)if(b.ctrlKey||b.metaKey||b.altKey)return}var c={faux:!0},h;for(h in b)/^(layer[XY]|returnValue|keyLocation)$/.test(h)||
(d=b[h],"function"!=typeof d&&"undefined"!=typeof d&&(c[h]=d));e.mixin(c,{charOrCode:a,_wasConsumed:!1,preventDefault:function(){c._wasConsumed=!0;b.preventDefault()},stopPropagation:function(){b.stopPropagation()}});this._lastInputProducingEvent=c;!1===this.onInput(c)&&(c.preventDefault(),c.stopPropagation());if(!c._wasConsumed&&9>=l("ie"))switch(b.keyCode){case f.TAB:case f.ESCAPE:case f.DOWN_ARROW:case f.UP_ARROW:case f.LEFT_ARROW:case f.RIGHT_ARROW:break;default:b.keyCode==f.ENTER&&"textarea"!=
this.textbox.tagName.toLowerCase()||this.defer(function(){this.textbox.value!==this._lastInputEventValue&&k.emit(this.textbox,"input",{bubbles:!0})})}})),k(this.textbox,"input",e.hitch(this,"_onInput")),k(this.domNode,"keypress",function(b){b.stopPropagation()}))},_blankValue:"",filter:function(b){if(null===b)return this._blankValue;if("string"!=typeof b)return b;this.trim&&(b=e.trim(b));this.uppercase&&(b=b.toUpperCase());this.lowercase&&(b=b.toLowerCase());this.propercase&&(b=b.replace(/[^\s]+/g,
function(a){return a.substring(0,1).toUpperCase()+a.substring(1)}));return b},_setBlurValue:function(){this._setValueAttr(this.get("value"),!0)},_onBlur:function(b){this.disabled||(this._setBlurValue(),this.inherited(arguments))},_isTextSelected:function(){return this.textbox.selectionStart!=this.textbox.selectionEnd},_onFocus:function(b){this.disabled||this.readOnly||(this.selectOnClick&&"mouse"==b&&(this._selectOnClickHandle=k.once(this.domNode,"mouseup, touchend",e.hitch(this,function(a){this._isTextSelected()||
h.selectInputText(this.textbox)})),this.own(this._selectOnClickHandle),this.defer(function(){this._selectOnClickHandle&&(this._selectOnClickHandle.remove(),this._selectOnClickHandle=null)},500)),this.inherited(arguments),this._refreshState())},reset:function(){this.textbox.value="";this.inherited(arguments)}});l("dojo-bidi")&&(h=m("dijit.form._TextBoxMixin",h,{_setValueAttr:function(){this.inherited(arguments);this.applyTextDir(this.focusNode)},_setDisplayedValueAttr:function(){this.inherited(arguments);
this.applyTextDir(this.focusNode)},_onInput:function(){this.applyTextDir(this.focusNode);this.inherited(arguments)}}));h._setSelectionRange=c._setSelectionRange=function(b,a,d){b.setSelectionRange&&b.setSelectionRange(a,d)};h.selectInputText=c.selectInputText=function(b,a,d){b=n.byId(b);isNaN(a)&&(a=0);isNaN(d)&&(d=b.value?b.value.length:0);try{b.focus(),h._setSelectionRange(b,a,d)}catch(t){}};return h})},"dijit/Tooltip":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/fx dojo/dom dojo/dom-class dojo/dom-geometry dojo/dom-style dojo/_base/lang dojo/mouse dojo/on dojo/sniff ./_base/manager ./place ./_Widget ./_TemplatedMixin ./BackgroundIframe dojo/text!./templates/Tooltip.html ./main".split(" "),
function(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r){function A(){}var y=m("dijit._MasterTooltip",[v,g],{duration:d.defaultDuration,templateString:p,postCreate:function(){this.ownerDocumentBody.appendChild(this.domNode);this.bgIframe=new u(this.domNode);this.fadeIn=n.fadeIn({node:this.domNode,duration:this.duration,onEnd:c.hitch(this,"_onShow")});this.fadeOut=n.fadeOut({node:this.domNode,duration:this.duration,onEnd:c.hitch(this,"_onHide")})},show:function(a,b,d,e,f,g,h){if(!this.aroundNode||this.aroundNode!==
b||this.containerNode.innerHTML!=a)if("playing"==this.fadeOut.status())this._onDeck=arguments;else{this.containerNode.innerHTML=a;f&&this.set("textDir",f);this.containerNode.align=e?"right":"left";var p=t.around(this.domNode,b,d&&d.length?d:B.defaultPosition,!e,c.hitch(this,"orient")),l=p.aroundNodePos;"M"==p.corner.charAt(0)&&"M"==p.aroundCorner.charAt(0)?(this.connectorNode.style.top=l.y+(l.h-this.connectorNode.offsetHeight>>1)-p.y+"px",this.connectorNode.style.left=""):"M"==p.corner.charAt(1)&&
"M"==p.aroundCorner.charAt(1)?this.connectorNode.style.left=l.x+(l.w-this.connectorNode.offsetWidth>>1)-p.x+"px":(this.connectorNode.style.left="",this.connectorNode.style.top="");k.set(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=!0;this.aroundNode=b;this.onMouseEnter=g||A;this.onMouseLeave=h||A}},orient:function(b,d,c,f,g){this.connectorNode.style.top="";var h=f.h;f=f.w;b.className="dijitTooltip "+{"MR-ML":"dijitTooltipRight","ML-MR":"dijitTooltipLeft","TM-BM":"dijitTooltipAbove",
"BM-TM":"dijitTooltipBelow","BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[d+"-"+c];this.domNode.style.width="auto";var k=e.position(this.domNode);if(a("ie")||a("trident"))k.w+=2;e.setMarginBox(this.domNode,{w:Math.min(Math.max(f,1),k.w)});"B"==c.charAt(0)&&"B"==d.charAt(0)?(b=e.position(b),d=this.connectorNode.offsetHeight,
b.h>h?(this.connectorNode.style.top=h-(g.h+d>>1)+"px",this.connectorNode.style.bottom=""):(this.connectorNode.style.bottom=Math.min(Math.max(g.h/2-d/2,0),b.h-d)+"px",this.connectorNode.style.top="")):(this.connectorNode.style.top="",this.connectorNode.style.bottom="");return Math.max(0,k.w-f)},_onShow:function(){a("ie")&&(this.domNode.style.filter="")},hide:function(a){this._onDeck&&this._onDeck[1]==a?this._onDeck=null:this.aroundNode===a&&(this.fadeIn.stop(),this.isShowingNow=!1,this.aroundNode=
null,this.fadeOut.play());this.onMouseEnter=this.onMouseLeave=A},_onHide:function(){this.domNode.style.cssText="";this.containerNode.innerHTML="";this._onDeck&&(this.show.apply(this,this._onDeck),this._onDeck=null)}});a("dojo-bidi")&&y.extend({_setAutoTextDir:function(a){this.applyTextDir(a);q.forEach(a.children,function(a){this._setAutoTextDir(a)},this)},_setTextDirAttr:function(a){this._set("textDir",a);"auto"==a?this._setAutoTextDir(this.containerNode):this.containerNode.dir=this.textDir}});r.showTooltip=
function(a,b,d,c,e,f,g){d&&(d=q.map(d,function(a){return{after:"after-centered",before:"before-centered"}[a]||a}));B._masterTT||(r._masterTT=B._masterTT=new y);return B._masterTT.show(a,b,d,c,e,f,g)};r.hideTooltip=function(a){return B._masterTT&&B._masterTT.hide(a)};var B=m("dijit.Tooltip",v,{label:"",showDelay:400,hideDelay:400,connectId:[],position:[],selector:"",_setConnectIdAttr:function(a){q.forEach(this._connections||[],function(a){q.forEach(a,function(a){a.remove()})},this);this._connectIds=
q.filter(c.isArrayLike(a)?a:a?[a]:[],function(a){return l.byId(a,this.ownerDocument)},this);this._connections=q.map(this._connectIds,function(a){a=l.byId(a,this.ownerDocument);var d=this.selector,e=d?function(a){return b.selector(d,a)}:function(a){return a},f=this;return[b(a,e(h.enter),function(){f._onHover(this)}),b(a,e("focusin"),function(){f._onHover(this)}),b(a,e(h.leave),c.hitch(f,"_onUnHover")),b(a,e("focusout"),c.hitch(f,"set","state","DORMANT"))]},this);this._set("connectId",a)},addTarget:function(a){a=
a.id||a;-1==q.indexOf(this._connectIds,a)&&this.set("connectId",this._connectIds.concat(a))},removeTarget:function(a){a=q.indexOf(this._connectIds,a.id||a);0<=a&&(this._connectIds.splice(a,1),this.set("connectId",this._connectIds))},buildRendering:function(){this.inherited(arguments);f.add(this.domNode,"dijitTooltipData")},startup:function(){this.inherited(arguments);var a=this.connectId;q.forEach(c.isArrayLike(a)?a:[a],this.addTarget,this)},getContent:function(a){return this.label||this.domNode.innerHTML},
state:"DORMANT",_setStateAttr:function(a){if(!(this.state==a||"SHOW TIMER"==a&&"SHOWING"==this.state||"HIDE TIMER"==a&&"DORMANT"==this.state)){this._hideTimer&&(this._hideTimer.remove(),delete this._hideTimer);this._showTimer&&(this._showTimer.remove(),delete this._showTimer);switch(a){case "DORMANT":this._connectNode&&(B.hide(this._connectNode),delete this._connectNode,this.onHide());break;case "SHOW TIMER":"SHOWING"!=this.state&&(this._showTimer=this.defer(function(){this.set("state","SHOWING")},
this.showDelay));break;case "SHOWING":var b=this.getContent(this._connectNode);if(!b){this.set("state","DORMANT");return}B.show(b,this._connectNode,this.position,!this.isLeftToRight(),this.textDir,c.hitch(this,"set","state","SHOWING"),c.hitch(this,"set","state","HIDE TIMER"));this.onShow(this._connectNode,this.position);break;case "HIDE TIMER":this._hideTimer=this.defer(function(){this.set("state","DORMANT")},this.hideDelay)}this._set("state",a)}},_onHover:function(a){this._connectNode&&a!=this._connectNode&&
this.set("state","DORMANT");this._connectNode=a;this.set("state","SHOW TIMER")},_onUnHover:function(a){this.set("state","HIDE TIMER")},open:function(a){this.set("state","DORMANT");this._connectNode=a;this.set("state","SHOWING")},close:function(){this.set("state","DORMANT")},onShow:function(){},onHide:function(){},destroy:function(){this.set("state","DORMANT");q.forEach(this._connections||[],function(a){q.forEach(a,function(a){a.remove()})},this);this.inherited(arguments)}});B._MasterTooltip=y;B.show=
r.showTooltip;B.hide=r.hideTooltip;B.defaultPosition=["after-centered","before-centered"];return B})},"dijit/form/NumberTextBox":function(){define("dojo/_base/declare dojo/_base/lang dojo/i18n dojo/string dojo/number ./RangeBoundTextBox".split(" "),function(q,m,n,l,f,e){var k=function(c){c=c||{};var b=n.getLocalization("dojo.cldr","number",n.normalizeLocale(c.locale)),a=c.pattern?c.pattern:b[(c.type||"decimal")+"Format"];c="number"==typeof c.places?c.places:"string"===typeof c.places&&0<c.places.length?
c.places.replace(/.*,/,""):-1!=a.indexOf(".")?a.split(".")[1].replace(/[^#0]/g,"").length:0;return{sep:b.decimal,places:c}},c=q("dijit.form.NumberTextBoxMixin",null,{pattern:function(c){return"("+(this.focused&&this.editOptions?this._regExpGenerator(m.delegate(c,this.editOptions))+"|":"")+this._regExpGenerator(c)+")"},value:NaN,editOptions:{pattern:"#.######"},_formatter:f.format,_regExpGenerator:f.regexp,_decimalInfo:k(),postMixInProperties:function(){this.inherited(arguments);this._set("type","text")},
_setConstraintsAttr:function(c){var b="number"==typeof c.places?c.places:0;b&&b++;"number"!=typeof c.max&&(c.max=9*Math.pow(10,15-b));"number"!=typeof c.min&&(c.min=-9*Math.pow(10,15-b));this.inherited(arguments,[c]);this.focusNode&&this.focusNode.value&&!isNaN(this.value)&&this.set("value",this.value);this._decimalInfo=k(c)},_onFocus:function(){if(!this.disabled&&!this.readOnly){var c=this.get("value");"number"!=typeof c||isNaN(c)||(c=this.format(c,this.constraints),void 0!==c&&(this.textbox.value=
c));this.inherited(arguments)}},format:function(c,b){var a=String(c);if("number"!=typeof c)return a;if(isNaN(c))return"";if(!("rangeCheck"in this&&this.rangeCheck(c,b))&&!1!==b.exponent&&/\de[-+]?\d/i.test(a))return a;this.editOptions&&this.focused&&(b=m.mixin({},b,this.editOptions));return this._formatter(c,b)},_parser:f.parse,parse:function(c,b){var a=m.mixin({},b,this.editOptions&&this.focused?this.editOptions:{});if(this.focused&&null!=a.places){var d=a.places,d="number"===typeof d?d:Number(d.split(",").pop());
a.places="0,"+d}a=this._parser(c,a);this.editOptions&&this.focused&&isNaN(a)&&(a=this._parser(c,b));return a},_getDisplayedValueAttr:function(){var c=this.inherited(arguments);return isNaN(c)?this.textbox.value:c},filter:function(c){if(null==c||"string"==typeof c&&""==c)return NaN;"number"!=typeof c||isNaN(c)||0==c||(c=f.round(c,this._decimalInfo.places));return this.inherited(arguments,[c])},serialize:function(c,b){return"number"!=typeof c||isNaN(c)?"":this.inherited(arguments)},_setBlurValue:function(){var c=
m.hitch(m.delegate(this,{focused:!0}),"get")("value");this._setValueAttr(c,!0)},_setValueAttr:function(c,b,a){if(void 0!==c&&void 0===a)if(a=String(c),"number"==typeof c)if(isNaN(c))a="";else{if("rangeCheck"in this&&this.rangeCheck(c,this.constraints)||!1===this.constraints.exponent||!/\de[-+]?\d/i.test(a))a=void 0}else c?c=void 0:(a="",c=NaN);this.inherited(arguments,[c,b,a])},_getValueAttr:function(){var c=this.inherited(arguments);if(isNaN(c)&&""!==this.textbox.value){if(!1!==this.constraints.exponent&&
/\de[-+]?\d/i.test(this.textbox.value)&&(new RegExp("^"+f._realNumberRegexp(m.delegate(this.constraints))+"$")).test(this.textbox.value))return c=Number(this.textbox.value),isNaN(c)?void 0:c}else return c},isValid:function(c){if(!this.focused||this._isEmpty(this.textbox.value))return this.inherited(arguments);var b=this.get("value");return!isNaN(b)&&this.rangeCheck(b,this.constraints)?!1!==this.constraints.exponent&&/\de[-+]?\d/i.test(this.textbox.value)?!0:this.inherited(arguments):!1},_isValidSubset:function(){var c=
"number"==typeof this.constraints.min,b="number"==typeof this.constraints.max,a=this.get("value");if(isNaN(a)||!c&&!b)return this.inherited(arguments);var d=a|0,e=0>a,f=-1!=this.textbox.value.indexOf(this._decimalInfo.sep),g=(this.maxLength||20)-this.textbox.value.length,k=f?this.textbox.value.split(this._decimalInfo.sep)[1].replace(/[^0-9]/g,""):"",d=f?d+"."+k:d+"",g=l.rep("9",g),f=a;e?f=Number(d+g):a=Number(d+g);return!(c&&a<this.constraints.min||b&&f>this.constraints.max)}});q=q("dijit.form.NumberTextBox",
[e,c],{baseClass:"dijitTextBox dijitNumberTextBox"});q.Mixin=c;return q})},"dijit/form/FilteringSelect":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/when","./MappedTextBox","./ComboBoxMixin"],function(q,m,n,l,f){return q("dijit.form.FilteringSelect",[l,f],{required:!0,_lastDisplayedValue:"",_isValidSubset:function(){return this._opened},isValid:function(){return!!this.item||!this.required&&""==this.get("displayedValue")},_refreshState:function(){this.searchTimer||this.inherited(arguments)},
_callbackSetLabel:function(e,f,c,h){f&&f[this.searchAttr]!==this._lastQuery||!f&&e.length&&this.store.getIdentity(e[0])!=this._lastQuery||(e.length?this.set("item",e[0],h):this.set("value","",h||void 0===h&&!this.focused,this.textbox.value,null))},_openResultList:function(e,f,c){f[this.searchAttr]===this._lastQuery&&(this.inherited(arguments),void 0===this.item&&this.validate(!0))},_getValueAttr:function(){return this.valueNode.value},_getValueField:function(){return"value"},_setValueAttr:function(e,
f,c,h){this._onChangeActive||(f=null);if(void 0===h){if(null===e||""===e)if(e="",!m.isString(c)){this._setDisplayedValueAttr(c||"",f);return}var b=this;this._lastQuery=e;n(this.store.get(e),function(a){b._callbackSetLabel(a?[a]:[],void 0,void 0,f)})}else this.valueNode.value=e,this.inherited(arguments,[e,f,c,h])},_setItemAttr:function(e,f,c){this.inherited(arguments);this._lastDisplayedValue=this.textbox.value},_getDisplayQueryString:function(e){return e.replace(/([\\\*\?])/g,"\\$1")},_setDisplayedValueAttr:function(e,
f){null==e&&(e="");if(!this._created){if(!("displayedValue"in this.params))return;f=!1}if(this.store){this.closeDropDown();var c=m.clone(this.query),h=this._getDisplayQueryString(e),b;this.store._oldAPI?b=h:(b=this._patternToRegExp(h),b.toString=function(){return h});this._lastQuery=c[this.searchAttr]=b;this._lastDisplayedValue=this.textbox.value=e;this._set("displayedValue",e);var a=this,d={queryOptions:{ignoreCase:this.ignoreCase,deep:!0}};m.mixin(d,this.fetchProperties);this._fetchHandle=this.store.query(c,
d);n(this._fetchHandle,function(b){a._fetchHandle=null;a._callbackSetLabel(b||[],c,d,f)},function(b){a._fetchHandle=null;a._cancelingQuery||console.error("dijit.form.FilteringSelect: "+b.toString())})}},undo:function(){this.set("displayedValue",this._lastDisplayedValue)}})})},"dijit/form/ComboBoxMixin":function(){define("dojo/_base/declare dojo/Deferred dojo/_base/kernel dojo/_base/lang dojo/store/util/QueryResults ./_AutoCompleterMixin ./_ComboBoxMenu ../_HasDropDown dojo/text!./templates/DropDownBox.html".split(" "),
function(q,m,n,l,f,e,k,c,h){return q("dijit.form.ComboBoxMixin",[c,e],{dropDownClass:k,hasDownArrow:!0,templateString:h,baseClass:"dijitTextBox dijitComboBox",cssStateNodes:{_buttonNode:"dijitDownArrowButton"},_setHasDownArrowAttr:function(b){this._set("hasDownArrow",b);this._buttonNode.style.display=b?"":"none"},_showResultList:function(){this.displayMessage("");this.inherited(arguments)},_setStoreAttr:function(b){b.get||l.mixin(b,{_oldAPI:!0,get:function(a){var b=new m;this.fetchItemByIdentity({identity:a,
onItem:function(a){b.resolve(a)},onError:function(a){b.reject(a)}});return b.promise},query:function(a,b){var d=new m(function(){c.abort&&c.abort()});d.total=new m;var c=this.fetch(l.mixin({query:a,onBegin:function(a){d.total.resolve(a)},onComplete:function(a){d.resolve(a)},onError:function(a){d.reject(a)}},b));return f(d)}});this._set("store",b)},postMixInProperties:function(){var b=this.params.store||this.store;b&&this._setStoreAttr(b);this.inherited(arguments);if(!this.params.store&&this.store&&
!this.store._oldAPI){var a=this.declaredClass;l.mixin(this.store,{getValue:function(b,c){n.deprecated(a+".store.getValue(item, attr) is deprecated for builtin store.  Use item.attr directly","","2.0");return b[c]},getLabel:function(b){n.deprecated(a+".store.getLabel(item) is deprecated for builtin store.  Use item.label directly","","2.0");return b.name},fetch:function(b){n.deprecated(a+".store.fetch() is deprecated for builtin store.","Use store.query()","2.0");require(["dojo/data/ObjectStore"],
l.hitch(this,function(a){(new a({objectStore:this})).fetch(b)}))}})}},buildRendering:function(){this.inherited(arguments);this.focusNode.setAttribute("aria-autocomplete",this.autoComplete?"both":"list")}})})},"dijit/form/_AutoCompleterMixin":function(){define("dojo/aspect dojo/_base/declare dojo/dom-attr dojo/keys dojo/_base/lang dojo/query dojo/regexp dojo/sniff ./DataList ./_TextBoxMixin ./_SearchMixin".split(" "),function(q,m,n,l,f,e,k,c,h,b,a){m=m("dijit.form._AutoCompleterMixin",a,{item:null,
autoComplete:!0,highlightMatch:"first",labelAttr:"",labelType:"text",maxHeight:-1,_stopClickEvents:!1,_getCaretPos:function(a){var b=0;if("number"==typeof a.selectionStart)b=a.selectionStart;else if(c("ie")){var d=a.ownerDocument.selection.createRange().duplicate();a=a.createTextRange();d.move("character",0);a.move("character",0);try{a.setEndPoint("EndToEnd",d),b=String(a.text).replace(/\r/g,"").length}catch(g){}}return b},_setCaretPos:function(a,c){c=parseInt(c);b.selectInputText(a,c,c)},_setDisabledAttr:function(a){this.inherited(arguments);
this.domNode.setAttribute("aria-disabled",a?"true":"false")},_onKey:function(a){if(!(32<=a.charCode)){var b=a.charCode||a.keyCode;if(b!=l.ALT&&b!=l.CTRL&&b!=l.META&&b!=l.SHIFT){var c=this.dropDown,d=null;this._abortQuery();this.inherited(arguments);if(!(a.altKey||a.ctrlKey||a.metaKey))switch(this._opened&&(d=c.getHighlightedOption()),b){case l.PAGE_DOWN:case l.DOWN_ARROW:case l.PAGE_UP:case l.UP_ARROW:this._opened&&this._announceOption(d);a.stopPropagation();a.preventDefault();break;case l.ENTER:if(d){if(d==
c.nextButton){this._nextSearch(1);a.stopPropagation();a.preventDefault();break}else if(d==c.previousButton){this._nextSearch(-1);a.stopPropagation();a.preventDefault();break}a.stopPropagation();a.preventDefault()}else this._setBlurValue(),this._setCaretPos(this.focusNode,this.focusNode.value.length);case l.TAB:b=this.get("displayedValue");if(c&&(b==c._messages.previousMessage||b==c._messages.nextMessage))break;d&&this._selectOption(d);case l.ESCAPE:this._opened&&(this._lastQuery=null,this.closeDropDown())}}}},
_autoCompleteText:function(a){var c=this.focusNode;b.selectInputText(c,c.value.length);var d=this.ignoreCase?"toLowerCase":"substr";0==a[d](0).indexOf(this.focusNode.value[d](0))?(d=this.autoComplete?this._getCaretPos(c):c.value.length,d+1>c.value.length&&(c.value=a,b.selectInputText(c,d))):(c.value=a,b.selectInputText(c))},_openResultList:function(a,b,c){var d=this.dropDown.getHighlightedOption();this.dropDown.clearResultList();a.length||0!=c.start?(this._nextSearch=this.dropDown.onPage=f.hitch(this,
function(b){a.nextPage(-1!==b);this.focus()}),this.dropDown.createOptions(a,c,f.hitch(this,"_getMenuLabelFromItem")),this._showResultList(),"direction"in c?(c.direction?this.dropDown.highlightFirstOption():c.direction||this.dropDown.highlightLastOption(),d&&this._announceOption(this.dropDown.getHighlightedOption())):!this.autoComplete||this._prev_key_backspace||/^[*]+$/.test(b[this.searchAttr].toString())||this._announceOption(this.dropDown.containerNode.firstChild.nextSibling)):this.closeDropDown()},
_showResultList:function(){this.closeDropDown(!0);this.openDropDown();this.domNode.setAttribute("aria-expanded","true")},loadDropDown:function(){this._startSearchAll()},isLoaded:function(){return!1},closeDropDown:function(){this._abortQuery();this._opened&&(this.inherited(arguments),this.domNode.setAttribute("aria-expanded","false"))},_setBlurValue:function(){var a=this.get("displayedValue"),b=this.dropDown;!b||a!=b._messages.previousMessage&&a!=b._messages.nextMessage?"undefined"==typeof this.item?
(this.item=null,this.set("displayedValue",a)):(this.value!=this._lastValueReported&&this._handleOnChange(this.value,!0),this._refreshState()):this._setValueAttr(this._lastValueReported,!0);this.focusNode.removeAttribute("aria-activedescendant")},_setItemAttr:function(a,b,c){var d="";a&&(c||(c=this.store._oldAPI?this.store.getValue(a,this.searchAttr):a[this.searchAttr]),d=this._getValueField()!=this.searchAttr?this.store.getIdentity(a):c);this.set("value",d,b,c,a)},_announceOption:function(a){if(a){var b;
if(a==this.dropDown.nextButton||a==this.dropDown.previousButton)b=a.innerHTML,this.item=void 0,this.value="";else{var c=this.dropDown.items[a.getAttribute("item")];b=(this.store._oldAPI?this.store.getValue(c,this.searchAttr):c[this.searchAttr]).toString();this.set("item",c,!1,b)}this.focusNode.value=this.focusNode.value.substring(0,this._lastInput.length);this.focusNode.setAttribute("aria-activedescendant",n.get(a,"id"));this._autoCompleteText(b)}},_selectOption:function(a){this.closeDropDown();a&&
this._announceOption(a);this._setCaretPos(this.focusNode,this.focusNode.value.length);this._handleOnChange(this.value,!0);this.focusNode.removeAttribute("aria-activedescendant")},_startSearchAll:function(){this._startSearch("")},_startSearchFromInput:function(){this.item=void 0;this.inherited(arguments)},_startSearch:function(a){if(!this.dropDown){var b=this.id+"_popup";this.dropDown=new (f.isString(this.dropDownClass)?f.getObject(this.dropDownClass,!1):this.dropDownClass)({onChange:f.hitch(this,
this._selectOption),id:b,dir:this.dir,textDir:this.textDir})}this._lastInput=a;this.inherited(arguments)},_getValueField:function(){return this.searchAttr},postMixInProperties:function(){this.inherited(arguments);if(!this.store&&this.srcNodeRef&&(this.store=new h({},this.srcNodeRef),!("value"in this.params))){var a=this.item=this.store.fetchSelectedItem();if(a){var b=this._getValueField();this.value=this.store._oldAPI?this.store.getValue(a,b):a[b]}}},postCreate:function(){var a=e('label[for\x3d"'+
this.id+'"]');a.length&&(a[0].id||(a[0].id=this.id+"_label"),this.domNode.setAttribute("aria-labelledby",a[0].id));this.inherited(arguments);q.after(this,"onSearch",f.hitch(this,"_openResultList"),!0)},_getMenuLabelFromItem:function(a){a=this.labelFunc(a,this.store);var b=this.labelType;"none"!=this.highlightMatch&&"text"==this.labelType&&this._lastInput&&(a=this.doHighlight(a,this._lastInput),b="html");return{html:"html"==b,label:a}},doHighlight:function(a,b){var c=(this.ignoreCase?"i":"")+("all"==
this.highlightMatch?"g":""),d=this.queryExpr.indexOf("${0}");b=k.escapeString(b);return this._escapeHtml(a.replace(new RegExp((0==d?"^":"")+"("+b+")"+(d==this.queryExpr.length-4?"$":""),c),"\uffff$1\uffff")).replace(/\uFFFF([^\uFFFF]+)\uFFFF/g,'\x3cspan class\x3d"dijitComboBoxHighlightMatch"\x3e$1\x3c/span\x3e')},_escapeHtml:function(a){return a=String(a).replace(/&/gm,"\x26amp;").replace(/</gm,"\x26lt;").replace(/>/gm,"\x26gt;").replace(/"/gm,"\x26quot;")},reset:function(){this.item=null;this.inherited(arguments)},
labelFunc:function(a,b){return(b._oldAPI?b.getValue(a,this.labelAttr||this.searchAttr):a[this.labelAttr||this.searchAttr]).toString()},_setValueAttr:function(a,b,c,e){this._set("item",e||null);null==a&&(a="");this.inherited(arguments)}});c("dojo-bidi")&&m.extend({_setTextDirAttr:function(a){this.inherited(arguments);this.dropDown&&this.dropDown._set("textDir",a)}});return m})},"dijit/form/DataList":function(){define("dojo/_base/declare dojo/dom dojo/_base/lang dojo/query dojo/store/Memory ../registry".split(" "),
function(q,m,n,l,f,e){function k(c){return{id:c.value,value:c.value,name:n.trim(c.innerText||c.textContent||"")}}return q("dijit.form.DataList",f,{constructor:function(c,f){this.domNode=m.byId(f);n.mixin(this,c);this.id&&e.add(this);this.domNode.style.display="none";this.inherited(arguments,[{data:l("option",this.domNode).map(k)}])},destroy:function(){e.remove(this.id)},fetchSelectedItem:function(){var c=l("\x3e option[selected]",this.domNode)[0]||l("\x3e option",this.domNode)[0];return c&&k(c)}})})},
"dijit/form/_SearchMixin":function(){define("dojo/_base/declare dojo/keys dojo/_base/lang dojo/query dojo/string dojo/when ../registry".split(" "),function(q,m,n,l,f,e,k){return q("dijit.form._SearchMixin",null,{pageSize:Infinity,store:null,fetchProperties:{},query:{},list:"",_setListAttr:function(c){this._set("list",c)},searchDelay:200,searchAttr:"name",queryExpr:"${0}*",ignoreCase:!0,_patternToRegExp:function(c){return new RegExp("^"+c.replace(/(\\.)|(\*)|(\?)|\W/g,function(c,b,a,d){return a?".*":
d?".":b?b:"\\"+c})+"$",this.ignoreCase?"mi":"m")},_abortQuery:function(){this.searchTimer&&(this.searchTimer=this.searchTimer.remove());this._queryDeferHandle&&(this._queryDeferHandle=this._queryDeferHandle.remove());this._fetchHandle&&(this._fetchHandle.abort&&(this._cancelingQuery=!0,this._fetchHandle.abort(),this._cancelingQuery=!1),this._fetchHandle.cancel&&(this._cancelingQuery=!0,this._fetchHandle.cancel(),this._cancelingQuery=!1),this._fetchHandle=null)},_processInput:function(c){if(!this.disabled&&
!this.readOnly){c=c.charOrCode;this._prev_key_backspace=!1;if(c==m.DELETE||c==m.BACKSPACE)this._maskValidSubsetError=this._prev_key_backspace=!0;if(this.store)this.searchTimer=this.defer("_startSearchFromInput",1);else this.onSearch()}},onSearch:function(){},_startSearchFromInput:function(){this._startSearch(this.focusNode.value)},_startSearch:function(c){this._abortQuery();var h=this,b=n.clone(this.query),a={start:0,count:this.pageSize,queryOptions:{ignoreCase:this.ignoreCase,deep:!0}},d=f.substitute(this.queryExpr,
[c.replace(/([\\\*\?])/g,"\\$1")]),k,l=function(){var c=h._fetchHandle=h.store.query(b,a);h.disabled||h.readOnly||k!==h._lastQuery||e(c,function(d){h._fetchHandle=null;h.disabled||h.readOnly||k!==h._lastQuery||e(c.total,function(c){d.total=c;var e=h.pageSize;if(isNaN(e)||e>d.total)e=d.total;d.nextPage=function(c){a.direction=c=!1!==c;a.count=e;c?(a.start+=d.length,a.start>=d.total&&(a.count=0)):(a.start-=e,0>a.start&&(a.count=Math.max(e+a.start,0),a.start=0));0>=a.count?(d.length=0,h.onSearch(d,b,
a)):l()};h.onSearch(d,b,a)})},function(a){h._fetchHandle=null;h._cancelingQuery||console.error(h.declaredClass+" "+a.toString())})};n.mixin(a,this.fetchProperties);this.store._oldAPI?k=d:(k=this._patternToRegExp(d),k.toString=function(){return d});this._lastQuery=b[this.searchAttr]=k;this._queryDeferHandle=this.defer(l,this.searchDelay)},constructor:function(){this.query={};this.fetchProperties={}},postMixInProperties:function(){if(!this.store){var c=this.list;c&&(this.store=k.byId(c))}this.inherited(arguments)}})})},
"dijit/form/_ComboBoxMenu":function(){define("dojo/_base/declare dojo/dom-class dojo/dom-style dojo/keys ../_WidgetBase ../_TemplatedMixin ./_ComboBoxMenuMixin ./_ListMouseMixin".split(" "),function(q,m,n,l,f,e,k,c){return q("dijit.form._ComboBoxMenu",[f,e,c,k],{templateString:"\x3cdiv class\x3d'dijitReset dijitMenu' data-dojo-attach-point\x3d'containerNode' style\x3d'overflow: auto; overflow-x: hidden;' role\x3d'listbox'\x3e\x3cdiv class\x3d'dijitMenuItem dijitMenuPreviousButton' data-dojo-attach-point\x3d'previousButton' role\x3d'option'\x3e\x3c/div\x3e\x3cdiv class\x3d'dijitMenuItem dijitMenuNextButton' data-dojo-attach-point\x3d'nextButton' role\x3d'option'\x3e\x3c/div\x3e\x3c/div\x3e",
baseClass:"dijitComboBoxMenu",postCreate:function(){this.inherited(arguments);this.isLeftToRight()||(m.add(this.previousButton,"dijitMenuItemRtl"),m.add(this.nextButton,"dijitMenuItemRtl"));this.containerNode.setAttribute("role","listbox")},_createMenuItem:function(){var c=this.ownerDocument.createElement("div");c.className="dijitReset dijitMenuItem"+(this.isLeftToRight()?"":" dijitMenuItemRtl");c.setAttribute("role","option");return c},onHover:function(c){m.add(c,"dijitMenuItemHover")},onUnhover:function(c){m.remove(c,
"dijitMenuItemHover")},onSelect:function(c){m.add(c,"dijitMenuItemSelected")},onDeselect:function(c){m.remove(c,"dijitMenuItemSelected")},_page:function(c){var b=0,a=this.domNode.scrollTop,d=n.get(this.domNode,"height");for(this.getHighlightedOption()||this.selectNextNode();b<d;){var e=this.getHighlightedOption();if(c){if(!e.previousSibling||"none"==e.previousSibling.style.display)break;this.selectPreviousNode()}else{if(!e.nextSibling||"none"==e.nextSibling.style.display)break;this.selectNextNode()}e=
this.domNode.scrollTop;b+=(e-a)*(c?-1:1);a=e}},handleKey:function(c){switch(c.keyCode){case l.DOWN_ARROW:return this.selectNextNode(),!1;case l.PAGE_DOWN:return this._page(!1),!1;case l.UP_ARROW:return this.selectPreviousNode(),!1;case l.PAGE_UP:return this._page(!0),!1;default:return!0}}})})},"dijit/form/_ComboBoxMenuMixin":function(){define("dojo/_base/array dojo/_base/declare dojo/dom-attr dojo/has dojo/i18n dojo/i18n!./nls/ComboBox".split(" "),function(q,m,n,l,f){var e=m("dijit.form._ComboBoxMenuMixin"+
(l("dojo-bidi")?"_NoBidi":""),null,{_messages:null,postMixInProperties:function(){this.inherited(arguments);this._messages=f.getLocalization("dijit.form","ComboBox",this.lang)},buildRendering:function(){this.inherited(arguments);this.previousButton.innerHTML=this._messages.previousMessage;this.nextButton.innerHTML=this._messages.nextMessage},_setValueAttr:function(e){this._set("value",e);this.onChange(e)},onClick:function(e){if(e==this.previousButton)this._setSelectedAttr(null),this.onPage(-1);else if(e==
this.nextButton)this._setSelectedAttr(null),this.onPage(1);else this.onChange(e)},onChange:function(){},onPage:function(){},onClose:function(){this._setSelectedAttr(null)},_createOption:function(e,c){var f=this._createMenuItem(),b=c(e);b.html?f.innerHTML=b.label:f.appendChild(f.ownerDocument.createTextNode(b.label));""==f.innerHTML&&(f.innerHTML="\x26#160;");return f},createOptions:function(e,c,f){this.items=e;this.previousButton.style.display=0==c.start?"none":"";n.set(this.previousButton,"id",this.id+
"_prev");q.forEach(e,function(a,b){var c=this._createOption(a,f);c.setAttribute("item",b);n.set(c,"id",this.id+b);this.nextButton.parentNode.insertBefore(c,this.nextButton)},this);var b=!1;e.total&&!e.total.then&&-1!=e.total?c.start+c.count<e.total?b=!0:c.start+c.count>e.total&&c.count==e.length&&(b=!0):c.count==e.length&&(b=!0);this.nextButton.style.display=b?"":"none";n.set(this.nextButton,"id",this.id+"_next")},clearResultList:function(){for(var e=this.containerNode;2<e.childNodes.length;)e.removeChild(e.childNodes[e.childNodes.length-
2]);this._setSelectedAttr(null)},highlightFirstOption:function(){this.selectFirstNode()},highlightLastOption:function(){this.selectLastNode()},selectFirstNode:function(){this.inherited(arguments);this.getHighlightedOption()==this.previousButton&&this.selectNextNode()},selectLastNode:function(){this.inherited(arguments);this.getHighlightedOption()==this.nextButton&&this.selectPreviousNode()},getHighlightedOption:function(){return this.selected}});l("dojo-bidi")&&(e=m("dijit.form._ComboBoxMenuMixin",
e,{_createOption:function(){var e=this.inherited(arguments);this.applyTextDir(e);return e}}));return e})},"dijit/form/_ListMouseMixin":function(){define(["dojo/_base/declare","dojo/on","dojo/touch","./_ListBase"],function(q,m,n,l){return q("dijit.form._ListMouseMixin",l,{postCreate:function(){this.inherited(arguments);this.domNode.dojoClick=!0;this._listConnect("click","_onClick");this._listConnect("mousedown","_onMouseDown");this._listConnect("mouseup","_onMouseUp");this._listConnect("mouseover",
"_onMouseOver");this._listConnect("mouseout","_onMouseOut")},_onClick:function(f,e){this._setSelectedAttr(e,!1);this._deferredClick&&this._deferredClick.remove();this._deferredClick=this.defer(function(){this._deferredClick=null;this.onClick(e)})},_onMouseDown:function(f,e){this._hoveredNode&&(this.onUnhover(this._hoveredNode),this._hoveredNode=null);this._isDragging=!0;this._setSelectedAttr(e,!1)},_onMouseUp:function(f,e){this._isDragging=!1;var k=this.selected,c=this._hoveredNode;k&&e==k?this.defer(function(){this._onClick(f,
k)}):c&&this.defer(function(){this._onClick(f,c)})},_onMouseOut:function(f,e){this._hoveredNode&&(this.onUnhover(this._hoveredNode),this._hoveredNode=null);this._isDragging&&(this._cancelDrag=(new Date).getTime()+1E3)},_onMouseOver:function(f,e){this._cancelDrag&&((new Date).getTime()>this._cancelDrag&&(this._isDragging=!1),this._cancelDrag=null);this._hoveredNode=e;this.onHover(e);this._isDragging&&this._setSelectedAttr(e,!1)}})})},"dijit/form/_ListBase":function(){define(["dojo/_base/declare","dojo/on",
"dojo/window"],function(q,m,n){return q("dijit.form._ListBase",null,{selected:null,_listConnect:function(l,f){var e=this;return e.own(m(e.containerNode,m.selector(function(e,c,f){return e.parentNode==f},l),function(k){e[f](k,this)}))},selectFirstNode:function(){for(var l=this.containerNode.firstChild;l&&"none"==l.style.display;)l=l.nextSibling;this._setSelectedAttr(l,!0)},selectLastNode:function(){for(var l=this.containerNode.lastChild;l&&"none"==l.style.display;)l=l.previousSibling;this._setSelectedAttr(l,
!0)},selectNextNode:function(){var l=this.selected;if(l){for(l=l.nextSibling;l&&"none"==l.style.display;)l=l.nextSibling;l?this._setSelectedAttr(l,!0):this.selectFirstNode()}else this.selectFirstNode()},selectPreviousNode:function(){var l=this.selected;if(l){for(l=l.previousSibling;l&&"none"==l.style.display;)l=l.previousSibling;l?this._setSelectedAttr(l,!0):this.selectLastNode()}else this.selectLastNode()},_setSelectedAttr:function(l,f){if(this.selected!=l){var e=this.selected;if(e)this.onDeselect(e);
l&&(f&&n.scrollIntoView(l),this.onSelect(l));this._set("selected",l)}else if(l)this.onSelect(l)}})})},"dijit/form/NumberSpinner":function(){define(["dojo/_base/declare","dojo/keys","./_Spinner","./NumberTextBox"],function(q,m,n,l){return q("dijit.form.NumberSpinner",[n,l.Mixin],{baseClass:"dijitTextBox dijitSpinner dijitNumberTextBox",adjust:function(f,e){var k=this.constraints,c=isNaN(f),h=!isNaN(k.max),b=!isNaN(k.min);c&&0!=e&&(f=0<e?b?k.min:h?k.max:0:h?this.constraints.max:b?k.min:0);var a=f+e;
if(c||isNaN(a))return f;h&&a>k.max&&(a=k.max);b&&a<k.min&&(a=k.min);return a},_onKeyDown:function(f){if(!(this.disabled||this.readOnly||f.keyCode!=m.HOME&&f.keyCode!=m.END||f.ctrlKey||f.altKey||f.metaKey||"undefined"==typeof this.get("value"))){var e=this.constraints[f.keyCode==m.HOME?"min":"max"];"number"==typeof e&&this._setValueAttr(e,!1);f.stopPropagation();f.preventDefault()}}})})},"dijit/form/_Spinner":function(){define("dojo/_base/declare dojo/keys dojo/_base/lang dojo/sniff dojo/mouse dojo/on ../typematic ./RangeBoundTextBox dojo/text!./templates/Spinner.html ./_TextBoxMixin".split(" "),
function(q,m,n,l,f,e,k,c,h,b){return q("dijit.form._Spinner",c,{defaultTimeout:500,minimumTimeout:10,timeoutChangeRate:.9,smallDelta:1,largeDelta:10,templateString:h,baseClass:"dijitTextBox dijitSpinner",cssStateNodes:{upArrowNode:"dijitUpArrowButton",downArrowNode:"dijitDownArrowButton"},adjust:function(a){return a},_arrowPressed:function(a,c,e){this.disabled||this.readOnly||(this._setValueAttr(this.adjust(this.get("value"),c*e),!1),b.selectInputText(this.textbox,this.textbox.value.length))},_arrowReleased:function(){this._wheelTimer=
null},_typematicCallback:function(a,b,c){var d=this.smallDelta;b==this.textbox&&(b=c.keyCode,d=b==m.PAGE_UP||b==m.PAGE_DOWN?this.largeDelta:this.smallDelta,b=b==m.UP_ARROW||b==m.PAGE_UP?this.upArrowNode:this.downArrowNode);-1==a?this._arrowReleased(b):this._arrowPressed(b,b==this.upArrowNode?1:-1,d)},_wheelTimer:null,_mouseWheeled:function(a){if(this.focused){a.stopPropagation();a.preventDefault();var b=a.wheelDelta/120;Math.floor(b)!=b&&(b=0<a.wheelDelta?1:-1);a=a.detail?-1*a.detail:b;if(0!==a){var c=
this[0<a?"upArrowNode":"downArrowNode"];this._arrowPressed(c,a,this.smallDelta);this._wheelTimer&&this._wheelTimer.remove();this._wheelTimer=this.defer(function(){this._arrowReleased(c)},50)}}},_setConstraintsAttr:function(a){this.inherited(arguments);this.focusNode&&(void 0!==this.constraints.min?this.focusNode.setAttribute("aria-valuemin",this.constraints.min):this.focusNode.removeAttribute("aria-valuemin"),void 0!==this.constraints.max?this.focusNode.setAttribute("aria-valuemax",this.constraints.max):
this.focusNode.removeAttribute("aria-valuemax"))},_setValueAttr:function(a,b){this.focusNode.setAttribute("aria-valuenow",a);this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.own(e(this.domNode,f.wheel,n.hitch(this,"_mouseWheeled")),k.addListener(this.upArrowNode,this.textbox,{keyCode:m.UP_ARROW,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1},this,"_typematicCallback",this.timeoutChangeRate,this.defaultTimeout,this.minimumTimeout),k.addListener(this.downArrowNode,this.textbox,
{keyCode:m.DOWN_ARROW,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1},this,"_typematicCallback",this.timeoutChangeRate,this.defaultTimeout,this.minimumTimeout),k.addListener(this.upArrowNode,this.textbox,{keyCode:m.PAGE_UP,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1},this,"_typematicCallback",this.timeoutChangeRate,this.defaultTimeout,this.minimumTimeout),k.addListener(this.downArrowNode,this.textbox,{keyCode:m.PAGE_DOWN,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1},this,"_typematicCallback",this.timeoutChangeRate,
this.defaultTimeout,this.minimumTimeout))}})})},"dijit/typematic":function(){define("dojo/_base/array dojo/_base/connect dojo/_base/lang dojo/on dojo/sniff ./main".split(" "),function(q,m,n,l,f,e){var k=e.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(0>this._currentTimeout?this._initialDelay:1<this._subsequentDelay?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay),this._minDelay);
this._timer=setTimeout(n.hitch(this,"_fireEventAndReload"),this._currentTimeout)},trigger:function(c,e,b,a,d,f,k,g){if(d!=this._obj){this.stop();this._initialDelay=k||500;this._subsequentDelay=f||.9;this._minDelay=g||10;this._obj=d;this._node=b;this._count=this._currentTimeout=-1;this._callback=n.hitch(e,a);this._evt={faux:!0};for(var h in c)"layerX"!=h&&"layerY"!=h&&(e=c[h],"function"!=typeof e&&"undefined"!=typeof e&&(this._evt[h]=e));this._fireEventAndReload()}},stop:function(){this._timer&&(clearTimeout(this._timer),
this._timer=null);this._obj&&(this._callback(-1,this._node,this._evt),this._obj=null)},addKeyListener:function(c,e,b,a,d,f,v){var g="keyCode"in e?"keyCode":"charCode"in e?"charCode":"charOrCode",h=[l(c,"keyCode"in e?"keydown":"charCode"in e?"keypress":m._keypress,n.hitch(this,function(h){h[g]!=e[g]||void 0!==e.ctrlKey&&e.ctrlKey!=h.ctrlKey||void 0!==e.altKey&&e.altKey!=h.altKey||void 0!==e.metaKey&&e.metaKey!=(h.metaKey||!1)||void 0!==e.shiftKey&&e.shiftKey!=h.shiftKey?k._obj==e&&k.stop():(h.stopPropagation(),
h.preventDefault(),k.trigger(h,b,c,a,e,d,f,v))})),l(c,"keyup",n.hitch(this,function(){k._obj==e&&k.stop()}))];return{remove:function(){q.forEach(h,function(a){a.remove()})}}},addMouseListener:function(c,e,b,a,d,m){var h=[l(c,"mousedown",n.hitch(this,function(f){f.preventDefault();k.trigger(f,e,c,b,c,a,d,m)})),l(c,"mouseup",n.hitch(this,function(a){this._obj&&a.preventDefault();k.stop()})),l(c,"mouseout",n.hitch(this,function(a){this._obj&&a.preventDefault();k.stop()})),l(c,"dblclick",n.hitch(this,
function(g){g.preventDefault();9>f("ie")&&(k.trigger(g,e,c,b,c,a,d,m),setTimeout(n.hitch(this,k.stop),50))}))];return{remove:function(){q.forEach(h,function(a){a.remove()})}}},addListener:function(c,e,b,a,d,f,k,g){var h=[this.addKeyListener(e,b,a,d,f,k,g),this.addMouseListener(c,a,d,f,k,g)];return{remove:function(){q.forEach(h,function(a){a.remove()})}}}};return k})},"dijit/form/SimpleTextarea":function(){define(["dojo/_base/declare","dojo/dom-class","dojo/sniff","./TextBox"],function(q,m,n,l){return q("dijit.form.SimpleTextarea",
l,{baseClass:"dijitTextBox dijitTextArea",rows:"3",cols:"20",templateString:"\x3ctextarea ${!nameAttrSetting} data-dojo-attach-point\x3d'focusNode,containerNode,textbox' autocomplete\x3d'off'\x3e\x3c/textarea\x3e",postMixInProperties:function(){!this.value&&this.srcNodeRef&&(this.value=this.srcNodeRef.value);this.inherited(arguments)},buildRendering:function(){this.inherited(arguments);n("ie")&&this.cols&&m.add(this.textbox,"dijitTextAreaCols")},filter:function(f){f&&(f=f.replace(/\r/g,""));return this.inherited(arguments)},
_onInput:function(f){if(this.maxLength){var e=parseInt(this.maxLength),k=this.textbox.value.replace(/\r/g,""),e=k.length-e;if(0<e){var c=this.textbox;if(c.selectionStart){var h=c.selectionStart,b=0;n("opera")&&(b=(this.textbox.value.substring(0,h).match(/\r/g)||[]).length);this.textbox.value=k.substring(0,h-e-b)+k.substring(h-b);c.setSelectionRange(h-e,h-e)}else this.ownerDocument.selection&&(c.focus(),k=this.ownerDocument.selection.createRange(),k.moveStart("character",-e),k.text="",k.select())}}this.inherited(arguments)}})})},
"dijit/form/TimeTextBox":function(){define("dojo/_base/declare dojo/keys dojo/query dojo/_base/lang ../_TimePicker ./_DateTimeTextBox".split(" "),function(q,m,n,l,f,e){return q("dijit.form.TimeTextBox",e,{baseClass:"dijitTextBox dijitComboBox dijitTimeTextBox",popupClass:f,_selector:"time",value:new Date(""),maxHeight:-1,openDropDown:function(e){this.inherited(arguments);var c=n(".dijitTimePickerItemSelected",this.dropDown.domNode),f=this.dropDown.domNode.parentNode;f.scrollTop=c[0]?c[0].offsetTop-
(f.clientHeight-c[0].clientHeight)/2:(f.scrollHeight-f.clientHeight)/2;this.dropDown.on("input",l.hitch(this,function(){this.set("value",this.dropDown.get("value"),!1)}))},_onInput:function(){this.inherited(arguments);var e=this.get("displayedValue");this.filterString=e&&!this.parse(e,this.constraints)?e.toLowerCase():"";this._opened&&this.closeDropDown();this.openDropDown()}})})},"dijit/_TimePicker":function(){define("dojo/_base/array dojo/date dojo/date/locale dojo/date/stamp dojo/_base/declare dojo/dom-class dojo/dom-construct dojo/_base/kernel dojo/keys dojo/_base/lang dojo/sniff dojo/query dojo/mouse dojo/on ./_WidgetBase ./form/_ListMouseMixin".split(" "),
function(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u){return f("dijit._TimePicker",[g,u],{baseClass:"dijitTimePicker",pickerMin:"T00:00:00",pickerMax:"T23:59:59",clickableIncrement:"T00:15:00",visibleIncrement:"T01:00:00",value:new Date,_visibleIncrement:2,_clickableIncrement:1,_totalIncrements:10,constraints:{},serialize:l.toISOString,buildRendering:function(){this.inherited(arguments);this.timeMenu=this.containerNode=this.domNode},setValue:function(a){c.deprecated("dijit._TimePicker:setValue() is deprecated.  Use set('value', ...) instead.",
"","2.0");this.set("value",a)},_setValueAttr:function(a){this._set("value",a);this._showText()},_setFilterStringAttr:function(a){this._set("filterString",a);this._showText()},isDisabledDate:function(){return!1},_getFilteredNodes:function(a,b,c,d){a=this.ownerDocument.createDocumentFragment();for(b=0;b<this._maxIncrement;b++)(c=this._createOption(b))&&a.appendChild(c);return a},_showText:function(){var a=l.fromISOString;this.domNode.innerHTML="";this._clickableIncrementDate=a(this.clickableIncrement);
this._visibleIncrementDate=a(this.visibleIncrement);var b=function(a){return 3600*a.getHours()+60*a.getMinutes()+a.getSeconds()},c=b(this._clickableIncrementDate),b=b(this._visibleIncrementDate);(this.value||this.currentFocus).getTime();this._refDate=a(this.pickerMin);this._refDate.setFullYear(1970,0,1);this._clickableIncrement=1;this._visibleIncrement=b/c;a=a(this.pickerMax);a.setFullYear(1970,0,1);a=.001*(a.getTime()-this._refDate.getTime());this._maxIncrement=Math.ceil((a+1)/c);c=this._getFilteredNodes();
!c.firstChild&&this.filterString?(this.filterString="",this._showText()):this.domNode.appendChild(c)},constructor:function(){this.constraints={}},postMixInProperties:function(){this.inherited(arguments);this._setConstraintsAttr(this.constraints)},_setConstraintsAttr:function(a){for(var b in{clickableIncrement:1,visibleIncrement:1,pickerMin:1,pickerMax:1})b in a&&(this[b]=a[b]);a.locale||(a.locale=this.lang)},_createOption:function(a){var b=new Date(this._refDate),c=this._clickableIncrementDate;b.setHours(b.getHours()+
c.getHours()*a,b.getMinutes()+c.getMinutes()*a,b.getSeconds()+c.getSeconds()*a);"time"==this.constraints.selector&&b.setFullYear(1970,0,1);var d=n.format(b,this.constraints);if(this.filterString&&0!==d.toLowerCase().indexOf(this.filterString))return null;c=this.ownerDocument.createElement("div");c.className=this.baseClass+"Item";c.date=b;c.idx=a;k.create("div",{"class":this.baseClass+"ItemInner",innerHTML:d},c);d=1>a%this._visibleIncrement&&-1<a%this._visibleIncrement;a=!d&&!(a%this._clickableIncrement);
d?c.className+=" "+this.baseClass+"Marker":a&&(c.className+=" "+this.baseClass+"Tick");this.isDisabledDate(b)&&(c.className+=" "+this.baseClass+"ItemDisabled");this.value&&!m.compare(this.value,b,this.constraints.selector)&&(c.selected=!0,c.className+=" "+this.baseClass+"ItemSelected",this._selectedDiv=c,d?c.className+=" "+this.baseClass+"MarkerSelected":a&&(c.className+=" "+this.baseClass+"TickSelected"),this._highlightOption(c,!0));return c},onOpen:function(){this.inherited(arguments);this.set("selected",
this._selectedDiv)},_onOptionSelected:function(a,b){var c=a.target.date||a.target.parentNode.date;c&&!this.isDisabledDate(c)&&(this._set("value",c),this.emit("input"),b&&(this._highlighted_option=null,this.set("value",c),this.onChange(c)))},onChange:function(){},_highlightOption:function(a,b){if(a){if(b)this._highlighted_option&&this._highlightOption(this._highlighted_option,!1),this._highlighted_option=a;else{if(this._highlighted_option!==a)return;this._highlighted_option=null}e.toggle(a,this.baseClass+
"ItemHover",b);e.contains(a,this.baseClass+"Marker")?e.toggle(a,this.baseClass+"MarkerHover",b):e.toggle(a,this.baseClass+"TickHover",b)}},handleKey:function(a){if(a.keyCode==h.DOWN_ARROW)return this.selectNextNode(),this._onOptionSelected({target:this._highlighted_option},!1),a.stopPropagation(),a.preventDefault(),!1;if(a.keyCode==h.UP_ARROW)return this.selectPreviousNode(),this._onOptionSelected({target:this._highlighted_option},!1),a.stopPropagation(),a.preventDefault(),!1;if(a.keyCode==h.ENTER||
a.keyCode===h.TAB){if(!this._keyboardSelected&&a.keyCode===h.TAB)return!0;this._highlighted_option&&this._onOptionSelected({target:this._highlighted_option},!0);return a.keyCode===h.TAB}},onHover:function(a){this._highlightOption(a,!0)},onUnhover:function(a){this._highlightOption(a,!1)},onSelect:function(a){this._highlightOption(a,!0)},onDeselect:function(a){this._highlightOption(a,!1)},onClick:function(a){this._onOptionSelected({target:a},!0)}})})},"dojo/data/ItemFileReadStore":function(){define("../_base/kernel ../_base/lang ../_base/declare ../_base/array ../_base/xhr ../Evented ./util/filter ./util/simpleFetch ../date/stamp".split(" "),
function(q,m,n,l,f,e,k,c,h){n=n("dojo.data.ItemFileReadStore",[e],{constructor:function(b){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=!1;this.url=this._ccUrl=this._jsonFileUrl=b.url;this._jsonData=b.data;this.data=null;this._datatypeMap=b.typeMap||{};this._datatypeMap.Date||(this._datatypeMap.Date={type:Date,deserialize:function(a){return h.fromISOString(a)}});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!==b.urlPreventCache&&(this.urlPreventCache=b.urlPreventCache?!0:!1);void 0!==b.hierarchical&&(this.hierarchical=b.hierarchical?!0:!1);b.clearOnClose&&(this.clearOnClose=!0);"failOk"in b&&(this.failOk=b.failOk?!0:!1)},url:"",_ccUrl:"",data:null,typeMap:null,clearOnClose:!1,urlPreventCache:!1,failOk:!1,hierarchical:!0,_assertIsItem:function(b){if(!this.isItem(b))throw Error(this.declaredClass+
": Invalid item argument.");},_assertIsAttribute:function(b){if("string"!==typeof b)throw Error(this.declaredClass+": Invalid attribute argument.");},getValue:function(b,a,c){b=this.getValues(b,a);return 0<b.length?b[0]:c},getValues:function(b,a){this._assertIsItem(b);this._assertIsAttribute(a);return(b[a]||[]).slice(0)},getAttributes:function(b){this._assertIsItem(b);var a=[],c;for(c in b)c!==this._storeRefPropName&&c!==this._itemNumPropName&&c!==this._rootItemPropName&&c!==this._reverseRefMap&&
a.push(c);return a},hasAttribute:function(b,a){this._assertIsItem(b);this._assertIsAttribute(a);return a in b},containsValue:function(b,a,c){var d=void 0;"string"===typeof c&&(d=k.patternToRegExp(c,!1));return this._containsValue(b,a,c,d)},_containsValue:function(b,a,c,e){return l.some(this.getValues(b,a),function(a){if(null!==a&&!m.isObject(a)&&e){if(a.toString().match(e))return!0}else if(c===a)return!0})},isItem:function(b){return b&&b[this._storeRefPropName]===this&&this._arrayOfAllItems[b[this._itemNumPropName]]===
b?!0:!1},isItemLoaded:function(b){return this.isItem(b)},loadItem:function(b){this._assertIsItem(b.item)},getFeatures:function(){return this._features},getLabel:function(b){if(this._labelAttr&&this.isItem(b))return this.getValue(b,this._labelAttr)},getLabelAttributes:function(b){return this._labelAttr?[this._labelAttr]:null},filter:function(b,a,c){var d=[],e,f;if(b.query){var h;e=b.queryOptions?b.queryOptions.ignoreCase:!1;var p={};for(f in b.query)h=b.query[f],"string"===typeof h?p[f]=k.patternToRegExp(h,
e):h instanceof RegExp&&(p[f]=h);for(e=0;e<a.length;++e){var l=!0,m=a[e];if(null===m)l=!1;else for(f in b.query)h=b.query[f],this._containsValue(m,f,h,p[f])||(l=!1);l&&d.push(m)}}else for(e=0;e<a.length;++e)f=a[e],null!==f&&d.push(f);c(d,b)},_fetchItems:function(b,a,c){var d=this;if(this._loadFinished)this.filter(b,this._getItemsArray(b.queryOptions),a);else if(this._jsonFileUrl!==this._ccUrl?(q.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:b,filter:m.hitch(d,"filter"),findCallback:m.hitch(d,a)});else{this._loadInProgress=!0;var e=f.get({url:d._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});e.addCallback(function(e){try{d._getItemsFromLoadedData(e),
d._loadFinished=!0,d._loadInProgress=!1,d.filter(b,d._getItemsArray(b.queryOptions),a),d._handleQueuedFetches()}catch(p){d._loadFinished=!0,d._loadInProgress=!1,c(p,b)}});e.addErrback(function(a){d._loadInProgress=!1;c(a,b)});var g=null;b.abort&&(g=b.abort);b.abort=function(){var a=e;a&&-1===a.fired&&(a.cancel(),a=null);g&&g.call(b)}}else if(this._jsonData)try{this._loadFinished=!0,this._getItemsFromLoadedData(this._jsonData),this._jsonData=null,d.filter(b,this._getItemsArray(b.queryOptions),a)}catch(u){c(u,
b)}else c(Error(this.declaredClass+": No JSON source data was provided as either URL or a nested Javascript object."),b)},_handleQueuedFetches:function(){if(0<this._queuedFetches.length){for(var b=0;b<this._queuedFetches.length;b++){var a=this._queuedFetches[b],c=a.args,e=a.filter,a=a.findCallback;e?e(c,this._getItemsArray(c.queryOptions),a):this.fetchItemByIdentity(c)}this._queuedFetches=[]}},_getItemsArray:function(b){return b&&b.deep?this._arrayOfAllItems:this._arrayOfTopLevelItems},close:function(b){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(b){function a(a){return null!==
a&&"object"===typeof a&&(!m.isArray(a)||e)&&!m.isFunction(a)&&(a.constructor==Object||m.isArray(a))&&"undefined"===typeof a._reference&&"undefined"===typeof a._type&&"undefined"===typeof a._value&&f.hierarchical}function c(b){f._arrayOfAllItems.push(b);for(var d in b){var e=b[d];if(e)if(m.isArray(e))for(var g=0;g<e.length;++g){var h=e[g];a(h)&&c(h)}else a(e)&&c(e)}}var e=!1,f=this;this._labelAttr=b.label;var g,h;this._arrayOfAllItems=[];this._arrayOfTopLevelItems=b.items;for(g=0;g<this._arrayOfTopLevelItems.length;++g)h=
this._arrayOfTopLevelItems[g],m.isArray(h)&&(e=!0),c(h),h[this._rootItemPropName]=!0;var k={},l;for(g=0;g<this._arrayOfAllItems.length;++g)for(l in h=this._arrayOfAllItems[g],h){if(l!==this._rootItemPropName){var n=h[l];null!==n?m.isArray(n)||(h[l]=[n]):h[l]=[null]}k[l]=l}for(;k[this._storeRefPropName];)this._storeRefPropName+="_";for(;k[this._itemNumPropName];)this._itemNumPropName+="_";for(;k[this._reverseRefMap];)this._reverseRefMap+="_";if(k=b.identifier)for(this._itemsByIdentity={},this._features["dojo.data.api.Identity"]=
k,g=0;g<this._arrayOfAllItems.length;++g)if(h=this._arrayOfAllItems[g],b=h[k],b=b[0],Object.hasOwnProperty.call(this._itemsByIdentity,b)){if(this._jsonFileUrl)throw Error(this.declaredClass+":  The json data as specified by: ["+this._jsonFileUrl+"] is malformed.  Items within the list have identifier: ["+k+"].  Value collided: ["+b+"]");if(this._jsonData)throw Error(this.declaredClass+":  The json data provided by the creation arguments is malformed.  Items within the list have identifier: ["+k+"].  Value collided: ["+
b+"]");}else this._itemsByIdentity[b]=h;else this._features["dojo.data.api.Identity"]=Number;for(g=0;g<this._arrayOfAllItems.length;++g)h=this._arrayOfAllItems[g],h[this._storeRefPropName]=this,h[this._itemNumPropName]=g;for(g=0;g<this._arrayOfAllItems.length;++g)for(l in h=this._arrayOfAllItems[g],h)for(b=h[l],k=0;k<b.length;++k)if(n=b[k],null!==n&&"object"==typeof n){if("_type"in n&&"_value"in n){var q=n._type,B=this._datatypeMap[q];if(B)if(m.isFunction(B))b[k]=new B(n._value);else if(m.isFunction(B.deserialize))b[k]=
B.deserialize(n._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 '"+q+"'");}if(n._reference){n=n._reference;if(m.isObject(n))for(q=0;q<this._arrayOfAllItems.length;++q){var B=this._arrayOfAllItems[q],x=!0,w;for(w in n)B[w]!=n[w]&&(x=!1);x&&(b[k]=B)}else b[k]=this._getItemByIdentity(n);
this.referenceIntegrity&&(n=b[k],this.isItem(n)&&this._addReferenceToMap(n,h,l))}else this.isItem(n)&&this.referenceIntegrity&&this._addReferenceToMap(n,h,l)}},_addReferenceToMap:function(b,a,c){},getIdentity:function(b){var a=this._features["dojo.data.api.Identity"];return a===Number?b[this._itemNumPropName]:(b=b[a])?b[0]:null},fetchItemByIdentity:function(b){var a,c;if(this._loadFinished)a=this._getItemByIdentity(b.identity),b.onItem&&(c=b.scope?b.scope:q.global,b.onItem.call(c,a));else{var e=this;
this._jsonFileUrl!==this._ccUrl?(q.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:b}):(this._loadInProgress=!0,c=f.get({url:e._jsonFileUrl,
handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk}),c.addCallback(function(c){var d=b.scope?b.scope:q.global;try{e._getItemsFromLoadedData(c),e._loadFinished=!0,e._loadInProgress=!1,a=e._getItemByIdentity(b.identity),b.onItem&&b.onItem.call(d,a),e._handleQueuedFetches()}catch(u){e._loadInProgress=!1,b.onError&&b.onError.call(d,u)}}),c.addErrback(function(a){e._loadInProgress=!1;b.onError&&b.onError.call(b.scope?b.scope:q.global,a)})):this._jsonData&&(e._getItemsFromLoadedData(e._jsonData),
e._jsonData=null,e._loadFinished=!0,a=e._getItemByIdentity(b.identity),b.onItem&&(c=b.scope?b.scope:q.global,b.onItem.call(c,a)))}},_getItemByIdentity:function(b){var a=null;this._itemsByIdentity?Object.hasOwnProperty.call(this._itemsByIdentity,b)&&(a=this._itemsByIdentity[b]):Object.hasOwnProperty.call(this._arrayOfAllItems,b)&&(a=this._arrayOfAllItems[b]);void 0===a&&(a=null);return a},getIdentityAttributes:function(b){b=this._features["dojo.data.api.Identity"];return b===Number?null:[b]},_forceLoad:function(){var b=
this;this._jsonFileUrl!==this._ccUrl?(q.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 a=f.get({url:this._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk,
sync:!0});a.addCallback(function(a){try{if(!0!==b._loadInProgress&&!b._loadFinished)b._getItemsFromLoadedData(a),b._loadFinished=!0;else if(b._loadInProgress)throw Error(this.declaredClass+":  Unable to perform a synchronous load, an async load is in progress.");}catch(t){throw console.log(t),t;}});a.addErrback(function(a){throw a;})}else this._jsonData&&(b._getItemsFromLoadedData(b._jsonData),b._jsonData=null,b._loadFinished=!0)}});m.extend(n,c);return n})},"dojo/data/util/filter":function(){define(["../../_base/lang"],
function(q){var m={};q.setObject("dojo.data.util.filter",m);m.patternToRegExp=function(m,l){for(var f="^",e=null,k=0;k<m.length;k++)switch(e=m.charAt(k),e){case "\\":f+=e;k++;f+=m.charAt(k);break;case "*":f+=".*";break;case "?":f+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":f+="\\";default:f+=e}f+="$";return l?new RegExp(f,"mi"):new RegExp(f,"m")};return m})},"dojo/data/util/simpleFetch":function(){define(["../../_base/lang",
"../../_base/kernel","./sorter"],function(q,m,n){var l={};q.setObject("dojo.data.util.simpleFetch",l);l.errorHandler=function(f,e){e.onError&&e.onError.call(e.scope||m.global,f,e)};l.fetchHandler=function(f,e){var k=e.abort||null,c=!1,h=e.start?e.start:0,b=e.count&&Infinity!==e.count?h+e.count:f.length;e.abort=function(){c=!0;k&&k.call(e)};var a=e.scope||m.global;e.store||(e.store=this);e.onBegin&&e.onBegin.call(a,f.length,e);e.sort&&f.sort(n.createSortFunction(e.sort,this));if(e.onItem)for(var d=
h;d<f.length&&d<b;++d){var l=f[d];c||e.onItem.call(a,l,e)}e.onComplete&&!c&&(d=null,e.onItem||(d=f.slice(h,b)),e.onComplete.call(a,d,e))};l.fetch=function(f){f=f||{};f.store||(f.store=this);this._fetchItems(f,q.hitch(this,"fetchHandler"),q.hitch(this,"errorHandler"));return f};return l})},"dojo/data/util/sorter":function(){define(["../../_base/lang"],function(q){var m={};q.setObject("dojo.data.util.sorter",m);m.basicComparator=function(m,l){var f=-1;null===m&&(m=void 0);null===l&&(l=void 0);if(m==
l)f=0;else if(m>l||null==m)f=1;return f};m.createSortFunction=function(n,l){function f(a,b,c,d){return function(e,f){var g=d.getValue(e,a),h=d.getValue(f,a);return b*c(g,h)}}for(var e=[],k,c=l.comparatorMap,h=m.basicComparator,b=0;b<n.length;b++){k=n[b];var a=k.attribute;if(a){k=k.descending?-1:1;var d=h;c&&("string"!==typeof a&&"toString"in a&&(a=a.toString()),d=c[a]||h);e.push(f(a,k,d,l))}}return function(a,b){for(var c=0;c<e.length;){var d=e[c++](a,b);if(0!==d)return d}return 0}};return m})},"dojox/date/islamic":function(){define(["dojox/main",
"dojo/_base/lang","dojo/date","./islamic/Date"],function(q,m,n,l){var f=m.getObject("date.islamic",!0,q);f.getDaysInMonth=function(e){return e.getDaysInIslamicMonth(e.getMonth(),e.getFullYear())};f.compare=function(e,f,c){e instanceof l&&(e=e.toGregorian());f instanceof l&&(f=f.toGregorian());return n.compare.apply(null,arguments)};f.add=function(e,f,c){var h=new l(e);switch(f){case "day":h.setDate(e.getDate()+c);break;case "weekday":var b=e.getDay();if(5>b+c&&0<b+c)h.setDate(e.getDate()+c);else{var a=
f=0;5==b?(b=4,a=0<c?-1:1):6==b&&(b=4,a=0<c?-2:2);var b=0<c?5-b-1:-b,d=c-b,k=parseInt(d/5);0!=d%5&&(f=0<c?2:-2);f=f+7*k+d%5+b;h.setDate(e.getDate()+f+a)}break;case "year":h.setFullYear(e.getFullYear()+c);break;case "week":c*=7;h.setDate(e.getDate()+c);break;case "month":e=e.getMonth();h.setMonth(e+c);break;case "hour":h.setHours(e.getHours()+c);break;case "minute":h._addMinutes(c);break;case "second":h._addSeconds(c);break;case "millisecond":h._addMilliseconds(c)}return h};f.difference=function(e,
k,c){k=k||new l;c=c||"day";var h=k.getFullYear()-e.getFullYear(),b=1;switch(c){case "weekday":h=Math.round(f.difference(e,k,"day"));b=parseInt(f.difference(e,k,"week"));if(0==h%7)h=5*b;else{c=0;var a=e.getDay(),d=k.getDay(),b=parseInt(h/7);k=h%7;e=new l(e);e.setDate(e.getDate()+7*b);e=e.getDay();if(0<h)switch(!0){case 5==a:c=-1;break;case 6==a:c=0;break;case 5==d:c=-1;break;case 6==d:c=-2;break;case 5<e+k:c=-2}else if(0>h)switch(!0){case 5==a:c=0;break;case 6==a:c=1;break;case 5==d:c=2;break;case 6==
d:c=1;break;case 0>e+k:c=2}h=h+c-2*b}b=h;break;case "year":b=h;break;case "month":c=k.toGregorian()>e.toGregorian()?k:e;a=k.toGregorian()>e.toGregorian()?e:k;b=c.getMonth();d=a.getMonth();if(0==h)b=c.getMonth()-a.getMonth();else for(b=12-d+b,h=a.getFullYear()+1,c=c.getFullYear(),h;h<c;h++)b+=12;k.toGregorian()<e.toGregorian()&&(b=-b);break;case "week":b=parseInt(f.difference(e,k,"day")/7);break;case "day":b/=24;case "hour":b/=60;case "minute":b/=60;case "second":b/=1E3;case "millisecond":b*=k.toGregorian().getTime()-
e.toGregorian().getTime()}return Math.round(b)};return f})},"dojox/main":function(){define(["dojo/_base/kernel"],function(q){return q.dojox})},"dojox/date/islamic/Date":function(){define(["dojo/_base/lang","dojo/_base/declare","dojo/date"],function(q,m,n){var l=m("dojox.date.islamic.Date",null,{_date:0,_month:0,_year:0,_hours:0,_minutes:0,_seconds:0,_milliseconds:0,_day:0,_GREGORIAN_EPOCH:1721425.5,_ISLAMIC_EPOCH:1948439.5,constructor:function(){var f=arguments.length;f?1==f?(f=arguments[0],"number"==
typeof f&&(f=new Date(f)),f instanceof Date?this.fromGregorian(f):""==f?this._date=new Date(""):(this._year=f._year,this._month=f._month,this._date=f._date,this._hours=f._hours,this._minutes=f._minutes,this._seconds=f._seconds,this._milliseconds=f._milliseconds)):3<=f&&(this._year+=arguments[0],this._month+=arguments[1],this._date+=arguments[2],this._hours+=arguments[3]||0,this._minutes+=arguments[4]||0,this._seconds+=arguments[5]||0,this._milliseconds+=arguments[6]||0):this.fromGregorian(new Date)},
getDate:function(){return this._date},getMonth:function(){return this._month},getFullYear:function(){return this._year},getDay:function(){return this.toGregorian().getDay()},getHours:function(){return this._hours},getMinutes:function(){return this._minutes},getSeconds:function(){return this._seconds},getMilliseconds:function(){return this._milliseconds},setDate:function(f){f=parseInt(f);if(!(0<f&&f<=this.getDaysInIslamicMonth(this._month,this._year))){var e;if(0<f)for(e=this.getDaysInIslamicMonth(this._month,
this._year);f>e;f-=e,e=this.getDaysInIslamicMonth(this._month,this._year))this._month++,12<=this._month&&(this._year++,this._month-=12);else for(e=this.getDaysInIslamicMonth(0<=this._month-1?this._month-1:11,0<=this._month-1?this._year:this._year-1);0>=f;e=this.getDaysInIslamicMonth(0<=this._month-1?this._month-1:11,0<=this._month-1?this._year:this._year-1))this._month--,0>this._month&&(this._year--,this._month+=12),f+=e}this._date=f;return this},setFullYear:function(f){this._year=+f},setMonth:function(f){this._year+=
Math.floor(f/12);this._month=0<f?Math.floor(f%12):Math.floor((f%12+12)%12)},setHours:function(){var f=arguments.length,e=0;1<=f&&(e=parseInt(arguments[0]));2<=f&&(this._minutes=parseInt(arguments[1]));3<=f&&(this._seconds=parseInt(arguments[2]));4==f&&(this._milliseconds=parseInt(arguments[3]));for(;24<=e;)this._date++,f=this.getDaysInIslamicMonth(this._month,this._year),this._date>f&&(this._month++,12<=this._month&&(this._year++,this._month-=12),this._date-=f),e-=24;this._hours=e},_addMinutes:function(f){f+=
this._minutes;this.setMinutes(f);this.setHours(this._hours+parseInt(f/60));return this},_addSeconds:function(f){f+=this._seconds;this.setSeconds(f);this._addMinutes(parseInt(f/60));return this},_addMilliseconds:function(f){f+=this._milliseconds;this.setMilliseconds(f);this._addSeconds(parseInt(f/1E3));return this},setMinutes:function(f){this._minutes=f%60;return this},setSeconds:function(f){this._seconds=f%60;return this},setMilliseconds:function(f){this._milliseconds=f%1E3;return this},toString:function(){if(isNaN(this._date))return"Invalidate Date";
var f=new Date;f.setHours(this._hours);f.setMinutes(this._minutes);f.setSeconds(this._seconds);f.setMilliseconds(this._milliseconds);return this._month+" "+this._date+" "+this._year+" "+f.toTimeString()},toGregorian:function(){var f=this._year,f=Math.floor(this._date+Math.ceil(29.5*this._month)+354*(f-1)+Math.floor((3+11*f)/30)+this._ISLAMIC_EPOCH-1-.5)+.5,e=f-this._GREGORIAN_EPOCH,k=Math.floor(e/146097),c=this._mod(e,146097),e=Math.floor(c/36524),h=this._mod(c,36524),c=Math.floor(h/1461),h=this._mod(h,
1461),h=Math.floor(h/365),k=400*k+100*e+4*c+h;4!=e&&4!=h&&k++;e=f-(this._GREGORIAN_EPOCH+365*(k-1)+Math.floor((k-1)/4)-Math.floor((k-1)/100)+Math.floor((k-1)/400));c=this._GREGORIAN_EPOCH-1+365*(k-1)+Math.floor((k-1)/4)-Math.floor((k-1)/100)+Math.floor((k-1)/400)+Math.floor(739/12+(n.isLeapYear(new Date(k,3,1))?-1:-2)+1);c=f<c?0:n.isLeapYear(new Date(k,3,1))?1:2;e=Math.floor((12*(e+c)+373)/367);c=this._GREGORIAN_EPOCH-1+365*(k-1)+Math.floor((k-1)/4)-Math.floor((k-1)/100)+Math.floor((k-1)/400)+Math.floor((367*
e-362)/12+(2>=e?0:n.isLeapYear(new Date(k,e-1,1))?-1:-2)+1);return new Date(k,e-1,f-c+1,this._hours,this._minutes,this._seconds,this._milliseconds)},fromGregorian:function(f){f=new Date(f);var e=f.getFullYear(),k=f.getMonth(),c=f.getDate(),e=this._GREGORIAN_EPOCH-1+365*(e-1)+Math.floor((e-1)/4)+-Math.floor((e-1)/100)+Math.floor((e-1)/400)+Math.floor((367*(k+1)-362)/12+(2>=k+1?0:n.isLeapYear(f)?-1:-2)+c),e=Math.floor(e)+.5,e=e-this._ISLAMIC_EPOCH,k=Math.floor((30*e+10646)/10631),c=Math.ceil((e-29-
this._yearStart(k))/29.5),c=Math.min(c,11);this._date=Math.ceil(e-this._monthStart(k,c))+1;this._month=c;this._year=k;this._hours=f.getHours();this._minutes=f.getMinutes();this._seconds=f.getSeconds();this._milliseconds=f.getMilliseconds();this._day=f.getDay();return this},valueOf:function(){return this.toGregorian().valueOf()},_yearStart:function(f){return 354*(f-1)+Math.floor((3+11*f)/30)},_monthStart:function(f,e){return Math.ceil(29.5*e)+354*(f-1)+Math.floor((3+11*f)/30)},_civilLeapYear:function(f){return 11>
(14+11*f)%30},getDaysInIslamicMonth:function(f,e){var k=0,k=29+(f+1)%2;11==f&&this._civilLeapYear(e)&&k++;return k},_mod:function(f,e){return f-e*Math.floor(f/e)}});l.getDaysInIslamicMonth=function(f){return(new l).getDaysInIslamicMonth(f.getMonth(),f.getFullYear())};return l})},"dojox/date/islamic/locale":function(){define("dojox/main dojo/_base/lang dojo/_base/array dojo/date dojo/i18n dojo/regexp dojo/string ./Date dojo/i18n!dojo/cldr/nls/islamic".split(" "),function(q,m,n,l,f,e,k,c,h){function b(a,
b,c,d,e){return e.replace(/([a-z])\1*/ig,function(c){var d,f,g=c.charAt(0);c=c.length;var h=["abbr","wide","narrow"];switch(g){case "G":d=b.eraAbbr[0];break;case "y":d=String(a.getFullYear());break;case "M":d=a.getMonth();3>c?(d+=1,f=!0):(g=["months-format",h[c-3]].join("-"),d=b[g][d]);break;case "d":d=a.getDate(!0);f=!0;break;case "E":d=a.getDay();3>c?(d+=1,f=!0):(g=["days-format",h[c-3]].join("-"),d=b[g][d]);break;case "a":d=12>a.getHours()?"am":"pm";d=b["dayPeriods-format-wide-"+d];break;case "h":case "H":case "K":case "k":f=
a.getHours();switch(g){case "h":d=f%12||12;break;case "H":d=f;break;case "K":d=f%12;break;case "k":d=f||24}f=!0;break;case "m":d=a.getMinutes();f=!0;break;case "s":d=a.getSeconds();f=!0;break;case "S":d=Math.round(a.getMilliseconds()*Math.pow(10,c-3));f=!0;break;case "z":if(d=l.getTimezoneName(a.toGregorian()))break;c=4;case "Z":d=a.toGregorian().getTimezoneOffset();d=[0>=d?"+":"-",k.pad(Math.floor(Math.abs(d)/60),2),k.pad(Math.abs(d)%60,2)];4==c&&(d.splice(0,0,"GMT"),d.splice(3,0,":"));d=d.join("");
break;default:throw Error("dojox.date.islamic.locale.formatPattern: invalid pattern char: "+e);}f&&(d=k.pad(d,c));return d})}function a(a,b,c,d){var e=function(a){return a};b=b||e;c=c||e;d=d||e;var f=a.match(/(''|[^'])+/g),g="'"==a.charAt(0);n.forEach(f,function(a,d){a?(f[d]=(g?c:b)(a),g=!g):f[d]=""});return d(f.join(""))}function d(a,b,c,d){d=e.escapeString(d);f.normalizeLocale(c.locale);return d.replace(/([a-z])\1*/ig,function(d){var e;e=d.charAt(0);var f=d.length,g="";c.strict?1<f&&(g="0{"+(f-
1)+"}"):g="0?";switch(e){case "y":e="\\d+";break;case "M":e=2<f?"\\S+ ?\\S+":g+"[1-9]|1[0-2]";break;case "d":e="[12]\\d|"+g+"[1-9]|3[01]";break;case "E":e="\\S+";break;case "h":e=g+"[1-9]|1[0-2]";break;case "k":e=g+"\\d|1[01]";break;case "H":e=g+"\\d|1\\d|2[0-3]";break;case "K":e=g+"[1-9]|1\\d|2[0-4]";break;case "m":case "s":e=g+"\\d|[0-5]\\d";break;case "S":e="\\d{"+f+"}";break;case "a":f=c.am||b["dayPeriods-format-wide-am"];g=c.pm||b["dayPeriods-format-wide-pm"];c.strict?e=f+"|"+g:(e=f+"|"+g,f!=
f.toLowerCase()&&(e+="|"+f.toLowerCase()),g!=g.toLowerCase()&&(e+="|"+g.toLowerCase()));break;default:e=".*"}a&&a.push(d);return"("+e+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}var t=m.getObject("date.islamic.locale",!0,q);t.format=function(c,d){d=d||{};var e=f.normalizeLocale(d.locale),g=d.formatLength||"short",h=t._getIslamicBundle(e),k=[],e=m.hitch(this,b,c,h,e,d.fullYear);if("year"==d.selector)return c.getFullYear();if("time"!=d.selector){var l=d.datePattern||h["dateFormat-"+g];l&&k.push(a(l,e))}"date"!=
d.selector&&(g=d.timePattern||h["timeFormat-"+g])&&k.push(a(g,e));return k.join(" ")};t.regexp=function(a){return t._parseInfo(a).regexp};t._parseInfo=function(b){b=b||{};var c=f.normalizeLocale(b.locale),c=t._getIslamicBundle(c),e=b.formatLength||"short",g=b.datePattern||c["dateFormat-"+e],e=b.timePattern||c["timeFormat-"+e],h=[];return{regexp:a("date"==b.selector?g:"time"==b.selector?e:"undefined"==typeof e?g:g+" "+e,m.hitch(this,d,h,c,b)),tokens:h,bundle:c}};t.parse=function(a,b){a=a.replace(/[\u200E\u200F\u202A\u202E]/g,
"");b||(b={});var d=t._parseInfo(b),e=d.tokens,g=d.bundle,d=d.regexp.replace(/[\u200E\u200F\u202A\u202E]/g,""),d=(new RegExp("^"+d+"$")).exec(a);f.normalizeLocale(b.locale);if(!d)return null;var h=[1389,0,1,0,0,0,0],k="",l=["abbr","wide","narrow"];n.every(d,function(a,c){if(!c)return!0;var d=e[c-1],f=d.length;switch(d.charAt(0)){case "y":h[0]=Number(a);break;case "M":if(2<f){if(d=g["months-format-"+l[f-3]].concat(),b.strict||(a=a.replace(".","").toLowerCase(),d=n.map(d,function(a){return a?a.replace(".",
"").toLowerCase():a})),a=n.indexOf(d,a),-1==a)return!1}else a--;h[1]=Number(a);break;case "D":h[1]=0;case "d":h[2]=Number(a);break;case "a":d=b.am||g["dayPeriods-format-wide-am"];f=b.pm||g["dayPeriods-format-wide-pm"];if(!b.strict){var p=/\./g;a=a.replace(p,"").toLowerCase();d=d.replace(p,"").toLowerCase();f=f.replace(p,"").toLowerCase()}if(b.strict&&a!=d&&a!=f)return!1;k=a==f?"p":a==d?"a":"";break;case "K":24==a&&(a=0);case "h":case "H":case "k":h[3]=Number(a);break;case "m":h[4]=Number(a);break;
case "s":h[5]=Number(a);break;case "S":h[6]=Number(a)}return!0});d=+h[3];"p"===k&&12>d?h[3]=d+12:"a"===k&&12==d&&(h[3]=0);return new c(h[0],h[1],h[2],h[3],h[4],h[5],h[6])};var v=[];t.addCustomFormats=function(a,b){v.push({pkg:a,name:b})};t._getIslamicBundle=function(a){var b={};n.forEach(v,function(c){c=f.getLocalization(c.pkg,c.name,a);b=m.mixin(b,c)},this);return b};t.addCustomFormats("dojo.cldr","islamic");t.getNames=function(a,b,c,d,e){var f;d=t._getIslamicBundle(d);a=[a,c,b];"standAlone"==c&&
(c=a.join("-"),f=d[c],1==f[0]&&(f=void 0));a[1]="format";return(f||d[a.join("-")]).concat()};t.weekDays=t.getNames("days","wide","format");t.months=t.getNames("months","wide","format");return t})},"esri/dijit/editing/Add":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ./EditOperationBase".split(" "),function(q,m,n,l,f,e){m=m(e,{declaredClass:"esri.dijit.editing.Add",type:"edit",label:"Add Features",constructor:function(e){e=e||{};e.featureLayer?(this._featureLayer=
e.featureLayer,e.addedGraphics?this._addedGraphics=e.addedGraphics:console.error("In constructor of 'esri.dijit.editing.Add', no graphics provided")):console.error("In constructor of 'esri.dijit.editing.Add', featureLayer is not provided")},updateObjectIds:function(e,c){this.updateIds(this._featureLayer,this._addedGraphics,e,c)},performUndo:function(){return this._featureLayer.applyEdits(null,null,this._addedGraphics).then(n.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))},
performRedo:function(){var e=q.map(this._addedGraphics,function(c){return c.attributes[this._featureLayer.objectIdField]},this);return this._featureLayer.applyEdits(this._addedGraphics,null,null).then(n.hitch(this,function(c,f,b){c=q.map(c,function(a){return a.objectId});return{oldIds:e,addedIds:c,layer:this._featureLayer,operation:this}}))}});l("extend-esri")&&n.setObject("dijit.editing.Add",m,f);return m})},"esri/dijit/editing/EditOperationBase":function(){define(["dojo/_base/array","dojo/_base/declare",
"dojo/has","../../kernel","../../OperationBase"],function(q,m,n,l,f){m=m(f,{declaredClass:"esri.EditOperationBase",updateIds:function(e,f,c,h){q.forEach(f,function(b,a){var d=b[e.objectIdField];q.forEach(c,function(a,c){d===a&&(b[e.objectIdField]=h[c])})})}});n("extend-esri")&&(l.EditOperationBase=m);return m})},"esri/OperationBase":function(){define(["dojo/_base/declare","dojo/has","./kernel"],function(q,m,n){q=q(null,{declaredClass:"esri.OperationBase",type:"not implemented",label:"not implemented",
constructor:function(l){l=l||{};l.label&&(this.label=l.label)},performUndo:function(){console.log("performUndo has not been implemented")},performRedo:function(){console.log("performRedo has not been implemented")}});m("extend-esri")&&(n.OperationBase=q);return q})},"esri/dijit/editing/Update":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ../../geometry/jsonUtils ./EditOperationBase".split(" "),function(q,m,n,l,f,e,k){q=m(k,{declaredClass:"esri.dijit.editing.Update",
type:"edit",label:"Update Features",constructor:function(c){var e;c=c||{};if(c.featureLayer)if(this._featureLayer=c.featureLayer,c.preUpdatedGraphics){this._preUpdatedGraphicsGeometries=[];this._preUpdatedGraphicsAttributes=[];for(e=0;e<c.preUpdatedGraphics.length;e++)this._preUpdatedGraphicsGeometries.push(c.preUpdatedGraphics[e].geometry.toJson()),this._preUpdatedGraphicsAttributes.push(c.preUpdatedGraphics[e].attributes);if(c.postUpdatedGraphics)for(this._postUpdatedGraphics=c.postUpdatedGraphics,
this._postUpdatedGraphicsGeometries=[],this._postUpdatedGraphicsAttributes=[],e=0;e<c.postUpdatedGraphics.length;e++)c.postUpdatedGraphics[e].geometry?this._postUpdatedGraphicsGeometries.push(c.postUpdatedGraphics[e].geometry.toJson()):this._postUpdatedGraphicsGeometries.push(c.postUpdatedGraphics[e].geometry),this._postUpdatedGraphicsAttributes.push(n.clone(c.postUpdatedGraphics[e].attributes));else console.error("In constructor of 'esri.dijit.editing.Update', postUpdatedGraphics not provided")}else console.error("In constructor of 'esri.dijit.editing.Update', preUpdatedGraphics not provided");
else console.error("In constructor of 'esri.dijit.editing.Update', featureLayer not provided")},updateObjectIds:function(c,e){this.updateIds(this._featureLayer,this._preUpdatedGraphicsAttributes,c,e);this.updateIds(this._featureLayer,this._postUpdatedGraphicsAttributes,c,e)},performUndo:function(){var c;for(c=0;c<this._postUpdatedGraphics.length;c++)this._preUpdatedGraphicsGeometries[c]?this._postUpdatedGraphics[c].setGeometry(e.fromJson(this._preUpdatedGraphicsGeometries[c])):this._postUpdatedGraphics[c].setGeometry(this._preUpdatedGraphicsGeometries[c]),
this._postUpdatedGraphics[c].setAttributes(this._preUpdatedGraphicsAttributes[c]);return this._featureLayer.applyEdits(null,this._postUpdatedGraphics,null).then(n.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))},performRedo:function(){var c;for(c=0;c<this._postUpdatedGraphics.length;c++)this._postUpdatedGraphicsGeometries[c]?this._postUpdatedGraphics[c].setGeometry(e.fromJson(this._postUpdatedGraphicsGeometries[c])):this._postUpdatedGraphics[c].setGeometry(this._postUpdatedGraphicsGeometries[c]),
this._postUpdatedGraphics[c].setAttributes(this._postUpdatedGraphicsAttributes[c]);return this._featureLayer.applyEdits(null,this._postUpdatedGraphics,null).then(n.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))}});l("extend-esri")&&n.setObject("dijit.editing.Update",q,f);return q})},"esri/dijit/editing/Delete":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ./EditOperationBase".split(" "),function(q,m,n,l,f,e){m=m(e,{declaredClass:"esri.dijit.editing.Delete",
type:"edit",label:"Delete Features",constructor:function(e){e=e||{};e.featureLayer?(this._featureLayer=e.featureLayer,e.deletedGraphics?this._deletedGraphics=e.deletedGraphics:console.error("In constructor of 'esri.dijit.editing.Delete', no graphics provided")):console.error("In constructor of 'esri.dijit.editing.Delete', featureLayer is not provided")},updateObjectIds:function(e,c){this.updateIds(this._featureLayer,this._deletedGraphics,e,c)},performUndo:function(){var e=q.map(this._deletedGraphics,
function(c){return c.attributes[this._featureLayer.objectIdField]},this);return this._featureLayer.applyEdits(this._deletedGraphics,null,null).then(n.hitch(this,function(c,f,b){c=q.map(c,function(a){return a.objectId});return{oldIds:e,addedIds:c,layer:this._featureLayer,operation:this}}))},performRedo:function(){return this._featureLayer.applyEdits(null,null,this._deletedGraphics).then(n.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))}});l("extend-esri")&&n.setObject("dijit.editing.Delete",
m,f);return m})},"esri/dijit/editing/Cut":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ../../geometry/jsonUtils ./EditOperationBase".split(" "),function(q,m,n,l,f,e,k){m=m(k,{declaredClass:"esri.dijit.editing.Cut",type:"edit",label:"Cut Features",constructor:function(c){var e;c=c||{};if(c.featureLayer)if(this._featureLayer=c.featureLayer,c.addedGraphics)if(this._addedGraphics=c.addedGraphics,c.preUpdatedGraphics){this._preUpdatedGraphicsGeometries=[];
this._preUpdatedGraphicsAttributes=[];for(e=0;e<c.preUpdatedGraphics.length;e++)this._preUpdatedGraphicsGeometries.push(c.preUpdatedGraphics[e].geometry.toJson()),this._preUpdatedGraphicsAttributes.push(c.preUpdatedGraphics[e].attributes);if(c.postUpdatedGraphics)for(this._postUpdatedGraphics=c.postUpdatedGraphics,this._postUpdatedGraphicsGeometries=[],this._postUpdatedGraphicsAttributes=[],e=0;e<c.postUpdatedGraphics.length;e++)this._postUpdatedGraphicsGeometries.push(c.postUpdatedGraphics[e].geometry.toJson()),
this._postUpdatedGraphicsAttributes.push(n.clone(c.postUpdatedGraphics[e].attributes));else console.error("In constructor of 'esri.dijit.editing.Cut', postUpdatedGraphics not provided")}else console.error("In constructor of 'esri.dijit.editing.Cut', preUpdatedGraphics not provided");else console.error("In constructor of 'esri.dijit.editing.Cut', addedGraphics for cut not provided");else console.error("In constructor of 'esri.dijit.editing.Cut', featureLayer not provided")},updateObjectIds:function(c,
e){this.updateIds(this._featureLayer,this._preUpdatedGraphicsAttributes,c,e);this.updateIds(this._featureLayer,this._postUpdatedGraphicsAttributes,c,e);this.updateIds(this._featureLayer,this._addedGraphics,c,e)},performUndo:function(){var c;for(c=0;c<this._postUpdatedGraphics.length;c++)this._postUpdatedGraphics[c].setGeometry(e.fromJson(this._preUpdatedGraphicsGeometries[c])),this._postUpdatedGraphics[c].setAttributes(this._preUpdatedGraphicsAttributes[c]);return this._featureLayer.applyEdits(null,
this._postUpdatedGraphics,this._addedGraphics).then(n.hitch(this,function(){return{layer:this._featureLayer,operation:this}}))},performRedo:function(){var c;for(c=0;c<this._postUpdatedGraphics.length;c++)this._postUpdatedGraphics[c].setGeometry(e.fromJson(this._postUpdatedGraphicsGeometries[c])),this._postUpdatedGraphics[c].setAttributes(this._postUpdatedGraphicsAttributes[c]);var f=q.map(this._addedGraphics,function(b){return b.attributes[this._featureLayer.objectIdField]},this);return this._featureLayer.applyEdits(this._addedGraphics,
this._postUpdatedGraphics,null).then(n.hitch(this,function(b,a,c){b=q.map(b,function(a){return a.objectId});return{oldIds:f,addedIds:b,layer:this._featureLayer,operation:this}}))}});l("extend-esri")&&n.setObject("dijit.editing.Cut",m,f);return m})},"esri/dijit/editing/Union":function(){define("dojo/_base/array dojo/_base/declare dojo/_base/lang dojo/has ../../kernel ../../geometry/jsonUtils ./EditOperationBase".split(" "),function(q,m,n,l,f,e,k){m=m(k,{declaredClass:"esri.dijit.editing.Union",type:"edit",
label:"Union Features",constructor:function(c){c=c||{};this._featureLayer=c.featureLayer;this._deletedGraphics=c.deletedGraphics;this._preUpdatedGraphics=c.preUpdatedGraphics;this._postUpdatedGraphics=c.postUpdatedGraphics;this._preUpdatedGraphicsGeometries=[];this._preUpdatedGraphicsAttributes=[];this._postUpdatedGraphicsGeometries=[];this._postUpdatedGraphicsAttributes=[];var e;for(e=0;e<c.preUpdatedGraphics.length;e++)this._preUpdatedGraphicsGeometries.push(c.preUpdatedGraphics[e].geometry.toJson()),
this._preUpdatedGraphicsAttributes.push(c.preUpdatedGraphics[e].attributes);for(e=0;e<c.postUpdatedGraphics.length;e++)this._postUpdatedGraphicsGeometries.push(c.postUpdatedGraphics[e].geometry.toJson()),this._postUpdatedGraphicsAttributes.push(n.clone(c.postUpdatedGraphics[e].attributes))},updateObjectIds:function(c,e){this.updateIds(this._featureLayer,this._preUpdatedGraphicsAttributes,c,e);this.updateIds(this._featureLayer,this._postUpdatedGraphicsAttributes,c,e);this.updateIds(this._featureLayer,
this._deletedGraphics,c,e)},performUndo:function(){var c;for(c=0;c<this._postUpdatedGraphics.length;c++)this._postUpdatedGraphics[c].setGeometry(e.fromJson(this._preUpdatedGraphicsGeometries[c])),this._postUpdatedGraphics[c].setAttributes(this._preUpdatedGraphicsAttributes[c]);var f=q.map(this._deletedGraphics,function(b){return b.attributes[this._featureLayer.objectIdField]},this);return this._featureLayer.applyEdits(this._deletedGraphics,this._postUpdatedGraphics,null).then(n.hitch(this,function(b,
a,c){b=q.map(b,function(a){return a.objectId});return{oldIds:f,addedIds:b,layer:this._featureLayer,operation:this}}))},performRedo:function(){var c;for(c=0;c<this._postUpdatedGraphics.length;c++)this._postUpdatedGraphics[c].setGeometry(e.fromJson(this._postUpdatedGraphicsGeometries[c])),this._postUpdatedGraphics[c].setAttributes(this._postUpdatedGraphicsAttributes[c]);return this._featureLayer.applyEdits(null,this._postUpdatedGraphics,this._deletedGraphics).then(n.hitch(this,function(){return{layer:this._featureLayer,
operation:this}}))}});l("extend-esri")&&n.setObject("dijit.editing.Union",m,f);return m})},"esri/dijit/editing/toolbars/Drawing":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has dijit/_CssStateMixin ../Util ./ToolbarBase ../tools/ButtonToolBase ../tools/Cut ../tools/Union ../tools/Reshape ../tools/Editing ../tools/EditingTools ../tools/Selection ../tools/SelectionTools ../../../kernel".split(" "),function(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p){q=q([c,
e],{declaredClass:"esri.dijit.editing.toolbars.Drawing",onShowAttributeInspector:function(){},_activateTool:function(a,b){this._settings.editor._activeTool=a;"EDITING"!==a&&this._settings.templatePicker.clearSelection();"ATTRIBUTES"!==a&&this._settings.editor._hideAttributeInspector();"CLEAR"!==a&&this.inherited(arguments)},_initializeToolbar:function(){n.forEach(this._settings.layers,function(a){this._tbConnects.push(l.connect(a,"onSelectionComplete",this,"_updateUI"))},this)},activateEditing:function(a,
b){this._tools.EDITING._activateTool(a,b.geometryType);this._activeTool=this._tools.EDITING;this._activeTool.setChecked(!0)},_updateUI:function(){this._settings.undoManager&&(this._tools.UNDO.set("disabled",!1===this._settings.undoManager.canUndo),this._tools.REDO.set("disabled",!1===this._settings.undoManager.canRedo));this._selectedFeatures=k.getSelection(this._settings.layers);var a=this._selectedFeatures.length;this._tools.DELETE&&this._tools.DELETE.set("disabled",0>=a);this._tools.CLEAR&&this._tools.CLEAR.set("disabled",
0>=a);this._tools.ATTRIBUTES&&this._tools.ATTRIBUTES.set("disabled",0>=a);this._tools.UNION&&this._tools.UNION.set("disabled",2>a)},_toolFinished:function(a){if("ATTRIBUTES"===a&&this._selectedFeatures&&this._selectedFeatures.length)this.onShowAttributeInspector(this._selectedFeatures[0]);if("SELECT"===a||"CUT"===a||"RESHAPING"===a||"EDITING"===a)this._activeTool.deactivate(),this._activeTool.setChecked(!1),this._activeTool=null;if("DELETE"===a)this.onDelete();this._settings.editor._activeTool=null;
this._updateUI()},_createTools:function(){this._tools.SELECT=new g({settings:this._settings,onClick:m.hitch(this,"_activateTool","SELECT",!0),onFinished:m.hitch(this,"_toolFinished","SELECT")});this.addChild(this._tools.SELECT);this._tools.CLEAR=new h(m.mixin(u.selectClear,{settings:this._settings,onClick:m.hitch(this._settings.editor,"_clearSelection",!1)}));this.addChild(this._tools.CLEAR);this._createSeparator();this._tools.ATTRIBUTES=new h(m.mixin(v.attributes,{settings:this._settings,onClick:m.hitch(this,
"_toolFinished","ATTRIBUTES")}));this.addChild(this._tools.ATTRIBUTES);this._createSeparator();this._tools.EDITING=new t({settings:this._settings,onClick:m.hitch(this,"_activateTool","EDITING",!0),onApplyEdits:m.hitch(this,"onApplyEdits"),onFinished:m.hitch(this,"_toolFinished","EDITING")});this.addChild(this._tools.EDITING);this._tools.DELETE=new h(m.mixin(v.del,{settings:this._settings,onClick:m.hitch(this,"_toolFinished","DELETE")}));this.addChild(this._tools.DELETE);this._settings.toolbarOptions&&
((this._settings.toolbarOptions.cutVisible||this._settings.toolbarOptions.mergeVisible||this._settings.toolbarOptions.reshapeVisible)&&this._createSeparator(),this._settings.toolbarOptions.cutVisible&&(this._tools.CUT=new b({settings:this._settings,onFinished:m.hitch(this,"_toolFinished","CUT"),onClick:m.hitch(this,"_activateTool","CUT",!0),onApplyEdits:m.hitch(this,"onApplyEdits")}),this.addChild(this._tools.CUT)),this._settings.toolbarOptions.mergeVisible&&(this._tools.UNION=new a({settings:this._settings,
onFinished:m.hitch(this,"_toolFinished","UNION"),onApplyEdits:m.hitch(this,"onApplyEdits")}),this.addChild(this._tools.UNION)),this._settings.toolbarOptions.reshapeVisible&&(this._tools.RESHAPING=new d({settings:this._settings,onClick:m.hitch(this,"_activateTool","RESHAPING",!0),onFinished:m.hitch(this,"_toolFinished","RESHAPING"),onApplyEdits:m.hitch(this,"onApplyEdits")}),this.addChild(this._tools.RESHAPING)));this._settings.enableUndoRedo&&(this._createSeparator(),this._tools.UNDO=new h(m.mixin(v.undo,
{settings:this._settings,disabled:!0,onClick:m.hitch(this,function(){this._tools.UNDO.set("disabled",!0);this._tools.REDO.set("disabled",!0);this._settings.editor._undo()})})),this.addChild(this._tools.UNDO),this._tools.REDO=new h(m.mixin(v.redo,{settings:this._settings,disabled:!0,onClick:m.hitch(this,function(){this._tools.UNDO.set("disabled",!0);this._tools.REDO.set("disabled",!0);this._settings.editor._redo()})})),this.addChild(this._tools.REDO))}});f("extend-esri")&&m.setObject("dijit.editing.toolbars.Drawing",
q,p);return q})},"esri/dijit/editing/toolbars/ToolbarBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has dijit/Toolbar dijit/ToolbarSeparator ../../../kernel ../../../lang".split(" "),function(q,m,n,l,f,e,k,c,h){q=q([e],{declaredClass:"esri.dijit.editing.toolbars.ToolbarBase",_enabled:!0,graphicsAdded:function(){},drawEnd:function(){},onApplyEdits:function(){},onDelete:function(){},constructor:function(b,a){b&&b.settings&&(this._tools=[],this._tbConnects=
[],this._initialize(b.settings))},postCreate:function(){this._createTools();this.deactivate()},destroy:function(){var b,a=this._tools;for(b in a)a.hasOwnProperty(b)&&h.isDefined(this._tools[b])&&this._tools[b].destroy();n.forEach(this._tbConnects,l.disconnect);this.inherited(arguments)},activate:function(b){this._enabled=!0},deactivate:function(){var b;this._enabled=!1;this._geometryType=this._layer=null;var a=this._tools;for(b in a)a.hasOwnProperty(b)&&(this._tools[b].deactivate(),this._tools[b].setChecked(!1))},
isEnabled:function(){return this._enabled},setActiveSymbol:function(b){this._activeSymbol=b},_getSymbol:function(){},_createTools:function(){},_initialize:function(b){this._settings=b;this._toolbar=b.drawToolbar;this._editToolbar=b.editToolbar;this._initializeToolbar()},_activateTool:function(b,a){this._activeTool&&this._activeTool.deactivate();!0===a&&this._activeTool==this._tools[b]?(this._activeTool.setChecked(!1),this._activeTool=null):(this._activeTool=this._tools[b],this._activeTool.setChecked(!0),
this._activeTool.activate(null))},_createSeparator:function(){this.addChild(new k)}});f("extend-esri")&&m.setObject("dijit.editing.toolbars.ToolbarBase",q,c);return q})},"esri/dijit/editing/tools/ButtonToolBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dijit/form/Button ./ToolBase ../../../kernel".split(" "),function(q,m,n,l,f,e){q=q([l,f],{declaredClass:"esri.dijit.editing.tools.ButtonToolBase",postCreate:function(){this.inherited(arguments);this._setShowLabelAttr&&this._setShowLabelAttr(!1)},
destroy:function(){l.prototype.destroy.apply(this,arguments);f.prototype.destroy.apply(this,arguments)}});n("extend-esri")&&m.setObject("dijit.editing.tools.ButtonToolBase",q,e);return q})},"esri/dijit/editing/tools/ToolBase":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","../../../kernel","dojo/i18n!../../../nls/jsapi"],function(q,m,n,l,f){q=q(null,{declaredClass:"esri.dijit.editing.tools.ToolBase",_enabled:!0,showLabel:!1,constructor:function(e,k){e=e||{};m.mixin(this,e);this.label=
this._label?f.widgets.editor.tools[this._label]:"";this._settings=e.settings;this._toolbar=e.settings.drawToolbar;this._editToolbar=e.settings.editToolbar;this._initializeTool()},onFinished:function(){},onDrawEnd:function(){},onApplyEdits:function(){},postCreate:function(){this.deactivate();this.inherited(arguments)},destroy:function(){},activate:function(e){this._toolbar&&this._toolbar.deactivate();this._editToolbar&&this._editToolbar.deactivate();this._enabled&&(this._checked=!0,this._layer=e,this._toolbar&&
this._drawType&&this._toolbar.activate(this._drawType))},deactivate:function(){this._toolbar&&this._toolbar.deactivate();this._editToolbar&&this._editToolbar.deactivate();this.setChecked(!1);this._updateUI()},setEnabled:function(e){this._enabled=e;this._updateUI()},setChecked:function(e){this._checked=e},enable:function(e){this._updateUI()},isEnabled:function(){return this._enabled},getToolName:function(){return this._toolName},_initializeTool:function(){},_updateUI:function(){this.disabled=!this._enabled;
this.attr("iconClass",this._enabled?this._enabledIcon:this._disabledIcon)}});n("extend-esri")&&m.setObject("dijit.editing.tools.ToolBase",q,l);return q})},"esri/dijit/editing/tools/Cut":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has dojo/DeferredList ../../../graphicsUtils ../../../graphic ../../../tasks/query ../../../layers/FeatureLayer ../../../toolbars/draw ../Cut ./ToggleToolBase ../../../kernel".split(" "),function(q,m,n,l,f,e,k,c,h,b,a,d,
t,v){q=q([t],{declaredClass:"esri.dijit.editing.tools.Cut",id:"btnFeatureCut",_enabledIcon:"toolbarIcon cutIcon",_disabledIcon:"toolbarIcon cutIcon",_drawType:a.POLYLINE,_enabled:!0,_label:"NLS_cutLbl",_cutConnects:[],activate:function(){this._cutConnects.push(l.connect(this._toolbar,"onDrawEnd",this,"_onDrawEnd"));this.inherited(arguments)},deactivate:function(){this.inherited(arguments);n.forEach(this._cutConnects,l.disconnect);this._cutConnects=[];this._edits=[]},_onDrawEnd:function(a){var c=this._cutLayers=
n.filter(this._settings.layers,function(a){return"esriGeometryPolygon"===a.geometryType||"esriGeometryPolyline"===a.geometryType&&a.visible&&a._isMapAtVisibleScale()});this._cutConnects=this._cutConnects.concat(n.map(c,m.hitch(this,function(a){return l.connect(a,"onEditsComplete",m.hitch(this,function(a,b,c){if(this._settings.undoRedoManager){var e=this._settings.undoRedoManager;n.forEach(this._edits,m.hitch(this,function(a){e.add(new d({featureLayer:a.layer,addedGraphics:a.adds,preUpdatedGraphics:a.preUpdates,
postUpdatedGraphics:a.updates}))}),this)}this.onFinished()}))})));var e=new h;e.geometry=a;n.forEach(c,function(a,c){this._settings.editor._selectionHelper.selectFeatures([a],e,b.SELECTION_NEW,m.hitch(this,"_cutFeatures",a,e))},this)},_cutFeatures:function(a,b,c){if(c&&c.length){this._edits=[];var d=[];d.push(this._settings.geometryService.cut(k.getGeometries(c),b.geometry,m.hitch(this,"_cutHandler",a,c)));(new e(d)).addCallback(m.hitch(this,function(){this.onApplyEdits(this._edits)}))}},_cutHandler:function(a,
b,d){var e=[],f=[],g=n.map(b,function(a){return new c(m.clone(a.toJson()))}),h,k;n.forEach(d.cutIndexes,function(a,g){h!=a?(h=a,f.push(b[a].setGeometry(d.geometries[g]))):(k=new c(d.geometries[g],null,m.mixin({},b[a].attributes),null),k.attributes[b[0].getLayer().objectIdField]=null,e.push(k))},this);this._edits.push({layer:a,adds:e,updates:f,preUpdates:g})}});f("extend-esri")&&m.setObject("dijit.editing.tools.Cut",q,v);return q})},"esri/dijit/editing/tools/ToggleToolBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dijit/form/ToggleButton ./ToolBase ../../../kernel".split(" "),
function(q,m,n,l,f,e){q=q([l,f],{declaredClass:"esri.dijit.editing.tools.ToggleToolBase",postCreate:function(){this.inherited(arguments);this._setShowLabelAttr&&this._setShowLabelAttr(!1)},destroy:function(){l.prototype.destroy.apply(this,arguments);f.prototype.destroy.apply(this,arguments)},setChecked:function(e){l.prototype.setChecked.apply(this,arguments)}});n("extend-esri")&&m.setObject("dijit.editing.tools.ToggleToolBase",q,e);return q})},"esri/dijit/editing/tools/Union":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../../../graphicsUtils ../../../graphic ../../../toolbars/draw ../Union ./ButtonToolBase ../../../kernel".split(" "),
function(q,m,n,l,f,e,k,c,h,b){q=q([h],{declaredClass:"esri.dijit.editing.tools.Union",id:"btnFeatureUnion",_enabledIcon:"toolbarIcon unionIcon",_disabledIcon:"toolbarIcon unionIcon",_drawType:k.POLYLINE,_enabled:!0,_label:"NLS_unionLbl",_onClick:function(a){this._settings.editor._activeTool="UNION";a=n.filter(this._settings.layers,function(a){return"esriGeometryPolygon"===a.geometryType&&a.visible&&a._isMapAtVisibleScale()});var b=[],h=0;n.forEach(a,function(a,d){var g=a.getSelectedFeatures();2<=
g.length&&(h++,this._settings.geometryService.union(f.getGeometries(g),m.hitch(this,function(d){var f=g.shift(),k=[],l=[];k.push(new e(f.toJson()));l.push(f.setGeometry(d));b.push({layer:a,updates:l,deletes:g,preUpdates:k});h--;if(0>=h)this.onApplyEdits(b,m.hitch(this,function(){if(this._settings.undoRedoManager){var a=this._settings.undoRedoManager;n.forEach(this._edits,m.hitch(this,function(b){a.add(new c({featureLayer:b.layer,deletedGraphics:b.deletes,preUpdatedGraphics:b.preUpdates,postUpdatedGraphics:b.updates}))}),
this)}this._settings.editor._selectionHelper.clearSelection(!1);this.onFinished()}))})))},this)}});l("extend-esri")&&m.setObject("dijit.editing.tools.Union",q,b);return q})},"esri/dijit/editing/tools/Reshape":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/has ../../../graphic ../../../layers/FeatureLayer ../../../tasks/query ../../../toolbars/draw ./ToggleToolBase ../../../kernel".split(" "),function(q,m,n,l,f,e,k,c,h,b,a){q=q([b],{declaredClass:"esri.dijit.editing.tools.Reshape",
id:"btnFeatureReshape",_enabledIcon:"toolbarIcon reshapeIcon",_disabledIcon:"toolbarIcon reshapeIcon",_drawType:h.POLYLINE,_enabled:!0,_label:"NLS_reshapeLbl",activate:function(){l.disconnect(this._rConnect);this._rConnect=l.connect(this._toolbar,"onDrawEnd",this,"_onDrawEnd");this.inherited(arguments)},deactivate:function(){this.inherited(arguments);l.disconnect(this._rConnect);delete this._rConnect},_onDrawEnd:function(a){var b=this._settings.layers,d=new c;d.geometry=a;a=this._reshapeLayers=n.filter(b,
function(a){return"esriGeometryPolygon"===a.geometryType||"esriGeometryPolyline"});this._settings.editor._selectionHelper.selectFeatures(a,d,k.SELECTION_NEW,m.hitch(this,"_reshape",d))},_reshape:function(a,b){if(1===b.length){var c=[],d=[],f=[],h=b[0],k=h.getLayer();this._settings.geometryService.reshape(h.geometry,a.geometry,m.hitch(this,function(a){"polyline"===a.type&&a.paths&&0===a.paths.length?(this._settings.editor._selectionHelper.clearSelection(!1),this.onFinished()):"polygon"===a.type&&a.rings&&
0===a.rings.length?(this._settings.editor._selectionHelper.clearSelection(!1),this.onFinished()):(f.push(new e(h.toJson())),d.push(h.setGeometry(a)),c.push({layer:k,updates:d,preUpdates:f}),this.onApplyEdits(c,m.hitch(this,function(){this._settings.editor._selectionHelper.clearSelection(!1);this.onFinished()})))}))}}});f("extend-esri")&&m.setObject("dijit.editing.tools.Reshape",q,a);return q})},"esri/dijit/editing/tools/Editing":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/has ../../../layers/FeatureTemplate ./Edit ./EditingTools ./DropDownToolBase ../../../kernel ../../../lang".split(" "),
function(q,m,n,l,f,e,k,c,h,b){q=q([c],{declaredClass:"esri.dijit.editing.tools.Editing",_enabled:!1,deactivate:function(){this._enabled&&(this._enabled=!1,this.inherited(arguments),this._settings.templatePicker.clearSelection())},onItemClicked:function(a,b){this.inherited(arguments);this._activeTool===this._tools.AUTOCOMPLETE&&(this._settings.editor._drawingTool=f.TOOL_AUTO_COMPLETE_POLYGON)},_activateTool:function(a,b){var c;this.enable(b);for(c in this._tools)this._tools.hasOwnProperty(c)&&(this.dropDown.removeChild(this._tools[c]),
!0===this._tools[c]._enabled&&this.dropDown.addChild(this._tools[c]));if(this._geometryType!==b||!1===this._activeTool._enabled)this._activeTool=this._tools[a.toUpperCase()];this._geometryType=b;this._activeTool.activate();this._activeTool.setChecked(!0);this._updateUI()},_initializeTool:function(a){this.inherited(arguments);this._initializeTools()},_initializeTools:function(){var a=this._settings.layers,b=this._settings.editor,c=!1,e=!1,f=!1,h=this._toolTypes=[],k;n.forEach(a,function(a){k=a.geometryType;
c=c||"esriGeometryPoint"===k;e=e||"esriGeometryPolyline"===k;f=f||"esriGeometryPolygon"===k;h=h.concat(n.map(this._getTemplatesFromLayer(a),m.hitch(this,function(c){return b._toDrawTool(c.drawingTool,a)})))},this);a=this._settings.createOptions;c&&this._toolTypes.push("point");e&&(this._toolTypes=this._toolTypes.concat(a.polylineDrawTools));f&&(this._toolTypes=this._toolTypes.concat(a.polygonDrawTools));this._toolTypes=this._toUnique(this._toolTypes.concat(h))},_toUnique:function(a){var b={};return n.filter(a,
function(a){return b[a]?!1:b[a]=!0})},_getTemplatesFromLayer:function(a){var c=a.templates||[];n.forEach(a.types,function(a){c=c.concat(a.templates)});return n.filter(c,b.isDefined)},_createTools:function(){n.forEach(this._toolTypes,this._createTool,this);this.inherited(arguments)},_createTool:function(a){var b=m.mixin(k[a],{settings:this._settings,onClick:m.hitch(this,"onItemClicked",k[a].id)});this._tools[a.toUpperCase()]=new e(b)}});l("extend-esri")&&m.setObject("dijit.editing.tools.Editing",q,
h);return q})},"esri/dijit/editing/tools/Edit":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/has","./MenuItemBase","../../../kernel"],function(q,m,n,l,f){q=q([l],{declaredClass:"esri.dijit.editing.tools.Edit",enable:function(e){this._enabled=e===this._geomType;this.inherited(arguments)}});n("extend-esri")&&m.setObject("dijit.editing.tools.Edit",q,f);return q})},"esri/dijit/editing/tools/MenuItemBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dijit/MenuItem ./ToolBase ../../../kernel".split(" "),
function(q,m,n,l,f,e){q=q([l,f],{declaredClass:"esri.dijit.editing.tools.MenuItemBase",destroy:function(){l.prototype.destroy.apply(this,arguments);f.prototype.destroy.apply(this,arguments)}});n("extend-esri")&&m.setObject("dijit.editing.tools.MenuItemBase",q,e);return q})},"esri/dijit/editing/tools/EditingTools":function(){define(["dojo/_base/lang","dojo/has","../../../toolbars/draw","../../../kernel"],function(q,m,n,l){n={point:{id:"esriPointTool",_enabledIcon:"toolbarIcon pointIcon",_disabledIcon:"toolbarIcon pointIconDisabled",
_drawType:n.POINT,_geomType:"esriGeometryPoint",_label:"NLS_pointLbl"},polyline:{id:"toolDrawFreehandPolyline",_enabledIcon:"toolbarIcon polylineIcon",_disabledIcon:"toolbarIcon polylineIconDisabled",_drawType:n.POLYLINE,_geomType:"esriGeometryPolyline",_label:"NLS_polylineLbl"},freehandpolyline:{id:"toolDrawPolyline",_enabledIcon:"toolbarIcon freehandPolylineIcon",_disabledIcon:"toolbarIcon freehandPolylineIcon",_drawType:n.FREEHAND_POLYLINE,_geomType:"esriGeometryPolyline",_label:"NLS_freehandPolylineLbl"},
polygon:{id:"toolDrawPolygon",_enabledIcon:"toolbarIcon polygonIcon",_disabledIcon:"toolbarIcon polygonIconDisabled",_drawType:n.POLYGON,_geomType:"esriGeometryPolygon",_label:"NLS_polygonLbl"},freehandpolygon:{id:"toolDrawFreehandPolygon",_enabledIcon:"toolbarIcon freehandPolygonIcon",_disabledIcon:"toolbarIcon freehandPolygonIconDisabled",_drawType:n.FREEHAND_POLYGON,_label:"NLS_freehandPolygonLbl",_geomType:"esriGeometryPolygon"},autocomplete:{id:"btnFeatureAutoComplete",_enabledIcon:"toolbarIcon autoCompleteIcon",
_disabledIcon:"toolbarIcon autoCompleteIcon",_drawType:n.POLYGON,_label:"NLS_autoCompleteLbl",_geomType:"esriGeometryPolygon"},rectangle:{id:"toolDrawRect",_enabledIcon:"toolbarIcon rectangleIcon",_disabledIcon:"toolbarIcon rectangleIcon",_drawType:n.RECTANGLE,_geomType:"esriGeometryPolygon",_label:"NLS_rectangleLbl"},arrow:{id:"toolDrawArrow",_enabledIcon:"toolbarIcon arrowIcon",_disabledIcon:"toolbarIcon arrowIcon",_drawType:n.ARROW,_geomType:"esriGeometryPolygon",_label:"NLS_arrowLbl"},uparrow:{id:"toolDrawArrowUp",
_enabledIcon:"toolbarIcon arrowUpIcon",_disabledIcon:"toolbarIcon arrowUpIcon",_drawType:n.UP_ARROW,_geomType:"esriGeometryPolygon",_label:"NLS_arrowUpLbl"},downarrow:{id:"toolDrawDownArrow",_enabledIcon:"toolbarIcon arrowDownIcon",_disabledIcon:"toolbarIcon arrowDownIcon",_drawType:n.DOWN_ARROW,_geomType:"esriGeometryPolygon",_label:"NLS_arrowDownLbl"},leftarrow:{id:"toolDrawLeftArrow",_enabledIcon:"toolbarIcon arrowLeftIcon",_disabledIcon:"toolbarIcon arrowLeftIcon",_drawType:n.LEFT_ARROW,_geomType:"esriGeometryPolygon",
_label:"NLS_arrowLeftLbl"},rightarrow:{id:"toolDrawRightArrow",_enabledIcon:"toolbarIcon arrowIcon",_disabledIcon:"toolbarIcon arrowIcon",_drawType:n.RIGHT_ARROW,_geomType:"esriGeometryPolygon",_label:"NLS_arrowRightLbl"},circle:{id:"toolDrawCircle",_enabledIcon:"toolbarIcon circleIcon",_disabledIcon:"toolbarIcon circleIcon",_drawType:n.CIRCLE,_geomType:"esriGeometryPolygon",_label:"NLS_circleLbl"},ellipse:{id:"toolDrawEllipse",_enabledIcon:"toolbarIcon ellipseIcon",_disabledIcon:"toolbarIcon ellipseIcon",
_drawType:n.ELLIPSE,_geomType:"esriGeometryPolygon",_label:"NLS_ellipseLbl"},triangle:{id:"toolDrawTriangle",_enabledIcon:"toolbarIcon triangleIcon",_disabledIcon:"toolbarIcon triangleIcon",_drawType:n.TRIANGLE,_geomType:"esriGeometryPolygon",_label:"NLS_triangleLbl"},attributes:{id:"btnAttributes",_enabledIcon:"toolbarIcon attributesIcon",_disabledIcon:"toolbarIcon attributesIcon",_enabled:!1,_label:"NLS_attributesLbl"},del:{id:"btnDelete2",_enabledIcon:"toolbarIcon deleteFeatureIcon",_disabledIcon:"toolbarIcon deleteFeatureIcon",
_enabled:!1,_label:"NLS_deleteLbl"},undo:{id:"btnUndo",_enabledIcon:"dijitEditorIcon dijitEditorIconUndo",_disabledIcon:"dijitEditorIcon dijitEditorIconUndo",_enabled:!1,_label:"NLS_undoLbl"},redo:{id:"btnRedo",_enabledIcon:"dijitEditorIcon dijitEditorIconRedo",_disabledIcon:"dijitEditorIcon dijitEditorIconRedo",_enabled:!1,_label:"NLS_redoLbl"}};m("extend-esri")&&q.setObject("dijit.editing.tools.EditingTools",n,l);return n})},"esri/dijit/editing/tools/DropDownToolBase":function(){define("dojo/_base/declare dojo/_base/lang dojo/has dojo/dom-style dijit/registry dijit/Menu dijit/form/ComboButton ./ToolBase ../../../kernel ../../../lang".split(" "),
function(q,m,n,l,f,e,k,c,h,b){q=q([k,c],{declaredClass:"esri.dijit.editing.tools.DropDownToolBase",_enabled:!1,_checked:!1,postCreate:function(){this._tools=[];this._createTools();this.inherited(arguments);this._setShowLabelAttr&&this._setShowLabelAttr(!1)},destroy:function(){var a,c=this._tools;for(a in c)c.hasOwnProperty(a)&&b.isDefined(c[a])&&c[a].destroy();this.inherited(arguments)},_createTools:function(){var a,b=new e;this.dropDown=b;for(a in this._tools)this._tools.hasOwnProperty(a)&&b.addChild(this._tools[a]);
this._activeTool=b.getChildren()[0];this._updateUI()},activate:function(a){this.inherited(arguments);this._activeTool?this._activeTool.activate():this._activateDefaultTool()},deactivate:function(){this.inherited(arguments);this._activeTool&&this._activeTool.deactivate()},enable:function(a){for(var b in this._tools)this._tools.hasOwnProperty(b)&&this._tools[b].enable(a);this.setEnabled(!0);this.inherited(arguments)},setChecked:function(a){this._checked=a;this._updateUI()},_onDrawEnd:function(a){},
onLayerChange:function(a,b,c){this._activeTool=null;this._activeType=b;this._activeTemplate=c;this._activeLayer=a},onItemClicked:function(a,b){this._activeTool&&this._activeTool.deactivate();this._activeTool=f.byId(a);!1===this._checked?this._onClick():(this._updateUI(),this._activeTool&&(this._activeTool.activate(),this._activeTool.setChecked(!0)))},_onClick:function(a){!1!==this._enabled&&(this._checked=!this._checked,this.inherited(arguments))},_updateUI:function(){this.attr("disabled",!this._enabled);
l.set(this.focusNode,{outline:"none"});l.set(this.titleNode,{padding:"0px",border:"none"});this._checked?l.set(this.titleNode,{backgroundColor:"#D4DFF2",border:"1px solid #316AC5"}):l.set(this.titleNode,{backgroundColor:"",border:""});this._activeTool&&(this.attr("iconClass",this._checked?this._activeTool._enabledIcon:this._activeTool._disabledIcon),this.attr("label",this._activeTool.label))}});n("extend-esri")&&m.setObject("dijit.editing.tools.DropDownToolBase",q,h);return q})},"dijit/form/ComboButton":function(){define("dojo/_base/declare dojo/keys ../focus ./DropDownButton dojo/text!./templates/ComboButton.html ../a11yclick".split(" "),
function(q,m,n,l,f){return q("dijit.form.ComboButton",l,{templateString:f,_setIdAttr:"",_setTabIndexAttr:["focusNode","titleNode"],_setTitleAttr:"titleNode",optionsTitle:"",baseClass:"dijitComboButton",cssStateNodes:{buttonNode:"dijitButtonNode",titleNode:"dijitButtonContents",_popupStateNode:"dijitDownArrowButton"},_focusedNode:null,_onButtonKeyDown:function(e){e.keyCode==m[this.isLeftToRight()?"RIGHT_ARROW":"LEFT_ARROW"]&&(n.focus(this._popupStateNode),e.stopPropagation(),e.preventDefault())},_onArrowKeyDown:function(e){e.keyCode==
m[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]&&(n.focus(this.titleNode),e.stopPropagation(),e.preventDefault())},focus:function(e){this.disabled||n.focus("start"==e?this.titleNode:this._popupStateNode)}})})},"esri/dijit/editing/tools/Selection":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/Color dojo/has ../../../symbols/SimpleMarkerSymbol ../../../symbols/SimpleLineSymbol ../../../symbols/SimpleFillSymbol ./Edit ./SelectionTools ./DropDownToolBase ../../../kernel".split(" "),
function(q,m,n,l,f,e,k,c,h,b,a,d,t){q=q([d],{declaredClass:"esri.dijit.editing.tools.Selection",_enabled:!0,activate:function(){this.inherited(arguments);this._sConnect=l.connect(this._toolbar,"onDrawEnd",this,"_onDrawEnd")},deactivate:function(){this.inherited(arguments);l.disconnect(this._sConnect);delete this._sConnect},_initializeTool:function(){this._createSymbols();this._initializeLayers();this._toolTypes=["select","selectadd","selectremove"]},_onDrawEnd:function(a){this.inherited(arguments);
this._settings.editor._hideAttributeInspector();var b=this._settings.layers;this._selectMethod=this._activeTool._selectMethod;this._settings.editor._selectionHelper.selectFeaturesByGeometry(b,a,this._selectMethod,m.hitch(this,"onFinished"))},_createSymbols:function(){this._pointSelectionSymbol=new k(k.STYLE_CIRCLE,10,new c(c.STYLE_SOLID,new f([0,0,0]),1),new f([255,0,0,.5]));this._polylineSelectionSymbol=new c(c.STYLE_SOLID,new f([0,200,255]),2);this._polygonSelectionSymbol=new h(h.STYLE_SOLID,new c(c.STYLE_SOLID,
new f([0,0,0]),1),new f([0,200,255,.5]))},_initializeLayers:function(){n.forEach(this._settings.layers,this._setSelectionSymbol,this)},_setSelectionSymbol:function(a){var b=null;switch(a.geometryType){case "esriGeometryPoint":b=this._pointSelectionSymbol;break;case "esriGeometryPolyline":b=this._polylineSelectionSymbol;break;case "esriGeometryPolygon":b=this._polygonSelectionSymbol}a.setSelectionSymbol(a._selectionSymbol||b)},_createTools:function(){n.forEach(this._toolTypes,this._createTool,this);
this.inherited(arguments)},_createTool:function(c){var d=m.mixin(a[c],{settings:this._settings,onClick:m.hitch(this,"onItemClicked",a[c].id)});this._tools[c.toUpperCase()]=new b(d)}});e("extend-esri")&&m.setObject("dijit.editing.tools.Selection",q,t);return q})},"esri/dijit/editing/tools/SelectionTools":function(){define(["dojo/_base/lang","dojo/has","../../../layers/FeatureLayer","../../../toolbars/draw","../../../kernel"],function(q,m,n,l,f){n={select:{id:"btnNewSelection",_enabledIcon:"toolbarIcon newSelectionIcon",
_disabledIcon:"toolbarIcon newSelectionIcon",_drawType:l.EXTENT,_selectMethod:n.SELECTION_NEW,_label:"NLS_selectionNewLbl"},selectadd:{id:"btnAddToSelection",_enabledIcon:"toolbarIcon addToSelectionIcon",_disabledIcon:"toolbarIcon addToSelectionIcon",_drawType:l.EXTENT,_selectMethod:n.SELECTION_ADD,_label:"NLS_selectionAddLbl"},selectremove:{id:"btnSubtractFromSelection",_enabledIcon:"toolbarIcon removeFromSelectionIcon",_disabledIcon:"toolbarIcon removeFromSelectionIcon",_drawType:l.EXTENT,_selectMethod:n.SELECTION_SUBTRACT,
_label:"NLS_selectionRemoveLbl"},selectClear:{id:"btnClearSelection",_enabledIcon:"toolbarIcon clearSelectionIcon",_disabledIcon:"toolbarIcon clearSelectionIcon",_enabled:!1,_label:"NLS_selectionClearLbl"}};m("extend-esri")&&q.setObject("dijit.editing.tools.SelectionTools",n,f);return n})},"esri/dijit/editing/SelectionHelper":function(){define("dojo/_base/declare dojo/_base/lang dojo/_base/connect dojo/_base/array dojo/has dojo/DeferredList ../../geometry/Extent ../../geometry/Point ../../geometry/ScreenPoint ../../layers/FeatureLayer ../../tasks/query ../../kernel".split(" "),
function(q,m,n,l,f,e,k,c,h,b,a,d){q=q(null,{declaredClass:"esri.dijit.editing.SelectionHelper",constructor:function(a){this._settings=a||{};this._sConnects=[];this._mapServiceCount=0;this._map=this._settings.map;this._tolerance=this._settings.singleSelectionTolerance;this._initMapServiceInfos(this._settings.layers)},destroy:function(){for(var a in this._sConnects)this._sConnects.hasOwnProperty(a)&&n.disconnect(this._sConnects[a])},selectFeatures:function(a,c,d,f){d===b.SELECTION_NEW&&(this._resetMapServiceInfos(),
this.getSelection(a));var g=[];l.forEach(a,function(a){if(!0===a.visible&&!0===a._isMapAtVisibleScale()){var e=d;a._isSelOnly&&e===b.SELECTION_NEW&&(e=b.SELECTION_ADD);g.push(a.selectFeatures(c,e))}});(new e(g)).addCallback(m.hitch(this,function(c){var e=[];l.forEach(c,function(b,c){l.forEach(b[1],function(b){(b=a[c]._mode._getFeature(b.attributes[a[c].objectIdField])||null)&&e.push(b)},this)},this);this._mapServiceCount?((c=d===b.SELECTION_SUBTRACT)?(this._resetMapServiceInfos(),this._createLayerDefs(this._getLayerInfosFromSelection(a))):
this._createLayerDefs(this._getLayerInfosFromFeatures(e)),this._updateLayerDefs(this._mapServiceInfos,!1,!(e&&e.length||c),m.hitch(this,f,e))):f(e)}))},selectFeaturesByGeometry:function(b,d,e,f){var g=d;-1!==d.declaredClass.indexOf("Extent")&&d.xmax===d.xmin&&d.ymax===d.ymin&&(g=new c(d.xmax,d.ymax,d.spatialReference));g=-1!==g.declaredClass.indexOf("Point")?this._extentFromPoint(g):g;d=new a;d.geometry=g;this.selectFeatures(b,d,e,f)},clearSelection:function(a){l.forEach(this._nonSelOnlyLayers,function(a){a.clearSelection&&
a.clearSelection()});if(this._mapServiceCount){this._resetMapServiceInfos();var b=this._getLayerInfosFromSelection(this._settings.layers);l.some(b,function(a){return a.oids&&a.oids.length})&&(this._createLayerDefs(b),this._updateLayerDefs(this._mapServiceInfos,!0,a||!1))}},findMapService:function(a){var b=this._map,c=b.layerIds;a=a&&a._url&&a._url.path?a._url.path.toLowerCase():"";var d,e,f;for(e in c)if(c.hasOwnProperty(e)&&(d=b.getLayer(c[e]),f=d._url?d._url.path?d._url.path.toLowerCase().replace("mapserver",
"featureserver"):d._url.toLowerCase().replace("mapserver","featureserver"):"",a.substr(0,f.length)===f&&"esri.layers.ArcGISDynamicMapServiceLayer"===d.declaredClass))return d},getSelection:function(a){var b=[];l.forEach(a,function(a){a._isSelOnly&&b.push(this._createLayerInfo(a))},this);l.forEach(b,function(a){var b=this._createMapServiceInfo(this.findMapService(a.layer));b&&(b.layerInfos[a.layer.layerId]=a)},this)},_initMapServiceInfos:function(a){this._nonSelOnlyLayers=[];this._mapServiceInfos=
[];l.forEach(a,function(a){var b=this.findMapService(a);b?(this._mapServiceCount++,this._createMapServiceInfo(b),b&&b.setDisableClientCaching(!0)):this._nonSelOnlyLayers.push(a)},this)},_createMapServiceInfo:function(a){if(!a)return null;var b=this._mapServiceInfos,c=b[a.id];c||(c=b[a.id]={mapService:a,layerInfos:[],layerDefs:m.mixin([],a.layerDefinitions||[]),origLayerDefs:m.mixin([],a.layerDefinitions||[])});return c},_resetMapServiceInfo:function(a){l.forEach(a.layerInfos,this._resetLayerInfo);
a.layerDefs=m.mixin([],a.origLayerDefs||[])},_resetMapServiceInfos:function(){var a=this._mapServiceInfos,b;for(b in a)a.hasOwnProperty(b)&&this._resetMapServiceInfo(a[b])},_createLayerInfo:function(a,b){var c=a.objectIdField,d=b?[]:a.getSelectedFeatures();return{layer:a,selectedFeatures:d||[],oids:l.map(d,function(a){return a.attributes[c]})}},_resetLayerInfo:function(a){a&&(a.selectedFeatures=[],a.oids=[])},_updateLayerDefs:function(a,b,c,d){for(var e in a)if(a.hasOwnProperty(e)){var f=a[e],g=f.mapService,
h=f.layerDefs=b?m.mixin([],f.origLayerDefs||[]):f.layerDefs;h?(c?d&&d():this._sConnects[g.id]=n.connect(g,"onUpdateEnd",m.hitch(this,"_onMapServiceUpdate",f,b,d)),g.setLayerDefinitions(h,c||!1)):d&&d()}},_onMapServiceUpdate:function(c,d,e){n.disconnect(this._sConnects[c.mapService.id]);l.forEach(c.layerInfos,function(c){if(d)c&&c.layer.clearSelection();else{var e=new a;e.objectIds=c?c.oids:[];e.objectIds.length&&c.layer.selectFeatures(e,b.SELECTION_SUBTRACT)}},this);d&&this._resetMapServiceInfo(c);
e&&e()},_createLayerDefs:function(a){l.forEach(a,function(a){var b=a.layer,c=this._createMapServiceInfo(this.findMapService(a.layer));if(c){var c=c.layerDefs,d=b.layerId,e='("'+b.objectIdField+'" NOT IN (',f=a.oids;f&&f.length&&(l.forEach(a.oids,function(a,b){f=!0;b&&(e+=",");e+="'"+a+"'"}),e+="))",c[d]=c.length&&c[d]&&c[d].length?c[d]+(" AND"+e):e)}},this)},_getLayerInfosFromFeatures:function(a){var b=[];l.forEach(a,function(a){var c=a.getLayer();c&&c._isSelOnly&&(b[c.id]||(b[c.id]=this._createLayerInfo(c,
!0)),b[c.id].selectedFeatures.push(a),b[c.id].oids.push(a.attributes[c.objectIdField]))},this);a=[];for(var c in b)b.hasOwnProperty(c)&&a.push(b[c]);return a},_getLayerInfosFromSelection:function(a){var b=[];l.forEach(a,function(a){a._isSelOnly&&b.push(this._createLayerInfo(a,!1))},this);return b},_extentFromPoint:function(a){var b=this._tolerance,c=this._map,d=c.toScreen(a);a=new h(d.x-b,d.y+b);b=new h(d.x+b,d.y-b);a=c.toMap(a);b=c.toMap(b);return new k(a.x,a.y,b.x,b.y,c.spatialReference)}});f("extend-esri")&&
m.setObject("dijit.editing.SelectionHelper",q,d);return q})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A,y,B,x,w,z,E,C,D,F,G,I,N){var M=q([G,g,u],{declaredClass:"esri.dijit.editing.TemplatePicker",widgetsInTemplate:!0,templateString:N,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<=k.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=
t.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=t.getContentBox(this.domNode);this._columns=Math.floor(a.w/this._assumedCellWidth)||1}this._applyGridPatches();this._setGridLayout();n.connect(this.grid,"onRowClick",this,this._rowClicked);this._setGridData();this._toggleTooltip();9>c("ie")&&(this._repaintItems=m.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,d;if(a){d=this.domNode;var e;e=k.query("#"+d.id+".templatePicker div.item")[0];d=t.getContentBox(d);e=(e=e&&e.parentNode)?l.coords(e).w:this._assumedCellWidth;this._columns=(this._columns=Math.floor((d.w-b.views.views[0].getScrollbarWidth())/e))||1}e=this._rows;this._preprocess();var f=this._rows;this._setGridLayout();this._setGridData();f!==e&&b.set("autoHeight",this._rows,!1);a?(b._resize({w:d.w,h:d.h}),b.viewsHeaderNode.style.display=
"none"):b.update();this._toggleTooltip();var g=this,h=this.getSelected();h&&b.store.fetch({onComplete:function(a){var c=(a=g._locate(h,g._selectedInfo,a))&&b.views.views[0].getCellNode(a[0],a[1]);c&&g._rowClicked({cellNode:c,rowIndex:a[0],cellIndex:a[1]},!0)}});9>c("ie")&&setTimeout(this._repaintItems,this._ieTimer);a=this.featureLayers;d=this.items;a&&a.length||d&&d.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,f.forEach(a,function(a){b+=Math.ceil(a.length/this.columns)},this)):(f.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:(f.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),f.every(this.featureLayers,function(a){return a.loaded}))this.featureLayers=f.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;f.forEach(this.featureLayers,function(a){if(a.loaded)b--;else var c=n.connect(a,"onLoad",this,function(){n.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,d,e,g,h,k={};f.forEach(this.featureLayers,function(e,f){e.mode===y.MODE_SELECTION&&e._map&&e.url&&e._params.drawMode&&!e.source&&(b=m.trim(e._url.path).replace(/\/(MapServer|FeatureServer).*/ig,
"/MapServer").replace(/^https?:\/\//ig,"").toLowerCase(),c=k[b]=k[b]||{},d=c.featureLayers=c.featureLayers||{},g=c.indices=c.indices||[],d[f]=e,g.push(f),a=e._map)});a&&f.forEach(a.layerIds,function(d){(d=a.getLayer(d))&&d.url&&(d.getImageUrl||d.getTileUrl)&&d.loaded&&10.1<=d.version&&(b=m.trim(d._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=d,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=M.prototype,d=c.legendCache[b];d?d.then&&d._contexts.push(a):(d=c.legendCache[b]=F({url:a.info.mapServiceUrl+"/legend",content:{f:"json"},callbackParamName:"callback"}),d._contexts=[a],d.addBoth(function(a){if(!d.canceled){c.legendCache[b]=a;var e=d._contexts;d._contexts=null;
f.forEach(e,function(b){var c=b.pickerInstance;b=b.info;var e;c._destroyed||(f.forEach(b.indices,function(a){e=f.indexOf(c._loadingIndices,a);-1<e&&c._loadingIndices.splice(e,1)}),e=f.indexOf(c._loadingLegends,d),-1<e&&c._loadingLegends.splice(e,1),c._processLegendResponse(a,b))})}}));return d},_clearLegendInfo:function(){clearTimeout(this._legendTimer);this._ignoreLegends();this._legendIndices=this._loadingIndices=this._legendSymbols=this._loadingLegends=this._legendTimer=null},_ignoreLegends:function(){this._loadingLegends&&
f.forEach(this._loadingLegends,function(a){var b=-1;f.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;f.forEach(b.indices,function(a){c=f.indexOf(this._legendIndices,a);-1<c&&this._legendIndices.splice(c,1)},this)}else f.forEach(b.indices,function(c){var d=b.featureLayers[c].layerId,e,g=b.mapServiceUrl+"/"+d+"/images/",h=b.mapServiceLayer._getToken(),k,l,p,m;
this._legendSymbols[c]||(k=null,f.some(a.layers,function(a){a.layerId==d&&(k=a);return!!k}),k&&(l=this._legendSymbols[c]={},f.forEach(k.legend,function(a){if((p=a.values)&&p.length)for(e=0;e<p.length;e++)l[p[e]]=a;else l.defaultSymbol=a;(m=a.url)&&!a._fixed&&(a._fixed=1,-1===m.search(/https?\:/)&&(a.url=g+m),h&&-1!==a.url.search(/https?\:/)&&(a.url+=(-1<a.url.indexOf("?")?"\x26":"?")+"token\x3d"+h))})))},this);var d=this;d._started&&!d._legendTimer&&(d._legendTimer=setTimeout(function(){clearTimeout(d._legendTimer);
d._legendTimer=null;d._destroyed||d.update()},0))},_applyGridPatches:function(){var a=this.grid,b=a.adaptWidth,c,d,e;a.adaptWidth=function(){c=this.views.views;for(d=0;e=c[d];d++)v.set(e.headerNode,"display","block");b.apply(this,arguments);for(d=0;e=c[d];d++)v.set(e.headerNode,"display","none")};if(this._dojo14x){if("auto"!==this.rows&&"auto"!==this.columns)var f=n.connect(a,"_onFetchComplete",this,function(){n.disconnect(f);this.grid.set("autoHeight",this._rows)});n.connect(a,"_onDelete",this,this._destroyItems);
n.connect(a,"_clearData",this,this._destroyItems);n.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=m.hitch(this,this._cellFormatter),c=[],d=this._columns,e;for(e=0;e<d;e++)c.push({field:"cell"+e,get:m.hitch(this,a(e)),formatter:b});a={cells:[c]};this.grouping&&(d={field:"groupName",colSpan:d,get:m.hitch(this,this._cellGetGroup),
formatter:m.hitch(this,this._cellGroupFormatter)},a.cells.push([d]));d=this.grid;b=r.prototype.rowsPerPage;d.set("rowsPerPage",this._rows>b?this._rows:b);d.set("structure",a)},_setGridData:function(){var a=[];if(this.grouping){this._groupRowIndices=[];var b,c,d=this._columns;f.forEach(this._flItems,function(e,f){a.push({});var g=0===f?0:b+c+1;this._groupRowIndices.push(g);b=g;c=Math.ceil(e.length/d);a=a.concat(this._getStoreItems(e))},this)}else this.featureLayers?(f.forEach(this._flItems,function(b){a=
a.concat(b)}),a=this._getStoreItems(a)):a=this._getStoreItems(this._itItems);var e=new p({data:{items:a}});this.grid.setStore(e)},_toggleTooltip:function(){if(this.showTooltip){if(!this.tooltip){this.tooltip=d.create("div",{"class":"esriMapTooltip"},this.domNode);this.tooltip.style.display="none";this.tooltip.style.position="fixed";var a=this.grid;this._mouseOverConnect=n.connect(a,"onCellMouseOver",this,this._cellMouseOver);this._mouseOutConnect=n.connect(a,"onCellMouseOut",this,this._cellMouseOut)}}else this.tooltip&&
(n.disconnect(this._mouseOverConnect),n.disconnect(this._mouseOutConnect),d.destroy(this.tooltip),this.tooltip=null)},_rowClicked:function(b,c){var d=b.cellNode,e=b.rowIndex,f=b.cellIndex,g=this._getCellInfo(d,e,f);if(g){var h=this.grid.store;if(!h.getValue(g,"loadingCell")&&(this._selectedCell&&a.remove(this._selectedCell,"selectedItem"),d!==this._selectedCell?(a.add(d,"selectedItem"),this._selectedCell=d,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:f,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 d=this.grid.store,e=Array(this._columns),g,h=b.index1,k=b.index2,l=b.index,p=a.item;f.some(c,function(a,b){return f.some(e,function(c,e){var f=d.getValue(a,"cell"+e);return f&&(p?
l===d.getValue(f,"index"):h===d.getValue(f,"index1")&&k===d.getValue(f,"index2"))?(g=[b,e],!0):!1})});return g},_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,d=this._getCellInfo(c,a.rowIndex,a.cellIndex);if(b&&d){var e=this.grid.store;a=e.getValue(d,"template");var f=e.getValue(d,"type"),g=e.getValue(d,
"symbolInfo"),e=e.getValue(d,"layer");a=(d=this._getItem(d))&&d.label+(d.description?": "+d.description:"")||a&&a.name+(a.description?": "+a.description:"")||f&&f.name||g&&g.label+(g.description?": "+g.description:"")||(e&&e.name+": ")+"Default";b.style.display="none";b.innerHTML=a;c=l.coords(c.firstChild);v.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=f.map(a,function(a){return m.mixin({surfaceId:"tpick-surface-"+b.id++},a)});for(var c=a.length,d=0,e={},g=0,h,k=[],l=!0,p=this._columns;d<c;)l=!0,h="cell"+g,e[h]=a[d],d++,g++,0===g%p&&(l=!1,k.push(e),e={},g=0);l&&c&&k.push(e);return k},_getItemsFromLayers:function(a){var b=[];f.forEach(a,function(a,c){b.push(this._getItemsFromLayer(a,
c))},this);return b},_getItemsFromLayer:function(a,c){var d=[];if(this.useLegend&&-1<f.indexOf(this._loadingIndices,c))return[{label:this._nls&&this._nls.loading||"",symbol:null,layer:a,type:null,template:null,index1:c,index2:0,loadingCell:1}];var g=[],g=g.concat(a.templates);f.forEach(a.types,function(a){var b=a.templates;f.forEach(b,function(b){b._type_=a});g=g.concat(b)});var g=f.filter(g,D.isDefined),h=a.renderer;if(h){var k=h.declaredClass.replace("esri.renderer.","");if(0<g.length)f.forEach(g,
function(g){var l=g.prototype;if(l){var p;if(p=h.valueExpression?this._createSimpleSymbol(a):this._isUnclassedRenderer(h)?h.infos[0].symbol:h.getSymbol(l)){var m=null,n;if(!(9>b("ie"))&&g.thumbnail&&g.thumbnail.imageData)m=new x(g.thumbnail);else if(this.useLegend&&-1<f.indexOf(this._legendIndices,c)){if(n=this._legendSymbols&&this._legendSymbols[c])switch(k){case "SimpleRenderer":m=n.defaultSymbol;break;case "UniqueValueRenderer":f.some(h.infos,function(a){a.symbol===p&&(m=n[a.value]);return!!m});
break;case "ClassBreaksRenderer":f.some(h.infos,function(a){a.symbol===p&&(m=n[a.maxValue]);return!!m})}m&&(l=e.fromJson(e.toJson(x.defaultProps)),l.url=m.url,l.imageData=m.imageData,l.contentType=m.contentType,l.width=m.width,l.height=m.height,D.isDefined(l.width)&&D.isDefined(l.height)||(l.width=15,l.height=15),m=new x(l))}d.push({label:this._trimLabel(g.name),symbol:m||p,legendOverride:!!m,layer:a,type:g._type_,template:g,index1:c,index2:d.length})}else switch(k){case "HeatmapRenderer":d.push({label:this._trimLabel(g.name),
symbol:new B,legendOverride:!!m,layer:a,type:g._type_,template:g,index1:c,index2:d.length})}}delete g._type_},this);else{var l=[];"TemporalRenderer"===k&&(h=h.observationRenderer)&&(k=h.declaredClass.replace("esri.renderer.",""));switch(k){case "SimpleRenderer":l=[{symbol:h.symbol,label:h.label,description:h.description}];break;case "UniqueValueRenderer":case "ClassBreaksRenderer":l=h.infos}d=f.map(l,function(b,d){return{label:this._trimLabel(b.label),description:b.description,symbolInfo:m.mixin({constructor:function(){}},
b),symbol:b.symbol,layer:a,index1:c,index2:d}},this)}}return d},_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 B;break;case "esriGeometryPolyline":b=new z;break;case "esriGeometryPolygon":b=new w;break;default:a.hasXYFootprint&&
a.hasXYFootprint()&&(b=new w)}return b},_getItemsFromItems:function(a){return f.map(a,function(a,b){a=m.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,d=c.getValue(a,"surfaceId"),e=b[d];e||(e=b[d]=new E({id:d,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=f.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":""}});c("extend-esri")&&m.setObject("dijit.editing.TemplatePicker",M,C);return M})},"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(q,m,n,l,f,e,k,c,h){var b=e("dojox.grid.DataGrid",k,{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 c(this)},get:function(a,b){if(b&&"_item"==
this.field&&!this.fields)return b;if(b&&this.fields){var c=[],d=this.grid.store;m.forEach(this.fields,function(a){c=c.concat(d.getValues(b,a))});return c}return b||"string"!==typeof a?b?this.field?"_item"==this.field?b:this.grid.store.getValue(b,this.field):this.value:this.defaultValue:this.inherited(arguments)},_checkUpdateStatus:function(){if(0<this.updateDelay){var a=!1;this._endUpdateDelay&&(clearTimeout(this._endUpdateDelay),delete this._endUpdateDelay,a=!0);this.updating||(this.beginUpdate(),
a=!0);if(a){var b=this;this._endUpdateDelay=setTimeout(function(){delete b._endUpdateDelay;b.endUpdate()},this.updateDelay)}}},_onSet:function(a,b,c,e){this._checkUpdateStatus();a=this.getItemIndex(a);-1<a&&this.updateRow(a)},_createItem:function(a,b){var c=this._hasIdentity?this.store.getIdentity(a):l.toJson(this.query)+":idx:"+b+":sort:"+l.toJson(this.getSortProps());return this._by_idty[c]={idty:c,item:a}},_addItem:function(a,b,c){this._by_idx[b]=this._createItem(a,b);c||this.updateRow(b)},_onNew:function(a,
b){this._checkUpdateStatus();var c=this.get("rowCount");this._addingItem=!0;this.updateRowCount(c+1);this._addingItem=!1;this._addItem(a,c);this.showMessage()},_onDelete:function(a){this._checkUpdateStatus();a=this._getItemIndex(a,!0);if(0<=a){this._pages=[];this._eop=this._bop=-1;var b=this._by_idx[a];this._by_idx.splice(a,1);delete this._by_idty[b.idty];this.updateRowCount(this.get("rowCount")-1);0===this.get("rowCount")&&this.showMessage(this.noDataMessage)}this.selection.isSelected(a)&&(this.selection.deselect(a),
this.selection.selected.splice(a,1))},_onRevert:function(){this._refresh()},setStore:function(a,b,c){this._requestsPending(0)||(this._setQuery(b,c),this._setStore(a),this._refresh(!0))},setQuery:function(a,b){this._requestsPending(0)||(this._setQuery(a,b),this._refresh(!0))},setItems:function(a){this.items=a;this._setStore(this.store);this._refresh(!0)},_setQuery:function(a,b){this.query=a;this.queryOptions=b||this.queryOptions},_setStore:function(a){this.store&&this._store_connects&&m.forEach(this._store_connects,
this.disconnect,this);if(this.store=a){a=this.store.getFeatures();var b=[];this._canEdit=!!a["dojo.data.api.Write"]&&!!a["dojo.data.api.Identity"];this._hasIdentity=!!a["dojo.data.api.Identity"];a["dojo.data.api.Notification"]&&!this.items&&(b.push(this.connect(this.store,"onSet","_onSet")),b.push(this.connect(this.store,"onNew","_onNew")),b.push(this.connect(this.store,"onDelete","_onDelete")));this._canEdit&&b.push(this.connect(this.store,"revert","_onRevert"));this._store_connects=b}},_onFetchBegin:function(a,
b){this.scroller&&(this.rowCount!=a&&(b.isRender?(this.scroller.init(a,this.keepRows,this.rowsPerPage),this.rowCount=a,this._setAutoHeightAttr(this.autoHeight,!0),this._skipRowRenormalize=!0,this.prerender(),this._skipRowRenormalize=!1):this.updateRowCount(a)),a?this.showMessage():(this.views.render(),this._resize(),this.showMessage(this.noDataMessage),this.focus.initFocusView()))},_onFetchComplete:function(a,b){this.scroller&&(a&&0<a.length&&(m.forEach(a,function(a,c){this._addItem(a,b.start+c,!0)},
this),this.updateRows(b.start,a.length),b.isRender?(this.setScrollTop(0),this.postrender()):this._lastScrollTop&&this.setScrollTop(this._lastScrollTop),f("ie")&&h.setSelectable(this.domNode,this.selectable)),delete this._lastScrollTop,this._isLoaded||(this._isLoading=!1,this._isLoaded=!0),this._pending_requests[b.start]=!1)},_onFetchError:function(a,b){console.log(a);delete this._lastScrollTop;this._isLoaded||(this._isLoading=!1,this._isLoaded=!0,this.showMessage(this.errorMessage));this._pending_requests[b.start]=
!1;this.onFetchError(a,b)},onFetchError:function(a,b){},_fetch:function(a,b){a=a||0;if(this.store&&!this._pending_requests[a]){this._isLoaded||this._isLoading||(this._isLoading=!0,this.showMessage(this.loadingMessage));this._pending_requests[a]=!0;try{if(this.items){var c=this.items,d=this.store;this.rowsPerPage=c.length;var e={start:a,count:this.rowsPerPage,isRender:b};this._onFetchBegin(c.length,e);var f=0;m.forEach(c,function(a){d.isItemLoaded(a)||f++});if(0===f)this._onFetchComplete(c,e);else{var h=
function(a){f--;0===f&&this._onFetchComplete(c,e)};m.forEach(c,function(a){d.isItemLoaded(a)||d.loadItem({item:a,onItem:h,scope:this})},this)}}else this.store.fetch({start:a,count:this.rowsPerPage,query:this.query,sort:this.getSortProps(),queryOptions:this.queryOptions,isRender:b,onBegin:n.hitch(this,"_onFetchBegin"),onComplete:n.hitch(this,"_onFetchComplete"),onError:n.hitch(this,"_onFetchError")})}catch(r){this._onFetchError(r,{start:a,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(a){var b=this._by_idx[a];return!b||b&&!b.item?(this._preparePage(a),null):b.item},getItemIndex:function(a){return this._getItemIndex(a,!1)},_getItemIndex:function(a,b){if(!b&&!this.store.isItem(a))return-1;for(var c=this._hasIdentity?this.store.getIdentity(a):null,d=0,e=this._by_idx.length;d<e;d++){var f=this._by_idx[d];if(f&&(c&&f.idty==c||f.item===a))return d}return-1},filter:function(a,
b){this.query=a;b&&this._clearData();this._fetch()},_getItemAttr:function(a,b){var c=this.getItem(a);return c?this.store.getValue(c,b):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(a){return this._pending_requests[a]},_rowToPage:function(a){return this.rowsPerPage?Math.floor(a/this.rowsPerPage):a},_pageToRow:function(a){return this.rowsPerPage?this.rowsPerPage*
a:a},_preparePage:function(a){(a<this._bop||a>=this._eop)&&!this._addingItem&&(a=this._rowToPage(a),this._needPage(a),this._bop=a*this.rowsPerPage,this._eop=this._bop+(this.rowsPerPage||this.get("rowCount")))},_needPage:function(a){this._pages[a]||(this._pages[a]=!0,this._requestPage(a))},_requestPage:function(a){a=this._pageToRow(a);0<Math.min(this.rowsPerPage,this.get("rowCount")-a)&&(this._requests++,this._requestsPending(a)||setTimeout(n.hitch(this,"_fetch",a,!1),1))},getCellName:function(a){return a.field},
_refresh:function(a){this._clearData();this._fetch(0,a)},sort:function(){this.edit.apply();this._lastScrollTop=this.scrollTop;this._refresh()},canSort:function(){return!this._isLoading},getSortProps:function(){var a=this.getCell(this.getSortIndex());if(a){var b=a.sortDesc,c=!(0<this.sortInfo);return[{attribute:a.field,descending:"undefined"==typeof b?c:c?!b:b}]}return this.sortFields?this.sortFields:null},styleRowState:function(a){if(this.store&&this.store.getState){for(var b=this.store.getState(a.index),
c="",e=0,f=["inflight","error","inserting"],h;h=f[e];e++)if(b[h]){c=" dojoxGridRow-"+h;break}a.customClasses+=c}},onStyleRow:function(a){this.styleRowState(a);this.inherited(arguments)},canEdit:function(a,b){return this._canEdit},_copyAttr:function(a,b){var c=this.getItem(a);return this.store.getValue(c,b)},doStartEdit:function(a,b){this._cache[b]||(this._cache[b]=this._copyAttr(b,a.field));this.onStartEdit(a,b)},doApplyCellEdit:function(a,b,c){this.store.fetchItemByIdentity({identity:this._by_idx[b].idty,
onItem:n.hitch(this,function(d){var e=this.store.getValue(d,c);"number"==typeof e?a=isNaN(a)?a:parseFloat(a):"boolean"==typeof e?a="true"==a?!0:"false"==a?!1:a:e instanceof Date&&(e=new Date(a),a=isNaN(e.getTime())?a:e);this.store.setValue(d,c,a);this.onApplyCellEdit(a,b,c)})})},doCancelEdit:function(a){this._cache[a]&&(this.updateRow(a),delete this._cache[a]);this.onCancelEdit.apply(this,arguments)},doApplyEdit:function(a,b){this.onApplyEdit(a)},removeSelectedRows:function(){if(this._canEdit){this.edit.apply();
var a=n.hitch(this,function(a){a.length&&(m.forEach(a,this.store.deleteItem,this.store),this.selection.clear())});this.allItemsSelected?this.store.fetch({query:this.query,queryOptions:this.queryOptions,onComplete:a}):a(this.selection.getSelected())}}});b.cell_markupFactory=function(a,b,c){var d=n.trim(h.attr(b,"field")||"");d&&(c.field=d);c.field=c.field||c.name;if(d=n.trim(h.attr(b,"fields")||""))c.fields=d.split(",");a&&a(b,c)};b.markupFactory=function(a,c,e,f){return k.markupFactory(a,c,e,n.partial(b.cell_markupFactory,
f))};return b})},"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(q,m,
n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A,y,B,x,w,z,E){q.isCopyKey||(q.isCopyKey=q.dnd.getCopyKeyState);n=n("dojox.grid._Grid",[g,u,l],{templateString:r,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:e,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");w.initOnFontResize();this.connect(w,"onFontResize","textSizeChanged");v.funnelEvents(this.domNode,this,"doKeyEvent",v.keyEvents);"none"!=this.selectionMode&&this.domNode.setAttribute("aria-multiselectable","single"==this.selectionMode?"false":"true");z.addClass(this.domNode,this.classTag);this.isLeftToRight()||z.addClass(this.domNode,this.classTag+"Rtl");0<this.rowHeight&&z.addClass(this.viewsNode,
this.classTag+"FixedRowHeight")},postMixInProperties:function(){this.inherited(arguments);var a=q.i18n.getLocalization("dijit","loading",this.lang);this.loadingMessage=A.substitute(this.loadingMessage,a);this.errorMessage=A.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&&z.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&&(y.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 h(this);this.focus=new b(this);this.edit=new a(this)},createSelection:function(){this.selection=new d(this)},createScroller:function(){this.scroller=new f;this.scroller.grid=this;this.scroller.renderRow=B.hitch(this,"renderRow");this.scroller.removeRow=
B.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 c(this);this.views.createView=B.hitch(this,"createView")},createView:function(a,b){var c=new (B.getObject(a))({grid:this,index:b});this.viewsNode.appendChild(c.domNode);this.viewsHeaderNode.appendChild(c.headerNode);this.views.addView(c);z.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||m._scopeName+".grid._View",a).setStructure(b);this.scroller.setContentNodes(this.views.getContentNodes())},_setStructureAttr:function(a){a&&B.isString(a)&&(q.deprecated("dojox.grid._Grid.set('structure', 'objVar')","use dojox.grid._Grid.set('structure', objVar) instead","2.0"),a=B.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){q.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=y.map(this.layout.cells,function(a){a.menuItems||(a.menuItems=[]);var c=this,d=new p({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&&y.forEach(b,function(b){b!==this&&b.setAttribute("checked",a)},this);a=y.filter(c.layout.cells,function(a){1<a.menuItems.length?y.forEach(a.menuItems,"item.set('disabled', false);"):a.menuItems[0].set("disabled",!1);return!a.hidden});1==a.length&&y.forEach(a[0].menuItems,"item.set('disabled', true);")}},destroy:function(){var a=y.indexOf(this._gridCell.menuItems,this);this._gridCell.menuItems.splice(a,1);delete this._gridCell;p.prototype.destroy.apply(this,
arguments)}});a.menuItems.push(d);a.hidden||b.push(d);return d},this);1==b.length&&b[0].set("disabled",!0);return a},_setHeaderMenuAttr:function(a){this._placeholders&&this._placeholders.length&&(y.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){q.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&&y.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||z._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 d=this._getPadBorder(),e=void 0,f;this._autoHeight?this.domNode.style.height="auto":"number"==typeof this.autoHeight?(f=
e=this._getHeaderHeight(),f+=this.scroller.averageRowHeight*this.autoHeight,this.domNode.style.height=f+"px"):this.domNode.clientHeight<=d.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?(z.marginBox(this.domNode,a),this.height=this.domNode.style.height,delete this.fitTo):"parent"==this.fitTo&&(f=this._parentContentBoxHeight=0<this._parentContentBoxHeight?this._parentContentBoxHeight:
z._getContentBox(c).h,this.domNode.style.height=Math.max(0,f)+"px");c=y.some(this.views.views,function(a){return a.flexCells});this._autoHeight||0!==(f||z._getContentBox(this.domNode).h)?(this.viewsHeaderNode.style.display="block",c||void 0!==e||(e=this._getHeaderHeight())):this.viewsHeaderNode.style.display="none";c&&(e=void 0);this.adaptWidth();this.adaptHeight(e);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,d=0,e=y.filter(this.views.views,function(a){(a=a.hasHScrollbar())?c++:d++;return!a});0<c&&0<d&&y.forEach(e,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();z.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 t)for(var b=0,c;c=this.views.views[b];b++){if(!(c instanceof t))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:x("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()}});n.markupFactory=function(a,b,c,d){var e=function(a){a=z.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=E("\x3e colgroup",b).map(function(a){var b=z.attr(a,"span"),b={noscroll:"true"==z.attr(a,"noscroll")?!0:!1,__span:b?parseInt(b,10):1,cells:[]};z.hasAttr(a,"width")&&(b.width=e(a));return b}),a.structure.length||a.structure.push({__span:Infinity,cells:[]}),E("thead \x3e tr",b).forEach(function(b,c){var f=0,g=0,h,k=null;E("\x3e th",b).map(function(b){k?f>=h+k.__span&&(g++,h+=k.__span,k=a.structure[g]):(h=
0,k=a.structure[0]);var l={name:B.trim(z.attr(b,"name")||b.innerHTML),colSpan:parseInt(z.attr(b,"colspan")||1,10),type:B.trim(z.attr(b,"cellType")||""),id:B.trim(z.attr(b,"id")||"")};f+=l.colSpan;var p=z.attr(b,"rowspan");p&&(l.rowSpan=p);z.hasAttr(b,"width")&&(l.width=e(b));z.hasAttr(b,"relWidth")&&(l.relWidth=window.parseInt(z.attr(b,"relWidth"),10));z.hasAttr(b,"hidden")&&(l.hidden="true"==z.attr(b,"hidden")||!0===z.attr(b,"hidden"));d&&d(b,l);l.type=l.type?B.getObject(l.type):m.grid.cells.Cell;
l.type&&l.type.markupFactory&&l.type.markupFactory(b,l);k.cells[c]||(k.cells[c]=[]);k.cells[c].push(l)})}));return new c(a,b)};return n})},"dojox/grid/_Events":function(){define(["dojo/keys","dojo/dom-class","dojo/_base/declare","dojo/_base/event","dojo/_base/sniff"],function(q,m,n,l,f){return n("dojox.grid._Events",null,{cellOverClass:"dojoxGridCellOver",onKeyEvent:function(e){this.dispatchKeyEvent(e)},onContentEvent:function(e){this.dispatchContentEvent(e)},onHeaderEvent:function(e){this.dispatchHeaderEvent(e)},
onStyleRow:function(e){e.customClasses+=(e.odd?" dojoxGridRowOdd":"")+(e.selected?" dojoxGridRowSelected":"")+(e.over?" dojoxGridRowOver":"");this.focus.styleRow(e);this.edit.styleRow(e)},onKeyDown:function(e){if(!e.altKey&&!e.metaKey){var f;switch(e.keyCode){case q.ESCAPE:this.edit.cancel();break;case q.ENTER:if(!this.edit.isEditing()){f=this.focus.getHeaderIndex();if(0<=f){this.setSortIndex(f);break}else this.selection.clickSelect(this.focus.rowIndex,dojo.isCopyKey(e),e.shiftKey);l.stop(e)}e.shiftKey||
(f=this.edit.isEditing(),this.edit.apply(),f||this.edit.setEditCell(this.focus.cell,this.focus.rowIndex));this.edit.isEditing()||((this.focus.focusView||this.views.views[0]).content.decorateEvent(e),this.onRowClick(e),l.stop(e));break;case q.SPACE:this.edit.isEditing()||(f=this.focus.getHeaderIndex(),0<=f?this.setSortIndex(f):(this.selection.clickSelect(this.focus.rowIndex,dojo.isCopyKey(e),e.shiftKey),this.focus._focusifyCellNode(!0),this.focus.setFocusCell(this.focus.cell,this.focus.rowIndex),l.stop(e)));
break;case q.TAB:this.focus[e.shiftKey?"previousKey":"nextKey"](e);break;case q.LEFT_ARROW:case q.RIGHT_ARROW:if(!this.edit.isEditing()){var c=e.keyCode;l.stop(e);f=this.focus.getHeaderIndex();0<=f&&e.shiftKey&&e.ctrlKey?this.focus.colSizeAdjust(e,f,5*(c==q.LEFT_ARROW?-1:1)):(e=c==q.LEFT_ARROW?1:-1,this.isLeftToRight()&&(e*=-1),this.focus.move(0,e))}break;case q.UP_ARROW:this.edit.isEditing()||0===this.focus.rowIndex||(l.stop(e),this.focus.move(-1,0));break;case q.DOWN_ARROW:this.edit.isEditing()||
this.focus.rowIndex+1==this.rowCount||(l.stop(e),this.focus.move(1,0));break;case q.PAGE_UP:this.edit.isEditing()||0===this.focus.rowIndex||(l.stop(e),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 q.PAGE_DOWN:this.edit.isEditing()||this.focus.rowIndex+1==this.rowCount||
(l.stop(e),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(e){-1==e.rowIndex?this.onHeaderCellMouseOver(e):this.onCellMouseOver(e)},onMouseOut:function(e){-1==e.rowIndex?this.onHeaderCellMouseOut(e):this.onCellMouseOut(e)},onMouseDown:function(e){-1==
e.rowIndex?this.onHeaderCellMouseDown(e):this.onCellMouseDown(e)},onMouseOverRow:function(e){this.rows.isOver(e.rowIndex)||(this.rows.setOverRow(e.rowIndex),-1==e.rowIndex?this.onHeaderMouseOver(e):this.onRowMouseOver(e))},onMouseOutRow:function(e){if(this.rows.isOver(-1))this.onHeaderMouseOut(e);else this.rows.isOver(-2)||(this.rows.setOverRow(-2),this.onRowMouseOut(e))},onMouseDownRow:function(e){if(-1!=e.rowIndex)this.onRowMouseDown(e)},onCellMouseOver:function(e){e.cellNode&&m.add(e.cellNode,
this.cellOverClass)},onCellMouseOut:function(e){e.cellNode&&m.remove(e.cellNode,this.cellOverClass)},onCellMouseDown:function(e){},onCellClick:function(e){this._click[0]=this._click[1];this._click[1]=e;this.edit.isEditCell(e.rowIndex,e.cellIndex)||this.focus.setFocusCell(e.cell,e.rowIndex);1<this._click.length&&null==this._click[0]&&this._click.shift();this.onRowClick(e)},onCellDblClick:function(e){var k;k=1<this._click.length&&f("ie")?this._click[1]:1<this._click.length&&this._click[0].rowIndex!=
this._click[1].rowIndex?this._click[0]:e;this.focus.setFocusCell(k.cell,k.rowIndex);this.edit.setEditCell(k.cell,k.rowIndex);this.onRowDblClick(e)},onCellContextMenu:function(e){this.onRowContextMenu(e)},onCellFocus:function(e,f){this.edit.cellFocus(e,f)},onRowClick:function(e){this.edit.rowClick(e);this.selection.clickSelectEvent(e)},onRowDblClick:function(e){},onRowMouseOver:function(e){},onRowMouseOut:function(e){},onRowMouseDown:function(e){},onRowContextMenu:function(e){l.stop(e)},onHeaderMouseOver:function(e){},
onHeaderMouseOut:function(e){},onHeaderCellMouseOver:function(e){e.cellNode&&m.add(e.cellNode,this.cellOverClass)},onHeaderCellMouseOut:function(e){e.cellNode&&m.remove(e.cellNode,this.cellOverClass)},onHeaderCellMouseDown:function(e){},onHeaderClick:function(e){},onHeaderCellClick:function(e){this.setSortIndex(e.cell.index);this.onHeaderClick(e)},onHeaderDblClick:function(e){},onHeaderCellDblClick:function(e){this.onHeaderDblClick(e)},onHeaderCellContextMenu:function(e){this.onHeaderContextMenu(e)},
onHeaderContextMenu:function(e){this.headerMenu||l.stop(e)},onStartEdit:function(e,f){},onApplyCellEdit:function(e,f,c){},onCancelEdit:function(e){},onApplyEdit:function(e){},onCanSelect:function(e){return!0},onCanDeselect:function(e){return!0},onSelected:function(e){this.updateRowStyles(e)},onDeselected:function(e){this.updateRowStyles(e)},onSelectionChanged:function(){}})})},"dojox/grid/_Scroller":function(){define(["dijit/registry","dojo/_base/declare","dojo/_base/lang","./util","dojo/_base/html"],
function(q,m,n,l,f){var e=function(c){c&&dojo.forEach(q.toArray(),function(e){e.domNode&&f.isDescendant(e.domNode,c,!0)&&e.destroy()})},k=function(c,e){for(var b=[],a=0,d;d=c.childNodes[a];){a++;var h=f.byId(d);(h&&h.tagName?h.tagName.toLowerCase():"")==e&&b.push(d)}return b};return m("dojox.grid._Scroller",null,{constructor:function(c){this.setContentNodes(c);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(c,e,b){switch(arguments.length){case 3:this.rowsPerPage=b;case 2:this.keepRows=e;case 1:this.rowCount=c}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=n.hitch(this,"onscroll"))},_getPageCount:function(c,e){return c?Math.ceil(c/e)||1:0},destroy:function(){this.invalidateNodes();delete this.contentNodes;delete this.contentNode;delete this.scrollboxNode},setKeepInfo:function(c){this.keepPages=(this.keepRows=c)?Math.max(Math.ceil(this.keepRows/this.rowsPerPage),2):this.keepPages},setContentNodes:function(c){this.colCount=(this.contentNodes=c)?this.contentNodes.length:0;this.pageNodes=[];for(c=0;c<this.colCount;c++)this.pageNodes[c]=
[]},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(c){this.invalidateNodes();this.rowCount=c;c=this.pageCount;0===c&&(this.height=1);this.pageCount=this._getPageCount(this.rowCount,this.rowsPerPage);if(this.pageCount<c)for(--c;c>=this.pageCount;c--)this.height-=
this.getPageHeight(c),delete this.pageHeights[c];else this.pageCount>c&&(this.height+=this.defaultPageHeight*(this.pageCount-c-1)+this.calcLastPageHeight());this.resize()},pageExists:function(c){return!!this.getDefaultPageNode(c)},measurePage:function(c){return this.grid.rowHeight?((c+1)*this.rowsPerPage>this.rowCount?this.rowCount-c*this.rowsPerPage:this.rowsPerPage)*this.grid.rowHeight:(c=this.getDefaultPageNode(c))&&c.innerHTML?c.offsetHeight:void 0},positionPage:function(c,e){for(var b=0;b<this.colCount;b++)this.pageNodes[b][c].style.top=
e+"px"},repositionPages:function(c){for(var e=this.getDefaultNodes(),b=0,a=0;a<this.stack.length;a++)b=Math.max(this.stack[a],b);var d=(a=e[c])?this.getPageNodePosition(a)+this.getPageHeight(c):0;for(c+=1;c<=b;c++){if(a=e[c]){if(this.getPageNodePosition(a)==d)break;this.positionPage(c,d)}d+=this.getPageHeight(c)}},installPage:function(c){for(var e=0;e<this.colCount;e++)this.contentNodes[e].appendChild(this.pageNodes[e][c])},preparePage:function(c,e){for(var b=e?this.popPage():null,a=0;a<this.colCount;a++){var d=
this.pageNodes[a],f=null===b?this.createPageNode():this.invalidatePageNode(b,d);f.pageIndex=c;d[c]=f}},renderPage:function(c){var e=[],b;for(b=0;b<this.colCount;b++)e[b]=this.pageNodes[b][c];b=0;for(c*=this.rowsPerPage;b<this.rowsPerPage&&c<this.rowCount;b++,c++)this.renderRow(c,e)},removePage:function(c){var e=0;for(c*=this.rowsPerPage;e<this.rowsPerPage;e++,c++)this.removeRow(c)},destroyPage:function(c){for(var e=0;e<this.colCount;e++){var b=this.invalidatePageNode(c,this.pageNodes[e]);b&&f.destroy(b)}},
pacify:function(c){},pacifying:!1,pacifyTicks:200,setPacifying:function(c){this.pacifying!=c&&(this.pacifying=c,this.pacify(this.pacifying))},startPacify:function(){this.startPacifyTicks=(new Date).getTime()},doPacify:function(){var c=(new Date).getTime()-this.startPacifyTicks>this.pacifyTicks;this.setPacifying(!0);this.startPacify();return c},endPacify:function(){this.setPacifying(!1)},resize:function(){this.scrollboxNode&&(this.windowHeight=this.scrollboxNode.clientHeight);for(var c=0;c<this.colCount;c++)l.setStyleHeightPx(this.contentNodes[c],
Math.max(1,this.height));c=!this._invalidating;if(!c){var e=this.grid.get("autoHeight");"number"==typeof e&&e<=Math.min(this.rowsPerPage,this.rowCount)&&(c=!0)}c&&this.needPage(this.page,this.pageTop);c=this.page<this.pageCount-1?this.rowsPerPage:this.rowCount%this.rowsPerPage||this.rowsPerPage;e=this.getPageHeight(this.page);this.averageRowHeight=0<e&&0<c?e/c:0},calcLastPageHeight:function(){if(!this.pageCount)return 0;var c=(this.rowCount%this.rowsPerPage||this.rowsPerPage)*this.defaultRowHeight;
return this.pageHeights[this.pageCount-1]=c},updateContentHeight:function(c){this.height+=c;this.resize()},updatePageHeight:function(c,e,b){if(this.pageExists(c)){var a=this.getPageHeight(c),d=this.measurePage(c);void 0===d&&(d=a);this.pageHeights[c]=d;if(a!=d){this.updateContentHeight(d-a);var f=this.grid.get("autoHeight");"number"==typeof f&&f>this.rowCount||!0===f&&!e?b?(e=this.grid.viewsNode.style,e.height=parseInt(e.height)+d-a+"px",this.repositionPages(c)):this.grid.sizeChange():this.repositionPages(c)}return d}return 0},
rowHeightChanged:function(c,e){this.updatePageHeight(Math.floor(c/this.rowsPerPage),!1,e)},invalidateNodes:function(){for(;this.stack.length;)this.destroyPage(this.popPage())},createPageNode:function(){var c=document.createElement("div");f.attr(c,"role","presentation");c.style.position="absolute";c.style[this.grid.isLeftToRight()?"left":"right"]="0";return c},getPageHeight:function(c){c=this.pageHeights[c];return void 0!==c?c:this.defaultPageHeight},pushPage:function(c){return this.stack.push(c)},
popPage:function(){return this.stack.shift()},findPage:function(c){for(var e=0,b=0,a=0;e<this.pageCount&&!(a=this.getPageHeight(e),b+a>=c);e++,b+=a);this.page=e;this.pageTop=b},buildPage:function(c,e,b){this.preparePage(c,e);this.positionPage(c,b);this.installPage(c);this.renderPage(c);this.pushPage(c)},needPage:function(c,e){var b=this.getPageHeight(c);this.pageExists(c)?this.positionPage(c,e):(this.buildPage(c,!this.grid._autoHeight&&this.keepPages&&this.stack.length>=this.keepPages,e),b=this.updatePageHeight(c,
!0));return b},onscroll:function(){this.scroll(this.scrollboxNode.scrollTop)},scroll:function(c){this.grid.scrollTop=c;if(this.colCount){this.startPacify();this.findPage(c);for(var e=this.height,b=this.getScrollBottom(c),a=this.page,d=this.pageTop;a<this.pageCount&&(0>b||d<b);a++)d+=this.needPage(a,d);this.firstVisibleRow=this.getFirstVisibleRow(this.page,this.pageTop,c);this.lastVisibleRow=this.getLastVisibleRow(a-1,d,b);e!=this.height&&this.repositionPages(a-1);this.endPacify()}},getScrollBottom:function(c){return 0<=
this.windowHeight?c+this.windowHeight:-1},processNodeEvent:function(c,e){for(var b=c.target;b&&b!=e&&b.parentNode&&b.parentNode.parentNode!=e;)b=b.parentNode;if(!b||!b.parentNode||b.parentNode.parentNode!=e)return!1;c.topRowIndex=b.parentNode.pageIndex*this.rowsPerPage;var a=c.topRowIndex,d;a:{d=0;for(var f,h=b.parentNode;f=h.childNodes[d++];)if(f==b){--d;break a}d=-1}c.rowIndex=a+d;c.rowTarget=b;return!0},processEvent:function(c){return this.processNodeEvent(c,this.contentNode)},renderRow:function(c,
e){},removeRow:function(c){},getDefaultPageNode:function(c){return this.getDefaultNodes()[c]},positionPageNode:function(c,e){},getPageNodePosition:function(c){return c.offsetTop},invalidatePageNode:function(c,f){var b=f[c];b&&(delete f[c],this.removePage(c,b),e(b),b.innerHTML="");return b},getPageRow:function(c){return c*this.rowsPerPage},getLastPageRow:function(c){return Math.min(this.rowCount,this.getPageRow(c+1))-1},getFirstVisibleRow:function(c,e,b){if(!this.pageExists(c))return 0;var a=this.getPageRow(c),
d=this.getDefaultNodes();c=k(d[c],"div");for(var d=0,f=c.length;d<f&&e<b;d++,a++)e+=c[d].offsetHeight;return a?a-1:a},getLastVisibleRow:function(c,e,b){if(!this.pageExists(c))return 0;var a=this.getDefaultNodes(),d=this.getLastPageRow(c);c=k(a[c],"div");for(a=c.length-1;0<=a&&e>b;a--,d--)e-=c[a].offsetHeight;return d+1},findTopRow:function(c){for(var e=this.getDefaultNodes(),e=k(e[this.page],"div"),b=0,a=e.length,d=this.pageTop,f;b<a;b++)if(f=e[b].offsetHeight,d+=f,d>=c)return this.offset=f-(d-c),
b+this.page*this.rowsPerPage;return-1},findScrollTop:function(c){var e=Math.floor(c/this.rowsPerPage),b=0,a;for(a=0;a<e;a++)b+=this.getPageHeight(a);this.pageTop=b;this.page=e;this.needPage(e,this.pageTop);a=this.getDefaultNodes();var d=k(a[e],"div"),e=c-this.rowsPerPage*e;a=0;for(c=d.length;a<c&&a<e;a++)b+=d[a].offsetHeight;return b},dummy:0})})},"dojox/grid/util":function(){define(["../main","dojo/_base/lang","dojo/dom"],function(q,m,n){var l=m.getObject("grid.util",!0,q);l.na="...";l.rowIndexTag=
"gridRowIndex";l.gridViewTag="gridView";l.fire=function(f,e,k){var c=f&&e&&f[e];return c&&(k?c.apply(f,k):f[e]())};l.setStyleHeightPx=function(f,e){if(0<=e){var k=f.style,c=e+"px";f&&k.height!=c&&(k.height=c)}};l.mouseEvents="mouseover mouseout mousedown mouseup click dblclick contextmenu".split(" ");l.keyEvents=["keyup","keydown","keypress"];l.funnelEvents=function(f,e,k,c){c=c?c:l.mouseEvents.concat(l.keyEvents);for(var h=0,b=c.length;h<b;h++)e.connect(f,"on"+c[h],k)};l.removeNode=function(f){(f=
n.byId(f))&&f.parentNode&&f.parentNode.removeChild(f);return f};l.arrayCompare=function(f,e){for(var k=0,c=f.length;k<c;k++)if(f[k]!=e[k])return!1;return f.length==e.length};l.arrayInsert=function(f,e,k){f.length<=e?f[e]=k:f.splice(e,0,k)};l.arrayRemove=function(f,e){f.splice(e,1)};l.arraySwap=function(f,e,k){var c=f[e];f[e]=f[k];f[k]=c};return l})},"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(q,m,n,l,f,e){return n("dojox.grid._Layout",null,{constructor:function(e){this.grid=e},cells:[],structure:null,defaultWidth:"6em",moveColumn:function(e,c,f,b,a){var d=this.structure[e].cells[0],h=this.structure[c].cells[0],k=null,g=k=0;e=0;for(var m;m=d[e];e++)if(m.index==f){k=e;break}k=d.splice(k,1)[0];k.view=this.grid.views.views[c];e=0;for(m=null;m=h[e];e++)if(m.index==b){g=e;break}a||(g+=1);h.splice(g,0,k);if(f=this.grid.getCell(this.grid.getSortIndex()))f._currentlySorted=this.grid.getSortAsc();
this.cells=[];for(e=f=0;c=this.structure[e];e++)for(b=0;a=c.cells[b];b++)for(d=0;m=a[d];d++)m.index=f,this.cells.push(m),"_currentlySorted"in m&&(h=f+1,h*=m._currentlySorted?1:-1,this.grid.sortInfo=h,delete m._currentlySorted),f++;l.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(f,c){var h=this.cells[f];if(h.hidden==c){h.hidden=!c;var b=
h.view,a=b.viewWidth;a&&"auto"!=a&&(b._togglingColumn=e.getMarginBox(h.getHeaderNode()).w||0);b.update();return!0}return!1},addCellDef:function(e,c,h){var b=this,a=function(a){var c=0;1<a.colSpan?c=0:(c=a.width||b._defaultCellProps.width||b.defaultWidth,isNaN(c)||(c+="em"));return c};e={grid:this.grid,subrow:e,layoutIndex:c,index:this.cells.length};if(h&&h instanceof m.grid.cells._Base)return c=f.clone(h),e.unitWidth=a(c._props),c=f.mixin(c,this._defaultCellProps,h._props,e);c=h.type||h.cellType||
this._defaultCellProps.type||this._defaultCellProps.cellType||m.grid.cells.Cell;f.isString(c)&&(c=f.getObject(c));e.unitWidth=a(h);return new c(f.mixin({},this._defaultCellProps,h,e))},addRowDef:function(e,c){for(var f=[],b=0,a=0,d=!0,k=0,m;m=c[k];k++)m=this.addCellDef(e,k,m),f.push(m),this.cells.push(m),d&&m.relWidth?b+=m.relWidth:m.width&&(m=m.width,"string"==typeof m&&"%"==m.slice(-1)?a+=window.parseInt(m,10):"auto"==m&&(d=!1));b&&d&&l.forEach(f,function(c){c.relWidth&&(c.width=c.unitWidth=c.relWidth/
b*(100-a)+"%")});return f},addRowsDef:function(e){var c=[];if(f.isArray(e))if(f.isArrayLike(e[0]))for(var h=0,b;e&&(b=e[h]);h++)c.push(this.addRowDef(h,b));else c.push(this.addRowDef(0,e));return c},addViewDef:function(e){this._defaultCellProps=e.defaultCell||{};e.width&&"auto"==e.width&&delete e.width;return f.mixin({},e,{cells:this.addRowsDef(e.rows||e.cells)})},setStructure:function(e){this.fieldIndex=0;this.cells=[];var c=this.structure=[];if(this.grid.rowSelector){var h={type:m._scopeName+".grid._RowSelector"};
if(f.isString(this.grid.rowSelector)){var b=this.grid.rowSelector;"false"==b?h=null:"true"!=b&&(h.width=b)}else this.grid.rowSelector||(h=null);h&&c.push(this.addViewDef(h))}var a=function(a){return"name"in a||"field"in a||"get"in a},h=function(b){return f.isArray(b)&&(f.isArray(b[0])||a(b[0]))?!0:!1},b=function(b){return null!==b&&f.isObject(b)&&("cells"in b||"rows"in b||"type"in b&&!a(b))};if(f.isArrayLike(e)){for(var d=!1,k=0,l;l=e[k];k++)if(b(l)){d=!0;break}if(d)for(k=0;l=e[k];k++)h(l)?c.push(this.addViewDef({cells:l})):
b(l)&&c.push(this.addViewDef(l));else c.push(this.addViewDef({cells:e}))}else b(e)&&c.push(this.addViewDef(e));this.cellCount=this.cells.length;this.grid.setupHeaderMenu()}})})},"dojox/grid/cells":function(){define(["../main","./cells/_base"],function(q){return q.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(q,m,n,l,f,e,k,c,h,b,a,d){var t=m("dojox.grid._DeferredTextWidget",a,{deferred:null,_destroyOnRemove:!0,postCreate:function(){this.deferred&&this.deferred.addBoth(n.hitch(this,function(a){this.domNode&&(this.domNode.innerHTML=a)}))}}),v=function(){setTimeout(n.hitch.apply(q,arguments),0)},g=m("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||{};n.mixin(this,a);void 0===this.draggable&&(this.draggable=!0)},_defaultFormat:function(a,c){var d=this.grid.formatterScope||this,e=this.formatter;e&&d&&"string"==typeof e&&(e=this.formatter=d[e]);d=a!=this.defaultValue&&e?e.apply(d,c):a;if("undefined"==typeof d)return this.defaultValue;d&&d.addBoth&&(d=new t({deferred:d},b.create("span",{innerHTML:this.defaultValue})));return d&&d.declaredClass&&d.startup?"\x3cdiv class\x3d'dojoxGridStubNode' linkWidget\x3d'"+d.id+"' cellIdx\x3d'"+this.index+
"'\x3e"+this.defaultValue+"\x3c/div\x3e":d},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&&n.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&&f.connect(a,"onblur",function(a){setTimeout(n.hitch(this,"_onEditBlur",b),250)})},needFormatNode:function(a,b){this._formatPending=!0;v(this,"_formatNode",a,b)},cancelFormatNode:function(){this._formatPending=!1},_formatNode:function(a,b){this._formatPending&&(this._formatPending=!1,k("ie")||c.setSelectable(this.grid.domNode,!0),this.formatNode(this.getEditNode(b),a,b))},formatNode:function(a,b,c){k("ie")?v(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{d.fire(c,"focus"),d.fire(c,"select")}catch(B){}},save:function(a){this.value=this.value||this.getValue(a)},restore:function(a){this.setValue(a,this.value)},_finish:function(a){c.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)}});g.markupFactory=function(a,b){var c=n.trim(h.get(a,"formatter")||"");c&&(b.formatter=n.getObject(c)||c);if(c=n.trim(h.get(a,"get")||""))b.get=n.getObject(c);c=function(b,c,d){var e=n.trim(h.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=n.trim(h.get(a,"loadingText")||h.get(a,"defaultValue")||""))b.defaultValue=c;c=function(b,
c,d){var e=n.trim(h.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 u=g.Cell=m("dojox.grid.cells.Cell",g,{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)&&l.stop(a)},_finish:function(a){this.inherited(arguments);var b=this.getEditNode(a);try{d.fire(b,"blur")}catch(y){}}});u.markupFactory=function(a,b){g.markupFactory(a,b);var c=n.trim(h.get(a,"keyFilter")||"");c&&(b.keyFilter=new RegExp(c))};(g.RowIndex=m("dojox.grid.cells.RowIndex",u,{name:"Row",postscript:function(){this.editable=!1},get:function(a){return a+1}})).markupFactory=function(a,b){u.markupFactory(a,b)};(g.Select=m("dojox.grid.cells.Select",
u,{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 d=e.indexOf(this.values,c);0<=d&&(c=this.options[d])}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){u.markupFactory(a,b);var c=n.trim(h.get(a,"options")||"");if(c){var d=c.split(",");d[0]!=c&&(b.options=d)}if(c=n.trim(h.get(a,
"values")||""))d=c.split(","),d[0]!=c&&(b.values=d)};var p=g.AlwaysEdit=m("dojox.grid.cells.AlwaysEdit",u,{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)}});p.markupFactory=function(a,b){u.markupFactory(a,b)};(g.Bool=m("dojox.grid.cells.Bool",p,{_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){p.markupFactory(a,b)};return g})},"dojox/grid/_RowSelector":function(){define(["dojo/_base/declare","./_View"],function(q,m){return q("dojox.grid._RowSelector",m,{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(m,l){l.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(m,l){var f=["dojoxGridRowbar dojoxGridNonNormalizedCell"];this.grid.rows.isOver(m)&&f.push("dojoxGridRowbarOver");this.grid.selection.isSelected(m)&&f.push("dojoxGridRowbarSelected");l.className=f.join(" ")},domouseover:function(m){this.grid.onMouseOverRow(m)},domouseout:function(m){if(!this.isIntraRowEvent(m))this.grid.onMouseOutRow(m)}})})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A,y){a=l("dojox.grid._View",[t,v],{defaultWidth:"18em",viewWidth:"",templateString:a,classTag:"dojoxGrid",marginBottom:0,rowPad:2,_togglingColumn:-1,_headerBuilderClass:r._HeaderBuilder,_contentBuilderClass:r._ContentBuilder,postMixInProperties:function(){this.rowNodes={}},postCreate:function(){this.connect(this.scrollboxNode,"onscroll","doscroll");u.funnelEvents(this.contentNode,this,"doContentEvent","mouseover mouseout click dblclick contextmenu mousedown".split(" "));
u.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(){p.destroy(this.headerNode);delete this.headerNode;for(var a in this.rowNodes)this._cleanupRowWidgets(this.rowNodes[a]),p.destroy(this.rowNodes[a]);this.rowNodes={};this.source&&this.source.destroy();
this.inherited(arguments)},focus:function(){c("ie")||c("webkit")||c("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&&f.forEach(h("[widgetId]",a).map(m.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;f.forEach(h(".dojoxGridStubNode",c),function(a){if(a&&a.parentNode){var b=a.getAttribute("linkWidget"),
c=window.parseInt(p.attr(a,"cellIdx"),10);d.getCell(c);(b=m.byId(b))?(a.parentNode.replaceChild(b.domNode,a),b._started||b.startup(),q.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 a=this.hasVScrollbar(),b=p.style(this.scrollboxNode,
"overflow");this.noscroll||!b||"hidden"==b?a=!1:"scroll"==b&&(a=!0);return a?g.getScrollbar().w:0},getColumnsWidth:function(){var a=this.headerContentNode;return a&&a.firstChild?a.firstChild.offsetWidth||p.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,
p._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,f=e.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&&p.destroy(this.bottomMarker);this.bottomMarker=p.byId("dojoxGrid_bottomMarker");this.topMarker&&p.destroy(this.topMarker);this.topMarker=p.byId("dojoxGrid_topMarker");this.bottomMarker||(this.bottomMarker=p.create("div",{id:"dojoxGrid_bottomMarker","class":"dojoxGridColPlaceBottom"},b.body()),this._hide(this.bottomMarker),this.topMarker=p.create("div",{id:"dojoxGrid_topMarker","class":"dojoxGridColPlaceTop"},
b.body()),this._hide(this.topMarker));this.arrowDim=p.contentBox(this.bottomMarker);var g=p.contentBox(this.headerContentNode.firstChild.rows[0]).h;this.source=new d(this.headerContentNode.firstChild.rows[0],{horizontal:!0,accept:["gridColumn_"+this.grid.id],viewIndex:this.index,generateText:!1,onMouseDown:e.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>c("ie")?1:0)&&d.prototype.onMouseDown.call(this.source,a)}}),onMouseOver:e.hitch(this,function(a){var b=this.source;b._getChildByEvent(a)&&d.prototype.onMouseOver.apply(b,arguments)}),_markTargetAnchor:e.hitch(this,function(a){var b=this.source;if(b.current!=b.targetAnchor||b.before!=a){b.targetAnchor&&f(b.targetAnchor,b.before)&&b._removeItemClass(f(b.targetAnchor,b.before),b.before?"After":"Before");d.prototype._markTargetAnchor.call(b,
a);var c=a?b.targetAnchor:f(b.targetAnchor,b.before);a=0;c||(c=b.targetAnchor,a=p.contentBox(c).w+this.arrowDim.w/2+2);c=p.position(c,!0);a=Math.floor(c.x-this.arrowDim.w/2+a);p.style(this.bottomMarker,"visibility","visible");p.style(this.topMarker,"visibility","visible");p.style(this.bottomMarker,{left:a+"px",top:g+c.y+"px"});p.style(this.topMarker,{left:a+"px",top:c.y-this.arrowDim.h+"px"});b.targetAnchor&&f(b.targetAnchor,b.before)&&b._addItemClass(f(b.targetAnchor,b.before),b.before?"After":"Before")}}),
_unmarkTargetAnchor:e.hitch(this,function(){var a=this.source;a.targetAnchor&&(a.targetAnchor&&f(a.targetAnchor,a.before)&&a._removeItemClass(f(a.targetAnchor,a.before),a.before?"After":"Before"),this._hide(this.bottomMarker),this._hide(this.topMarker),d.prototype._unmarkTargetAnchor.call(a))}),destroy:e.hitch(this,function(){k.disconnect(this._source_conn);k.unsubscribe(this._source_sub);d.prototype.destroy.call(this.source);this.bottomMarker&&(p.destroy(this.bottomMarker),delete this.bottomMarker);
this.topMarker&&(p.destroy(this.topMarker),delete this.topMarker)}),onDndCancel:e.hitch(this,function(){d.prototype.onDndCancel.call(this.source);this._hide(this.bottomMarker);this._hide(this.topMarker)})});this._source_conn=k.connect(this.source,"onDndDrop",this,"_onDndDrop");this._source_sub=k.subscribe("/dnd/drop/before",this,"_onDndDropBefore");this.source.startup()}},_hide:function(a){p.style(a,{top:"-10000px",visibility:"hidden"})},_onDndDropBefore:function(a,b,c){y.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(y.manager().target!==this.source)y.manager().source===this.source&&(this._removingColumn=!0);else{this._hide(this.bottomMarker);this._hide(this.topMarker);c=function(a){return a?p.attr(a,"idx"):null};var d=p.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);u.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=p.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=p.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=h("th",this.headerContentNode),c=f.map(b,function(b,c){var d=b.style.width;p.attr(b,"vIdx",c);if(d&&"%"==d.slice(-1))a=!0;else if(d&&"px"==d.slice(-2))return window.parseInt(d,10);return p.contentBox(b).w});return a?(f.forEach(this.grid.layout.cells,function(a,b){if(a.view==this){var d=a.view.getHeaderCellNode(a.index);if(d&&p.hasAttr(d,"vIdx")){var e=window.parseInt(p.attr(d,"vIdx"));this.setColWidth(b,c[e]);p.removeAttr(d,"vIdx")}}},this),!0):!1},adaptHeight:function(a){if(!this.grid._autoHeight){var b=
this.domNode.style.height&&parseInt(this.domNode.style.height.replace(/px/,""),10)||this.domNode.clientHeight;if(!a&&(a=this.noscroll))a:{for(var c=0;c<this.grid.views.views.length;++c)if(a=this.grid.views.views[c],a!==this&&a.hasHScrollbar()){a=!0;break a}a=!1}a&&(b-=g.getScrollbar().h);u.setStyleHeightPx(this.scrollboxNode,b)}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 n.grid._RowSelector?p.attr(b,"role","presentation"):(p.attr(b,"role","row"),"none"!=this.grid.selectionMode&&b.setAttribute("aria-selected","false"));b[u.gridViewTag]=this.id;b[u.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);u.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<=c("ff")||c("chrome"))this._nativeScroll=!0;a=this.grid.isLeftToRight();if(2>this.firstScroll){if(!a&&
1==this.firstScroll||a&&0===this.firstScroll){var b=p.marginBox(this.headerNodeContainer);c("ie")?this.headerNodeContainer.style.width=b.w+this.getScrollbarWidth()+"px":c("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 B=l("dojox.grid._GridAvatar",A,{construct:function(){var a=b.doc,c=a.createElement("table");c.cellPadding=c.cellSpacing="0";c.className="dojoxGridDndAvatar";c.style.position="absolute";c.style.zIndex=1999;c.style.margin="0px";var d=a.createElement("tbody"),e=a.createElement("tr"),
f=a.createElement("td"),g=a.createElement("td");e.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),k,l;"tr"==h.tagName.toLowerCase()?(k=a.createElement("table"),l=a.createElement("tbody"),l.appendChild(h),k.appendChild(l),h=k):"th"==h.tagName.toLowerCase()&&(k=a.createElement("table"),l=
a.createElement("tbody"),a=a.createElement("tr"),k.cellPadding=k.cellSpacing="0",a.appendChild(h),l.appendChild(a),k.appendChild(l),h=k)}h.id="";f.appendChild(h);e.appendChild(g);e.appendChild(f);p.style(e,"opacity",.9);d.appendChild(e);c.appendChild(d);this.node=c;c=y.manager();this.oldOffsetY=c.OFFSET_Y;c.OFFSET_Y=1},destroy:function(){y.manager().OFFSET_Y=this.oldOffsetY;this.inherited(arguments)}}),x=y.manager().makeAvatar;y.manager().makeAvatar=function(){return void 0===this.source.viewIndex||
p.hasClass(b.body(),"dijit_a11y")?x.call(y.manager()):new B(this)};return a})},"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(q,m,n,l,f,e,k,c,h,b,a,d){n.isAsync||c(0,function(){require(["dojo/dnd/AutoSource","dojo/dnd/Target"])});var t=m("dojo.dnd.Source",a,{isSource:!0,horizontal:!1,copyOnly:!1,selfCopy:!1,selfAccept:!0,skipForm:!1,withHandles:!1,
autoSync:!1,delay:0,accept:["text"],generateText:!0,constructor:function(a,b){l.mixin(this,l.mixin({},b));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&&f.add(this.node,"dojoDndSource");this.targetState="";this.accept&&f.add(this.node,"dojoDndTarget");this.horizontal&&f.add(this.node,"dojoDndHorizontal");this.topics=
[h.subscribe("/dnd/source/over",l.hitch(this,"onDndSourceOver")),h.subscribe("/dnd/start",l.hitch(this,"onDndStart")),h.subscribe("/dnd/drop",l.hitch(this,"onDndDrop")),h.subscribe("/dnd/cancel",l.hitch(this,"onDndCancel"))]},checkAcceptance:function(a,b){if(this==a)return!this.copyOnly||this.selfAccept;for(var c=0;c<b.length;++c){for(var d=a.getItem(b[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(a,b){if(a)return!0;2>arguments.length&&
(b=this==d.manager().target);if(b){if(this.copyOnly)return this.selfCopy}else return this.copyOnly;return!1},destroy:function(){t.superclass.destroy.call(this);q.forEach(this.topics,function(a){a.remove()});this.targetAnchor=null},onMouseMove:function(a){if(!this.isDragging||"Disabled"!=this.targetState){t.superclass.onMouseMove.call(this,a);var c=d.manager();if(!this.isDragging&&this.mouseDown&&this.isSource&&(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay)){var f=
this.getSelectedNodes();f.length&&c.startDrag(this,f,this.copyState(b.getCopyKeyState(a),!0))}this.isDragging&&(f=!1,this.current&&(this.targetBox&&this.targetAnchor==this.current||(this.targetBox=e.position(this.current,!0)),f=this.horizontal?a.pageX-this.targetBox.x<this.targetBox.w/2==e.isBodyLtr(this.current.ownerDocument):a.pageY-this.targetBox.y<this.targetBox.h/2),this.current!=this.targetAnchor||f!=this.before)&&(this._markTargetAnchor(f),c.canDrop(!this.current||c.source!=this||!(this.current.id in
this.selection)))}},onMouseDown:function(a){this.mouseDown||!this._legalMouseDown(a)||this.skipForm&&b.isFormElement(a)||(this.mouseDown=!0,this._lastX=a.pageX,this._lastY=a.pageY,t.superclass.onMouseDown.call(this,a))},onMouseUp:function(a){this.mouseDown&&(this.mouseDown=!1,t.superclass.onMouseUp.call(this,a))},onDndSourceOver:function(a){this!==a?(this.mouseDown=!1,this.targetAnchor&&this._unmarkTargetAnchor()):this.isDragging&&(a=d.manager(),a.canDrop("Disabled"!=this.targetState&&(!this.current||
a.source!=this||!(this.current.id in this.selection))))},onDndStart:function(a,b,c){this.autoSync&&this.sync();this.isSource&&this._changeState("Source",this==a?c?"Copied":"Moved":"");b=this.accept&&this.checkAcceptance(a,b);this._changeState("Target",b?"":"Disabled");this==a&&d.manager().overSource(this);this.isDragging=!0},onDndDrop:function(a,b,c,d){if(this==d)this.onDrop(a,b,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(a,b,c){if(this!=a)this.onDropExternal(a,b,c);else this.onDropInternal(b,c)},onDropExternal:function(a,c,d){var e=this._normalizedCreator;this._normalizedCreator=this.creator?function(b,c){return e.call(this,a.getItem(b.id).data,c)}:d?function(c){var d=a.getItem(c.id);c=c.cloneNode(!0);c.id=b.getUniqueId();return{node:c,data:d.data,type:d.type}}:function(b){var c=a.getItem(b.id);a.delItem(b.id);
return{node:b,data:c.data,type:c.type}};this.selectNone();d||this.creator||a.selectNone();this.insertNodes(!0,c,this.before,this.current);!d&&this.creator&&a.deleteSelectedNodes();this._normalizedCreator=e},onDropInternal:function(a,c){var d=this._normalizedCreator;if(!(this.current&&this.current.id in this.selection)){if(c)this._normalizedCreator=this.creator?function(a,b){return d.call(this,this.getItem(a.id).data,b)}:function(a){var c=this.getItem(a.id);a=a.cloneNode(!0);a.id=b.getUniqueId();return{node:a,
data:c.data,type:c.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,a,this.before,this.current);this._normalizedCreator=d}},onDraggingOver:function(){},onDraggingOut:function(){},onOverEvent:function(){t.superclass.onOverEvent.call(this);d.manager().overSource(this);if(this.isDragging&&"Disabled"!=this.targetState)this.onDraggingOver()},onOutEvent:function(){t.superclass.onOutEvent.call(this);
d.manager().outSource(this);if(this.isDragging&&"Disabled"!=this.targetState)this.onDraggingOut()},_markTargetAnchor:function(a){if(this.current!=this.targetAnchor||this.before!=a)this.targetAnchor&&this._removeItemClass(this.targetAnchor,this.before?"Before":"After"),this.targetAnchor=this.current,this.targetBox=null,this.before=a,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(a){this._changeState("Source",a?"Copied":"Moved")},_legalMouseDown:function(a){if("touchstart"!=a.type&&!k.isLeft(a))return!1;if(!this.withHandles)return!0;for(a=a.target;a&&a!==this.node;a=a.parentNode){if(f.contains(a,"dojoDndHandle"))return!0;if(f.contains(a,"dojoDndItem")||f.contains(a,"dojoDndIgnore"))break}return!1}});return t})},"dojo/dnd/common":function(){define(["../sniff","../_base/kernel",
"../_base/lang","../dom"],function(q,m,n,l){var f=n.getObject("dojo.dnd",!0);f.getCopyKeyState=function(e){return e[q("mac")?"metaKey":"ctrlKey"]};f._uniqueId=0;f.getUniqueId=function(){var e;do e=m._scopeName+"Unique"+ ++f._uniqueId;while(l.byId(e));return e};f._empty={};f.isFormElement=function(e){e=e.target;3==e.nodeType&&(e=e.parentNode);return 0<=" a button textarea input select option ".indexOf(" "+e.tagName.toLowerCase()+" ")};return f})},"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(q,m,n,l,f,e,k,c,h,b,a,d){var t=m("dojo.dnd.Selector",d,{constructor:function(a,c){c||(c={});this.singular=c.singular;this.autoSync=c.autoSync;this.selection={};this.anchor=null;this.simpleSelection=!1;this.events.push(h(this.node,b.press,l.hitch(this,"onMouseDown")),h(this.node,b.release,l.hitch(this,"onMouseUp")))},singular:!1,getSelectedNodes:function(){var b=new c,d=a._empty,e;for(e in this.selection)e in d||b.push(f.byId(e));return b},selectNone:function(){return this._removeSelection()._removeAnchor()},
selectAll:function(){this.forInItems(function(a,b){this._addItemClass(f.byId(b),"Selected");this.selection[b]=1},this);return this._removeAnchor()},deleteSelectedNodes:function(){var b=a._empty,c;for(c in this.selection)if(!(c in b)){var d=f.byId(c);this.delItem(c);e.destroy(d)}this.anchor=null;this.selection={};return this},forInSelectedItems:function(b,c){c=c||n.global;var d=this.selection,e=a._empty,f;for(f in d)f in e||b.call(c,this.getItem(f),f,this)},sync:function(){t.superclass.sync.call(this);
this.anchor&&!this.getItem(this.anchor.id)&&(this.anchor=null);var b=[],c=a._empty,d;for(d in this.selection)d in c||this.getItem(d)||b.push(d);q.forEach(b,function(a){delete this.selection[a]},this);return this},insertNodes:function(a,b,c,d){var e=this._normalizedCreator;this._normalizedCreator=function(b,c){var d=e.call(this,b,c);a?(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};t.superclass.insertNodes.call(this,b,c,d);this._normalizedCreator=e;return this},destroy:function(){t.superclass.destroy.call(this);this.selection=this.anchor=null},onMouseDown:function(b){this.autoSync&&this.sync();if(this.current)if(!this.singular&&!a.getCopyKeyState(b)&&!b.shiftKey&&this.current.id in this.selection)this.simpleSelection=
!0,k.isLeft(b)&&(b.stopPropagation(),b.preventDefault());else{if(!this.singular&&b.shiftKey){a.getCopyKeyState(b)||this._removeSelection();var c=this.getAllNodes();if(c.length&&(this.anchor||(this.anchor=c[0],this._addItemClass(this.anchor,"Anchor")),this.selection[this.anchor.id]=1,this.anchor!=this.current)){for(var d=0,e;d<c.length&&(e=c[d],e!=this.anchor&&e!=this.current);++d);for(++d;d<c.length;++d){e=c[d];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?a.getCopyKeyState(b)&&this.selectNone():(this.selectNone(),this.anchor=this.current,this._addItemClass(this.anchor,"Anchor"),this.selection[this.current.id]=1):a.getCopyKeyState(b)?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);b.stopPropagation();b.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=h(this.node,b.move,l.hitch(this,"onMouseMove"))},onOutEvent:function(){this.onmousemoveEvent&&(this.onmousemoveEvent.remove(),delete this.onmousemoveEvent)},_removeSelection:function(){var b=a._empty,c;for(c in this.selection)if(!(c in b)){var d=f.byId(c);d&&this._removeItemClass(d,"Selected")}this.selection=
{};return this},_removeAnchor:function(){this.anchor&&(this._removeItemClass(this.anchor,"Anchor"),this.anchor=null);return this}});return t})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t,v){m=m("dojo.dnd.Container",h,{skipForm:!1,allowNested:!1,constructor:function(b,c){this.node=e.byId(b);
c||(c={});this.creator=c.creator||null;this.skipForm=c.skipForm;this.parent=c.dropParent&&e.byId(c.dropParent);this.map={};this.current=null;this.containerState="";k.add(this.node,"dojoDndContainer");c&&c._skipStartup||this.startup();this.events=[a(this.node,t.over,l.hitch(this,"onMouseOver")),a(this.node,t.out,l.hitch(this,"onMouseOut")),a(this.node,"dragstart",l.hitch(this,"onSelectStart")),a(this.node,"selectstart",l.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||n.global;var c=this.map,d=v._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 d((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=v.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,c){this.parent.firstChild?b?c||(c=this.parent.firstChild):c&&(c=c.nextSibling):c=null;var d;if(c)for(b=0;b<a.length;++b)d=this._normalizedCreator(a[b]),this.setItem(d.node.id,{data:d.data,type:d.type}),c.parentNode.insertBefore(d.node,c);else for(b=0;b<a.length;++b)d=this._normalizedCreator(a[b]),this.setItem(d.node.id,{data:d.data,type:d.type}),this.parent.appendChild(d.node);
return this},destroy:function(){q.forEach(this.events,function(a){a.remove()});this.clearItems();this.node=this.parent=this.current=null},markupFactory:function(a,b,c){a._skipStartup=!0;return new c(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=v._defaultCreator(this.parent);this.sync()},onMouseOver:function(a){for(var b=a.relatedTarget;b&&
b!=this.node;)try{b=b.parentNode}catch(p){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(u){a=null}}this.current&&(this._removeItemClass(this.current,"Over"),this.current=null);this._changeState("Container","");this.onOutEvent()},onSelectStart:function(a){this.withHandles||
this.skipForm&&v.isFormElement(a)||(a.stopPropagation(),a.preventDefault())},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(a,b){var c="dojoDnd"+a,d=a.toLowerCase()+"State";k.replace(this.node,c+b,c+this[d]);this[d]=b},_addItemClass:function(a,b){k.add(a,"dojoDndItem"+b)},_removeItemClass:function(a,b){k.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)&&k.contains(a,"dojoDndItem"))return a;
return null},_normalizedCreator:function(a,b){var c=(this.creator||this.defaultCreator).call(this,a,b);l.isArray(c.type)||(c.type=["text"]);c.node.id||(c.node.id=v.getUniqueId());k.add(c.node,"dojoDndItem");return c}});v._createNode=function(a){return a?function(b){return c.create(a,{innerHTML:b})}:v._createSpan};v._createTrTd=function(a){var b=c.create("tr");c.create("td",{innerHTML:a},b);return b};v._createSpan=function(a){return c.create("span",{innerHTML:a})};v._defaultCreatorNodes={ul:"li",ol:"li",
div:"div",p:"div"};v._defaultCreator=function(a){a=a.tagName.toLowerCase();var b="tbody"==a||"thead"==a?v._createTrTd:v._createNode(v._defaultCreatorNodes[a]);return function(a,c){var d=a&&l.isObject(a),e,f;d&&a.tagName&&a.nodeType&&a.getAttribute?(e=a.getAttribute("dndData")||a.innerHTML,d=(d=a.getAttribute("dndType"))?d.split(/\s*,\s*/):["text"],f=a):(e=d&&a.data?a.data:a,d=d&&a.type?a.type:["text"],f=("avatar"==c?v._createSpan:b)(String(e)));f.id||(f.id=v.getUniqueId());return{node:f,data:e,type:d}}};
return m})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t,v){var g=m("dojo.dnd.Manager",[e],{constructor:function(){this.source=this.avatar=null;this.nodes=[];this.copy=!0;this.target=null;this.canDropFlag=!1;this.events=[]},OFFSET_X:k("touch")?4:16,OFFSET_Y:k("touch")?4:16,overSource:function(a){this.avatar&&
(this.target=a&&"Disabled"!=a.targetState?a:null,this.canDropFlag=!!this.target,this.avatar.update());b.publish("/dnd/source/over",a)},outSource:function(a){this.avatar?this.target==a&&(this.target=null,this.canDropFlag=!1,this.avatar.update(),b.publish("/dnd/source/over",null)):b.publish("/dnd/source/over",null)},startDrag:function(c,d,e){function g(a){a.preventDefault();a.stopPropagation()}t.autoScrollStart(l.doc);this.source=c;this.nodes=d;this.copy=!!e;this.avatar=this.makeAvatar();l.body().appendChild(this.avatar.node);
b.publish("/dnd/start",c,d,this.copy);this.events=[h(l.doc,a.move,n.hitch(this,"onMouseMove")),h(l.doc,a.release,n.hitch(this,"onMouseUp")),h(l.doc,"keydown",n.hitch(this,"onKeyDown")),h(l.doc,"keyup",n.hitch(this,"onKeyUp")),h(l.doc,"dragstart",g),h(l.body(),"selectstart",g)];c="dojoDnd"+(e?"Copy":"Move");f.add(l.body(),c)},canDrop:function(a){a=!(!this.target||!a);this.canDropFlag!=a&&(this.canDropFlag=a,this.avatar.update())},stopDrag:function(){f.remove(l.body(),["dojoDndCopy","dojoDndMove"]);
q.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 v(this)},updateAvatar:function(){this.avatar.update()},onMouseMove:function(a){var b=this.avatar;b&&(t.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(d.getCopyKeyState(a)),this.copy!=b&&this._setCopyStatus(b));k("touch")&&a.preventDefault()},onMouseUp:function(a){if(this.avatar){if(this.target&&
this.canDropFlag){var c=!!this.source.copyState(d.getCopyKeyState(a));b.publish("/dnd/drop/before",this.source,this.nodes,c,this.target,a);b.publish("/dnd/drop",this.source,this.nodes,c,this.target,a)}else b.publish("/dnd/cancel");this.stopDrag()}},onKeyDown:function(a){if(this.avatar)switch(a.keyCode){case c.CTRL:a=!!this.source.copyState(!0);this.copy!=a&&this._setCopyStatus(a);break;case c.ESCAPE:b.publish("/dnd/cancel"),this.stopDrag()}},onKeyUp:function(a){this.avatar&&a.keyCode==c.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();f.replace(l.body(),"dojoDnd"+(this.copy?"Copy":"Move"),"dojoDnd"+(this.copy?"Move":"Copy"))}});d._manager=null;g.manager=d.manager=function(){d._manager||(d._manager=new g);return d._manager};return g})},"dojo/dnd/autoscroll":function(){define("../_base/lang ../sniff ../_base/window ../dom-geometry ../dom-style ../window".split(" "),function(q,
m,n,l,f,e){var k={};q.setObject("dojo.dnd.autoscroll",k);k.getViewport=e.getBox;k.V_TRIGGER_AUTOSCROLL=32;k.H_TRIGGER_AUTOSCROLL=32;k.V_AUTOSCROLL_VALUE=16;k.H_AUTOSCROLL_VALUE=16;var c,h=n.doc,b=Infinity,a=Infinity;k.autoScrollStart=function(d){h=d;c=e.getBox(h);d=n.body(h).parentNode;b=Math.max(d.scrollHeight-c.h,0);a=Math.max(d.scrollWidth-c.w,0)};k.autoScroll=function(d){var f=c||e.getBox(h),l=n.body(h).parentNode,g=0,m=0;d.clientX<k.H_TRIGGER_AUTOSCROLL?g=-k.H_AUTOSCROLL_VALUE:d.clientX>f.w-
k.H_TRIGGER_AUTOSCROLL&&(g=Math.min(k.H_AUTOSCROLL_VALUE,a-l.scrollLeft));d.clientY<k.V_TRIGGER_AUTOSCROLL?m=-k.V_AUTOSCROLL_VALUE:d.clientY>f.h-k.V_TRIGGER_AUTOSCROLL&&(m=Math.min(k.V_AUTOSCROLL_VALUE,b-l.scrollTop));window.scrollBy(g,m)};k._validNodes={div:1,p:1,td:1};k._validOverflow={auto:1,scroll:1};k.autoScrollNodes=function(a){for(var b,c,d,e,h,q=0,A=0,y=a.target;y;){if(1==y.nodeType&&y.tagName.toLowerCase()in k._validNodes){d=f.getComputedStyle(y);h=d.overflowX.toLowerCase()in k._validOverflow;
e=d.overflowY.toLowerCase()in k._validOverflow;if(h||e)b=l.getContentBox(y,d),c=l.position(y,!0);if(h){d=Math.min(k.H_TRIGGER_AUTOSCROLL,b.w/2);h=a.pageX-c.x;if(m("webkit")||m("opera"))h+=n.body().scrollLeft;q=0;0<h&&h<b.w&&(h<d?q=-d:h>b.w-d&&(q=d),y.scrollLeft+=q)}if(e){e=Math.min(k.V_TRIGGER_AUTOSCROLL,b.h/2);d=a.pageY-c.y;if(m("webkit")||m("opera"))d+=n.body().scrollTop;A=0;0<d&&d<b.h&&(d<e?A=-e:d>b.h-e&&(A=e),y.scrollTop+=A)}if(q||A)return}try{y=y.parentNode}catch(B){y=null}}k.autoScroll(a)};
return k})},"dojo/dnd/Avatar":function(){define("../_base/declare ../_base/window ../dom ../dom-attr ../dom-class ../dom-construct ../hccss ../query".split(" "),function(q,m,n,l,f,e,k,c){return q("dojo.dnd.Avatar",null,{constructor:function(c){this.manager=c;this.construct()},construct:function(){var c=e.create("table",{"class":"dojoDndAvatar",style:{position:"absolute",zIndex:"1999",margin:"0px"}}),b=this.manager.source,a,d=e.create("tbody",null,c),f=e.create("tr",null,d),m=e.create("td",null,f),
g=Math.min(5,this.manager.nodes.length),n=0;k("highcontrast")&&e.create("span",{id:"a11yIcon",innerHTML:this.manager.copy?"+":"\x3c"},m);e.create("span",{innerHTML:b.generateText?this._generateText():""},m);for(l.set(f,{"class":"dojoDndAvatarHeader",style:{opacity:.9}});n<g;++n)b.creator?a=b._normalizedCreator(b.getItem(this.manager.nodes[n].id).data,"avatar").node:(a=this.manager.nodes[n].cloneNode(!0),"tr"==a.tagName.toLowerCase()&&(f=e.create("table"),e.create("tbody",null,f).appendChild(a),a=
f)),a.id="",f=e.create("tr",null,d),m=e.create("td",null,f),m.appendChild(a),l.set(f,{"class":"dojoDndAvatarItem",style:{opacity:(9-n)/10}});this.node=c},destroy:function(){e.destroy(this.node);this.node=!1},update:function(){f.toggle(this.node,"dojoDndAvatarCanDrop",this.manager.canDropFlag);if(k("highcontrast")){var e=n.byId("a11yIcon"),b="+";this.manager.canDropFlag&&!this.manager.copy?b="\x3c ":this.manager.canDropFlag||this.manager.copy?this.manager.canDropFlag||(b="x"):b="o";e.innerHTML=b}c("tr.dojoDndAvatarHeader td span"+
(k("highcontrast")?" span":""),this.node).forEach(function(a){a.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(q,m,n,l,f,e,k){var c=m.getObject("dojox.html.metrics",!0),h=m.getObject("dojox");c.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;n("ie")&&(b=e.doc.documentElement.style.fontSize||"",b||(e.doc.documentElement.style.fontSize="100%"));var c=e.doc.createElement("div"),d=c.style;d.position="absolute";d.left="-100px";d.top="0";d.width="30px";d.height="1000em";d.borderWidth="0";d.margin="0";d.padding="0";d.outline="0";d.lineHeight="1";d.overflow="hidden";e.body().appendChild(c);for(var f in a)d.fontSize=f,a[f]=
16*Math.round(12*c.offsetHeight/16)/12/1E3;n("ie")&&(e.doc.documentElement.style.fontSize=b);e.body().removeChild(c);c=null;return a};var b=null;c.getCachedFontMeasurements=function(a){if(a||!b)b=c.getFontMeasurements();return b};var a=null,d={};c.getTextBox=function(b,c,f){var g,h;if(a)g=a;else{g=a=e.doc.createElement("div");var l=e.doc.createElement("div");l.appendChild(g);h=l.style;h.overflow="scroll";h.position="absolute";h.left="0px";h.top="-10000px";h.width="1px";h.height="1px";h.visibility=
"hidden";h.borderWidth="0";h.margin="0";h.padding="0";h.outline="0";e.body().appendChild(l)}g.className="";h=g.style;h.borderWidth="0";h.margin="0";h.padding="0";h.outline="0";if(1<arguments.length&&c)for(var m in c)m in d||(h[m]=c[m]);2<arguments.length&&f&&(g.className=f);g.innerHTML=b;h=k.position(g);h.w=g.parentNode.scrollWidth;return h};var t=16,v=16;c.getScrollbar=function(){return{w:t,h:v}};c._fontResizeNode=null;c.initOnFontResize=function(a){var b=c._fontResizeNode=e.doc.createElement("iframe");
a=b.style;a.position="absolute";a.width="5em";a.height="10em";a.top="-10000px";a.display="none";n("ie")?b.onreadystatechange=function(){"complete"==b.contentWindow.document.readyState&&(b.onresize=b.contentWindow.parent[h._scopeName].html.metrics._fontresize)}:b.onload=function(){b.contentWindow.onresize=b.contentWindow.parent[h._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'");
e.body().appendChild(b);c.initOnFontResize=function(){}};c.onFontResize=function(){};c._fontresize=function(){c.onFontResize()};f.addOnUnload(function(){var a=c._fontResizeNode;a&&(n("ie")&&a.onresize?a.onresize=null:a.contentWindow&&a.contentWindow.onresize&&(a.contentWindow.onresize=null),c._fontResizeNode=null)});l(function(){try{var a=e.doc.createElement("div");a.style.cssText="top:0;left:0;width:100px;height:100px;overflow:scroll;position:absolute;visibility:hidden;";e.body().appendChild(a);
t=a.offsetWidth-a.clientWidth;v=a.offsetHeight-a.clientHeight;e.body().removeChild(a);delete a}catch(u){}"fontSizeWatch"in q.config&&q.config.fontSizeWatch&&c.initOnFontResize()});return c})},"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(q,m,n,l,f,e,k,c,h,b,a,d){var t=q.grid,v=function(a){return 0<=
a.rowIndex?a.rowIndex:m.indexOf(a.parentNode.childNodes,a)},g=function(a,b){return a&&((a.rows||0)[b]||a.childNodes[b])},u=function(a){for(;a&&"TABLE"!=a.tagName;a=a.parentNode);return a},p=function(a){var b=a.toUpperCase();return function(a){return a.tagName!=b}},r=b.rowIndexTag,A=b.gridViewTag,y=t._Builder=n.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(b){return!(!b||b==l.doc||!a.attr(b,"idx"))},getCellNodeIndex:function(b){return b?Number(a.attr(b,"idx")):-1},getCellNode:function(a,b){for(var c=0,d;(d=g(a.firstChild,c))&&d.cells;c++)for(var e=0,f;f=d.cells[e];e++)if(this.getCellNodeIndex(f)==b)return f;return null},findCellTarget:function(a,b){for(var c=a;c&&(!this.isCellNode(c)||c.offsetParent&&A in c.offsetParent.parentNode&&c.offsetParent.parentNode[A]!=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)||A in c&&c[A]!=this.view.id);)c=c.parentNode;return c!=this.domNode?c:null},findRowTarget:function(a){return this.findTarget(a,r)},isIntraNodeEvent:function(b){try{return b.cellNode&&
b.relatedTarget&&a.isDescendant(b.relatedTarget,b.cellNode)}catch(w){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(z){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""}});q=t._ContentBuilder=n.extend(function(a){y.call(this,a)},y.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,c){var d=this.getTableArray(),e,f=this.view.structure.cells,g=this.grid.getItem(c);b.fire(this.view,"onBeforeRow",[c,f]);for(var h=0,k;k=f[h];h++)if(!k.hidden&&!k.header){d.push(k.invisible?'\x3ctr class\x3d"dojoxGridInvisible"\x3e':"\x3ctr\x3e");for(var l=0,m,n,p;m=k[l];l++)n=m.markup,
e=m.customClasses=[],p=m.customStyles=[],n[5]=m.format(c,g),n[1]=e.join(" "),n[3]=p.join(";"),(e=m.textDir||this.grid.textDir)&&(n[3]+=this._getTextDirStyle(e,m,c)),d.push.apply(d,n);d.push("\x3c/tr\x3e")}d.push("\x3c/table\x3e");return d.join("")},decorateEvent:function(a){a.rowNode=this.findRowTarget(a.target);if(!a.rowNode)return!1;a.rowIndex=a.rowNode[r];this.baseDecorateEvent(a);a.cell=this.grid.getCell(a.cellIndex);return!0}});var B=t._HeaderBuilder=n.extend(function(a){this.moveable=null;y.call(this,
a)},y.prototype,{_skipBogusClicks:!1,overResizeWidth:4,minColWidth:1,update:function(){this.tableMap?this.tableMap.mapRows(this.view.structure.cells):this.tableMap=new t._TableMap(this.view.structure.cells)},generateHtml:function(a,c){var d,e=this.getTableArray(),f=this.view.structure.cells;b.fire(this.view,"onBeforeRow",[-1,f]);for(var g=0,h;h=f[g];g++)if(!h.hidden){e.push(h.invisible?'\x3ctr class\x3d"dojoxGridInvisible"\x3e':"\x3ctr\x3e");for(var k=0,l,m;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+"'"),m=this.generateCellMarkup(l,l.headerStyles,l.headerClasses,!0),m[5]=void 0!=c?c:a(l),m[3]=l.customStyles.join(";"),(d=l.textDir||this.grid.textDir)&&(m[3]+=this._getTextDirStyle(d,
l,c)),m[1]=l.customClasses.join(" "),e.push(m.join(""));e.push("\x3c/tr\x3e")}e.push("\x3c/table\x3e");return e.join("")},getCellX:function(a){var b;b=p("th");for(var c=a.target;c&&b(c);c=c.parentNode);(b=c)?(b=d.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(b){if(a.hasClass(l.body(),"dojoDndMove"))return!1;if(e("ie")){var c=b.target;if(a.hasClass(c,"dojoxGridArrowButtonNode")||a.hasClass(c,"dojoxGridArrowButtonChar")||a.hasClass(c,"dojoxGridColCaption"))return!1}return this.grid.isLeftToRight()?0<b.cellIndex&&0<b.cellX&&
b.cellX<this.overResizeWidth&&this.prepareResize(b,-1):b.cellNode&&0<b.cellX&&b.cellX<this.overResizeWidth},overRightResizeArea:function(b){if(a.hasClass(l.body(),"dojoDndMove"))return!1;if(e("ie")){var c=b.target;if(a.hasClass(c,"dojoxGridArrowButtonNode")||a.hasClass(c,"dojoxGridArrowButtonChar")||a.hasClass(c,"dojoxGridColCaption"))return!1}return this.grid.isLeftToRight()?b.cellNode&&b.cellX>=b.cellNode.offsetWidth-this.overResizeWidth:0<b.cellIndex&&b.cellX>=b.cellNode.offsetWidth-this.overResizeWidth&&
this.prepareResize(b,-1)},domousemove:function(b){if(!this.moveable){var c=this.overRightResizeArea(b)?"dojoxGridColResize":this.overLeftResizeArea(b)?"dojoxGridColResize":"";c&&!this.canResize(b)&&(c="dojoxGridColNoResize");a.toggleClass(b.sourceView.headerNode,"dojoxGridColNoResize","dojoxGridColNoResize"==c);a.toggleClass(b.sourceView.headerNode,"dojoxGridColResize","dojoxGridColResize"==c);c&&f.stop(b)}},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?(f.stop(a),!0):!1},colResizeSetup:function(b,c){var d=a.contentBox(b.sourceView.headerNode);if(c){this.lineDiv=document.createElement("div");var f=a.position(b.sourceView.headerNode,!0),g=a.contentBox(b.sourceView.domNode),k=b.pageX;!this.grid.isLeftToRight()&&8>e("ie")&&(k-=h.getScrollbar().w);a.style(this.lineDiv,{top:f.y+"px",left:k+"px",height:g.h+
d.h+"px"});a.addClass(this.lineDiv,"dojoxGridResizeColLine");this.lineDiv._origLeft=k;l.body().appendChild(this.lineDiv)}for(var f=[],g=this.tableMap.findOverlappingNodes(b.cellNode),k=0,m;m=g[k];k++)f.push({node:m,index:this.getCellNodeIndex(m),width:m.offsetWidth});g=b.sourceView;m=this.grid.isLeftToRight()?1:-1;for(var n=b.grid.views.views,k=[],p=g.idx+m,q;q=n[p];p+=m)k.push({node:q.headerNode,left:window.parseInt(q.headerNode.style.left)});m=g.headerContentNode.firstChild;return{scrollLeft:b.sourceView.headerNode.scrollLeft,
view:g,node:b.cellNode,index:b.cellIndex,w:a.contentBox(b.cellNode).w,vw:d.w,table:m,tw:a.contentBox(m).w,spanners:f,followers:k}},beginColumnResize:function(b){this.moverDiv=document.createElement("div");a.style(this.moverDiv,{position:"absolute",left:0});l.body().appendChild(this.moverDiv);a.addClass(this.grid.domNode,"dojoxGridColumnResizing");var d=this.moveable=new c(this.moverDiv),e=this.colResizeSetup(b,!0);d.onMove=n.hitch(this,"doResizeColumn",e);k.connect(d,"onMoveStop",n.hitch(this,function(){this.endResizeColumn(e);
e.node.releaseCapture&&e.node.releaseCapture();this.moveable.destroy();delete this.moveable;this.moveable=null;a.removeClass(this.grid.domNode,"dojoxGridColumnResizing")}));b.cellNode.setCapture&&b.cellNode.setCapture();d.onMouseDown(b)},doResizeColumn:function(b,c,d){var e=d.l,e={deltaX:e,w:b.w+(this.grid.isLeftToRight()?e:-e),vw:b.vw+e,tw:b.tw+e};this.dragRecord={inDrag:b,mover:c,leftTop:d};e.w>=this.minColWidth&&(c?a.style(this.lineDiv,"left",this.lineDiv._origLeft+e.deltaX+"px"):this.doResizeNow(b,
e))},endResizeColumn:function(b){if(this.dragRecord){var c=this.dragRecord.leftTop,c=this.grid.isLeftToRight()?c.l:-c.l,c=c+(Math.max(b.w+c,this.minColWidth)-(b.w+c));e("webkit")&&b.spanners.length&&(c+=a._getPadBorderExtents(b.spanners[0].node).w);this.doResizeNow(b,{deltaX:c,w:b.w+c,vw:b.vw+c,tw:b.tw+c});delete this.dragRecord}a.destroy(this.lineDiv);a.destroy(this.moverDiv);a.destroy(this.moverDiv);delete this.moverDiv;this._skipBogusClicks=!0;b.view.update();this._skipBogusClicks=!1;this.grid.onResizeColumn(b.index)},
doResizeNow:function(a,b){a.view.convertColPctToFixed();if(a.view.flexCells&&!a.view.testFlexCells()){var c=u(a.node);c&&(c.style.width="")}for(var d,f,c=0;d=a.spanners[c];c++)f=d.width+b.deltaX,0<f&&(d.node.style.width=f+"px",a.view.setColWidth(d.index,f));if(this.grid.isLeftToRight()||!e("ie"))for(c=0;d=a.followers[c];c++)f=d.left+b.deltaX,d.node.style.left=f+"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)}});t._TableMap=n.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(u(a),v(a.parentNode),0<=a.cellIndex?a.cellIndex:m.indexOf(a.parentNode.cells,a))}});
return{_Builder:y,_HeaderBuilder:B,_ContentBuilder:q}})},"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(q,m,n,l,f,e,k,c,h,b,a,d,t){function v(a,b){"touchAction"in document.body.style?g="touchAction":"msTouchAction"in document.body.style&&(g="msTouchAction");u=function(a,b){a.style[g]=b};u(a,b)}var g,u=function(){};k("touch-action")&&(u=v);return m("dojo.dnd.Moveable",
[e],{handle:"",delay:0,skip:!1,constructor:function(a,e){this.node=l.byId(a);u(this.node,"none");e||(e={});this.handle=e.handle?l.byId(e.handle):null;this.handle||(this.handle=this.node);this.delay=0<e.delay?e.delay:0;this.skip=e.skip;this.mover=e.mover?e.mover:d;this.events=[c(this.handle,b.press,n.hitch(this,"onMouseDown")),c(this.handle,"dragstart",n.hitch(this,"onSelectStart")),c(this.handle,"selectstart",n.hitch(this,"onSelectStart"))]},markupFactory:function(a,b,c){return new c(b,a)},destroy:function(){q.forEach(this.events,
function(a){a.remove()});u(this.node,"");this.events=this.node=this.handle=null},onMouseDown:function(d){if(!this.skip||!a.isFormElement(d)){if(this.delay)this.events.push(c(this.handle,b.move,n.hitch(this,"onMouseMove")),c(this.handle.ownerDocument,b.release,n.hitch(this,"onMouseUp"))),this._lastX=d.pageX,this._lastY=d.pageY;else this.onDragDetected(d);d.stopPropagation();d.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(b){this.skip&&a.isFormElement(b)||(b.stopPropagation(),b.preventDefault())},onDragDetected:function(a){new this.mover(this.node,a,this)},onMoveStart:function(a){h.publish("/dnd/move/start",a);f.add(t.body(),"dojoMove");f.add(this.node,"dojoMoveItem")},onMoveStop:function(a){h.publish("/dnd/move/stop",a);f.remove(t.body(),
"dojoMove");f.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(q,m,n,l,f,e,k,c,h,b,a,d,t){return m("dojo.dnd.Mover",[h],{constructor:function(c,
d,f){function g(a){a.preventDefault();a.stopPropagation()}this.node=e.byId(c);this.marginBox={l:d.pageX,t:d.pageY};this.mouseButton=d.button;d=this.host=f;c=c.ownerDocument;this.events=[b(c,a.move,n.hitch(this,"onFirstMove")),b(c,a.move,n.hitch(this,"onMouseMove")),b(c,a.release,n.hitch(this,"onMouseUp")),b(c,"dragstart",g),b(c.body,"selectstart",g)];t.autoScrollStart(c);if(d&&d.onMoveStart)d.onMoveStart(this)},onMouseMove:function(a){t.autoScroll(a);var b=this.marginBox;this.host.onMove(this,{l:b.l+
a.pageX,t:b.t+a.pageY},a);a.preventDefault();a.stopPropagation()},onMouseUp:function(a){(l("webkit")&&l("mac")&&2==this.mouseButton?0==a.button:this.mouseButton==a.button)&&this.destroy();a.preventDefault();a.stopPropagation()},onFirstMove:function(a){var b=this.node.style,d,e=this.host;switch(b.position){case "relative":case "absolute":d=Math.round(parseFloat(b.left))||0;b=Math.round(parseFloat(b.top))||0;break;default:b.position="absolute";b=k.getMarginBox(this.node);d=f.doc.body;var h=c.getComputedStyle(d),
l=k.getMarginBox(d,h),h=k.getContentBox(d,h);d=b.l-(h.l-l.l);b=b.t-(h.t-l.t)}this.marginBox.l=d-this.marginBox.l;this.marginBox.t=b-this.marginBox.t;if(e&&e.onFirstMove)e.onFirstMove(this,a);this.events.shift().remove()},destroy:function(){q.forEach(this.events,function(a){a.remove()});var a=this.host;if(a&&a.onMoveStop)a.onMoveStop(this);this.events=this.node=this.host=null}})})},"dojox/grid/_ViewManager":function(){define(["dojo/_base/declare","dojo/_base/sniff","dojo/dom-class"],function(q,m,n){return q("dojox.grid._ViewManager",
null,{constructor:function(l){this.grid=l},defaultWidth:200,views:[],resize:function(){this.onEach("resize")},render:function(){this.onEach("render")},addView:function(l){l.idx=this.views.length;this.views.push(l)},destroyViews:function(){for(var l=0,f;f=this.views[l];l++)f.destroy();this.views=[]},getContentNodes:function(){for(var l=[],f=0,e;e=this.views[f];f++)l.push(e.contentNode);return l},forEach:function(l){for(var f=0,e;e=this.views[f];f++)l(e,f)},onEach:function(l,f){f=f||[];for(var e=0,
k;k=this.views[e];e++)l in k&&k[l].apply(k,f)},normalizeHeaderNodeHeight:function(){for(var l=[],f=0,e;e=this.views[f];f++)e.headerContentNode.firstChild&&l.push(e.headerContentNode);this.normalizeRowNodeHeights(l)},normalizeRowNodeHeights:function(l){var f=0,e=[];if(this.grid.rowHeight)f=this.grid.rowHeight;else{if(1>=l.length)return;for(var k=0,c;c=l[k];k++)n.contains(c,"dojoxGridNonNormalizedCell")||(e[k]=c.firstChild.offsetHeight,f=Math.max(f,e[k]));f=0<=f?f:0;(m("mozilla")||8<m("ie"))&&f&&f++}for(k=
0;c=l[k];k++)e[k]!=f&&(c.firstChild.style.height=f+"px")},resetHeaderNodeHeight:function(){for(var l=0,f;f=this.views[l];l++)if(f=f.headerContentNode.firstChild)f.style.height=""},renormalizeRow:function(l){for(var f=[],e=0,k,c;(k=this.views[e])&&(c=k.getRowNode(l));e++)c.firstChild.style.height="",f.push(c);this.normalizeRowNodeHeights(f)},getViewWidth:function(l){return this.views[l].getWidth()||this.defaultWidth},measureHeader:function(){this.resetHeaderNodeHeight();this.forEach(function(f){f.headerContentNode.style.height=
""});var l=0;this.forEach(function(f){l=Math.max(f.headerNode.offsetHeight,l)});return l},measureContent:function(){var l=0;this.forEach(function(f){l=Math.max(f.domNode.offsetHeight,l)});return l},findClient:function(l){l=this.grid.elasticView||-1;if(0>l)for(var f=1,e;e=this.views[f];f++)if(e.viewWidth){for(f=1;e=this.views[f];f++)if(!e.viewWidth){l=f;break}break}0>l&&(l=Math.floor(this.views.length/2));return l},arrange:function(l,f){var e,k,c,h=this.views.length,b=this,a=0>=f?h:this.findClient(),
d=function(a,c){var d=a.domNode.style,e=a.headerNode.style;b.grid.isLeftToRight()?(d.left=c+"px",e.left=c+"px"):(d.right=c+"px",4>m("ff")?e.right=c+a.getScrollbarWidth()+"px":e.right=c+"px",m("webkit")||"auto"==e.width||(e.width=parseInt(e.width,10)-a.getScrollbarWidth()+"px"));d.top="0px";e.top=0};for(e=0;(k=this.views[e])&&e<a;e++)c=this.getViewWidth(e),k.setSize(c,0),d(k,l),c=k.headerContentNode&&k.headerContentNode.firstChild?k.getColumnsWidth()+k.getScrollbarWidth():k.domNode.offsetWidth,l+=
c;e++;for(var n=f,q=h-1;(k=this.views[q])&&e<=q;q--)c=this.getViewWidth(q),k.setSize(c,0),c=k.domNode.offsetWidth,n-=c,d(k,n);a<h&&(k=this.views[a],c=Math.max(1,n-l),k.setSize(c+"px",0),d(k,l));return l},renderRow:function(l,f,e){for(var k=[],c=0,h,b;(h=this.views[c])&&(b=f[c]);c++)h=h.renderRow(l),b.appendChild(h),k.push(h);e||this.normalizeRowNodeHeights(k)},rowRemoved:function(l){this.onEach("rowRemoved",[l])},updateRow:function(l,f){for(var e=0,k;k=this.views[e];e++)k.updateRow(l);f||this.renormalizeRow(l)},
updateRowStyles:function(l){this.onEach("updateRowStyles",[l])},setScrollTop:function(l){for(var f=l,e=0,k;k=this.views[e];e++)f=k.setScrollTop(l),m("ie")&&k.headerNode&&k.scrollboxNode&&(k.headerNode.scrollLeft=k.scrollboxNode.scrollLeft);return f},getFirstScrollingView:function(){for(var l=0,f;f=this.views[l];l++)if(f.hasHScrollbar()||f.hasVScrollbar())return f;return null}})})},"dojox/grid/_RowManager":function(){define(["dojo/_base/declare","dojo/_base/lang","dojo/dom-class"],function(q,m,n){return q("dojox.grid._RowManager",
null,{constructor:function(l){this.grid=l},linesToEms:2,overRow:-2,prepareStylingRow:function(l,f){return{index:l,node:f,odd:!!(l&1),selected:!!this.grid.selection.isSelected(l),over:this.isOver(l),customStyles:"",customClasses:"dojoxGridRow"}},styleRowNode:function(l,f){var e=this.prepareStylingRow(l,f);this.grid.onStyleRow(e);this.applyStyles(e)},applyStyles:function(l){l.node.className=l.customClasses;var f=l.node.style.height,e=l.node,k=l.customStyles+";"+(l.node._style||"");void 0==e.style.cssText?
e.setAttribute("style",k):e.style.cssText=k;l.node.style.height=f},updateStyles:function(l){this.grid.updateRowStyles(l)},setOverRow:function(l){var f=this.overRow;this.overRow=l;f!=this.overRow&&(m.isString(f)||0<=f)&&this.updateStyles(f);this.updateStyles(this.overRow)},isOver:function(l){return this.overRow==l&&!n.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(q,m,n,l,f,e,k,c,h){return n("dojox.grid._FocusManager",null,{constructor:function(b){this.grid=b;this.cell=null;this.rowIndex=-1;this._connects=[];this._headerConnects=[];this.headerMenu=this.grid.headerMenu;this._connects.push(l.connect(this.grid.domNode,"onfocus",this,"doFocus"));this._connects.push(l.connect(this.grid.domNode,"onblur",this,"doBlur"));this._connects.push(l.connect(this.grid.domNode,"mousedown",this,"_mouseDown"));this._connects.push(l.connect(this.grid.domNode,"mouseup",
this,"_mouseUp"));this._connects.push(l.connect(this.grid.domNode,"oncontextmenu",this,"doContextMenu"));this._connects.push(l.connect(this.grid.lastFocusNode,"onfocus",this,"doLastNodeFocus"));this._connects.push(l.connect(this.grid.lastFocusNode,"onblur",this,"doLastNodeBlur"));this._connects.push(l.connect(this.grid,"_onFetchComplete",this,"_delayedCellFocus"));this._connects.push(l.connect(this.grid,"postrender",this,"_delayedHeaderFocus"))},destroy:function(){q.forEach(this._connects,l.disconnect);
q.forEach(this._headerConnects,l.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(b,a){return this.cell==b&&this.rowIndex==a},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?q.indexOf(this._findHeaderCells(),this._colHeadNode):-1},_focusifyCellNode:function(b){var a=this.cell&&this.cell.getNode(this.rowIndex);if(a&&(h.toggleClass(a,this.focusClass,b),b)){b=this.scrollIntoView();
try{if(e("webkit")||!this.grid.edit.isEditing())c.fire(a,"focus"),b&&(this.cell.view.scrollboxNode.scrollLeft=b)}catch(d){}}},_delayedCellFocus:function(){if(!this.isNavHeader()&&this.grid.focused){var b=this.cell&&this.cell.getNode(this.rowIndex);if(b)try{this.grid.edit.isEditing()||(h.toggleClass(b,this.focusClass,!0),this._colHeadNode&&this.blurHeader(),c.fire(b,"focus"))}catch(a){}}},_delayedHeaderFocus:function(){this.isNavHeader()&&this.focusHeader()},_initColumnHeaders:function(){q.forEach(this._headerConnects,
l.disconnect);this._headerConnects=[];for(var b=this._findHeaderCells(),a=0;a<b.length;a++)this._headerConnects.push(l.connect(b[a],"onfocus",this,"doColHeaderFocus")),this._headerConnects.push(l.connect(b[a],"onblur",this,"doColHeaderBlur"))},_findHeaderCells:function(){for(var b=k("th",this.grid.viewsHeaderNode),a=[],c=0;c<b.length;c++){var e=b[c],f=h.hasAttr(e,"tabIndex"),g=h.attr(e,"tabIndex");f&&0>g&&a.push(e)}return a},_setActiveColHeader:function(b,a,c){this.grid.domNode.setAttribute("aria-activedescendant",
b.id);null!=c&&0<=c&&c!=a&&h.toggleClass(this._findHeaderCells()[c],this.focusClass,!1);h.toggleClass(b,this.focusClass,!0);this._colHeadNode=b;this._colHeadFocusIdx=a;this._scrollHeader(this._colHeadFocusIdx)},scrollIntoView:function(){var b=this.cell?this._scrollInfo(this.cell):null;if(!b||!b.s)return null;var a=this.grid.scroller.findScrollTop(this.rowIndex);b.n&&b.sr&&(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));b.r&&b.sr&&(a+b.r.offsetHeight>b.sr.t+b.sr.h?this.grid.setScrollTop(a+b.r.offsetHeight-b.sr.h):a<b.sr.t&&this.grid.setScrollTop(a));return b.s.scrollLeft},_scrollInfo:function(b,a){if(b){var c=b.view.scrollboxNode,e={w:c.clientWidth,l:c.scrollLeft,t:c.scrollTop,h:c.clientHeight},f=b.view.getRowNode(this.rowIndex);return{c:b,s:c,sr:e,n:a?a:b.getNode(this.rowIndex),r:f}}return null},_scrollHeader:function(b){var a=null;if(this._colHeadNode){var c=this.grid.getCell(b);if(!c)return;a=
this._scrollInfo(c,c.getNode(0))}a&&a.s&&a.sr&&a.n&&(a.n.offsetLeft+a.n.offsetWidth>a.sr.l+a.sr.w?a.s.scrollLeft=a.n.offsetLeft+a.n.offsetWidth-a.sr.w:a.n.offsetLeft<a.sr.l?a.s.scrollLeft=a.n.offsetLeft:7>=e("ie")&&c&&c.view.headerNode&&(c.view.headerNode.scrollLeft=a.s.scrollLeft))},_isHeaderHidden:function(){var b=this.focusView;if(!b)for(var a=0,c;c=this.grid.views.views[a];a++)if(c.headerNode){b=c;break}return b&&"none"==h.getComputedStyle(b.headerNode).display},colSizeAdjust:function(b,a,c){var d=
this._findHeaderCells(),e=this.focusView;if(!e||!e.header.tableMap.map)for(var f=0,h;h=this.grid.views.views[f];f++)if(h.header.tableMap.map){e=h;break}f=d[a];!e||a==d.length-1&&0===a||(e.content.baseDecorateEvent(b),b.cellNode=f,b.cellIndex=e.content.getCellNodeIndex(b.cellNode),b.cell=0<=b.cellIndex?this.grid.getCell(b.cellIndex):null,e.header.canResize(b)&&(a={l:c},b=e.header.colResizeSetup(b,!1),e.header.doResizeColumn(b,null,a),e.update()))},styleRow:function(b){},setFocusIndex:function(b,a){this.setFocusCell(this.grid.getCell(a),
b)},setFocusCell:function(b,a){b&&!this.isFocusCell(b,a)&&(this.tabbingOut=!1,this._colHeadNode&&this.blurHeader(),this._colHeadNode=this._colHeadFocusIdx=null,this.focusGridView(),this._focusifyCellNode(!1),this.cell=b,this.rowIndex=a,this._focusifyCellNode(!0));if(e("opera"))setTimeout(m.hitch(this.grid,"onCellFocus",this.cell,this.rowIndex),1);else this.grid.onCellFocus(this.cell,this.rowIndex)},next:function(){if(this.cell){var b=this.rowIndex,a=this.cell.index+1,c=this.grid.layout.cellCount-
1,e=this.grid.rowCount-1;a>c&&(a=0,b++);b>e&&(a=c,b=e);if(this.grid.edit.isEditing()&&(c=this.grid.getCell(a),!this.isLastFocusCell()&&(!c.editable||this.grid.canEdit&&!this.grid.canEdit(c,b)))){this.cell=c;this.rowIndex=b;this.next();return}this.setFocusIndex(b,a)}},previous:function(){if(this.cell){var b=this.rowIndex||0,a=(this.cell.index||0)-1;0>a&&(a=this.grid.layout.cellCount-1,b--);0>b&&(a=b=0);if(this.grid.edit.isEditing()){var c=this.grid.getCell(a);if(!this.isFirstFocusCell()&&!c.editable){this.cell=
c;this.rowIndex=b;this.previous();return}}this.setFocusIndex(b,a)}},move:function(b,a){var c=0>a?-1:1;if(this.isNavHeader()){var e=this._findHeaderCells(),f=currentIdx=q.indexOf(e,this._colHeadNode);for(currentIdx+=a;0<=currentIdx&&currentIdx<e.length&&"none"==e[currentIdx].style.display;)currentIdx+=c;0<=currentIdx&&currentIdx<e.length&&this._setActiveColHeader(e[currentIdx],currentIdx,f)}else if(this.cell){var g=this.grid.scroller,e=this.rowIndex,f=this.grid.rowCount-1,k=Math.min(f,Math.max(0,e+
b));b&&(0<b?k>g.getLastPageRow(g.page)&&this.grid.setScrollTop(this.grid.scrollTop+g.findScrollTop(k)-g.findScrollTop(e)):0>b&&k<=g.getPageRow(g.page)&&this.grid.setScrollTop(this.grid.scrollTop-g.findScrollTop(e)-g.findScrollTop(k)));for(var g=this.grid.layout.cellCount-1,l=this.cell.index,m=Math.min(g,Math.max(0,l+a)),n=this.grid.getCell(m);0<=m&&m<g&&n&&!0===n.hidden;)m+=c,n=this.grid.getCell(m);n&&!0!==n.hidden||(m=l);c=n.getNode(k);!c&&b?0<=k+b&&k+b<=f&&this.move(0<b?++b:--b,a):c&&"none"!==h.style(c,
"display")||!a?(this.setFocusIndex(k,m),b&&this.grid.updateRow(e)):0<=m+a&&m+a<=g&&this.move(b,0<a?++a:--a)}},previousKey:function(b){this.grid.edit.isEditing()?(f.stop(b),this.previous()):this.isNavHeader()||this._isHeaderHidden()?(this.tabOut(this.grid.domNode),null!=this._colHeadFocusIdx&&(h.toggleClass(this._findHeaderCells()[this._colHeadFocusIdx],this.focusClass,!1),this._colHeadFocusIdx=null),this._focusifyCellNode(!1)):(this.grid.domNode.focus(),f.stop(b))},nextKey:function(b){b.target===
this.grid.domNode&&null==this._colHeadFocusIdx?(this.focusHeader(),f.stop(b)):this.isNavHeader()?(this.blurHeader(),this.findAndFocusGridCell()||this.tabOut(this.grid.lastFocusNode),this._colHeadNode=this._colHeadFocusIdx=null):this.grid.edit.isEditing()?(f.stop(b),this.next()):this.tabOut(this.grid.lastFocusNode)},tabOut:function(b){this.tabbingOut=!0;b.focus()},focusGridView:function(){c.fire(this.focusView,"focus")},focusGrid:function(b){this.focusGridView();this._focusifyCellNode(!0)},findAndFocusGridCell:function(){var b=
!0,a=0===this.grid.rowCount;this.isNoFocusCell()&&!a?(a=0,this.grid.getCell(a).hidden&&(a=this.isNavHeader()?this._colHeadFocusIdx:0),this.setFocusIndex(0,a)):this.cell&&!a?(this.focusView&&!this.focusView.rowNodes[this.rowIndex]&&this.grid.scrollToRow(this.rowIndex),this.focusGrid()):b=!1;this._colHeadNode=this._colHeadFocusIdx=null;return b},focusHeader:function(){var b=this._findHeaderCells(),a=this._colHeadFocusIdx;this._isHeaderHidden()?this.findAndFocusGridCell():this._colHeadFocusIdx||(this.isNoFocusCell()?
this._colHeadFocusIdx=0:this._colHeadFocusIdx=this.cell.index);for(this._colHeadNode=b[this._colHeadFocusIdx];this._colHeadNode&&0<=this._colHeadFocusIdx&&this._colHeadFocusIdx<b.length&&"none"==this._colHeadNode.style.display;)this._colHeadFocusIdx++,this._colHeadNode=b[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,a),this._scrollHeader(this._colHeadFocusIdx),this._focusifyCellNode(!1)):this.findAndFocusGridCell()},blurHeader:function(){h.removeClass(this._colHeadNode,this.focusClass);h.removeAttr(this.grid.domNode,"aria-activedescendant");if(this.headerMenu&&this._contextMenuBindNode==this.grid.domNode){var b=this.grid.viewsHeaderNode;this.headerMenu.unBindDomNode(this.grid.domNode);this.headerMenu.bindDomNode(b);
this._contextMenuBindNode=b}},doFocus:function(b){b&&b.target!=b.currentTarget?f.stop(b):this._clickFocus||(this.tabbingOut||this.focusHeader(),this.tabbingOut=!1,f.stop(b))},doBlur:function(b){f.stop(b)},doContextMenu:function(b){this.headerMenu||f.stop(b)},doLastNodeFocus:function(b){this.tabbingOut?this._focusifyCellNode(!1):0<this.grid.rowCount?(this.isNoFocusCell()&&this.setFocusIndex(0,0),this._focusifyCellNode(!0)):this.focusHeader();this.tabbingOut=!1;f.stop(b)},doLastNodeBlur:function(b){f.stop(b)},
doColHeaderFocus:function(b){this._setActiveColHeader(b.target,h.attr(b.target,"idx"),this._colHeadFocusIdx);this._scrollHeader(this.getHeaderIndex());f.stop(b)},doColHeaderBlur:function(b){h.toggleClass(b.target,this.focusClass,!1)},_mouseDown:function(b){this._clickFocus=dojo.some(this.grid.views.views,function(a){return a.scrollboxNode===b.target})},_mouseUp:function(b){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(q,m,n,l,f,e){return n("dojox.grid._EditManager",null,{constructor:function(e){this.grid=e;this.connections=f("ie")?[l.connect(document.body,"onfocus",q.hitch(this,"_boomerangFocus"))]:[];this.connections.push(l.connect(this.grid,"onBlur",this,"apply"));this.connections.push(l.connect(this.grid,"prerender",this,"_onPreRender"))},info:{},destroy:function(){m.forEach(this.connections,l.disconnect)},cellFocus:function(e,c){this.grid.singleClickEdit||this.isEditRow(c)?this.setEditCell(e,c):this.apply();
(this.isEditing()||e&&e.editable&&e.alwaysEditing)&&this._focusEditor(e,c)},rowClick:function(e){this.isEditing()&&!this.isEditRow(e.rowIndex)&&this.apply()},styleRow:function(e){e.index==this.info.rowIndex&&(e.customClasses+=" dojoxGridRowEditing")},dispatchEvent:function(e){var c=e.cell;return(c=c&&c.editable?c:0)&&c.dispatchEvent(e.dispatch,e)},isEditing:function(){return void 0!==this.info.rowIndex},isEditCell:function(e,c){return this.info.rowIndex===e&&this.info.cell.index==c},isEditRow:function(e){return this.info.rowIndex===
e},setEditCell:function(e,c){!this.isEditCell(c,e.index)&&this.grid.canEdit&&this.grid.canEdit(e,c)&&this.start(e,c,this.isEditRow(c)||e.editable)},_focusEditor:function(f,c){e.fire(f,"focus",[c])},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(){f("ie")&&(this._catchBoomerang=(new Date).getTime()+this._boomerangWindow)},start:function(e,c,f){this._isValidInput()&&(this.grid.beginUpdate(),this.editorApply(),this.isEditing()&&!this.isEditRow(c)&&(this.applyRowEdit(),this.grid.updateRow(c)),f?(this.info={cell:e,rowIndex:c},this.grid.doStartEdit(e,c),this.grid.updateRow(c)):this.info={},this.grid.endUpdate(),this.grid.focus.focusGrid(),this._focusEditor(e,c),this._doCatchBoomerang())},_editorDo:function(e){var c=
this.info.cell;if(c&&c.editable)c[e](this.info.rowIndex)},editorApply:function(){this._editorDo("apply")},editorCancel:function(){this._editorDo("cancel")},applyCellEdit:function(e,c,f){this.grid.canEdit(c,f)&&this.grid.doApplyCellEdit(e,f,c.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(e,c){var f=this.info.cell;!this.isEditRow(e)||c&&f.view!=c||!f.editable||f.save(f,this.info.rowIndex)},restore:function(e,c){var f=this.info.cell;this.isEditRow(c)&&f.view==e&&f.editable&&f.restore(this.info.rowIndex)},_isValidInput:function(){var e=(this.info.cell||{}).widget;if(!e||!e.isValid)return!0;
e.focused=!0;return e.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(q,m,n,l){return q("dojox.grid.Selection",null,{constructor:function(f){this.grid=f;this.selected=[];this.setMode(f.selectionMode)},mode:"extended",selected:null,updating:0,selectedIndex:-1,rangeStartIndex:-1,setMode:function(f){this.selected.length&&
this.deselectAll();this.mode="extended"!=f&&"multiple"!=f&&"single"!=f&&"none"!=f?"extended":f},onCanSelect:function(f){return this.grid.onCanSelect(f)},onCanDeselect:function(f){return this.grid.onCanDeselect(f)},onSelected:function(f){},onDeselected:function(f){},onChanging:function(){},onChanged:function(){},isSelected:function(f){return"none"==this.mode?!1:this.selected[f]},getFirstSelected:function(){if(!this.selected.length||"none"==this.mode)return-1;for(var f=0,e=this.selected.length;f<e;f++)if(this.selected[f])return f;
return-1},getNextSelected:function(f){if("none"==this.mode)return-1;f+=1;for(var e=this.selected.length;f<e;f++)if(this.selected[f])return f;return-1},getSelected:function(){for(var f=[],e=0,k=this.selected.length;e<k;e++)this.selected[e]&&f.push(e);return f},getSelectedCount:function(){for(var f=0,e=0;e<this.selected.length;e++)this.selected[e]&&f++;return f},_beginUpdate:function(){if(0===this.updating)this.onChanging();this.updating++},_endUpdate:function(){this.updating--;if(0===this.updating)this.onChanged()},
select:function(f){"none"!=this.mode&&("multiple"!=this.mode?(this.deselectAll(f),this.addToSelection(f)):this.toggleSelect(f))},addToSelection:function(f){if("none"!=this.mode)if(n.isArray(f))m.forEach(f,this.addToSelection,this);else if(f=Number(f),this.selected[f])this.selectedIndex=f;else if(!1!==this.onCanSelect(f)){this.selectedIndex=f;var e=this.grid.getRowNode(f);e&&l.set(e,"aria-selected","true");this._beginUpdate();this.selected[f]=!0;this.onSelected(f);this._endUpdate()}},deselect:function(f){if("none"!=
this.mode)if(n.isArray(f))m.forEach(f,this.deselect,this);else if(f=Number(f),this.selectedIndex==f&&(this.selectedIndex=-1),this.selected[f]&&!1!==this.onCanDeselect(f)){var e=this.grid.getRowNode(f);e&&l.set(e,"aria-selected","false");this._beginUpdate();delete this.selected[f];this.onDeselected(f);this._endUpdate()}},setSelected:function(f,e){this[e?"addToSelection":"deselect"](f)},toggleSelect:function(f){n.isArray(f)?m.forEach(f,this.toggleSelect,this):this.setSelected(f,!this.selected[f])},
_range:function(f,e,k){var c=0<=f?f:e;f=e;c>f&&(f=c,c=e);for(e=c;e<=f;e++)k(e)},selectRange:function(f,e){this._range(f,e,n.hitch(this,"addToSelection"))},deselectRange:function(f,e){this._range(f,e,n.hitch(this,"deselect"))},insert:function(f){this.selected.splice(f,0,!1);this.selectedIndex>=f&&this.selectedIndex++},remove:function(f){this.selected.splice(f,1);this.selectedIndex>=f&&this.selectedIndex--},deselectAll:function(f){for(var e in this.selected)e!=f&&!0===this.selected[e]&&this.deselect(e)},
clickSelect:function(f,e,k){if("none"!=this.mode){this._beginUpdate();if("extended"!=this.mode)this.select(f);else{if(!k||0>this.rangeStartIndex)this.rangeStartIndex=f;e||this.deselectAll(f);k?this.selectRange(this.rangeStartIndex,f):e?this.toggleSelect(f):this.addToSelection(f)}this._endUpdate()}},clickSelectEvent:function(f){this.clickSelect(f.rowIndex,dojo.isCopyKey(f),f.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(q,m,n,l){return q("dijit.CheckedMenuItem",n,{baseClass:"dijitMenuItem dijitCheckedMenuItem",templateString:l,checked:!1,_setCheckedAttr:function(f){this.domNode.setAttribute("aria-checked",f?"true":"false");this._set("checked",f)},iconClass:"",role:"menuitemcheckbox",checkedChar:"\x26#10003;",onChange:function(){},_onClick:function(f){this.disabled||(this.set("checked",!this.checked),this.onChange(this.checked));
this.onClick(f)}})})},"dojox/grid/DataSelection":function(){define(["dojo/_base/declare","./_SelectionPreserver","./Selection"],function(q,m,n){return q("dojox.grid.DataSelection",n,{constructor:function(l){l.keepSelection&&(this.preserver=new m(this))},destroy:function(){this.preserver&&this.preserver.destroy()},getFirstSelected:function(){var l=n.prototype.getFirstSelected.call(this);return-1==l?null:this.grid.getItem(l)},getNextSelected:function(l){l=this.grid.getItemIndex(l);l=n.prototype.getNextSelected.call(this,
l);return-1==l?null:this.grid.getItem(l)},getSelected:function(){for(var l=[],f=0,e=this.selected.length;f<e;f++)this.selected[f]&&l.push(this.grid.getItem(f));return l},addToSelection:function(l){if("none"!=this.mode){var f=null,f="number"==typeof l||"string"==typeof l?l:this.grid.getItemIndex(l);n.prototype.addToSelection.call(this,f)}},deselect:function(l){if("none"!=this.mode){var f=null,f="number"==typeof l||"string"==typeof l?l:this.grid.getItemIndex(l);n.prototype.deselect.call(this,f)}},deselectAll:function(l){var f=
null;l||"number"==typeof l?(f="number"==typeof l||"string"==typeof l?l:this.grid.getItemIndex(l),n.prototype.deselectAll.call(this,f)):this.inherited(arguments)}})})},"dojox/grid/_SelectionPreserver":function(){define(["dojo/_base/declare","dojo/_base/connect","dojo/_base/lang","dojo/_base/array"],function(q,m,n,l){return q("dojox.grid._SelectionPreserver",null,{constructor:function(f){this.selection=f;var e=this.grid=f.grid;this.reset();this._connects=[m.connect(e,"_setStore",this,"reset"),m.connect(e,
"_addItem",this,"_reSelectById"),m.connect(f,"onSelected",n.hitch(this,"_selectById",!0)),m.connect(f,"onDeselected",n.hitch(this,"_selectById",!1)),m.connect(f,"deselectAll",this,"reset")]},destroy:function(){this.reset();l.forEach(this._connects,m.disconnect);delete this._connects},reset:function(){this._selectedById={}},_reSelectById:function(f,e){f&&this.grid._hasIdentity&&(this.selection.selected[e]=this._selectedById[this.grid.store.getIdentity(f)])},_selectById:function(f,e){if("none"!=this.selection.mode&&
this.grid._hasIdentity){var k=e,c=this.grid;if("number"==typeof e||"string"==typeof e)k=(k=c._by_idx[e])&&k.item;k&&(this._selectedById[c.store.getIdentity(k)]=!!f);return k}}})})},"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(q,m,n,l,f,e,k,c,h,b,a){q=q([k,c],{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(a,c,f,g,k){if(c&&"textsymbol"!==c.type){a=h.createSurface(a,f,g);if(9>l("ie")){var d=a.getEventSource();
e.set(d,"position","relative");e.set(d.parentNode,"position","relative")}c=!this.legendOverride&&this._getDrawingToolShape(c,k)||b.getShapeDescriptors(c);var n;try{n=a.createShape(c.defaultShape).setFill(c.fill).setStroke(c.stroke)}catch(B){a.clear();a.destroy();return}var q=n.getBoundingBox();c=q.width;k=q.height;var d=-(q.x+c/2),q=-(q.y+k/2),t=a.getDimensions(),d={dx:d+t.width/2,dy:q+t.height/2};if(c>f||k>g)q=c/f>k/g,f=((q?f:g)-5)/(q?c:k),m.mixin(d,{xx:f,yy:f});n.applyTransform(d);return a}},_getDrawingToolShape:function(a,
b){var c;switch(b?b.drawingTool||null:null){case "esriFeatureEditToolArrow":c={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":c={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":c={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":c={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":c={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":c={type:"path",path:"M -10,14 L 2,-10 L 14,14 L -10,14 E"};break;case "esriFeatureEditToolRectangle":c={type:"path",path:"M -10,-10 L 10,-10 L 10,10 L -10,10 L -10,-10 E"};break;case "esriFeatureEditToolCircle":c={type:"circle",cx:0,cy:0,r:10};break;case "esriFeatureEditToolEllipse":c={type:"ellipse",cx:0,cy:0,rx:10,ry:5};break;case "esriFeatureEditToolFreehand":c=
"simplelinesymbol"===a.type||"cartographiclinesymbol"===a.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:c,fill:a.getFill(),stroke:a.getStroke()}},_repaint:function(a){a?(a.getStroke&&a.setStroke&&a.setStroke(a.getStroke()),a.getFill&&a.setFill&&a.setFill(a.getFill()),a.children&&m.isArray(a.children)&&n.forEach(a.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)}});
l("extend-esri")&&m.setObject("dijit.editing.TemplatePickerItem",q,a);return q})},"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:dijit/form/templates/Button.html":'\x3cspan class\x3d"dijit dijitReset dijitInline" role\x3d"presentation"\r\n\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitButtonNode"\r\n\t\tdata-dojo-attach-event\x3d"ondijitclick:__onClick" role\x3d"presentation"\r\n\t\t\x3e\x3cspan class\x3d"dijitReset dijitStretch dijitButtonContents"\r\n\t\t\tdata-dojo-attach-point\x3d"titleNode,focusNode"\r\n\t\t\trole\x3d"button" aria-labelledby\x3d"${id}_label"\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitIcon" data-dojo-attach-point\x3d"iconNode"\x3e\x3c/span\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitToggleButtonIconChar"\x3e\x26#x25CF;\x3c/span\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitButtonText"\r\n\t\t\t\tid\x3d"${id}_label"\r\n\t\t\t\tdata-dojo-attach-point\x3d"containerNode"\r\n\t\t\t\x3e\x3c/span\r\n\t\t\x3e\x3c/span\r\n\t\x3e\x3c/span\r\n\t\x3e\x3cinput ${!nameAttrSetting} type\x3d"${type}" value\x3d"${value}" class\x3d"dijitOffScreen"\r\n\t\tdata-dojo-attach-event\x3d"onclick:_onClick"\r\n\t\ttabIndex\x3d"-1" aria-hidden\x3d"true" data-dojo-attach-point\x3d"valueNode"\r\n/\x3e\x3c/span\x3e\r\n',
"url:dijit/form/templates/DropDownButton.html":'\x3cspan class\x3d"dijit dijitReset dijitInline"\r\n\t\x3e\x3cspan class\x3d\'dijitReset dijitInline dijitButtonNode\'\r\n\t\tdata-dojo-attach-event\x3d"ondijitclick:__onClick" data-dojo-attach-point\x3d"_buttonNode"\r\n\t\t\x3e\x3cspan class\x3d"dijitReset dijitStretch dijitButtonContents"\r\n\t\t\tdata-dojo-attach-point\x3d"focusNode,titleNode,_arrowWrapperNode,_popupStateNode"\r\n\t\t\trole\x3d"button" aria-haspopup\x3d"true" aria-labelledby\x3d"${id}_label"\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitIcon"\r\n\t\t\t\tdata-dojo-attach-point\x3d"iconNode"\r\n\t\t\t\x3e\x3c/span\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitButtonText"\r\n\t\t\t\tdata-dojo-attach-point\x3d"containerNode"\r\n\t\t\t\tid\x3d"${id}_label"\r\n\t\t\t\x3e\x3c/span\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitArrowButtonInner"\x3e\x3c/span\r\n\t\t\t\x3e\x3cspan class\x3d"dijitReset dijitInline dijitArrowButtonChar"\x3e\x26#9660;\x3c/span\r\n\t\t\x3e\x3c/span\r\n\t\x3e\x3c/span\r\n\t\x3e\x3cinput ${!nameAttrSetting} type\x3d"${type}" value\x3d"${value}" class\x3d"dijitOffScreen" tabIndex\x3d"-1"\r\n\t\tdata-dojo-attach-event\x3d"onclick:_onClick" data-dojo-attach-point\x3d"valueNode" aria-hidden\x3d"true"\r\n/\x3e\x3c/span\x3e\r\n',
"url:dijit/templates/ProgressBar.html":'\x3cdiv class\x3d"dijitProgressBar dijitProgressBarEmpty" role\x3d"progressbar"\r\n\t\x3e\x3cdiv  data-dojo-attach-point\x3d"internalProgress" class\x3d"dijitProgressBarFull"\r\n\t\t\x3e\x3cdiv class\x3d"dijitProgressBarTile" role\x3d"presentation"\x3e\x3c/div\r\n\t\t\x3e\x3cspan style\x3d"visibility:hidden"\x3e\x26#160;\x3c/span\r\n\t\x3e\x3c/div\r\n\t\x3e\x3cdiv data-dojo-attach-point\x3d"labelNode" class\x3d"dijitProgressBarLabel" id\x3d"${id}_label"\x3e\x3c/div\r\n\t\x3e\x3cspan data-dojo-attach-point\x3d"indeterminateHighContrastImage"\r\n\t\t   class\x3d"dijitInline dijitProgressBarIndeterminateHighContrastImage"\x3e\x3c/span\r\n\x3e\x3c/div\x3e\r\n',
"url:esri/dijit/editing/templates/AttachmentEditor.html":"\x3cdiv class\x3d\"attachmentEditor\"\x3e\r\n    \x3cbr /\x3e\r\n    \x3cdiv\x3e\r\n        \x3cb\x3e${NLS_attachments}\x3c/b\x3e\r\n        \x3chr /\x3e\r\n        \x3cdiv dojoAttachPoint\x3d\"_attachmentError\" style\x3d'color:red;display:none'\x3e\x3c/div\x3e\r\n        \x3cbr /\x3e\r\n        \x3cspan dojoAttachPoint\x3d'_attachmentList' style\x3d'word-wrap: break-word;'\x3e\x3c/span\x3e\r\n        \x3cbr\x3e\x3cbr\x3e\r\n        \x3cdiv data-dojo-type\x3d\"dijit/ProgressBar\" dojoAttachPoint\x3d\"_attachmentProgress\" indeterminate\x3d\"true\" style\x3d'display:none'\x3e\x3c/div\x3e\r\n        \x3cbr /\x3e        \r\n        \x3cform dojoAttachPoint\x3d'_uploadForm'\x3e ${NLS_add}:\x26nbsp;\x26nbsp;\x3cinput type\x3d'file' name\x3d'attachment' dojoAttachPoint\x3d'_uploadField' /\x3e \x3c/form\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e",
"url:dijit/templates/Calendar.html":'\x3cdiv class\x3d"dijitCalendarContainer dijitInline" role\x3d"presentation" aria-labelledby\x3d"${id}_mddb ${id}_year"\x3e\r\n\t\x3cdiv class\x3d"dijitReset dijitCalendarMonthContainer" role\x3d"presentation"\x3e\r\n\t\t\x3cdiv class\x3d\'dijitReset dijitCalendarArrow dijitCalendarDecrementArrow\' data-dojo-attach-point\x3d"decrementMonth"\x3e\r\n\t\t\t\x3cimg src\x3d"${_blankGif}" alt\x3d"" class\x3d"dijitCalendarIncrementControl dijitCalendarDecrease" role\x3d"presentation"/\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"decreaseArrowNode" class\x3d"dijitA11ySideArrow"\x3e-\x3c/span\x3e\r\n\t\t\x3c/div\x3e\r\n\t\t\x3cdiv class\x3d\'dijitReset dijitCalendarArrow dijitCalendarIncrementArrow\' data-dojo-attach-point\x3d"incrementMonth"\x3e\r\n\t\t\t\x3cimg src\x3d"${_blankGif}" alt\x3d"" class\x3d"dijitCalendarIncrementControl dijitCalendarIncrease" role\x3d"presentation"/\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"increaseArrowNode" class\x3d"dijitA11ySideArrow"\x3e+\x3c/span\x3e\r\n\t\t\x3c/div\x3e\r\n\t\t\x3cdiv data-dojo-attach-point\x3d"monthNode" class\x3d"dijitInline"\x3e\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\t\x3ctable cellspacing\x3d"0" cellpadding\x3d"0" role\x3d"grid" data-dojo-attach-point\x3d"gridNode"\x3e\r\n\t\t\x3cthead\x3e\r\n\t\t\t\x3ctr role\x3d"row"\x3e\r\n\t\t\t\t${!dayCellsHtml}\r\n\t\t\t\x3c/tr\x3e\r\n\t\t\x3c/thead\x3e\r\n\t\t\x3ctbody data-dojo-attach-point\x3d"dateRowsNode" data-dojo-attach-event\x3d"ondijitclick: _onDayClick" class\x3d"dijitReset dijitCalendarBodyContainer"\x3e\r\n\t\t\t\t${!dateRowsHtml}\r\n\t\t\x3c/tbody\x3e\r\n\t\x3c/table\x3e\r\n\t\x3cdiv class\x3d"dijitReset dijitCalendarYearContainer" role\x3d"presentation"\x3e\r\n\t\t\x3cdiv class\x3d"dijitCalendarYearLabel"\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"previousYearLabelNode" class\x3d"dijitInline dijitCalendarPreviousYear" role\x3d"button"\x3e\x3c/span\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"currentYearLabelNode" class\x3d"dijitInline dijitCalendarSelectedYear" role\x3d"button" id\x3d"${id}_year"\x3e\x3c/span\x3e\r\n\t\t\t\x3cspan data-dojo-attach-point\x3d"nextYearLabelNode" class\x3d"dijitInline dijitCalendarNextYear" role\x3d"button"\x3e\x3c/span\x3e\r\n\t\t\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:dijit/form/templates/TextBox.html":'\x3cdiv class\x3d"dijit dijitReset dijitInline dijitLeft" id\x3d"widget_${id}" role\x3d"presentation"\r\n\t\x3e\x3cdiv class\x3d"dijitReset dijitInputField dijitInputContainer"\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputInner" data-dojo-attach-point\x3d\'textbox,focusNode\' autocomplete\x3d"off"\r\n\t\t\t${!nameAttrSetting} type\x3d\'${type}\'\r\n\t/\x3e\x3c/div\r\n\x3e\x3c/div\x3e\r\n',"url:dijit/templates/Tooltip.html":'\x3cdiv class\x3d"dijitTooltip dijitTooltipLeft" id\x3d"dojoTooltip" data-dojo-attach-event\x3d"mouseenter:onMouseEnter,mouseleave:onMouseLeave"\r\n\t\x3e\x3cdiv class\x3d"dijitTooltipConnector" data-dojo-attach-point\x3d"connectorNode"\x3e\x3c/div\r\n\t\x3e\x3cdiv class\x3d"dijitTooltipContainer dijitTooltipContents" data-dojo-attach-point\x3d"containerNode" role\x3d\'alert\'\x3e\x3c/div\r\n\x3e\x3c/div\x3e\r\n',
"url:dijit/form/templates/ValidationTextBox.html":'\x3cdiv class\x3d"dijit dijitReset dijitInline dijitLeft"\r\n\tid\x3d"widget_${id}" role\x3d"presentation"\r\n\t\x3e\x3cdiv class\x3d\'dijitReset dijitValidationContainer\'\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value\x3d"\x26#935; " type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"presentation"\r\n\t/\x3e\x3c/div\r\n\t\x3e\x3cdiv class\x3d"dijitReset dijitInputField dijitInputContainer"\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputInner" data-dojo-attach-point\x3d\'textbox,focusNode\' autocomplete\x3d"off"\r\n\t\t\t${!nameAttrSetting} type\x3d\'${type}\'\r\n\t/\x3e\x3c/div\r\n\x3e\x3c/div\x3e\r\n',
"url:dijit/form/templates/DropDownBox.html":'\x3cdiv class\x3d"dijit dijitReset dijitInline dijitLeft"\r\n\tid\x3d"widget_${id}"\r\n\trole\x3d"combobox"\r\n\taria-haspopup\x3d"true"\r\n\tdata-dojo-attach-point\x3d"_popupStateNode"\r\n\t\x3e\x3cdiv class\x3d\'dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer\'\r\n\t\tdata-dojo-attach-point\x3d"_buttonNode" role\x3d"presentation"\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField dijitArrowButtonInner" value\x3d"\x26#9660; " type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"button presentation" aria-hidden\x3d"true"\r\n\t\t\t${_buttonInputDisabled}\r\n\t/\x3e\x3c/div\r\n\t\x3e\x3cdiv class\x3d\'dijitReset dijitValidationContainer\'\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value\x3d"\x26#935; " type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"presentation"\r\n\t/\x3e\x3c/div\r\n\t\x3e\x3cdiv class\x3d"dijitReset dijitInputField dijitInputContainer"\r\n\t\t\x3e\x3cinput class\x3d\'dijitReset dijitInputInner\' ${!nameAttrSetting} type\x3d"${type}" autocomplete\x3d"off"\r\n\t\t\tdata-dojo-attach-point\x3d"textbox,focusNode" role\x3d"textbox"\r\n\t/\x3e\x3c/div\r\n\x3e\x3c/div\x3e\r\n',
"url:dijit/form/templates/Spinner.html":'\x3cdiv class\x3d"dijit dijitReset dijitInline dijitLeft"\r\n\tid\x3d"widget_${id}" role\x3d"presentation"\r\n\t\x3e\x3cdiv class\x3d"dijitReset dijitButtonNode dijitSpinnerButtonContainer"\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField dijitSpinnerButtonInner" type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"presentation"\r\n\t\t/\x3e\x3cdiv class\x3d"dijitReset dijitLeft dijitButtonNode dijitArrowButton dijitUpArrowButton"\r\n\t\t\tdata-dojo-attach-point\x3d"upArrowNode"\r\n\t\t\t\x3e\x3cdiv class\x3d"dijitArrowButtonInner"\r\n\t\t\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField" value\x3d"\x26#9650; " type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"presentation"\r\n\t\t\t\t\t${_buttonInputDisabled}\r\n\t\t\t/\x3e\x3c/div\r\n\t\t\x3e\x3c/div\r\n\t\t\x3e\x3cdiv class\x3d"dijitReset dijitLeft dijitButtonNode dijitArrowButton dijitDownArrowButton"\r\n\t\t\tdata-dojo-attach-point\x3d"downArrowNode"\r\n\t\t\t\x3e\x3cdiv class\x3d"dijitArrowButtonInner"\r\n\t\t\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField" value\x3d"\x26#9660; " type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"presentation"\r\n\t\t\t\t\t${_buttonInputDisabled}\r\n\t\t\t/\x3e\x3c/div\r\n\t\t\x3e\x3c/div\r\n\t\x3e\x3c/div\r\n\t\x3e\x3cdiv class\x3d\'dijitReset dijitValidationContainer\'\r\n\t\t\x3e\x3cinput class\x3d"dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value\x3d"\x26#935; " type\x3d"text" tabIndex\x3d"-1" readonly\x3d"readonly" role\x3d"presentation"\r\n\t/\x3e\x3c/div\r\n\t\x3e\x3cdiv class\x3d"dijitReset dijitInputField dijitInputContainer"\r\n\t\t\x3e\x3cinput class\x3d\'dijitReset dijitInputInner\' data-dojo-attach-point\x3d"textbox,focusNode" type\x3d"${type}" data-dojo-attach-event\x3d"onkeydown:_onKeyDown"\r\n\t\t\trole\x3d"spinbutton" autocomplete\x3d"off" ${!nameAttrSetting}\r\n\t/\x3e\x3c/div\r\n\x3e\x3c/div\x3e\r\n',
"url:esri/dijit/templates/AttributeInspector.html":'\x3cdiv class\x3d"esriAttributeInspector"\x3e\r\n    \x3cdiv class\x3d"atiLayerName" dojoAttachPoint\x3d"layerName"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"atiAttributes" dojoAttachPoint\x3d"attributeTable"\x3e\x3c/div\x3e\r\n    \x3cdiv dojoAttachPoint\x3d"attachmentEditor"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"atiEditorTrackingInfo" dojoAttachPoint\x3d"editorTrackingInfoDiv"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"atiButtons" dojoAttachPoint\x3d"editButtons"\x3e\r\n        \x3cbutton  dojoType\x3d"dijit.form.Button" class\x3d"atiButton atiDeleteButton"  dojoAttachPoint\x3d"deleteBtn" dojoAttachEvent\x3d"onClick: onDeleteBtn" showLabel\x3d"true" type\x3d"button"\x3e${NLS_deleteFeature}\x3c/button\x3e\r\n        \x3cdiv class\x3d"atiNavButtons" dojoAttachPoint\x3d"navButtons"\x3e\r\n            \x3cdiv class\x3d"atiNavMessage" dojoAttachPoint\x3d"navMessage"\x3e\x3c/div\x3e\r\n            \x3cbutton  dojoType\x3d"dijit.form.Button" iconClass\x3d"atiButton atiFirstIcon" dojoAttachPoint\x3d"firstFeatureButton" dojoAttachEvent\x3d"onClick: onFirstFeature" showLabel\x3d"false" type\x3d"button"\x3e${NLS_first}\x3c/button\x3e\r\n            \x3cbutton  dojoType\x3d"dijit.form.Button" iconClass\x3d"atiButton atiPrevIcon" dojoAttachPoint\x3d"prevFeatureButton" dojoAttachEvent\x3d"onClick: onPreviousFeature" showLabel\x3d"false" type\x3d"button"\x3e${NLS_previous}\x3c/button\x3e\r\n            \x3cbutton  dojoType\x3d"dijit.form.Button" iconClass\x3d"atiButton atiNextIcon" dojoAttachPoint\x3d"nextFeatureButton" dojoAttachEvent\x3d"onClick: onNextFeature" showLabel\x3d"false" type\x3d"button"\x3e${NLS_next}\x3c/button\x3e\r\n            \x3cbutton  dojoType\x3d"dijit.form.Button" iconClass\x3d"atiButton atiLastIcon" dojoAttachPoint\x3d"lastFeatureButton" dojoAttachEvent\x3d"onClick: onLastFeature" showLabel\x3d"false" type\x3d"button"\x3e${NLS_last}\x3c/button\x3e\r\n        \x3c/div\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e\r\n',
"url:dijit/form/templates/ComboButton.html":'\x3ctable class\x3d"dijit dijitReset dijitInline dijitLeft"\r\n\tcellspacing\x3d\'0\' cellpadding\x3d\'0\' role\x3d"presentation"\r\n\t\x3e\x3ctbody role\x3d"presentation"\x3e\x3ctr role\x3d"presentation"\r\n\t\t\x3e\x3ctd class\x3d"dijitReset dijitStretch dijitButtonNode" data-dojo-attach-point\x3d"buttonNode" data-dojo-attach-event\x3d"ondijitclick:__onClick,onkeydown:_onButtonKeyDown"\r\n\t\t\x3e\x3cdiv id\x3d"${id}_button" class\x3d"dijitReset dijitButtonContents"\r\n\t\t\tdata-dojo-attach-point\x3d"titleNode"\r\n\t\t\trole\x3d"button" aria-labelledby\x3d"${id}_label"\r\n\t\t\t\x3e\x3cdiv class\x3d"dijitReset dijitInline dijitIcon" data-dojo-attach-point\x3d"iconNode" role\x3d"presentation"\x3e\x3c/div\r\n\t\t\t\x3e\x3cdiv class\x3d"dijitReset dijitInline dijitButtonText" id\x3d"${id}_label" data-dojo-attach-point\x3d"containerNode" role\x3d"presentation"\x3e\x3c/div\r\n\t\t\x3e\x3c/div\r\n\t\t\x3e\x3c/td\r\n\t\t\x3e\x3ctd id\x3d"${id}_arrow" class\x3d\'dijitReset dijitRight dijitButtonNode dijitArrowButton\'\r\n\t\t\tdata-dojo-attach-point\x3d"_popupStateNode,focusNode,_buttonNode"\r\n\t\t\tdata-dojo-attach-event\x3d"onkeydown:_onArrowKeyDown"\r\n\t\t\ttitle\x3d"${optionsTitle}"\r\n\t\t\trole\x3d"button" aria-haspopup\x3d"true"\r\n\t\t\t\x3e\x3cdiv class\x3d"dijitReset dijitArrowButtonInner" role\x3d"presentation"\x3e\x3c/div\r\n\t\t\t\x3e\x3cdiv class\x3d"dijitReset dijitArrowButtonChar" role\x3d"presentation"\x3e\x26#9660;\x3c/div\r\n\t\t\x3e\x3c/td\r\n\t\t\x3e\x3ctd style\x3d"display:none !important;"\r\n\t\t\t\x3e\x3cinput ${!nameAttrSetting} type\x3d"${type}" value\x3d"${value}" data-dojo-attach-point\x3d"valueNode"\r\n\t\t\t\tclass\x3d"dijitOffScreen" aria-hidden\x3d"true" data-dojo-attach-event\x3d"onclick:_onClick"\r\n\t\t/\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/tbody\r\n\x3e\x3c/table\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',"url:esri/dijit/editing/templates/Editor.html":'\x3cdiv class\x3d"esriEditor"\x3e\r\n    \x3cdiv class\x3d"esriTemplatePicker" dojoAttachPoint\x3d"templatePickerDiv"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"esriDrawingToolbar" dojoAttachPoint\x3d"drawingToolbarDiv"\x3e\x3c/div\x3e\r\n    \x3cdiv class\x3d"progressBar" dojoAttachPoint\x3d"progressBar" indeterminate\x3d"true" dojoType\x3d"dijit.ProgressBar" /\x3e\r\n\x3c/div\x3e',
"*now":function(q){q(['dojo/i18n!*preload*esri/dijit/editing/nls/Editor*["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/Editor","dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/_base/connect dojo/_base/kernel dojo/has dojo/query dojo/DeferredList dojo/dom-class dojo/dom-construct dojo/string dijit/_Widget dijit/_Templated ../../domUtils ../../graphicsUtils ../../geometry/Polyline ../../geometry/Polygon ../../graphic ../../undoManager ../../tasks/query ../../layers/FeatureLayer ../../layers/FeatureTemplate ../../toolbars/draw ../../toolbars/edit ../AttributeInspector ./Util ./Add ./Update ./Delete ./Cut ./Union ./toolbars/Drawing ./SelectionHelper ./TemplatePicker ../../kernel ../../config dojo/i18n!../../nls/jsapi dojo/text!./templates/Editor.html dijit/ProgressBar dojo/NodeList-dom".split(" "),function(q,
m,n,l,f,e,k,c,h,b,a,d,t,v,g,u,p,r,A,y,B,x,w,z,E,C,D,F,G,I,N,M,P,U,V,W,T,K){var J=q([d,t],{declaredClass:"esri.dijit.editing.Editor",widgetsInTemplate:!0,templateString:K,onLoad:function(){},constructor:function(a,b){a=a||{};a.settings||console.error("Editor: please provide 'settings' parameter in the constructor");a.settings.layerInfos||console.error("Editor: please provide 'layerInfos' parameter in the constructor");this._settings=a.settings;this._eConnects=[]},startup:function(){this.inherited(arguments);
this._setDefaultOptions();this._settings.map.setInfoWindowOnClick(!1);var a=this._settings.layerInfos;this.featureReductionEnabledLayers=[];n.forEach(a,function(a){a=a.featureLayer;a.isFeatureReductionEnabled()&&(a.disableFeatureReduction(),this.featureReductionEnabledLayers.push(a))},this);if(n.every(a,function(a){return a.featureLayer.loaded}))this._initLayers(),this._connectEvents(),this._createWidgets(),this.onLoad(),this.loaded=!0;else{var b=a.length;n.forEach(a,function(a){a=a.featureLayer;
if(a.loaded)b--;else var c=l.connect(a,"onLoad",this,function(a){l.disconnect(c);c=null;b--;b||(this._initLayers(),this._connectEvents(),this._createWidgets(),this.onLoad(),this.loaded=!0)})},this)}this._reset();this._enableMapClickHandler()},stopEditing:function(a){this._updateCurrentFeature(m.hitch(this,function(){this._clearSelection(!1);a&&a()}))},destroy:function(){this._settings.map.setInfoWindowOnClick(!0);this.drawingToolbar&&this.drawingToolbar.destroy();this.attributeInspector&&this.attributeInspector.destroy();
this.templatePicker&&this.templatePicker.destroy();this._selectionHelper&&this._selectionHelper.destroy();this._drawToolbar&&this._drawToolbar.deactivate();this._reset();this._disableMapClickHandler();n.forEach(this._eConnects,l.disconnect);l.disconnect(this._dtConnect);l.disconnect(this._templatePickerOnSelectionChangeEvent);this._layer=this._currentGraphic=this._activeType=this._activeTemplate=this._drawingTool=this._drawToolbar=this.editToolbar=this.drawingToolbar=this.attributeInspector=this.templatePicker=
this.undoManager=null;this._settings.map.infoWindow&&this._settings.map.infoWindow.clearFeatures&&this._settings.map.infoWindow.clearFeatures();n.forEach(this.featureReductionEnabledLayers,function(a){a.enableFeatureReduction()});this.inherited(arguments)},_setDefaultOptions:function(){this._drawToolbar=this._settings.drawToolbar||new w(this._settings.map);this._settings.drawToolbar=this._drawToolbar;this.editToolbar=this._settings.editToolbar||new z(this._settings.map,{textSymbolEditorHolder:this.domNode});
this._settings.editToolbar=this.editToolbar;this._settings.toolbarVisible=this._settings.toolbarVisible||!1;this._settings.toolbarOptions=m.mixin({reshapeVisible:!1,cutVisible:!1,mergeVisible:!1},this._settings.toolbarOptions);this._settings.createOptions=m.mixin({polylineDrawTools:[J.CREATE_TOOL_POLYLINE],polygonDrawTools:[J.CREATE_TOOL_POLYGON],editAttributesImmediately:!0},this._settings.createOptions);this._settings.singleSelectionTolerance=this._settings.singleSelectionTolerance||3;this._settings.maxUndoRedoOperations=
this._settings.maxUndoRedoOperations||10;this._settings.editor=this;this._usePopup=this._settings.usePopup=this._settings.map.infoWindow._setPagerCallbacks?!0:!1;this._datePackage=this._settings.datePackage;var a=W.defaults;this._settings.geometryService=this._settings.geometryService||a.geometryService;a.geometryService=a.geometryService||this._settings.geometryService},_initLayers:function(){this._settings.layers=[];this._settings.userIds={};this._settings.createOnlyLayer={};n.forEach(this._settings.layerInfos,
function(a){if(a.featureLayer&&a.featureLayer.loaded){this._settings.layers.push(a.featureLayer);var b=a.featureLayer.id;a.featureLayer.credential&&(this._settings.userIds[b]=a.featureLayer.credential.userId);a.userId&&(this._settings.userIds[b]=a.userId);var c=a.featureLayer.getEditCapabilities();this._settings.createOnlyLayer[b]=c.canCreate&&!c.canUpdate?!0:!1;this._isTextSymbolPointLayer(a.featureLayer)&&(a.disableAttributeUpdate=!0)}},this)},_reset:function(){this._hideAttributeInspector();this.editToolbar.deactivate();
this._editVertices=!0;this._drawingTool=this._activeTemplate=this._activeType=this._currentGraphic=this._layer=null;this._attributeChanged=!1},_saveFeatureOnClient:function(a){var b=this.templatePicker.getSelected(),c;c=b.template?b.featureLayer.renderer.getSymbol(b.template.prototype):b.symbolInfo.symbol;this._tempGraphic=new r(a,c,null,null);this._tempGraphic.setAttributes(m.mixin({},b.template.prototype.attributes));c=this._settings.map;c.graphics.add(this._tempGraphic);a=this._findCenterPoint(a);
this._createAttributeInspector(!0);c.infoWindow.setTitle(b.featureLayer?b.featureLayer.name:T.widgets.attributeInspector.NLS_title);this.attributeInspector.showFeature(this._tempGraphic,b.featureLayer);this._showInfoWindow(a,c.getInfoWindowAnchor(a));this._settings.createOnlyLayer[b.featureLayer.id]&&(this._infoWindowHideEvent=l.connect(c.infoWindow,"onHide",this,"_infoWindowHide"));l.disconnect(this._templatePickerOnSelectionChangeEvent);this.templatePicker.clearSelection();this._drawToolbar.deactivate();
this._enableMapClickHandler();this.drawingToolbar&&this.drawingToolbar.deactivate();this._templatePickerOnSelectionChangeEvent=l.connect(this.templatePicker,"onSelectionChange",m.hitch(this,"_onCreateFeature"))},_saveAttributesOnClient:function(a,b,c){this._tempGraphic.attributes[b]="number"===typeof c&&isNaN(c)?null:c},_infoWindowHide:function(){this._createFeature(this._tempGraphic.geometry,this._tempGraphic.attributes);l.disconnect(this._infoWindowHideEvent)},_createFeature:function(a,b){this._editClickPoint=
this._findCenterPoint(a);a.rings?this._simplify(a,m.hitch(this,function(a){this._drawingTool!==x.TOOL_AUTO_COMPLETE_POLYGON?this._applyEdits([{layer:this._layer,adds:[this._createGraphic(a,b)]}],m.hitch(this,function(){this._chainAttachment(this._oEdits[0].adds[0].attributes[this._oEdits[0].layer.objectIdField],this._oEdits[0].layer)})):this._autoComplete(a,m.hitch(this,function(a){a&&a.length&&this._applyEdits([{layer:this._layer,adds:n.map(a,m.hitch(this,function(a){return this._createGraphic(a,
b)}))}],function(){this._chainAttachment(this._oEdits[0].adds[0].attributes[this._oEdits[0].layer.objectIdField],this._oEdits[0].layer)})}))})):this._applyEdits([{layer:this._layer,adds:[this._createGraphic(a,b)]}],m.hitch(this,function(){this._chainAttachment(this._oEdits[0].adds[0].attributes[this._oEdits[0].layer.objectIdField],this._oEdits[0].layer);this._layer&&this._layer.renderer&&"heatmap"===this._layer.renderer.type&&this._layer.refresh()}))},_chainAttachment:function(a,b){this.attributeInspector&&
this.attributeInspector._attachmentEditor&&this.attributeInspector._attachmentEditor._tempUpload&&this.attributeInspector._attachmentEditor._chainAttachment(a,b)},_updateCurrentFeature:function(a){var b=this._isModified();b?this._updateFeature(b,a):a&&a(!1)},_updateFeature:function(a,b,c){var d=a.geometry,e=a.getLayer();e.hasZ&&!e.enableZDefaults||e.hasM&&!e.allowUpdateWithoutMValues||c&&!this._isModified()?(c=new r,c.setAttributes(a.attributes),this._applyEdits([{layer:a.getLayer(),updates:[c]}],
b)):d.rings?this._simplify(d,m.hitch(this,function(c){this._applyEdits([{layer:a.getLayer(),updates:[m.mixin(a,{geometry:c})]}],b)})):this._applyEdits([{layer:a.getLayer(),updates:[a]}],b)},_deleteFeature:function(a,b){var c=[];a?c.push({layer:a.getLayer(),deletes:[a]}):(c=n.map(n.filter(this._settings.layers,function(a){return 0<a.getSelectedFeatures().length}),function(a){return{layer:a,deletes:a.getSelectedFeatures()}}))&&c.length||!this._currentGraphic||c.push({layer:this._layer,deletes:[this._currentGraphic]});
this._applyEdits(c,b)},_stopEditing:function(a,b,c,d){v.hide(this.progressBar.domNode);this._settings.createOnlyLayer[a.id]||this._undoRedoAdd();var e;!0===a._isSelOnly||1===a.mode||6===a.mode?b&&b.length&&(this.templatePicker.clearSelection(),e=new y,e.objectIds=[b[0].objectId],this._settings.createOnlyLayer[a.id]?this._settings.map.graphics.remove(this._tempGraphic):this._selectFeatures([a],e,m.hitch(this,"_onEditFeature"))):((e=this._selectionHelper.findMapService(this._settings.map,a))&&e.refresh(),
b&&b.length&&(this.templatePicker.clearSelection(),this._settings.createOnlyLayer[a.id]?this._settings.map.graphics.remove(this._tempGraphic):C.findFeatures(b,a,m.hitch(this,"_onEditFeature"))));d&&d.length&&(this._clearSelection(!0),this._undoRedo&&(e=this._selectionHelper.findMapService(a,this._settings.map))&&e.refresh());this._undoRedo&&c&&c.length&&((e=this._selectionHelper.findMapService(a,this._settings.map))&&e.refresh(),this.attributeInspector.refresh(),this._undoRedo=!1);this.drawingToolbar&&
this.drawingToolbar._updateUI();this._undoRedo=!1},_undoRedoAdd:function(){this._settings._isApplyEditsCall=!1;if(this._settings.undoManager){var a=this._edits&&this._edits.length?this._edits[0]:null;if(a){var b=a.adds||[],c=a.updates||[],d=a.deletes||[],e=a.preUpdates||[],a={featureLayer:a.layer};"CUT"===this._activeTool?b.length&&c.length&&e.length&&this.undoManager.add(new I(m.mixin(a,{preUpdatedGraphics:e,addedGraphics:b,postUpdatedGraphics:c}))):"UNION"===this._activeTool?d.length&&c.length&&
e.length&&this.undoManager.add(new N(m.mixin(a,{preUpdatedGraphics:e,deletedGraphics:d,postUpdatedGraphics:c}))):b.length?this.undoManager.add(new D(m.mixin(a,{addedGraphics:b}))):d.length?this.undoManager.add(new G(m.mixin(a,{deletedGraphics:d}))):c.length&&(this._rollbackGraphic||e.length)&&this.undoManager.add(new F(m.mixin(a,{preUpdatedGraphics:e.length?e:[this._rollbackGraphic],postUpdatedGraphics:c})));this._rollbackGraphic=this._edits=null}}},_activateDrawToolbar:function(a){this._layer=a.featureLayer;
this._activeType=a.type;this._drawingTool=(this._activeTemplate=a.template)?this._activeTemplate.drawingTool:null;this._drawTool=this._toDrawTool(this._drawingTool,a.featureLayer);l.disconnect(this._dtConnect);this._dtConnect=this._settings.createOnlyLayer[a.featureLayer.id]?l.connect(this._drawToolbar,"onDrawEnd",this,"_saveFeatureOnClient"):l.connect(this._drawToolbar,"onDrawEnd",this,"_createFeature");this.editToolbar.deactivate();this._disableMapClickHandler();this.drawingToolbar?this.drawingToolbar.activateEditing(this._drawTool,
this._layer):this._drawToolbar.activate(this._drawTool)},_activateEditToolbar:function(a,b){var c=a.getLayer(),d=c?c.geometryType:null,e=this._isTextSymbolPoint(a),f=z.MOVE;"esriGeometryPoint"!==d&&!0===this._isNotesFeature(a)?(f=f|z.ROTATE|z.SCALE,this._editVertices=!1):"esriGeometryPoint"!==d&&!0===this._editVertices?(f=f|z.ROTATE|z.SCALE,this._editVertices=!1):e?(f=f|z.ROTATE|z.SCALE|z.EDIT_TEXT,this._editVertices=!1):(f|=z.EDIT_VERTICES,this._editVertices=!0);this._attributeChanged=this._isModified();
this._rollbackGraphic=new r(a.toJson());var d=c.getEditCapabilities({feature:a,userId:this._settings.userIds[c.id]}),g=n.filter(this._settings.layerInfos,function(a){return a.featureLayer.layerId===c.layerId})[0];d.canUpdate&&!g.disableGeometryUpdate&&d.canUpdateGeometry&&(this.editToolbar.activate(f,a),e&&(this.editToolbar._textEditor._addTextBox(a),this.editToolbar._textSymbolEditor&&this.editToolbar._textSymbolEditor.hide()));this._settings.map.infoWindow.isShowing||this._updateAttributeDisabled(a)||
(e=b&&b.screenPoint||this._findCenterPoint(a),this._showInfoWindow(e,this._settings.map.getInfoWindowAnchor(e)))},_createGraphic:function(a,b){var c=new r(a,this._activeType&&this._activeType.symbol||this._layer.defaultSymbol,b);this._activeTemplate||b?c.attributes=b||m.mixin({},this._activeTemplate.prototype.attributes):(c.attributes=c.attributes||[],n.forEach(this._layer.fields,function(a){c.attributes[a.name]=null},this));return c},_connectEvents:function(){var a=this._settings.layers;n.forEach(a,
function(a){this._connect(a,"onEditsComplete",m.hitch(this,"_stopEditing",a))},this);n.forEach(a,function(a){this._connect(a,"onBeforeApplyEdits",m.hitch(this,function(){v.show(this.progressBar.domNode);this._settings._isApplyEditsCall=!0}))},this);this._connect(this.editToolbar,"onGraphicClick",m.hitch(this,"_activateEditToolbar"));this._connect(this.editToolbar,"onGraphicFirstMove",m.hitch(this,"_hideAttributeInspector"));this._connect(this.editToolbar,"onVertexFirstMove",m.hitch(this,"_hideAttributeInspector"));
this._connect(this.editToolbar,"onScaleStart",m.hitch(this,"_hideAttributeInspector"));this._connect(this.editToolbar,"onRotateStart",m.hitch(this,"_hideAttributeInspector"))},_connect:function(a,b,c){this._eConnects.push(l.connect(a,b,c))},_createWidgets:function(){this._selectionHelper=new P(this._settings);this._createTemplatePicker();this._createAttributeInspector();this._createDrawingToolbar();this._createUndoRedoManager()},_createTemplatePicker:function(){if(this._settings.templatePicker)this.templatePicker=
this._settings.templatePicker,v.hide(this.templatePickerDiv);else{var a=n.filter(this._settings.layers,function(a){return a.getEditCapabilities().canCreate});this.templatePicker=new U({"class":"esriTemplatePicker",featureLayers:a,showTooltip:!0,maxLabelLength:this._settings.typesCharacterLimit,columns:"auto",rows:"auto"},this.templatePickerDiv);this.templatePicker.startup();this._settings.templatePicker=this.templatePicker}this._templatePickerOnSelectionChangeEvent=l.connect(this.templatePicker,"onSelectionChange",
m.hitch(this,"_onCreateFeature"))},_createAttributeInspector:function(a){if(this._settings.attributeInspector)this._customAttributeInspector=!0,this.attributeInspector=this._settings.attributeInspector;else{this._customAttributeInspector=!1;var c=this._settings.map;this.attributeInspector=new E({layerInfos:this._settings.layerInfos,hideNavButtons:this._usePopup,datePackage:this._datePackage},b.create("div"));this.attributeInspector.startup();c.infoWindow.setContent(this.attributeInspector.domNode);
c.infoWindow.setTitle(T.widgets.attributeInspector.NLS_title);c.infoWindow.resize(350,375);f.query(".esriAttributeInspector .atiLayerName").style({display:"none"})}this._connect(this.attributeInspector,"onDelete",m.hitch(this,"_deleteFeature"));this._connect(this.attributeInspector,"onNext",m.hitch(this,function(a){this._updateCurrentFeature(m.hitch(this,function(){this._attributeChanged=!1;this._onEditFeature(a)}))}));this._usePopup&&this._settings.map.infoWindow._setPagerCallbacks(this.attributeInspector,
m.hitch(this.attributeInspector,"previous"),m.hitch(this.attributeInspector,"next"));a?this._connect(this.attributeInspector,"onAttributeChange",m.hitch(this,"_saveAttributesOnClient")):this._connect(this.attributeInspector,"onAttributeChange",m.hitch(this,function(a,b,c){var d=a.getLayer();(d=n.filter(d.fields,function(a){return a.name===b})[0])&&""===c&&(c=null);this._rollbackGraphic=new r(m.clone(a.toJson()));this.attributeInspector._rollbackInfo={field:d,graphic:this._rollbackGraphic};this._currentGraphic.attributes[b]=
"number"===typeof c&&isNaN(c)?null:c;this._currentGraphic.setAttributes(this._currentGraphic.attributes);this._updateFeature(this._currentGraphic,null,!0);this._attributeChanged=!1}))},_createDrawingToolbar:function(){!0===this._settings.toolbarVisible&&(this.drawingToolbar=new M({"class":"esriDrawingToolbar",drawToolbar:this._drawToolbar,editToolbar:this.editToolbar,settings:this._settings,onDelete:m.hitch(this,"_deleteFeature"),onApplyEdits:m.hitch(this,"_applyEdits"),onShowAttributeInspector:m.hitch(this,
"_onEditFeature")},this.drawingToolbarDiv))},_createUndoRedoManager:function(){if(this._settings.enableUndoRedo||this._settings.undoManager)this._settings.enableUndoRedo=!0,this.undoManager=this._settings.undoManager,this.undoManager||(this.undoManager=this._settings.undoManager=new A({maxOperations:this._settings.maxUndoRedoOperations})),this._connect(this.undoManager,"onUndoComplete",m.hitch(this,this._updateUndoRedoOperations)),this._connect(this.undoManager,"onRedoComplete",m.hitch(this,this._updateUndoRedoOperations)),
this._connect(document,"onkeypress",m.hitch(this,function(a){if(a.metaKey||a.ctrlKey)"z"===a.charOrCode&&this._undo(),"y"===a.charOrCode&&this._redo()}))},_updateUndoRedoOperations:function(a){if(a&&a.addedIds){var b;for(b=0;b<this.undoManager.length;b++){var c=this.undoManager.get(b);c&&a.layer===c._featureLayer&&c.updateObjectIds(a.oldIds,a.addedIds)}}a&&"Update Features"===a.operation.label&&this.attributeInspector.refresh()},_enableMapClickHandler:function(){this._mapClickHandler=l.connect(this._settings.map,
"onClick",m.hitch(this,function(a){this._drawToolbar._geometryType||("SELECT"===this._activeTool?this._activeTool="":this._updateCurrentFeature(m.hitch(this,function(){this._reset();this._updateSelection(a)})))}))},_disableMapClickHandler:function(){l.disconnect(this._mapClickHandler)},_onCreateFeature:function(){var a=this.templatePicker.getSelected();a?this._updateCurrentFeature(m.hitch(this,function(){this._currentGraphic&&this._clearSelection(!1);this._reset();this._activateDrawToolbar(a)})):
(this._reset(),l.disconnect(this._dtConnect),this._drawToolbar.deactivate(),this._enableMapClickHandler(),this.drawingToolbar&&this.drawingToolbar.deactivate())},_isTextSymbolPoint:function(a){if("point"===a.geometry.type||"multipoint"===a.geometry.type){var b=a.getLayer(),c=b.renderer;a=a.symbol||b._getSymbol(a);!a&&(c.hasVisualVariables("sizeInfo",!1)||c.hasVisualVariables("colorInfo",!1)||c.hasVisualVariables("opacityInfo",!1))&&c.addBreak&&c.infos&&1===c.infos.length&&(a=c.infos[0].symbol||c.defaultSymbol);
if(a&&"textsymbol"===a.type)return!0}return!1},_isTextSymbolPointLayer:function(a){return"esriGeometryPoint"===a.geometryType&&a.renderer&&a.renderer._symbols&&a.renderer._symbols[0]&&a.renderer._symbols[0].symbol&&"textsymbol"===a.renderer._symbols[0].symbol.type?!0:!1},_updateAttributeDisabled:function(a){a=a.getLayer();if(!a)return!1;var b,c,d=!1;for(b=0;b<this._settings.layerInfos.length;b++)if(c=this._settings.layerInfos[b],c.featureLayer==a){d=c.disableAttributeUpdate;break}return d},_onEditFeature:function(b,
c){if(b=(m.isArray(b)?b[0]:b)||null){var d;this._layer=b.getLayer();if(!this._customAttributeInspector&&!this._updateAttributeDisabled(b)){c=c||this._editClickPoint||this._findCenterPoint(b);1<this._currentFeatureCount?(d=this._popupFeatures.indexOf(b),d=a.substitute(T.widgets.popup.NLS_pagingInfo,{index:d+1,total:this._currentFeatureCount})):d=this._layer?this._layer.name:T.widgets.attributeInspector.NLS_title;this._settings.map.infoWindow.setTitle(d);if(this.drawingToolbar||!this._settings.map.infoWindow.isShowing)this.attributeInspector.refresh(),
this._showInfoWindow(c,this._settings.map.getInfoWindowAnchor(c));this._editClickPoint=null}b!==this._currentGraphic&&(this._editVertices=!0,this._currentGraphic=b,b.getDojoShape()&&b.getDojoShape().moveToFront(),d=this._layer.hasM,this._layer.hasZ&&!this._layer.enableZDefaults||d&&!this._layer.allowUpdateWithoutMValues||this._activateEditToolbar(b))}},_applyEdits:function(a,b){a=a||[];if(!(0>=a.length)){this._edits=this._oEdits=a;var d=[];n.forEach(a,function(a){a.layer&&d.push(a.layer.applyEdits(a.adds,
a.updates,a.deletes))});0<d.length&&(this._deferredsList=(new c(d)).addCallback(m.hitch(this,function(){v.hide(this.progressBar.domNode);b&&b();var a=this._settings.map;a&&a.infoWindow.reposition&&a.infoWindow.isShowing&&a.infoWindow.reposition()})))}},_undo:function(){this._settings.undoManager&&!this._settings._isApplyEditsCall&&(this.editToolbar.deactivate(),this._undoRedo=!0,this._settings.undoManager.undo())},_redo:function(){this._settings.undoManager&&!this._settings._isApplyEditsCall&&(this.editToolbar.deactivate(),
this._undoRedo=!0,this._settings.undoManager.redo())},_simplify:function(a,b){p.prototype.isSelfIntersecting(a)?this._settings.geometryService.simplify([a],function(a){var c=a&&a.length?a[0]:c;b&&b(c)}):b&&b(a)},_autoComplete:function(a,b){var c=this._getLayers("esriGeometryPolygon"),d=new y;d.geometry=a;d.returnGeometry=!0;this._selectFeatures(c,d,m.hitch(this,function(c){!c||0>=c.length?b&&b([a]):this._settings.geometryService.autoComplete(g.getGeometries(c),this._toPolylines([d.geometry]),function(a){b&&
b(a)})}))},_getLayers:function(a){return n.filter(this._settings.layers,function(b){return b.geometryType===a})},_selectFeatures:function(a,b,c,d){this._selectionHelper.selectFeatures(a,b,d||B.SELECTION_NEW,c)},_updateSelection:function(a){var b=a.mapPoint,c=a.graphic,d=this._settings.layerInfos,e;this._selectionHelper.selectFeaturesByGeometry(this._settings.layers,b,B.SELECTION_NEW,m.hitch(this,function(a){var f=n.some(a,m.hitch(this,function(a){return a==c}));if(c&&!f)if(f=c.getLayer(),this._isValidLayer(f)){var g=
new y;g.objectIds=[c.attributes[f.objectIdField]];this._selectionHelper.selectFeatures([f],g,B.SELECTION_ADD,m.hitch(this,function(c){c&&c.length&&(c=c.concat(a),e=C.sortFeaturesById(d,c),this._updatePopupButtons(e),this._onEditFeature(e,b))}))}else a&&a.length?(e=C.sortFeaturesById(d,a),this._updatePopupButtons(e),this._onEditFeature(e,b)):this._clearSelection();else a&&a.length?(e=C.sortFeaturesById(d,a),this._updatePopupButtons(e),this._onEditFeature(e,b)):this._clearSelection()}));c&&this._isTextSymbolPoint(c)&&
this._isValidLayer(c.getLayer())&&this.editToolbar.activate(0|z.MOVE|z.ROTATE|z.SCALE|z.EDIT_TEXT,c)},_updatePopupButtons:function(a){if(this._usePopup&&a){var b=a.length;n.forEach([this._settings.map.infoWindow._prevFeatureButton,this._settings.map.infoWindow._nextFeatureButton],m.hitch(this,function(a){1<b?h.remove(a,"hidden"):h.add(a,"hidden")}));var c=1<b?"block":"none";f.query(".esriAttributeInspector .atiLayerName").style({display:c});this._currentFeatureCount=b;this._popupFeatures=a}else this._currentFeatureCount=
this._popupFeatures=null},_clearSelection:function(a){this._currentFeatureCount=0;this._popupFeatures=null;this._selectionHelper.clearSelection(a||!1);this._reset()},_findCenterPoint:function(a){a=a.geometry||a;var b;switch(a.type){case "point":b=a;break;case "polyline":b=a.getPoint(0,Math.ceil(a.paths[0].length/2));break;case "polygon":b=a.rings.length-1,b=a.getPoint(b,a.rings[b].length-1)}return this._settings.map.toScreen(b)},_hideAttributeInspector:function(){!this._customAttributeInspector&&
this._settings.map.infoWindow&&this._settings.map.infoWindow.hide()},_toPolylines:function(a){return n.map(a,function(a){var b=new u(a.spatialReference);n.forEach(a.rings,function(a){b.addPath(a)});return b})},_isNotesFeature:function(a){var b=a.getLayer(),c=b?b.types||null:null;if(!c)return!1;var d=a.attributes[b.typeIdField],e;n.some(c,function(a){return a.id===d?(e=a.templates,!0):!1});return e?(a=e[0]||null)?this._isShapeTool(a.drawingTool)?!0:!1:!1:!1},_isValidLayer:function(a){var b,c=this._settings.layerInfos;
for(b=0;b<c.length;b++){var d=c[b];if(a.id==(d.featureLayer?d.featureLayer.id:d.layerId))return!0}return!1},_isShapeTool:function(a){switch(a){case x.TOOL_ARROW:return w.ARROW;case x.TOOL_LEFT_ARROW:return w.LEFT_ARROW;case x.TOOL_RIGHT_ARROW:return w.RIGHT_ARROW;case x.TOOL_UP_ARROW:return w.UP_ARROW;case x.TOOL_DOWN_ARROW:return w.DOWN_ARROW;case x.TOOL_CIRCLE:return w.CIRCLE;case x.TOOL_ELLIPSE:return w.ELLIPSE;case x.TOOL_TRIANGLE:return w.TRIANGLE;case x.TOOL_RECTANGLE:return w.RECTANGLE;default:return null}},
_toDrawTool:function(a,b){var c=b.geometryType;switch(a){case x.TOOL_POINT:return w.POINT;case x.TOOL_ARROW:return w.ARROW;case x.TOOL_LEFT_ARROW:return w.LEFT_ARROW;case x.TOOL_RIGHT_ARROW:return w.RIGHT_ARROW;case x.TOOL_UP_ARROW:return w.UP_ARROW;case x.TOOL_DOWN_ARROW:return w.DOWN_ARROW;case x.TOOL_CIRCLE:return w.CIRCLE;case x.TOOL_ELLIPSE:return w.ELLIPSE;case x.TOOL_TRIANGLE:return w.TRIANGLE;case x.TOOL_RECTANGLE:return w.RECTANGLE;case x.TOOL_LINE:return w.POLYLINE;case x.TOOL_POLYGON:return w.POLYGON;
case x.TOOL_FREEHAND:return"esriGeometryPolyline"===c?w.FREEHAND_POLYLINE:w.FREEHAND_POLYGON;default:var d=w.POINT;"esriGeometryPolyline"===c?(d=w.POLYLINE,this._settings.createOptions.polylineDrawTools[0]===J.CREATE_TOOL_FREEHAND_POLYLINE&&(d=w.FREEHAND_POLYLINE)):"esriGeometryPolygon"===c&&(d=w.POLYGON,this._settings.createOptions.polygonDrawTools[0]===J.CREATE_TOOL_FREEHAND_POLYGON&&(d=w.FREEHAND_POLYGON));return d}},_isModified:function(){var a=this.editToolbar.getCurrentState();return(a.isModified||
this._attributeChanged)&&a.graphic?a.graphic:null},_showInfoWindow:function(a,b){this._customAttributeInspector||this._settings.map.infoWindow.show(a,b)}});m.mixin(J,{CREATE_TOOL_POLYLINE:"polyline",CREATE_TOOL_FREEHAND_POLYLINE:"freehandpolyline",CREATE_TOOL_POLYGON:"polygon",CREATE_TOOL_FREEHAND_POLYGON:"freehandpolygon",CREATE_TOOL_AUTOCOMPLETE:"autocomplete",CREATE_TOOL_RECTANGLE:"rectangle",CREATE_TOOL_TRIANGLE:"triangle",CREATE_TOOL_CIRCLE:"circle",CREATE_TOOL_ELLIPSE:"ellipse",CREATE_TOOL_ARROW:"arrow",
CREATE_TOOL_UP_ARROW:"uparrow",CREATE_TOOL_DOWN_ARROW:"downarrow",CREATE_TOOL_RIGHT_ARROW:"rightarrow",CREATE_TOOL_LEFT_ARROW:"leftarrow"});e("extend-esri")&&m.setObject("dijit.editing.Editor",J,V);return J});