define(["Ti/_/declare","Ti/_/Evented","Ti/UI/Button","Ti/Facebook","Ti/_/lang"],function(e,t,n,i,o){var g="themes/"+require.config.ti.theme+"/Facebook/",s=["login.png","logout.png","loginWide.png","logout.png"],a=["loginPressed.png","logoutPressed.png","loginWidePressed.png","logoutPressed.png"];return e("Ti.Facebook.LoginButton",n,{constructor:function(){this._clearDefaultLook(),this._updateImages(),this._loggedInState=i.loggedIn,this.addEventListener("singletap",function(){i.loggedIn?i.logout():i.authorize()}),i.addEventListener("login",o.hitch(this,"_updateImages")),i.addEventListener("logout",o.hitch(this,"_updateImages"))},_updateImages:function(){this._loggedInState=i.loggedIn;var e=0;i.loggedIn&&e++,this.style===i.BUTTON_STYLE_WIDE&&(e+=2),this.backgroundImage=g+s[e],this.backgroundSelectedImage=g+a[e],this._hasSizeDimensions()&&this._triggerLayout()},_getContentSize:function(){return{width:i.loggedIn||this.style!==i.BUTTON_STYLE_WIDE?144:318,height:58}},properties:{style:{post:function(){this._updateImages()},value:i.BUTTON_STYLE_NORMAL}}})});