(function(){function k(a){a._oldId||(a._oldId=a.uuid,setTimeout(function(){delete a._oldId},0))}zul.tab.Tab=zk.$extends(zul.LabelImageWidget,{$init:function(){this.$supers("$init",arguments);this.listen({onClose:this},-1E3)},$define:{closable:_zkf=function(){this.rerender()},image:function(a){a&&this._preloadImag&&zUtl.loadImage(a);this.rerender()},disabled:_zkf,selected:function(a){this._sel()}},getTabbox:function(){return this.parent?this.parent.parent:null},getIndex:function(){return this.getChildIndex()},
getLinkedPanel:function(){var a;return(a=this.getTabbox())&&(a=a.getTabpanels())?a.getChildAt(this.getIndex()):null},_doCloseClick:function(a){this._disabled||(this.fire("onClose"),a.stop())},_sel:function(a,b){var c=this.getTabbox();if(c&&!c._animating){var d=c._selTab;if(d!=this||b)d&&c.inAccordionMold()&&(c=this.getLinkedPanel())&&c._changeSel(d.getLinkedPanel()),d&&d!=this&&this._setSel(d,!1,!1,b),this._setSel(this,!0,a,b)}},_setSel:function(a,b,c,d){var e,f=this.getTabbox(),g=a.getLinkedPanel();
if(a.isSelected()!=b||!c){if(b){f._selTab=a;var h;if(h=f.tabpanels)h._selPnl&&h._selPnl!=g&&h._selPnl._sel(!1,f.inAccordionMold()),h._selPnl=g}a._selected=b;this.desktop&&(b?jq(a).addClass(this.$s("selected")):jq(a).removeClass(this.$s("selected")),g&&g.isVisible()&&g._sel(b,!d),f.inAccordionMold()||(e=this.parent)&&e._fixWidth(b),a==this&&(f.isVertical()?e._scrollcheck("vsel",this):f.inAccordionMold()||e._scrollcheck("sel",this)),c&&this.fire("onSelect",{items:[this],reference:this.uuid}))}},setHeight:function(a){this.$supers("setHeight",
arguments);this.desktop&&(this._calcHgh(),zUtl.fireSized(this.parent))},setWidth:function(a){this.$supers("setWidth",arguments);this.desktop&&zUtl.fireSized(this.parent)},_calcHgh:function(){this.$n();var a=this.getTabbox();if(!a.isVertical()){var b=a.$n("right"),c=a.$n("left"),d=a.toolbar;a=a.tabs.$n();a=jq.px0(a?a.offsetHeight:0);b&&c&&(b.style.height=c.style.height=a);d&&(d=d.$n())&&(d.style.height=a)}},doClick_:function(a){this._disabled||(this._sel(!0),this.$supers("doClick_",arguments))},domClass_:function(a){var b=
this.$supers("domClass_",arguments);a&&a.zclass||(this.isDisabled()&&(b+=" "+this.$s("disabled")),this.isSelected()&&(b+=" "+this.$s("selected")));return b},domContent_:function(){var a=zUtl.encodeXML(this.getLabel()),b=this.getImage(),c=this.domIcon_();a||(a="&nbsp;");if(!b&&!c)return a;b=b?'<img src="'+b+'" class="'+this.$s("image")+'"/>'+(c?" "+c:""):c;return a?b+" "+a:b},setVflex:function(a){"min"!=a&&(a=!1);this.$supers("setVflex",arguments)},setHflex:function(a){"min"!=a&&(a=!1);this.$supers("setHflex",
arguments)},bind_:function(a,b,c){this.$supers(zul.tab.Tab,"bind_",arguments);var d=this.isClosable()?this.$n("cls"):null,e=this;d&&this.domListen_(d,"onClick","_doCloseClick");e.isSelected()&&zk.afterMount(function(){if(e.desktop&&e.getTabbox().inAccordionMold()){var a=e.getLinkedPanel(),b=a?a.$n("cave"):null;b&&"none"==b.style.display&&a._sel(!0,!0)}e.isSelected()&&e._sel(!1,!0)});this.getHeight()&&this._calcHgh();this.parent._shallCheck=!0},unbind_:function(){var a=this.$n("cls");k(this);a&&this.domUnlisten_(a,
"onClick","_doCloseClick");this.$supers(zul.tab.Tab,"unbind_",arguments)},onClose:function(){this.getTabbox().inAccordionMold()&&this.getTabbox()._syncSize()},deferRedrawHTML_:function(a){var b=this.getTabbox().inAccordionMold()?"div":"li";a.push("<",b,this.domAttrs_({domClass:1}),' class="z-renderdefer"></',b,">")},rerender:function(a){this.desktop&&k(this);this.$supers(zul.tab.Tab,"rerender",arguments)},contentRenderer_:function(a){a.push('<span id="',this.uuid,'-cnt" class="',this.$s("text"),'">',
this.domContent_(),"</span>")}});zul.tab.TabRenderer={isFrameRequired:function(){return!1}}})();
