// 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/declare dijit/_WidgetBase dojo/_base/lang dojo/_base/html dojo/on dojo/keys dojo/Evented".split(" "),function(g,h,c,a,d,e,k){return g([h,k],{baseClass:"jimu-toggle-button",declaredClass:"jimu.dijit.ToggleButton",checked:!1,postCreate:function(){var b=this.toggleTips?this.toggleTips:window.jimuNls.toggleButton;this.toggleTips={"true":b.toggleOn,"false":b.toggleOff};a.setAttr(this.domNode,"role","button");a.setAttr(this.domNode,"tabindex","0");this._setDomNodeAttrs();this.innerNode=
a.create("div",{"class":"inner"},this.domNode);this.checked&&a.addClass(this.domNode,"checked");this.own(d(this.domNode,"click",c.hitch(this,function(){this.toggle()})));this.own(d(this.domNode,"keydown",c.hitch(this,function(f){f.keyCode!==e.ENTER&&f.keyCode!==e.SPACE||this.toggle()})))},_setDomNodeAttrs:function(){a.setAttr(this.domNode,"aria-label",this.toggleTips[!this.checked+""]);a.setAttr(this.domNode,"aria-pressed",this.checked+"")},resetToggleTips:function(b){this.toggleTips={"true":b.toggleOn,
"false":b.toggleOff};this._setDomNodeAttrs()},check:function(){this.checked=!0;a.addClass(this.domNode,"checked");this._setDomNodeAttrs();this.emit("change",this.checked)},uncheck:function(){this.checked=!1;a.removeClass(this.domNode,"checked");this._setDomNodeAttrs();this.emit("change",this.checked)},toggle:function(){this.checked?this.uncheck():this.check()},setValue:function(b){this.checked!==b&&this.toggle()}})});