~ted/lazr-js/annoying-debug-message

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/event-custom/event-custom-min.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-08-23 19:48:21 UTC
  • mfrom: (173.2.15 yui-3.1.2)
  • Revision ID: launchpad@pqm.canonical.com-20100823194821-a1npffz5qodt3ejf
[r=beuno] Land YUI 3.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
3
Code licensed under the BSD License:
4
4
http://developer.yahoo.com/yui/license.html
5
 
version: 3.1.1
6
 
build: 47
 
5
version: 3.1.2
 
6
build: 56
7
7
*/
8
8
YUI.add("event-custom-base",function(E){E.Env.evt={handles:{},plugins:{}};(function(){var F=0,G=1;E.Do={objs:{},before:function(I,K,L,M){var J=I,H;if(M){H=[I,M].concat(E.Array(arguments,4,true));J=E.rbind.apply(E,H);}return this._inject(F,J,K,L);},after:function(I,K,L,M){var J=I,H;if(M){H=[I,M].concat(E.Array(arguments,4,true));J=E.rbind.apply(E,H);}return this._inject(G,J,K,L);},_inject:function(H,J,K,M){var N=E.stamp(K),L,I;if(!this.objs[N]){this.objs[N]={};}L=this.objs[N];if(!L[M]){L[M]=new E.Do.Method(K,M);K[M]=function(){return L[M].exec.apply(L[M],arguments);};}I=N+E.stamp(J)+M;L[M].register(I,J,H);return new E.EventHandle(L[M],I);},detach:function(H){if(H.detach){H.detach();}},_unload:function(I,H){}};E.Do.Method=function(H,I){this.obj=H;this.methodName=I;this.method=H[I];this.before={};this.after={};};E.Do.Method.prototype.register=function(I,J,H){if(H){this.after[I]=J;}else{this.before[I]=J;}};E.Do.Method.prototype._delete=function(H){delete this.before[H];delete this.after[H];};E.Do.Method.prototype.exec=function(){var J=E.Array(arguments,0,true),K,I,N,L=this.before,H=this.after,M=false;for(K in L){if(L.hasOwnProperty(K)){I=L[K].apply(this.obj,J);if(I){switch(I.constructor){case E.Do.Halt:return I.retVal;case E.Do.AlterArgs:J=I.newArgs;break;case E.Do.Prevent:M=true;break;default:}}}}if(!M){I=this.method.apply(this.obj,J);}for(K in H){if(H.hasOwnProperty(K)){N=H[K].apply(this.obj,J);if(N&&N.constructor==E.Do.Halt){return N.retVal;}else{if(N&&N.constructor==E.Do.AlterReturn){I=N.newRetVal;}}}}return I;};E.Do.AlterArgs=function(I,H){this.msg=I;this.newArgs=H;};E.Do.AlterReturn=function(I,H){this.msg=I;this.newRetVal=H;};E.Do.Halt=function(I,H){this.msg=I;this.retVal=H;};E.Do.Prevent=function(H){this.msg=H;};E.Do.Error=E.Do.Halt;})();var D="after",B=["broadcast","monitored","bubbles","context","contextFn","currentTarget","defaultFn","defaultTargetOnly","details","emitFacade","fireOnce","async","host","preventable","preventedFn","queuable","silent","stoppedFn","target","type"],C=9,A="yui:log";E.EventHandle=function(F,G){this.evt=F;this.sub=G;};E.EventHandle.prototype={detach:function(){var F=this.evt,H=0,G;if(F){if(E.Lang.isArray(F)){for(G=0;G<F.length;G++){H+=F[G].detach();}}else{F._delete(this.sub);H=1;}}return H;},monitor:function(F){return this.evt.monitor.apply(this.evt,arguments);}};E.CustomEvent=function(F,G){G=G||{};this.id=E.stamp(this);this.type=F;this.context=E;this.logSystem=(F==A);this.silent=this.logSystem;this.subscribers={};this.afters={};this.preventable=true;this.bubbles=true;this.signature=C;this.subCount=0;this.afterCount=0;this.applyConfig(G,true);};E.CustomEvent.prototype={hasSubs:function(F){var I=this.subCount,G=this.afterCount,H=this.sibling;if(H){I+=H.subCount;G+=H.afterCount;}if(F){return(F=="after")?G:I;}return(I+G);},monitor:function(H){this.monitored=true;var G=this.id+"|"+this.type+"_"+H,F=E.Array(arguments,0,true);F[0]=G;return this.host.on.apply(this.host,F);},getSubs:function(){var H=E.merge(this.subscribers),F=E.merge(this.afters),G=this.sibling;if(G){E.mix(H,G.subscribers);E.mix(F,G.afters);}return[H,F];},applyConfig:function(G,F){if(G){E.mix(this,G,F,B);}},_on:function(J,H,G,F){if(!J){this.log("Invalid callback for CE: "+this.type);}var I=new E.Subscriber(J,H,G,F);if(this.fireOnce&&this.fired){if(this.async){setTimeout(E.bind(this._notify,this,I,this.firedWith),0);}else{this._notify(I,this.firedWith);}}if(F==D){this.afters[I.id]=I;this.afterCount++;}else{this.subscribers[I.id]=I;this.subCount++;}return new E.EventHandle(this,I);},subscribe:function(H,G){var F=(arguments.length>2)?E.Array(arguments,2,true):null;return this._on(H,G,F,true);},on:function(H,G){var F=(arguments.length>2)?E.Array(arguments,2,true):null;this.host._monitor("attach",this.type,{args:arguments});return this._on(H,G,F,true);},after:function(H,G){var F=(arguments.length>2)?E.Array(arguments,2,true):null;return this._on(H,G,F,D);},detach:function(J,H){if(J&&J.detach){return J.detach();}var K=0,G=this.subscribers,F,I;for(F in G){if(G.hasOwnProperty(F)){I=G[F];if(I&&(!J||J===I.fn)){this._delete(I);K++;}}}return K;},unsubscribe:function(){return this.detach.apply(this,arguments);},_notify:function(I,H,F){this.log(this.type+"->"+"sub: "+I.id);var G;G=I.notify(H,this);if(false===G||this.stopped>1){this.log(this.type+" cancelled by subscriber");return false;}return true;},log:function(G,F){if(!this.silent){}},fire:function(){if(this.fireOnce&&this.fired){this.log("fireOnce event: "+this.type+" already fired");return true;}else{var F=E.Array(arguments,0,true);this.fired=true;this.firedWith=F;if(this.emitFacade){return this.fireComplex(F);}else{return this.fireSimple(F);}}},fireSimple:function(F){this.stopped=0;this.prevented=0;if(this.hasSubs()){var G=this.getSubs();this._procSubs(G[0],F);this._procSubs(G[1],F);}this._broadcast(F);return this.stopped?false:true;},fireComplex:function(F){F[0]=F[0]||{};return this.fireSimple(F);},_procSubs:function(I,G,F){var J,H;for(H in I){if(I.hasOwnProperty(H)){J=I[H];if(J&&J.fn){if(false===this._notify(J,G,F)){this.stopped=2;}if(this.stopped==2){return false;}}}}return true;},_broadcast:function(G){if(!this.stopped&&this.broadcast){var F=E.Array(G);F.unshift(this.type);if(this.host!==E){E.fire.apply(E,F);}if(this.broadcast==2){E.Global.fire.apply(E.Global,F);}}},unsubscribeAll:function(){return this.detachAll.apply(this,arguments);},detachAll:function(){return this.detach();},_delete:function(F){if(F){delete F.fn;delete F.context;delete this.subscribers[F.id];delete this.afters[F.id];}this.host._monitor("detach",this.type,{ce:this,sub:F});}};E.Subscriber=function(H,G,F){this.fn=H;this.context=G;this.id=E.stamp(this);this.args=F;};E.Subscriber.prototype={_notify:function(J,H,I){var F=this.args,G;switch(I.signature){case 0:G=this.fn.call(J,I.type,H,J);break;case 1:G=this.fn.call(J,H[0]||null,J);break;default:if(F||H){H=H||[];F=(F)?H.concat(F):H;G=this.fn.apply(J,F);}else{G=this.fn.call(J);}}if(this.once){I._delete(this);}return G;},notify:function(G,I){var J=this.context,F=true;
9
 
if(!J){J=(I.contextFn)?I.contextFn():I.context;}if(E.config.throwFail){F=this._notify(J,G,I);}else{try{F=this._notify(J,G,I);}catch(H){E.error(this+" failed: "+H.message,H);}}return F;},contains:function(G,F){if(F){return((this.fn==G)&&this.context==F);}else{return(this.fn==G);}}};(function(){var F=E.Lang,I=":",J="|",K="~AFTER~",H=E.cached(function(L){return L.replace(/(.*)(:)(.*)/,"*$2$3");}),M=E.cached(function(L,O){if(!O||!F.isString(L)||L.indexOf(I)>-1){return L;}return O+I+L;}),G=E.cached(function(P,R){var O=P,Q,S,L;if(!F.isString(O)){return O;}L=O.indexOf(K);if(L>-1){S=true;O=O.substr(K.length);}L=O.indexOf(J);if(L>-1){Q=O.substr(0,(L));O=O.substr(L+1);if(O=="*"){O=null;}}return[Q,(R)?M(O,R):O,S,O];}),N=function(L){var O=(F.isObject(L))?L:{};this._yuievt=this._yuievt||{id:E.guid(),events:{},targets:{},config:O,chain:("chain" in O)?O.chain:E.config.chain,bubbling:false,defaults:{context:O.context||this,host:this,emitFacade:O.emitFacade,fireOnce:O.fireOnce,queuable:O.queuable,monitored:O.monitored,broadcast:O.broadcast,defaultTargetOnly:O.defaulTargetOnly,bubbles:("bubbles" in O)?O.bubbles:true}};};N.prototype={once:function(){var L=this.on.apply(this,arguments);L.sub.once=true;return L;},on:function(R,W,P){var Z=G(R,this._yuievt.config.prefix),b,d,O,h,Y,X,e,T=E.Env.evt.handles,Q,L,U,g=E.Node,a,V,S;this._monitor("attach",Z[1],{args:arguments,category:Z[0],after:Z[2]});if(F.isObject(R)){if(F.isFunction(R)){return E.Do.before.apply(E.Do,arguments);}b=W;d=P;O=E.Array(arguments,0,true);h={};if(F.isArray(R)){S=true;}else{Q=R._after;delete R._after;}E.each(R,function(f,c){if(F.isObject(f)){b=f.fn||((F.isFunction(f))?f:b);d=f.context||d;}O[0]=(S)?f:((Q)?K+c:c);O[1]=b;O[2]=d;h[c]=this.on.apply(this,O);},this);return(this._yuievt.chain)?this:new E.EventHandle(h);}X=Z[0];Q=Z[2];U=Z[3];if(g&&(this instanceof g)&&(U in g.DOM_EVENTS)){O=E.Array(arguments,0,true);O.splice(2,0,g.getDOMNode(this));return E.on.apply(E,O);}R=Z[1];if(this instanceof YUI){L=E.Env.evt.plugins[R];O=E.Array(arguments,0,true);O[0]=U;if(g){a=O[2];if(a instanceof E.NodeList){a=E.NodeList.getDOMNodes(a);}else{if(a instanceof g){a=g.getDOMNode(a);}}V=(U in g.DOM_EVENTS);if(V){O[2]=a;}}if(L){e=L.on.apply(E,O);}else{if((!R)||V){e=E.Event._attach(O);}}}if(!e){Y=this._yuievt.events[R]||this.publish(R);e=Y._on(W,P,(arguments.length>3)?E.Array(arguments,3,true):null,(Q)?"after":true);}if(X){T[X]=T[X]||{};T[X][R]=T[X][R]||[];T[X][R].push(e);}return(this._yuievt.chain)?this:e;},subscribe:function(){return this.on.apply(this,arguments);},detach:function(X,Z,L){var c=this._yuievt.events,R,U=E.Node,b=U&&(this instanceof U);if(!X&&(this!==E)){for(R in c){if(c.hasOwnProperty(R)){c[R].detach(Z,L);}}if(b){E.Event.purgeElement(U.getDOMNode(this));}return this;}var Q=G(X,this._yuievt.config.prefix),W=F.isArray(Q)?Q[0]:null,d=(Q)?Q[3]:null,T,S,a=E.Env.evt.handles,Y,V,P,O=function(g,f){var e=g[f];if(e){while(e.length){T=e.pop();T.detach();}}};if(W){Y=a[W];X=Q[1];if(Y){if(X){O(Y,X);}else{for(R in Y){if(Y.hasOwnProperty(R)){O(Y,R);}}}return this;}}else{if(F.isObject(X)&&X.detach){X.detach();return this;}else{if(b&&((!d)||(d in U.DOM_EVENTS))){V=E.Array(arguments,0,true);V[2]=U.getDOMNode(this);E.detach.apply(E,V);return this;}}}S=E.Env.evt.plugins[d];if(this instanceof YUI){V=E.Array(arguments,0,true);if(S&&S.detach){S.detach.apply(E,V);return this;}else{if(!X||(!S&&U&&(X in U.DOM_EVENTS))){V[0]=X;E.Event.detach.apply(E.Event,V);return this;}}}P=c[Q[1]];if(P){P.detach(Z,L);}return this;},unsubscribe:function(){return this.detach.apply(this,arguments);},detachAll:function(L){return this.detach(L);},unsubscribeAll:function(){return this.detachAll.apply(this,arguments);},publish:function(P,Q){var O,S,L,R=this._yuievt.config.prefix;P=(R)?M(P,R):P;this._monitor("publish",P,{args:arguments});if(F.isObject(P)){L={};E.each(P,function(U,T){L[T]=this.publish(T,U||Q);},this);return L;}O=this._yuievt.events;S=O[P];if(S){if(Q){S.applyConfig(Q,true);}}else{S=new E.CustomEvent(P,(Q)?E.mix(Q,this._yuievt.defaults):this._yuievt.defaults);O[P]=S;}return O[P];},_monitor:function(Q,L,R){var O,P=this.getEvent(L);if((this._yuievt.config.monitored&&(!P||P.monitored))||(P&&P.monitored)){O=L+"_"+Q;R.monitored=Q;this.fire.call(this,O,R);}},fire:function(Q){var U=F.isString(Q),P=(U)?Q:(Q&&Q.type),T,O,S=this._yuievt.config.prefix,R,L=(U)?E.Array(arguments,1,true):arguments;P=(S)?M(P,S):P;this._monitor("fire",P,{args:L});T=this.getEvent(P,true);R=this.getSibling(P,T);if(R&&!T){T=this.publish(P);}if(!T){if(this._yuievt.hasTargets){return this.bubble({type:P},L,this);}O=true;}else{T.sibling=R;O=T.fire.apply(T,L);}return(this._yuievt.chain)?this:O;},getSibling:function(L,P){var O;if(L.indexOf(I)>-1){L=H(L);O=this.getEvent(L,true);if(O){O.applyConfig(P);O.bubbles=false;O.broadcast=0;}}return O;},getEvent:function(O,L){var Q,P;if(!L){Q=this._yuievt.config.prefix;O=(Q)?M(O,Q):O;}P=this._yuievt.events;return P[O]||null;},after:function(P,O){var L=E.Array(arguments,0,true);switch(F.type(P)){case"function":return E.Do.after.apply(E.Do,arguments);case"object":L[0]._after=true;break;default:L[0]=K+P;}return this.on.apply(this,L);},before:function(){return this.on.apply(this,arguments);}};E.EventTarget=N;E.mix(E,N.prototype,false,false,{bubbles:false});N.call(E);YUI.Env.globalEvents=YUI.Env.globalEvents||new N();E.Global=YUI.Env.globalEvents;})();},"3.1.1",{requires:["oop"]});YUI.add("event-custom-complex",function(A){(function(){var C,E,B=A.CustomEvent.prototype,D=A.EventTarget.prototype;A.EventFacade=function(G,F){G=G||{};this.details=G.details;this.type=G.type;this._type=G.type;this.target=G.target;this.currentTarget=F;this.relatedTarget=G.relatedTarget;this.stopPropagation=function(){G.stopPropagation();};this.stopImmediatePropagation=function(){G.stopImmediatePropagation();};this.preventDefault=function(){G.preventDefault();};this.halt=function(H){G.halt(H);};};B.fireComplex=function(N){var O=A.Env._eventstack,J,F,L,G,M,R,H,Q=this,P=Q.host||Q,K,I;if(O){if(Q.queuable&&Q.type!=O.next.type){Q.log("queue "+Q.type);
10
 
O.queue.push([Q,N]);return true;}}else{A.Env._eventstack={id:Q.id,next:Q,silent:Q.silent,stopped:0,prevented:0,bubbling:null,type:Q.type,afterQueue:new A.Queue(),defaultTargetOnly:Q.defaultTargetOnly,queue:[]};O=A.Env._eventstack;}H=Q.getSubs();Q.stopped=(Q.type!==O.type)?0:O.stopped;Q.prevented=(Q.type!==O.type)?0:O.prevented;Q.target=Q.target||P;R=new A.EventTarget({fireOnce:true,context:P});Q.events=R;if(Q.preventedFn){R.on("prevented",Q.preventedFn);}if(Q.stoppedFn){R.on("stopped",Q.stoppedFn);}Q.currentTarget=P;Q.details=N.slice();Q.log("Firing "+Q.type);Q._facade=null;J=Q._getFacade(N);if(A.Lang.isObject(N[0])){N[0]=J;}else{N.unshift(J);}if(H[0]){Q._procSubs(H[0],N,J);}if(Q.bubbles&&P.bubble&&!Q.stopped){I=O.bubbling;O.bubbling=Q.type;if(O.type!=Q.type){O.stopped=0;O.prevented=0;}M=P.bubble(Q);Q.stopped=Math.max(Q.stopped,O.stopped);Q.prevented=Math.max(Q.prevented,O.prevented);O.bubbling=I;}if(Q.defaultFn&&!Q.prevented&&((!Q.defaultTargetOnly&&!O.defaultTargetOnly)||P===J.target)){Q.defaultFn.apply(P,N);}Q._broadcast(N);if(H[1]&&!Q.prevented&&Q.stopped<2){if(O.id===Q.id||Q.type!=P._yuievt.bubbling){Q._procSubs(H[1],N,J);while((K=O.afterQueue.last())){K();}}else{O.afterQueue.add(function(){Q._procSubs(H[1],N,J);});}}Q.target=null;if(O.id===Q.id){L=O.queue;while(L.length){F=L.pop();G=F[0];O.next=G;G.fire.apply(G,F[1]);}A.Env._eventstack=null;}M=!(Q.stopped);if(Q.type!=P._yuievt.bubbling){O.stopped=0;O.prevented=0;Q.stopped=0;Q.prevented=0;}return M;};B._getFacade=function(){var F=this._facade,I,H,G=this.details;if(!F){F=new A.EventFacade(this,this.currentTarget);}I=G&&G[0];if(A.Lang.isObject(I,true)){H={};A.mix(H,F,true,E);A.mix(F,I,true);A.mix(F,H,true,E);F.type=I.type||F.type;}F.details=this.details;F.target=this.originalTarget||this.target;F.currentTarget=this.currentTarget;F.stopped=0;F.prevented=0;this._facade=F;return this._facade;};B.stopPropagation=function(){this.stopped=1;A.Env._eventstack.stopped=1;this.events.fire("stopped",this);};B.stopImmediatePropagation=function(){this.stopped=2;A.Env._eventstack.stopped=2;this.events.fire("stopped",this);};B.preventDefault=function(){if(this.preventable){this.prevented=1;A.Env._eventstack.prevented=1;this.events.fire("prevented",this);}};B.halt=function(F){if(F){this.stopImmediatePropagation();}else{this.stopPropagation();}this.preventDefault();};D.addTarget=function(F){this._yuievt.targets[A.stamp(F)]=F;this._yuievt.hasTargets=true;};D.getTargets=function(){return A.Object.values(this._yuievt.targets);};D.removeTarget=function(F){delete this._yuievt.targets[A.stamp(F)];};D.bubble=function(R,O,M){var K=this._yuievt.targets,N=true,S,P=R&&R.type,G,J,L,H,F=M||(R&&R.target)||this,Q=A.Env._eventstack,I;if(!R||((!R.stopped)&&K)){for(J in K){if(K.hasOwnProperty(J)){S=K[J];G=S.getEvent(P,true);H=S.getSibling(P,G);if(H&&!G){G=S.publish(P);}I=S._yuievt.bubbling;S._yuievt.bubbling=P;if(!G){if(S._yuievt.hasTargets){S.bubble(R,O,F);}}else{G.sibling=H;G.target=F;G.originalTarget=F;G.currentTarget=S;L=G.broadcast;G.broadcast=false;N=N&&G.fire.apply(G,O||R.details||[]);G.broadcast=L;G.originalTarget=null;if(G.stopped){break;}}S._yuievt.bubbling=I;}}}return N;};C=new A.EventFacade();E=A.Object.keys(C);})();},"3.1.1",{requires:["event-custom-base"]});YUI.add("event-custom",function(A){},"3.1.1",{use:["event-custom-base","event-custom-complex"]});
 
 
b'\\ No newline at end of file'
 
