1import{b as ue}from"./chunk-K5V3DMJX.js";import{Cb as ce,I as ae,L as D,eb as oe,kb as k,l as J,m as P,t as T,tb as v,u as ie,x as se,yb as ne}from"./chunk-XPV7SQ5Y.js";import{Bd as Y,De as m,Ie as E,Kd as h,R as q,Rd as A,S as z,Sd as Q,Ve as O,ab as B,e as V,fa as L,ff as ee,gf as te,if as w,jf as j,kf as _,la as f,le as l,lf as x,m as W,me as X,ne as U,od as Z,pa as i,pd as R,r as u,rf as S,uf as I,zf as re}from"./chunk-T5IFD54H.js";import{a as p,b as K}from"./chunk-CS7K6LXP.js";var he=767.98,de=(()=>{let s=class s{constructor(){this.platformService=i(ce),this.breakpointObserver=i(J)}getDeviceCategory(){let e=window.navigator.userAgent.toLowerCase(),t=this.detectBreakpoint();if(/ipad|tablet|tab/.test(e))return l.TABLET;if(/macintosh/.test(e)&&this.breakpointObserver.isMatched(P.Tablet))return l.TABLET;if(/mobile|android|windows phone/.test(e)){if(t===v.tablet)return l.TABLET;if(t===v.phone)return l.MOBILE;if(/android/.test(e)&&!/mobile/.test(e))return l.TABLET}return/iphone/.test(e)?l.MOBILE:t===v.phone?l.MOBILE:t===v.tablet?l.TABLET:l.DESKTOP}getOperatingSystem(){let e=navigator.userAgent.toLowerCase();return this.platformService.isAndroid()?U.ANDROID:this.platformService.isIos()?U.IOS:/macintosh|mac os/.test(e)?U.MACOS:/windows|win/.test(e)?U.WINDOWS:U.OTHER}getDeviceInfo(){return{device:this.getDeviceCategory(),platform:X.WEB,os:this.getOperatingSystem()}}detectBreakpoint(){let e=this.isPortrait(),t=e?window.innerWidth:window.innerHeight;return!e&&this.breakpointObserver.isMatched(P.Tablet)?v.tablet:t<=he?v.phone:this.breakpointObserver.isMatched(P.Tablet)?v.tablet:"Unknown"}isPortrait(){return screen.orientation?.type?screen.orientation.type.includes("portrait"):window.innerHeight>=window.innerWidth}};s.\u0275fac=function(t){return new(t||s)},s.\u0275prov=f({token:s,factory:s.\u0275fac,providedIn:"root"});let c=s;return c})();var g="active-subscriber",b="b2b-learner",N=(()=>{let s=class s{constructor(){this.router=i(h),this.apiService=i(D),this.currentUserStorage=i(S),this.authRedirectService=i(_),this.urlSerializer=i(Y),this.twoFaCompletedStorage=i(I),this.environment=i(O),this.identityEvents=i(ie),this.checkoutJourney=i(ae),this.checkoutEvents=i(oe),this.bodyTagService=i(T),this.deviceInfoService=i(de),this.sessionStorage=i(re),this.frontendParameters$$=new V(null),this.frontendParameters$=this.frontendParameters$$.asObservable()}expressLogin(e){let t=p({token:e,source:"LMS_ADMIN"},this.deviceInfoService.getDeviceInfo());return this.apiService.executePost("users/login_by_express_token",t).pipe(u(r=>{if(r&&r.data&&r.data.id)if(this.identityEvents.signup(r.data),this.currentUserStorage.setCurrentUser(r.data),this.authRedirectService.getReturnUrl()!==null)this.authRedirectService.performRedirect();else{let o=r.data.permissionObjects.indexOf(m.BACKEND_ACCESS)!==-1,d=r.data.permissionObjects.indexOf(m.B2B_DASHBOARD_ACCESS)!==-1;o?window.location.href=this.environment.adminPanelUrl:d?window.location.href=this.environment.teamsUrl:this.router.navigate(["/"])}return r}))}getStateOrProvinceDropdownItems(e){return this.getStateOrProvince(e).pipe(u(t=>t.states.map(r=>({label:r.name,value:r.code}))))}getStateOrProvince(e){return this.apiService.executeGet(`states/listing?country=${e}`).pipe(u(t=>t?.data??{states:[]}))}login(e,t,r,n){let a=p({login:e,password:t,rememberMe:r,captcha:n,source:"LMS_ADMIN"},this.deviceInfoService.getDeviceInfo());return this.apiService.executePost("users/login",a).pipe(u(o=>{if(o&&o.data&&o.data.id){this.currentUserStorage.setCurrentUser(o.data);let d=o.data.permissionObjects.indexOf(m.BACKEND_ACCESS)!==-1,y=o.data.permissionObjects.indexOf(m.B2B_DASHBOARD_ACCESS)!==-1;if(o?.data?.subscriptions?.length?this.bodyTagService.setBodyClass(g):this.bodyTagService.removeBodyClass(g),o?.data?.subscriptions?.length?this.bodyTagService.setBodyAttribute("subscription-type",o?.data?.subscriptions?.map(C=>C.name).join(", ")):this.bodyTagService.removeBodyAttribute("subscription-type"),this.bodyTagService.setBodyAttribute("student-id",String(o?.data?.id)),this.bodyTagService.setBodyAttribute("student-email",String(o?.data?.email)),o.data.twoFaEnabled)this.authRedirectService.setAuthState(w.PENDING_2FA),this.twoFaCompletedStorage.setState(!1),this.router.navigate(["/auth/2fa"]);else{this.authRedirectService.setAuthState(w.COMPLETE),this.environment.build==="admin"&&!d&&(window.location.href=this.environment.dashboardPanelUrl);let C=this.authRedirectService.getReturnUrl()!==null&&this.authRedirectService.getReturnUrl()!=="/dashboard",$=this.currentUserStorage.getCurrentUser()?.blockLearnerDashboard;!C&&d&&$?window.location.href=this.environment.adminPanelUrl:!C&&y&&$?window.location.href=this.environment.teamsUrl:this.authRedirectService.performRedirect()}}return o}
1))}submitTwoFa(e){let t=p({twoFaCode:e},this.deviceInfoService.getDeviceInfo());return this.apiService.executePost("users/2fa_confirm",t).pipe(u(r=>{if(r&&r.data&&r.data.id){r?.data?.subscriptions?.length?this.bodyTagService.setBodyClass(g):this.bodyTagService.removeBodyClass(g),r?.data?.subscriptions?.length?this.bodyTagService.setBodyAttribute("subscription-type",r?.data?.subscriptions?.map(d=>d.name).join(", ")):this.bodyTagService.removeBodyAttribute("subscription-type"),this.bodyTagService.setBodyAttribute("student-id",String(r?.data?.id)),this.bodyTagService.setBodyAttribute("student-email",String(r?.data?.email)),this.twoFaCompletedStorage.setState(!0),this.authRedirectService.setAuthState(w.COMPLETE),this.currentUserStorage.setCurrentUser(r.data);let n=r.data.permissionObjects.indexOf(m.BACKEND_ACCESS)!==-1,a=r.data.permissionObjects.indexOf(m.B2B_DASHBOARD_ACCESS)!==-1,o=this.authRedirectService.getReturnUrl()!==null;!o&&n?window.location.href=this.environment.adminPanelUrl:!o&&a?window.location.href=this.environment.teamsUrl:this.authRedirectService.performRedirect()}return r}))}syncProfile(e=A.RECONNECTING_AND_RETRY_ACTION){return this.apiService.executeGet("users/profile",void 0,void 0,new Z().set(Q,e)).pipe(u(t=>{if(t?.data?.subscriptions?.length?this.bodyTagService.setBodyClass(g):this.bodyTagService.removeBodyClass(g),t?.data?.subscriptions?.length?this.bodyTagService.setBodyAttribute("subscription-type",t?.data?.subscriptions?.map(r=>r.name).join(", ")):this.bodyTagService.removeBodyAttribute("subscription-type"),this.bodyTagService.setBodyAttribute("student-id",String(t?.data?.id)),this.bodyTagService.setBodyAttribute("student-email",String(t?.data?.email)),t.data.companies.filter(r=>r.id!==0).length?this.bodyTagService.setBodyClass(b):this.bodyTagService.removeBodyClass(b),t&&t.data&&t.data.id){this.currentUserStorage.setCurrentUser(t.data);let r=t.data.frontendParameters?.reduce((n,{code:a,value:o})=>(n[a]=o,n),{});this.frontendParameters$$.next(r)}return t}))}getEnrolmentStat(){return this.apiService.executeGet("users/enrolment_statistics").pipe(u(e=>e?.data??{}))}studentProfile(){return this.apiService.executeGet("users/student_profile").pipe(u(e=>e?.data??{}))}register(e,t){let r=this.authRedirectService.getReturnUrl()||null,n=p({firstname:e.firstname,lastname:e.lastname,email:e.email,password:e.password,captcha:t,registrationType:this.resolveRegistrationType(r),referralUrl:r,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},this.deviceInfoService.getDeviceInfo());return this.apiService.executePost("users/registration",n).pipe(u(a=>(a?.data?.subscriptions?.length?this.bodyTagService.setBodyAttribute("subscription-type",a?.data?.subscriptions?.map(o=>o.name).join(", ")):this.bodyTagService.removeBodyAttribute("subscription-type"),this.bodyTagService.setBodyAttribute("student-id",String(a?.data?.id)),this.bodyTagService.setBodyAttribute("student-email",String(a?.data?.email)),a&&a.data&&a.data.id&&(this.checkoutJourney.markNewAccountRegistered(),this.identityEvents.signup(a.data),this.identityEvents.signUp(a.data,this.currentUserStorage.resolveRegisterSource(),this.currentUserStorage.resolveSocialSource()),this.currentUserStorage.setCurrentUser(a.data),this.authRedirectService.getReturnUrl()?this.authRedirectService.performRedirect():this.router.navigate(["/"])),a)))}updateParameter(e,t){return this.frontendParameters$.pipe(z()).subscribe(r=>{r&&(r[e]=t),this.frontendParameters$$.next(r)}),this.apiService.executePost("users/set_parameter",{key:e,value:t})}updateDashboardVisitedOnboardingStatistics(){return this.apiService.executePut("users/onboarding_statistics/update_dashboard_visited")}updateParameterSynchronously(e,t){this.apiService.executeBeacon("users/set_parameter",{key:e,value:t})}createNps(){return this.apiService.executePost("users/nps/create")}updateNps(e){return this.apiService.executePut("users/nps/update",e)}updateVideoSettings(e){return this.apiService.executePost("course_player/settings",e)}updateVideoSettingsSynchronously(e){this.apiService.executeBeacon("course_player/settings",e)}updateVideoProgress(e){return this.apiService.executePost("course_player/video_progress",e)}updateVideoProgressSynchronously(e){this.apiService.executeBeacon("course_player/video_progress",e)}getVideoSettings(){return this.apiService.executeGet("course_player/settings").pipe(u(e=>e?.data?.videoSettings??{}))}updateUserCourseSettingsSynchronously(e){this.apiService.executeBeacon("users/update_course_settings",e)}updateProfile(e,t){let r={firstname:e.firstname,lastname:e.lastname,email:e.email,company:e.company,job:e.job,timeZone:e.timeZone,imageUuid:e.image?.uuid,country:e.country,shareFeedback:e.shareFeedback,language:e.language,industry:e.industry,degree:e.degree,school:e.school,linkedinProfileUrl:e.linkedinProfileUrl};return this.apiService.executePost("users/update_profile",r,!1,t)}updatePassword(e,t,r,n){let a={oldPassword:e,newPassword:t,newPasswordAgain:r};
1return this.apiService.executePost("users/update_password",a,!1,n)}activateUserPartnershipToken(e,t,r,n,a,o=!1,d){let y={accountActivationToken:e,firstname:t,lastname:r,newPassword:n,newPasswordAgain:a,autologin:o};return this.apiService.executePost("users/account_activation",y,!1,d)}updatePasswordByResetToken(e,t,r,n=!1,a){let o={resetPasswordToken:e,newPassword:t,newPasswordAgain:r,autologin:n};return this.apiService.executePost("users/update_password_by_reset_token",o,!1,a)}passwordTokenVerify(e){return this.apiService.executeGet("users/verify_password_token/"+e)}resetPassword(e,t){let r={email:e,captcha:t};return this.apiService.executePost("users/reset_password_cloudflare",r)}logout(){return this.authRedirectService.clearAll(),this.currentUserStorage.setCurrentUser(null),this.checkoutJourney.reset(),this.sessionStorage.clear(),this.apiService.executeDelete("users/logout")}oauthLoginUrl(e){let t=this.environment.adminPanelUrl;this.environment.build==="dashboard"&&(t=this.environment.dashboardPanelUrl);let r=this.authRedirectService.isExternalReturnUrl()?"":this.authRedirectService.getReturnUrl()||"",n=this.deviceInfoService.getDeviceInfo(),a=this.router.createUrlTree(["/api/users/oauth_connect/",e],{queryParams:{successUrl:t+r,errorUrl:t+"auth/login?oauth_error=1",device:n.device,platform:n.platform,os:n.os,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone}});return new URL(this.urlSerializer.serialize(a),this.environment.apiUrl)}getTwoFaQrContents(){return this.apiService.executePost("users/2fa_qr")}setupTwoFa(e,t){let r={pinCode:e,enabled:t};return this.apiService.executePost("users/2fa_setup",r)}updateHonorPledge(e,t){let r={isAccepted:e,fullNameSignature:t};return this.apiService.executePost("users/update_honor_pledge",r)}getPricingPlanLinks(){return this.apiService.executeGet("pricing_plans/subscriptions/links").pipe(u(e=>(this.currentUserStorage.pricingPlanLinks$$.next(e.data),e.data)))}getCountries(){return this.apiService.executeGet("countries/listing").pipe(u(e=>this.currentUserStorage.countries$.next(e.data.countries)))}syncUser(){this.syncProfile(A.NONE).subscribe()}getTranscriptUrl(e=null,t=null){return e===null?new URL(t?`/api/users/transcript?companyId=${t}`:"/api/users/transcript",this.environment.apiUrl).toString():new URL("/api/users/transcript?bundleId="+e,this.environment.apiUrl).toString()}setNameConfirmed(){return this.apiService.executePost("users/set_name_confirmed")}showTour(){return this.apiService.executeGet("users/show_tour")}getUserDataToken(){return this.apiService.executeGet("users/user_data_token").pipe(u(e=>e.data))}delete(){return this.apiService.executeDelete("users/delete_my_account")}getCancellationScenario(){let e=new R().set("referer",window.location.href);return this.apiService.executeGet("scenarios/get_cancellation_proposal",e).pipe(u(t=>t.data.cancellationProposal),L(t=>{t.scenarioOptionCode&&this.bodyTagService.setBodyAttribute("cancellation",t.scenarioOptionCode??"")}))}getUserScenarioByOption(e){let t=new R().set("scenarioCode",e).set("referer",window.location.href);return this.apiService.executeGet("scenarios/get_option_code",t).pipe(u(r=>K(p({},r.data),{scenarioCode:e})),L(r=>{r.scenarioOptionCode&&this.bodyTagService.setBodyAttribute(e,r.scenarioOptionCode),this.checkoutEvents.lmsTestEnrollment(r)}))}resolveRegistrationType(e){return e?se(e)?E.CHECKOUT:E.REGISTRATION:E.REGISTRATION}};s.\u0275fac=function(t){return new(t||s)},s.\u0275prov=f({token:s,factory:s.\u0275fac,providedIn:"root"});let c=s;return c})();var G="logged-in",M="logged-out",Me=(()=>{let s=class s{constructor(){this.router=i(h),this.currentUserStorage=i(S),this.authRedirectService=i(_),this.userService=i(N),this.sidebar=i(k),this.notifierService=i(ne),this.notificationFacadeService=i(ue),this.bodyTag=i(T),this.environment=i(O);let e=i(B);this.renderer=e.createRenderer(null,null)}canActivate(e,t){return new Promise(r=>{let n=this.currentUserStorage.getCurrentUser();n?(this.bodyTag.removeBodyClass(M),this.bodyTag.setBodyClass(G),this.notificationFacadeService.reloadNotifications(!0,A.NONE),r(this.checkUserPermissions(e,t)),this.turnOffGlobalLoader(),n.companies.filter(a=>a.id!==0).length?this.bodyTag.setBodyClass(b):this.bodyTag.removeBodyClass(b)):this.userService.syncProfile().subscribe({next:()=>{this.turnOffGlobalLoader(),r(this.checkUserPermissions(e,t))},error:()=>{this.authRedirectService.getReturnUrl()||this.snapshotBackUrl(t),this.turnOffGlobalLoader(),r(!1)}})})}turnOffGlobalLoader(){let e=this.renderer.selectRootElement("#loader");this.renderer.setStyle(e,"display","none")}canActivateChild(e,t){return this.canActivate(e,t)}checkUserPermissions(e,t){let r=this.currentUserStorage.getCurrentUser();if(!r)return this.authRedirectService.getReturnUrl()||this.snapshotBackUrl(t),this.authRedirectService.setUtmParams(this.extractUtmParameters(t.url)),this.router.navigate(["/auth"],{queryParams:p({[ee]:t.url,[te]:j.AUTH_GUARD},this.extractUtmParameters(t.url))}),!1;if(this.authRedirectService.isExternalReturnUrl())return this.authRedirectService.performRedirect(),!1;if(r?.blockLearnerDashboard&&this.currentUserStorage.hasB2BAdminRole())return window.location.href=this.environment.teamsUrl,!1;if(r?.blockLearnerDashboard&&this.currentUserStorage.hasBackendAccess())return window.location.href=this.environment.adminPanelUrl,!1;if(r?.blockLearnerDashboard)return this.router.navigate([x.ACCESS_RESTRICTED]),!1;if(typeof e.data.permissionObjects>"u")return!0;
1if(typeof e.data.permissionObjects.find(a=>r.permissionObjects.indexOf(a)!==-1)>"u")if(r.permissionObjects.indexOf(m.DASHBOARD_ACCESS)!==-1&&r.permissionObjects.indexOf(m.BACKEND_ACCESS)===-1)this.currentUserStorage.setCurrentUser(null),window.location.href=this.environment.dashboardPanelUrl;else return this.notifierService.error("Access denied"),this.router.navigate(["/auth"],{queryParams:this.extractUtmParameters(t.url)}),!1;return!0}snapshotBackUrl(e){e.url&&this.authRedirectService.setReturnUrl(e.url,j.AUTH_GUARD)}extractUtmParameters(e){let t={},r=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"];try{let a=new URL(e,window.location.origin).searchParams;r.forEach(o=>{let d=a.get(o);d&&(t[o]=d)})}catch(n){let a=e.includes("?")?e.split("?")[1]:"",o=new URLSearchParams(a);r.forEach(d=>{let y=o.get(d);y&&(t[d]=y)})}return t}};s.\u0275fac=function(t){return new(t||s)},s.\u0275prov=f({token:s,factory:s.\u0275fac,providedIn:"root"});let c=s;return c})();var Ye=(()=>{let s=class s{constructor(){this.currentUserStorage=i(S),this.userService=i(N),this.router=i(h),this.sidebar=i(k),this.twoFaCompletedStorage=i(I),this.bodyTag=i(T);let e=i(B);this.renderer=e.createRenderer(null,null)}canActivate(e){let t=this.currentUserStorage.getCurrentUser();return this.applicationReady(),(t||this.currentUserStorage.getAuthorizationStatus())&&this.twoFaCompletedStorage.getState()?(this.router.navigate(["/"]),!1):(this.bodyTag.removeBodyClass(G),this.bodyTag.removeBodyClass(g),this.bodyTag.removeBodyClass(b),this.bodyTag.setBodyClass(M),!0)}canActivateChild(e){return this.canActivate(e)}applicationReady(){let e=this.renderer.selectRootElement("#loader");this.renderer.setStyle(e,"display","none"),this.sidebar.enabled$.next(!1)}};s.\u0275fac=function(t){return new(t||s)},s.\u0275prov=f({token:s,factory:s.\u0275fac,providedIn:"root"});let c=s;return c})();var rt=()=>{let c=i(S),s=i(h);return c.hasB2BStudentRole()||c.isFreeStudent()?(s.navigate(["/careers-roles/career-resources"]),!1):!0};var ht=(c,s)=>{let H=i(D),e=i(h),t=c.queryParams?.companyUuid;if(t!==""&&s.url.split("/")[1]===`invitation_accept?companyUuid=${t}`){let r=new R().set("companyUuid",t);return H.executeGet("users/invitation_accept",r).pipe(q(()=>{e.navigate([x.DASHBOARD_B2B_START])}))}return W(!0)};export{N as a,Me as b,Ye as c,ht as d,rt as e}; 2//# sourceMappingURL=chunk-RCU3ZRIF.js.map
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.