1import{a as ve}from"./chunk-MDSGFDAC.js";import{b as ge,d as L}from"./chunk-7I55YF5A.js";import{a as _e}from"./chunk-PBBXP6MP.js";import{a as P,e as fe}from"./chunk-PBGK7JUD.js";import"./chunk-CHXQQ5H5.js";import"./chunk-FHF4ZBMD.js";import{c as le}from"./chunk-2TBEF6CK.js";import{H as he,La as ye,b as de,e as pe,ga as ue,t as me}from"./chunk-4GG7V4GP.js";import{a as re,c as ce}from"./chunk-2G25NAWI.js";import{B as oe,d as ae,e as se,k as E}from"./chunk-FF2NWXCA.js";import"./chunk-4O3FVBGX.js";import{$c as ne,Ac as ee,Bc as ie,Cc as te,Eb as j,F as N,Gb as $,Hb as W,Mb as u,Nb as r,Ob as d,Pb as b,Pc as A,Tb as x,Ua as B,Ub as D,Va as H,Wb as R,X as g,_a as m,_b as C,a as k,ac as p,b as K,ec as J,fa as M,fc as U,gc as z,jb as S,jc as O,ka as y,la as f,m as V,ma as w,mc as Q,na as I,oc as _,pc as T,qb as G,rc as X,tc as Y,uc as q,vc as Z,wb as F}from"./chunk-KG2ZUT5X.js";var Fe=()=>({width:"40rem"});function be(s,i){if(s&1){let e=R();r(0,"img",28),C("click",function(){y(e);let t=p();return f(t.navigateToLogin())}),d()}if(s&2){let e=p();u("src",e.company_logo,H)}}function Ce(s,i){if(s&1){let e=R();r(0,"img",29),C("click",function(){y(e);let t=p();return f(t.navigateToLogin())}),d()}}function we(s,i){s&1&&(w(),x(0),b(1,"use",35),D())}function Re(s,i){s&1&&(w(),x(0),b(1,"use",36),D())}function Te(s,i){if(s&1&&F(0,Re,2,0,"ng-container",33),s&2){let e=p().$implicit,n=O(7);u("ngIf",e.tabStatus==="complete")("ngIfElse",n)}}function Ie(s,i){s&1&&(w(),b(0,"use",37))}function xe(s,i){if(s&1&&(r(0,"div",30)(1,"span",31),w(),r(2,"svg",32),F(3,we,2,0,"ng-container",33)(4,Te,1,2,"ng-template",null,0,A)(6,Ie,1,0,"ng-template",null,1,A),d(),I(),r(8,"div",34),_(9),d()()()),s&2){let e=i.$implicit,n=O(5);m(3),u("ngIf",e.tabStatus==="current")("ngIfElse",n),m(6),T(e.name)}}function De(s,i){if(s&1&&(r(0,"div",47)(1,"span"),_(2),d()()),s&2){let e=p(3);m(2),T(e.getRecaptchaError())}}function Ee(s,i){if(s&1){let e=R();r(0,"div",41)(1,"div",42),b(2,"div",43),F(3,De,3,1,"div",44),r(4,"div",45),_(5," By clicking on Register, you agree to our "),r(6,"a",46),C("click",function(){y(e);let t=p(2);return f(t.showTermsDialog())}),_(7,"Terms and Conditions"),d()()()()}if(s&2){let e=p(2);m(3),u("ngIf",e.getRecaptchaError())}}function Oe(s,i){if(s&1){let e=R();r(0,"div",49)(1,"div",50)(2,"div",51),_(3),d(),r(4,"div",52),C("click",function(){let t=y(e).$implicit,a=p(3);return f(a.removeAdditionalForm(t.id))}),w(),r(5,"svg",32),b(6,"use",53),d()()(),I(),r(7,"div",42)(8,"app-create-dynamic-form",54),C("formReady",function(t){let a=y(e).$implicit,l=p(3);return f(l.onAdditionalFormReady(t,a.id))}),d()()()}if(s&2){let e=i.$implicit,n=i.index,t=p(3);m(3),X("",t.tabKey==="licenses"?"License":"Certificate"," #",n+1),m(5),u("formId","additionalForm_"+e.id)("fields",e.fields)("columns",2)("showButtons",!1)("useDialogFooter",!1)("nonCompactStates",t.nonCompactStates)}}function Ae(s,i){if(s&1&&(x(0),F(1,Oe,9,8,"div",48),D()),s&2){let e=p(2);m(),u("ngForOf",e.additionalForms)}}function Pe(s,i){if(s&1){let e=R();r(0,"div",49)(1,"div",42)(2,"p-button",55),C("click",function(){y(e);let t=p(2);return f(t.addAdditionalForm())}),d()()()}if(s&2){let e=p(2);m(2),u("label",ee("Add ",e.tabKey==="licenses"?"License":"Certificate"))}}function Le(s,i){if(s&1){let e=R();r(0,"div")(1,"app-create-dynamic-form",38),C("formReady",function(t){y(e);let a=p();return f(a.onFormReady(t))})("formSubmitSuccess",function(t){y(e);let a=p();return f(a.onFormSubmit(t))})("passwordInput",function(t){y(e);let a=p();return f(a.onPasswordInput(t.event))})("emailBlur",function(t){y(e);let a=p();return f(a.onEmailBlur(t))})("fieldChange",function(t){y(e);let a=p();return f(a.onFieldChange(t))})("previousEvent",function(){y(e);let t=p();return f(t.onPreviousClick())})("nextEvent",function(){y(e);let t=p();return f(t.onNextClick())}),F(2,Ee,8,1,"div",39)(3,Ae,2,1,"ng-container",22)(4,Pe,3,2,"div",40),d()()}if(s&2){let e=p();m(),u("formId","personalDetailsForm")("fields",e.sectionFormControls)("columns",2)("showButtons",!0)("showCancelButton",!1)("useDialogFooter",!0)("submitLabel",e.buttonLabel)("showPreviousButton",e.shouldShowPreviousButton())("previousLabel",e.getPreviousButtonLabel())("showNextButton",e.shouldShowNextButton())("nextLabel","Skip")("passwordHelpText",e.passwordHelpText)("showPasswordSuggestions",e.showPasswordSuggestions)("nonCompactStates",e.nonCompactStates)("gridClass",e.tabKey==="register_details"?"formgrid grid formRow":"formgrid grid formRow formHr"),m(),u("ngIf",e.tabKey==="register_details"),m(),u("ngIf",(e.tabKey==="licenses"||e.tabKey==="certifications")&&e.additionalForms.length>
10),m(),u("ngIf",(e.tabKey==="licenses"||e.tabKey==="certifications")&&e.additionalForms.length<2)}}function ke(s,i){s&1&&(r(0,"div",56)(1,"span",57),_(2,"Terms and Conditions"),d()())}var Se=class s{constructor(i,e,n,t,a,l,c,o){this._router=i;this._toasterService=e;this._userAuthService=n;this._cd=t;this.confirmationService=a;this._myProfileService=l;this._fieldDependencyService=c;this._datePipe=o}_router;_toasterService;_userAuthService;_cd;confirmationService;_myProfileService;_fieldDependencyService;_datePipe;destroy$=new V;buttonLabel="";companyId="";tabKey="register_details";visibleSections=[];currentTab="";sectionFormControls=[];passwordHelpText=[];passwordValidationRegex="";showPasswordSuggestions=!1;encJobSeekerId="";isRegDetailsFinish=!1;nonCompactStates=[];originalStates=[];originalTypeOptions=[];signupForm;additionalForms=[];additionalFormIdCounter=0;_recaptchaRetryCount=0;MAX_RECAPTCHA_RETRIES=10;_recaptchaWidgetId=null;_dynamicFieldService=M(fe);firstName="";lastName="";email="";previousEmailValue="";specialityOptions=[];primarySpecialityOptions=[];PERSONAL_DETAILS_FORM_ID="personalDetailsForm";dynamicFormComponent;company_logo="";titleData={register_details:{mainTitle:"Personal Details",subTitle:"Please fill the below details to register for an account",icon:"assets/images/icons.svg#icon-user"},personal_details:{mainTitle:"Professional Details",subTitle:"Please enter the below details to complete your profile",icon:"assets/images/icons.svg#icon-professional"},documents:{mainTitle:"Documents",subTitle:"Please upload the below documents to complete your profile",icon:"assets/images/icons.svg#icon-Documents"},certifications:{mainTitle:"Certifications",subTitle:"Please upload the below certificates to complete your profile",icon:"assets/images/icons.svg#signUp-certification"},licenses:{mainTitle:"Licenses",subTitle:"Please upload the below licenses to complete your profile",icon:"assets/images/icons.svg#icon-licenses-signup"}};showTerms=!1;termsConditions="";ngOnInit(){this.companyId=window.GlobalRouteParams.getCompanyId()||"",this.firstName=window.GlobalRouteParams.getParam("firstname")||"",this.lastName=window.GlobalRouteParams.getParam("lastname")||"",this.email=window.GlobalRouteParams.getParam("email")||"",document.body.classList.add("signup-page"),this.setupRecaptchaCallbacks(),this.setupCascadingDropdowns(),this.get
1SignupConfig(),this.getCompanyLogo()}ngAfterViewInit(){}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this._dynamicFieldService.unregisterSubmitHandler("personalDetailsForm"),this._dynamicFieldService.unregisterForm("personalDetailsForm"),document.body.classList.remove("signup-page")}getSignupConfig(){let i={encCompanyId:this.companyId,tabKey:this.tabKey};this.tabKey!="register_details"&&(i.encJobSeekerId=this.encJobSeekerId),this._userAuthService.getSignupConfig(i).pipe(g(this.destroy$)).subscribe(e=>{if(e.status===1){let n=this.visibleSections.filter(o=>o.tabStatus==="complete").map(o=>o.key);this.visibleSections=e.data.visibleSections,this.currentTab=e.data.currentTab,this.termsConditions=e.data.termsAndConditions,n.forEach(o=>{this.changeSectionStatus(o,"complete")}),this.setCurrentTab(this.tabKey);let t=e.data.tabData.standardFields,a=e.data.tabData.customFields?.length>0?e.data.tabData.customFields:[],l=e.data.tabData.eeoFields?e.data.tabData.eeoFields:[],c=[...t,...l,...a];if((this.tabKey==="certifications"||this.tabKey==="licenses")&&Array.isArray(c)&&c.length>0&&Array.isArray(c[0])){this.sectionFormControls=c[0]||[],this.additionalForms=[],this.additionalFormIdCounter=0;for(let o=1;o<c.length;o++)this.additionalFormIdCounter++,this.additionalForms.push({id:this.additionalFormIdCounter,fields:c[o]||[]})}else this.sectionFormControls=c||[],this.tabKey!=="certifications"&&this.tabKey!=="licenses"&&(this.additionalForms=[],this.additionalFormIdCounter=0);if(this.buttonLabel=e.data.buttonLabel,this.tabKey==="register_details")this.passwordHelpText=e.data.passwordValidation?.pwdMatchText||[],this.passwordValidationRegex=e.data.passwordValidation?.regex||"",this.applySignupPasswordValidation();else if(this.tabKey==="licenses"){this.nonCompactStates=e.data.tabData.nonCompactStates||[];let o=this.sectionFormControls.find(v=>v.key==="stateIds");o&&o.options&&(this.originalStates=[...o.options]);let h=this.sectionFormControls.find(v=>v.key==="compact");h&&(!("value"in h)||h.value===""||h.value===null||h.value===void 0)&&(h.value="0"),this.storeOriginalTypeOptions()}else if(this.tabKey==="certifications")this.storeOriginalTypeOptions();else if(this.tabKey==="personal_details"){this.specialityOptions=[],this.primarySpecialityOptions=[];let o=this.sectionFormControls.find(v=>v.key==="country"),h=this.sectionFormControls.find(v=>v.key==="state");o&&h&&(o.value||h.options&&(h.options=[]))}this._cd.detectChanges()}else this._toasterService.error("Signup",e.message),this.navigateToLogin()})}navigateToLogin(){this._router.navigate(["/login/"+this.companyId])}isTabClickable(i){return i==="register_details"?!this.isRegDetailsFinish:this.isRegDetailsFinish}navigateToSection(i){this.isTabClickable(i)&&(this.tabKey=i,this.additionalForms=[],this.additionalFormIdCounter=0,this.getSignupConfig())}onFormSubmit(i){if((this.tabKey==="licenses"||this.tabKey==="certifications")&&this.additionalForms.length>0&&this.validateAllAdditionalForms().length>0){window.GlobalError.showError("MISSING_REQUIRED_FIELDS");return}let e={encCompanyId:this.companyId,tabKey:this.tabKey,formData:this.getAllFormsData(i)};if(this.tabKey==="register_details"){let t=this.signupForm?.get("gRecaptchaResponse")?.value;if(!t){this.signupForm?.get("gRecaptchaResponse")?.markAsTouched(),window.GlobalError.showError("MISSING_REQUIRED_FIELDS");return}e.gRecaptchaResponse=t}else e.encJobSeekerId=this.encJobSeekerId;if(this.tabKey==="personal_details"){e.formData.dateOfBirth&&e.formData.dateOfBirth!=""&&(e.formData.dateOfBirth=this._datePipe.transform(e.formData.dateOfBirth,"yyyy-MM-dd")),e.formData.workAuthorizationExpiry&&e.formData.workAuthorizationExpiry!=""&&(e.formData.workAuthorizationExpiry=this._datePipe.transform(e.formData.workAuthorizationExpiry,"yyyy-MM-dd")),this.transformDateFields(e.formData,this.sectionFormControls),e.formData.city&&typeof e.formData.city=="object"&&e.formData.city.code?e.formData.city=e.formData.city.code:(!e.formData.city||typeof e.formData.city!="string")&&(e.formData.city="");let t=a=>a==null||a===""?"":Array.isArray(a)?a.map(c=>typeof c=="string"?c.trim():c&&typeof c=="object"?String(c.code||c.id||"").trim():"").filter(c=>!!c).join(","):typeof a=="object"&&(a.code||a.id)?String(a.code||a.id):typeof a=="str
1ing"?a:"";e.formData.preferredLocation!==void 0&&(e.formData.preferredLocation=t(e.formData.preferredLocation)),e.formData.preferred_location!==void 0&&(e.formData.preferred_location=t(e.formData.preferred_location))}(this.tabKey==="licenses"||this.tabKey==="certifications")&&Array.isArray(e.formData)&&e.formData.forEach(t=>{t.expiryDate&&t.expiryDate!=""&&(t.expiryDate=this._datePipe.transform(t.expiryDate,"yyyy-MM-dd"))});let n=this.tabKey;this._userAuthService.saveTab(e,this.tabKey).pipe(g(this.destroy$)).subscribe(t=>{if(t.status===1){let a="Registration Successful";if(this.tabKey!="register_details"&&(a="Registration Process"),this.tabKey!="licenses"&&this._toasterService.success(a,t.message),this._cd.detectChanges(),this.tabKey==="register_details"&&(this.isRegDetailsFinish=!0),t.isComplete){this.showConfirm(),this.encJobSeekerId=t.encJobSeekerId;return}this.navigateToSection(t.nextTabKey),this.updateTabStatusAfterSubmit(n,t.nextTabKey),this.encJobSeekerId=t.encJobSeekerId}else this._toasterService.error("Signup",t.message)})}applySignupPasswordValidation(){this.tabKey!=="register_details"||!this.passwordValidationRegex||!this.signupForm||this._dynamicFieldService.setPasswordRegexValidator("personalDetailsForm","password",this.passwordValidationRegex)}onPasswordInput(i){let e=i.target?.value||"";this.showPasswordSuggestions=e&&e.length>0,this.validatePassword(e)}validatePassword(i){this.showPasswordSuggestions=!!(i&&i.length>0);let e=this._dynamicFieldService.validatePasswordPatterns(i,this.passwordHelpText);return this._cd.detectChanges(),e}onEmailBlur(i){let e=(i.email||"").trim();if(!e){this.previousEmailValue="",this._dynamicFieldService.clearFieldError("personalDetailsForm",i.field?.key,"emailAlreadyExists");return}e===this.previousEmailValue&&this.previousEmailValue!==""||(this.previousEmailValue=e,this.checkEmailExists(e,i.field.key))}checkEmailExists(i,e){if(this.tabKey!=="register_details"||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i))return;let t={encCompanyId:this.companyId,email:i};this._userAuthService.emailExists(t).pipe(g(this.destroy$)).subscribe(a=>{a.status===1?this._dynamicFieldService.clearFieldError("personalDetailsForm",e,"emailAlreadyExists"):a.message==="Email is already registered"&&(this._toasterService.error("Signup","An account with this email already exists."),this._dynamicFieldService.setFieldError("personalDetailsForm",e,"emailAlreadyExists"))})}onFormReady(i){if(this.signupForm=i,this.tabKey==="register_details"){let e=this.signupForm.get("firstname");this.firstName&&e&&e.setValue(this.firstName);let n=this.signupForm.get("lastname");this.lastName&&n&&n.setValue(this.lastName);let t=this.signupForm.get("email");this.email&&t?(t.setValue(this.email),this.previousEmailValue=this.email.trim()):this.previousEmailValue=""}else this.previousEmailValue="";if(this._dynamicFieldService.registerSubmitHandler("personalDetailsForm",e=>{}),this.tabKey==="register_details"&&(this._dynamicFieldService.addPasswordMatchValidator("personalDetailsForm","password","confirmPassword"),this.applySignupPasswordValidation(),this.signupForm.addControl("gRecaptchaResponse",new pe("",de.required)),setTimeout(()=>{this.loadRecaptchaScript("g-recaptcha-gRecaptchaResponse")},100)),this.tabKey==="licenses"||this.tabKey==="certifications"){let e=this.getTypeFieldKey(),n=this.signupForm.get(e);n&&n.valueChanges.pipe(g(this.destroy$)).subscribe(()=>{this.updateAllTypeOptions()})}this.tabKey==="personal_details"&&(this.initializeCascadingOptions(this.signupForm),this.setupCountryStateSubscription(this.signupForm))}setupRecaptchaCallbacks(){window.onSignupRecaptchaSuccess=i=>{this.signupForm?.get("gRecaptchaResponse")?.setValue(i)},window.onSignupRecaptchaExpired=()=>{this.signupForm?.get("gRecaptchaResponse")?.setValue("")},window.onSignupRecaptchaError=()=>{this.signupForm?.get("gRecaptchaResponse")?.setValue("")}}loadRecaptchaScript(i){if(typeof window.grecaptcha>"u"){let e=document.createElement("script");e.src="https://www.google.com/recaptcha/api.js?onload=onSignupRecaptchaLoad&render=explicit",e.async=!0,e.defer=!0,document.head.appendChild(e),window.onSignupRecaptchaLoad=()=>{this.renderRecaptcha(i)}}else setTimeout(()=>this.renderRecaptcha(i),100)}renderRecaptcha(i){if(typeof window.grecaptcha<"u")try{let e=document.getElementById(i);if(!e){this._recaptchaRetryCount++,this._recaptchaRetryCount<this.MAX_RECAPTCHA_RETRIES?setTimeout(()=>this.renderRecaptcha(i),100):this._recaptchaRetryCount=0;return}if(this._recaptchaWidgetId!==null){try{window.grecaptcha.reset(this._recaptchaWidgetId)}catch{}this._recaptchaWidgetId=null}this._recaptchaRetryCount=0,e.innerHTML="";let n=window.grecaptcha.render(i,{sitekey:re.captcha.sitekey,callback:"onSignupRecaptchaSuccess","expired-callback":"onSignupRecaptchaExpired","error-callback":"onSignupRecaptchaError"});this._recaptchaWidgetId=n}catch{this._recaptchaRetryCount++,this._recaptchaRetryCount<this.MAX_RECAPTCHA_RETRIES?setTimeout(()=>this.renderRecaptcha(i),200):this._recaptchaRetryCount=0}}getRecaptchaError(){let i=this.signupForm?.get("gRecaptchaResponse");return i?.invalid&&i?.touched?"Please complete the reCAPTCHA verification":null}resetRecaptcha(){if(this.signupForm?.get("gRecaptchaResponse")?.setValue(""),this.setupRecaptchaCallbacks(),typeof window.grecaptcha<"u")if(this._recaptchaWidgetId!==null)try{window.grecaptcha.reset(this._recaptchaWidgetId)}catch{this._recaptchaWidgetId=null,setTimeout(()=>this.renderRecaptcha("g-recaptcha-gRecaptchaResponse"),100)}else setTimeout(()=>this.renderRecaptcha("g-recaptcha-gRecaptchaResponse"),100);else this.loadRecaptchaScript("g-recaptcha-gRecaptchaResponse")}
1changeSectionStatus(i,e){let n=this.visibleSections.find(t=>t.key===i);n&&(n.tabStatus=e)}updateTabStatusAfterSubmit(i,e){this.changeSectionStatus(i,"complete"),this.changeSectionStatus(e,"current")}setCurrentTab(i){this.visibleSections.forEach(e=>{e.key===i&&e.tabStatus!=="complete"?e.tabStatus="current":e.tabStatus==="current"&&e.key!==i&&(e.tabStatus="pending")})}onFieldChange(i){i.field?.key==="email"&&((i.value||"").trim()||(this.previousEmailValue="",this._dynamicFieldService.clearFieldError("personalDetailsForm",i.field.key,"emailAlreadyExists")))}shouldShowPreviousButton(){return["register_details","documents","certifications","licenses"].includes(this.tabKey)}getPreviousButtonLabel(){return this.tabKey==="register_details"?"Sign In":"Previous"}shouldShowNextButton(){return!1}onNextClick(){let i=["register_details","personal_details","documents","certifications","licenses"],e=i.indexOf(this.tabKey);if(e<i.length-1)for(let n=e+1;n<i.length;n++){let t=i[n];if(this.visibleSections.find(l=>l.key===t)){this.navigateToSection(t);break}}}onPreviousClick(){if(this.tabKey==="register_details"){this.navigateToLogin();return}let i=["register_details","personal_details","documents","certifications","licenses"],e=i.indexOf(this.tabKey);if(e>0)for(let n=e-1;n>=0;n--){let t=i[n];if(this.visibleSections.find(l=>l.key===t)){this.navigateToSection(t);break}}}handleCompactChange(i){let e=["stateIds"],n=this.sectionFormControls.find(a=>e.includes(a.key));if(!n)return;let t=n.key;if(i===1||i==="1"){let a=this.originalStates.filter(c=>!this.nonCompactStates.includes(c.code));this._dynamicFieldService.updateFieldOptions("personalDetailsForm",t,a);let l=this.signupForm?.get(t)?.value;l&&this.nonCompactStates.includes(l)&&this._dynamicFieldService.clearFieldValue("personalDetailsForm",t)}else this._dynamicFieldService.updateFieldOptions("personalDetailsForm",t,this.originalStates);this._cd.detectChanges()}addAdditionalForm(){if(this.tabKey!=="licenses"&&this.tabKey!=="certifications")return;let i=this.getTypeFieldKey(),e=this.getSelectedTypeValues(i),n=this.sectionFormControls.map(t=>{let a="";(t.type===P.RADIO||t.type===P.RADIO_BUTTON)&&(t.key==="compact"?a="0":a=t.options?.[0]?.code||"");let l=K(k({},t),{value:a});return t.key===i&&t.options&&(l.options=t.options.filter(c=>!e.includes(c.code))),l});this.additionalFormIdCounter++,this.additionalForms.push({id:this.additionalFormIdCounter,fields:n}),this._cd.detectChanges()}getTypeFieldKey(){return this.tabKey==="certifications"?this.sectionFormControls.find(e=>e.key==="certificationType")?.key||"certificationType":this.tabKey==="licenses"?this.sectionFormControls.find(e=>e.key==="licenseType")?.key||"licenseType":""}getSelectedTypeValues(i){let e=[];
1if(!i)return e;let n=this.signupForm?.get(i)?.value;n&&e.push(n);for(let t of this.additionalForms)if(t.formRef){let a=t.formRef.get(i)?.value;a&&e.push(a)}return e}storeOriginalTypeOptions(){let i=this.getTypeFieldKey(),e=this.sectionFormControls.find(n=>n.key===i);e&&e.options&&(this.originalTypeOptions=[...e.options])}updateAllTypeOptions(){let i=this.getTypeFieldKey();if(!i||this.originalTypeOptions.length===0)return;let e=this.getSelectedTypeValues(i),n=this.signupForm?.get(i)?.value,t=this.originalTypeOptions.filter(a=>a.code===n||!e.includes(a.code));this._dynamicFieldService.updateFieldOptions("personalDetailsForm",i,t);for(let a of this.additionalForms)if(a.formRef){let l=a.formRef.get(i)?.value,c=this.originalTypeOptions.filter(o=>o.code===l||!e.includes(o.code));this._dynamicFieldService.updateFieldOptions(`additionalForm_${a.id}`,i,c)}this._cd.detectChanges()}removeAdditionalForm(i){let e=this.additionalForms.findIndex(n=>n.id===i);e>-1&&(this._dynamicFieldService.unregisterForm(`additionalForm_${i}`),this.additionalForms.splice(e,1),this.updateAllTypeOptions(),this._cd.detectChanges())}onAdditionalFormReady(i,e){let n=this.additionalForms.find(t=>t.id===e);if(n){n.formRef=i;let t=this.getTypeFieldKey(),a=i.get(t);a&&a.valueChanges.pipe(g(this.destroy$)).subscribe(()=>{this.updateAllTypeOptions()})}}validateAllAdditionalForms(){let i=[];for(let e of this.additionalForms)e.formRef&&(Object.keys(e.formRef.controls).forEach(n=>{let t=e.formRef.get(n);t&&(t.markAsTouched(),t.markAsDirty())}),e.formRef.invalid&&i.push(e.id));return this._cd.detectChanges(),i}getAllFormsData(i){if(this.tabKey!=="licenses"&&this.tabKey!=="certifications")return i;let e=[],n=this.transformFormDataForSubmission(i);n&&e.push(n);for(let t of this.additionalForms)if(t.formRef){let a=t.formRef.getRawValue(),l=this.transformFormDataForSubmission(a);l&&e.push(l)}return e}transformFormDataForSubmission(i){if(!i)return null;let e=this.getTypeFieldKey(),n=i[e];if(!n)return null;let t={};return this.tabKey==="certifications"?t.certificationTypeId=n:this.tabKey==="licenses"&&(t.licenseTypeId=n),this.tabKey==="licenses"&&i.licenseNumber!==void 0&&(t.licenseNumber=i.licenseNumber),this.tabKey==="licenses"&&i.profession!==void 0&&(t.profession=i.profession),this.tabKey==="licenses"&&i.compact!==void 0&&(t.compact=i.compact),i.certificateName!==void 0&&(t.certificateName=i.certificateName),i.name!==void 0&&!t.certificateName&&(t.certificateName=i.name),i.expiryDate!==void 0?t.expiryDate=i.expiryDate:i.expirationDate!==void 0&&(t.expiryDate=i.expirationDate),i.score!==void 0&&(t.score=i.score),i.stateIds!==void 0&&(t.stateIds=i.stateIds),i.documentFile!==void 0?t.documentFile=i.documentFile:i.docAttachment!==void 0&&(t.docAttachment=i.docAttachment),i.comments!==void 0?t.comments=i.comments:i.notes!==void 0&&(t.comments=i.notes),t}showTermsDialog(){this.showTerms=!0}onCancelTermsDialog(){this.showTerms=!1}setupCascadingDropdowns(){this._dynamicFieldService.fieldChange$.pipe(g(this.destroy$),N(i=>i.formId===this.PERSONAL_DETAILS_FORM_ID&&this.tabKey==="personal_details")).subscribe(i=>{i.field.key==="profession"&&this.onProfessionChange(i.value),i.field.key==="speciality"&&this.onSpecialityChange(i.value),i.field.key==="city"&&this.onCityChange(i.value)})}initializeCascadingOptions(i){let e=i.get("profession"),n=i.get("speciality");if(!e||!e.value||e.value.length===0){this._dynamicFieldService.updateFieldOptions(this.PERSONAL_DETAILS_FORM_ID,"speciality",[]),this._dynamicFieldService.updateFieldOptions(this.PERSONAL_DETAILS_FORM_ID,"primarySpeciality",[]),this.specialityOptions=[],this.primarySpecialityOptions=[],this.refreshFormView();return}let t=e.value&&e.value.length>0,a=n&&n.value&&n.value.length>0;if(t&&a){let o=this._dynamicFieldService.getFields(this.PERSONAL_DETAILS_FORM_ID).find(h=>h.key==="speciality"||h.key==="specialityId");if(o&&o.options&&Array.isArray(o.options)&&o.options.length>0){this.specialityOptions=o.options;let h=this.specialityOptions.filter(v=>n.value.includes(v.code));this.primarySpecialityOptions=h,this._dynamicFieldService.updateFieldOptions(this.PERSONAL_DETAILS_FORM_ID,"primarySpeciality",h),this.refreshFormView();return}}let l={encProfessionIds:e.value,encCompanyId:window.GlobalRouteParam
1s.getCompanyId()||""};this._myProfileService.getSpecialityOptions(l).pipe(g(this.destroy$)).subscribe(c=>{if(c.status===1){if(this.specialityOptions=c.data,this._dynamicFieldService.updateFieldOptions(this.PERSONAL_DETAILS_FORM_ID,"speciality",this.specialityOptions),n&&n.value&&n.value.length>0){let o=this.specialityOptions.filter(h=>n.value.includes(h.code));this.primarySpecialityOptions=o,this._dynamicFieldService.updateFieldOptions(this.PERSONAL_DETAILS_FORM_ID,"primarySpeciality",o)}else this._dynamicFieldService.updateFieldOptions(this.PERSONAL_DETAILS_FORM_ID,"primarySpeciality",[]),this.primarySpecialityOptions=[];this.refreshFormView()}})}onProfessionChange(i){if(this._dynamicFieldService.clearFieldValue(this.PERSONAL_DETAILS_FORM_ID,"speciality"),this._dynamicFieldService.clearFieldValue(this.PERSONAL_DETAILS_FORM_ID,"primarySpeciality"),this._dynamicFieldService.updateFieldOptions(this.PERSONAL_DETAILS_FORM_ID,"speciality",[]),this._dynamicFieldService.updateFieldOptions(this.PERSONAL_DETAILS_FORM_ID,"primarySpeciality",[]),this.specialityOptions=[],this.primarySpecialityOptions=[],!i||i.length===0){this.refreshFormView();return}this.getSpecialityOptions(i)}onSpecialityChange(i){if(this._dynamicFieldService.clearFieldValue(this.PERSONAL_DETAILS_FORM_ID,"primarySpeciality"),!i||i.length===0){this._dynamicFieldService.updateFieldOptions(this.PERSONAL_DETAILS_FORM_ID,"primarySpeciality",[]),this.primarySpecialityOptions=[],this.refreshFormView();return}let e=this.specialityOptions.filter(n=>i.includes(n.code));this.primarySpecialityOptions=e,this._dynamicFieldService.updateFieldOptions(this.PERSONAL_DETAILS_FORM_ID,"primarySpeciality",e),this.refreshFormView()}onCityChange(i){i&&typeof i=="object"&&i.postalCode?(this._dynamicFieldService.setFieldValue(this.PERSONAL_DETAILS_FORM_ID,"postalCode",i.postalCode),this.refreshFormView()):(this._dynamicFieldService.clearFieldValue(this.PERSONAL_DETAILS_FORM_ID,"postalCode"),this.refreshFormView())}getSpecialityOptions(i){let e={encProfessionIds:i,encCompanyId:window.GlobalRouteParams.getCompanyId()||""};this._myProfileService.getSpecialityOptions(e).pipe(g(this.destroy$)).subscribe(n=>{n.status===1?(this.specialityOptions=n.data,this._dynamicFieldService.updateFieldOptions(this.PERSONAL_DETAILS_FORM_ID,"speciality",this.specialityOptions),this.refreshFormView()):this._toasterService.error("Error",n.message)})}refreshFormView(){this.dynamicFormComponent&&this.dynamicFormComponent.refreshView(),this._cd.markForCheck()}setupCountryStateSubscription(i){let e=i.get("country"),n=i.get("state"),t=i.get("city");if(!e||!n)return;e.value||(this._dynamicFieldService.updateFieldOptions(this.PERSONAL_DETAILS_FORM_ID,"state",[]),this._dynamicFieldService.clearFieldValue(this.PERSONAL_DETAILS_FORM_ID,"state")),e.valueChanges.pipe(g(this.destroy$)).subscribe(l=>{l||(this._dynamicFieldService.updateFieldOptions(this.PERSONAL_DETAILS_FORM_ID,"state",[]),this._dynamicFieldService.clearFieldValue(this.PERSONAL_DETAILS_FORM_ID,"state"),t&&this._dynamicFieldService.clearFieldValue(this.PERSONAL_DETAILS_FORM_ID,"city"),this._dynamicFieldService.clearFieldValue(this.PERSONAL_DETAILS_FORM_ID,"postalCode"),this._cd.detectChanges())}),n&&n.valueChanges.pipe(g(this.destroy$)).subscribe(l=>{t&&this._dynamicFieldService.clearFieldValue(this.PERSONAL_DETAILS_FORM_ID,"city"),this._dynamicFieldService.clearFieldValue(this.PERSONAL_DETAILS_FORM_ID,"postalCode"),this._cd.detectChanges()})}transformDateFields(i,e){!i||!e||!Array.isArray(e)||e.forEach(n=>{if(n.type==="date"&&n.key){let t=i[n.key];t&&t!==""&&(i[n.key]=this._datePipe.transform(t,"yyyy-MM-dd"))}})}showConfirm(){this.confirmationService.showConfirmation({title:"Registration Success",message:"Your registration is complete! You can now log in and start applying for jobs.",confirmText:"OK",hideCancelButton:!0,confirmSeverity:"primary",closable:!1},()=>{this.navigateToLogin()})}getCompanyLogo(){let i={encCompanyId:this.companyId,encJobId:""};this._userAuthService.getCompanyLogoWithoutLogin(i).pipe(g(this.destroy$)).subscribe(e=>{e.status===1?this.company_logo=e.data.companyLogo:window.GlobalError.showErrorWithCustomMessage("ERROR",e.message)})}static \u0275fac=function(e){return new(e||s)(S(oe),S(ce),S(le),S(ne),S(ve),S(_e),S(ge),S(E))};static \u0275cmp=G({type:s,selectors:[["app-signup"]],viewQuery:function(e,n){if(e&1&&J(L,5),e&2){let t;U(t=z())&&(n.dynamicFormComponent=t.first)}},features:[ie([E])],decls:34,vars:12,consts:[["elseIfBlock",""],["elseBlock",""],[1,"flex","justify-content-center"],[1,"flex","w-full","min-h-screen"],[1,"col-3","p-0"],[1,"bgGray","suLeftSect"],[1,"mb-6"],["alt","company logo",2,"cursor","pointer",3,"src"],["src","assets/images/Ceipal-Healthcare Color Logo.svg","alt","company logo",2,"cursor","pointer"],[1,"logTtl-1","mb-2"],["class","flex align-items-center mb-3",4,"ngFor","ngForOf"],[1,"col-9","p-0"],[1,"suRightSect"],[1,"grid"],[1,"col-2","md:col-2","lg:col-1"],[1,"col-10"],[1,"regTtl","mb-5"],[1,"col-2","md:col-2","lg:col-1","pr-5"],[1,"icnBx-1"],["width","20","height","20","fill","none","xmlns","http://www.w3.org/2000/svg","viewBox","0 0 20 20"],[1,"subBlcTtl"],[1,"BlcTxt","mb-4"],[4,"ngIf"],[3,"visibleChange","visible","modal"],["pTemplate","header"],[1,"formgrid","grid","formRow"],[1,"field","col-12"],[1,"formL-2",3,"innerHTML"],["alt","company logo",2,"cursor","pointer",3,"click","
1src"],["src","assets/images/Ceipal-Healthcare Color Logo.svg","alt","company logo",2,"cursor","pointer",3,"click"],[1,"flex","align-items-center","mb-3"],[1,"flex","align-items-center"],["width","16","height","16","fill","none","xmlns","http://www.w3.org/2000/svg","viewBox","0 0 16 16"],[4,"ngIf","ngIfElse"],[1,"checkTxt","ml-2"],[0,"xlink","href","assets/images/icons.svg#icon-check-outline"],[0,"xlink","href","assets/images/icons.svg#icon-verifycheck"],[0,"xlink","href","assets/images/icons.svg#icon-circle"],[3,"formReady","formSubmitSuccess","passwordInput","emailBlur","fieldChange","previousEvent","nextEvent","formId","fields","columns","showButtons","showCancelButton","useDialogFooter","submitLabel","showPreviousButton","previousLabel","showNextButton","nextLabel","passwordHelpText","showPasswordSuggestions","nonCompactStates","gridClass"],["class","formgrid grid mt-4",4,"ngIf"],["class","formgrid grid formRow formHr mt-4",4,"ngIf"],[1,"formgrid","grid","mt-4"],[1,"col-12"],["id","g-recaptcha-gRecaptchaResponse"],["class","error mt-2",4,"ngIf"],[1,"tandc","mt-2"],[1,"cursor-pointer",2,"color","var(--p-primary-500)",3,"click"],[1,"error","mt-2"],["class","formgrid grid formRow formHr mt-4",4,"ngFor","ngForOf"],[1,"formgrid","grid","formRow","formHr","mt-4"],[1,"col-12","flex","align-items-center","justify-content-between","mb-4"],[1,"signupHdTxt"],[1,"cursor-pointer",3,"click"],[0,"xlink","href","assets/images/icons.svg#icon-delete"],[3,"formReady","formId","fields","columns","showButtons","useDialogFooter","nonCompactStates"],["variant","text",1,"pActBtn","showmore-link",3,"click","label"],[1,"inline-flex","items-center","justify-center","gap-2"],[1,"popup-title"]],template:function(e,n){e&1&&(r(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6),$(5,be,1,1,"img",7)(6,Ce,1,0,"img",8),d(),r(7,"div",9),_(8,"Sign Up"),d(),r(9,"div"),F(10,xe,10,3,"div",10),d()()(),r(11,"div",11)(12,"div",12)(13,"div",13),b(14,"div",14),r(15,"div",15)(16,"div",16),_(17,"New Account Registration"),d()()(),r(18,"div",13)(19,"div",17)(20,"div",18),w(),r(21,"svg",19),b(22,"use"),d()()(),I(),r(23,"div",15)(24,"div",20),_(25),d(),r(26,"div",21),_(27),d(),F(28,Le,5,18,"div",22),d()()()()()(),r(29,"p-dialog",23),Z("visibleChange",function(a){return q(n.showTerms,a)||(n.showTerms=a),a}),F(30,ke,3,0,"ng-template",24),r(31,"div",25)(32,"div",26),b(33,"div",27),d()()()),e&2&&(m(5),W(n.company_logo?5:6),m(5),u("ngForOf",n.visibleSections),m(12),j("href",n.titleData[n.tabKey].icon,null,"xlink"),m(3),T(n.titleData[n.tabKey].mainTitle),m(2),T(n.titleData[n.tabKey].subTitle),m(),u("ngIf",n.sectionFormControls&&n.sectionFormControls.length>0),m(),Q(te(11,Fe)),Y("visible",n.showTerms),u("modal",!0),m(4),u("innerHTML",n.termsConditions,B))},dependencies:[ye,ae,se,he,me,ue,L],encapsulation:2})};export{Se as Signup};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.