1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aa77719f-8e8d-5316-9940-d37f2e509c1b")}catch(e){}}(); 3(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,523912,e=>{"use strict";let t=e=>{if("string"==typeof e){let t=e.trim();if(t.length>0)return t}if(Array.isArray(e))for(let t of e){let e=t.trim();if(e.length>0)return e}};e.s(["firstNonEmptyQueryString",0,t,"getFirstNonEmptyRouterQueryValue",0,(e,a)=>{for(let i of a){let a=t(e[i]);if(void 0!==a)return a}}])},977045,505512,e=>{"use strict";var t=e.i(590579);let a={isEnabled:!1,isLoading:!1,isError:!1},i=(0,t.proxy)({...a});e.s(["authMigrationRegistrationDefaultState",0,a,"authMigrationRegistrationStore",0,i],977045);var r=e.i(91452);e.i(409649);var s=e.i(393259),o=e.i(370727);let n=(0,r.createContext)({cookieDomain:o.DEFAULT_COOKIE_DOMAIN,setCookieDomain:s.noop});e.s(["CookieContext",0,n],505512)},322868,e=>{e.q("/_next/static/media/b2bSingaporeLandscape.2mnpz5rl9zm-f.png")},56997,e=>{"use strict";let t={src:e.i(322868).default,width:1440,height:2700,blurWidth:4,blurHeight:8,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAICAYAAADeM14FAAAAk0lEQVR42gGIAHf/AJCNnv+MjJ7/iIma/4CBkv8Away1/7+uuP+8rbX/tKWs/wDqw7j/68i+/+3Lv//qxbj/AMKikv/Bo5b/y62d/+i9of8AT1xo/1Zfa/9ZYWz/enFy/wBJTlT/VFhf/15eZf+Oe3f/AId9ef+hk47/lYmG/6CKg/8Axquh/9G2qv/QtKn/z7Kl/yiOWWxN/Ov4AAAAAElFTkSuQmCC"};e.s(["b2bSingaporeLandscape",0,t],56997)},541938,399413,e=>{"use strict";var t,a=e.i(443248),i=e.i(535235);e.i(558917);var r=e.i(381865),s=e.i(723211);e.i(105663);var o=e.i(135136),n=e.i(911787),l=e.i(1612),u=e.i(977045);let d=()=>{let e=(0,o.useFeature)("auth.keycloakAuth"),{enabled:t}=(0,l.useAuthMigrationFeatureConfig)(),a=(0,n.useSnapshot)(u.authMigrationRegistrationStore);return{isEnabled:e||t&&a.isEnabled,isLoading:t&&a.isLoading,isError:a.isError}};e.s(["useIsKeycloakRegistrationEnabled",0,d],399413),e.i(727015);var c=e.i(333740);e.i(936574);var m=e.i(902993),h=e.i(462821),g=e.i(664584);e.i(484037);var p=e.i(580407),b=e.i(166569),v=e.i(743378),S=e.i(257721);e.i(745684);var E=e.i(56997);e.i(978379);var f=e.i(655913);e.i(282888);var A=e.i(396839);let P=()=>(0,a.jsx)(A.DotLottieReact,{src:"lottie/SG_LANDING_ANIMATION_202506.json",loop:!0,autoplay:!0,renderConfig:{autoResize:!0},layout:{fit:"contain",align:[0,1]},className:"h-screen overflow-hidden"}),y=({hideAnimation:e})=>(0,a.jsxs)(o.FeatureSwitch,{children:[(0,a.jsx)(o.Feature,{name:"profile.endowus",children:(0,a.jsx)(m.Grid,{item:!0,md:4,className:(0,b.twMerge)("hidden",!e&&"md:block"),style:{background:"radial-gradient(circle at 50% 20%, var(--navy-400) 0% ,var(--navy-650) 38%, var(--navy-850))"},children:(0,a.jsx)("div",{"data-testid":"BaseAuthLayout_Animation",children:(0,a.jsx)(P,{})})})}),(0,a.jsx)(o.Feature,{name:"profile.uobkh",children:(0,a.jsx)(m.Grid,{item:!0,md:4,className:(0,b.twMerge)("hidden",!e&&"md:block !p-0"),style:{background:"linear-gradient(180deg, rgba(103,110,133,1) 0%, rgba(249,210,199,1) 91%, rgba(204,175,167,1) 100%)"},children:(0,a.jsx)("div",{className:"relative h-screen w-full",children:(0,a.jsx)(f.Image,{"data-testid":"BaseAuthLayout_B2B_Image",alt:"B2b-singapore-landscape",src:E.b2bSingaporeLandscape,style:{objectFit:"cover"}})})})})]});var I=e.i(529054);e.i(668792);var C=e.i(713167),R=e.i(221813),x=e.i(91452);e.i(409649);var w=e.i(644859),T=e.i(706936),O=e.i(388602);e.i(762713);var D=e.i(87056),N=e.i(556347),_=e.i(693646),j=((t=j||{}).Idle="Idle",t.Loading="Loading",t.Success="Success",t.Error="Error",t);let L=({enabled:e=!0})=>{let[t,a]=(0,x.useState)({status:"Idle",data:void 0}),i=(0,x.useCallback)(async()=>{try{a({status:"Loading"});let e=await D.axios.get("https://cloudflare.com/cdn-cgi/trace"),t=e.data?.trim().split("\n").map(e=>e.split("=")),i=Object.fromEntries(t);a({status:"Success",data:{countryCode:i?.loc}})}catch(e){N.Sentry.captureException(e,{level:"warning",tags:{[_.SentryTag.Location]:L.name}}),a({status:"Error",data:void 0})}},[]);return(0,x.useEffect)(()=>{e&&i()},[e,i]),t};e.i(471727);var k=e.i(385916),F=e.i(301555),M=e.i(505512);e.i(18522);var U=e.i(675093),V=e.i(959828),G=e.i(126962),B=e.i(541595),H=e.i(62129);let Q=({open:e,onClose:t,title:i,subtitle:r,closeLabel:s,children:o,testIds:n})=>{let l=(0,H.useMediaQuery)(`(max-width: ${B.theme.screens.sm})`);return(0,a.jsx)(G.DefaultModal,{open:e,onClose:t,hasCloseIcon:!0,classes:{content:"px-24 py-20 sm:px-40 sm:pb-40",dividers:"sm:border-b-0 border-muted"},"data-testid":n.modal,title:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{"data-testid":n.title,className:"heading-m text-default",children:i}),r&&(0,a.jsx)("div",{"data-testid":n.subtitle,className:"body-l text-muted",children:r})]}),actions:l?(0,a.jsx)(V.Button,{onClick:t,className:"w-full sm:w-fit",color:"secondary","data-testid":n.close,children:s}):null,children:(0,a.jsx)(g.Row,{rowSpacing:2,children:o})})};var K=e.i(855378),W=e.i(160167);let q=({countryCode:e,regionLanguageLabel:t,onClick:i,testIds:r})=>(0,a.jsx)(m.Grid,{item:!0,xs:12,className:"w-full",children:(0,a.jsx)(K.ButtonCard,{title:t,testids:{title:r.title},onClick:i,icon:(0,a.jsx)(W.CountryFlag,{countryCode:e,"data-testid":r.countryFlag})})});var $=e.i(131073);let z=({onClick:e,currentRegionOrLangLabel:t,testIds:i})=>(0,a.jsxs)(V.Button,{color:"secondary",onClick:e,className:"elevation-m flex justify-between gap-x-4 px-8","data-testid":i.button,children:[(0,a.jsx)("span",{className:"body-m ml-8 text-default","data-testid":i.label,children:t}),(0,a.jsx)($.ArrowDropDownIcon,{className:"text-600"})]}),Y=({open:e,onClose:t,handleRegionClick:i,subtitle:r,labelMap:s})=>(0,a.jsxs)(Q,{open:e,onClose:t,title:s.title,subtitle:r,closeLabel:s.close,testIds:{modal:"RegionSwitcherModal",title:"RegionSwitcherModal_Title",subt
3itle:"RegionSwitcherModal_Subtitle",close:"RegionSwitcherModal_Close"},children:[(0,a.jsx)(q,{countryCode:w.CountryCode.SG,regionLanguageLabel:s.singaporeRegion,onClick:()=>i(w.CountryCode.SG),testIds:{countryFlag:"RegionSwitcherModal_CountryFlag_SG",title:"RegionSwitcherModal_CountryName_SG"}}),(0,a.jsx)(q,{countryCode:w.CountryCode.HK,regionLanguageLabel:s.hongKongRegion,onClick:()=>i(w.CountryCode.HK),testIds:{countryFlag:"RegionSwitcherModal_CountryFlag_HK",title:"RegionSwitcherModal_CountryName_HK"}})]}),J=({onOpen:e})=>{let{t}=(0,U.useTranslation)();return(0,a.jsx)(z,{onClick:e,currentRegionOrLangLabel:t("platformRegionToggleButtonSingapore"),testIds:{button:"RegionSwitcherButton",label:"RegionSwitcherButton_LanguageName"}})},Z=({open:t,onClose:i,isFromDifferentRegion:r})=>{let{t:s}=(0,U.useTranslation)(),{data:o}=(0,k.useAppConfig)();return(0,a.jsx)(Y,{open:t,onClose:i,handleRegionClick:t=>{t===w.CountryCode.SG&&i?.(),t===w.CountryCode.HK&&o.webAppHkUrl&&(e.g.location.href=o.webAppHkUrl)},labelMap:{title:s(r?"onboardingRegionLanguageModalWrongRegionTitle":"platformRegionSwitcherModalTitle"),close:s("commonClose"),singaporeRegion:s("commonSingapore"),hongKongRegion:s("commonHongKong")},subtitle:r?s("platformRegionSwitcherModalTitle"):void 0})},X=()=>{let e,[t,i]=(0,x.useState)(!1),{open:r,onOpen:s,onClose:n}=(0,O.useModalState)(!1),{data:l}=(0,k.useAppConfig)(),{data:u}=L({enabled:l.enableGeolocationInfo}),d=(e=(()=>{let{cookieDomain:e}=(0,x.useContext)(M.CookieContext);return e})(),(0,x.useCallback)(t=>{(0,F.setCustomerLocale)(t,e)},[e]));return(0,T.useEffectOnce)(()=>{d(F.DEFAULT_SG_LOCALE)}),(0,x.useEffect)(()=>{u&&i(u?.countryCode!==w.CountryCode.SG)},[u]),(0,x.useEffect)(()=>{t&&s()},[t]),(0,a.jsxs)(o.Feature,{name:"auth.languageRegionSwitcher",children:[(0,a.jsx)(J,{onOpen:s}),(0,a.jsx)(Z,{open:r,onClose:n,isFromDifferentRegion:t})]})},ee=()=>{let e=R.ExternalLink.Homepage;return(0,a.jsxs)("div",{className:"elevation-s flex justify-between bg-emphasis px-24 py-20 min-h-[90px]",children:[(0,a.jsx)("div",{className:"flex items-center","data-testid":"BaseAuthTop_Logo",children:(0,a.jsx)(C.Link,{href:e,children:(0,a.jsx)(I.BrandTextLogo,{})})}),(0,a.jsx)(X,{})]})};e.s(["BaseAuthLayout",0,({children:e,hideHeader:t,hideAnimation:o})=>{let{pathname:n}=(0,i.useRouter)(),l=n===c.RootPath.CreateAccount||n===c.RootPath.CreateJointAccountInvite,u=(0,s.useIsKeycloakAuthEnabled)(),E=d(),{isEnabled:f,isLoading:A}=l?E:u,{onDismiss:P,banner:{value:I,enabled:C}}=(0,v.useOperationalBanner)(S.Locale.enSG);if(A)return(0,a.jsx)("div",{className:"flex h-screen items-center justify-center","data-testid":"BaseAuthLayout_KeycloakAuthLoading",children:(0,a.jsx)(r.PageLoader,{})});if(f)return(0,a.jsx)(a.Fragment,{children:e});let R=C&&(n===c.RootPath.Home||n===c.RootPath.Login)&&I.isVisibleOnLogin;return(0,a.jsxs)(g.Row,{className:"h-screen","data-testid":"BaseAuthLayout",children:[(0,a.jsxs)(m.Grid,{item:!0,xs:!0,container:!0,direction:"column",children:[R&&(0,a.jsx)(p.OperationalBanner,{title:I.title,de
3scription:I.description,onClose:I.isDismissible?()=>P():void 0}),(0,a.jsx)("div",{className:(0,b.cx)("sticky top-0",t&&"hidden"),children:(0,a.jsx)(ee,{})}),(0,a.jsx)(m.Grid,{item:!0,container:!0,xs:!0,justifyContent:"center",alignItems:"center",children:(0,a.jsx)(h.RootContainer,{className:"bg-default py-32",children:(0,a.jsx)("div",{className:"w-full max-w-500","data-testid":"BaseAuthLayout_Content",children:e})})})]}),(0,a.jsx)(y,{hideAnimation:o})]})}],541938)},597545,e=>{"use strict";var t=e.i(535235),a=e.i(91452);e.s(["useStableRouterQuery",0,()=>{let e=(0,t.useRouter)(),i=JSON.stringify(e.query),r=(0,a.useRef)(e.query),s=(0,a.useRef)(i);return s.current!==i&&(s.current=i,r.current=e.query),r.current}])},257827,436225,315566,180031,501299,e=>{"use strict";var t,a=e.i(91452);e.i(105663);var i=e.i(135136),r=e.i(227153),s=e.i(492379),o=e.i(440238);let n=e=>!!e&&"object"==typeof e&&("ERR_NETWORK"===e.code||"ECONNABORTED"===e.code||"ENOTFOUND"===e.code||"ECONNREFUSED"===e.code||0===(e.status??e.response?.status)||!e.response&&!!e.request);var l=e.i(599980);let u=[l.CustomerStatus.READY_TO_BE_REVIEWED,l.CustomerStatus.REVIEWED_WITH_DEFICIENCY,l.CustomerStatus.ADMIN_APPROVED_PENDING_SUPERADMIN_APPROVAL,l.CustomerStatus.PENDING_DOCUMENT_SUBMISSION,l.CustomerStatus.PENDING_ADMIN_APPROVAL],d=[l.CustomerStatus.ACTIVE,l.CustomerStatus.SUSPENDED,l.CustomerStatus.READY_TO_BE_REVIEWED,l.CustomerStatus.REVIEWED_WITH_DEFICIENCY,l.CustomerStatus.ADMIN_APPROVED_PENDING_SUPERADMIN_APPROVAL,l.CustomerStatus.PENDING_DOCUMENT_SUBMISSION,l.CustomerStatus.PENDING_ADMIN_APPROVAL];e.s(["ADD_GOAL_OVERVIEW_STATUS",0,u,"DASHBOARD_CUSTOMER_STATUS",0,d],436225);let c=async(e,t,a)=>{if(!e)return Promise.resolve(void 0);let i=e?.declarationsSubmissionV2&&(e?.personalDetails||e?.retrievedMyInfoPersonData),s=t===l.CustomerStatus.REGISTERING;return i&&s&&a?r.sg.onboarding.api.getMissingRequirement({urlValues:{customerId:a}}).then(e=>e.missingRequirements.length>0).catch(()=>void 0):s?Promise.resolve(void 0):Promise.resolve(!1)};var m=((t=m||{}).Idle="Idle",t.Success="Success",t.Error="Error",t);let h=async({customerId:e,isEnabled:t=!0})=>t?r.sg.onboarding.api.getVcQuestionRequirement({preserveNetworkErrors:!0,urlValues:{customerId:e}}).then(e=>({status:m.Success,value:e.isRequired})).catch(()=>({status:m.Error,value:void 0})):{status:m.Idle,value:void 0},g=async e=>e?.hasCompletedOnboarding?{success:!1,error:{type:"skipped"}}:r.sg.onboarding.api.getOnboardingV2({preserveNetworkErrors:!0}).then(e=>({success:!0,data:e})).catch(t=>n(t)?(e?.onNetworkError?.(t),{success:!1,error:{type:"network"}}):((0,s.isInvalidAccessTokenError)(t)&&e?.onUnauthorized?.(),{success:!1,error:{type:"fetch_failed"}})),p=async({customerId:e,isEnabled:t=!0})=>t&&e?r.sg.customer.api.getVcQuestionnaireStatus({preserveNetworkErrors:!0,urlValues:{customerId:e}}).then(e=>({status:m.Success,value:{isVc:e.isVc,hasFailedVc:e.hasFailedVc}})).catch(()=>({status:m.Error,value:void 0})):{status:m.Idle,value:void 0},b=async({shouldFetchIsRequiredForVcQuestions:e})=>{let t,a,i=!1;try{a=await r.sg.customer.api.getCustomerDetail({preserveNetworkErrors:!0})}catch(e){n(e)?(t={type:"network",status:e.status,code:e.code,message:e.message},i=!1):(i=!0,(0,s.isInvalidAccessTokenError)(e)&&(t={type:"unauthorized",status:401})),a=void 0}let l=!!a?.status&&d.includes(a.status),u=await g({hasCompletedOnboarding:l,onNetworkError:e=>{t||(t={type:"network",status:e.status,code:e.code,message:e.message})},onUnauthorized:()=>{t||(t={type:"unauthorized",status:401})}}),m=u.success?u.data:void 0,b=!u.success&&"fetch_failed"===u.error.type,v=a?.status?await c(m,a.status,a.customerId):void 0,S=a?.customerId?await h({customerId:a.customerId,isEnabled:!l&&!!e}):{value:void 0},E=a?.customerId?await p({customerId:a.customerId,isEnabled:l}):{value:void 0},f=(0,o.shouldBlockVcUser)({vcQuestionnaireStatus:E.value,customerStatus:a?.status});return{customerStatus:a?.status,customerFetchFailed:i,customerEmail:a?.email,isJointAccount:a?.isJointAccount,isAiEnabled:a?.singaporeSpecificDetails?.isAi,firstName:a?.personalDetails?.firstName,lastName:a?.personalDetails?.lastName,customerId:a?.customerId,email:a?.email,onboardingData:m,onboardingFetchFailed:b,hasMissingRequirement:v,errorContext:t,isRequiredForVcQuestions:S.value,shouldBlockVcUser:f}};e.s(["fetchUserInformationForRedirection",0,b],315566),e.s(["useFetchUserInformationForRedirection",0,()=>{let e=(0,i.useFeature)("onboarding.otherDetails.vcQuestionnaire");return(0,a.useCallback)(async()=>b({shouldFetchIsRequiredForVcQuestions:!!e}),[e])}],257827);var v=e.i(239821);e.i(179768);var S=e.i(56023);e.i(727015);var E=e.i(333740);let f=({onboardingData:e,canAccessSipQuestions:t})=>{let a=!t||!!e?.financialDetails?.financialQuestions;return!!e?.employmentDetails&&!!e?.financialDetails&&!!e?.investWithEndowus&&!!e?.taxDetails&&!!e?.educationDetail
3s&&a};e.s(["getUserHasOnboardingEmploymentFinancialDetails",0,f],180031);let A=({customerStatus:e,customerFetchFailed:t=!1,onboardingData:a,onboardingFetchFailed:i=!1,firstName:r,lastName:s,hasMissingRequirement:o,isRequiredForVcQuestions:n,canAccessSipQuestions:c,shouldBlockVcUser:m,errorContext:h})=>{let g=o??!0;if(h&&(0,S.logCommonError)(h,A.name),h?.type==="unauthorized"||!e)return E.RootPath.Login;let p=h?.type==="network";if(t&&!p)return E.RootPath.Login;if(e===l.CustomerStatus.REGISTERING&&!0===i&&!p)return`${E.OnboardingPath.UnknownError}?code=unknown-001`;if(e===l.CustomerStatus.REGISTERING&&!a?.onboardingStatus&&!i&&!p)return`${E.OnboardingPath.UnknownError}?code=unknown-004`;let b=e===l.CustomerStatus.REGISTERING&&a?.onboardingStatus===v.OnboardingStatus.InProgress;if(b&&!g)return E.OnboardingPath.LegalDeclarations;let P=!f({onboardingData:a,canAccessSipQuestions:c});if(b)if(a?.preOnboardingSubmission?.preferredFirstName===void 0&&void 0===r)return E.OnboardingPath.PreferredFirstName;else if(a?.preOnboardingSubmission?.preferredLastName===void 0&&void 0===s)return E.OnboardingPath.PreferredLastName;else if(!a.phoneDetails||!a.phoneDetails?.isVerified)return E.OnboardingPath.MobileVerification;else if(a?.retrievedMyInfoPersonData&&(P||a?.myInfoErrorType))return E.OnboardingPath.MyInfoSummary;else if((!a.personalDetails||!a.addressDetails)&&!a.retrievedMyInfoPersonData)return E.OnboardingPath.PersonalInformation;else if(P)return E.OnboardingPath.EmploymentFinancial;else if(!a.investorTypeSubmission?.investorType)return E.OnboardingPath.InvestorType;else if(!a.ckaDetailsSubmission?.ckaFormOption&&a.investorTypeSubmission?.investorType?.type===l.InvestorTypeDiscriminatorType.RetailInvestor)return E.OnboardingPath.OtherDetails;else if(a.ckaDetailsSubmission?.ckaFormOption&&!a.vcQuestionnaire&&!0===n)return E.OnboardingPath.OtherFinancialQuestions;else if(!a.declarationsSubmissionV2)return E.OnboardingPath.LegalDeclarations;else if(g)return E.OnboardingPath.VerifyIdentity;else return`${E.OnboardingPath.UnknownError}?code=unknown-002`;if(void 0!==e){if(u.includes(e))return m?E.PagePath.Dashboard:E.PagePath.AddGoalOverview;if(d.includes(e))return E.PagePath.Dashboard}return E.RootPath.Login};e.s(["useGetUrlToRedirectUserTo",0,()=>{let e=(0,i.useFeature)("onboarding.employmentFinancial.sipQuestions");return(0,a.useCallback)(t=>A({...t,canAccessSipQuestions:e}),[e])}],501299)},525363,660397,485103,145549,73059,e=>{"use strict";var t=e.i(880307),a=e.i(443248),i=e.i(91452);e.i(558917);var r=e.i(381865),s=e.i(732930);e.i(714285);var o=e.i(338021);e.i(671747);var n=e.i(840461),l=e.i(824286),u=e.i(535235);e.i(727015);var d=e.i(333740),c=e.i(124557),m=e.i(141985),h=e.i(257827),g=e.i(501299);e.i(105663);var p=e.i(135136),b=e.i(239821),v=e.i(436225),S=e.i(599980),E=e.i(307883),f=e.i(180031);e.i(766688);var A=e.i(857454),P=e.i(535924),y=e.i(723211),I=e.i(432122),C=e.i(683118),R=e.i(841499),x=e.i(995981);e.s(["AuthProvider",0,({children:e})=>{let{setIsAutoLogout:w}=(0,o.useAutoLogoutContext)(),{loading:T,customerId:O}=(()=>{let e=(0,u.useRouter)(),[t,a]=(0,i.useState)(!0),[r,s]=(0,i.useState)(void 0),{pathname:o,asPath:n}=e,l=(0,i.useRef)(e.push);l.current=e.push;let A=(()=>{let e,t=(e=(0,p.useFeature)("onboarding.employmentFinancial.sipQuestions"),(0,i.useCallback)(async t=>(({urlPath:e,customerStatus:t,onboardingData:a,hasMissingRequirement:i,isRequiredForVcQuestions:r,canAccessSipQuestions:s,shouldBlockVcUser:o=!1})=>{let n=t===S.CustomerStatus.REGISTERING&&a?.onboardingStatus===b.OnboardingStatus.InProgress,l=!!a?.personalDetails&&!!a?.addressDetails,u=!!a?.retrievedMyInfoPersonData,c=!!a?.myInfoErrorType,m=u&&!c||l,h=!!a?.investorTypeSubmission?.investorType,g=a?.investorTypeSubmission?.investorType?.type===S.InvestorTypeDiscriminatorType.RetailInvestor,p=!!a?.ckaDetailsSubmission?.ckaFormOption,A=!!a?.vcQuestionnaire,P=i??!0,y=(0,f.getUserHasOnboardingEmploymentFinancialDetails)({onboardingData:a,canAccessSipQuestions:s}),I=!!(t&&v.DASHBOARD_CUSTOMER_STATUS.includes(t)),C=a?.onboardingStatus===b.OnboardingStatus.Completed,R=!!a?.declarationsSubmissionV2&&m&&y&&h;return(0,E.match)(e).with(d.OnboardingPath.UnknownError,()=>n).with(d.OnboardingPath.PreferredFirstName,d.OnboardingPath.PreferredLastName,d.OnboardingPath.FaAssistedReviewInformation,()=>n).with(d.OnboardingPath.MobileVerification,()=>n&&!!a.preOnboardingSubmission).with(d.OnboardingPath.MyInfoSummary,()=>n&&u).with(d.OnboardingPath.PersonalInformation,()=>n&&!!a.phoneDetails?.isVerified&&!!a.phoneDetails).with(d.OnboardingPath.EmploymentFinancial,()=>n&&m).with(d.OnboardingPath.InvestorType,()=>n&&y&&m).with(d.JointAccountOnboardingPath.InvestorType,()=>!n&&(m||I)).with(d.OnboardingPath.OtherDetails,()=>n&&g&&m&&y).with(d.OnboardingPath.OtherFinancialQuestions,()=>n&&m&&h&&y&&!0===r).with(d.OnboardingPath.LegalDeclarations,()=>n&&m&&y&&(!0===r?A&&p:p||h)).with(d.OnboardingPath.VerifyIdentity,()=>n&&a.declarationsSubmissionV2&&P&&m&&y&&h).with(d.OnboardingPath.VerifyIdentityConfirmation,()=>I||C||n&&R).with(d.PagePath.MyInfoCallback,()=>n||!!(t&&v.DASHBOARD_CUSTOMER_STATUS.includes(t))).with(d.PagePath.AddGoalOverview,d.PagePath.Dashboard,d.PagePath.Account,d.PagePath.LinkedAccounts,d.PagePath.Rewards,d.PagePath.ModelAssetAllocations,d.AccountPath.AccountInformation,...Object.values(d.AccountPath),e=>e===d.AccountPath.ProfileAssessment||e===d.AccountPath.ProfileAssessmentCka?t===S.CustomerStatus.ACTIVE:!!(t&&v.DASHBOARD_CUSTOMER_STATUS.includes(t))).with(d.PagePath.Explore,d.PagePath.Performance,d.PagePath.Portfolio,d.PagePath.ActivityAndBalances,d.PagePath.InvestRedeemTransfer,d.PagePath.Invest,d.PagePath.Redeem,...Object.values(d.AddGoalPath),()=>!!(t&&v.DASHBOARD_CUSTOMER_STATUS.includes(t))&&!o).with(E.Pattern.when(d.isRo
3otPath),()=>!0).with(E.Pattern.when(d.isPublicPath),()=>!0).otherwise(()=>t===S.CustomerStatus.ACTIVE)})({...t,canAccessSipQuestions:e}),[e])),a=(0,g.useGetUrlToRedirectUserTo)(),r=(0,h.useFetchUserInformationForRedirection)(),{getAccessToken:s}=(0,m.useTenantAccessToken)();return(0,i.useCallback)(async({pathname:e,asPath:i})=>{if((0,d.isSsoPath)(e))return{newRoute:void 0,customerId:void 0};if(e===d.PagePath.ExternalAuth){if(!s()){let t=i??e;return{newRoute:{pathname:d.RootPath.Login,query:{redirect:t}},customerId:void 0}}return{newRoute:void 0,customerId:void 0}}let{customerStatus:o,customerFetchFailed:n,onboardingData:l,onboardingFetchFailed:u,customerId:c,isRequiredForVcQuestions:m,errorContext:h,shouldBlockVcUser:g}=await r();return(0,d.isAppPath)(e)&&!await t({urlPath:e,customerStatus:o,onboardingData:l,isRequiredForVcQuestions:m,shouldBlockVcUser:g})?{newRoute:a({customerStatus:o,customerFetchFailed:n,onboardingData:l,onboardingFetchFailed:u,isRequiredForVcQuestions:m,errorContext:h,shouldBlockVcUser:g}),customerId:c}:{newRoute:void 0,customerId:c}},[t,a,r,s])})(),P=(0,i.useRef)(A);return P.current=A,(0,i.useEffect)(()=>{(0,d.isRootPath)(o)||c.logoutStore.inProgress?a(!1):P.current({pathname:o,asPath:n}).then(e=>{if(e&&!c.logoutStore.inProgress){let{newRoute:t,customerId:a}=e;if(s(a),t)return l.current(t)}}).finally(()=>a(!1))},[o,n]),{loading:t,customerId:r}})();(e=>{let{isEnabled:t}=(0,y.useIsKeycloakAuthEnabled)(),a=(0,u.useRouter)(),i=(0,P.useQueryClient)(),{removeAccessToken:r}=(0,m.useTenantAccessToken)(),{logout:s}=(0,x.useTenantLogout)({logoutMode:"idle_timeout",callbackQueryParams:(0,I.isPathExcludedFromRedirect)(a.asPath)?void 0:{redirect:a.asPath}});(0,C.useIdleActivityTracking)(),(0,R.useIdleLogoutTimer)({pathname:a.pathname,shouldMonitor:e=>!Object.values(d.RootPath).includes(e),onIdle:async()=>{if(e(!0),i.clear(),t)return void await s();r();let o={pathname:d.RootPath.Login};(0,I.isPathExcludedFromRedirect)(a.asPath)?await a.push(o):await a.push({...o,search:`redirect=${a.asPath}`})}})})(w);let D=window[l.GlobalHelper.getCustomerId]?.()??O;(0,i.useEffect)(()=>{(0,n.trackEvent)({[s.TrackVariable.UserId]:D})},[D]);let N=(0,i.useMemo)(()=>({customerId:D}),[D]);return(0,a.jsx)(A.ToastProvider,{children:(0,a.jsx)(t.AuthContext.Provider,{value:N,children:T?(0,a.jsx)("div",{className:"flex h-screen items-center justify-center",children:(0,a.jsx)(r.PageLoader,{})}):e})})}],660397),e.i(18522);var w=e.i(675093),T=e.i(548438),O=e.i(6612);e.i(336509);var D=e.i(297854),N=e.i(986399);e.i(247314);var _=e.i(479569);e.i(936574);var j=e.i(429507),L=e.i(902993),k=e.i(664584);e.s(["LoginForm",0,({control:e,errorCode:t,isLoading:i,onSubmit:r})=>{let{t:s}=(0,w.useTranslation)(),o=[_.IssueTokenSuccessCode.AUTH_INVALID_GRANT_ERROR,_.IssueTokenSuccessCode.DEACTIVATED_USER_ACCESS].includes(t);return(0,a.jsxs)("form",{noValidate:!0,onSubmit:r,"data-testid":"LoginForm",children:[(0,a.jsxs)(k.Row,{rowSpacing:2,children:[(0,a.jsx)(L.Grid,{item:!0,xs:12,children:(0,a.jsx)(O.TextBox,{control:e,name:"username",type:"email",label:s("commonEmailAddress"),disabled:i,uiError:o,"data-testid-input":"LoginForm_InputEmailAddress","data-testid-error":"LoginForm_InputEmailAddress_ErrorMessage","data-private":!0})}),(0,a.jsx)(L.Grid,{item:!0,xs:12,children:(0,a.jsx)(T.PasswordBox,{
3control:e,name:"password",label:s("commonPassword"),disabled:i,uiError:o,"data-testid-input":"LoginForm_InputPassword","data-testid-error":"LoginForm_InputPassword_ErrorMessage"})})]}),(0,a.jsx)(j.ErrorMessage,{className:"mt-16 whitespace-pre","data-testid":"LoginForm_ErrorMessage",children:(0,E.match)(t).with(_.IssueTokenSuccessCode.AUTH_INVALID_GRANT_ERROR,()=>s("onboardingErrorCredentialsWrong")).with(_.IssueTokenSuccessCode.DEACTIVATED_USER_ACCESS,()=>(0,a.jsx)(N.Trans,{text:s("onboardingErrorDeactivatedAccount"),elements:[D.I18nElement.ContactUsLink]})).otherwise(()=>void 0)}),(0,a.jsx)("button",{className:"hidden",disabled:i})]})}],485103);var F=e.i(901191),M=e.i(982507),M=M,U=e.i(516306),V=e.i(870045);e.i(340509);var G=e.i(51876);let B=({name:e,control:t,disabled:r,label:s,inputProps:o,shouldUnregister:n,uiError:l,closeMenuList:u,placeholder:d,showDomainMenuList:c,options:m,"data-testid-input":h,"data-testid-error":g,"data-private":p})=>{let{t:b}=(0,w.useTranslation)();return(0,a.jsx)(F.Controller,{name:e,control:t,shouldUnregister:n,render:({field:{onChange:e,ref:t,value:n,...v},fieldState:S})=>{let{error:E,errorMessageKey:f}=(0,G.extractFormError)({fieldState:S,uiError:l});return(0,a.jsx)(M.default,{...v,freeSolo:!0,options:m.map(e=>e.value),onBlur:u,disabled:r,onChange:(t,a)=>e(a),open:c,renderInput:({inputProps:i,...l})=>(0,a.jsx)(V.TextField,{...l,label:s,placeholder:d,inputRef:t,disabled:r,inputProps:{...i,...o,"data-testid":h,"data-private":p},type:"email",fullWidth:!0,error:E,helperText:f&&b(f),FormHelperTextProps:{"data-testid":g},value:n||"",onChange:e}),renderOption:(e,t)=>(0,i.createElement)(U.MenuItem,{...e,"data-testid":`EmailOption_Item_${t}`,key:t,value:t,className:"body-m text-default"},t)})}})};e.s(["SignupForm",0,({control:e,isLoading:t,onSubmit:r,watch:s})=>{let{t:o}=(0,w.useTranslation)(),n=(e=>{let[t,a]=(0,i.useState)(!1),[r,s]=(0,i.useState)(""),o=e.split("@")[1],n=Object.values(_.EmailDomainType).includes(o),l=e.includes("@")&&!n,u=[{name:_.EmailDomainType.GMAIL,value:`${r}@${_.EmailDomainType.GMAIL}`},{name:_.EmailDomainType.YAHOO,value:`${r}@${_.EmailDomainType.YAHOO}`},{name:_.EmailDomainType.HOTMAIL,value:`${r}@${_.EmailDomainType.HOTMAIL}`}];return(0,i.useEffect)(()=>{if(l){let t=e.split("@")[0];t.length>=1&&(s(t),a(!0))}else a(!1)},[l,e]),{savedEmailText:r,showDomainMenuList:t,options:u,handleCloseMenuList:()=>a(!1)}})(s("email")??"");return(0,a.jsxs)("form",{noValidate:!0,onSubmit:r,"data-testid":"SignupForm",children:[(0,a.jsxs)(k.Row,{rowSpacing:2,children:[(0,a.jsx)(L.Grid,{item:!0,xs:12,children:(0,a.jsx)(B,{name:"email",control:e,label:o("commonEmailAddress"),disabled:t,showDomainMenuList:n.showDomainMenuList,closeMenuList:n.handleCloseMenuList,options:n.options,"data-testid-input":"SignupForm_InputEmailAddress","data-testid-error":"SignupForm_InputEmailAddress_ErrorMessage","data-private":!0})}),(0,a.jsx)(L.Grid,{item:!0,xs:12,children:(0,a.jsx)(T.PasswordBox,{
3control:e,name:"password",label:o("commonPassword"),disabled:t,enablePasswordStrength:!0,"data-testid-input":"SignupForm_InputPassword","data-testid-error":"SignupForm_InputPassword_ErrorMessage"})})]}),(0,a.jsx)("div",{id:"recaptcha_challenge",className:"[&>*]:mt-8"}),(0,a.jsx)("button",{className:"hidden",disabled:t,type:"submit"})]})}],145549);var H=e.i(445794),Q=e.i(227153);e.s(["useSignup",0,()=>(0,H.useMutation)(Q.sg.auth.api.createAccountV2)],73059),e.s([],525363)}]); 4 5//# sourceMappingURL=1sqg5034xiab4.js.map 6//# debugId=aa77719f-8e8d-5316-9940-d37f2e509c1b
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.