YUI.add("event-delegate",function(f,e){var c=f.Array,t=f.Lang,h=t.isString,g=t.isObject,y=t.isArray,u=f.Selector.test,v=f.Env.evt.handles;function E(e,t,n,r){var a,l,i,s,u,o,p=c(arguments,0,!0),d=h(n)?n:null;if(g(e)){if(u=[],y(e))for(i=0,s=e.length;i<s;++i)p[0]=e[i],u.push(f.delegate.apply(f,p));else for(i in p.unshift(null),e)e.hasOwnProperty(i)&&(p[0]=i,p[1]=e[i],u.push(f.delegate.apply(f,p)));return new f.EventHandle(u)}if(1<(a=e.split(/\|/)).length&&(l=a.shift(),p[0]=e=a.shift()),a=f.Node.DOM_EVENTS[e],!(o=g(a)&&a.delegate?a.delegate.apply(a,arguments):o)){if(!(e&&t&&n&&r))return;a=d?f.Selector.query(d,null,!0):n,!(o=!a&&h(n)?f.on("available",function(){f.mix(o,f.delegate.apply(f,p),!0)},n):o)&&a&&(p.splice(2,2,a),(o=f.Event._attach(p,{facade:!1})).sub.filter=r,o.sub._notify=E.notifySub)}return o&&l&&(d=(d=v[l]||(v[l]={}))[e]||(d[e]=[])).push(o),o}E.notifySub=function(e,t,n){t=t.slice(),this.args&&t.push.apply(t,this.args);var r,a,l,i,s=E._applyFilter(this.filter,t,n);if(s){for(s=c(s),(r=t[0]=new f.DOMEventFacade(t[0],n.el,n)).container=f.one(n.el),a=0,l=s.length;a<l&&!r.stopped&&(r.currentTarget=f.one(s[a]),!1!==(i=this.fn.apply(this.context||r.currentTarget,t)));++a);return i}},E.compileFilter=f.cached(function(n){return function(e,t){return u(e._node,n,t.currentTarget===t.target?null:t.currentTarget._node)}}),E._disabledRE=/^(?:button|input|select|textarea)$/i,E._applyFilter=function(e,t,n){var r,a=t[0],l=n.el,i=a.target||a.srcElement,s=[];if(!(i=3===i.nodeType?i.parentNode:i).disabled||!E._disabledRE.test(i.nodeName)){if(t.unshift(i),h(e))for(;i&&(u(i,e,(r=i===l)?null:l)&&s.push(i),!r);)i=i.parentNode;else{for(t[0]=f.one(i),t[1]=new f.DOMEventFacade(a,l,n);i&&(e.apply(t[0],t)&&s.push(i),i!==l);)i=i.parentNode,t[0]=f.one(i);t[1]=a}s.length<=1&&(s=s[0]),t.shift()}return s},f.delegate=f.Event.delegate=E},"patched-v3.18.7",{requires:["node-base"]});