{"version":3,"sources":["contexts/ApolloProvider/ApolloProvider.tsx","hooks/useConfiguration.ts","hooks/useQuery.ts","types/graphql-global-types.ts","hooks/useQueryWithPolling.ts","hooks/useBuildCalendlyUrl.ts","contexts/CheckoutProvider/CheckoutProvider.tsx","contexts/UserContext/gqls.ts","services/utm.ts","pages/IdVerification/IdVerificationContext.tsx","utils/mappingUtils.ts","pages/IdVerification/gqls.ts","contexts/CheckoutProvider/utils.ts","components/ScrollToTop/ScrollToTop.tsx","components/NestedComposer/NestedComposer.tsx","services/i18n.ts","AppProviders.tsx","components/ErrorBoundary/ErrorBoundary.tsx","components/ActionsHandler/ActionsHandler.tsx","components/ActionsHandler/useActionExecutor.ts","utils/pathUtils.ts","components/PrivateRoute.tsx","utils/redirectRules.ts","components/RedirectHandler/RedirectHandler.tsx","hooks/useRedirect.ts","pages/Login/Login.tsx","pages/Logout/Logout.tsx","App.tsx","hooks/useLanguageSwitch.ts","index.tsx","utils/germanHoliday.ts","utils/misc.ts","hooks/useTranslate.ts","services/sentry.ts","pages/InvestorIdentification/InvestorIdentificationProvider.tsx","utils/constants.ts","components/Loading.tsx","hooks/usePlatform.ts","contexts/UserContext/UserContext.tsx","utils/stringUtils.ts"],"names":["ApolloContext","createContext","setTokenRefetch","allowTokenRefetch","cache","InMemoryCache","useApolloProvider","useContext","ApolloProvider","children","useAuth0","getAccessTokenSilently","isAuthenticated","logout","useState","setAllowTokenRefetch","httpLink","createHttpLink","uri","process","authLink","setContext","authorization","headers","Authorization","errorLink","onError","graphQLErrors","err","extensions","code","returnTo","window","location","origin","routes","LOGIN","apolloClient","ApolloClient","link","ApolloLink","from","connectToDevTools","environment","DEVELOPMENT","name","version","Provider","value","client","useConfiguration","useLocation","isSecretUserParam","useQuery","get","isPublic","useMemo","isPublicPath","pathname","auth0Token","findLocalItems","isPublicRoute","isTest","isSecretLinkRoute","includes","SECRET_LINK","isSecretUser","auth0TokenValue","localStorage","getItem","isMarketUserUnavailable","URLSearchParams","search","CurrencyIsoCode","FinancingType","Folder","IdentCaseStatus","IdentCaseTransactionStatus","IdentCaseTransactionType","IdentCaseType","InvestmentRequestStatus","Language","MarketplaceUserFallbackRegistrationStatus","MarketplaceUserInvitationStatus","MarketplaceUserRegistrationStatus","MarketplaceUserSource","PaymentFrequency","Platform","ProductType","RepaymentType","SalesforceLanguage","SalesforcePlatformAccess","SalesforceSalutation","SalesforceUserStatus","StageName","StatusOnWebsite","UkInvestorClassification","useQueryWithPolling","query","variables","pollingExitCheck","pollInterval","timeout","onLoaded","timerId","useRef","undefined","loading","setLoading","error","setError","result","setResult","useLazyQuery","fetchPolicy","nextFetchPolicy","onCompleted","data","stopPolling","safeClearTimeout","current","logError","fetch","startPolling","refetch","fireTimeout","Error","poll","setTimeout","appEnv","calendlyColor","theme","colors","success","substring","UTM_SOURCE_TYPES","MARKETPLACE_REGISTRATION_ONBOARDING_CALL","PLATFORM_PROJECT_OVERVIEW","getUtmContent","userId","content","marketplaceUserId","targetDeploymentIdentifier","JSON","stringify","useBuildCalendlyUrl","localUser","language","useTranslate","isUK","usePlatform","user","useUser","calendly","useCalendly","getPublicCalendlyUrl","useCallback","props","utmContent","uuid","utmSource","campaign","payload","parseJSONString","utmCampaign","calendar","PRODUCTION","webAppLocales","getPrivateCalendlyUrl","calendlyUrlPath","source","id","replace","makeAppointment","CALENDLY_ONBOARDING_LINK","accountManager","calendlyLinkTemplate","url","initPopupWidget","prefill","firstName","lastName","email","inlineCalendly","utm","customAnswers","a1","phone","configDefaultValue","stageTitles","stages","offset","hasNext","totalStages","defaultInvestmentRequest","checkoutFormConfig","main","authorizedSignatory","status","DRAFT","coInvestmentStageName","authorizedSignatories","formData","interestRate","fundName","CheckoutContext","product","investmentRequest","updateInvestmentRequest","shouldRefetchInvestmentRequest","setShouldRefetchInvestmentRequest","GET_PRODUCT","gql","CheckoutProvider","productId","useParams","salesforceLanguage","initialRender","setProduct","setInvestmentRequest","stageIndex","dealId","deal","fetchProduct","useEffect","CHECKOUT","newStageIndex","normalizedInvestmentRequest","normalizeInvestmentRequest","toUpdateRequest","contextValue","Loading","useCheckout","GET_USER_UK","GET_USER_EU","GET_USER","EU","UK","GET_USER_ONBOARDING_CALL","UPDATE_USER","CONFIRM_WELCOME_MESSAGE","ACCEPT_NDA_AND_TERMS","JOIN_DEALS_WAITING_LIST","init","initUtm","getFirstClick","trackedEvents","getTrackedEvents","length","e","getLastClick","getSessionCount","pushEvent","event","dataLayer","push","getMetaData","isNewRegistration","utmFirstClick","utmLastClick","sessionCount","ga","Cookie","toString","gid","StatusMessage","mapIdentproviderToCaseType","provider","IdentificationProvider","ID_NOW","POST_IDENT","AML","ID_NOW_AUTO","LINUS","ID_NOW_QES","POST_IDENT_QES","QES_AML","mapIdentproviderToTransactionType","IDNOW_VIDEO","LIONWARE_POSTIDENT","IDNOW_AUTO","IDNOW_QES","LIONWARE_POSTIDENT_QES","MANUAL","CREATE_IDENT_CASE","CREATE_IDENT_CASE_TRANSACTION","IDENT_CASES","IdVerificationContext","identificationStatus","inProgress","isWindowExist","useIdVerificationContext","IdVerificationProvider","updaterRef","isFetchingUrl","setFetchingUrl","birthDate","personData","setPersonData","useInvestorIdentificationContext","setProvider","clickOutWindowRef","setClickOutWindowRef","setIdentificationStatus","identCase","setIdentCase","identCaseId","setIdentCaseId","useMutation","createIdentCase","createIdNowWindow","closed","open","startIdVerification","clickOutURL","createTransaction","identCaseType","filter","ids","identCases","currentTransaction","ABORTED","stopPollingStatus","FAILED_TO_START","SYSTEM_FAILED","FAILED","IDENTIFICATION_FAILED","SUCCESS","cancelIdVerification","CREATED","PENDING","STARTED","pollStatus","NEW_IDENTIFICATION_STARTED","identRedirectUrl","IDENTIFICATION_START_FAILED","fetchIdentCase","type","close","clearInterval","updateStatus","updater","identCaseTransactionType","startIdentCaseTransaction","startOrContinueIdent","fetchIdentCaseId","handleStartIdVerification","resetCaches","toConfig","config","checkoutConfig","ScrollToTop","scrollTo","NestedComposer","components","composed","reduceRight","acc","CurrentComponent","i18n","use","Backend","LanguageDetector","initReactI18next","fallbackLng","ns","defaultNS","interpolation","escapeValue","debug","ThemeProvider","translate","handleReload","reload","fallback","minHeight","bg","flexDirection","justifyContent","alignItems","my","onClick","variant","ToastProvider","privateComponents","UserProvider","InvestorIdentificationProvider","AppProviders","I18nextProvider","ActionsHandler","actionExecute","addToast","useToast","navigate","useNavigate","builderEvent","action","message","position","useActionExecutor","handleAction","detail","document","addEventListener","removeEventListener","getRedirectUrl","PrivateRoute","component","platform","REGISTER_VERIFICATION","REGISTER","state","Component","withAuthenticationRequired","onRedirecting","loginOptions","redirect_uri","fragment","encodeURIComponent","isRelaunchUser","isAuth0OrLegacy","AUTH0_REGISTRATION_SCREEN","LEGACY_PLATFORM","RedirectRules","path","OVERVIEW","conditions","isClassification","registrationStatus","EMAIL_VERIFIED","invitationStatus","fallbackRegistrationStatus","CONTACT_DETAILS_WITH_TERMS_AND_NDA_SUBMITTED","isOverview","CONTACT_DETAILS","REGISTRATION","LOGIN_CREDENTIALS_PROVIDED","ACCOUNT_DETAILS_SUBMITTED","CALENDLY_SCHEDULED","VERIFICATION_EMAIL_REQUESTED","INVITATION","PASSWORD_SET_AND_EMAIL_VERIFIED","INVITED_VIA_SALESFORCE","isInvitation","isLegacy","CLASSIFICATION","IMPRINT","CONTACT","ACCOUNT","LOGOUT","RedirectHandler","redirect","marketplaceUser","calledOnce","rule","find","getRedirectPath","useRedirect","to","Login","loginWithRedirect","prompt","Logout","history","createBrowserHistory","AuthCallbackPage","lazy","lazyRetry","then","default","AuthCallback","DownloadPage","Download","ProjectOverviewPage","ProjectOverview","BuilderDev","ProductDetail","IdVerificationPage","IdVerification","PortfolioPage","Portfolio","ContactPage","Contact","ImprintPage","Imprint","UserAccountPage","UserAccount","CheckoutPage","Checkout","RegistrationPage","Registration","ClassificationPage","Classification","ContactDetailsPage","ContactDetails","InvestorIdentificationPage","InvestorIdentification","AuthErrorPage","AuthError","RegisterPage","Register","SecretLinkPage","SecretLink","CSSKillReactCreateAppDebugIframe","createGlobalStyle","App","isLoading","utmInit","changeLanguage","useLanguageSwitch","isDevelop","AUTH_CALLBACK","element","AUTH_ERROR","ID_VERIFICATION","PORTFOLIO","INVESTOR_IDENTIFICATION","PRODUCT_DETAIL","PRODUCT_DETAIL_DEV","initSentry","ReactDOM","render","StrictMode","domain","clientId","redirectUri","audience","scope","cacheLocation","onRedirectCallback","appState","useRefreshTokens","advancedOptions","defaultScope","getElementById","TagManager","initialize","gtmId","getHolidays","currentYear","Date","getFullYear","easter","year","f","Math","floor","G","C","H","I","L","month","day","getEaster","goodFriday","addDays","easterMonday","whitMonday","holidays","map","holiday","isGermanHoliday","date","isEqual","getInvestmentDateOptions","locale","limit","currentDate","monthlyStartDate","getMonth","twoDaysAfter","addMonths","getDate","lastDayOfMonth","results","eachDayOfInterval","start","end","idx","isWeekend","addBusinessDays","differenceInBusinessDays","label","toLocaleString","weekday","format","slice","getCountryNames","lang","countries","registerLocale","require","getNames","isCalendlyEvent","indexOf","clearTimeout","safeParseInt","parseInt","componentName","componentImport","Promise","resolve","reject","hasRefreshed","parse","sessionStorage","setItem","catch","namespace","useTranslation","t","currentLanguage","languageConstants","en","key","options","toUpperCase","EN","lng","formatNumber","val","minimumFractionDigits","formatCurrency","localValue","currency","maximumFractionDigits","formatParams","currencyLocaleMap","EUR","formatDate","formatDateTime","hour","minute","Sentry","dsn","integrations","Integrations","BrowserTracing","routingInstrumentation","tracesSampleRate","Number","parseFloat","autoSessionTracking","errorInfo","setExtras","InvestorIdentificationContext","selectedInvestorIndex","setSelectedInvestorIndex","reset","localeDomains","platformMap","getPlatform","host","grid","gridMix","sm","md","lg","xl","STAGING","TEST","domains","nonDisclosureFiles","growthCardImage","nestedRoutes","VERIFICATION","CHECKOUT_INVESTMENT_ACCOUNT","CHECKOUT_INVESTMENT_DETAILS","CHECKOUT_SIGN_CONTRACT","CHECKOUT_COMPLIANCE","CHECKOUT_CLASSIFICATION","CHECKOUT_IDENTIFICATION","i18nNumberFormats","symbol","GBP","USD","isProduction","LoadingPage","height","backgroundColor","background","spinnerSize","size","devPlatform","toLowerCase","isEU","UserContext","shouldRefetchOpenAllocations","setShouldRefetchOpenAllocations","isNotTestOrDevelopment","userPlatform","fetchUser","ukClassificationSubmitted","JOIN","i","hasOwnProperty","match"],"mappings":"+TAmBMA,EAAgBC,wBAA2B,CAC/CC,gBAAiB,aACjBC,mBAAmB,IAGRC,EAAQ,IAAIC,IAEZC,EAAoB,kBAAMC,qBAAWP,IAErCQ,EAAiB,SAAC,GAA2C,IAAzCC,EAAwC,EAAxCA,SAC/B,EAA4DC,cAApDC,EAAR,EAAQA,uBAAwBC,EAAhC,EAAgCA,gBAAiBC,EAAjD,EAAiDA,OAEjD,EAAkDC,oBAAS,GAA3D,mBAAOX,EAAP,KAA0BY,EAA1B,KAEMC,EAAWC,YAAe,CAC9BC,IAAKC,sCAGDC,EAAWC,YAAU,gCAAC,iGACtBC,EAAgB,QAChBV,IAAmBT,EAFG,+CAGQQ,EAAuB,IAH/B,mBAGxBW,EAHwB,4DAMnB,CACLC,QAAS,CACPC,cAAeF,KARO,4CAatBG,EAAYC,aAAQ,YAAwB,IAArBC,EAAoB,EAApBA,cAC3B,GAAIA,EAAe,CAAC,IAAD,gBACCA,GADD,IACjB,2BAAiC,CAAC,IAAvBC,EAAsB,QAC/B,GACO,qBADP,OAAQA,QAAR,IAAQA,OAAR,EAAQA,EAAKC,WAAWC,MAEpBjB,EAAO,CAAEkB,SAAS,GAAD,OAAKC,OAAOC,SAASC,QAArB,OAA8BC,IAAOC,UAJ3C,mCAWfC,EAAe,IAAIC,IAAa,CACpCC,KAAMC,IAAWC,KAAK,CAAChB,EAAWL,EAAUJ,IAC5CZ,QACAsC,kBAAmBvB,eAAsCwB,IAAYC,YACrEC,KAAK,mBAAD,OAAqB1B,cACzB2B,QAAS3B,UAOX,OACE,cAACnB,EAAc+C,SAAf,CACEC,MAAO,CACL9C,gBAPqB,WACzBa,GAAqB,IAOjBZ,qBAHJ,SAME,cA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AAH,UAAGA,EAAiB5C,gBAApB,aAAG,EAA2BqR,cAC5CK,GAA0BC,IAAiB3R,GAC7CxX,OAAOC,SAAS2I,QAAhB,UACK0e,IAAO,WAAqC6B,IADjD,OAEIhpB,IAAOC,MAFX,kBAOJV,QAAS,SAACmF,GACRY,YAASZ,GACT4R,EAAStW,IAAO8Z,WAbpB,mBAAOmP,EAAP,YAAoBzkB,EAApB,EAAoBA,QAASU,EAA7B,EAA6BA,KAAMO,EAAnC,EAAmCA,QAqBnCoG,qBAAU,WACJ1J,GAGH,gCAAC,wGACM8mB,IADN,0CAAD,KAGA,CAACA,EAAW9mB,IAEf,IAAMqW,EACJtR,MACC,OAAChC,QAAD,IAACA,GAAD,UAACA,EAAM+U,uBAAP,OAAC,EAAuBiP,6BACnB,OAAJhkB,QAAI,IAAJA,GAAA,UAAAA,EAAM+U,uBAAN,eAAuB9P,UAAWzG,IAAqBylB,MAE3D,OAAI3kB,EACK,cAAC4H,EAAA,EAAD,IAIP,cAACwc,EAAYhoB,SAAb,CACEC,MAAO,CACLuG,KAAI,OAAElC,QAAF,IAAEA,OAAF,EAAEA,EAAM+U,gBACZxU,UACA+S,mBACAqQ,6BAA8BA,EAA6BxjB,QAC3DyjB,gCA7BkC,SAACjoB,GACvCgoB,EAA6BxjB,QAAUxE,IAsBvC,SASGvC,KAKM+I,EAAU,kBAAMjJ,qBAAWwqB,K,gCC1FxC,oEASO,IAAMnnB,EAAiB,SAACsC,GAC7B,IAAK,IAAMqlB,KAAKvpB,OAAOoC,aAErB,GAAIpC,OAAOoC,aAAaonB,eAAeD,IAAMA,EAAEE,MAAMvlB,GACnD,OAAOqlB,EAGX,OAAO,MAGIphB,EAAkB,SAAInH,GACjC,IACE,OAAO+F,KAAK8c,MAAM7iB,GAClB,SACA,OAAO,S","file":"static/js/main.b1a4c0e4.chunk.js","sourcesContent":["import React, { createContext, ReactNode, useContext, useState } from 'react'\n\nimport {\n ApolloClient,\n ApolloProvider as OriginalApolloProvider,\n InMemoryCache,\n createHttpLink,\n ApolloLink,\n} from '@apollo/client'\nimport { setContext } from '@apollo/client/link/context'\nimport { onError } from '@apollo/client/link/error'\nimport { useAuth0 } from '@auth0/auth0-react'\nimport { environment, routes } from 'utils/constants'\n\ntype ContextType = {\n setTokenRefetch: () => void\n allowTokenRefetch?: boolean\n}\n\nconst ApolloContext = createContext({\n setTokenRefetch: () => {},\n allowTokenRefetch: false,\n})\n\nexport const cache = new InMemoryCache()\n\nexport const useApolloProvider = () => useContext(ApolloContext)\n\nexport const ApolloProvider = ({ children }: { children: ReactNode }) => {\n const { getAccessTokenSilently, isAuthenticated, logout } = useAuth0()\n\n const [allowTokenRefetch, setAllowTokenRefetch] = useState(false)\n\n const httpLink = createHttpLink({\n uri: process.env.REACT_APP_APOLLO_CLIENT_URI,\n })\n\n const authLink = setContext(async () => {\n let authorization = 'none'\n if (isAuthenticated || allowTokenRefetch) {\n authorization = `Bearer ${await getAccessTokenSilently({})}`\n }\n\n return {\n headers: {\n Authorization: authorization,\n },\n }\n })\n\n const errorLink = onError(({ graphQLErrors }) => {\n if (graphQLErrors) {\n for (const err of graphQLErrors) {\n switch (err?.extensions.code) {\n case 'UNAUTHENTICATED':\n logout({ returnTo: `${window.location.origin}${routes.LOGIN}` })\n break\n }\n }\n }\n })\n\n const apolloClient = new ApolloClient({\n link: ApolloLink.from([errorLink, authLink, httpLink]),\n cache,\n connectToDevTools: process.env.REACT_APP_ENVIRONMENT === environment.DEVELOPMENT,\n name: `bricks-frontend-${process.env.REACT_APP_ENVIRONMENT}`,\n version: process.env.REACT_APP_VERSION,\n })\n\n const handleTokenRefetch = () => {\n setAllowTokenRefetch(true)\n }\n\n return (\n \n {children}\n \n )\n}\n","import { useMemo } from 'react'\n\nimport { useQuery } from 'hooks/useQuery'\nimport { useLocation } from 'react-router-dom'\nimport { isPublicPath, isTest, routes } from 'utils/constants'\nimport { findLocalItems } from 'utils/stringUtils'\n\nexport const useConfiguration = () => {\n const location = useLocation()\n const isSecretUserParam = useQuery().get('isSecretUser') as string\n const isPublic = useMemo(() => isPublicPath(location.pathname), [location.pathname])\n\n // START isMarketUserUnavailable\n // Route is Public and the account has not been created yet\n const auth0Token = findLocalItems(/^@@auth0spajs@@::/)\n const isPublicRoute = !isTest && isPublic && !auth0Token\n\n // Secret Link Route\n const isSecretLinkRoute = useMemo(() => location.pathname.includes(routes.SECRET_LINK), [location.pathname])\n const isSecretUser = () => {\n if (isTest && isSecretUserParam === 'true') return true\n const auth0TokenValue = window.localStorage.getItem(auth0Token ?? '')\n return auth0TokenValue?.includes('http://secretLinkUser/grantedResources')\n }\n const isMarketUserUnavailable = isPublicRoute || isSecretLinkRoute || isSecretUser()\n // END isMarketUserUnavailable\n\n return { isPublic, isMarketUserUnavailable, isSecretUser: !!isSecretUser() }\n}\n","import { useLocation } from 'react-router-dom'\n\nexport const useQuery = () => {\n const location = useLocation()\n\n return new URLSearchParams(location.search)\n}\n","/* tslint:disable */\n/* eslint-disable */\n// @generated\n// This file was automatically generated and should not be edited.\n\n//==============================================================\n// START Enums and Input Objects\n//==============================================================\n\nexport enum CurrencyIsoCode {\n EUR = 'EUR',\n GBP = 'GBP',\n USD = 'USD',\n}\n\nexport enum FinancingType {\n JUNIOR_LOAN = 'JUNIOR_LOAN',\n SENIOR_LOAN = 'SENIOR_LOAN',\n WHOLE_LOAN = 'WHOLE_LOAN',\n}\n\nexport enum Folder {\n CASHFLOW_SCHEDULE = 'CASHFLOW_SCHEDULE',\n CONTRACTUAL_DOCUMENTS = 'CONTRACTUAL_DOCUMENTS',\n IMAGES = 'IMAGES',\n INVESTMENT_DOCUMENTS = 'INVESTMENT_DOCUMENTS',\n INVESTMENT_MEMORANDUM = 'INVESTMENT_MEMORANDUM',\n KEY_INFORMATION_DOCUMENTS_TEST_INVESTMENT = 'KEY_INFORMATION_DOCUMENTS_TEST_INVESTMENT',\n LEGAL_DOCUMENTS = 'LEGAL_DOCUMENTS',\n PORTRAIT_IMAGE = 'PORTRAIT_IMAGE',\n POWER_OF_ATTORNEY = 'POWER_OF_ATTORNEY',\n PREVIEW_IMAGE = 'PREVIEW_IMAGE',\n PROFILE_IMAGE = 'PROFILE_IMAGE',\n QUARTERLY_REPORTS = 'QUARTERLY_REPORTS',\n PROJECT_UPDATE = 'PROJECT_UPDATE',\n SIGNED_PURCHASE_AGREEMENT = 'SIGNED_PURCHASE_AGREEMENT',\n STEUERBESCHEINIGUNG = 'STEUERBESCHEINIGUNG',\n STEUERMERKMALE = 'STEUERMERKMALE',\n TEASER = 'TEASER',\n}\n\nexport enum IdentCaseStatus {\n CREATED = 'CREATED',\n PERSON_ASSIGNED = 'PERSON_ASSIGNED',\n PERSON_IDENTIFIED = 'PERSON_IDENTIFIED',\n PERSON_NOT_IDENTIFIED_ON_TIME = 'PERSON_NOT_IDENTIFIED_ON_TIME',\n}\n\nexport enum IdentCaseTransactionStatus {\n ABORTED = 'ABORTED',\n CREATED = 'CREATED',\n FAILED = 'FAILED',\n FAILED_TO_START = 'FAILED_TO_START',\n PENDING = 'PENDING',\n STARTED = 'STARTED',\n SUCCESS = 'SUCCESS',\n}\n\nexport enum IdentCaseTransactionType {\n IDNOW_AUTO = 'IDNOW_AUTO',\n IDNOW_QES = 'IDNOW_QES',\n IDNOW_VIDEO = 'IDNOW_VIDEO',\n LIONWARE_POSTIDENT = 'LIONWARE_POSTIDENT',\n LIONWARE_POSTIDENT_QES = 'LIONWARE_POSTIDENT_QES',\n MANUAL = 'MANUAL',\n}\n\nexport enum IdentCaseType {\n AML = 'AML',\n EXTERNAL = 'EXTERNAL',\n LINUS = 'LINUS',\n QES_AML = 'QES_AML',\n}\n\nexport enum InvestmentRequestStatus {\n DRAFT = 'DRAFT',\n COMPLETED = 'COMPLETED',\n SUBMITTED = 'SUBMITTED',\n AWAITING_APPROVAL = 'AWAITING_APPROVAL',\n CAPITAL_CALL = 'CAPITAL_CALL',\n AWAITING_PAYMENT = 'AWAITING_PAYMENT',\n PAYMENT_RECEIVED = 'PAYMENT_RECEIVED',\n INVESTED = 'INVESTED',\n CANCELLED = 'CANCELLED',\n}\n\nexport enum Language {\n DE = 'DE',\n EN = 'EN',\n}\n\nexport enum MarketplaceUserFallbackRegistrationStatus {\n CONTACT_DETAILS_WITH_TERMS_AND_NDA_SUBMITTED = 'CONTACT_DETAILS_WITH_TERMS_AND_NDA_SUBMITTED',\n EMAIL_VERIFIED = 'EMAIL_VERIFIED',\n}\n\nexport enum MarketplaceUserInvitationStatus {\n CONTACT_DETAILS_WITH_TERMS_AND_NDA_SUBMITTED = 'CONTACT_DETAILS_WITH_TERMS_AND_NDA_SUBMITTED',\n INVITED_VIA_SALESFORCE = 'INVITED_VIA_SALESFORCE',\n PASSWORD_SET_AND_EMAIL_VERIFIED = 'PASSWORD_SET_AND_EMAIL_VERIFIED',\n}\n\nexport enum MarketplaceUserRegistrationStatus {\n ACCOUNT_DETAILS_SUBMITTED = 'ACCOUNT_DETAILS_SUBMITTED',\n CALENDLY_SCHEDULED = 'CALENDLY_SCHEDULED',\n EMAIL_VERIFIED = 'EMAIL_VERIFIED',\n LOGIN_CREDENTIALS_PROVIDED = 'LOGIN_CREDENTIALS_PROVIDED',\n VERIFICATION_EMAIL_REQUESTED = 'VERIFICATION_EMAIL_REQUESTED',\n}\n\nexport enum MarketplaceUserSource {\n AUTH0_REGISTRATION_SCREEN = 'AUTH0_REGISTRATION_SCREEN',\n INVITATION = 'INVITATION',\n LEGACY_PLATFORM = 'LEGACY_PLATFORM',\n REGISTRATION = 'REGISTRATION',\n}\n\nexport enum PaymentFrequency {\n ANNUAL = 'ANNUAL',\n BULLET = 'BULLET',\n DATE = 'DATE',\n MONTHLY = 'MONTHLY',\n QUARTERLY = 'QUARTERLY',\n SEMI_ANNUAL = 'SEMI_ANNUAL',\n}\n\nexport enum Platform {\n EU = 'EU',\n UK = 'UK',\n}\n\nexport enum ProductType {\n CORE = 'CORE',\n DEAL_BY_DEAL = 'DEAL_BY_DEAL',\n DEBT_FUND = 'DEBT_FUND',\n MANAGED_PORTFOLIO = 'MANAGED_PORTFOLIO',\n PARTNER_FUND = 'PARTNER_FUND',\n PARTNER_FUND_LARAMAR = 'PARTNER_FUND_LARAMAR',\n TEST_INVESTMENT = 'TEST_INVESTMENT',\n TREUHAND = 'TREUHAND',\n}\n\nexport enum RepaymentType {\n BULLET = 'BULLET',\n PAID_ANNUALLY = 'PAID_ANNUALLY',\n QUARTERLY = 'QUARTERLY',\n SPECIAL = 'SPECIAL',\n}\n\nexport enum SalesforceLanguage {\n DE = 'DE',\n EN = 'EN',\n}\n\nexport enum SalesforcePlatformAccess {\n CORE = 'CORE',\n FULL_PLATFORM = 'FULL_PLATFORM',\n FULL_PLATFORM_PLUS_DEBT_FUND = 'FULL_PLATFORM_PLUS_DEBT_FUND',\n}\n\nexport enum SalesforceSalutation {\n MR = 'MR',\n MS = 'MS',\n}\n\nexport enum SalesforceUserStatus {\n ACTIVE = 'ACTIVE',\n DISABLED = 'DISABLED',\n JOIN = 'JOIN',\n NOUSER = 'NOUSER',\n PREVIEW = 'PREVIEW',\n}\n\nexport enum StageName {\n NEW = 'NEW',\n KICKOFF = 'KICKOFF',\n DUE_DILIGENCE_VOTUM = 'DUE_DILIGENCE_VOTUM',\n READY_TO_GO_LIVE = 'READY_TO_GO_LIVE',\n GO_FOR_CAPITAL_CALL = 'GO_FOR_CAPITAL_CALL',\n CLOSING_AND_BILLING = 'CLOSING_AND_BILLING',\n REPORTING_AND_MONITORING = 'REPORTING_AND_MONITORING',\n UNAWARE = 'UNAWARE',\n AWARE = 'AWARE',\n INTERESTED = 'INTERESTED',\n SEND_ACCESSION_DOCUMENTS = 'SEND_ACCESSION_DOCUMENTS',\n AWAITING_SIGNED_DOCUMENTS = 'AWAITING_SIGNED_DOCUMENTS',\n COMPLIANCE_APPROVAL = 'COMPLIANCE_APPROVAL',\n COUNTERSIGN = 'COUNTERSIGN',\n AWAITING_CAPITAL_CALL_APPROVAL = 'AWAITING_CAPITAL_CALL_APPROVAL',\n SEND_CAPITAL_CALL = 'SEND_CAPITAL_CALL',\n AWAITING_PAYMENT = 'AWAITING_PAYMENT',\n PAYMENT_RECEIVED = 'PAYMENT_RECEIVED',\n INVESTED = 'INVESTED',\n REPAID = 'REPAID',\n CLOSED_LOST = 'CLOSED_LOST',\n OTHER = 'OTHER',\n}\n\nexport enum StatusOnWebsite {\n CLOSED = 'CLOSED',\n DRAFT = 'DRAFT',\n HIDDEN = 'HIDDEN',\n LIVE = 'LIVE',\n OFFLINE = 'OFFLINE',\n REPAID = 'REPAID',\n}\n\nexport enum UkInvestorClassification {\n CERTIFIED_SOPHISTICATED = 'CERTIFIED_SOPHISTICATED',\n HIGH_NET_WORTH = 'HIGH_NET_WORTH',\n PROFESSIONAL_CLIENT = 'PROFESSIONAL_CLIENT',\n SELF_CERTIFIED_SOPHISTICATED = 'SELF_CERTIFIED_SOPHISTICATED',\n}\n\nexport interface AddressDataInput {\n street: string\n zip: string\n city: string\n country?: string | null\n}\n\nexport interface IdentCaseFilter {\n ids?: string[] | null\n types?: IdentCaseType[] | null\n personIds?: string[] | null\n}\n\nexport interface PersonDataInput {\n firstName: string\n lastName: string\n email: string\n birthDate: any\n birthplace?: string | null\n phone?: string | null\n salutation?: string | null\n title?: string | null\n citizenship?: string | null\n address?: AddressDataInput | null\n}\n\nexport interface RegistrationAccountDetailsInput {\n salutation: SalesforceSalutation\n firstName: string\n lastName: string\n phone: string\n company?: string | null\n language?: SalesforceLanguage | null\n referredById?: string | null\n}\n\nexport interface RegistrationFormDataInput {\n language: Language\n platform: Platform\n termsAccepted: boolean\n ndaAccepted: boolean\n metadata?: RegistrationFormDataInputMetadata | null\n}\n\nexport interface RegistrationFormDataInputMetadata {\n utmFirstClick?: string | null\n utmLastClick?: string | null\n sessionCount?: number | null\n ga?: string | null\n gid?: string | null\n landingPage?: string | null\n}\n\nexport interface SupportRequestGraphQLInput {\n message: string\n}\n\nexport interface UpdateAccountDetailsGraphQLInput {\n salutation?: SalesforceSalutation | null\n firstName?: string | null\n lastName?: string | null\n company?: string | null\n phone?: string | null\n referredById?: string | null\n newsletter?: boolean | null\n language?: SalesforceLanguage | null\n hasOptedOutOfEmail?: boolean | null\n}\n\n//==============================================================\n// END Enums and Input Objects\n//==============================================================\n","import { useRef, useState } from 'react'\n\nimport { DocumentNode, OperationVariables, useLazyQuery } from '@apollo/client'\nimport { logError } from 'services/sentry'\nimport { safeClearTimeout } from 'utils/misc'\n\nexport const useQueryWithPolling = (\n query: DocumentNode,\n variables?: OperationVariables,\n pollingExitCheck?: (data: T) => boolean,\n pollInterval = 0,\n timeout = 0,\n onError?: (error: Error) => void,\n onLoaded?: (data: T) => void\n) => {\n const timerId = useRef | null>(null)\n\n const [loading, setLoading] = useState(undefined)\n const [error, setError] = useState(undefined)\n const [result, setResult] = useState()\n\n const [fetch, { startPolling, stopPolling, refetch }] = useLazyQuery(query, {\n variables,\n fetchPolicy: 'no-cache',\n nextFetchPolicy: 'no-cache',\n onCompleted: (data) => {\n if (!pollingExitCheck || pollingExitCheck(data)) {\n stopPolling()\n setLoading(false)\n setResult(data)\n safeClearTimeout(timerId.current)\n onLoaded?.(data)\n }\n },\n onError: (error) => {\n logError(error)\n setLoading(false)\n setError(error)\n safeClearTimeout(timerId.current)\n onError?.(error)\n },\n })\n\n const fireTimeout = () => {\n // TODO: create custom error\n stopPolling()\n const error = new Error('Timeout')\n logError(error)\n setError(error)\n onError?.(error)\n }\n\n const poll = () => {\n setLoading(true)\n if (timeout) {\n timerId.current = setTimeout(fireTimeout, timeout)\n }\n startPolling(pollInterval)\n }\n\n return { result, loading, error, poll, stopPolling, refetch, fetch }\n}\n","import { useCallback, useMemo } from 'react'\n\nimport { useCalendly, theme } from '@linus-capital/linus-ui'\nimport { useUser } from 'contexts/UserContext'\nimport { environment, webAppLocales, CALENDLY_ONBOARDING_LINK } from 'utils/constants'\nimport { parseJSONString } from 'utils/stringUtils'\nimport * as uuid from 'uuid'\n\nimport { usePlatform } from './usePlatform'\nimport { useTranslate } from './useTranslate'\n\nconst appEnv = process.env.REACT_APP_ENVIRONMENT\n\nconst calendlyColor = theme.colors.success.substring(1)\n\ntype PublicCalendlyUrlProps = { payload?: string }\ntype PrivateCalendlyUrlProps = { calendlyUrlPath: string; source: string }\ntype CalendlyUrlProps = { payload?: string; source?: string }\n\ntype CalendlyInputType = {\n utmCampaign: string\n}\n\ntype LocalUser = {\n firstName: string\n lastName: string\n email: string\n phone: string\n}\n\nexport const UTM_SOURCE_TYPES = {\n MARKETPLACE_REGISTRATION_ONBOARDING_CALL: 'marketplace-registration-onboarding-call',\n PLATFORM_PROJECT_OVERVIEW: 'platform-project-overview',\n}\n\nexport const getUtmContent = (userId: string) => {\n const content = {\n marketplaceUserId: userId,\n targetDeploymentIdentifier: `marketplace-monolith-${appEnv}`,\n }\n return JSON.stringify(content)\n}\n\n/**\n 1. If the marketplaceUser is NOT available set utm_medium=repurposed-for-web-app and set utm_source={appEnv} \n ---> getPublicCalendlyUrl\n 2. If marketplaceUser is available do NOT set utm_medium=repurposed-for-web-app, do set utmContent=getUtmContent(userId), and utm_source is:\n a) marketplace-registration-onboarding-call\n b) platform-project-overview (onboarding call from /overview)\n c) for 15min call\n ---> getPrivateCalendlyUrl\n 3. utmCampaign is currently only set on landing pages, and thus only present in public urls.\n**/\n\nexport const useBuildCalendlyUrl = (localUser?: LocalUser) => {\n const { language } = useTranslate()\n const { isUK } = usePlatform()\n const { user } = useUser()\n const calendly = useCalendly()\n\n /** for public routes and landing pages **/\n const getPublicCalendlyUrl = useCallback(\n (props?: PublicCalendlyUrlProps) => {\n const utmMedium = '&utm_medium=repurposed-for-web-app'\n const utmContent = `&utm_content=${uuid.v4()}`\n const utmSource = `&utm_source=${appEnv}`\n const campaign = props?.payload ? parseJSONString(props?.payload)?.utmCampaign : ''\n const utmCampaign = campaign ? `&utm_campaign=${campaign}` : ''\n let calendar = ''\n\n if (appEnv === environment.PRODUCTION) {\n calendar = isUK\n ? 'linus-uk/15-min-meeting'\n : `linus-finance/15min-${webAppLocales[language as keyof typeof webAppLocales]}`\n } else {\n calendar = 'linus-test/15min'\n }\n\n return `https://calendly.com/${calendar}?primary_color=${calendlyColor}&hide_gdpr_banner=1${utmMedium}${utmSource}${utmCampaign}${utmContent}`\n },\n [isUK, language]\n )\n\n /** for private routes (marketplaceUser is available) **/\n const getPrivateCalendlyUrl = useCallback(\n ({ calendlyUrlPath, source }: PrivateCalendlyUrlProps) => {\n let calendar = ''\n const utmSource = `&utm_source=${source}`\n const utmContent = `&utm_content=${getUtmContent(user?.id)}`\n\n if (calendlyUrlPath && appEnv === environment.PRODUCTION) {\n calendar = calendlyUrlPath\n .replace(/{locale}/, webAppLocales[language as keyof typeof webAppLocales])\n .replace('https://calendly.com/', '')\n } else {\n calendar = 'linus-test/15min'\n }\n\n return `https://calendly.com/${calendar}?primary_color=${calendlyColor}&hide_gdpr_banner=1${utmSource}${utmContent}`\n },\n [language, user?.id]\n )\n\n const makeAppointment = useCallback(\n ({ payload, source }: CalendlyUrlProps) => {\n const calendlyUrlPath =\n source === UTM_SOURCE_TYPES.PLATFORM_PROJECT_OVERVIEW\n ? CALENDLY_ONBOARDING_LINK\n : user?.accountManager?.calendlyLinkTemplate\n const url = calendlyUrlPath\n ? getPrivateCalendlyUrl({ calendlyUrlPath, source: source ?? '' })\n : getPublicCalendlyUrl({ payload })\n\n calendly?.initPopupWidget({\n url,\n prefill: {\n name: `${user?.firstName} ${user?.lastName}`,\n email: user?.email,\n },\n })\n },\n [\n user?.accountManager?.calendlyLinkTemplate,\n user?.firstName,\n user?.lastName,\n user?.email,\n calendly,\n getPrivateCalendlyUrl,\n getPublicCalendlyUrl,\n ]\n )\n\n const inlineCalendly = useMemo(() => {\n const utm = {\n utmSource: UTM_SOURCE_TYPES.MARKETPLACE_REGISTRATION_ONBOARDING_CALL,\n utmContent: getUtmContent(user?.id),\n }\n\n const link = CALENDLY_ONBOARDING_LINK.replace(\n /{locale}/,\n webAppLocales[language as keyof typeof webAppLocales]\n )\n const url = `${link}?primary_color=${calendlyColor}&hide_gdpr_banner=1&hide_event_type_details=1`\n\n return {\n url,\n prefill: {\n name: `${localUser?.firstName || user?.firstName} ${localUser?.lastName || user?.lastName}`,\n email: `${localUser?.email || user?.email}`,\n customAnswers: {\n a1: `${localUser?.phone ?? user?.phone}`,\n },\n },\n utm,\n }\n }, [\n language,\n localUser?.email,\n localUser?.firstName,\n localUser?.lastName,\n localUser?.phone,\n user?.email,\n user?.firstName,\n user?.id,\n user?.lastName,\n user?.phone,\n ])\n\n return { makeAppointment, inlineCalendly, getPublicCalendlyUrl }\n}\n","import React, {\n createContext,\n useContext,\n useCallback,\n useMemo,\n useRef,\n useState,\n PropsWithChildren,\n useEffect,\n Dispatch,\n SetStateAction,\n} from 'react'\n\nimport { gql, useLazyQuery } from '@apollo/client'\nimport { Loading } from 'components/Loading'\nimport { useTranslate } from 'hooks/useTranslate'\nimport { InvestmentRequest_investmentRequest_deal } from 'pages/Checkout/CheckoutWizard/gql-query-types/InvestmentRequest'\nimport { useLocation, useParams } from 'react-router-dom'\nimport { FormData } from 'types/CheckoutFormData'\nimport { InvestmentRequestStatus, StageName } from 'types/graphql-global-types'\nimport { AvailableAuthorizedSignatory, Stage } from 'types/Stages'\nimport { routes } from 'utils/constants'\n\nimport { Product, Product_product } from './gql-query-types/Product'\nimport { normalizeInvestmentRequest } from './utils'\n\nexport type Config = {\n stageTitles: string[]\n stages: Stage[]\n offset: number\n hasNext: boolean\n totalStages: number\n}\n\nexport type ConfigInput = {\n stageTitles: string[] | null\n stages: string | null\n offset: number | null\n hasNext: boolean | null\n totalStages: number | null\n} | null\n\nexport type InvestmentRequest = {\n id?: string\n formData: FormData\n interestRate: number | null\n status: InvestmentRequestStatus\n coInvestmentStageName: StageName | null\n checkoutFormConfig: {\n main: Config\n authorizedSignatory: Config\n }\n authorizedSignatories?: AvailableAuthorizedSignatory[]\n fundName: string | null\n}\n\nexport type UpdateInvestmentRequestType = {\n id?: string | null\n formData?: string | null\n interestRate?: number | null\n status?: InvestmentRequestStatus | null\n checkoutFormConfig?: {\n main: ConfigInput\n authorizedSignatory: ConfigInput\n } | null\n authorizedSignatories?: (AvailableAuthorizedSignatory | null)[] | null\n deal?: InvestmentRequest_investmentRequest_deal | null\n}\n\nexport type ContextValueType = {\n product: Product_product['deal']\n investmentRequest: InvestmentRequest\n updateInvestmentRequest: (\n data: T,\n currentStageIndex?: number\n ) => void\n shouldRefetchInvestmentRequest: boolean\n setShouldRefetchInvestmentRequest: Dispatch>\n}\n\nconst configDefaultValue: Config = {\n stageTitles: [],\n stages: [],\n offset: 0,\n hasNext: true,\n totalStages: 0,\n}\n\nconst defaultInvestmentRequest = {\n id: '',\n checkoutFormConfig: {\n main: configDefaultValue,\n authorizedSignatory: configDefaultValue,\n },\n status: InvestmentRequestStatus.DRAFT,\n coInvestmentStageName: null,\n authorizedSignatories: [],\n formData: {},\n interestRate: null,\n fundName: null,\n}\n\nexport const CheckoutContext = createContext({\n product: null,\n investmentRequest: defaultInvestmentRequest,\n updateInvestmentRequest: () => {},\n shouldRefetchInvestmentRequest: false,\n setShouldRefetchInvestmentRequest: () => {},\n})\n\nconst GET_PRODUCT = gql`\n query Product($dealId: String!, $language: Language!) {\n product(dealId: $dealId, language: $language) {\n deal {\n id\n name\n fundName\n previewImage\n hasDetailsPage\n introText\n currencyIsoCode\n }\n }\n }\n`\n\nexport const CheckoutProvider = ({ children }: PropsWithChildren<{}>) => {\n const { productId } = useParams<{ productId: string }>()\n const { pathname } = useLocation()\n const { salesforceLanguage } = useTranslate()\n const [shouldRefetchInvestmentRequest, setShouldRefetchInvestmentRequest] = useState(false)\n const initialRender = useRef(true)\n\n const [product, setProduct] = useState(null)\n const [investmentRequest, setInvestmentRequest] = useState(defaultInvestmentRequest)\n\n const stageIndex = useRef(0)\n\n const [fetchProduct, { loading }] = useLazyQuery(GET_PRODUCT, {\n variables: {\n dealId: productId,\n language: salesforceLanguage(),\n },\n onCompleted: (data) => {\n if (data.product?.deal) {\n setProduct(data.product?.deal)\n }\n },\n })\n\n useEffect(() => {\n if (pathname === `${routes.CHECKOUT}/${productId}`) {\n ;(async () => {\n await fetchProduct()\n })()\n } else if (initialRender.current) {\n setShouldRefetchInvestmentRequest(true)\n initialRender.current = false\n }\n }, [fetchProduct, pathname, productId])\n\n const updateInvestmentRequest = useCallback(\n (data: T, newStageIndex: number = 0) => {\n const normalizedInvestmentRequest = normalizeInvestmentRequest(data)\n\n const toUpdateRequest = {\n ...investmentRequest,\n ...normalizedInvestmentRequest,\n fundName: normalizedInvestmentRequest?.deal?.fundName,\n } as InvestmentRequest\n\n if (data?.deal) {\n setProduct(data.deal)\n }\n setInvestmentRequest(toUpdateRequest)\n stageIndex.current = newStageIndex\n },\n [investmentRequest]\n )\n\n const contextValue = useMemo(\n () => ({\n product,\n updateInvestmentRequest,\n investmentRequest,\n shouldRefetchInvestmentRequest,\n setShouldRefetchInvestmentRequest,\n }),\n [product, updateInvestmentRequest, investmentRequest, shouldRefetchInvestmentRequest]\n )\n\n if (loading) {\n return \n }\n\n return {children}\n}\n\nexport const useCheckout = () => useContext(CheckoutContext)\n","import { gql } from '@apollo/client'\nimport { Platform } from 'utils/constants'\n\nexport const GET_USER_UK = gql`\n query MarketplaceUserUK {\n marketplaceUser {\n id\n email\n salutation\n firstName\n lastName\n phone\n newsletter\n language\n company\n ndaAcceptedAt\n platformAccess\n termsConditionsAcceptedAt\n onboardingCall {\n startTime\n endTime\n }\n accountManager {\n id\n email\n firstName\n lastName\n title\n imageUrl\n profileId\n mobilePhone\n calendlyLinkTemplate\n signatureImageUrl\n }\n joinedNewDealsWaitingList\n ukInvestorClassification\n acceptedUkRiskWarning\n ndaAccepted\n termsConditionsAccepted\n contactDetailsSubmitted\n welcomeMessageConfirmed\n status\n hasOptedOutOfEmail\n registrationStatus\n source\n invitationStatus\n fallbackRegistrationStatus\n ukClassificationFormConfig {\n stages\n stageTitles\n }\n ukClassificationFormData\n ukClassificationSubmitted\n platform\n }\n }\n`\n\nexport const GET_USER_EU = gql`\n query MarketplaceUserEU {\n marketplaceUser {\n id\n email\n salutation\n firstName\n lastName\n phone\n newsletter\n language\n company\n ndaAcceptedAt\n platformAccess\n termsConditionsAcceptedAt\n onboardingCall {\n startTime\n endTime\n }\n accountManager {\n id\n email\n firstName\n lastName\n title\n imageUrl\n profileId\n mobilePhone\n calendlyLinkTemplate\n signatureImageUrl\n }\n joinedNewDealsWaitingList\n ukInvestorClassification\n acceptedUkRiskWarning\n ndaAccepted\n termsConditionsAccepted\n contactDetailsSubmitted\n welcomeMessageConfirmed\n status\n hasOptedOutOfEmail\n registrationStatus\n source\n invitationStatus\n fallbackRegistrationStatus\n platform\n }\n }\n`\n\nexport const GET_USER = {\n [Platform.EU]: GET_USER_EU,\n [Platform.UK]: GET_USER_UK,\n}\n\nexport const GET_USER_ONBOARDING_CALL = gql`\n query MarketplaceUserOnboardingCall {\n marketplaceUser {\n onboardingCall {\n startTime\n endTime\n }\n }\n }\n`\n\nexport const UPDATE_USER = gql`\n mutation UpdateAccountDetails($update: UpdateAccountDetailsGraphQLInput, $deleteItems: [String]) {\n updateAccountDetails(update: $update, deleteItems: $deleteItems)\n }\n`\n\nexport const CONFIRM_WELCOME_MESSAGE = gql`\n mutation ConfirmWelcomeMessage {\n confirmWelcomeMessage\n }\n`\n\nexport const ACCEPT_NDA_AND_TERMS = gql`\n mutation AcceptNdaAndTerms {\n acceptNdaAndTerms\n }\n`\n\nexport const JOIN_DEALS_WAITING_LIST = gql`\n mutation JoinNewDealsWaitingList {\n joinNewDealsWaitingList\n }\n`\n","import Cookie from 'js-cookie'\n\ndeclare global {\n interface Window {\n initUtm: any\n getTrackedEvents: any\n dataLayer: {\n push: (event: any) => void\n }\n }\n}\n\nexport const init = () => {\n window.initUtm()\n}\n\nexport const getFirstClick = () => {\n try {\n const trackedEvents = window.getTrackedEvents()\n return trackedEvents.length > 0 ? trackedEvents[0] : null\n } catch (e) {\n return null\n }\n}\n\nexport const getLastClick = () => {\n try {\n const trackedEvents = window.getTrackedEvents()\n return trackedEvents.length > 0 ? trackedEvents[trackedEvents.length - 1] : null\n } catch (e) {\n return null\n }\n}\n\nexport const getSessionCount = () => {\n try {\n const trackedEvents = window.getTrackedEvents()\n return trackedEvents.length\n } catch (e) {\n return null\n }\n}\n\nexport const pushEvent = (event: string) => window.dataLayer?.push({ event })\n\nexport const getMetaData = (isNewRegistration = true) => {\n if (isNewRegistration) {\n return {\n utmFirstClick: JSON.stringify(getFirstClick()) || null,\n utmLastClick: JSON.stringify(getLastClick()) || null,\n sessionCount: getSessionCount() ?? null,\n ga: Cookie.get('_ga')?.toString() || null,\n gid: Cookie.get('_gid')?.toString() || null,\n }\n } else {\n return {\n utmFirstClick: getFirstClick(),\n utmLastClick: getLastClick(),\n sessionCount: getSessionCount(),\n ga: Cookie.get('_ga'),\n gid: Cookie.get('_gid'),\n }\n }\n}\n","import React, {\n createContext,\n Dispatch,\n PropsWithChildren,\n useCallback,\n useContext,\n useRef,\n useState,\n} from 'react'\n\nimport { useMutation, resetCaches, useLazyQuery } from '@apollo/client'\nimport { useQueryWithPolling } from 'hooks/useQueryWithPolling'\nimport { logError } from 'services/sentry'\nimport { IdentCaseTransactionStatus, IdentCaseType, PersonDataInput } from 'types/graphql-global-types'\nimport { mapIdentproviderToCaseType, mapIdentproviderToTransactionType } from 'utils/mappingUtils'\n\nimport {\n IdentificationProvider,\n IdentificationStatus,\n PersonData,\n useInvestorIdentificationContext,\n} from '../InvestorIdentification/InvestorIdentificationProvider'\nimport { CreateIdentCase, CreateIdentCaseVariables } from './gql-query-types/CreateIdentCase'\nimport { CreateIdentCaseTransaction } from './gql-query-types/CreateIdentCaseTransaction'\nimport { IdentCases, IdentCases_identCases } from './gql-query-types/IdentCases'\nimport { CREATE_IDENT_CASE, CREATE_IDENT_CASE_TRANSACTION, IDENT_CASES } from './gqls'\n\nconst WINDOW_CLOSE_CAPTURE_INTERVAL = 1000\n\nexport enum StatusMessage {\n ABORTED,\n SYSTEM_FAILED,\n IDENTIFICATION_FAILED,\n SUCCESS,\n IDENTIFICATION_START_FAILED,\n NEW_IDENTIFICATION_STARTED,\n}\n\nexport type UpdaterCallback = (statusMessage: StatusMessage) => void\n\ntype IdVerificationContextType = {\n startIdVerification?: (url: string) => void\n cancelIdVerification?: () => void\n identificationStatus?: IdentificationStatus\n createTransaction?: (personData: PersonDataInput) => Promise\n identCaseId?: string\n identCase?: IdentCases_identCases\n provider?: IdentificationProvider\n setIdentCaseId?: (id: string) => void\n setIdentCase?: React.Dispatch>\n setProvider?: React.Dispatch>\n setBlock?: React.Dispatch>\n poll?: () => void\n updateStatus?: (updater: (statusMessage: StatusMessage) => void) => void\n isFetchingUrl?: boolean\n setFetchingUrl?: Dispatch>\n personData?: PersonData\n setPersonData?: Dispatch>\n marketplaceUserId?: string\n setMarketplaceUserId?: Dispatch>\n handleStartIdVerification?: (data: PersonData) => void\n startOrContinueIdent?: (id: string, provider?: IdentificationProvider) => void\n}\n\nconst IdVerificationContext = createContext({\n identificationStatus: { inProgress: false, isWindowExist: false },\n})\n\nexport const useIdVerificationContext = () => useContext(IdVerificationContext)\n\ntype IdVerificationProviderProps = PropsWithChildren<{}>\n\nexport const IdVerificationProvider = ({ children }: IdVerificationProviderProps) => {\n const updaterRef = useRef(null)\n const timerId = useRef | null>(null)\n\n const [isFetchingUrl, setFetchingUrl] = useState(false)\n const [personData, setPersonData] = useState({\n firstName: '',\n lastName: '',\n birthDate: '',\n email: '',\n })\n const {\n provider,\n setProvider,\n clickOutWindowRef,\n setClickOutWindowRef,\n identificationStatus,\n setIdentificationStatus,\n } = useInvestorIdentificationContext()\n\n const [identCase, setIdentCase] = useState({} as IdentCases_identCases)\n const [identCaseId, setIdentCaseId] = useState('')\n\n const [createIdentCase] = useMutation(CREATE_IDENT_CASE)\n\n const createIdNowWindow = useCallback(\n (url: string) => {\n if (!clickOutWindowRef || clickOutWindowRef?.closed) {\n setClickOutWindowRef?.(window.open(url, '_blank'))\n }\n },\n [clickOutWindowRef, setClickOutWindowRef]\n )\n\n const startIdVerification = useCallback(\n (url: string) => {\n if (url) {\n createIdNowWindow(url)\n setIdentificationStatus?.({\n inProgress: true,\n isWindowExist: !!clickOutWindowRef,\n clickOutURL: url,\n })\n //startPullTimer()\n }\n },\n [clickOutWindowRef, createIdNowWindow, setIdentificationStatus]\n )\n\n const createTransaction = useCallback(\n async (personData: PersonDataInput) => {\n await createIdentCase({\n variables: { identCaseType: IdentCaseType.LINUS, personData },\n })\n },\n [createIdentCase]\n )\n\n const { poll: pollStatus, stopPolling: stopPollingStatus } = useQueryWithPolling(\n IDENT_CASES,\n { filter: { ids: [identCase?.id ?? identCaseId] } },\n (data) => {\n if (data?.identCases?.length > 0) {\n const status = data.identCases[0]?.currentTransaction?.status\n switch (status) {\n case IdentCaseTransactionStatus.ABORTED:\n // user - canceled ident - show aborted info message\n updaterRef.current?.(StatusMessage.ABORTED)\n stopPollingStatus()\n break\n case IdentCaseTransactionStatus.FAILED_TO_START:\n // error - our backend failed - just show error - no retry\n stopPollingStatus()\n updaterRef.current?.(StatusMessage.SYSTEM_FAILED)\n break\n case IdentCaseTransactionStatus.FAILED:\n // error - this after identification - failed identification\n updaterRef.current?.(StatusMessage.IDENTIFICATION_FAILED)\n stopPollingStatus()\n break\n case IdentCaseTransactionStatus.SUCCESS:\n // success - show success message - update UI\n cancelIdVerification()\n updaterRef.current?.(StatusMessage.SUCCESS)\n break\n case IdentCaseTransactionStatus.CREATED:\n // won't happen in this poll - let's keep it for error tracking - add GA event\n break\n case IdentCaseTransactionStatus.PENDING:\n case IdentCaseTransactionStatus.STARTED:\n // ignore - continue polling - let's keep it for time or error tracking - add GA events\n break\n }\n }\n return false\n },\n 5000,\n 20 * 60 * 1000, // polling for 20 mins\n (error) => {\n logError(error)\n }\n )\n\n const [fetchIdentCase] = useLazyQuery(IDENT_CASES, {\n variables: { filter: { ids: [identCase?.id ? identCase?.id : identCaseId] } },\n fetchPolicy: 'no-cache',\n onCompleted: (data: IdentCases) => {\n setIdentCase(data?.identCases[0])\n updaterRef.current?.(StatusMessage.NEW_IDENTIFICATION_STARTED)\n const identRedirectUrl = data?.identCases[0]?.currentTransaction?.identRedirectUrl\n if (identRedirectUrl && !identificationStatus?.inProgress) {\n setTimeout(() => {\n startIdVerification?.(identRedirectUrl)\n pollStatus?.()\n })\n }\n },\n onError: (error) => {\n logError(error)\n setFetchingUrl?.(false)\n updaterRef.current?.(StatusMessage.IDENTIFICATION_START_FAILED)\n },\n })\n\n const { poll, stopPolling } = useQueryWithPolling(\n IDENT_CASES,\n { filter: { ids: [provider && identCase?.id ? identCase?.id : identCaseId] } },\n (data) => {\n if (data?.identCases?.length > 0) {\n const identRedirectUrl = data.identCases[0]?.currentTransaction?.identRedirectUrl\n if (\n identRedirectUrl &&\n mapIdentproviderToTransactionType(provider) == data.identCases[0]?.currentTransaction?.type\n ) {\n stopPolling()\n setTimeout(() => {\n startIdVerification?.(identRedirectUrl)\n pollStatus()\n })\n return true\n }\n }\n return false\n },\n 2000,\n 30 * 1000, // polling for URL\n (error) => {\n logError(error)\n cancelIdVerification()\n }\n )\n\n const cancelIdVerification = useCallback(() => {\n setIdentificationStatus?.({ inProgress: false, isWindowExist: false })\n stopPolling()\n stopPollingStatus()\n setFetchingUrl(false)\n setIdentCase({} as IdentCases_identCases)\n try {\n clickOutWindowRef?.close()\n setClickOutWindowRef?.(null)\n if (timerId.current) {\n clearInterval(timerId.current)\n }\n } catch (error) {\n logError(error as Error)\n }\n }, [stopPolling, stopPollingStatus, clickOutWindowRef, setClickOutWindowRef, setIdentificationStatus])\n\n const updateStatus = useCallback((updater: UpdaterCallback) => {\n updaterRef.current = updater\n }, [])\n\n const [startIdentCaseTransaction] = useMutation(CREATE_IDENT_CASE_TRANSACTION, {\n variables: {\n identCaseId: identCase?.id ?? identCaseId,\n identCaseTransactionType: mapIdentproviderToTransactionType(provider),\n },\n onError: (error) => {\n logError(error)\n setFetchingUrl?.(false)\n updaterRef.current?.(StatusMessage.IDENTIFICATION_START_FAILED)\n },\n })\n\n const [fetchIdentCaseId] = useMutation(CREATE_IDENT_CASE, {\n onCompleted: async (data) => {\n setIdentCaseId?.(data.createIdentCase)\n await startOrContinueIdent(data.createIdentCase, provider)\n },\n onError: (error) => {\n logError(error)\n setFetchingUrl?.(false)\n updaterRef.current?.(StatusMessage.IDENTIFICATION_START_FAILED)\n },\n })\n\n const handleStartIdVerification = useCallback(\n async (data: PersonData) => {\n setFetchingUrl?.(true)\n setPersonData(data)\n\n await fetchIdentCaseId({\n variables: {\n identCaseType: mapIdentproviderToCaseType(provider),\n personData: data,\n },\n })\n },\n [fetchIdentCaseId, provider]\n )\n\n const startOrContinueIdent = useCallback(\n async (id, provider) => {\n resetCaches()\n setFetchingUrl?.(true)\n\n if (\n identCase?.currentTransaction &&\n identCase?.currentTransaction?.status === IdentCaseTransactionStatus.STARTED &&\n mapIdentproviderToTransactionType(provider) === identCase.currentTransaction.type\n ) {\n if (identCase.currentTransaction.identRedirectUrl) {\n startIdVerification(identCase.currentTransaction.identRedirectUrl)\n setIdentCaseId(id)\n setProvider?.(provider)\n pollStatus?.()\n }\n } else {\n await startIdentCaseTransaction({\n variables: {\n identCaseId: id,\n identCaseTransactionType: mapIdentproviderToTransactionType(provider),\n },\n onCompleted: () => {\n setTimeout(() => {\n fetchIdentCase({\n variables: { filter: { ids: [id] } },\n })\n }, 3000)\n },\n })\n }\n },\n [\n startIdentCaseTransaction,\n fetchIdentCase,\n setProvider,\n identCase,\n startIdVerification,\n pollStatus,\n setIdentCaseId,\n ]\n )\n\n return (\n \n {children}\n \n )\n}\n","import { IdentificationProvider } from 'pages/InvestorIdentification/InvestorIdentificationProvider'\nimport { IdentCaseTransactionType, IdentCaseType } from 'types/graphql-global-types'\n\nexport const mapIdentproviderToCaseType = (provider?: IdentificationProvider) => {\n switch (provider) {\n case IdentificationProvider.ID_NOW:\n case IdentificationProvider.POST_IDENT:\n return IdentCaseType.AML\n case IdentificationProvider.ID_NOW_AUTO:\n return IdentCaseType.LINUS\n case IdentificationProvider.ID_NOW_QES:\n case IdentificationProvider.POST_IDENT_QES:\n return IdentCaseType.QES_AML\n }\n}\n\nexport const mapIdentproviderToTransactionType = (provider?: IdentificationProvider) => {\n switch (provider) {\n case IdentificationProvider.ID_NOW:\n return IdentCaseTransactionType.IDNOW_VIDEO\n case IdentificationProvider.POST_IDENT:\n return IdentCaseTransactionType.LIONWARE_POSTIDENT\n case IdentificationProvider.ID_NOW_AUTO:\n return IdentCaseTransactionType.IDNOW_AUTO\n case IdentificationProvider.ID_NOW_QES:\n return IdentCaseTransactionType.IDNOW_QES\n case IdentificationProvider.POST_IDENT_QES:\n return IdentCaseTransactionType.LIONWARE_POSTIDENT_QES\n default:\n return IdentCaseTransactionType.MANUAL\n }\n}\n","import { gql } from '@apollo/client'\n\nexport const CREATE_IDENT_CASE = gql`\n mutation CreateIdentCase($identCaseType: IdentCaseType!, $personData: PersonDataInput!) {\n createIdentCase(identCaseType: $identCaseType, personData: $personData)\n }\n`\n\nexport const CREATE_IDENT_CASE_TRANSACTION = gql`\n mutation CreateIdentCaseTransaction(\n $identCaseId: ID!\n $identCaseTransactionType: IdentCaseTransactionType!\n ) {\n createIdentCaseTransaction(identCaseId: $identCaseId, identCaseTransactionType: $identCaseTransactionType)\n }\n`\n\nexport const IDENT_CASES = gql`\n query IdentCases($filter: IdentCaseFilter) {\n identCases(filter: $filter) {\n id\n type\n status\n creationDate\n currentTransaction {\n status\n type\n id\n identRedirectUrl\n }\n }\n }\n`\n","import { FormData } from 'types/CheckoutFormData'\nimport { Stage } from 'types/Stages'\nimport { parseJSONString } from 'utils/stringUtils'\n\nimport { UpdateInvestmentRequestType, ConfigInput } from './CheckoutProvider'\n\nconst toConfig = (config: ConfigInput) => ({\n ...config,\n stages: parseJSONString(config?.stages!) as Stage[],\n})\n\nconst toFormConfig = (checkoutConfig?: UpdateInvestmentRequestType['checkoutFormConfig']) => {\n if (checkoutConfig) {\n return {\n checkoutFormConfig: {\n main: toConfig(checkoutConfig?.main),\n authorizedSignatory: toConfig(checkoutConfig?.authorizedSignatory),\n },\n }\n }\n return {}\n}\n\nexport const normalizeInvestmentRequest = (data?: UpdateInvestmentRequestType | null) =>\n data\n ? {\n ...data,\n formData: parseJSONString(data?.formData!) as FormData,\n ...toFormConfig(data?.checkoutFormConfig),\n }\n : null\n","import { useEffect } from 'react'\n\nimport { useLocation } from 'react-router-dom'\n\nexport const ScrollToTop = () => {\n const { pathname } = useLocation()\n\n useEffect(() => {\n window.scrollTo(0, 0)\n }, [pathname])\n\n return null\n}\n","import React, { useMemo, PropsWithChildren } from 'react'\n\ntype NestedComposerProps = PropsWithChildren<{\n components: React.JSXElementConstructor[]\n}>\n\n// based on https://stackoverflow.com/questions/51504506/too-many-react-context-providers\nexport const NestedComposer = ({ components, children }: NestedComposerProps) => {\n const composed = useMemo(\n () =>\n components.reduceRight((acc, CurrentComponent) => {acc}, children),\n [children, components]\n )\n return <>{composed}\n}\n","import i18n from 'i18next'\nimport LanguageDetector from 'i18next-browser-languagedetector'\nimport Backend from 'i18next-http-backend'\nimport { initReactI18next } from 'react-i18next'\n\ni18n\n .use(Backend)\n .use(LanguageDetector)\n .use(initReactI18next)\n .init({\n fallbackLng: 'de',\n ns: ['translation'],\n defaultNS: 'translation',\n interpolation: {\n escapeValue: false,\n },\n debug: false,\n })\n\nexport default i18n\n","import React, { PropsWithChildren } from 'react'\n\nimport { ThemeProvider, ToastProvider } from '@linus-capital/linus-ui'\nimport { ErrorBoundary } from 'components/ErrorBoundary'\nimport { NestedComposer } from 'components/NestedComposer'\nimport { ApolloProvider } from 'contexts/ApolloProvider'\nimport { UserProvider } from 'contexts/UserContext'\nimport { IdVerificationProvider } from 'pages/IdVerification/IdVerificationContext'\nimport { InvestorIdentificationProvider } from 'pages/InvestorIdentification/InvestorIdentificationProvider'\nimport { I18nextProvider } from 'react-i18next'\nimport i18n from 'services/i18n'\n\ntype Props = PropsWithChildren<{}>\n\nconst components: React.JSXElementConstructor[] = [\n ThemeProvider,\n ErrorBoundary,\n ApolloProvider,\n ToastProvider,\n]\n\nconst privateComponents: React.JSXElementConstructor[] = [\n UserProvider,\n InvestorIdentificationProvider,\n IdVerificationProvider,\n]\n\nexport const BaseProviders = ({ children }: Props) => (\n \n {children}\n \n)\n\nexport const PrivateProviders = ({ children }: Props) => (\n {children}\n)\n\nconst AppProviders = ({ children }: Props) => (\n \n {children}\n \n)\n\nexport default AppProviders\n","import React, { PropsWithChildren, useCallback } from 'react'\n\nimport { Box, Button, Flex, H3, Text } from '@linus-capital/linus-ui'\nimport { ErrorBoundary as SentryErrorBoundary } from '@sentry/react'\nimport { useTranslate } from 'hooks/useTranslate'\n\nexport const ErrorBoundary = ({ children }: PropsWithChildren<{}>) => {\n const { translate } = useTranslate()\n\n const handleReload = useCallback(() => {\n window.location.reload()\n }, [])\n\n return (\n \n \n

{translate('error.boundary.title')}

\n {translate('error.boundary.subTitle')}\n \n
\n \n }\n >\n {children}\n \n )\n}\n","import { useEffect } from 'react'\n\nimport { Action, useActionExecutor } from './useActionExecutor'\n\nexport const ActionsHandler = () => {\n const { actionExecute } = useActionExecutor()\n\n useEffect(() => {\n const handleAction = (event: CustomEvent) => {\n const { detail } = event\n actionExecute(detail)\n }\n window.document.addEventListener('builderAction', handleAction as (e: Event) => void)\n return () => {\n window.document.removeEventListener('builderAction', handleAction as (e: Event) => void)\n }\n }, [actionExecute])\n\n return null\n}\n","import { useCallback } from 'react'\n\nimport { useToast } from '@linus-capital/linus-ui'\nimport { useUser } from 'contexts/UserContext'\nimport { MarketplaceUser } from 'contexts/UserContext/UserContext'\nimport { useBuildCalendlyUrl } from 'hooks/useBuildCalendlyUrl'\nimport { useTranslate } from 'hooks/useTranslate'\nimport { useNavigate } from 'react-router-dom'\nimport { logError } from 'services/sentry'\n\nexport type Action =\n | { action: 'follow-link'; payload: string }\n | { action: '15min-call'; payload: string }\n | { action: 'link'; payload: string }\n | { action: 'show-locked-notification'; payload: unknown }\n | { action: 'download-document'; payload: string }\n | { action: 'get-user'; payload: (user: MarketplaceUser | null | undefined) => void }\n\nexport const useActionExecutor = () => {\n const { addToast } = useToast()\n const { makeAppointment } = useBuildCalendlyUrl()\n const { translate } = useTranslate()\n const navigate = useNavigate()\n const { user } = useUser()\n\n const actionExecute = useCallback<(action: Action) => void>(\n (builderEvent) => {\n switch (builderEvent.action) {\n case '15min-call':\n makeAppointment({ payload: builderEvent.payload })\n break\n case 'show-locked-notification':\n addToast({\n message: translate('projectOverview.onboarding.lockedNotification'),\n position: 'bottom-right',\n status: 'info',\n })\n break\n case 'download-document':\n window.open(`/download/${builderEvent.payload}?closeTab=1&type=PROJECT`, '_blank')\n break\n case 'follow-link':\n if (builderEvent.payload.substring(0, 2) === '//') {\n window.open(builderEvent.payload, '_blank')\n } else {\n navigate(builderEvent.payload)\n }\n break\n case 'get-user':\n builderEvent.payload(user)\n break\n case 'link':\n navigate(builderEvent.payload)\n break\n default:\n logError(new Error(`Unknown action ${builderEvent}`))\n break\n }\n },\n [addToast, makeAppointment, navigate, translate, user]\n )\n\n return { actionExecute }\n}\n","export const getRedirectUrl = (language: string) => `${window.location.origin}/auth-callback?lng=${language}`\n","import React from 'react'\n\nimport { withAuthenticationRequired } from '@auth0/auth0-react'\nimport { Loading } from 'components/Loading'\nimport { useApolloProvider } from 'contexts/ApolloProvider/ApolloProvider'\nimport { usePlatform } from 'hooks/usePlatform'\nimport { useTranslate } from 'hooks/useTranslate'\nimport { useLocation } from 'react-router-dom'\nimport { routes } from 'utils/constants'\nimport { getRedirectUrl } from 'utils/pathUtils'\n\nexport const PrivateRoute = ({ component }: React.PropsWithChildren) => {\n const { language } = useTranslate()\n const { platform } = usePlatform()\n const location = useLocation()\n const { allowTokenRefetch } = useApolloProvider()\n\n if (\n // @ts-ignore\n [routes.REGISTER_VERIFICATION, routes.REGISTER].includes(location.state?.from.pathname) &&\n allowTokenRefetch\n ) {\n return component\n } else {\n const Component = withAuthenticationRequired(component, {\n onRedirecting: () => ,\n returnTo: location.pathname,\n loginOptions: {\n redirect_uri: getRedirectUrl(language),\n fragment: encodeURIComponent(JSON.stringify({ platform, isRelaunchUser: true })),\n },\n })\n\n return \n }\n}\n","import { MarketplaceUser } from 'contexts/UserContext/UserContext'\nimport {\n MarketplaceUserInvitationStatus,\n MarketplaceUserRegistrationStatus,\n MarketplaceUserSource,\n MarketplaceUserFallbackRegistrationStatus,\n} from 'types/graphql-global-types'\n\nimport { routes } from './constants'\n\nconst isAuth0OrLegacy = (user: MarketplaceUser) =>\n [MarketplaceUserSource.AUTH0_REGISTRATION_SCREEN, MarketplaceUserSource.LEGACY_PLATFORM].includes(\n user?.source!\n )\n\nconst isLegacy = (user: MarketplaceUser) =>\n isAuth0OrLegacy(user) &&\n user?.fallbackRegistrationStatus === MarketplaceUserFallbackRegistrationStatus.EMAIL_VERIFIED\n\nconst isInvitation = (user: MarketplaceUser) =>\n user?.source === MarketplaceUserSource.INVITATION &&\n [\n MarketplaceUserInvitationStatus.PASSWORD_SET_AND_EMAIL_VERIFIED,\n MarketplaceUserInvitationStatus.INVITED_VIA_SALESFORCE,\n ].includes(user.invitationStatus!)\n\nconst isOverview = (user: MarketplaceUser) =>\n [user?.invitationStatus, user?.fallbackRegistrationStatus].includes(\n MarketplaceUserInvitationStatus.CONTACT_DETAILS_WITH_TERMS_AND_NDA_SUBMITTED\n )\n\ntype RedirectRulesType = {\n path: string\n conditions: (\n user: MarketplaceUser,\n config: {\n pathname: string\n isClassification: boolean\n isSecretUser: boolean\n }\n ) => boolean\n}\n\nexport const RedirectRules: RedirectRulesType[] = [\n {\n path: routes.OVERVIEW,\n conditions: (user, { pathname, isClassification }) =>\n (user?.registrationStatus === MarketplaceUserRegistrationStatus.EMAIL_VERIFIED &&\n !isClassification &&\n pathname === routes.REGISTER) ||\n (isOverview(user) && pathname === routes.CONTACT_DETAILS),\n },\n {\n path: routes.REGISTER,\n conditions: (user) =>\n user?.source === MarketplaceUserSource.REGISTRATION &&\n [\n MarketplaceUserRegistrationStatus.LOGIN_CREDENTIALS_PROVIDED,\n MarketplaceUserRegistrationStatus.ACCOUNT_DETAILS_SUBMITTED,\n MarketplaceUserRegistrationStatus.CALENDLY_SCHEDULED,\n ].includes(user.registrationStatus!),\n },\n {\n path: routes.REGISTER_VERIFICATION,\n conditions: (user) =>\n (user?.source === MarketplaceUserSource.REGISTRATION &&\n user?.registrationStatus === MarketplaceUserRegistrationStatus.VERIFICATION_EMAIL_REQUESTED) ||\n (isAuth0OrLegacy(user) && user?.fallbackRegistrationStatus === null),\n },\n {\n path: routes.CONTACT_DETAILS,\n conditions: (user) => isInvitation(user) || isLegacy(user),\n },\n {\n path: routes.CLASSIFICATION,\n conditions: (user, { isClassification, pathname }) =>\n isClassification && ![routes.IMPRINT, routes.CONTACT, routes.ACCOUNT].includes(pathname),\n },\n {\n path: routes.LOGOUT,\n conditions: (user, { pathname, isSecretUser }) => isSecretUser && !pathname.includes(routes.CHECKOUT),\n },\n]\n","import React, { PropsWithChildren } from 'react'\n\nimport { useRedirect } from 'hooks/useRedirect'\nimport { Navigate, useLocation } from 'react-router-dom'\n\nexport const RedirectHandler = ({ children }: PropsWithChildren<{}>) => {\n const { pathname, search } = useLocation()\n const redirect = useRedirect()\n\n const from = `${pathname}${search}`\n const to = `${redirect}${search}`\n\n if (redirect && from !== to) {\n return \n }\n\n return <>{children}\n}\n","import { useCallback, useRef } from 'react'\n\nimport { useUser } from 'contexts/UserContext'\nimport { useConfiguration } from 'hooks/useConfiguration'\nimport { useLocation } from 'react-router-dom'\nimport { RedirectRules } from 'utils/redirectRules'\n\nexport const useRedirect = () => {\n const { user: marketplaceUser, isClassification } = useUser()\n const { pathname } = useLocation()\n const { isSecretUser } = useConfiguration()\n const calledOnce = useRef(false)\n\n const getRedirectPath = useCallback(() => {\n if (calledOnce.current || (!marketplaceUser && !isSecretUser)) {\n return\n }\n\n calledOnce.current = true\n\n const rule = RedirectRules.find((rule) =>\n rule.conditions(marketplaceUser ?? null, {\n pathname,\n isClassification,\n isSecretUser,\n })\n )\n\n return rule?.path\n }, [marketplaceUser, pathname, isClassification, isSecretUser])\n\n return getRedirectPath()\n}\n","import React, { useEffect } from 'react'\n\nimport { useAuth0 } from '@auth0/auth0-react'\nimport { Loading } from 'components/Loading'\nimport { usePlatform } from 'hooks/usePlatform'\nimport { useQuery } from 'hooks/useQuery'\nimport { useTranslate } from 'hooks/useTranslate'\nimport { getRedirectUrl } from 'utils/pathUtils'\n\nexport const Login = () => {\n const { loginWithRedirect } = useAuth0()\n const { language } = useTranslate()\n const { platform } = usePlatform()\n const prompt = useQuery().get('prompt')\n\n useEffect(() => {\n loginWithRedirect({\n redirect_uri: getRedirectUrl(language),\n fragment: encodeURIComponent(JSON.stringify({ platform, isRelaunchUser: true })),\n prompt: prompt === 'none' ? prompt : undefined,\n })\n }, [language, loginWithRedirect, platform, prompt])\n\n return \n}\n","import { useEffect } from 'react'\n\nimport { useAuth0 } from '@auth0/auth0-react'\nimport { useTranslate } from 'hooks/useTranslate'\nimport { routes } from 'utils/constants'\n\nexport const Logout = () => {\n const { logout } = useAuth0()\n const { language } = useTranslate()\n\n useEffect(() => {\n logout({ returnTo: `${window.location.origin}${routes.LOGIN}?lng=${language}` })\n }, [language, logout])\n\n return null\n}\n","import React, { lazy, useEffect } from 'react'\n\nimport { useAuth0 } from '@auth0/auth0-react'\nimport AppProviders from 'AppProviders'\nimport { ActionsHandler } from 'components/ActionsHandler'\nimport { Loading } from 'components/Loading'\nimport { PrivateRoute } from 'components/PrivateRoute'\nimport { RedirectHandler } from 'components/RedirectHandler'\nimport { CheckoutProvider } from 'contexts/CheckoutProvider'\nimport { createBrowserHistory } from 'history'\nimport { useLanguageSwitch } from 'hooks/useLanguageSwitch'\nimport { Login } from 'pages/Login'\nimport { Logout } from 'pages/Logout'\nimport { Route, Routes, Navigate } from 'react-router-dom'\nimport { init as utmInit } from 'services/utm'\nimport { createGlobalStyle } from 'styled-components'\nimport { routes, isDevelop } from 'utils/constants'\n// TODO: this is a tech debt. We have to replace these components in order to avoid this import\nimport '@reach/listbox/styles.css'\nimport '@reach/menu-button/styles.css'\nimport '@reach/dialog/styles.css'\nimport { lazyRetry } from 'utils/misc'\n\nexport const history = createBrowserHistory()\n\nconst AuthCallbackPage = lazy(() =>\n lazyRetry('AuthCallback', () => import(/* webpackChunkName: \"AuthCallback\" */ './pages/AuthCallback')).then(\n ({ AuthCallback }) => ({\n default: AuthCallback,\n })\n )\n)\n\nconst DownloadPage = lazy(() =>\n lazyRetry('Download', () => import(/* webpackChunkName: \"ProjectOverview\" */ './pages/Download')).then(\n ({ Download }) => ({\n default: Download,\n })\n )\n)\n\nconst ProjectOverviewPage = lazy(() =>\n lazyRetry(\n 'ProjectOverview',\n () => import(/* webpackChunkName: \"ProjectOverview\" */ './pages/ProjectOverview')\n ).then(({ ProjectOverview }) => ({\n default: ProjectOverview,\n }))\n)\n\nconst BuilderDev = lazy(() =>\n lazyRetry('BuilderDev', () => import(/* webpackChunkName: \"Builder\" */ './pages/Builder')).then(\n ({ BuilderDev }) => ({\n default: BuilderDev,\n })\n )\n)\n\nconst ProductDetail = lazy(() =>\n lazyRetry('ProductDetail', () => import(/* webpackChunkName: \"Builder\" */ './pages/Builder')).then(\n ({ ProductDetail }) => ({\n default: ProductDetail,\n })\n )\n)\n\nconst IdVerificationPage = lazy(() =>\n lazyRetry(\n 'IdVerification',\n () => import(/* webpackChunkName: \"IdVerificationPage\" */ './pages/IdVerification')\n ).then(({ IdVerification }) => ({\n default: IdVerification,\n }))\n)\n\nconst PortfolioPage = lazy(() =>\n lazyRetry('Portfolio', () => import(/* webpackChunkName: \"PortfolioPage\" */ './pages/Portfolio')).then(\n ({ Portfolio }) => ({\n default: Portfolio,\n })\n )\n)\n\nconst ContactPage = lazy(() =>\n lazyRetry('Contact', () => import(/* webpackChunkName: \"ContactPage\" */ './pages/Contact')).then(\n ({ Contact }) => ({\n default: Contact,\n })\n )\n)\n\nconst ImprintPage = lazy(() =>\n lazyRetry('Imprint', () => import(/* webpackChunkName: \"ImprintPage\" */ './pages/Imprint')).then(\n ({ Imprint }) => ({\n default: Imprint,\n })\n )\n)\n\nconst UserAccountPage = lazy(() =>\n lazyRetry('UserAccount', () => import(/* webpackChunkName: \"UserAccount\" */ './pages/UserAccount')).then(\n ({ UserAccount }) => ({\n default: UserAccount,\n })\n )\n)\n\nconst CheckoutPage = lazy(() =>\n lazyRetry('Checkout', () => import(/* webpackChunkName: \"CheckoutPage\" */ './pages/Checkout')).then(\n ({ Checkout }) => ({\n default: Checkout,\n })\n )\n)\n\nconst RegistrationPage = lazy(() =>\n lazyRetry('Registration', () => import(/* webpackChunkName: \"Registration\" */ './pages/Registration')).then(\n ({ Registration }) => ({\n default: Registration,\n })\n )\n)\n\nconst ClassificationPage = lazy(() =>\n lazyRetry(\n 'Classification',\n () => import(/* webpackChunkName: \"Classification\" */ './pages/Classification')\n ).then(({ Classification }) => ({\n default: Classification,\n }))\n)\n\nconst ContactDetailsPage = lazy(() =>\n lazyRetry(\n 'ContactDetails',\n () => import(/* webpackChunkName: \"ContactDetails\" */ './pages/ContactDetails')\n ).then(({ ContactDetails }) => ({\n default: ContactDetails,\n }))\n)\n\nconst InvestorIdentificationPage = lazy(() =>\n lazyRetry(\n 'InvestorIdentification',\n () => import(/* webpackChunkName: \"InvestorIdentification\" */ './pages/InvestorIdentification')\n ).then(({ InvestorIdentification }) => ({\n default: InvestorIdentification,\n }))\n)\n\nconst AuthErrorPage = lazy(() =>\n lazyRetry('AuthError', () => import(/* webpackChunkName: \"AuthError\" */ './pages/AuthError')).then(\n ({ AuthError }) => ({\n default: AuthError,\n })\n )\n)\n\nconst RegisterPage = lazy(() =>\n lazyRetry('Register', () => import(/* webpackChunkName: \"Register\" */ './pages/Register')).then(\n ({ Register }) => ({\n default: Register,\n })\n )\n)\n\nconst SecretLinkPage = lazy(() =>\n lazyRetry('SecretLink', () => import(/* webpackChunkName: \"SecretLink\" */ './pages/SecretLink')).then(\n ({ SecretLink }) => ({\n default: SecretLink,\n })\n )\n)\n\nconst CSSKillReactCreateAppDebugIframe = createGlobalStyle`\n body {\n iframe {\n display: none;\n }\n }`\n\nconst App = () => {\n const { isLoading } = useAuth0()\n\n useEffect(() => {\n utmInit()\n }, [])\n\n useLanguageSwitch()\n\n if (isLoading) {\n return \n }\n\n return (\n \n \n {isDevelop && }\n \n \n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n \n \n \n }\n />\n } />\n }\n />\n }\n />\n } />\n } />\n } />\n } />\n\n } />\n\n } />\n \n \n \n )\n}\n\nexport default App\n","import { useEffect } from 'react'\n\nimport { usePlatform } from './usePlatform'\nimport { useTranslate } from './useTranslate'\n\nexport const useLanguageSwitch = () => {\n const { isUK } = usePlatform()\n const { language, changeLanguage } = useTranslate()\n\n useEffect(() => {\n if (isUK && language !== 'en-GB') {\n changeLanguage('en-GB')\n } else if (!isUK && language === 'en-GB') {\n changeLanguage('en')\n }\n }, [changeLanguage, isUK, language])\n\n return null\n}\n","import React, { Suspense } from 'react'\n\nimport { Auth0Provider, AppState } from '@auth0/auth0-react'\nimport { LoadingPage } from 'components/Loading'\nimport { ScrollToTop } from 'components/ScrollToTop'\nimport ReactDOM from 'react-dom'\nimport TagManager from 'react-gtm-module'\nimport { BrowserRouter as Router } from 'react-router-dom'\nimport { initSentry } from 'services/sentry'\n\nimport App, { history } from './App'\n\ninitSentry(history)\n\nconst onRedirectCallback = (appState?: AppState) => {\n history.replace((appState && appState.returnTo) || window.location.pathname)\n}\n\nReactDOM.render(\n \n \n }>\n \n \n \n \n \n \n ,\n document.getElementById('root')\n)\n\nTagManager.initialize({ gtmId: 'GTM-N33RQ4P' })\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\n","import { addDays, isEqual } from 'date-fns'\n\n/**\n * Calculates Easter in the Gregorian/Western (Catholic and Protestant) calendar\n * based on the algorithm by Oudin (1940) from http://www.tondering.dk/claus/cal/easter.php\n * Found the solution here https://gist.github.com/johndyer/0dffbdd98c2046f41180c051f378f343\n * @param {number} year - The year to calculate the easter date for\n * @returns {Date} Easter date for the year\n */\nexport const getEaster = (year: number): Date => {\n const f = Math.floor\n // Golden Number - 1\n const G = year % 19\n const C = f(year / 100)\n // related to Epact\n const H = (C - f(C / 4) - f((8 * C + 13) / 25) + 19 * G + 15) % 30\n // number of days from 21 March to the Paschal full moon\n const I = H - f(H / 28) * (1 - f(29 / (H + 1)) * f((21 - G) / 11))\n // weekday for the Paschal full moon\n const J = (year + f(year / 4) + I + 2 - C + f(C / 4)) % 7\n // number of days from 21 March to the Sunday on or before the Paschal full moon\n const L = I - J\n const month = 3 + f((L + 40) / 44)\n const day = L + 28 - 31 * f(month / 4)\n\n return new Date(year, month - 1, day)\n}\n\nexport const getHolidays = () => {\n const monthAndDay = ['01.01', '05.01', '10.03', '12.25', '12.26']\n\n const currentYear = new Date().getFullYear()\n const easter = getEaster(currentYear)\n const goodFriday = addDays(easter, -2)\n const easterMonday = addDays(easter, 1)\n /*\n * Pentecost is the Sunday after the full moon of Easter\n * https://en.wikipedia.org/wiki/Pentecost (in German)\n * WhitMonday is the Monday after Pentecost\n */\n const whitMonday = addDays(easter, 50)\n\n const holidays = monthAndDay.map((holiday) => new Date(`${holiday}.${currentYear}`))\n\n return [...holidays, whitMonday, easter, easterMonday, goodFriday]\n}\n\n/**\n * @param {Date|string} date - The date to check\n * @returns {Boolean}\n */\nexport const isGermanHoliday = (date: Date | string): boolean => {\n const holidays = getHolidays()\n return !!holidays.find((holiday) => isEqual(holiday, new Date(date)))\n}\n","import { ComponentType } from 'react'\n\nimport {\n eachDayOfInterval,\n addBusinessDays,\n addDays,\n isWeekend,\n lastDayOfMonth,\n addMonths,\n differenceInBusinessDays,\n format,\n} from 'date-fns'\nimport countries from 'i18n-iso-countries'\n\nimport { isGermanHoliday } from './germanHoliday'\n\nexport const getInvestmentDateOptions = (locale = 'de-DE', limit = 5) => {\n const currentDate = new Date()\n let monthlyStartDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), 15)\n const twoDaysAfter = addDays(currentDate, 2)\n if (twoDaysAfter.getMonth() !== currentDate.getMonth()) {\n monthlyStartDate = addMonths(monthlyStartDate, 1)\n }\n\n if (twoDaysAfter.getDate() > monthlyStartDate.getDate()) {\n monthlyStartDate = lastDayOfMonth(twoDaysAfter)\n }\n\n const results = eachDayOfInterval({\n start: monthlyStartDate,\n end: new Date(`${currentDate.getFullYear() + 1}-12-31T00:00:00Z`),\n }).filter((date, idx) => idx === 0 || [15, lastDayOfMonth(date).getDate()].includes(date.getDate()))\n\n return results\n .map((date) => {\n if (isWeekend(date)) {\n return addBusinessDays(date, -1)\n }\n return date\n })\n .filter((date) => !isGermanHoliday(date) && differenceInBusinessDays(date, currentDate) >= 2)\n .map((date) => ({\n label: date.toLocaleString(locale, {\n weekday: 'long',\n day: 'numeric',\n month: '2-digit',\n year: 'numeric',\n }),\n value: format(date, 'yyyy-MM-dd'),\n }))\n .slice(0, limit)\n}\n\n// conditionally loading the countries\nexport const getCountryNames = (lang: string) => {\n countries.registerLocale(require('i18n-iso-countries/langs/de.json'))\n if (lang === 'en') {\n countries.registerLocale(require('i18n-iso-countries/langs/en.json'))\n }\n\n return countries.getNames(lang === 'en' ? 'en' : 'de')\n}\n\nexport const partition = (arr: T[], predicate: (value: T) => boolean) =>\n arr.reduce(\n (acc, cur) => {\n acc[predicate(cur) ? 0 : 1].push(cur)\n return acc\n },\n [[], []] as T[][]\n )\n\nexport const isCalendlyEvent: (e: MessageEvent) => boolean = (e) =>\n e.data.event && e.data.event.indexOf('calendly') === 0\n\nexport const delay = (ms: number) =>\n new Promise((resolve) => {\n setTimeout(resolve, ms)\n })\n\nexport const safeClearTimeout = (timerId: ReturnType | null) => {\n if (timerId) {\n clearTimeout(timerId)\n }\n}\n\nexport const safeParseInt = (value: string | number): number =>\n typeof value === 'number' ? value : parseInt(value, 10)\n\nexport const pick = (obj: T, keys: string[]) =>\n Object.keys(obj)\n .filter((k) => keys.includes(k))\n .reduce((res, k) => Object.assign(res, { [k]: obj[k as keyof T] }), {} as T)\n\nexport const lazyRetry = (\n componentName: string,\n componentImport: () => Promise<{}>\n): Promise<{ [key: string]: ComponentType }> =>\n new Promise((resolve, reject) => {\n // check if the window has already been refreshed\n const hasRefreshed = JSON.parse(\n window.sessionStorage.getItem(`retry-${componentName}-refreshed`) || 'false'\n )\n // try to import the component\n componentImport()\n .then((component) => {\n window.sessionStorage.setItem(`retry-${componentName}-refreshed`, 'false')\n resolve(component)\n })\n .catch((error: unknown) => {\n if (!hasRefreshed) {\n // not been refreshed yet\n window.sessionStorage.setItem(`retry-${componentName}-refreshed`, 'true')\n return window.location.reload()\n }\n reject(error) // Default error behavior as already tried refresh\n })\n })\n","import { useTranslation } from 'react-i18next'\nimport { CurrencyIsoCode, SalesforceLanguage } from 'types/graphql-global-types'\nimport { currencyLocaleMap, salesforceLanguage as languageConstants, webAppLocales } from 'utils/constants'\n\ntype DateProps = (value: Date, options?: Intl.DateTimeFormatOptions) => string\n\ntype UseTranslateProps = {\n translate: (key: string, options?: any) => T\n language: string\n salesforceLanguage: () => string\n changeLanguage: (lng: string) => void\n formatNumber: (val: number, minimumFractionDigits: number) => string\n formatCurrency: (\n localValue: number,\n currency?: CurrencyIsoCode | null,\n minimumFractionDigits?: number | null\n ) => string\n formatDate: DateProps\n formatDateTime: DateProps\n}\n\nexport const useTranslate = (\n namespace?: string[]\n): UseTranslateProps => {\n const { t, i18n } = useTranslation(namespace)\n\n const currentLanguage = languageConstants[i18n.language as keyof typeof languageConstants]\n ? i18n.language\n : webAppLocales.en\n\n return {\n translate: (key, options?) => t(key, '', options),\n language: currentLanguage,\n salesforceLanguage: () =>\n SalesforceLanguage[\n (languageConstants[\n i18n.language as keyof typeof languageConstants\n ]?.toUpperCase() as keyof typeof SalesforceLanguage) ?? SalesforceLanguage.EN\n ],\n changeLanguage: async (lng) => {\n await i18n.changeLanguage(lng)\n },\n formatNumber: (val: number, minimumFractionDigits: number) =>\n t('intlNumber', {\n val,\n lng: currentLanguage,\n minimumFractionDigits,\n }),\n formatCurrency: (\n localValue: number,\n currency?: CurrencyIsoCode | null,\n minimumFractionDigits?: number | null\n ) =>\n t('intlCurrencyWithUniqueFormatOptions', {\n localValue,\n minimumFractionDigits: minimumFractionDigits || 0,\n maximumFractionDigits: 2,\n formatParams: {\n localValue: {\n ...(currency ? currencyLocaleMap[currency] : currencyLocaleMap.EUR),\n locale: currentLanguage,\n },\n },\n }),\n formatDate: (val: Date, options?: Intl.DateTimeFormatOptions) => t('intlDateTime', { val, ...options }),\n formatDateTime: (val: Date, options?: Intl.DateTimeFormatOptions) =>\n t('intlDateTime', {\n val,\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n ...options,\n }),\n }\n}\n","import * as Sentry from '@sentry/react'\nimport { Integrations } from '@sentry/tracing'\nimport { History } from 'history'\n\nconst isLocal = process.env.NODE_ENV === 'development'\n\nexport const initSentry = (history: History) => {\n if (isLocal) {\n return\n }\n\n Sentry.init({\n dsn: process.env.REACT_APP_SENTRY_DSN,\n integrations: [\n new Integrations.BrowserTracing({\n routingInstrumentation: Sentry.reactRouterV5Instrumentation(history as any),\n }),\n ],\n environment: process.env.REACT_APP_ENVIRONMENT,\n tracesSampleRate: Number.parseFloat(process.env.REACT_APP_SENTRY_SAMPLE_RATE ?? '1.0'),\n autoSessionTracking: true,\n })\n}\n\nexport function logError(error: Error, errorInfo = null) {\n if (isLocal) {\n console.error(error)\n return\n }\n\n Sentry.withScope((scope) => {\n errorInfo && scope.setExtras(errorInfo)\n Sentry.captureException(error)\n })\n}\n","import React, {\n createContext,\n Dispatch,\n PropsWithChildren,\n SetStateAction,\n useCallback,\n useContext,\n useState,\n} from 'react'\n\nexport enum IdentificationProvider {\n POST_IDENT = 'postIdent',\n POST_IDENT_QES = 'postIdentQes',\n ID_NOW = 'idNow',\n ID_NOW_QES = 'idNowQes',\n ID_NOW_AUTO = 'idNowAuto',\n}\n\nexport type PersonData = {\n firstName: string\n lastName: string\n birthDate: string\n email: string\n}\n\nexport type IdentificationStatus = {\n inProgress: boolean\n isWindowExist: boolean\n clickOutURL?: string\n}\n\ntype InvestorIdentificationContextType = {\n selectedInvestorIndex?: number | undefined\n setSelectedInvestorIndex?: Dispatch>\n provider?: IdentificationProvider\n setProvider?: Dispatch>\n setClickOutWindowRef?: Dispatch>\n clickOutWindowRef?: Window | null\n identificationStatus?: IdentificationStatus\n setIdentificationStatus?: Dispatch>\n reset?: () => void\n}\n\nconst InvestorIdentificationContext = createContext({})\n\nexport const useInvestorIdentificationContext = () => useContext(InvestorIdentificationContext)\n\ntype InvestorIdentificationContextProps = PropsWithChildren<{}>\n\nexport const InvestorIdentificationProvider = ({ children }: InvestorIdentificationContextProps) => {\n const [selectedInvestorIndex, setSelectedInvestorIndex] = useState()\n const [provider, setProvider] = useState(\n IdentificationProvider.ID_NOW_AUTO\n )\n const [clickOutWindowRef, setClickOutWindowRef] = useState(null)\n\n const [identificationStatus, setIdentificationStatus] = useState({\n inProgress: false,\n isWindowExist: false,\n })\n\n const reset = useCallback(() => {\n setProvider(undefined)\n setSelectedInvestorIndex(undefined)\n setClickOutWindowRef(null)\n }, [setProvider, setSelectedInvestorIndex, setClickOutWindowRef])\n\n return (\n \n {children}\n \n )\n}\n","import { CurrencyIsoCode } from 'types/graphql-global-types'\n\nexport const localeDomains = {\n en: 'https://app.linus-finance.com',\n de: 'https://app.linus-finance.com',\n uk: 'https://app.linus-finance.co.uk',\n}\n\nexport enum Platform {\n UK = 'uk',\n EU = 'eu',\n}\n\nexport const platformMap = {\n 'app.linus-finance.com': Platform.EU,\n 'app.linus-finance.co.uk': Platform.UK,\n}\n\nexport const getPlatform = () =>\n window.location.host === localeDomains.uk ||\n process.env.REACT_APP_PLATFORM === platformMap['app.linus-finance.co.uk']\n ? platformMap['app.linus-finance.co.uk']\n : platformMap['app.linus-finance.com']\n\nexport const grid: Record = {\n 0: [0, 0, 0, 0],\n 1: [20, 65, 65, 73],\n 2: [40, 130, 130, 146],\n 3: [60, 195, 195, 219],\n 4: [80, 260, 260, 292],\n 5: [100, 325, 325, 365],\n 6: [120, 390, 390, 438],\n 7: [140, 455, 455, 511],\n}\n\nexport const gridMix = (sm: number, md: number, lg: number, xl: number) => [\n grid[sm][0],\n grid[md][1],\n grid[lg][2],\n grid[xl][3],\n]\n\nexport const generateUniqueId = (): string => Math.random().toString(36).substring(2, 9)\n\nexport const environment = {\n PRODUCTION: 'production',\n STAGING: 'staging',\n DEVELOPMENT: 'development',\n TEST: 'test',\n}\n\n// TODO: move to env variables - don't expose our infrastructure in code\nexport const domains = {\n [environment.PRODUCTION]: {\n [Platform.EU]: 'https://app.linus-finance.com',\n [Platform.UK]: 'https://app.linus-finance.co.uk',\n },\n [environment.STAGING]: {\n [Platform.EU]: 'https://app-staging.linus-finance.com',\n [Platform.UK]: 'https://app-staging.linus-finance.co.uk',\n },\n [environment.DEVELOPMENT]: {\n [Platform.EU]: 'http://auth.localhost:3000',\n [Platform.UK]: 'http://auth.localhost:3000',\n },\n}\n\nexport const webAppLocales = {\n 'de-DE': 'de',\n 'en-GB': 'en',\n en: 'en',\n}\n\nexport const salesforceLanguage = {\n 'de-DE': 'DE',\n 'en-GB': 'EN',\n en: 'EN',\n}\n\nexport const nonDisclosureFiles = {\n 'de-DE':\n 'https://static-authetification-files.s3.eu-central-1.amazonaws.com/LINUS-Vertraulichkeitsvereinbarung.pdf',\n en: 'https://static-authetification-files.s3.eu-central-1.amazonaws.com/LINUS-non-disclosure-agreement.pdf',\n 'en-GB':\n 'https://static-authetification-files.s3.eu-central-1.amazonaws.com/LINUS-non-disclosure-agreement.pdf',\n}\n\nexport const growthCardImage = 'https://manualupload.s3.eu-central-1.amazonaws.com/GrowthOverview.png'\n\nexport const nestedRoutes = {\n VERIFICATION: 'verification',\n CHECKOUT_INVESTMENT_ACCOUNT: 'investment-account',\n CHECKOUT_INVESTMENT_DETAILS: 'investment-details',\n CHECKOUT_SIGN_CONTRACT: 'sign-contract',\n CHECKOUT_COMPLIANCE: 'compliance',\n CHECKOUT_CLASSIFICATION: 'classification',\n CHECKOUT_IDENTIFICATION: 'identification',\n}\n\nexport const routes = {\n AUTH_CALLBACK: '/auth-callback',\n REGISTRATION: '/registration',\n ACCOUNT: '/account',\n CONTACT: '/contact',\n IMPRINT: '/imprint',\n ID_VERIFICATION: '/id-verification',\n PORTFOLIO: '/portfolio',\n CONTACT_DETAILS: '/contact-details',\n CHECKOUT: '/checkout',\n OVERVIEW: '/overview',\n INVESTOR_IDENTIFICATION: '/investor-identification',\n LOGIN: '/login',\n LOGOUT: '/logout',\n PRODUCT_DETAIL: '/product',\n PRODUCT_DETAIL_DEV: '/dev/*',\n AUTH_ERROR: '/error',\n REGISTER: '/register',\n REGISTER_VERIFICATION: `/register/${nestedRoutes.VERIFICATION}`,\n CLASSIFICATION: '/classification',\n SECRET_LINK: '/secret-link',\n}\n\nexport const isPublicPath = (pathname: string) => {\n const publicRoutes = [\n routes.CONTACT_DETAILS,\n routes.AUTH_ERROR,\n routes.REGISTER,\n routes.REGISTER_VERIFICATION,\n routes.LOGOUT,\n routes.LOGIN,\n ]\n return publicRoutes.includes(pathname)\n}\n\nexport const i18nNumberFormats = {\n 'de-DE': {\n currency: 'EUR',\n symbol: '€',\n },\n en: {\n currency: 'EUR',\n symbol: '€',\n },\n 'en-GB': {\n currency: 'GBP',\n symbol: '£',\n },\n 'en-US': {\n currency: 'USD',\n symbol: '€',\n },\n}\n\nexport const currencyLocaleMap = {\n [CurrencyIsoCode.EUR]: i18nNumberFormats.en,\n [CurrencyIsoCode.GBP]: i18nNumberFormats['en-GB'],\n [CurrencyIsoCode.USD]: i18nNumberFormats['en-US'],\n}\n\nexport const CALENDLY_ONBOARDING_LINK = 'https://calendly.com/linus-finance/onboarding-call-{locale}'\n\nexport const isDevelop = process.env.NODE_ENV === environment.DEVELOPMENT\nexport const isProduction = process.env.NODE_ENV === environment.PRODUCTION\nexport const isTest = process.env.NODE_ENV === environment.TEST\n","import React, { PropsWithChildren } from 'react'\n\nimport { Flex, Spinner, colors } from '@linus-capital/linus-ui'\n\ntype Props = {\n height?: string\n spinnerSize?: string\n}\n\nexport const LoadingPage = ({ children, height = '100vh' }: PropsWithChildren) => (\n \n {children}\n \n)\n\nexport const Loading = ({ height, spinnerSize = 'xxlarge' }: Props) => (\n \n \n \n)\n","import { useMemo } from 'react'\n\nimport { getPlatform, isProduction, Platform } from 'utils/constants'\n\nexport const usePlatform = () => {\n // This will allow dev to change platform locally on the fly\n const devPlatform = new URLSearchParams(window.location.search).get('platform')\n\n const platform = useMemo(\n () => (!isProduction && devPlatform ? devPlatform.toLowerCase() : getPlatform()),\n [devPlatform]\n ) as Platform\n\n return { platform, isUK: platform === Platform.UK, isEU: platform === Platform.EU }\n}\n","import React, { createContext, useContext, useEffect, useRef } from 'react'\n\nimport { useLazyQuery } from '@apollo/client'\nimport { Loading } from 'components/Loading'\nimport { useConfiguration } from 'hooks/useConfiguration'\nimport { usePlatform } from 'hooks/usePlatform'\nimport { useNavigate } from 'react-router-dom'\nimport { logError } from 'services/sentry'\nimport { SalesforceUserStatus } from 'types/graphql-global-types'\nimport { domains, isDevelop, isTest, Platform, routes } from 'utils/constants'\n\nimport { MarketplaceUserEU_marketplaceUser } from './gql-query-types/MarketplaceUserEU'\nimport { MarketplaceUserUK_marketplaceUser } from './gql-query-types/MarketplaceUserUK'\nimport { GET_USER } from './gqls'\n\nexport type MarketplaceUser = (MarketplaceUserEU_marketplaceUser & MarketplaceUserUK_marketplaceUser) | null\n\ntype MarketplaceUserData = {\n marketplaceUser: MarketplaceUser\n}\n\ntype UserContextType = {\n user?: MarketplaceUser | null\n refetch: () => void\n isClassification: boolean\n shouldRefetchOpenAllocations: boolean\n setShouldRefetchOpenAllocations: (value: boolean) => void\n}\n\nconst UserContext = createContext({\n user: null,\n refetch: () => {},\n isClassification: false,\n shouldRefetchOpenAllocations: false,\n setShouldRefetchOpenAllocations: () => {},\n})\n\nexport const UserProvider = ({ children }: { children: React.ReactNode }) => {\n const { isMarketUserUnavailable } = useConfiguration()\n const { platform, isUK } = usePlatform()\n const isNotTestOrDevelopment = !(isTest || isDevelop)\n const navigate = useNavigate()\n const shouldRefetchOpenAllocations = useRef(false)\n\n const [fetchUser, { loading, data, refetch }] = useLazyQuery(GET_USER[platform], {\n onCompleted: ({ marketplaceUser }) => {\n const userPlatform = marketplaceUser?.platform?.toLowerCase()\n if (isNotTestOrDevelopment && userPlatform !== platform) {\n window.location.replace(\n `${domains[process.env.REACT_APP_ENVIRONMENT!][userPlatform as Platform]}${\n routes.LOGIN\n }?prompt=none`\n )\n }\n },\n onError: (error) => {\n logError(error)\n navigate(routes.LOGOUT)\n },\n })\n\n const setShouldRefetchOpenAllocations = (value: boolean) => {\n shouldRefetchOpenAllocations.current = value\n }\n\n useEffect(() => {\n if (isMarketUserUnavailable) {\n return\n }\n ;(async () => {\n await fetchUser()\n })()\n }, [fetchUser, isMarketUserUnavailable])\n\n const isClassification =\n isUK &&\n (!data?.marketplaceUser?.ukClassificationSubmitted ||\n data?.marketplaceUser?.status === SalesforceUserStatus.JOIN)\n\n if (loading) {\n return \n }\n\n return (\n \n {children}\n \n )\n}\n\nexport const useUser = () => useContext(UserContext)\n","type ParamProps = {\n utm_source?: string\n utm_medium?: string\n utm_term?: string\n utm_content?: string\n utm_campaign?: string\n}\n\nexport function buildQueryString(params: ParamProps) {\n return Object.keys(params)\n .reduce((cur: string, acc: string) => {\n const value = params[acc as keyof ParamProps]\n return value ? `${cur}&${acc}=${encodeURIComponent(value)}` : ''\n }, '')\n .slice(1)\n}\n\nexport const findLocalItems = (query: RegExp) => {\n for (const i in window.localStorage) {\n // eslint-disable-next-line no-prototype-builtins\n if (window.localStorage.hasOwnProperty(i) && i.match(query)) {\n return i\n }\n }\n return null\n}\n\nexport const parseJSONString = (value: string): T | null => {\n try {\n return JSON.parse(value) as T\n } catch {\n return null\n }\n}\n"],"sourceRoot":""}