// 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:{"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(p,f,k,l,m,x,r,v,n,c,e,q,a,A,h,z,g,t,u,D,E,F,y){function B(b){return function(d){v[d?
"set":"remove"](this.domNode,b,d);this._set(b,d)}}a.add("dijit-legacy-requires",!A.isAsync);a.add("dojo-bidi",!1);a("dijit-legacy-requires")&&g(0,function(){p(["dijit/_base/manager"])});var C={};l=x("dijit._WidgetBase",[t,E],{id:"",_setIdAttr:"domNode",lang:"",_setLangAttr:B("lang"),dir:"",_setDirAttr:B("dir"),"class":"",_setClassAttr:{node:"domNode",type:"class"},_setTypeAttr:null,style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,ownerDocument:null,_setOwnerDocumentAttr:function(b){this._set("ownerDocument",
b)},attributeMap:{},_blankGif:l.blankGif||p.toUrl("dojo/resources/blank.gif"),textDir:"",_introspect:function(){var b=this.constructor;if(!b._setterAttrs){var d=b.prototype,w=b._setterAttrs=[],b=b._onMap={},a;for(a in d.attributeMap)w.push(a);for(a in d)/^on/.test(a)&&(b[a.substring(2).toLowerCase()]=a),/^_set[A-Z](.*)Attr$/.test(a)&&(a=a.charAt(4).toLowerCase()+a.substr(5,a.length-9),d.attributeMap&&a in d.attributeMap||w.push(a))}},postscript:function(b,d){this.create(b,d)},create:function(b,d){this._introspect();
this.srcNodeRef=r.byId(d);this._connects=[];this._supportingWidgets=[];this.srcNodeRef&&this.srcNodeRef.id&&"string"==typeof this.srcNodeRef.id&&(this.id=this.srcNodeRef.id);b&&(this.params=b,h.mixin(this,b));this.postMixInProperties();this.id||(this.id=y.getUniqueId(this.declaredClass.replace(/\./g,"_")),this.params&&delete this.params.id);this.ownerDocument=this.ownerDocument||(this.srcNodeRef?this.srcNodeRef.ownerDocument:document);this.ownerDocumentBody=D.body(this.ownerDocument);y.add(this);
this.buildRendering();var a;if(this.domNode){this._applyAttributes();var c=this.srcNodeRef;c&&c.parentNode&&this.domNode!==c&&(c.parentNode.replaceChild(this.domNode,c),a=!0);this.domNode.setAttribute("widgetId",this.id)}this.postCreate();a&&delete this.srcNodeRef;this._created=!0},_applyAttributes:function(){var b={},d;for(d in this.params||{})b[d]=this._get(d);f.forEach(this.constructor._setterAttrs,function(d){if(!(d in b)){var a=this._get(d);a&&this.set(d,a)}},this);for(d in b)this.set(d,b[d])},
postMixInProperties:function(){},buildRendering:function(){this.domNode||(this.domNode=this.srcNodeRef||this.ownerDocument.createElement("div"));if(this.baseClass){var b=this.baseClass.split(" ");this.isLeftToRight()||(b=b.concat(f.map(b,function(b){return b+"Rtl"})));n.add(this.domNode,b)}},postCreate:function(){},startup:function(){this._started||(this._started=!0,f.forEach(this.getChildren(),function(b){b._started||b._destroyed||!h.isFunction(b.startup)||(b.startup(),b._started=!0)}))},destroyRecursive:function(b){this._beingDestroyed=
!0;this.destroyDescendants(b);this.destroy(b)},destroy:function(b){function d(d){d.destroyRecursive?d.destroyRecursive(b):d.destroy&&d.destroy(b)}this._beingDestroyed=!0;this.uninitialize();f.forEach(this._connects,h.hitch(this,"disconnect"));f.forEach(this._supportingWidgets,d);this.domNode&&f.forEach(y.findWidgets(this.domNode,this.containerNode),d);this.destroyRendering(b);y.remove(this.id);this._destroyed=!0},destroyRendering:function(b){this.bgIframe&&(this.bgIframe.destroy(b),delete this.bgIframe);
this.domNode&&(b?v.remove(this.domNode,"widgetId"):c.destroy(this.domNode),delete this.domNode);this.srcNodeRef&&(b||c.destroy(this.srcNodeRef),delete this.srcNodeRef)},destroyDescendants:function(b){f.forEach(this.getChildren(),function(d){d.destroyRecursive&&d.destroyRecursive(b)})},uninitialize:function(){return!1},_setStyleAttr:function(b){var d=this.domNode;h.isObject(b)?q.set(d,b):d.style.cssText=d.style.cssText?d.style.cssText+("; "+b):b;this._set("style",b)},_attrToDom:function(b,d,a){a=3<=
arguments.length?a:this.attributeMap[b];f.forEach(h.isArray(a)?a:[a],function(a){var w=this[a.node||a||"domNode"];switch(a.type||"attribute"){case "attribute":h.isFunction(d)&&(d=h.hitch(this,d));a=a.attribute?a.attribute:/^on[A-Z][a-zA-Z]*$/.test(b)?b.toLowerCase():b;w.tagName?v.set(w,a,d):w.set(a,d);break;case "innerText":w.innerHTML="";w.appendChild(this.ownerDocument.createTextNode(d));break;case "innerHTML":w.innerHTML=d;break;case "class":n.replace(w,d,this[b]);break;case "toggleClass":n.toggle(w,
a.className||b,d)}},this)},get:function(b){var d=this._getAttrNames(b);return this[d.g]?this[d.g]():this._get(b)},set:function(b,d){if("object"===typeof b){for(var a in b)this.set(a,b[a]);return this}a=this._getAttrNames(b);var c=this[a.s];if(h.isFunction(c))var g=c.apply(this,Array.prototype.slice.call(arguments,1));else{var c=this.focusNode&&!h.isFunction(this.focusNode)?"focusNode":"domNode",q=this[c]&&this[c].tagName,e;if((e=q)&&!(e=C[q])){e=this[c];var u={},t;for(t in e)u[t.toLowerCase()]=!0;
e=C[q]=u}t=e;a=b in this.attributeMap?this.attributeMap[b]:a.s in this?this[a.s]:t&&a.l in t&&"function"!=typeof d||/^aria-|^data-|^role$/.test(b)?c:null;null!=a&&this._attrToDom(b,d,a);this._set(b,d)}return g||this},_attrPairNames:{},_getAttrNames:function(b){var a=this._attrPairNames;if(a[b])return a[b];var c=b.replace(/^[a-z]|-[a-zA-Z]/g,function(a){return a.charAt(a.length-1).toUpperCase()});return a[b]={n:b+"Node",s:"_set"+c+"Attr",g:"_get"+c+"Attr",l:c.toLowerCase()}},_set:function(a,d){var b=
this[a];this[a]=d;!this._created||b===d||b!==b&&d!==d||(this._watchCallbacks&&this._watchCallbacks(a,b,d),this.emit("attrmodified-"+a,{detail:{prevValue:b,newValue:d}}))},_get:function(a){return this[a]},emit:function(a,d,c){d=d||{};void 0===d.bubbles&&(d.bubbles=!0);void 0===d.cancelable&&(d.cancelable=!0);d.detail||(d.detail={});d.detail.widget=this;var b,g=this["on"+a];g&&(b=g.apply(this,c?c:[d]));this._started&&!this._beingDestroyed&&z.emit(this.domNode,a.toLowerCase(),d);return b},on:function(a,
d){var b=this._onMap(a);return b?k.after(this,b,d,!0):this.own(z(this.domNode,a,d))[0]},_onMap:function(a){var b=this.constructor,c=b._onMap;if(!c){var c=b._onMap={},g;for(g in b.prototype)/^on/.test(g)&&(c[g.replace(/^on/,"").toLowerCase()]=g)}return c["string"==typeof a&&a.toLowerCase()]},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getChildren:function(){return this.containerNode?y.findWidgets(this.containerNode):[]},getParent:function(){return y.getEnclosingWidget(this.domNode.parentNode)},
connect:function(a,d,c){return this.own(m.connect(a,d,this,c))[0]},disconnect:function(a){a.remove()},subscribe:function(a,d){return this.own(u.subscribe(a,h.hitch(this,d)))[0]},unsubscribe:function(a){a.remove()},isLeftToRight:function(){return this.dir?"ltr"==this.dir.toLowerCase():e.isBodyLtr(this.ownerDocument)},isFocusable:function(){return this.focus&&"none"!=q.get(this.domNode,"display")},placeAt:function(a,d){var b=!a.tagName&&y.byId(a);!b||!b.addChild||d&&"number"!==typeof d?(b=b&&"domNode"in
b?b.containerNode&&!/after|before|replace/.test(d||"")?b.containerNode:b.domNode:r.byId(a,this.ownerDocument),c.place(this.domNode,b,d),!this._started&&(this.getParent()||{})._started&&this.startup()):b.addChild(this,d);return this},defer:function(a,d){var b=setTimeout(h.hitch(this,function(){b&&(b=null,this._destroyed||h.hitch(this,a)())}),d||0);return{remove:function(){b&&(clearTimeout(b),b=null);return null}}}});a("dojo-bidi")&&l.extend(F);return l})},"dijit/Destroyable":function(){define(["dojo/_base/array",
"dojo/aspect","dojo/_base/declare"],function(p,f,k){return k("dijit.Destroyable",null,{destroy:function(f){this._destroyed=!0},own:function(){var l=["destroyRecursive","destroy","remove"];p.forEach(arguments,function(m){function k(){v.remove();p.forEach(n,function(c){c.remove()})}var r,v=f.before(this,"destroy",function(c){m[r](c)}),n=[];m.then?(r="cancel",m.then(k,k)):p.forEach(l,function(c){"function"===typeof m[c]&&(r||(r=c),n.push(f.after(m,c,k,!0)))})},this);return arguments}})})},"dijit/_TemplatedMixin":function(){define("dojo/cache dojo/_base/declare dojo/dom-construct dojo/_base/lang dojo/on dojo/sniff dojo/string ./_AttachMixin".split(" "),
function(p,f,k,l,m,x,r,v){var n=f("dijit._TemplatedMixin",v,{templateString:null,templatePath:null,_skipNodeCache:!1,searchContainerNode:!0,_stringRepl:function(c){var e=this.declaredClass,q=this;return r.substitute(c,this,function(a,c){"!"==c.charAt(0)&&(a=l.getObject(c.substr(1),!1,q));if("undefined"==typeof a)throw Error(e+" template:"+c);return null==a?"":"!"==c.charAt(0)?a:this._escapeValue(""+a)},this)},_escapeValue:function(c){return c.replace(/["'<>&]/g,function(c){return{"\x26":"\x26amp;",
"\x3c":"\x26lt;","\x3e":"\x26gt;",'"':"\x26quot;","'":"\x26#x27;"}[c]})},buildRendering:function(){if(!this._rendered){this.templateString||(this.templateString=p(this.templatePath,{sanitize:!0}));var c=n.getCachedTemplate(this.templateString,this._skipNodeCache,this.ownerDocument),e;if(l.isString(c)){if(e=k.toDom(this._stringRepl(c),this.ownerDocument),1!=e.nodeType)throw Error("Invalid template: "+c);}else e=c.cloneNode(!0);this.domNode=e}this.inherited(arguments);this._rendered||this._fillContent(this.srcNodeRef);
this._rendered=!0},_fillContent:function(c){var e=this.containerNode;if(c&&e)for(;c.hasChildNodes();)e.appendChild(c.firstChild)}});n._templateCache={};n.getCachedTemplate=function(c,e,q){var a=n._templateCache,f=c,h=a[f];if(h){try{if(!h.ownerDocument||h.ownerDocument==(q||document))return h}catch(z){}k.destroy(h)}c=r.trim(c);if(e||c.match(/\$\{([^\}]+)\}/g))return a[f]=c;e=k.toDom(c,q);if(1!=e.nodeType)throw Error("Invalid template: "+c);return a[f]=e};x("ie")&&m(window,"unload",function(){var c=
n._templateCache,e;for(e in c){var q=c[e];"object"==typeof q&&k.destroy(q);delete c[e]}});return n})},"dojo/cache":function(){define(["./_base/kernel","./text"],function(p){return p.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(p,f,k,l,m,x,r,v,n){var c=m.delegate(v,{mouseenter:x.enter,mouseleave:x.leave,keypress:k._keypress}),e;k=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(c){for(var a=c;;)if(1==a.nodeType&&(this._processTemplateNode(a,function(a,c){return a.getAttribute(c)},this._attach)||this.searchContainerNode)&&a.firstChild)a=a.firstChild;else{if(a==c)break;for(;!a.nextSibling;)if(a=a.parentNode,a==c)return;a=
a.nextSibling}},_processTemplateNode:function(c,a,e){var h=!0,f=this.attachScope||this,g=a(c,"dojoAttachPoint")||a(c,"data-dojo-attach-point");if(g)for(var t=g.split(/\s*,\s*/);g=t.shift();)m.isArray(f[g])?f[g].push(c):f[g]=c,h="containerNode"!=g,this._attachPoints.push(g);if(a=a(c,"dojoAttachEvent")||a(c,"data-dojo-attach-event"))for(g=a.split(/\s*,\s*/),t=m.trim;a=g.shift();)if(a){var u=null;-1!=a.indexOf(":")?(u=a.split(":"),a=t(u[0]),u=t(u[1])):a=t(a);u||(u=a);this._attachEvents.push(e(c,a,m.hitch(f,
u)))}return h},_attach:function(f,a,k){a=a.replace(/^on/,"").toLowerCase();a="dijitclick"==a?e||(e=p("./a11yclick")):c[a]||a;return r(f,a,k)},_detachTemplateNodes:function(){var c=this.attachScope||this;f.forEach(this._attachPoints,function(a){delete c[a]});this._attachPoints=[];f.forEach(this._attachEvents,function(a){a.remove()});this._attachEvents=[]},destroyRendering:function(){this._detachTemplateNodes();this.inherited(arguments)}});m.extend(n,{dojoAttachEvent:"",dojoAttachPoint:""});return k})},
"url:esri/dijit/templates/BasemapToggle.html":'\x3cdiv class\x3d"${theme}" role\x3d"presentation" style\x3d"display:none;"\x3e\r\n    \x3cdiv class\x3d"${_css.container}"\x3e\r\n        \x3cdiv data-dojo-attach-point\x3d"_toggleNode" title\x3d"${_i18n.widgets.basemapToggle.toggle}" role\x3d"button" class\x3d"${_css.toggleButton}" tabindex\x3d"0"\x3e\x3c/div\x3e\r\n    \x3c/div\x3e\r\n\x3c/div\x3e',"*noref":1}});
define("esri/dijit/BasemapToggle","require dojo/Evented dojo/_base/declare dojo/_base/lang dojo/has ../kernel dijit/_WidgetBase dijit/a11yclick dijit/_TemplatedMixin dojo/on dojo/text!./templates/BasemapToggle.html dojo/i18n!../nls/jsapi dojo/dom-class dojo/dom-style dojo/dom-construct ../basemaps".split(" "),function(p,f,k,l,m,x,r,v,n,c,e,q,a,A,h,z){p=k("esri.dijit.BasemapToggle",[r,n,f],{templateString:e,options:{theme:"BasemapToggle",map:null,visible:!0,basemap:"hybrid",defaultBasemap:"streets",
basemaps:z},constructor:function(a,c){var g=l.mixin({},this.options,a);this.domNode=c;this._i18n=q;this.set("map",g.map);this.set("theme",g.theme);this.set("visible",g.visible);this.set("basemaps",g.basemaps);this.set("basemap",g.basemap);this.set("defaultBasemap",g.defaultBasemap);this.watch("theme",this._updateThemeWatch);this.watch("visible",this._visible);this._css={container:"basemapContainer",toggleButton:"toggleButton",basemapImage:"basemapImage",basemapImageContainer:"basemapImageContainer",
basemapImageBG:"basemapBG",basemapTitle:"basemapTitle"}},postCreate:function(){this.inherited(arguments);this.own(c(this._toggleNode,v,l.hitch(this,this.toggle)))},startup:function(){this.inherited(arguments);this.map||(this.destroy(),console.log("BasemapToggle::map required"));if(this.map.loaded)this._init();else c.once(this.map,"load",l.hitch(this,function(){this._init()}))},destroy:function(){this.inherited(arguments)},show:function(){this.set("visible",!0)},hide:function(){this.set("visible",
!1)},toggle:function(){var a=this.map.getBasemap();a&&this.set("defaultBasemap",a);var a=this.get("defaultBasemap"),c=this.get("basemap"),e={previousBasemap:a,currentBasemap:c};a!==c?(this.map.setBasemap(c),this.set("basemap",a),this._basemapChange()):e.error=Error("BasemapToggle::Current basemap is same as new basemap");this.emit("toggle",e)},_init:function(){this._visible();this._basemapChange();this.own(c(this.map,"basemap-change",l.hitch(this,function(){this._basemapChange()})));this.set("loaded",
!0);this.emit("load",{})},_getBasemapInfo:function(a){var c=this.get("basemaps");if(c&&c.hasOwnProperty(a))return c[a]},_updateImage:function(){var a=this.get("basemap"),a=this._getBasemapInfo(a),c=a.thumbnailUrl,e;e=""+('\x3cdiv class\x3d"'+this._css.basemapImageContainer+'"\x3e');e+='\x3cdiv class\x3d"'+this._css.basemapImage+'"\x3e\x3cdiv class\x3d"'+this._css.basemapImageBG+'" style\x3d"background-image:url('+c+')" title\x3d"'+a.title+'"\x3e\x3c/div\x3e\x3c/div\x3e';e+='\x3cdiv title\x3d"'+a.title+
'" class\x3d"'+this._css.basemapTitle+'"\x3e'+a.title+"\x3c/div\x3e";e+="\x3cdiv\x3e";h.empty(this._toggleNode);h.place(e,this._toggleNode,"only")},_basemapChange:function(){var c=this.map.getBasemap();c&&this.set("defaultBasemap",c);var c=this.get("defaultBasemap"),e=this.get("basemap");this._updateImage();a.remove(this._toggleNode,c);a.add(this._toggleNode,e)},_updateThemeWatch:function(c,e,f){this.get("loaded")&&(a.remove(this.domNode,e),a.add(this.domNode,f))},_visible:function(){this.get("visible")?
A.set(this.domNode,"display","block"):A.set(this.domNode,"display","none")}});m("extend-esri")&&l.setObject("dijit.BasemapToggle",p,x);return p});