YUI.add("aui-tree-paginator",function(e,t){function E(t){var n=this;e.after(n._bindPaginatorUI,this,"bindUI"),e.after(n._syncPaginatorUI,this,"syncUI")}var n=e.Lang,r=n.isObject,i=n.isValue,s=e.getClassName,o="children",u="container",a="end",f="io",l="limit",c="Load more results",h="node",p="ownerTree",d="paginator",v="start",m="tree",g="tree-node-io",y="paginatorClick",b=s(m,h,d),w='<a class="'+b+'" hrsef="javascript:void(0);">{moreResultsLabel}</a>';E.ATTRS={paginator:{setter:function(t){var r=this,i=e.Node.create(n.sub(w,{moreResultsLabel:t.moreResultsLabel||c}));return e.merge({alwaysVisible:!1,autoFocus:!0,element:i,endParam:a,limitParam:l,start:0,startParam:v},t)},validator:r}},E.prototype={_bindPaginatorUI:function(){var t=this,n=t.get(d);n&&n.element.on("click",e.bind(t._handlePaginatorClickEvent,t)),t._createEvents()},_createEvents:function(){var e=this;e.publish(y,{defaultFn:e._defPaginatorClickFn,prefix:g})},_defPaginatorClickFn:function(e){var t=this,n=t.get(d);i(n.limit)&&(n.start=t.getChildrenLength()),t.get(f)&&t.initIO()},_handlePaginatorClickEvent:function(e){var t=this,n=t.getEventOutputMap(t);t.fire(y,n),e.halt()},_syncPaginatorIOData:function(e){var t=this,n=t.get(d);if(n&&i(n.limit)){var r=e.cfg.data||{};r[n.limitParam]=n.limit,r[n.startParam]=n.start,r[n.endParam]=n.start+n.limit,e.cfg.data=r}},_syncPaginatorUI:function(e){var t=this,n=t.get(d);if(n){var r=!0;e&&(r=e.length>0);var i=t.getChildrenLength(),s=n.start,o=n.total||i,a=i&&r&&o>i;if(n.alwaysVisible||a){t.get(u).append(n.element.show());if(n.autoFocus)try{n.element.focus()}catch(f){}}else n.element.hide()}}},e.TreeViewPaginator=E},"2.0.0",{requires:["yui-base"]});
