!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("../../../../common/v1/src")):"function"==typeof def&&def.amd?def("pcs-candidate-login-v1",["vue","../../../../common/v1/src"],t):((e=e||self).phw=e.phw||{},e.phw.PcsCandidateLoginV1=t(e.Vue,e.PcsCommon))}(this,function(p,a){"use strict";p=p&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p,a=a&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a;var i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};function e(e,t,i,o){var s,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;0<=r;r--)(s=e[r])&&(a=(n<3?s(a):3()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,$=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$/,C="signIn",P="signUp",J="resetPassword",S="signIn",W="forgotPassword",b="candidateProfileUpdated",k="ph:candidateLoggedinEvent",D="getUserProfileData",G="fyf_container",T="ph:bot:removeProfile",x="ph:site:removeProfile",L="apply",V="ph:hash:triggerCandidatePopup",z=27,Z=9,Q=13,X={upperCase:{regex:/(.*[A-Z].*)/,literal:"",hasError:!1},lowerCase:{regex:/(.*[a-z].*)/,literal:"",hasError:!1},numeric:{regex:/(.*\d.*)/,literal:"",hasError:!1},passwordLength:{regex:/(.{8,})/,literal:"",hasError:!1}},Y=[{key:/</g,value:"<"},{key:/>/g,value:">"},{key:/&/g,value:"&"},{key:/©/g,value:"©"},{key:/®/g,value:"®"},{key:/“/g,value:"“"},{key:/”/g,value:"”"},{key:/‘/g,value:"‘"},{key:/’/g,value:"’"},{key:/'/g,value:"'"},{key:/"/g,value:'"'},{key:/'/g,value:"'"}],O="fyfSignInHeading",M="fyfSignUpHeading",ee="applySignInHeading",te="applySignUpHeading",ie="savedJobsSignUpHeading",oe="savedJobsSignInHeading",F="loginEmail",R="loginPassword",se="pcs-candidate-login-v1";function ne(){this.constructor=m}function I(){var e=null!==g&&g.apply(this,arguments)||this;return e.flowType="",e.widgetContext={},e.elementTag=se,e.bindableModel=new K,e.commonService=a.CommonService,e.localStorage=a.LocalStorage,e.phenomAppManager=a.PhenomAppManager,e.translationFilter=a.TranslationFilter,e.candidateLoginService=new H,e.initialFlowType="",e.isPasswordVisible=!1,e.staySignIn=!0,e.profileDetails={profile:{}},e.isLoggedIn=!1,e.isDialogOpen=!1,e.signInModel={email:"",password:""},e.hasErrors=!1,e.errors=new B,e.step=S,e.isValidEmail=!1,e.isValidPassword=!1,e.isDropdownOpen=!1,e.socialProvider="",e.invalidCredentials=!1,e.resendEmail=!1,e.resetPasswordModel={rpToken:"",newPassword:""},e.pwdRegexMap=X,e.isHeadingDisabled=!1,e.cvUploaded=!1,e.tokenInvalid=!1,e.anonymousEmail="",e.showPasswordSrOnly=!1,e.passwordErrorSrOnly=!1,e.isFirstTimeUser=!0,e.userState="",e.isProfileDataAvailable=!1,e.widgetContent=void 0,e.signInHeading="",e.signUpHeading="",e.isEventRaisedForTriggerHashPopup=!1,e.ignoreMulTriggerHashPopup=!1,e.signUpSuccessSr=!1,e.signInSuccessSr=!1,e.privacyDataConsent=!1,e.privacyConsentError=!1,e.privacyConsentReqFlag=!1,e.piiConsentData={},e.piiConsentError=!1,e.piiConsentContext={},e.showConsentsForm=!1,e.submitData=!1,e.masterLiteralData={},e.isDisabled=!1,e.consentPrefill=!0,e.socialLoginContext={},e.preferredName=!1,e.subscriptions=[],e.isEmailValidationEnabled=!1,e.isVerifiedUser=!1,e.isResendFailed=!1,e.isShowValidationSuccessPopup=!1,e.isShowValidationFailurePopup=!1,e.isShowEmailValidationPopup=!1,e.privacyConsentPreCheck=!1,e.tokenExpiryTimeInMinutes=240,e.tokenExpiryTimeText="",e.isEmailValidationStatus=!1,e.isAccountDeletionStatus=!1,e.isCsrfGetLogoutFlowEnabled=!1,e.isEmailResend=!1,e.isResendBtnEnable=!0,e.resendEmailTimeOut=3e4,e.isDataFetch=!1,e}return g=a.BaseComponent,i(m=I,t=g),m.prototype=null===t?Object.create(t):(ne.prototype=t.prototype,new ne),I.prototype.widgetViewLoaded=function(){var i=this,t=(this.element=this.$el,this.getPiiConsentData(),this.getMasterLiteralData(),this.userState=this.phenomAppManager.getSegmentedUserState&&this.phenomAppManager.getSegmentedUserState(),this.isPrivacyDataConsentCheckBoxRequired(),this.isCsrfGetLogoutFlowEnabled=this.commonService.getSiteSettings("isCsrfGetLogoutFlowEnabled"),0==this.commonService.getSiteSettings("consentPrefill")&&(this.consentPrefill=!1),this.preferredName=this.commonService.getSiteSettings("preferredName"),window.location.hash);a.EventBus.$on(V,function(e){i.ignoreMulTriggerHashPopup=!0,setTimeout(function(){i.isEventRaisedForTriggerHashPopup&&!i.isLoggedIn&&("#profilelogin"===t?i.handleDialogModal(C):"#createprofile"===t&&i.handleDialogModal(P))},150)}),this.fetchValidateJwtToken().then(function(){i.getContextBasedHeading(),i.getStateBasedHeading(),i.widgetContext=i.widgetContext||{};var e=i.widgetContext.context,e=(i.isLoggedIn||"header"!==e||i.isEventRaisedForTriggerHashPopup||i.ignoreMulTriggerHashPopup||(i.isEventRaisedForTriggerHashPopup=!0,a.EventBus.$emit(V,{})),i.phenomAppManager.getSessionParams("validationStatus")),t=i.phenomAppManager.getSessionParams("accountDeletionStatus");i.isEmailValidationStatus=!!e,i.isAccountDeletionStatus=!!t,e&&"200"===e||t&&"200"===t?i.isShowValidationSuccessPopup=!0:(e&&("401"===e||"400"===e||"500"===e)||t&&("401"===t||"400"===t||"500"===t))&&(i.isShowValidationFailurePopup=!0),i.openEmailValidationStatusPopup(),(i.isShowValidationSuccessPopup||i.isShowValidationFailurePopup)&&i.candidateLoginService.makeDDORequest(l.v1.ddoKeyRemoveValidationDataFromSession,{}).then(function(e){}),i.isDataFetch=!0}),this.subscribeEvents(),this.flowType=this.flowType||P,this.initialFlowType=this.flowType,this.localStorage.getItem("_li")&&(this.isFirstTimeUser=!1),document.addEventListener("mouseup",this.handleDropdownOutsideScope,!0),document.addEventListener("keyup",this.handleDropdownOutsideScope,!0),this.initialFlowType==J&&this.checkValidToken(),(this.commonService.getSiteSettings("navItems")||{}).candidateHome||this.hideContainer(),this.updateTokenExpiry()},I.prototype.openEmailValidationStatusPopup=function(){var o=this;(this.isShowValidationSuccessPopup||this.isShowValidationFailurePopup)&&setTimeout(function(){var e=o.element.querySelector(o.isLoggedIn?".ph-a11y-after-close-focus-elem":o.isFirstTimeUser?".create-account-link":".sign-in-link"),t=o.element.querySelector(o.isShowValidationSuccessPopup?".email-val-success .btn":".email-val-failure .btn"),i=o.element.querySelector(".popup-modal-backdrop"),i=(i&&i.classList.add("active"),o.element.querySelector(o.isShowValidationSuccessPopup?".ph-ally-email-validation-success":".ph-ally-email-validation-failure"));document.addEventListener("keyup",o.handleValidationStatusEscape),document.addEventListener("click",o.handleValidationStatusEscape),i&&a.DialogManager.openDialog(i,t,e,null,null,!0)},250)},I.prototype.updateTokenExpiry=function(){this.tokenExpiryTimeInMinutes=parseInt(this.commonService.getSiteSettings("emailValidationTokenExpiry"))||this.tokenExpiryTimeInMinutes;var e=Math.floor(this.tokenExpiryTimeInMinutes/60),t=this.tokenExpiryTimeInMinutes%60;e&&(this.tokenExpiryTimeText+=e+(1