// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
define("dojo/_base/lang dojo/on dojo/query dojo/_base/array dojo/_base/html dojo/keys dijit/a11yclick".split(" "),function(e,f,m,n,h,d,p){return{a11y_init:function(){h.setAttr(this.speedLabelNode,"role","button");h.setAttr(this.speedLabelNode,"aria-label",this.nls.speed)},a11y_setAriaLabel:function(a,b){h.setAttr(a,"aria-label",b)},a11y_focusOnSelectedItem:function(){var a=m(".check:not(.hide)",this.speedMenu)[0],b;a&&(a.parentElement||a.parentNode)&&(b=a.parentElement||a.parentNode);b&&b.focus&&
b.focus()},a11y_initEvents:function(){var a=m('[tabindex $\x3d"0"]',this.speedMenu);a&&(this.a11y_firstNode=a[0],this.a11y_lastNode=a[a.length-1]);this.own(f(this.speedLabelNode,p,e.hitch(this,function(b){this._onSpeedLabelClick(b)})));this.own(f(this.speedMenu,"keydown",e.hitch(this,function(b){b.keyCode===d.ESCAPE&&(b.stopPropagation(),b.preventDefault(),this._closeSpeedMenu(),this.speedLabelNode.focus())})));a&&a.length&&(this.a11y_firstNode=a[0],this.a11y_lastNode=a[length-1],n.forEach(a,e.hitch(this,
function(b,g){var k=0===g?a[a.length-1]:a[g-1];this.own(f(b,"keydown",e.hitch(this,function(c){c.stopPropagation();c.preventDefault();c.keyCode===d.UP_ARROW&&k&&k.focus&&k.focus()})));var l=g===a.length-1?a[0]:a[g+1];this.own(f(b,"keydown",e.hitch(this,function(c){c.stopPropagation();c.preventDefault();(c.keyCode===d.DOWN_ARROW||c.keyCode===d.TAB)&&l&&l.focus&&l.focus()})));this.own(f(b,"keydown",e.hitch(this,function(c){c.stopPropagation();c.preventDefault();if(c.keyCode===d.ENTER||c.keyCode===d.SPACE)f.emit(b,
"click",{cancelable:!1,bubbles:!0}),this.speedLabelNode.focus();c.keyCode===d.ESCAPE&&(this._closeSpeedMenu(),this.speedLabelNode.focus())})))})))}}});