+function(n,t){"use strict";var r=window.ContractFX=window.ContractFX||{},i;r.Controls=r.Controls||{};r.Controls.Auth=r.Controls.Auth||{};i=r.Controls.Auth.LoginPopup=function(t,i,r,u,f,e,o,s,h,c){this._popup=t;this._tbxEmail=i;this._tbxPass=r;this._btnCancel=u;this._btnSignIn=f;this._rbUnsafeComp=e;this._rbSafeComp=o;this._cbxRemember=s;this._hfLoginType=n("#"+h);this._recaptchaLoginPopup=c;this._popupReady=n.Deferred();this._captchaChecked=!1;t.Init.AddHandler(this._popup_Init,this)};i.TYPE_CLIENT=1;i.TYPE_VENDOR=2;i.prototype._popup_Init=function(){this._container=n(this._GetContentContainer());this._popup.Shown.AddHandler(this._popup_OnShown,this);this._tbxEmail.KeyUp.AddHandler(this._tbxEmail_KeyUp,this);this._tbxEmail.TextChanged.AddHandler(this._tbxEmail_KeyUp,this);this._tbxPass.KeyUp.AddHandler(this._tbxPass_KeyUp,this);this._tbxPass.TextChanged.AddHandler(this._tbxPass_KeyUp,this);this._btnCancel.Click.AddHandler(this._btnCancel_Click,this);new t.LoginSecurity(this._rbUnsafeComp,this._rbSafeComp,this._cbxRemember);this._popupReady.resolve()};i.prototype._popup_OnShown=function(){this._RefreshClientType();this._UpdateSignInButton();this._checkRecaptchaApi()};i.prototype._tbxEmail_KeyUp=function(){this._UpdateSignInButton()};i.prototype._tbxPass_KeyUp=function(){this._UpdateSignInButton()};i.prototype._btnCancel_Click=function(n,t){t.processOnServer=!1;this._popup.Hide()};i.prototype._OnVerifyCert_Click=function(n){n.preventDefault();GoToPopupSized("https://seal.starfieldtech.com/verifySeal?sealID=bUjQkACqg21R3Db3KlYhul6F4uXpDC6TdWcHB0D9ROCXa1yznahe19L7",595,394)};i.prototype._GetContentContainer=function(){return this._popup.GetContentContainer(-1)};i.prototype._UpdateSignInButton=function(){var n=this._tbxEmail.GetText()!=""&&this._tbxPass.GetText()!=""&&this._captchaChecked;this._btnSignIn.SetEnabled(n)};i.prototype.SetType=function(n){this._hfLoginType.val(n);this._RefreshClientType()};i.prototype._RefreshClientType=function(){var n=this._container.find(".lbl-client-type"),t=this._hfLoginType.val()==i.TYPE_VENDOR,r=t?"Attendee":"Client";n.text(r)};i.prototype.Show=function(){this._popupReady.done(function(){this._popup.Show();this._tbxEmail.GetText()==""?this._tbxEmail.SetFocus():this._tbxPass.SetFocus()}.bind(this))};i.prototype._checkRecaptchaApi=function(){document.querySelectorAll("#"+this._recaptchaLoginPopup+"> div").length===0?($("#recaptcha-error-login-popup-msg").text("Something went wrong with Captcha. We are working on resolving this issue. Please try again later."),$(".recaptcha-error-login-popup").attr({style:" max-width: 326px; font-size: 12px;color: Red;display: flex;","class":"justify-content-center"})):$(".recaptcha-error-login-popup").attr({style:"display: none;"})}}(jQuery,ContractFX.Common)