YUI.add("view",function(o,t){function e(){e.superclass.constructor.apply(this,arguments)}o.View=o.extend(e,o.Base,{containerTemplate:"<div/>",events:{},template:"",_allowAdHocAttrs:!0,initializer:function(t){(t=t||{}).containerTemplate&&(this.containerTemplate=t.containerTemplate),t.template&&(this.template=t.template),this.events=t.events?o.merge(this.events,t.events):this.events,this.after("containerChange",this._afterContainerChange)},destroy:function(t){return t&&(t.remove||t["delete"])&&this.onceAfter("destroy",function(){this._destroyContainer()}),e.superclass.destroy.call(this)},destructor:function(){this.detachEvents(),delete this._container},attachEvents:function(t){var e,n,i,r,s=this.get("container"),a=o.Object.owns;for(r in this.detachEvents(),t=t||this.events)if(a(t,r))for(i in n=t[r])a(n,i)&&(e="string"==typeof(e=n[i])?this[e]:e)&&this._attachedViewEvents.push(s.delegate(i,e,r,this));return this},create:function(t){return t?o.one(t):o.Node.create(this.containerTemplate)},detachEvents:function(){return o.Array.each(this._attachedViewEvents,function(t){t&&t.detach()}),this._attachedViewEvents=[],this},remove:function(){var t=this.get("container");return t&&t.remove(),this},render:function(){return this},_destroyContainer:function(){var t=this.get("container");t&&t.remove(!0)},_getContainer:function(t){return this._container||(t?(this._container=t,this.attachEvents()):(t=this._container=this.create(),this._set("container",t))),t},_afterContainerChange:function(){this.attachEvents(this.events)}},{NAME:"view",ATTRS:{container:{getter:"_getContainer",setter:o.one,writeOnce:!0}},_NON_ATTRS_CFG:["containerTemplate","events","template"]})},"patched-v3.18.7",{requires:["base-build","node-event-delegate"]});