YUI.add("plugin",function(n,t){function s(t){(this.hasImpl&&this.hasImpl(n.Plugin.Base)?s.prototype.initializer:s.superclass.constructor).apply(this,arguments)}s.ATTRS={host:{writeOnce:!0}},s.NAME="plugin",s.NS="plugin",n.extend(s,n.Base,{_handles:null,initializer:function(t){this._handles=[]},destructor:function(){if(this._handles)for(var t=0,s=this._handles.length;t<s;t++)this._handles[t].detach()},doBefore:function(t,s,e){var n,h=this.get("host");return t in h?n=this.beforeHostMethod(t,s,e):h.on&&(n=this.onHostEvent(t,s,e)),n},doAfter:function(t,s,e){var n,h=this.get("host");return t in h?n=this.afterHostMethod(t,s,e):h.after&&(n=this.afterHostEvent(t,s,e)),n},onHostEvent:function(t,s,e){t=this.get("host").on(t,s,e||this);return this._handles.push(t),t},onceHostEvent:function(t,s,e){t=this.get("host").once(t,s,e||this);return this._handles.push(t),t},afterHostEvent:function(t,s,e){t=this.get("host").after(t,s,e||this);return this._handles.push(t),t},onceAfterHostEvent:function(t,s,e){t=this.get("host").onceAfter(t,s,e||this);return this._handles.push(t),t},beforeHostMethod:function(t,s,e){s=n.Do.before(s,this.get("host"),t,e||this);return this._handles.push(s),s},afterHostMethod:function(t,s,e){s=n.Do.after(s,this.get("host"),t,e||this);return this._handles.push(s),s},toString:function(){return this.constructor.NAME+"["+this.constructor.NS+"]"}}),n.namespace("Plugin").Base=s},"patched-v3.18.7",{requires:["base-base"]});