//>>built
define("dijit/_MenuBase","dojo/_base/array,dojo/_base/declare,dojo/dom,dojo/dom-attr,dojo/dom-class,dojo/_base/lang,dojo/mouse,dojo/on,dojo/window,./a11yclick,./popup,./registry,./_Widget,./_KeyNavContainer,./_TemplatedMixin".split(","),function(j,k,q,l,h,f,i,e,r,m,g,c,n,o,p){return k("dijit._MenuBase",[n,p,o],{parentMenu:null,popupDelay:500,autoFocus:!1,childSelector:function(a){var b=c.byNode(a);return a.parentNode==this.containerNode&&b&&b.focus},postCreate:function(){var a=this,b="string"==typeof this.childSelector?
this.childSelector:f.hitch(this,"childSelector");this.own(e(this.containerNode,e.selector(b,i.enter),function(){a.onItemHover(c.byNode(this))}),e(this.containerNode,e.selector(b,i.leave),function(){a.onItemUnhover(c.byNode(this))}),e(this.containerNode,e.selector(b,m),function(b){a.onItemClick(c.byNode(this),b);b.stopPropagation();b.preventDefault()}));this.inherited(arguments)},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(){if(this.currentPopup&&this.currentPopup._pendingClose_timer){var a=this.currentPopup.parentMenu;a.focusedChild&&a.focusedChild._setSelected(!1);a.focusedChild=this.currentPopup.from_item;a.focusedChild._setSelected(!0);this._stopPendingCloseTimer(this.currentPopup)}},onItemHover:function(a){if(this.isActive&&(this.focusChild(a),this.focusedChild.popup&&!this.focusedChild.disabled&&!this.hover_timer))this.hover_timer=
this.defer("_openPopup",this.popupDelay);this.focusedChild&&this.focusChild(a);this._hoveredChild=a;a._set("hovering",!0)},_onChildBlur:function(a){this._stopPopupTimer();a._setSelected(!1);var b=a.popup;if(b)this._stopPendingCloseTimer(b),b._pendingClose_timer=this.defer(function(){b._pendingClose_timer=null;if(b.parentMenu)b.parentMenu.currentPopup=null;g.close(b)},this.popupDelay)},onItemUnhover:function(a){this.isActive&&this._stopPopupTimer();if(this._hoveredChild==a)this._hoveredChild=null;
a._set("hovering",!1)},_stopPopupTimer:function(){if(this.hover_timer)this.hover_timer=this.hover_timer.remove()},_stopPendingCloseTimer:function(a){if(a._pendingClose_timer)a._pendingClose_timer=a._pendingClose_timer.remove()},_stopFocusTimer:function(){if(this._focus_timer)this._focus_timer=this._focus_timer.remove()},_getTopMenu:function(){for(var a=this;a.parentMenu;a=a.parentMenu);return a},onItemClick:function(a,b){"undefined"==typeof this.isShowingNow&&this._markActive();this.focusChild(a);
if(a.disabled)return!1;a.popup?this._openPopup("keypress"==b.type):(this.onExecute(),a._onClick?a._onClick(b):a.onClick(b))},_openPopup:function(a){this._stopPopupTimer();var b=this.focusedChild;if(b){var d=b.popup;if(!d.isShowingNow){this.currentPopup&&(this._stopPendingCloseTimer(this.currentPopup),g.close(this.currentPopup));d.parentMenu=this;d.from_item=b;var c=this;g.open({parent:this,popup:d,around:b.domNode,orient:this._orient||["after","before"],onCancel:function(){c.focusChild(b);c._cleanUp();
b._setSelected(!0);c.focusedChild=b},onExecute:f.hitch(this,"_cleanUp")});this.currentPopup=d;this.popupHoverHandle&&this.popupHoverHandle.remove();this.own(this.popupHoverHandle=e.once(d.domNode,"mouseover",f.hitch(c,"_onPopupHover")))}if(a&&d.focus)d._focus_timer=this.defer(f.hitch(d,function(){this._focus_timer=null;this.focus()}))}},_markActive:function(){this.isActive=!0;h.replace(this.domNode,"dijitMenuActive","dijitMenuPassive")},onOpen:function(){this.isShowingNow=!0;this._markActive()},_markInactive:function(){this.isActive=
!1;h.replace(this.domNode,"dijitMenuPassive","dijitMenuActive")},onClose:function(){this._stopFocusTimer();this._markInactive();this.isShowingNow=!1;this.parentMenu=null},_closeChild:function(){this._stopPopupTimer();if(this.currentPopup)0<=j.indexOf(this._focusManager.activeStack,this.id)&&(l.set(this.focusedChild.focusNode,"tabIndex",this.tabIndex),this.focusedChild.focusNode.focus()),g.close(this.currentPopup),this.currentPopup=null;if(this.focusedChild)this.focusedChild._setSelected(!1),this.onItemUnhover(this.focusedChild),
this.focusedChild=null},_onItemFocus:function(a){if(this._hoveredChild&&this._hoveredChild!=a)this.onItemUnhover(this._hoveredChild)},_onBlur:function(){this._cleanUp();this.inherited(arguments)},_cleanUp:function(){this._closeChild();"undefined"==typeof this.isShowingNow&&this._markInactive()}})});