define(["Ti/_/declare","Ti/UI/View","Ti/_/dom","Ti/Locale","Ti/UI","Ti/UI/MobileWeb","Ti/UI/Label","Ti/UI/ImageView"],function(t,i,a,e,o,n){var r={post:function(){this._tabTitle.text=this._getTitle()}},_=o.FILL,s=o.SIZE;return t("Ti.UI.Tab",i,{constructor:function(t){var i=t&&t.window,a=o.createView({layout:o._LAYOUT_CONSTRAINING_VERTICAL,width:"100%",height:s}),e=this._tabNavigationGroup=n.createNavigationGroup({window:i,_tab:this});this._add(a),a._add(this._tabIcon=o.createImageView({height:s,width:s})),a._add(this._tabTitle=o.createLabel({width:"100%",wordWrap:!0,textAlign:o.TEXT_ALIGNMENT_CENTER})),i&&require.on(this,"singletap",this,function(){var t=this._tabGroup;t&&(t.activeTab===this?e._reset():t.activeTab=this)})},_defaultWidth:_,_defaultHeight:_,open:function(t,i){this._tabNavigationGroup.open(t,i)},close:function(t,i){this._tabNavigationGroup.close(t,i)},_focus:function(){this.fireEvent("focus",this._tabGroup._getEventData());var t=this._tabNavigationGroup._getTopWindow();t&&(this._tabGroup&&this._tabGroup._opened&&!t._opened&&(t._opened=1,t.fireEvent("open")),t._handleFocusEvent())},_blur:function(){var t=this._tabNavigationGroup._getTopWindow();t&&t._handleBlurEvent(),this.fireEvent("blur",this._tabGroup._getEventData())},_getTitle:function(){return e._getString(this.titleid,this.title)},_setTabGroup:function(t){this._tabGroup=t,this._tabNavigationGroup.navBarAtTop=t.tabsAtTop,this._win&&(this._win.tabGroup=t)},_setNavBarAtTop:function(t){this._tabNavigationGroup.navBarAtTop=t},properties:{active:{get:function(){return this._tabGroup&&this._tabGroup.activeTab===this},post:function(t){var i=this._tabGroup,a=this._tabNavigationGroup,e=i._focused&&i._opened;t?(a.navBarAtTop=i.tabsAtBottom,a._updateNavBar(),i._addTabContents(a),e&&this._focus()):(i._removeTabContents(a),e&&this._blur())}},icon:{set:function(t){return this._tabIcon.image=t}},title:r,titleid:r}})});