9
if(!J){J=(I.contextFn)?I.contextFn():I.context;}if(E.config.throwFail){F=this._notify(J,G,I);}else{try{F=this._notify(J,G,I);}catch(H){E.error(this+" failed: "+H.message,H);}}return F;},contains:function(G,F){if(F){return((this.fn==G)&&this.context==F);}else{return(this.fn==G);}}};(function(){var F=E.Lang,I=":",J="|",K="~AFTER~",H=E.cached(function(L){return L.replace(/(.*)(:)(.*)/,"*$2$3");}),M=E.cached(function(L,O){if(!O||!F.isString(L)||L.indexOf(I)>-1){return L;}return O+I+L;}),G=E.cached(function(P,R){var O=P,Q,S,L;if(!F.isString(O)){return O;}L=O.indexOf(K);if(L>-1){S=true;O=O.substr(K.length);}L=O.indexOf(J);if(L>-1){Q=O.substr(0,(L));O=O.substr(L+1);if(O=="*"){O=null;}}return[Q,(R)?M(O,R):O,S,O];}),N=function(L){var O=(F.isObject(L))?L:{};this._yuievt=this._yuievt||{id:E.guid(),events:{},targets:{},config:O,chain:("chain" in O)?O.chain:E.config.chain,bubbling:false,defaults:{context:O.context||this,host:this,emitFacade:O.emitFacade,fireOnce:O.fireOnce,queuable:O.queuable,monitored:O.monitored,broadcast:O.broadcast,defaultTargetOnly:O.defaulTargetOnly,bubbles:("bubbles" in O)?O.bubbles:true}};};N.prototype={once:function(){var L=this.on.apply(this,arguments);L.sub.once=true;return L;},on:function(R,W,P){var Z=G(R,this._yuievt.config.prefix),b,d,O,h,Y,X,e,T=E.Env.evt.handles,Q,L,U,g=E.Node,a,V,S;this._monitor("attach",Z[1],{args:arguments,category:Z[0],after:Z[2]});if(F.isObject(R)){if(F.isFunction(R)){return E.Do.before.apply(E.Do,arguments);}b=W;d=P;O=E.Array(arguments,0,true);h={};if(F.isArray(R)){S=true;}else{Q=R._after;delete R._after;}E.each(R,function(f,c){if(F.isObject(f)){b=f.fn||((F.isFunction(f))?f:b);d=f.context||d;}O[0]=(S)?f:((Q)?K+c:c);O[1]=b;O[2]=d;h[c]=this.on.apply(this,O);},this);return(this._yuievt.chain)?this:new E.EventHandle(h);}X=Z[0];Q=Z[2];U=Z[3];if(g&&(this instanceof g)&&(U in g.DOM_EVENTS)){O=E.Array(arguments,0,true);O.splice(2,0,g.getDOMNode(this));return E.on.apply(E,O);}R=Z[1];if(this instanceof YUI){L=E.Env.evt.plugins[R];O=E.Array(arguments,0,true);O[0]=U;if(g){a=O[2];if(a instanceof E.NodeList){a=E.NodeList.getDOMNodes(a);}else{if(a instanceof g){a=g.getDOMNode(a);}}V=(U in g.DOM_EVENTS);if(V){O[2]=a;}}if(L){e=L.on.apply(E,O);}else{if((!R)||V){e=E.Event._attach(O);}}}if(!e){Y=this._yuievt.events[R]||this.publish(R);e=Y._on(W,P,(arguments.length>3)?E.Array(arguments,3,true):null,(Q)?"after":true);}if(X){T[X]=T[X]||{};T[X][R]=T[X][R]||[];T[X][R].push(e);}return(this._yuievt.chain)?this:e;},subscribe:function(){return this.on.apply(this,arguments);},detach:function(X,Z,L){var c=this._yuievt.events,R,U=E.Node,b=U&&(this instanceof U);if(!X&&(this!==E)){for(R in c){if(c.hasOwnProperty(R)){c[R].detach(Z,L);}}if(b){E.Event.purgeElement(U.getDOMNode(this));}return this;}var Q=G(X,this._yuievt.config.prefix),W=F.isArray(Q)?Q[0]:null,d=(Q)?Q[3]:null,T,S,a=E.Env.evt.handles,Y,V,P,O=function(g,f){var e=g[f];if(e){while(e.length){T=e.pop();T.detach();}}};if(W){Y=a[W];X=Q[1];if(Y){if(X){O(Y,X);}else{for(R in Y){if(Y.hasOwnProperty(R)){O(Y,R);}}}return this;}}else{if(F.isObject(X)&&X.detach){X.detach();return this;}else{if(b&&((!d)||(d in U.DOM_EVENTS))){V=E.Array(arguments,0,true);V[2]=U.getDOMNode(this);E.detach.apply(E,V);return this;}}}S=E.Env.evt.plugins[d];if(this instanceof YUI){V=E.Array(arguments,0,true);if(S&&S.detach){S.detach.apply(E,V);return this;}else{if(!X||(!S&&U&&(X in U.DOM_EVENTS))){V[0]=X;E.Event.detach.apply(E.Event,V);return this;}}}P=c[Q[1]];if(P){P.detach(Z,L);}return this;},unsubscribe:function(){return this.detach.apply(this,arguments);},detachAll:function(L){return this.detach(L);},unsubscribeAll:function(){return this.detachAll.apply(this,arguments);},publish:function(P,Q){var O,S,L,R=this._yuievt.config.prefix;P=(R)?M(P,R):P;this._monitor("publish",P,{args:arguments});if(F.isObject(P)){L={};E.each(P,function(U,T){L[T]=this.publish(T,U||Q);},this);return L;}O=this._yuievt.events;S=O[P];if(S){if(Q){S.applyConfig(Q,true);}}else{S=new E.CustomEvent(P,(Q)?E.mix(Q,this._yuievt.defaults):this._yuievt.defaults);O[P]=S;}return O[P];},_monitor:function(Q,L,R){var O,P=this.getEvent(L);if((this._yuievt.config.monitored&&(!P||P.monitored))||(P&&P.monitored)){O=L+"_"+Q;R.monitored=Q;this.fire.call(this,O,R);}},fire:function(Q){var U=F.isString(Q),P=(U)?Q:(Q&&Q.type),T,O,S=this._yuievt.config.prefix,R,L=(U)?E.Array(arguments,1,true):arguments;P=(S)?M(P,S):P;this._monitor("fire",P,{args:L});T=this.getEvent(P,true);R=this.getSibling(P,T);if(R&&!T){T=this.publish(P);}if(!T){if(this._yuievt.hasTargets){return this.bubble({type:P},L,this);}O=true;}else{T.sibling=R;O=T.fire.apply(T,L);}return(this._yuievt.chain)?this:O;},getSibling:function(L,P){var O;if(L.indexOf(I)>-1){L=H(L);O=this.getEvent(L,true);if(O){O.applyConfig(P);O.bubbles=false;O.broadcast=0;}}return O;},getEvent:function(O,L){var Q,P;if(!L){Q=this._yuievt.config.prefix;O=(Q)?M(O,Q):O;}P=this._yuievt.events;return P[O]||null;},after:function(P,O){var L=E.Array(arguments,0,true);switch(F.type(P)){case"function":return E.Do.after.apply(E.Do,arguments);case"object":L[0]._after=true;break;default:L[0]=K+P;}return this.on.apply(this,L);},before:function(){return this.on.apply(this,arguments);}};E.EventTarget=N;E.mix(E,N.prototype,false,false,{bubbles:false});N.call(E);YUI.Env.globalEvents=YUI.Env.globalEvents||new N();E.Global=YUI.Env.globalEvents;})();},"3.1.2",{requires:["oop"]});YUI.add("event-custom-complex",function(A){(function(){var C,E,B=A.CustomEvent.prototype,D=A.EventTarget.prototype;A.EventFacade=function(G,F){G=G||{};this.details=G.details;this.type=G.type;this._type=G.type;this.target=G.target;this.currentTarget=F;this.relatedTarget=G.relatedTarget;this.stopPropagation=function(){G.stopPropagation();};this.stopImmediatePropagation=function(){G.stopImmediatePropagation();};this.preventDefault=function(){G.preventDefault();};this.halt=function(H){G.halt(H);};};B.fireComplex=function(N){var O=A.Env._eventstack,J,F,L,G,M,R,H,Q=this,P=Q.host||Q,K,I;if(O){if(Q.queuable&&Q.type!=O.next.type){Q.log("queue "+Q.type);
 
10
O.queue.push([Q,N]);return true;}}else{A.Env._eventstack={id:Q.id,next:Q,silent:Q.silent,stopped:0,prevented:0,bubbling:null,type:Q.type,afterQueue:new A.Queue(),defaultTargetOnly:Q.defaultTargetOnly,queue:[]};O=A.Env._eventstack;}H=Q.getSubs();Q.stopped=(Q.type!==O.type)?0:O.stopped;Q.prevented=(Q.type!==O.type)?0:O.prevented;Q.target=Q.target||P;R=new A.EventTarget({fireOnce:true,context:P});Q.events=R;if(Q.preventedFn){R.on("prevented",Q.preventedFn);}if(Q.stoppedFn){R.on("stopped",Q.stoppedFn);}Q.currentTarget=P;Q.details=N.slice();Q.log("Firing "+Q.type);Q._facade=null;J=Q._getFacade(N);if(A.Lang.isObject(N[0])){N[0]=J;}else{N.unshift(J);}if(H[0]){Q._procSubs(H[0],N,J);}if(Q.bubbles&&P.bubble&&!Q.stopped){I=O.bubbling;O.bubbling=Q.type;if(O.type!=Q.type){O.stopped=0;O.prevented=0;}M=P.bubble(Q);Q.stopped=Math.max(Q.stopped,O.stopped);Q.prevented=Math.max(Q.prevented,O.prevented);O.bubbling=I;}if(Q.defaultFn&&!Q.prevented&&((!Q.defaultTargetOnly&&!O.defaultTargetOnly)||P===J.target)){Q.defaultFn.apply(P,N);}Q._broadcast(N);if(H[1]&&!Q.prevented&&Q.stopped<2){if(O.id===Q.id||Q.type!=P._yuievt.bubbling){Q._procSubs(H[1],N,J);while((K=O.afterQueue.last())){K();}}else{O.afterQueue.add(function(){Q._procSubs(H[1],N,J);});}}Q.target=null;if(O.id===Q.id){L=O.queue;while(L.length){F=L.pop();G=F[0];O.next=G;G.fire.apply(G,F[1]);}A.Env._eventstack=null;}M=!(Q.stopped);if(Q.type!=P._yuievt.bubbling){O.stopped=0;O.prevented=0;Q.stopped=0;Q.prevented=0;}return M;};B._getFacade=function(){var F=this._facade,I,H,G=this.details;if(!F){F=new A.EventFacade(this,this.currentTarget);}I=G&&G[0];if(A.Lang.isObject(I,true)){H={};A.mix(H,F,true,E);A.mix(F,I,true);A.mix(F,H,true,E);F.type=I.type||F.type;}F.details=this.details;F.target=this.originalTarget||this.target;F.currentTarget=this.currentTarget;F.stopped=0;F.prevented=0;this._facade=F;return this._facade;};B.stopPropagation=function(){this.stopped=1;A.Env._eventstack.stopped=1;this.events.fire("stopped",this);};B.stopImmediatePropagation=function(){this.stopped=2;A.Env._eventstack.stopped=2;this.events.fire("stopped",this);};B.preventDefault=function(){if(this.preventable){this.prevented=1;A.Env._eventstack.prevented=1;this.events.fire("prevented",this);}};B.halt=function(F){if(F){this.stopImmediatePropagation();}else{this.stopPropagation();}this.preventDefault();};D.addTarget=function(F){this._yuievt.targets[A.stamp(F)]=F;this._yuievt.hasTargets=true;};D.getTargets=function(){return A.Object.values(this._yuievt.targets);};D.removeTarget=function(F){delete this._yuievt.targets[A.stamp(F)];};D.bubble=function(R,O,M){var K=this._yuievt.targets,N=true,S,P=R&&R.type,G,J,L,H,F=M||(R&&R.target)||this,Q=A.Env._eventstack,I;if(!R||((!R.stopped)&&K)){for(J in K){if(K.hasOwnProperty(J)){S=K[J];G=S.getEvent(P,true);H=S.getSibling(P,G);if(H&&!G){G=S.publish(P);}I=S._yuievt.bubbling;S._yuievt.bubbling=P;if(!G){if(S._yuievt.hasTargets){S.bubble(R,O,F);}}else{G.sibling=H;G.target=F;G.originalTarget=F;G.currentTarget=S;L=G.broadcast;G.broadcast=false;N=N&&G.fire.apply(G,O||R.details||[]);G.broadcast=L;G.originalTarget=null;if(G.stopped){break;}}S._yuievt.bubbling=I;}}}return N;};C=new A.EventFacade();E=A.Object.keys(C);})();},"3.1.2",{requires:["event-custom-base"]});YUI.add("event-custom",function(A){},"3.1.2",{use:["event-custom-base","event-custom-complex"]});
 
 
b'\\ No newline at end of file'