AUI.add("aui-state-interaction",function(F){var I=F.Lang,E=I.isBoolean,D=I.isString,G=F.ClassNameManager.getClassName,J="state",K=G(J,"default"),H=G(J,"hover"),C=G(J,"active");var B=F.Component.create({NAME:"stateinteraction",NS:"StateInteraction",ATTRS:{active:{value:false},activeState:{value:true,validator:E},bubbleTarget:{value:null},classNames:{value:{}},"default":{value:false},defaultState:{value:true,validator:E},hover:{value:false},hoverState:{value:true,validator:E},node:{value:null}},EXTENDS:F.Plugin.Base,constructor:function(A){var M=A.host;var L=M;if(F.Widget&&M instanceof F.Widget){L=M.get("contentBox");}A.node=L;B.superclass.constructor.apply(this,arguments);},prototype:{initializer:function(){var A=this;var M=A.get("classNames.active");var L=A.get("classNames.default");var N=A.get("classNames.hover");A._CSS_STATES={active:D(M)?M:C,"default":D(L)?L:K,hover:D(N)?N:H};if(A.get("defaultState")){A.get("node").addClass(A._CSS_STATES["default"]);}A._createEvents();A._attachInteractionEvents();},_attachInteractionEvents:function(){var A=this;var L=A.get("node");L.on("click",A._fireEvents,A);L.on("mouseenter",F.rbind(A._fireEvents,A,"mouseover"));L.on("mouseleave",F.rbind(A._fireEvents,A,"mouseout"));A.after("activeChange",A._uiSetState);A.after("hoverChange",A._uiSetState);A.after("defaultChange",A._uiSetState);},_fireEvents:function(N,M){var A=this;var L=A.get("bubbleTarget");M=M||N.type;if(L){L.fire(M);}return A.fire(M);},_createEvents:function(){var A=this;var L=A.get("bubbleTarget");if(L){A.addTarget(L);}A.publish("click",{defaultFn:A._defClickFn,emitFacade:true});A.publish("mouseout",{defaultFn:A._defMouseOutFn,emitFacade:true});A.publish("mouseover",{defaultFn:A._defMouseOverFn,emitFacade:true});},_defClickFn:function(L){var A=this;A.set("active",!A.get("active"));},_defMouseOutFn:function(){var A=this;A.set("hover",false);},_defMouseOverFn:function(){var A=this;A.set("hover",true);},_uiSetState:function(M){var A=this;var L=M.attrName;if(A.get(L+"State")){var N="addClass";if(!M.newVal){N="removeClass";}A.get("node")[N](A._CSS_STATES[L]);}}}});F.namespace("Plugin").StateInteraction=B;},"1.0.1",{skinnable:false,requires:["aui-base","plugin"]});