// 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/_base/html dojo/dom-attr dojo/dom-construct dojo/query dojo/on dojo/keys dijit/a11yclick jimu/utils".split(" "),function(k,d,e,p,n,l,f,q,m){return{a11y_initFirstFocusNode:function(){m.initFirstFocusNode(this.domNode,this.toolsSection)},a11y_initLastFocusNode:function(){var a=n(".tools-table-item",this.toolsTbody);(a=a[a.length-1])&&m.initLastFocusNode(this.domNode,a)},a11y_addTool:function(a,b,c){var h=m.getUUID();e.set(a,"role","button");e.set(a,"tabindex","0");var g=
"jimuUniq_name_"+h;e.set(b,"id",g);!0===c?e.set(a,"aria-labelledby",g):(b="jimuUniq_tip_"+h,p.create("div",{id:b,"class":"icon-section screen-readers-only",innerHTML:this.nls.toolNotAvailable},a),e.set(a,"aria-disabled","true"),e.set(a,"aria-labelledby",g+" "+b))},a11y_analysisTool_backBtn:function(a,b){e.set(a,"role","button");e.set(a,"tabindex","0");this.currentAnalysisDijit.own(l(a,"keydown",k.hitch(this,function(c){c.keyCode===f.TAB&&(c.preventDefault(),c.shiftKey?this.toolPanel.focus():("none"!==
d.getStyle(b,"display")?b:this.toolPanel).focus())})))},a11y_analysisTool_submitBtn:function(a,b){if("none"!==d.getStyle(b,"display")){var c=n('[role\x3d"button"]',b)[0],h=d.getAttr(c,"aria-labelledby");d.setAttr(b,"aria-labelledby",h);d.setAttr(b,"tabindex","0");d.setAttr(b,"role","button");this.currentAnalysisDijit.own(l(b,q,k.hitch(this,function(){c.click()})));this.currentAnalysisDijit.own(l(b,"keydown",k.hitch(this,function(g){g.keyCode===f.TAB&&(g.preventDefault(),g.shiftKey?(a?a:this.toolPanel).focus():
this.toolPanel.focus())})))}else b=a?a:this.toolPanel;1===this.toolCountInList&&(m.initFirstFocusNode(this.domNode,this.toolPanel),m.initLastFocusNode(this.domNode,b))},a11y_analysisTool_toolPanel:function(a,b){this.own(l(this.toolPanel,"keydown",k.hitch(this,function(c){if(c.keyCode===f.ESCAPE&&a)c.stopPropagation(),a.focus();else if(d.hasClass(c.target,"tool-panel")&&c.keyCode===f.TAB){c.preventDefault();var h="none"!==d.getStyle(b,"display")?b:null,g;c.shiftKey?g=h||a||this.toolPanel:c.shiftKey||
(g=a||h||this.toolPanel);g.focus()}})))},a11y_updateTitleForMsgDom:function(a,b){var c=d.getAttr(this.toolTitle,"id"),h=d.getAttr(this.messageStatusNode,"id");c=[c,h];a===b.STATUS_SUCCEEDED&&c.push(d.getAttr(this.outputtip,"id"));d.setAttr(this.messagePanel,"aria-labelledby",c.join(" "))},a11y_addAttrsAndEventForCancelBtn:function(a){e.set(a,"role","button");e.set(a,"tabindex","0");this.own(l(a,"keydown",k.hitch(this,function(b){b.shiftKey||b.keyCode!==f.TAB||(b.preventDefault(),this.messagePanel.focus())})))},
a11y_addAttrsForOutputLink:function(a){e.set(a,"role","link")},a11y_addAttrsForExportNode:function(a){e.set(a,"role","button");e.set(a,"aria-haspopup","true");e.set(a,"aria-label",this.nls.action);e.set(a,"tabindex","0")},a11y_addMessagePanelEvent:function(){this.own(l(this.messagePanel,"keydown",k.hitch(this,function(a){if(a.keyCode===f.ESCAPE)a.stopPropagation(),"none"!==d.getStyle(this.buttonSection,"display")&&this.backBtn.focus();else if(d.hasClass(a.target,"message-panel")&&a.keyCode===f.TAB){var b=
n(".job-cancel-icon",this.messageSection)[0]||("none"!==d.getStyle(this.buttonSection,"display")?this.homeBtn:null);b?a.shiftKey&&(a.preventDefault(),b.focus()):a.preventDefault()}})))},a11y_switchToPrevious:function(a){a.keyCode!==f.ENTER&&a.keyCode!==f.SPACE||this._switchToPrevious()},a11y_switchToHome:function(a){a.keyCode===f.ENTER||a.keyCode===f.SPACE?this._switchToHome():a.shiftKey||a.keyCode!==f.TAB||(a.preventDefault(),this.messagePanel.focus())},a11y_switchView_toolList:function(){1===this.toolCountInList?
this.toolPanel.focus():this.toolsSection.focus()},a11y_switchView_others:function(a,b){a===b?this.toolPanel.focus():this.messagePanel.focus()}}});