(function(){function g(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},isSelected:function(){var a=this.getTabbox();return a&&a.getSelectedTab()==this},setSelected:function(a,b){var c=this.getTabbox();c&&a&&
c.setSelectedTab(this,b)},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=this.getLinkedPanel(),h=c.inAccordionMold();if(a){var e;if(e=c.tabpanels)e._selPnl&&e._selPnl!=d&&e._selPnl._sel(!1,
h),e._selPnl=d;c._selTab=this}if(this.desktop){a?jq(this).addClass(this.$s("selected")):jq(this).removeClass(this.$s("selected"));d&&d.isVisible()&&d._sel(a,!0);if(!h){var f=this.parent;f&&f._fixWidth(a)}a&&(c.isVertical()?f._scrollcheck("vsel",this):c.inAccordionMold()||f._scrollcheck("sel",this));b&&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(){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){if(!this._disabled){var b=this.getTabbox();b&&b._animating||(this.setSelected(!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")+'" alt="" aria-hidden="true"/>'+(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;d&&this.domListen_(d,"onClick","_doCloseClick");this.getHeight()&&this._calcHgh();this.parent._shallCheck=!0},unbind_:function(){var a=this.$n("cls");g(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&&g(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}}})();
