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MAiDMC,EAAsC,wY,kCCjD5C,MAyDMC,EAAyC,gN,+EChB/C,MAAMC,EAAmB,CAC9BC,EACAnvC,EACAovC,EACAC,EACAC,KAEA,MAAM3oC,GAAW,UAEjB,IAAArO,YAAU,K,MAER,IAAK82C,EAAoB,OAIzB,MAAMG,EAAS,IAAI,IAAJ,CAA2C,QAAhC,0BAAgC,EAAI,GAAI,CAChEC,QAAkD,OAAzC,YAA6C,KAGlDt1B,EAAUq1B,EAAOE,UAAUN,GAUjC,OAPAj1B,EAAQw1B,KAAK1vC,GAAW,KAClBsvC,GACFA,OAKG,KAELp1B,EAAQy1B,OAAO3vC,GAEfuvC,EAAOK,YAAYT,GACnBE,IACAC,OAED,CAACH,EAAanvC,EAAWovC,EAAoBzoC,M,0CC9ElD,MAAMkpC,EAAY,CAChBC,GAAI,CACFC,I,WAIJ,SAAS,MAAkBl1C,KAAK,CAC9Bg1C,UAAAA,EACAG,IAAK,KACLC,UAAW,MACXC,cAAe,CACbC,aAAa,KAIPp3C,OACRq3C,eAAkBC,GAClB,oBAAoBA,EAAW,SAAW","sources":["webpack://leadsbridge/./src/aws-exports.js","webpack://leadsbridge/./src/components/Alert/AlertProgressBar/AlertProgressBar.tsx","webpack://leadsbridge/./src/components/Alert/styled.tsx","webpack://leadsbridge/./src/components/Basic/FakeInput/styled.tsx","webpack://leadsbridge/./src/components/Basic/Loader/styled.tsx","webpack://leadsbridge/./src/components/Basic/Skeleton/elementSizes.ts","webpack://leadsbridge/./src/components/Basic/StateIcon/styled.tsx","webpack://leadsbridge/./src/components/Basic/Typography.tsx","webpack://leadsbridge/./src/components/Basic/Variables.ts","webpack://leadsbridge/./src/components/ButtonProvider/Facebook/ButtonErrorUi.tsx","webpack://leadsbridge/./src/components/ButtonProvider/Facebook/FacebookButtonCustom.tsx","webpack://leadsbridge/./src/components/ButtonProvider/Facebook/FacebookButtonNative.tsx","webpack://leadsbridge/./src/components/ButtonProvider/Facebook/facebookApiService.ts","webpack://leadsbridge/./src/components/ButtonProvider/Google/GoogleButtonCustom.tsx","webpack://leadsbridge/./src/components/ButtonProvider/Google/googleApiService.ts","webpack://leadsbridge/./src/components/ButtonProvider/Google/GoogleButtonNative.tsx","webpack://leadsbridge/./src/components/ButtonProvider/Google/GooglePicker.tsx","webpack://leadsbridge/./src/components/Confetti.tsx","webpack://leadsbridge/./src/components/ConnectedPopupWindow/DestinationContentSample.tsx","webpack://leadsbridge/./src/components/ErrorBoundary/ErrorPage.tsx","webpack://leadsbridge/./src/components/FastAppSurvey/formikUtils.ts","webpack://leadsbridge/./src/components/FastAppSurvey/Form.tsx","webpack://leadsbridge/./src/components/Form/InputDomain/styled.tsx","webpack://leadsbridge/./src/components/Form/InputSmartSelect/ComponentOverrides.tsx","webpack://leadsbridge/./src/components/Form/InputSmartSelect/Creatable.tsx","webpack://leadsbridge/./src/components/Form/InputSmartSelect/Tooltip.tsx","webpack://leadsbridge/./src/components/Form/InputToggle/styled.tsx","webpack://leadsbridge/./src/components/Form/MultiCreatableCustom/ComponentOverrides.tsx","webpack://leadsbridge/./src/components/Form/MultiCreatableCustom/utils.tsx","webpack://leadsbridge/./src/components/Formik/FormikInputCheckbox.tsx","webpack://leadsbridge/./src/components/Formik/FormikInputField.tsx","webpack://leadsbridge/./src/components/Formik/FormikInputSelect.tsx","webpack://leadsbridge/./src/components/IncomingDataTable/styled.tsx","webpack://leadsbridge/./src/components/Panel/ProgressBar.tsx","webpack://leadsbridge/./src/components/StepBar/StepBarItem.tsx","webpack://leadsbridge/./src/dataTracking/index.ts","webpack://leadsbridge/./src/enums/AppStoreStatus.tsx","webpack://leadsbridge/./src/enums/bridgeByUrl.ts","webpack://leadsbridge/./src/enums/persistentCookiesKeys.ts","webpack://leadsbridge/./src/enums/persistentLocalStorageKeys.ts","webpack://leadsbridge/./src/components/ToolSquare.tsx","webpack://leadsbridge/./src/features/auth/bridgeByUrl/PartnerConnectButton.tsx","webpack://leadsbridge/./src/features/auth/bridgeByUrl/SignInBridgeByUrl.tsx","webpack://leadsbridge/./src/features/auth/slots/SignIn.tsx","webpack://leadsbridge/./src/features/auth/components/PasswordHelper.tsx","webpack://leadsbridge/./src/features/auth/slots/LostPassword.tsx","webpack://leadsbridge/./src/features/auth/slots/ChangePassword/formConfig.ts","webpack://leadsbridge/./src/features/auth/slots/ChangePassword/CustomInputError.tsx","webpack://leadsbridge/./src/features/auth/slots/ChangePassword/ChangePassword.tsx","webpack://leadsbridge/./src/features/auth/AuthRouter.tsx","webpack://leadsbridge/./src/features/auth/components/AuthContainer.styled.tsx","webpack://leadsbridge/./src/features/auth/components/SignInForm.styled.tsx","webpack://leadsbridge/./src/components/Basic/BrandLogo.tsx","webpack://leadsbridge/./src/features/auth/slots/ClaimLogin.tsx","webpack://leadsbridge/./src/features/auth/components/ResourceItem.tsx","webpack://leadsbridge/./src/features/auth/components/AuthContainer.tsx","webpack://leadsbridge/./src/features/auth/functions/SignInUtilities.tsx","webpack://leadsbridge/./src/features/auth/functions/parseAuthUser.ts","webpack://leadsbridge/./src/features/auth/functions/useFirstLandRedirect.ts","webpack://leadsbridge/./src/features/auth/slots/Saml.tsx","webpack://leadsbridge/./src/features/nbee/AddFilterButton/AddFilterButtonModal/FilterRuleRow.tsx","webpack://leadsbridge/./src/features/nbee/BridgeChooserForm/validation.ts","webpack://leadsbridge/./src/features/nbee/EmailReceipt/FeatureNotAvailable.tsx","webpack://leadsbridge/./src/features/nbee/EmailReceipt/FieldRecipients.tsx","webpack://leadsbridge/./src/features/nbee/EmailReceipt/FieldSubject.tsx","webpack://leadsbridge/./src/features/nbee/EmailReceipt/FieldToggleStatus.tsx","webpack://leadsbridge/./src/features/nbee/EmailReceipt/validation.ts","webpack://leadsbridge/./src/features/nbee/EmailReceipt/useEmailReceiptValidation.tsx","webpack://leadsbridge/./src/features/nbee/FieldsMappingForm/popupContent/PopupContentMappingError.tsx","webpack://leadsbridge/./src/features/nbee/FieldsMappingForm/ButtonTestBeforeProceeding.tsx","webpack://leadsbridge/./src/features/nbee/FieldsMappingForm/FieldMappingRow/FieldMappingRow.tsx","webpack://leadsbridge/./src/features/nbee/FieldsMappingForm/HeaderSearch/styled.tsx","webpack://leadsbridge/./src/features/nbee/FieldsMappingForm/HeaderSearch/FieldsProgressBar.tsx","webpack://leadsbridge/./src/features/nbee/FieldsMappingForm/HeaderSearch/HeaderSearchComponent.tsx","webpack://leadsbridge/./src/features/nbee/FieldsMappingForm/SendTestLeadSubForm/ButtonSendTestLead.tsx","webpack://leadsbridge/./src/features/nbee/FieldsMappingForm/initialStateUtils.ts","webpack://leadsbridge/./src/features/nbee/FieldsMappingForm/popupContent/PopupContentNoSelectOptions.tsx","webpack://leadsbridge/./src/features/nbee/FieldsMappingForm/sortingUtils.ts","webpack://leadsbridge/./src/features/nbee/FieldsMappingForm/validation.ts","webpack://leadsbridge/./src/features/nbee/IncomingDataContent/IncomingDataFinalStep/styled.tsx","webpack://leadsbridge/./src/features/nbee/IncomingDataContent/IncomingDataInitialStep/styled.tsx","webpack://leadsbridge/./src/features/nbee/IncomingDataContent/IncomingDataTableStep/styled.tsx","webpack://leadsbridge/./src/features/nbee/IncomingDataContent/LoadingStep/styled.tsx","webpack://leadsbridge/./src/features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/SubmitButton.tsx","webpack://leadsbridge/./src/features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/CredentialFieldDomain.tsx","webpack://leadsbridge/./src/features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/CredentialFieldInput.tsx","webpack://leadsbridge/./src/features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/CredentialFieldSmartCreatableSelect.tsx","webpack://leadsbridge/./src/features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/CredentialFieldSmartSelect.tsx","webpack://leadsbridge/./src/features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/CredentialFieldToggle.tsx","webpack://leadsbridge/./src/features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/CredentialFieldVerifyEmail.tsx","webpack://leadsbridge/./src/features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/fields/IntegrationNameInput.tsx","webpack://leadsbridge/./src/features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/useRefetchCredentialSchema.ts","webpack://leadsbridge/./src/features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/validation.ts","webpack://leadsbridge/./src/features/nbee/IntegrationCredentialsContent/InfoSection.tsx","webpack://leadsbridge/./src/features/nbee/ModalTrialInfo/styled.tsx","webpack://leadsbridge/./src/features/nbee/SimpleBridgeBuilderForm/appsCompatibility/WaitingListInfoMessage.tsx","webpack://leadsbridge/./src/features/nbee/SimpleBridgeBuilderForm/appsCompatibility/utils.tsx","webpack://leadsbridge/./src/features/nbee/SimpleBridgeBuilderForm/appsCompatibility/useHandleAppsCompatibility.ts","webpack://leadsbridge/./src/features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/SettingFieldInput.tsx","webpack://leadsbridge/./src/features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/SettingFieldSmartCreatableSelect.tsx","webpack://leadsbridge/./src/features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/SmartSelectAddOptionApiModal.tsx","webpack://leadsbridge/./src/features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/SettingFieldSmartSelect.tsx","webpack://leadsbridge/./src/features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/SettingFieldToggle.tsx","webpack://leadsbridge/./src/features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/touchAllSettings.ts","webpack://leadsbridge/./src/features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/usePopupError.tsx","webpack://leadsbridge/./src/features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/useTriggerSettingsUpdate.ts","webpack://leadsbridge/./src/features/nbee/SimpleBridgeBuilderForm/validation.ts","webpack://leadsbridge/./src/features/nbee/StepCompleted/InfoPage.tsx","webpack://leadsbridge/./src/features/nbee/StepCompleted/PerformanceBoosterBanner.tsx","webpack://leadsbridge/./src/features/nbee/StepCompleted/PerformanceBoosterTip.tsx","webpack://leadsbridge/./src/features/nbee/StepCompleted/handlePerformanceBoosterRedirectUri.ts","webpack://leadsbridge/./src/features/nbee/WelcomeMessageForm/DropDown.tsx","webpack://leadsbridge/./src/features/nbee/WelcomeMessageForm/utils.tsx","webpack://leadsbridge/./src/features/signup/SignupContent/Content.tsx","webpack://leadsbridge/./src/features/signup/SignupForm/formConfig.ts","webpack://leadsbridge/./src/features/signup/SignupForm/signupWithEmailUtils.ts","webpack://leadsbridge/./src/features/signup/SignupForm/useHideParamsFromString.ts","webpack://leadsbridge/./src/graphql/mutations.ts","webpack://leadsbridge/./src/graphql/queries.ts","webpack://leadsbridge/./src/graphql/subscriptions.ts","webpack://leadsbridge/./src/hooks/usePusherChannel.ts","webpack://leadsbridge/./src/i18n.ts"],"sourcesContent":["/* eslint-disable */\n// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.\n\nconst awsmobile = {\n \"aws_project_region\": \"us-west-2\",\n \"aws_cognito_identity_pool_id\": process.env.REACT_APP_IDENTITY_POOL_ID,\n \"aws_cognito_region\": \"us-west-2\",\n \"aws_user_pools_id\": process.env.REACT_APP_USER_POOL_ID,\n \"aws_user_pools_web_client_id\": process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID,\n \"oauth\": {\n \"domain\": process.env.REACT_APP_OAUTH_DOMAIN,\n \"scope\": [\n \"phone\",\n \"email\",\n \"openid\",\n \"profile\",\n \"aws.cognito.signin.user.admin\"\n ],\n \"redirectSignIn\": process.env.REACT_APP_APP_URL,\n \"redirectSignOut\": `${process.env.REACT_APP_APP_URL}/logout`,\n \"responseType\": \"code\"\n },\n \"federationTarget\": \"COGNITO_USER_POOLS\",\n \"aws_appsync_graphqlEndpoint\": process.env.REACT_APP_GRAPHQL_ENDPOINT,\n \"aws_appsync_region\": \"us-west-2\",\n \"aws_appsync_authenticationType\": \"AMAZON_COGNITO_USER_POOLS\"\n};\n\n\nexport default awsmobile;\n","import {\n AlertProgressBarStyled,\n AlertProgressBarWrapper,\n} from '@components/Alert/styled'\nimport React from 'react'\n\ninterface AlertProgressBarProps {\n timer: number\n}\nexport const AlertProgressBar: React.FC<AlertProgressBarProps> = ({\n timer,\n}) => {\n return (\n <AlertProgressBarStyled>\n <AlertProgressBarWrapper progress={timer} />\n </AlertProgressBarStyled>\n )\n}\n","import styled, { css } from 'styled-components'\n\nexport const AlertStyled = styled.div<{ isVisible: boolean }>`\n position: fixed;\n bottom: 0;\n background-color: white;\n width: 100%;\n\n border: 1px solid rgb(29 29 29 / 10%);\n box-shadow: rgb(0 0 0 / 2%) 0px -4px 6px -1px,\n rgb(0 0 0 / 4%) 0px -2px 4px -1px;\n transition: 0.16s all cubic-bezier(0.17, 0.67, 0.83, 0.67);\n z-index: ${({ theme }) => theme.zIndex.overallNotifications};\n transform: translateY(0);\n ${({ isVisible }) =>\n isVisible\n ? css`\n opacity: 1;\n `\n : css`\n opacity: 0;\n transform: translateY(100%);\n `}\n`\n\nexport const AlertProgressBarWrapper = styled.div<{ progress?: number }>`\n width: 100%;\n height: 5px;\n position: absolute;\n left: 0;\n bottom: 0;\n top: 0;\n ${({ progress }) =>\n progress\n ? css`\n background-color: ${({ theme }) =>\n theme.button.primary.backgroundColor};\n animation: linear fillProgressBar;\n animation-duration: ${progress + 'ms'};\n `\n : null}\n`\nexport const AlertProgressBarStyled = styled.div`\n width: 100%;\n height: 5px;\n position: relative;\n background-color: whitesmoke;\n`\n\nexport const AlertWrapper = styled.div`\n display: flex;\n margin: 0 auto;\n flex-direction: column;\n gap: 1rem;\n padding: 1.5rem 2em;\n`\n\nexport const AlertHeader = styled.div``\nexport const AlertButtonClose = styled.div`\n background-color: #fff;\n padding: 0;\n border: 0;\n display: flex;\n align-items: center;\n cursor: pointer;\n font-size: 0.8rem;\n\n svg {\n width: 1.2rem;\n height: 1.2rem;\n margin-right: 0.2rem;\n }\n\n &:hover {\n color: ${({ theme }) => theme.color.link};\n }\n`\n\nexport const AlertBody = styled.div`\n display: flex;\n gap: 10px;\n align-items: flex-start;\n justify-content: space-between;\n`\nexport const AlertBodyContent = styled.div`\n font-weight: 600;\n`\nexport const AlertImageWrapper = styled.div`\n img {\n width: 100px;\n }\n`\n\nexport const AlertFooter = styled.div`\n width: 100%;\n margin-bottom: 1rem;\n display: flex;\n gap: 5px;\n`\n","import styled, { css } from 'styled-components'\nimport { FakeInputProps } from './index'\n\nexport const FakeInputStyled = styled.div<FakeInputProps>`\n padding: 0.5rem 0.7em;\n min-height: 43px;\n width: 100%;\n background: rgba(228, 234, 239, 0.75);\n border-radius: 4px;\n position: relative;\n display: flex;\n align-items: center;\n\n ${({ required }) =>\n required &&\n css`\n &::before {\n content: '*';\n position: absolute;\n top: -6px;\n right: -8px;\n font-size: 2rem;\n color: #137fc0;\n }\n `}\n\n p {\n font-size: 0.9rem;\n color: #404040;\n opacity: 75%;\n margin: 0;\n }\n`\n","import styled, { css } from 'styled-components'\nimport { LoaderProps } from './index'\n\nconst borderColor = ({ $inverted }: LoaderProps) =>\n $inverted ? '#fff' : '#767676'\n\nconst paddingTop = ({ $size }: LoaderProps) => {\n switch ($size) {\n case 'small':\n return '2.5rem'\n case 'large':\n return '4.21428571rem'\n\n case 'x-large':\n return '9rem'\n\n default:\n return '3.07142857rem'\n }\n}\n\nconst getSize = ({ $size }: LoaderProps) => {\n switch ($size) {\n case 'small':\n return '1.71428571rem'\n case 'large':\n return '3.42857143rem'\n case 'x-large':\n return '8rem'\n\n default:\n return '2.28571429rem'\n }\n}\n\nconst margin = ({ $size }: LoaderProps) => {\n switch ($size) {\n case 'small':\n return '-.85714286rem'\n case 'large':\n return '-1.71428571rem'\n case 'x-large':\n return ' -3.6rem'\n\n default:\n return '-1.14285714rem'\n }\n}\n\nconst textSize = ({ $size }: LoaderProps) => {\n switch ($size) {\n case 'small':\n return '.8em'\n case 'large':\n return '.9em'\n case 'x-large':\n return '1.3em'\n default:\n return '1em'\n }\n}\n\nexport const LoaderDimmer = styled.div<LoaderProps>`\n & {\n display: flex;\n background-color: rgba(255, 255, 255, 0.85);\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n text-align: center;\n padding: 1em;\n animation-duration: 0.5s;\n transition: background-color 0.5s linear;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n }\n`\n\nexport const LoaderStyled = styled.div<LoaderProps>`\n & {\n ${({ $active }) =>\n $active\n ? css`\n display: block;\n `\n : css`\n display: none;\n `}\n width: ${getSize};\n height: ${getSize};\n font-size: ${textSize};\n text-align: center;\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: 1000;\n transform: translateX(-50%) translateY(-50%);\n\n ${({ $text }) =>\n $text !== '' &&\n css`\n min-width: ${getSize};\n padding-top: ${paddingTop};\n width: auto !important;\n height: auto !important;\n `}\n\n &::before {\n position: absolute;\n content: '';\n top: 0;\n left: 50%;\n border-radius: 500rem;\n border: 0.2em solid rgba(0, 0, 0, 0.1);\n width: ${getSize};\n height: ${getSize};\n margin: 0 0 0 ${margin};\n }\n\n &::after {\n position: absolute;\n content: '';\n top: 0;\n left: 50%;\n animation: loader-spin 0.6s linear;\n animation-iteration-count: infinite;\n border-radius: 500rem;\n border-color: ${borderColor} transparent transparent;\n border-style: solid;\n border-width: 0.2em;\n box-shadow: 0 0 0 1px transparent;\n width: ${getSize};\n height: ${getSize};\n margin: 0 0 0 ${margin};\n }\n\n @keyframes loader-spin {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n }\n }\n`\n","export type SkeletonAllowedElement =\n | 'button'\n | 'label'\n | 'select'\n | 'smart-select'\n | 'input'\n | 'toggle'\n\nexport type SkeletonSizes = {\n width: string\n height: string\n marginBottom: string\n marginTop: string\n}\n\nexport const skeletonElementSizes: Record<\n SkeletonAllowedElement,\n SkeletonSizes\n> = {\n button: {\n width: '140px',\n height: '40px',\n marginBottom: '0',\n marginTop: '0',\n },\n label: {\n width: '200px',\n height: '22px',\n marginBottom: '5px',\n marginTop: '0',\n },\n select: {\n width: '100%',\n height: '40px',\n marginBottom: '0',\n marginTop: '0',\n },\n 'smart-select': {\n width: '100%',\n height: '43px',\n marginBottom: '0',\n marginTop: '0',\n },\n input: {\n width: '100%',\n height: '43px',\n marginBottom: '1rem',\n marginTop: '8px',\n },\n toggle: {\n width: '120px',\n height: '30px',\n marginBottom: '0',\n marginTop: '0',\n },\n}\n","import styled from 'styled-components'\n\nexport const StateIconStyled = styled.div`\n display: flex;\n width: 100%;\n justify-content: center;\n align-items: center;\n\n span {\n flex: 1;\n border-bottom: 1px dashed #979797;\n }\n`\n","import React, { FC } from 'react'\nimport { createGlobalStyle } from 'styled-components'\nimport { BrandColors } from './Variables'\n\ninterface TypographyProps extends React.HTMLAttributes<HTMLOrSVGElement> {\n tagName?: keyof JSX.IntrinsicElements\n className?: string\n}\nconst GlobalTypographyStyled = createGlobalStyle`\n \n /*H1 Headline*/\n .text-block-1{\n line-height: 1.4;\n font-size: 27px;\n font-weight: bold;\n }\n \n /*H2 Headline*/\n .text-block-2{\n line-height: 1.3;\n font-size: 18px;\n font-weight: bold;\n }\n \n /*H3 Headline*/\n .text-block-3{\n text-transform: uppercase;\n line-height: 1.3;\n font-size: 16px;\n letter-spacing: 1px;\n font-weight: bold;\n }\n\n /*Subtitle*/\n .text-block-4{\n line-height: 1.5;\n font-size: 14px;\n font-weight: bold;\n }\n /* used for subheader */\n .text-block-5{\n line-height: 1.3;\n font-size: 20px;\n }\n .text-block-6{\n line-height: 1;\n font-size: small;\n margin:0;\n letter-spacing: 4px;\n text-transform: uppercase;\n }\n /*Parag*/\n .text-block{\n font-size: 1rem;\n line-height: 1.4;\n font-weight: normal;\n }\n .text-block.bold{\n font-weight: bold;\n }\n .text-block.small{\n font-size: 12px;\n line-height: 1.3;\n }\n [class^='text-block-']{}\n \n .text-secondary{\n color: ${BrandColors.secondary};\n }\n .text-bold{\n font-weight: bold;\n }\n .text-link{\n cursor: pointer;\n &:hover{\n text-decoration: underline;\n }\n }\n .text-black{\n color: ${BrandColors.default};\n }\n`\n\nconst Typography: FC<TypographyProps> = ({ tagName, ...otherProps }) => {\n const Tag = tagName as keyof JSX.IntrinsicElements\n let sizing = ''\n switch (Tag) {\n case 'h1':\n sizing = 'text-block-1'\n break\n case 'h2':\n sizing = 'text-block-2'\n break\n case 'h3':\n sizing = 'text-block-3'\n break\n case 'h4':\n sizing = 'text-block-4'\n break\n case 'h5':\n sizing = 'text-block-5'\n break\n case 'h6':\n sizing = 'text-block-6'\n break\n default:\n sizing = 'text-block'\n break\n }\n return (\n <>\n <GlobalTypographyStyled />\n <Tag {...otherProps} className={`${otherProps.className} ${sizing}`} />\n </>\n )\n}\n\nTypography.defaultProps = {\n tagName: 'p',\n}\nexport default Typography\n","export const BrandColors = {\n default: 'black',\n secondary: '#637381',\n primary: '',\n}\n","import React from 'react'\nimport { Button } from '@components/Basic/Button'\nimport ReactTooltip from 'react-tooltip'\nimport { Link, matchPath } from 'react-router-dom'\nimport { appRoutes, bridgeByUrlPartnersPaths } from '@app/routes'\nimport { BbuRouteParams } from 'LeadsBridgeApp'\nimport { BbuPartnersName } from '@app/enums/bridgeByUrl'\nimport { Trans, useTranslation } from 'react-i18next'\nimport styled from 'styled-components'\nimport { AuthScope } from '@components/ButtonProvider'\n\nconst Message = styled.div`\n color: ${({ theme }) => theme.color.error};\n font-size: 0.9rem;\n`\n\ninterface Props {\n scope: AuthScope\n}\n\nexport const ButtonErrorUi: React.VFC<Props> = ({ scope }) => {\n const { t } = useTranslation()\n const bbuMatchUrl = matchPath<BbuRouteParams>(location.pathname, {\n path: bridgeByUrlPartnersPaths,\n exact: true,\n })\n\n const isFbBbu =\n bbuMatchUrl?.params?.partnerName === BbuPartnersName.facebook ||\n bbuMatchUrl?.params?.partnerName === BbuPartnersName.facebookConversionLeads\n\n const signupBbuRoute = bbuMatchUrl?.params\n ? appRoutes.signupBbu.makeUrl({\n source: bbuMatchUrl.params.source || '',\n destination: bbuMatchUrl.params.destination || '',\n })\n : undefined\n\n // In case of error and we are in signup page, we just hide everything without showing any message.\n // This because we use the signup bbu page as fallback in case user won't disable the ad-blocker\n // and in the bbu signup page we don't want to be redundant\n if (scope === 'SignUp') {\n return null\n }\n\n return (\n <>\n {/* In case of Facebook BBU we give the user the possibility to navigate to signup bbu and register a new account with email (no social) */}\n {isFbBbu && signupBbuRoute ? (\n <div>\n <Button $fluid $variant={'facebook'} disabled>\n {t('auth.signin.ctaWithPartner', { partnerName: 'Facebook' })}\n </Button>\n <Message>\n <Trans\n i18nKey={'auth.fbButtonLoadErrorBbu'}\n components={{\n a: <Link to={signupBbuRoute} />,\n }}\n />\n </Message>\n </div>\n ) : (\n <div data-tip data-for={'fb-sdk-error'}>\n <Button $fluid $variant={'facebook'} disabled>\n {t('auth.signin.ctaWithPartner', { partnerName: 'Facebook' })}\n </Button>\n <ReactTooltip id={'fb-sdk-error'}>\n {t('auth.fbButtonLoadError')}\n </ReactTooltip>\n </div>\n )}\n </>\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { Button } from '@components/Basic/Button'\nimport { AuthScope } from '@components/ButtonProvider'\nimport { useTranslation } from 'react-i18next'\nimport { initFbScriptOrCreate } from '@components/ButtonProvider/Facebook/facebookApiService'\n\ninterface FacebookButtonCustomProps {\n scope: AuthScope\n onTokenRetrived: (token: string) => void\n onSdkLoadError: () => void\n}\n\nexport const FacebookButtonCustom: React.FC<FacebookButtonCustomProps> = ({\n scope,\n onTokenRetrived,\n onSdkLoadError,\n}) => {\n const { t } = useTranslation()\n const [doingLoginFb, setDoingLoginFb] = useState<boolean>(true)\n\n const handleFbSignin = () => {\n const fb = window.FB\n if (!fb) {\n console.error('No FB sdk found')\n return null\n }\n setDoingLoginFb(true)\n fb.login(\n (response) => {\n const accessToken = response.authResponse?.accessToken\n console.log(accessToken)\n if (accessToken) {\n onTokenRetrived(accessToken)\n }\n setDoingLoginFb(false)\n },\n {\n // the authorized scopes\n scope: 'public_profile,email',\n }\n )\n }\n\n useEffect(() => {\n initFbScriptOrCreate()\n .then(() => setDoingLoginFb(false))\n .catch((error) => {\n console.log(error)\n onSdkLoadError()\n })\n }, [])\n\n const buttonLabel: Record<AuthScope, string> = {\n SignUp: t('auth.signup.ctaWithPartner', { partnerName: 'Facebook' }),\n SignIn: t('auth.signin.ctaWithPartner', { partnerName: 'Facebook' }),\n NoScope: t('auth.signin.ctaWithPartner', { partnerName: 'Facebook' }),\n }\n\n return (\n <Button\n $fluid\n $variant={'facebook'}\n onClick={handleFbSignin}\n $loading={doingLoginFb}\n disabled={doingLoginFb}\n >\n {buttonLabel[scope]}\n </Button>\n )\n}\n","import React, { useEffect } from 'react'\nimport { AuthScope } from '@components/ButtonProvider'\nimport {\n createFbOnLoginFunction,\n initFbScriptOrCreate,\n} from '@components/ButtonProvider/Facebook/facebookApiService'\nimport styled from 'styled-components'\n\ninterface FacebookButtonLegacyProps {\n dataSize?: 'large' | 'small'\n dataWidth?: number\n useContinueAs?: boolean\n onTokenRetrived: (token: string) => void\n scope: AuthScope\n onSdkLoadError: () => void\n customFbAppScopes?: string\n}\n\nconst FacebookNativeButtonWrapper = styled.div`\n min-height: 40px;\n position: relative;\n\n &:before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 30px;\n height: 30px;\n margin-top: -15px;\n margin-left: -15px;\n border-radius: 50%;\n border: 4px solid #1976f2;\n border-top-color: #ccc;\n animation: fb-loading-spinner 1s ease-in-out infinite;\n }\n @keyframes fb-loading-spinner {\n to {\n transform: rotate(360deg);\n }\n }\n`\n\nexport const FacebookButtonNative: React.FC<FacebookButtonLegacyProps> = ({\n dataSize = 'large',\n dataWidth,\n useContinueAs = true,\n onTokenRetrived,\n scope,\n onSdkLoadError,\n customFbAppScopes,\n}) => {\n useEffect(() => {\n initFbScriptOrCreate()\n .then(() => {\n createFbOnLoginFunction('onFbLogin', onTokenRetrived)\n })\n .catch((error) => {\n console.log(error)\n onSdkLoadError()\n })\n }, [])\n\n return (\n <FacebookNativeButtonWrapper>\n <div\n className='fb-login-button'\n data-scope={customFbAppScopes || 'public_profile,email'}\n data-width={dataWidth}\n data-size={dataSize}\n data-button-type={scope === 'NoScope' ? 'continue_with' : 'login_with'}\n data-layout='default'\n data-auto-logout-link='false'\n data-use-continue-as={String(useContinueAs)}\n data-onlogin='onFbLogin'\n />\n </FacebookNativeButtonWrapper>\n )\n}\n","// inject FB sdk script in the page and resolve the promise once done\nimport { sleep } from '@app/utils/helpers'\n\nexport const createScript = () =>\n new Promise((resolve, reject) => {\n const script = document.createElement('script')\n script.src = 'https://connect.facebook.net/en_US/sdk.js'\n script.async = true\n script.onload = () => {\n resolve(null)\n }\n script.onerror = () => {\n reject(\n new Error(\n 'Call to https://connect.facebook.net/en_US/sdk.js has been blocked'\n )\n )\n }\n document.body.appendChild(script)\n })\n\n// init FB with our appID and default settings\n// if FB SDK is not found promise will be rejected\nexport const facebookInit: () => Promise<null> = () =>\n new Promise((resolve, reject) => {\n const fb = window.FB\n if (!fb || !fb.login) {\n // we check the existance of fb.login since ad-blockers allow FB init but remove some methods like `login`\n reject(new Error('Failed FB SDK init'))\n return\n }\n fb.init({\n appId: '939660826071336',\n cookie: true,\n xfbml: true,\n version: 'v2.11',\n })\n resolve(null)\n })\n\n// create a function in global window object to be called by facebook as callback\n// once button is rendered\nexport const createFbOnLoginFunction = (\n fnName: string,\n onTokenRetrived: (token: string) => void\n) => {\n const w = window as any\n w[fnName] = () => {\n FB.getLoginStatus((response) => {\n if (response?.authResponse?.accessToken) {\n onTokenRetrived(response.authResponse.accessToken)\n }\n })\n }\n}\n\n// This is to be used to check if facebook script exists, if so it will be initializated\nexport const initFbScriptOrCreate = async () => {\n const fb = window.FB\n if (!fb) {\n await createScript()\n }\n await sleep(300)\n return await facebookInit()\n}\n","import React, { useEffect, useState } from 'react'\nimport { Button } from '@components/Basic/Button'\nimport { AuthScope } from '@components/ButtonProvider'\nimport { useTranslation } from 'react-i18next'\n\n// ATTENTION!\n// This google button uses Google legacy SDK, which is going to be deprecated by Q1 2023: DO NOT USE!\n// https://leadsbridge.atlassian.net/wiki/spaces/DV/pages/1228242962/Q4+2022+-+Migrate+the+frontend+Signup+flow+to+Google+Identity+Services\n\ninterface GoogleButtonProps {\n onTokenRetrived: (token: string) => void\n scope: AuthScope\n onGoogleLegacySdkInitError: () => void\n onGoogleLegacySdkInitSuccess: () => void\n}\n\nexport const GoogleButtonCustom: React.VFC<GoogleButtonProps> = ({\n onTokenRetrived,\n scope,\n onGoogleLegacySdkInitError,\n onGoogleLegacySdkInitSuccess,\n}) => {\n const { t } = useTranslation()\n const [isLoading, setIsLoading] = useState(false)\n const [isDisabled, setIsDisabled] = useState(true)\n\n const injectGoogleScript = () => {\n if (window.gapi) {\n // google script exists\n setIsDisabled(false)\n return\n }\n\n const script = document.createElement('script')\n script.src = 'https://apis.google.com/js/platform.js'\n script.async = true\n script.onload = () => {\n window.gapi?.load('auth2', () => {\n gapi.auth2\n .init({\n client_id: process.env.REACT_GOOGLE_API_CLIENT_ID,\n scope: 'profile email openid',\n })\n .then(\n () => {\n setIsDisabled(false)\n onGoogleLegacySdkInitSuccess()\n },\n () => {\n onGoogleLegacySdkInitError()\n }\n )\n })\n }\n script.id = 'google-legacy-script'\n document.body.appendChild(script)\n }\n\n const onAuthRequest = () => {\n setIsLoading(true)\n const googleauthInstance = gapi.auth2.getAuthInstance()\n googleauthInstance\n .signIn()\n .then((googleUser) => {\n // eslint-disable-next-line camelcase\n const { id_token } = googleUser.getAuthResponse()\n // const profile = googleUser.getBasicProfile()\n onTokenRetrived(id_token)\n setIsLoading(false)\n })\n .catch(() => {\n setIsLoading(false)\n })\n }\n\n useEffect(() => {\n injectGoogleScript()\n\n // cleanup function to remove script on component unmount\n // return () => {\n // const googleScript = document.getElementById('google-legacy-script')\n // if (googleScript) {\n // googleScript.remove()\n // }\n // }\n }, [])\n\n const buttonLabel: Record<AuthScope, string> = {\n SignUp: t('auth.signup.ctaWithPartner', { partnerName: 'Google' }),\n SignIn: t('auth.signin.ctaWithPartner', { partnerName: 'Google' }),\n NoScope: t('auth.signin.ctaWithPartner', { partnerName: 'Google' }),\n }\n\n return (\n <Button\n $variant={'google'}\n onClick={onAuthRequest}\n $loading={isLoading}\n disabled={isDisabled}\n $fluid\n >\n {buttonLabel[scope]}\n </Button>\n )\n}\n","export const googleElementScriptId = 'google-gsi'\n\nexport const createScript = () => {\n return new Promise((resolve, reject) => {\n // load the Google SDK\n const script = document.createElement('script')\n script.src = 'https://accounts.google.com/gsi/client'\n script.async = true\n script.id = googleElementScriptId\n script.onload = () => {\n const google = window.google\n if (!google) {\n reject(new Error('google sdk failed to load'))\n return\n }\n resolve(null)\n }\n document.body.appendChild(script)\n })\n}\n\nexport const initGoogleSignin = (\n buttonId: string,\n scope: 'signup_with' | 'signin_with' | 'continue_with'\n): Promise<CredentialResponse> =>\n new Promise((resolve, reject) => {\n const google = window.google\n if (!google) {\n reject(new Error('google sdk failed to load'))\n return\n }\n google.accounts.id.initialize({\n client_id: process.env.REACT_GOOGLE_API_CLIENT_ID || '',\n callback: (credentialResponse) => {\n // our callback is stored in global window so it can be called any time\n const w = window as any\n if (w.onGoogleTokenRetrived) {\n w.onGoogleTokenRetrived(credentialResponse.credential)\n }\n // in case onGoogleTokenRetrived is not in the global window we can always proceed with an async flow\n // since this function (initGoogleSignin) will always resolve the credential reponse obj\n resolve(credentialResponse)\n },\n })\n\n google.accounts.id.renderButton(document.getElementById(buttonId), {\n type: 'standard',\n theme: 'outline',\n size: 'large',\n text: scope,\n locale: 'en-US',\n width: scope === 'signin_with' ? '350px' : '380px',\n })\n })\n\nexport const checkGoogleScriptOrCreate = async () => {\n const google = window.google\n\n if (!google) {\n await createScript()\n }\n\n return Promise.resolve(null)\n}\n","import React, { useEffect, useState } from 'react'\nimport {\n checkGoogleScriptOrCreate,\n initGoogleSignin,\n} from '@components/ButtonProvider/Google/googleApiService'\nimport { AuthScope } from '@components/ButtonProvider'\nimport styled from 'styled-components'\n\ninterface GoogleButtonProps {\n onTokenRetrived: (token: string) => void\n scope: AuthScope\n}\n\n// dictionary\nconst scopeToGoogleContext: Record<\n AuthScope,\n 'signup_with' | 'signin_with' | 'continue_with'\n> = {\n SignIn: 'signin_with',\n SignUp: 'signup_with',\n NoScope: 'continue_with',\n}\n\nconst GoogleButtonStyled = styled.div`\n height: 44px;\n text-align: center;\n justify-content: center;\n display: flex;\n`\n// This Google button uses the newer version of Google SDK, it is the one that should be used.\nexport const GoogleButtonNative: React.FC<GoogleButtonProps> = ({\n onTokenRetrived,\n scope,\n}) => {\n const initGoogleButton = async () => {\n try {\n await checkGoogleScriptOrCreate()\n // we don't need to read response from `initGoogleSignin` since it will call `window.onGoogleTokenRetrived` internally\n // in case we need to handle something when `initGoogleSignin` is resolved we can do it here since it will returns the credentials object\n await initGoogleSignin('googleSigninButton', scopeToGoogleContext[scope])\n } catch (e) {\n console.log('error', e)\n }\n }\n\n useEffect(() => {\n // on mount we need to store our callback function in global window object\n // so google sdk wil be able to re-call it every time without the need of\n // re-init the flow in case of error from our API\n // (eg: user has selected a wrong google account and he needs to retry)\n const w = window as any\n w.onGoogleTokenRetrived = onTokenRetrived\n\n initGoogleButton()\n\n return () => {\n window.google?.accounts.id.cancel()\n // document.getElementById(googleElementScriptId)?.remove()\n }\n }, [])\n\n return (\n <GoogleButtonStyled\n id='googleSigninButton'\n data-size={'small'}\n data-width={280}\n />\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { ApiAppSetting } from 'BackendApi'\nimport {\n AppConfigurationType,\n AppIntegrationSetting,\n BridgeFormValues,\n} from 'Nbee'\nimport { useFormikContext } from 'formik'\nimport { getSettingFieldError } from '@features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/utils'\nimport { trackEvent } from '@app/dataTracking'\nimport { makeNbeeTrackingParams } from '@app/dataTracking/utils'\nimport { Loader } from '@components/Basic/Loader'\nimport { LabelWithDocTooltip } from '@components/Form/LabelWithDocTooltip'\nimport { InputFeedback } from '@components/Basic/InputFeedback'\nimport { FakeInput } from '@components/Basic/FakeInput'\nimport { TinyTextualButton } from \"@components/Basic/TinyTextualButton\";\nimport { useTranslation } from \"react-i18next\";\n\ninterface GooglePickerProps {\n isLoading: boolean\n fieldSchema: ApiAppSetting\n type: AppConfigurationType\n index: number\n apiHasError: boolean\n}\n\nexport const GooglePicker: React.VFC<GooglePickerProps> = ({\n isLoading,\n type,\n fieldSchema,\n index,\n apiHasError,\n}) => {\n const {\n values: formValues,\n setFieldValue,\n setFieldTouched,\n errors,\n touched,\n } = useFormikContext<BridgeFormValues>()\n\n const FILE_ID_PREFIX: string = 'L___'\n const { t } = useTranslation()\n\n const [accessToken, setAccessToken] = useState<string>('')\n const [fileName, setFileName] = useState<string>('')\n const [fileId, setFileId] = useState<string>('')\n const [fieldId, setFieldId] = useState<string>('')\n const [internalError, setInternalError] = useState<string | null>(null)\n\n const settingFieldName = `${type}.settings`\n const isBridgeEnabled = formValues.ui?.isBridgeEnabled\n\n const { isTouched, fieldStatus } = getSettingFieldError({\n type,\n touched,\n errors,\n index,\n })\n\n const updateFormSettings = (newValue: AppIntegrationSetting) => {\n setFieldValue(`${settingFieldName}.${index}`, newValue)\n }\n\n const injectGoogleScript = () => {\n if (window.gapi) {\n return\n }\n\n const script = document.createElement('script')\n script.src = 'https://apis.google.com/js/api.js'\n script.async = true\n script.onload = () => {\n window.gapi.load('client:picker', async () => {\n await gapi.client.load(\n 'https://www.googleapis.com/discovery/v1/apis/drive/v3/rest'\n )\n })\n }\n script.id = 'google-api-script'\n document.body.appendChild(script)\n }\n\n const pickerCallback = async (data: any) => {\n if (data.action === google.picker.Action.CANCEL) {\n // nothing to do\n } else if (data.action === google.picker.Action.PICKED) {\n setFileId(FILE_ID_PREFIX + data.docs[0].id)\n setFileName(data.docs[0].name)\n const newValue: AppIntegrationSetting = {\n key: fieldId,\n value: FILE_ID_PREFIX + data.docs[0].id,\n }\n updateFormSettings(newValue)\n trackEvent({\n eventName: 'IntegrationSettingSelected',\n step: 'Apps',\n feature: 'NBEE',\n params: {\n ...makeNbeeTrackingParams(formValues, type),\n custom: {\n fieldId: fieldId,\n value: newValue.value + '',\n },\n },\n })\n }\n }\n\n const checkAccessToken = async (): Promise<boolean> => {\n try {\n const res = await gapi.client.drive.about.get({\n fields: '*',\n access_token: accessToken,\n })\n return true\n } catch (error) {\n return false\n }\n }\n\n const getMetaFileType = (\n fileType: string\n ): { viewId: google.picker.ViewId; mimeType: string } => {\n switch (fileType) {\n case google.picker.ViewId.FORMS.toString():\n return {\n viewId: google.picker.ViewId.FORMS,\n mimeType: 'application/vnd.google-apps.form',\n }\n default:\n return {\n viewId: google.picker.ViewId.SPREADSHEETS,\n mimeType: 'application/vnd.google-apps.spreadsheet',\n }\n }\n }\n\n const openPicker = async () => {\n const tokenValid: boolean = await checkAccessToken()\n if (!tokenValid) {\n const error: string = t('integrationAuthPopup.integrationUpdate')\n setInternalError(error)\n return\n }\n setInternalError(null)\n const metaFileType: { viewId: google.picker.ViewId; mimeType: string } =\n getMetaFileType(fieldSchema.format || 'spreadsheets')\n const view = new google.picker.DocsView(metaFileType.viewId)\n view.setMimeTypes(metaFileType.mimeType)\n view.setMode(google.picker.DocsViewMode.LIST)\n const picker = new google.picker.PickerBuilder()\n .enableFeature(google.picker.Feature.NAV_HIDDEN)\n .setDeveloperKey(process.env.REACT_GOOGLE_PICKER_API_KEY || '')\n .setAppId(process.env.REACT_GOOGLE_API_APP_ID || '')\n .setOAuthToken(accessToken)\n .addView(view)\n .addView(new google.picker.DocsUploadView())\n .setCallback(pickerCallback)\n .build()\n picker.setVisible(true)\n }\n\n const initData = (\n data: { id: number | string; text: string }[] | undefined\n ) => {\n if (data && data.length > 0) {\n for (const values of data) {\n if (values.id === 'accessToken') {\n setAccessToken(values.text)\n } else {\n setFileName(\n values.text === ''\n ? t('nbee.bridgeBuilder.chooseFileLong')\n : values.text\n )\n setFileId(values.id + '')\n }\n }\n }\n }\n\n useEffect(() => {\n injectGoogleScript()\n initData(fieldSchema.data)\n setFieldId(fieldSchema.id)\n }, [fieldSchema])\n\n const isRefreshingFromApi = Boolean(\n formValues.ui && formValues.ui[type]?.refresh?.includes(fieldSchema.id)\n )\n\n return (\n <div style={{ position: 'relative' }}>\n {/* we show the loader when is hard refreshing from api, but if we received an error we can't show the loading status or user will be stuck */}\n {isRefreshingFromApi && !apiHasError && <Loader $active $dimmer />}\n <LabelWithDocTooltip\n label={fieldSchema.label}\n isRequired={fieldSchema.required}\n tooltip={fieldSchema.tooltip}\n docUrl={fieldSchema.docUrl}\n />\n {isLoading && <Loader $active $dimmer $size='small' />}\n <FakeInput\n text={fileName}\n onClick={!isBridgeEnabled ? openPicker : undefined}\n style={{\n backgroundColor: isBridgeEnabled ? undefined : '#fff',\n border: '1px solid hsl(0, 0%, 80%)',\n cursor: 'pointer',\n }}\n onBlur={() => {\n setFieldTouched(`${settingFieldName}.${index}`, true)\n }}\n />\n {!isBridgeEnabled ? (\n <div style={{ textAlign: 'right' }}>\n <TinyTextualButton\n onClick={openPicker}\n disabled={isLoading}\n >\n {t('nbee.bridgeBuilder.chooseFile')}\n </TinyTextualButton>\n </div>\n ) : null}\n {!isBridgeEnabled ? (\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '1fr auto',\n gap: '1rem',\n }}\n >\n {isTouched && fieldStatus ? (\n <InputFeedback $status={fieldStatus} />\n ) : internalError ? (\n <InputFeedback $status={{ error: internalError }} />\n ) : (\n <div />\n )}\n </div>\n ) : null}\n </div>\n )\n}\n","import React, { useEffect } from 'react'\nimport styled from 'styled-components'\nimport confetti from 'canvas-confetti'\n\nconst ConfettiStyled = styled.div`\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 0;\n pointer-events: none;\n touch-action: none;\n canvas {\n width: 100%;\n height: 100%;\n }\n`\n// DOCS https://www.kirilv.com/canvas-confetti/\n// https://github.com/catdad/canvas-confetti#readme\nconst Confetti: React.FC = () => {\n useEffect(() => {\n const myCanvas = document.createElement('canvas')\n const confettiDiv = document.getElementById('confetti')\n confettiDiv!.appendChild(myCanvas)\n\n const myConfetti = confetti.create(myCanvas, {\n resize: true,\n useWorker: true,\n })\n myConfetti({\n particleCount: 320,\n spread: 140,\n origin: { y: 0.6 },\n // any other options from the global\n // confetti function\n })\n }, [])\n\n return <ConfettiStyled id='confetti'></ConfettiStyled>\n}\n\nexport default Confetti\n","import React, { useEffect, useRef, useState } from 'react'\nimport { Loader } from '@components/Basic/Loader'\nimport { isDebug } from '@app/utils/envUtils'\n\nexport type ConnectedPopupInitialData = Record<string, unknown>\n\ntype PostMessageData = {\n isLbMessage: true\n [key: string]: unknown\n}\n// This component is just an example to be mounte in a specific path\n// connected-popup-destination-url-example\n// to showcase how to use a connected popup window\nexport const DestinationContentSample: React.FC = () => {\n const [initialData, setInitialData] = useState<ConnectedPopupInitialData>()\n const [initialDataError, setInitialDataError] = useState<string | null>()\n const initialDataTimoutId = useRef<NodeJS.Timer | null>(null)\n const initialDataRef = useRef<ConnectedPopupInitialData>()\n\n const messageReceiverFn = function (event: MessageEvent) {\n // it's should always better to check if origin matches to avoid security issues\n // but since this is an embeddable experience we can't do it :(\n // if (event.origin !== window.location.origin) {\n // setInitialDataError('skipping message received from uknown parent')\n // return\n // }\n\n // checking if it's our message, since react (maybe react-dev-tools) posts its own messages\n // and also we can improve this with by checking a sort of nonce key\n if (event.data.isLbMessage) {\n setInitialData(event.data)\n initialDataRef.current = event.data\n }\n }\n\n useEffect(() => {\n // we are expecting to receive data as postMessage from parent window\n window.addEventListener('message', messageReceiverFn)\n return () => window.removeEventListener('message', messageReceiverFn)\n }, [])\n\n useEffect(() => {\n // in case we don't receive initialData from parent window within a given time\n initialDataTimoutId.current = setTimeout(() => {\n if (!initialData && !initialDataRef.current) {\n setInitialDataError(\n 'No data received from LeadsBridge App. Please close this popup window and try to authorize again.'\n )\n }\n }, 3000)\n\n return () => {\n if (initialDataTimoutId.current) {\n clearTimeout(initialDataTimoutId.current)\n }\n }\n }, [])\n\n const sendDataToParentHandler = () => {\n const parentWindow = window.opener\n if (!parentWindow) {\n return\n }\n\n const message: PostMessageData = {\n isLbMessage: true,\n payload: 'something with any shape',\n }\n parentWindow.postMessage(message, '*')\n }\n\n if (isDebug) {\n // we keep this just for internal showcase\n return null\n }\n\n return (\n <div>\n {initialDataError ? (\n <div>\n <div>{initialDataError}</div>\n <button\n onClick={() => {\n window.close()\n }}\n >\n Close\n </button>\n </div>\n ) : initialData ? (\n <div>\n <h2>Data received via post message from parent</h2>\n <pre>{JSON.stringify(initialData)}</pre>\n <button onClick={sendDataToParentHandler}>Send some data back</button>\n </div>\n ) : (\n <Loader $active $dimmer $size={'large'} />\n )}\n </div>\n )\n}\n","import React from 'react'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport styled from 'styled-components'\nimport lbLogo from '@assets/images/logo_lb_extended.svg'\nimport errorImg from '@assets/images/generic-error.svg'\n\nconst Wrapper = styled.div`\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 100vh;\n`\nconst LogoWrapper = styled.div`\n position: absolute;\n top: 2rem;\n right: 2rem;\n`\n\nconst Container = styled.div`\n text-align: center;\n width: 650px;\n\n h1 {\n margin-bottom: 6rem;\n font-size: 1.8rem;\n font-weight: 600;\n }\n`\nconst ButtonWrapper = styled.div`\n display: flex;\n justify-content: space-around;\n margin: 5rem auto 0;\n width: 60%;\n`\n\nexport const ErrorPage: React.FC = () => {\n return (\n <Wrapper>\n <LogoWrapper>\n <img src={lbLogo} width={140} alt={'LeadsBridge'} />\n </LogoWrapper>\n <Container>\n <h1>Oops, an unknown error has occurred..</h1>\n <img src={errorImg} width={250} alt='Error' />\n <ButtonWrapper>\n <a\n target={'_blank'}\n href={`${process.env.REACT_APP_V1_URL}/support`}\n rel='noreferrer'\n >\n <Button $variant={'action'}>Contact support</Button>\n </a>\n <a\n target={'_blank'}\n href={`${process.env.REACT_APP_V1_URL}`}\n rel='noreferrer'\n >\n <Button $variant={'primary'}>Go to dashboard</Button>\n </a>\n </ButtonWrapper>\n </Container>\n </Wrapper>\n )\n}\n","import * as yup from 'yup'\nimport {\n yupPhoneNumber,\n yupRequiredBoolean,\n} from '@app/utils/validators/yupCustomValidators'\n\nexport type FormValues = typeof initialFormValues\n\nexport const initialFormValues = {\n email: '',\n phone: '',\n industry: '',\n privacyConsent: false,\n}\n\nexport const validationSchema = yup.object().shape({\n email: yup.string().email().required(),\n phone: yupPhoneNumber(),\n privacyConsent: yupRequiredBoolean('Consent is mandatory'),\n})\n","import React from 'react'\nimport {\n ButtonWrapperStyled,\n FormStyled,\n} from '@components/FastAppSurvey/styled'\nimport { Button } from '@components/Basic/Button'\nimport { useFastAppSurveyIndustries } from '@app/api/fastAppSurveyIndustries'\nimport { useStoreSurveyData } from '@app/api/storeFastAppSurvey'\nimport { getApiErrorMessage } from '@app/api/config'\nimport { sendToast } from '@app/store/actions/ApplicationConfigurationActions'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { Formik, Form as FormikForm } from 'formik'\nimport { FormikInputField } from '@components/Formik/FormikInputField'\nimport { FormikInputSelect } from '@components/Formik/FormikInputSelect'\nimport { FormikInputCheckbox } from '@components/Formik/FormikInputCheckbox'\nimport {\n initialFormValues,\n validationSchema,\n FormValues,\n} from '@components/FastAppSurvey/formikUtils'\nimport { Auth } from 'aws-amplify'\nimport { parseAuthUser } from '@app/features/auth/functions/parseAuthUser'\nimport { CognitoUserInterface } from '@aws-amplify/ui-components'\nimport { setCurrentUserAction } from '@app/store/actions/UserActions'\nimport AuthService from '@app/services/AuthService'\n\nexport interface FormProps {\n onSubmitSuccess: () => void\n}\n\nexport const Form: React.FC<FormProps> = ({ onSubmitSuccess }) => {\n const storeSurveyData = useStoreSurveyData()\n const getIndustries = useFastAppSurveyIndustries()\n const dispatch = useAppDispatch()\n\n const handleSubmit = ({\n email,\n phone,\n industry,\n privacyConsent,\n }: FormValues) => {\n // Post new data to api\n storeSurveyData.mutate(\n { email, phone, industry, privacyConsent },\n {\n onSuccess: async () => {\n console.log('getting fresh user data since email is changed')\n // We need to call Auth.currentAuthenticatedUser with bypassCache as true. In this way we can update\n // our cognito user (which is by default stored/cached as jwt in localStorage by Cognito).\n // In this way we are sure user will not see its old (randomly generated) email address, but the new one.\n const cognitoResponse: CognitoUserInterface =\n await Auth.currentAuthenticatedUser({\n bypassCache: true,\n })\n // storing fresh data to Redux store, so it will be available globally\n const cognitoUser = parseAuthUser(cognitoResponse)\n dispatch(setCurrentUserAction(cognitoUser))\n\n // as final step, now that the user is properly logged-in with is correct email address,\n // we can store session cooke so it will be recognized in v1\n await AuthService.onLoginAsync(false, dispatch)\n\n console.log('proceed with bbu...')\n onSubmitSuccess()\n },\n onError: (error) => {\n dispatch(\n sendToast({\n title: 'Error',\n message: getApiErrorMessage({ error: error as Error }),\n color: 'negative',\n })\n )\n },\n }\n )\n }\n\n return (\n <FormStyled>\n <p>Please tell us more about yourself</p>\n <Formik\n initialValues={initialFormValues}\n validationSchema={validationSchema}\n onSubmit={(values) => {\n handleSubmit(values)\n }}\n >\n {() => {\n return (\n <FormikForm>\n <FormikInputField\n name='email'\n type='email'\n label='Company Email'\n $fluid\n $hasMargin\n />\n <FormikInputField name='phone' type='tel' label='Phone' $fluid />\n <FormikInputSelect\n $options={getIndustries.data || []}\n $loading={getIndustries.isLoading}\n disabled={Boolean(getIndustries.error)}\n $optionsLabel={\n getIndustries.error\n ? 'Unable to retrieve industries'\n : 'Please select industry'\n }\n name={'industry'}\n $label={'Industry'}\n $hasMargin\n />\n <FormikInputCheckbox name='privacyConsent'>\n I agree with LeadsBridge \n <a\n href='https://leadsbridge.com/privacy/'\n target='_blank'\n rel='noreferrer'\n >\n privacy policy\n </a>\n </FormikInputCheckbox>\n <ButtonWrapperStyled>\n <Button\n $loading={\n storeSurveyData.isLoading || storeSurveyData.isSuccess\n }\n type={'submit'}\n $fluid\n $variant={'primary'}\n >\n Get Started\n </Button>\n </ButtonWrapperStyled>\n </FormikForm>\n )\n }}\n </Formik>\n </FormStyled>\n )\n}\n","import styled from 'styled-components'\n\nconst borderStyle = '1px solid #979797'\n\nexport const InputDomainStyled = styled.div`\n display: grid;\n grid-template-columns: auto 1fr auto;\n border-radius: 4px;\n border: ${borderStyle};\n\n & input {\n padding: 0 0.5rem;\n text-align: left;\n border: none;\n min-width: 1px; /* to make entire input on one line */\n }\n\n & label {\n background: #f4f6f8;\n border-radius: 4px;\n padding: 0.5rem;\n border: ${borderStyle};\n\n &:first-child {\n margin: -1px 0 -1px -1px;\n }\n\n &:nth-child(3) {\n margin: -1px -1px -1px 0;\n }\n }\n`\n","import React from 'react'\nimport {\n OptionProps,\n SingleValueProps,\n ControlProps,\n ValueContainerProps,\n MenuProps,\n MenuListProps,\n components,\n IndicatorsContainerProps,\n MultiValueRemoveProps,\n InputProps,\n} from 'react-select'\nimport {\n AddActionClickButton,\n AddNewSelectOptionButton,\n StyledControlIconWrapper,\n StyledOptionWithExtraLabel,\n StyledOptionImageWrapper,\n StyledOptionSecondaryLabel,\n StyledOptionText,\n StyledOptionValueWrapper,\n StyledOptionWrapper,\n VerifyContentWrapper,\n FloatingLabelStyled,\n DropDownIconsWrapperStyled,\n} from './styled'\nimport { SelectValue, SmartSelectProps } from './index'\nimport { FiAward, FiWatch } from 'react-icons/fi'\nimport { FaCheck, FaChevronDown, FaChevronUp } from 'react-icons/fa'\nimport { MdArrowDropDown, MdArrowDropUp } from 'react-icons/md'\nimport {\n IoIosCloseCircle,\n IoIosCheckmarkCircle,\n IoIosClose,\n} from 'react-icons/io'\nimport { AiOutlinePlus, AiOutlineSearch } from 'react-icons/ai'\nimport { Tooltip } from '@components/Form/InputSmartSelect/Tooltip'\nimport { generateRandomId } from '@app/utils/randomIdGenerator'\nimport { defaultTheme } from '@app/styles/theme/default'\nimport { MultiValueComponent } from 'react-select/dist/declarations/src/animated/MultiValue'\n\nconst leftIcon =\n 'https://leadsbridge.com/wp-content/themes/leadsbridge/img/icon/functions.png'\n\nexport const CustomInput = (props: InputProps<SelectValue>) => {\n const onPaste = (props.selectProps as any)\n .onPaste as SmartSelectProps['onPaste']\n\n return (\n <>\n <components.Input onPaste={onPaste} {...props}>\n {props.children}\n </components.Input>\n </>\n )\n}\n\nexport const CustomMenu = (props: MenuProps<SelectValue>) => {\n return (\n <>\n <components.Menu {...props}>{props.children}</components.Menu>\n </>\n )\n}\n\nexport const MenuList = (props: MenuListProps<SelectValue>) => {\n // dirty solution to make TS happy, but I couldn't find another way to pass props from the main Select component\n const addNewOptionButton = (props.selectProps as any)\n .addNewOptionButton as SmartSelectProps['addNewOptionButton']\n const setNullSelectValue = () =>\n props.setValue(null, 'deselect-option', {} as any)\n\n const addActionClick = (props.selectProps as any)\n .addActionClick as SmartSelectProps['addActionClick']\n\n return (\n <components.MenuList {...props}>\n {addNewOptionButton ? (\n <div>\n <AddNewSelectOptionButton\n onClick={() => {\n addNewOptionButton.onClick()\n setNullSelectValue()\n }}\n >\n <AiOutlinePlus />\n {addNewOptionButton.label}\n </AddNewSelectOptionButton>\n </div>\n ) : addActionClick ? (\n <>\n {props.children}\n <AddNewSelectOptionButton\n data-testid={'new-integration-button'}\n onClick={() => {\n addActionClick.onClick()\n setNullSelectValue()\n }}\n >\n <AiOutlinePlus\n strokeWidth={20}\n style={{\n color: 'hsl(0, 0%, 50%)',\n borderRadius: '50%',\n padding: '.1rem',\n }}\n size='1.3rem'\n />\n <p\n style={{\n color: 'rgba(0,0,0,.87)',\n fontFamily: defaultTheme.font.family,\n }}\n >\n {addActionClick.label}\n </p>\n </AddNewSelectOptionButton>\n </>\n ) : null}\n {addActionClick ? null : props.children}\n </components.MenuList>\n )\n}\n\nexport const CustomOption: React.FC<OptionProps<SelectValue>> = (props) => {\n const hasLogo = props.data.logoUri\n const inputHasValue = !!props.selectProps.inputValue\n const hasExtraLabel =\n (props.selectProps as any).extraLabel &&\n props.data.label !== props.data.value\n\n const isVerified = props.data.isVerified\n const emailValidation = (props.selectProps as any).emailValidation\n\n const isFormulas = (props.selectProps as any).isFormulas\n\n return (\n <components.Option {...props}>\n <StyledOptionWrapper\n hasPadding\n hasHoverEffect\n isFocused={inputHasValue && props.isFocused}\n // isSelected={props.isSelected}\n >\n {props.isFocused && isFormulas ? (\n <StyledOptionImageWrapper>\n <FaCheck size={15} color={'#41a6dc'} />\n </StyledOptionImageWrapper>\n ) : isFormulas ? (\n <StyledOptionImageWrapper></StyledOptionImageWrapper>\n ) : null}\n\n {hasLogo && (\n <div>\n <StyledOptionImageWrapper>\n <img src={props.data.logoUri} key={props.data.value} />\n </StyledOptionImageWrapper>\n </div>\n )}\n <div\n style={{\n width: '100%',\n }}\n >\n <StyledOptionText\n $variant={props.data.secondaryLabel ? 'light' : 'default'}\n emailValidation={emailValidation}\n >\n {hasExtraLabel ? (\n <StyledOptionWithExtraLabel>\n <span>{props.data.label}</span>\n <span>{props.data.value}</span>\n </StyledOptionWithExtraLabel>\n ) : isFormulas ? (\n <h5 style={{ fontSize: '.9rem', color: '#384757' }}>\n {props.data.dropdownPrimaryLabel?.toUpperCase() || ''}\n </h5>\n ) : (\n <>{props.data.label}</>\n )}\n\n {props.data.icon === 'new' ? (\n <FiAward />\n ) : props.data.icon === 'waiting' ? (\n <FiWatch />\n ) : null}\n </StyledOptionText>\n {props.data.secondaryLabel ? (\n <StyledOptionSecondaryLabel>\n {props.data.secondaryLabel}\n </StyledOptionSecondaryLabel>\n ) : null}\n </div>\n {emailValidation && (\n <>\n {isVerified ? (\n <VerifyContentWrapper>\n <IoIosCheckmarkCircle color={'#2fcc71'} size={18} />\n <p>Verified</p>\n </VerifyContentWrapper>\n ) : (\n <VerifyContentWrapper>\n <IoIosCloseCircle color={'#ef4836 '} size={18} />\n <p>Unverified</p>\n </VerifyContentWrapper>\n )}\n </>\n )}\n </StyledOptionWrapper>\n </components.Option>\n )\n}\n\nexport const CustomSingleValue: React.FC<SingleValueProps<SelectValue>> = ({\n children,\n ...props\n}) => {\n const hasLogo = props.data.logoUri\n const elementInnerRef = (props.selectProps as any)\n .selectedSingleValueEl as React.MutableRefObject<HTMLDivElement | null>\n const isVerified = (props.selectProps as any).isVerified\n const emailValidation = (props.selectProps as any).emailValidation\n const floatingLabel = (props.selectProps as any).floatingLabel\n const fieldIsUnavailable = (props.selectProps as any).fieldIsUnavailable\n\n const floatingSingleValueStyles = {\n marginTop: '18px',\n color: fieldIsUnavailable && 'red',\n }\n\n return hasLogo ? (\n <StyledOptionWrapper>\n <StyledOptionImageWrapper>\n <img src={props.data.logoUri} />\n </StyledOptionImageWrapper>\n <StyledOptionValueWrapper ref={elementInnerRef}>\n {props.data.label}\n </StyledOptionValueWrapper>\n </StyledOptionWrapper>\n ) : (\n <components.SingleValue {...props}>\n <div\n style={\n floatingLabel\n ? floatingSingleValueStyles\n : { display: 'flex', justifyContent: 'space-between' }\n }\n >\n <div style={{ flex: 2 }} ref={elementInnerRef}>\n {children}\n </div>\n {emailValidation && (\n <>\n {isVerified ? (\n <VerifyContentWrapper>\n <IoIosCheckmarkCircle color={'#2fcc71'} size={18} />\n <p>Verified</p>\n </VerifyContentWrapper>\n ) : (\n <VerifyContentWrapper>\n <IoIosCloseCircle color={'#ef4836'} size={18} />\n <p>Unverified</p>\n </VerifyContentWrapper>\n )}\n </>\n )}\n </div>\n </components.SingleValue>\n )\n}\n\nexport const CustomControl = ({\n children,\n ...props\n}: ControlProps<SelectValue>) => {\n // dirty solution to make TS happy, but I couldn't find another way to pass props from the main Select component\n const isCreatable = (props.selectProps as any).isCreatable as\n | boolean\n | undefined\n\n const forceNoIcon = (props.selectProps as any).noIcon\n const isFormulas = (props.selectProps as any).isFormulas\n\n const showIcon =\n props.selectProps.isSearchable &&\n !props.hasValue &&\n !isCreatable &&\n !forceNoIcon\n\n const addActionClick = (props.selectProps as any)\n .addActionClick as SmartSelectProps['addActionClick']\n\n const floatingLabel = (props.selectProps as any).floatingLabel\n const defaultLabel = (props.selectProps as any).defaultLabel\n const currentValue = props.getValue()\n const hasValue = currentValue.length > 0 && currentValue[0].value !== ''\n\n return (\n <components.Control {...props}>\n {floatingLabel && (\n <FloatingLabelStyled isFloating={props.isFocused || hasValue}>\n {props.isFocused || hasValue\n ? floatingLabel.toUpperCase()\n : defaultLabel}\n </FloatingLabelStyled>\n )}\n {(showIcon || isFormulas) && (\n <StyledControlIconWrapper>\n {addActionClick ? (\n <AddActionClickButton\n onClick={() => {\n addActionClick.onClick()\n }}\n >\n <AiOutlinePlus\n strokeWidth={20}\n style={{\n backgroundColor: '#F1F3FF',\n borderRadius: '50%',\n padding: '.1rem',\n }}\n size='1.3rem'\n />\n </AddActionClickButton>\n ) : isFormulas ? (\n <img style={{ width: '1rem' }} src={leftIcon} alt='' />\n ) : (\n <AiOutlineSearch size='1rem' />\n )}\n </StyledControlIconWrapper>\n )}\n {isCreatable ? (\n <div\n style={{\n display: 'flex',\n justifyContent: 'space-between',\n width: '100%',\n marginTop: floatingLabel ? '1rem' : 0,\n }}\n >\n {children}\n </div>\n ) : (\n <>{children}</>\n )}\n </components.Control>\n )\n}\n\nexport const CustomValueContainer = ({\n children,\n ...props\n}: ValueContainerProps<SelectValue>) => {\n // show tooltip in two cases:\n // - tooltipInternalLabel is the selected label when text is too long and gets trimmed\n // - tooltipExternalMessage is thte tooltipMessage passed from parent component\n const tooltipId = generateRandomId()\n const tooltipInternalLabel = (props.selectProps as any).tooltipInternalLabel\n const tooltipExternalMessage = (props.selectProps as any)\n .tooltipExternalMessage\n const innerProps =\n tooltipInternalLabel || tooltipExternalMessage\n ? {\n ...props.innerProps,\n 'data-tip': '',\n 'data-for': tooltipId,\n }\n : props.innerProps\n\n return (\n <>\n <components.ValueContainer {...props} innerProps={innerProps}>\n {children}\n </components.ValueContainer>\n {tooltipInternalLabel || tooltipExternalMessage ? (\n <Tooltip\n id={tooltipId}\n label={tooltipInternalLabel}\n tooltipMessage={tooltipExternalMessage}\n />\n ) : null}\n </>\n )\n}\n\nexport const CustomIndicatorsContainer = (\n props: IndicatorsContainerProps<SelectValue>\n) => {\n const emailValidation = (props.selectProps as any).emailValidation\n const isMenuOpen = props.selectProps.menuIsOpen\n const upDownIconsStyle = (props.selectProps as any).upDownIconsStyle\n const largeUpDownIconsStyle = (props.selectProps as any).largeUpDownIconsStyle\n\n return (\n <>\n {emailValidation ? null : (\n <components.IndicatorsContainer\n {...props}\n className={'indicators-container'}\n >\n {props.selectProps.isClearable && props.hasValue ? (\n // @ts-ignore\n <components.ClearIndicator {...props}>\n <IoIosClose\n size={25}\n onClick={() => {\n props.clearValue()\n props.setValue({ value: '', label: '' }, 'deselect-option', {\n value: '',\n label: '',\n })\n }}\n />\n </components.ClearIndicator>\n ) : null}\n {upDownIconsStyle && (\n <>\n {isMenuOpen ? (\n <MdArrowDropUp\n size={20}\n color={'#3fb1f2'}\n style={{ marginRight: '.8rem' }}\n />\n ) : (\n <MdArrowDropDown\n size={20}\n color={'#c3ccd5'}\n style={{ marginRight: '.8rem' }}\n />\n )}\n </>\n )}\n {largeUpDownIconsStyle && (\n <DropDownIconsWrapperStyled isMenuOpen={isMenuOpen}>\n {isMenuOpen ? (\n <FaChevronUp\n size={18}\n color={'#3fb1f2'}\n style={{ marginRight: '.8rem' }}\n />\n ) : (\n <FaChevronDown\n size={18}\n color={'#c3ccd5'}\n style={{ marginRight: '.8rem' }}\n />\n )}\n </DropDownIconsWrapperStyled>\n )}\n </components.IndicatorsContainer>\n )}\n </>\n )\n}\n\nexport const CustomMultiValueRemove = (\n props: MultiValueRemoveProps<SelectValue>\n) => {\n const isDisabled = props.selectProps.isDisabled\n return (\n <>\n {isDisabled ? null : (\n <components.MultiValueRemove {...props}></components.MultiValueRemove>\n )}\n </>\n )\n}\n","import React, {\n ClipboardEventHandler,\n FocusEventHandler,\n useState,\n} from 'react'\nimport CreatableSelect from 'react-select/creatable'\n\nimport {\n CustomControl,\n CustomInput,\n CustomMenu,\n CustomMultiValueRemove,\n CustomOption,\n CustomSingleValue,\n MenuList,\n} from './ComponentOverrides'\nimport { customStyles } from './styled'\nimport {\n InputFeedback,\n InputFeedbackStatus,\n} from '@components/Basic/InputFeedback'\n\nexport interface SmartSelectProps {\n initialValues?: string[]\n defaultValue?: string[]\n placeholder?: string\n isClearable?: boolean\n isLoading?: boolean\n isDisabled?: boolean\n onSelect?: (values: string[]) => void\n $status?: InputFeedbackStatus\n onBlur?: FocusEventHandler<HTMLInputElement>\n name?: string\n showDropdownIndicator?: boolean\n defaultLabel?: string\n floatingLabel?: string\n onPaste?: ClipboardEventHandler<HTMLInputElement>\n}\n\nconst createOptions = (values?: string[]) =>\n (values || []).map((v) => ({\n label: v,\n value: v,\n }))\n\nexport const InputSmartCreatableSelect: React.FC<SmartSelectProps> = ({\n initialValues,\n isClearable = true,\n onSelect,\n placeholder,\n defaultValue,\n isLoading,\n isDisabled,\n $status,\n onBlur,\n name,\n showDropdownIndicator,\n defaultLabel,\n floatingLabel,\n onPaste,\n}) => {\n // use this object to pass extra props and read them inside custom components (overrides)\n const extraProps = {\n isCreatable: true,\n defaultLabel,\n floatingLabel,\n onPaste,\n }\n\n const noDropdownIndicator = !showDropdownIndicator\n ? { DropdownIndicator: () => null, IndicatorSeparator: () => null }\n : {}\n\n return (\n <div>\n <CreatableSelect\n options={createOptions(initialValues)}\n defaultValue={createOptions(defaultValue)}\n components={{\n Option: CustomOption,\n SingleValue: CustomSingleValue,\n Control: CustomControl,\n Menu: CustomMenu,\n MenuList: MenuList,\n MultiValueRemove: CustomMultiValueRemove,\n Input: CustomInput,\n ...noDropdownIndicator,\n }}\n isMulti\n noOptionsMessage={() => 'Type to add a new value'}\n styles={customStyles}\n isClearable={isClearable}\n placeholder={isLoading ? 'Loading...' : placeholder}\n isDisabled={isLoading || isDisabled}\n onBlur={(e) => {\n if (onBlur) {\n onBlur(e)\n }\n }}\n onChange={(selectedValue) => {\n if (onSelect) {\n const typedValues = selectedValue as {\n label: string\n value: string\n }[]\n const newValues = (typedValues || []).map((v) => v.label)\n onSelect(newValues)\n }\n }}\n name={name}\n {...extraProps}\n />\n {$status && <InputFeedback $status={$status} />}\n </div>\n )\n}\n","import React, { useLayoutEffect, useRef, useState } from 'react'\nimport ReactTooltip from 'react-tooltip'\nimport { SmartSelectTooltipInfoMessage } from '@components/Form/InputSmartSelect/styled'\nimport { BsInfoCircle } from 'react-icons/bs'\nimport { SelectValue } from '@components/Form/InputSmartSelect/index'\n\ninterface Props {\n id: string\n tooltipMessage?: string\n label: string\n}\n\nexport const Tooltip: React.VFC<Props> = ({ id, tooltipMessage, label }) => {\n return (\n <ReactTooltip\n id={id}\n place={'right'}\n getContent={() =>\n tooltipMessage && label ? (\n <>\n <label>{label}</label>\n <SmartSelectTooltipInfoMessage>\n <BsInfoCircle /> <span>{tooltipMessage}</span>\n </SmartSelectTooltipInfoMessage>\n </>\n ) : tooltipMessage ? (\n <SmartSelectTooltipInfoMessage>\n <BsInfoCircle /> <span>{tooltipMessage}</span>\n </SmartSelectTooltipInfoMessage>\n ) : (\n <label>{label}</label>\n )\n }\n className={'react-select-tooltip'}\n />\n )\n}\n\n// This hook is used to check if selected label is too long. It only work for single SelectValue.\n// It exposes the outer element ref and the inner element ref, so we can check if width exceed.\nexport const useIsLabelTooLong = ({\n defaultValue,\n}: {\n defaultValue: SelectValue\n}) => {\n const wrapperEl = useRef<HTMLDivElement | null>(null)\n const selectedSingleValueEl = useRef<HTMLDivElement | null>(null)\n const [outerWidth, setOuterWidth] = useState<number>()\n const [singleValueWidth, setSingleValueWidth] = useState<number>()\n\n // To get and calculate wrapper width minus icons containers if present\n useLayoutEffect(() => {\n // To check if icon/logo or controllers are present and return default value\n let extraElementsWidth = Array.isArray(defaultValue)\n ? 0\n : defaultValue?.icon\n ? 65\n : 0\n\n if (wrapperEl.current) {\n // in most of the cases the select has indicators on the right,\n // we added a custom `.indicators-container` so we can retrieve the width do detract\n const indicatorsContainerWidth =\n wrapperEl.current?.querySelector('.indicators-container')\n ?.clientWidth || 0\n\n extraElementsWidth += indicatorsContainerWidth\n setOuterWidth(wrapperEl.current?.clientWidth - extraElementsWidth)\n }\n }, [wrapperEl])\n\n // to get single value input width\n useLayoutEffect(() => {\n if (selectedSingleValueEl.current) {\n setSingleValueWidth(selectedSingleValueEl.current?.offsetWidth)\n }\n }, [selectedSingleValueEl])\n\n const isLabelTooLong =\n defaultValue &&\n !Array.isArray(defaultValue) &&\n singleValueWidth &&\n outerWidth\n ? singleValueWidth > outerWidth\n : false\n\n return {\n selectedSingleValueEl,\n wrapperEl,\n isLabelTooLong,\n }\n}\n","import styled, { css } from 'styled-components'\nimport { InputToggleProps } from './index'\n\nconst labelWidth = ({ $size }: InputToggleProps) => {\n switch ($size) {\n case 'large':\n return '4.375rem'\n case 'small':\n return '2.8rem'\n default:\n return '3.8rem'\n }\n}\n\nconst labelHeight = ({ $size }: InputToggleProps) => {\n switch ($size) {\n case 'large':\n return '1.875rem'\n case 'small':\n return '1.2rem'\n default:\n return '1.7rem'\n }\n}\n\nconst sliderWidthHeight = ({ $size }: InputToggleProps) => {\n switch ($size) {\n case 'large':\n return '1.625rem'\n case 'small':\n return '1.05rem'\n default:\n return '1.5rem'\n }\n}\n\nconst rootFontSize = 16\n\nconst transitionSize = ({ $size }: InputToggleProps) => {\n const totalWidth =\n parseFloat(labelWidth({ $size }).replace('rem', '')) * rootFontSize\n const switchWidth =\n parseFloat(sliderWidthHeight({ $size }).replace('rem', '')) * rootFontSize\n const originalLeftSpace = 4\n\n const transitionDistance = totalWidth - switchWidth - originalLeftSpace * 2\n return `${transitionDistance}px`\n}\n\n/* const transitionSize = ({ $size }: InputToggleProps) => {\n switch ($size) {\n case 'large':\n return '37px'\n case 'small':\n return '23px'\n default:\n return '30.5px'\n }\n} */\n\nconst fontSize = ({ $size }: InputToggleProps) => {\n switch ($size) {\n case 'large':\n return '1.125rem'\n case 'small':\n return '0.875rem'\n default:\n return '1rem'\n }\n}\n\nconst labelStyle = ({ $variant, $size }: InputToggleProps) => {\n const commonStyle = css`\n font-size: ${fontSize({ $size })};\n `\n\n switch ($variant) {\n case 'dark':\n return css`\n color: #273649;\n ${commonStyle}\n `\n case 'primary':\n return css`\n color: #696f8c;\n ${commonStyle}\n `\n }\n}\n\nconst bgColorChecked = ({ $variant }: Pick<InputToggleProps, '$variant'>) => {\n switch ($variant) {\n case 'dark':\n return '#273649'\n case 'primary':\n return '#fd9645'\n }\n}\n\nconst bgColorNotChecked = ({\n $variant,\n}: Pick<InputToggleProps, '$variant'>) => {\n switch ($variant) {\n case 'dark':\n return '#d9dee1'\n case 'primary':\n return '#919EAB'\n }\n}\n\nexport const WrapperStyled = styled.div<InputToggleProps>`\n display: flex;\n align-items: center;\n\n label {\n ${labelStyle}\n ${({ $isChecked, $variant }) => {\n if ($isChecked && $variant === 'dark') {\n return css`\n &:first-child {\n opacity: 0.7;\n }\n &:last-child {\n font-weight: 600;\n letter-spacing: -0.3px;\n }\n `\n } else if (!$isChecked && $variant === 'dark') {\n return css`\n &:last-child {\n opacity: 0.7;\n }\n &:first-child {\n font-weight: 600;\n letter-spacing: -0.3px;\n }\n `\n }\n }}\n`\n\nexport const LabelStyled = styled.label<InputToggleProps>`\n position: relative;\n display: inline-block;\n min-width: ${labelWidth};\n width: ${labelWidth};\n height: ${labelHeight};\n\n ${({ $isDisabled }) =>\n $isDisabled\n ? css`\n pointer-events: none;\n `\n : null}\n\n & input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n`\n\nexport const SpanStyled = styled.span<InputToggleProps>`\n position: absolute;\n cursor: pointer;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-radius: 18.5px;\n\n ${({ $isChecked }) =>\n $isChecked\n ? css`\n background-color: ${bgColorChecked};\n `\n : css`\n background-color: ${bgColorNotChecked};\n `};\n\n \n\n &:before {\n position: absolute;\n content: '';\n width: ${sliderWidthHeight};\n height: ${sliderWidthHeight};\n left: 4px;\n bottom: 1.5px;\n transition: 0.4s;\n background-color: #fff;\n border-radius: 18.5px;\n box-shadow: 1px 1px 4px 0 rgba(67, 62, 62, 0.27);\n\n ${({ $isChecked }) =>\n $isChecked &&\n css`\n transform: translateX(${transitionSize});\n `};\n \n`\n","import React, { ReactElement, useEffect, useRef, useState } from 'react'\nimport {\n components,\n MultiValueProps,\n MenuListProps,\n OptionProps,\n} from 'react-select'\nimport { FaCheck, FaList } from 'react-icons/fa'\nimport {\n HoverDivider,\n StyledCustomMultiValueHoverContainer,\n LockIcon,\n StyledCustomMultiValueContainer,\n StyledMenuTabContainer,\n StyledMenuTab,\n StyledCustomOptionContainer,\n StyledCustomOptionFormulaContainer,\n StyledCustomOptionFormulaLabel,\n StyledCustomOptionFormulaDescription,\n StyledCustomOptionSourceContainer,\n StyledCustomOptionSourceLabel,\n StyledCustomOptionPicklistLabel,\n StyledCustomMultiValueRemoveContainer,\n RemoveIcon,\n HoverRemoveIcon,\n HoverEditIcon,\n StyledCustomMultiValueLabel,\n} from '@components/Form/MultiCreatableCustom/styled'\nimport {\n TabType,\n SelectValueMulti,\n CustomCreatableAdditionalProps,\n} from '@components/Form/MultiCreatableCustom'\nimport { useTranslation } from 'react-i18next'\nimport { AiOutlineFunction } from 'react-icons/ai'\nimport { MdTextFields } from 'react-icons/md'\nimport { MappedFieldType } from 'Nbee'\nimport ReactTooltip from 'react-tooltip'\n\nexport const CustomMultiValue = ({\n children,\n ...props\n}: MultiValueProps): ReactElement<MultiValueProps> | null => {\n const data = props.data as SelectValueMulti\n const isFormula = data.fieldType === 'formula'\n const [isHovering, setIsHovering] = useState(false)\n const valueContainerRef = useRef<HTMLDivElement>(null)\n const [containerSize, setContainerSize] = useState({ width: 0, height: 0 })\n\n const handleEditClick = () => {\n const data = props.data as SelectValueMulti\n props.setValue(\n { ...data, isNewFormula: false }, // we pass isNewFormula to the option to indicate that it's not a new formula\n 'select-option',\n props.options\n )\n }\n const handleRemoveClick = () => {\n props.setValue(props.data, 'deselect-option', props.options)\n }\n const handleMouseEnter = () => setIsHovering(true)\n const handleMouseLeave = () => setIsHovering(false)\n\n const { sourceLogoComponent } =\n props.selectProps as CustomCreatableAdditionalProps // another extra prop\n\n // get the size of the value container to use it for the hover container\n useEffect(() => {\n if (valueContainerRef.current) {\n const { width, height } =\n valueContainerRef.current.getBoundingClientRect()\n setContainerSize({ width, height })\n }\n }, [])\n\n const shouldShowTooltip =\n data.label &&\n (data.label[0] === ' ' ||\n data.label[data.value.length - 1] === ' ' ||\n data.label.length > 20) // 20 is an approximate number of characters that can fit\n\n const renderTooltipContent = (text: string) => {\n if (!text) return null\n\n const chars = text.split('')\n return (\n <div>\n {chars.map((char, index) => {\n const isFirst = index === 0\n const isLast = index === chars.length - 1\n const shouldHighlight = (isFirst || isLast) && char === ' '\n return shouldHighlight ? (\n <span key={index} style={{ backgroundColor: '#40b1f3' }}>\n \n </span>\n ) : (\n <span key={index}>{char}</span>\n )\n })}\n </div>\n )\n }\n\n return (\n <components.MultiValue {...props}>\n <components.MultiValueContainer {...props}>\n <StyledCustomMultiValueContainer\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n fieldType={data.fieldType as MappedFieldType}\n >\n {shouldShowTooltip ? (\n <ReactTooltip\n id={`multi-creatable-tooltip-${data.value}`}\n place='top'\n type='dark'\n effect='solid'\n getContent={() => renderTooltipContent(data.label)}\n />\n ) : null}\n {!props.isDisabled && isHovering && isFormula ? (\n <StyledCustomMultiValueHoverContainer\n width={containerSize.width}\n height={containerSize.height}\n onMouseDown={(e) => {\n e.preventDefault()\n e.stopPropagation()\n }} // prevents menu to opening when clicking on the pencil icon\n >\n <HoverEditIcon onClick={handleEditClick} />\n <HoverDivider />\n <HoverRemoveIcon onClick={handleRemoveClick} />\n </StyledCustomMultiValueHoverContainer>\n ) : (\n <StyledCustomMultiValueLabel\n label={props.selectProps.getOptionLabel(data) || ''}\n ref={valueContainerRef}\n data-tip\n data-for={`multi-creatable-tooltip-${data.value}`}\n >\n {isFormula && <AiOutlineFunction size={16} />}\n {data.fieldType === 'source' &&\n sourceLogoComponent?.props.src &&\n sourceLogoComponent}\n {/* Display logo only we have it */}\n {data.fieldType === 'text' && <MdTextFields size={16} />}\n {data.fieldType === 'custom' && <FaList size={11} />}\n <components.MultiValueLabel {...props}>\n {children}\n </components.MultiValueLabel>\n </StyledCustomMultiValueLabel>\n )}\n {!props.isDisabled && !isFormula && (\n <components.MultiValueRemove {...props}>\n <StyledCustomMultiValueRemoveContainer\n onMouseDown={(e) => e.stopPropagation()}\n >\n <RemoveIcon\n onClick={handleRemoveClick}\n className={'remove-icon'}\n />\n </StyledCustomMultiValueRemoveContainer>\n </components.MultiValueRemove>\n )}\n </StyledCustomMultiValueContainer>\n </components.MultiValueContainer>\n </components.MultiValue>\n )\n}\n\nexport const CustomMenuList = ({\n children,\n ...props\n}: MenuListProps): ReactElement<MultiValueProps> | null => {\n const {\n activeTab,\n handleTabChange,\n userHasFormulaEnabled,\n hasPicklist,\n hasFormula,\n } = props.selectProps as CustomCreatableAdditionalProps // these are the extraProps added to the MultiCreatableCustom component\n if (!handleTabChange) return null\n const handleTabClick = (\n e: React.MouseEvent<HTMLButtonElement, MouseEvent>,\n tab: TabType\n ) => {\n e.preventDefault()\n handleTabChange(tab)\n }\n\n return (\n <components.MenuList {...props}>\n {(hasPicklist || hasFormula) && (\n <StyledMenuTabContainer>\n {hasPicklist && (\n <StyledMenuTab\n isActive={activeTab === 'custom'}\n onClick={(e) => handleTabClick(e, 'custom')}\n >\n Picklist\n </StyledMenuTab>\n )}\n <StyledMenuTab\n isActive={activeTab === 'fields'}\n onClick={(e) => handleTabClick(e, 'fields')}\n >\n Fields\n </StyledMenuTab>\n {hasFormula && (\n <StyledMenuTab\n isActive={activeTab === 'formulas'}\n onClick={(e) => handleTabClick(e, 'formulas')}\n style={{\n color:\n activeTab === 'formulas' && userHasFormulaEnabled\n ? 'black'\n : '#A9A9A9',\n }}\n >\n Formulas\n {!userHasFormulaEnabled && <LockIcon />}\n </StyledMenuTab>\n )}\n </StyledMenuTabContainer>\n )}\n {children}\n </components.MenuList>\n )\n}\n\nexport const CustomOption = (\n props: OptionProps\n): ReactElement<MultiValueProps> | null => {\n const { t } = useTranslation()\n const data = props.data as SelectValueMulti\n const isFormula = data.fieldType === 'formula'\n\n const { userHasFormulaEnabled, onRedirectToPricing } =\n props.selectProps as CustomCreatableAdditionalProps // these are the extraProps added to the MultiCreatableCustom component\n const handleRedirectToPricing = () => {\n if (onRedirectToPricing) {\n onRedirectToPricing(!userHasFormulaEnabled)\n }\n }\n return (\n <components.Option {...props}>\n <StyledCustomOptionContainer isFocused={props.isFocused}>\n {isFormula ? (\n <StyledCustomOptionFormulaContainer onClick={handleRedirectToPricing}>\n <StyledCustomOptionFormulaLabel>\n {data.label}\n </StyledCustomOptionFormulaLabel>\n <StyledCustomOptionFormulaDescription>\n {data.formulaDescription}\n </StyledCustomOptionFormulaDescription>\n </StyledCustomOptionFormulaContainer>\n ) : (\n <StyledCustomOptionSourceContainer>\n <StyledCustomOptionSourceLabel>\n {data.label}\n </StyledCustomOptionSourceLabel>\n {data?.fieldType === 'custom' ? (\n <StyledCustomOptionPicklistLabel>\n {data.value}\n </StyledCustomOptionPicklistLabel>\n ) : (\n data?.fieldType === 'source' &&\n data?.lastValue !== undefined && (\n <StyledCustomOptionPicklistLabel>\n {data.lastValue}\n </StyledCustomOptionPicklistLabel>\n )\n )}\n </StyledCustomOptionSourceContainer>\n )}\n </StyledCustomOptionContainer>\n </components.Option>\n )\n}\n","import { ApiFormulasSchemaResponseData } from 'BackendApi'\nimport { MappedFieldMapping, MappedField } from 'Nbee'\nimport { SelectValueMulti } from '@components/Form/MultiCreatableCustom'\nimport { TFunction } from 'i18next'\nimport { useTranslation } from 'react-i18next'\n\nexport const regenerateMappingIds = (\n newMapping: MappedFieldMapping[],\n fieldIndex: number\n): MappedFieldMapping[] => {\n return newMapping.map((mapping, index) => {\n return {\n ...mapping,\n id: `${fieldIndex}-${\n mapping.sourceFieldId || mapping.formula?.id || mapping.text\n }-${index}`,\n }\n })\n}\n\n// function to convert options objects\n// from SelectValueMulti\n// into fields mapping object\n// fot the Formik context\nexport const convertToMapping = (\n options: SelectValueMulti[],\n mappedField: MappedField\n): MappedFieldMapping[] => {\n return options.map((option) => {\n const isFormula = option.fieldType === 'formula'\n const isCustom = option.fieldType === 'custom'\n const isText = option.fieldType === 'text'\n const isSource = option.fieldType === 'source'\n return {\n id: option.selectId,\n sourceFieldId: isSource || isCustom ? option.value?.toString() : null,\n fieldType: option.fieldType,\n text: isText ? option.value : null,\n formula: isFormula\n ? {\n id: option.value,\n // Directly find and use existing formula params if available, or set to an empty array\n params:\n mappedField?.mapping.find((m) => m.id === option.selectId)\n ?.formula?.params || [],\n }\n : null,\n }\n }) as MappedFieldMapping[]\n}\n\nexport const createOptions = (\n sourceFields: SelectValueMulti[],\n picklistOptions: SelectValueMulti[],\n formulas: ApiFormulasSchemaResponseData[],\n activeTab: string\n): SelectValueMulti[] => {\n const { t } = useTranslation()\n if (activeTab === 'fields') {\n return sourceFields\n } else if (activeTab === 'custom') {\n return picklistOptions\n } else if (activeTab === 'formulas') {\n return formulas?.map(\n (formula) =>\n ({\n label: `${formula.category} \\u00BB ${t(\n `nbee.formulas.${formula.id}.Name` as any\n )}`,\n formulaDescription: `${t(\n `nbee.formulas.${formula.id}.Description` as any\n )}`,\n value: formula.id,\n formulaCategory: formula.category,\n fieldType: 'formula',\n } as SelectValueMulti)\n )\n } else {\n return []\n }\n}\n\nconst findFieldLabel = (\n fieldId: string | null,\n field: MappedFieldMapping,\n sourceFields?: SelectValueMulti[]\n): string | null => {\n return sourceFields?.find((f) => f.value === fieldId)?.label || field.text\n}\nexport const createDefaultValues = (\n mapping: MappedFieldMapping[],\n sourceFields: SelectValueMulti[],\n t: TFunction\n): SelectValueMulti[] => {\n return mapping.map((item) => {\n const isFormula = item.fieldType === 'formula'\n const isText = item.fieldType === 'text'\n const isSource = item.fieldType === 'source'\n const isCustom = item.fieldType === 'custom'\n\n if (isFormula && item.formula?.params?.length) {\n const firstParam = findFieldLabel(\n Array.isArray(item.formula.params[0]?.values)\n ? item.formula.params[0].values?.join('')\n : item.formula.params[0].values?.toString() || '',\n item,\n sourceFields\n )\n const formulaName = t(`nbee.formulas.${item.formula.id}.Name` as string)\n return {\n label: `${formulaName.toUpperCase()}${\n firstParam ? ': ' + firstParam : ''\n }`,\n value: item.formula.id,\n fieldType: item.fieldType,\n selectId: item.id,\n }\n }\n\n return {\n label: (isSource || isFormula\n ? findFieldLabel(item.sourceFieldId, item, sourceFields)\n : isText && item.text === ' '\n ? '<white-space>'\n : item.text\n ? item.text\n : isCustom\n ? item.sourceFieldId\n : '') as string,\n value: item.sourceFieldId || item.text || '',\n fieldType: item.fieldType,\n selectId: item.id,\n }\n })\n}\n","import React from 'react'\nimport { useField } from 'formik'\nimport { Checkbox, CheckboxProps } from '@components/Form/Checkbox'\n\nexport const FormikInputCheckbox: React.FC<CheckboxProps> = ({\n name,\n ...rest\n}) => {\n const [field, meta] = useField({\n name,\n })\n\n return (\n <Checkbox\n {...rest}\n {...field}\n $status={{\n ...rest.$status,\n error: (meta.touched && meta.error) || undefined,\n }}\n />\n )\n}\n","import React from 'react'\nimport { useField } from 'formik'\nimport { InputFieldAttrProps, InputField } from '@components/Form/InputField'\n\nexport const FormikInputField: React.FC<InputFieldAttrProps> = ({\n name,\n ...rest\n}) => {\n const [field, meta] = useField({\n name,\n })\n\n return (\n <InputField\n {...rest}\n {...field}\n $status={{\n ...rest.$status,\n error: (meta.touched && meta.error) || undefined,\n }}\n />\n )\n}\n","import React from 'react'\nimport { useField } from 'formik'\nimport { InputSelect, SelectFieldProps } from '@components/Form/InputSelect'\n\nexport const FormikInputSelect: React.FC<SelectFieldProps> = ({\n name,\n ...rest\n}) => {\n const [field, meta] = useField({\n name,\n })\n\n return (\n <InputSelect\n {...rest}\n {...field}\n $status={{\n ...rest.$status,\n error: (meta.touched && meta.error) || undefined,\n }}\n />\n )\n}\n","import styled from 'styled-components'\n\nexport const Wrapper = styled.div`\n width: 100%;\n`\n\nexport const DataTable = styled.div`\n border: 1px solid #d8d8d8;\n border-bottom: none;\n border-right: none;\n border-radius: 4px;\n`\n\nexport const FieldsRow = styled.div`\n display: grid;\n grid-template-columns: 1fr 3fr 3fr;\n border-bottom: 1px solid #d8d8d8;\n`\n\nexport const InputBox = styled.div`\n display: flex;\n justify-content: center;\n padding: 0.6rem 0.1rem;\n border-right: 1px solid #d8d8d8;\n\n span {\n left: 5px !important;\n }\n`\n\nexport const ValueBox = styled.div`\n position: relative; /* make sure pseudo-elements are relative to this box */\n padding: 0.6rem 0.75rem;\n border-right: 1px solid #d8d8d8;\n word-wrap: break-word;\n overflow-wrap: break-word;\n -webkit-hyphens: auto;\n hyphens: auto;\n -webkit-hyphenate-character: '';\n hyphenate-character: '';\n word-break: break-all;\n`\n","import React from 'react'\nimport styled from 'styled-components'\n\nconst Wrapper = styled.div<{ percentage: number }>`\n background: #c6e4f4;\n height: 10px;\n width: 100%;\n border-top-left-radius: 6px;\n border-top-right-radius: 6px;\n overflow: hidden;\n position: relative;\n &:after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: ${({ percentage }) => percentage}%;\n background-color: ${({ theme }) => theme.color.primary};\n transition: width 0.4s ease-in-out;\n }\n`\n\ninterface Props {\n percentage: number\n}\n\nexport const ProgressBar: React.VFC<Props> = ({ percentage }) => {\n return <Wrapper percentage={percentage} />\n}\n","import React from 'react'\nimport { StepBarItemStyled } from './styled'\nimport { StepBarStep } from '@components/StepBar/index'\n\nexport interface StepBarItemProps extends StepBarStep {\n index: number\n isActive?: boolean\n}\nexport const StepBarItem: React.FC<StepBarItemProps> = ({\n index,\n onStepClick,\n label,\n title,\n subLabel,\n isActive,\n}) => {\n const onClickHandler = () => {\n if (onStepClick) {\n onStepClick(index)\n }\n }\n\n return (\n <StepBarItemStyled className={isActive ? 'active' : undefined}>\n <div\n className={`step-bar-circle ${onStepClick ? ' is-clickable' : ''}`}\n onClick={onClickHandler}\n >\n <span title={title}>{index + 1}</span>\n </div>\n {isActive && (\n <span onClick={onClickHandler} className={`step-bar-label`}>\n {label}\n </span>\n )}\n <div className='step-bar-optional'>{subLabel}</div>\n <div className='step-bar-left' />\n <div className='step-bar-right' />\n </StepBarItemStyled>\n )\n}\n","import {\n EventProperties,\n TrackingEvents,\n TrackingFeature,\n TrackingParams,\n TrackingStep,\n} from 'DataTracking'\nimport store from '@app/store'\nimport { extractUserIdFromCognitoUser } from '@app/dataTracking/utils'\nimport { isDebug } from '@app/utils/envUtils'\nimport { matchPath, useLocation } from 'react-router-dom'\nimport { useEffect } from 'react'\nimport { appRoutes } from '@app/routes'\nimport { isInIframe } from '@app/utils/isInFrame'\nimport { ApiUser } from 'BackendApi'\n\ninterface ExtendedWindow {\n logTrackCallback: boolean\n enableTrackingDebug: () => void\n}\n\nconst w = window as unknown as ExtendedWindow\nw.logTrackCallback = isDebug\nw.enableTrackingDebug = () => {\n w.logTrackCallback = true\n}\n\nconst isSegmentEnabled = Boolean(process.env.SEGMENT_API_KEY)\nconst isEmbedded = isInIframe()\n\nexport const trackEvent = ({\n eventName,\n feature,\n step,\n params,\n sendEventToIntercom = false,\n}: {\n eventName: TrackingEvents\n feature: TrackingFeature\n step?: TrackingStep\n params?: TrackingParams\n sendEventToIntercom?: boolean // this is used to send the event to intercom as well\n}): void => {\n if (!isSegmentEnabled) {\n return\n }\n\n if (!eventName) {\n console.warn('received a tacking event request without a valid event name')\n return\n }\n if (!window.analytics) {\n console.warn('segment script not found')\n return\n }\n\n // getting data from redux\n const { user } = store.getState()\n const { userId, accountId } = extractUserIdFromCognitoUser(user.auth)\n const { custom, ...eventParams } = params || {}\n\n const properties: EventProperties = {\n feature,\n step,\n userId,\n lbAccountId: accountId,\n embedded: isEmbedded,\n ...eventParams, // some events (eg. signup) might also pass `userId` (eg. signup) in this case redux content will be replaces to what passed in the event as userId\n ...custom,\n }\n\n // Send track event to segment, with the specified payload\n if (w.logTrackCallback) {\n console.info('sending event to Segment: ', eventName, properties)\n }\n window.analytics.track(eventName, properties, undefined, () => {\n if (w.logTrackCallback) {\n console.info(`segment has logged -> ${eventName}`)\n }\n })\n}\n\nexport const identifyUserByUserData = async (userData?: ApiUser) => {\n if (!isSegmentEnabled) {\n return\n }\n\n if (!window.analytics) {\n console.warn('segment script not found')\n return\n }\n\n const uid = userData?.user?.slaveUserId\n ? `SUID-${userData?.user?.slaveUserId}`\n : userData?.user?.userId\n ? `UID-${userData?.user?.userId}`\n : undefined\n const email = userData?.user?.email\n const intercomUserHash = userData?.external?.intercom?.userHash\n\n if (uid) {\n window.analytics.identify(\n uid,\n {\n email,\n },\n {\n integrations: {\n Intercom: {\n user_hash: intercomUserHash,\n },\n },\n },\n () => {\n if (w.logTrackCallback) {\n console.log(`Identify by uid -> ${uid}`)\n }\n // This is usefull so we can wait for the identify event to be completed before sending new events.\n // Eg: to be used in signup, so before sending the signup event we can be sure to have identified the user first.\n Promise.resolve()\n }\n )\n }\n}\n\nexport const forgetUser = () => {\n if (!isSegmentEnabled) {\n return\n }\n\n if (!window.analytics) {\n console.warn('segment script not found')\n return\n }\n\n window.analytics.reset()\n}\n\n// React hook to be used to connect read-router with page analytics tracking event\nexport const useTrackPageView = (isUserLoggedIn: boolean) => {\n const location = useLocation()\n\n useEffect(() => {\n // we don't want to send page views for `/`, `/signin` or `logout`\n const isInExcludedPath = matchPath(location.pathname, {\n path: [appRoutes.logout.path, appRoutes.signin.path],\n exact: false,\n strict: false,\n })\n const isInRootPath = location.pathname === '/'\n const doNotSendPageView = isInExcludedPath || isInRootPath\n\n if (!isSegmentEnabled || doNotSendPageView) {\n return\n }\n\n if (window.analytics && isUserLoggedIn) {\n // we only send page-view when user is authenticated\n window.analytics.page(location.pathname)\n }\n }, [location, isUserLoggedIn])\n}\n","export enum AppStoreStatus {\n NONE = 'None', // mai arrivato nello stepper\n PLATFORMAUTHENTICATION = 'PlatformAuthentication', // arrivato nello step di autenticazione piattaforma ma non autenticata\n PLATFORMAUTHENTICATED = 'PlatformAuthenticated', // autenticata piattaforma\n SPREADSHEETSELECTION = 'SpreadSheetSelection', // arrivato nella selezione del Google sheet\n SPREADSHEETSELECTED = 'SpreadSheetSelected', // selezionato il Google Sheet/Tab\n PLATFORMCONFIGURATION = 'PlatformConfiguration', // arrivato nella scelta della configurazione Bridge\n PLATFORMCONFIGURED = 'PlatformConfigured', // configurato il Bridge\n PUBLISH = 'Publish', // ultima schermata,\n STATUS_SEGMENTATION_SELECTION = 'SegmentationSelection',\n STATUS_SEGMENTATION_SELECTED = 'SegmentationSelected',\n}\n","// used in bbu url\nexport enum BbuPartnersName {\n facebook = 'fb',\n facebookConversionLeads = 'fb-cl',\n tiktok = 'tt',\n app = 'app',\n}\n\n// used in generic bbu callback url\nexport enum BbuParnersFullName {\n tiktok = 'tiktok',\n}\n","export enum PersistentCookiesKeys {\n CognitoSession = 'LB_cognito_session', // store cognito jwt and deviceKey to authenticate api requests\n EvoToken = 'evoToken', // allows communication of auth session between v1 and v2\n LbImp = 'LB_imp',\n XsrfToken = 'XSRF-TOKEN', // cookie to prevent CSRF attack. This cookie is used also in Vue app\n}\n","export enum PersistentLocalStorageKeys {\n bbuPersistentData = 'bbuPersistentData',\n bbuPersistentUserStatus = 'bbuPersistentUserStatus',\n}\n\nexport enum PersistentSessionStorageKeys {\n integrationAuthFlowAppId = 'integrationAuthFlowAppId',\n integrationAuthFlowCredentials = 'integrationAuthFlowCredentials',\n}\n","import React from 'react'\nimport styled from 'styled-components'\n\ninterface ToolSquare {\n logoUri?: string\n name?: string\n}\nconst ToolSquareStyled = styled.div`\n box-shadow: 0 2px 2px 0 rgb(0 0 0 / 14%), 0 3px 1px -2px rgb(0 0 0 / 20%),\n 0 1px 5px 0 rgb(0 0 0 / 12%);\n width: 100%;\n border-radius: 5px;\n height: 110px;\n padding: 10px;\n text-align: center;\n cursor: default;\n background-color: white;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n img {\n max-width: 45px;\n width: fit-content;\n margin: 0 auto;\n }\n label {\n font-weight: 600;\n width: 100%;\n font-size: 0.9rem;\n padding: 5px 0;\n line-height: 1.2;\n min-height: 45px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n`\nconst ToolSquare: React.FC<ToolSquare> = ({ ...props }) => {\n return (\n <ToolSquareStyled>\n <img alt={`Logo ${props.name}`} width={'100%'} src={props.logoUri} />\n <label>{props.name}</label>\n </ToolSquareStyled>\n )\n}\nexport default ToolSquare\n","import React, { useEffect, useState } from 'react'\nimport { Button } from '@components/Basic/Button'\nimport { BbuRouteParams, PersistentBbuData } from 'LeadsBridgeApp'\nimport { BbuParnersFullName, BbuPartnersName } from '@app/enums/bridgeByUrl'\nimport { PersistentLocalStorageKeys } from '@app/enums/persistentLocalStorageKeys'\nimport { appRoutes } from '@app/routes'\nimport { ButtonProvider } from '@components/ButtonProvider'\nimport { Loader } from '@components/Basic/Loader'\nimport { useTranslation } from 'react-i18next'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { identifyUserByUserData, trackEvent } from '@app/dataTracking'\nimport { useAppSelector } from '@app/store/hooks'\nimport { AuthState } from '@aws-amplify/ui-components'\n\ninterface Props {\n partnerName: BbuPartnersName\n integrationsMeta: PersistentBbuData\n}\n\nexport const PartnerConnectButton: React.FC<Props> = ({\n partnerName,\n integrationsMeta,\n}) => {\n const { t } = useTranslation()\n const history = useHistory()\n const urlParams = useParams<BbuRouteParams>()\n const [isDoingLogin, setIsDoingLogin] = useState(false)\n const [popup, setPopup] = useState<Window | null>(null)\n const [isPopupOpen, setIsPopupOpen] = useState(false) // Track whether the pop-up is open\n\n const authState = useAppSelector((state) => state.user.authState)\n const userAuthState = useAppSelector((state) => state.user.auth)\n const userIsLogged = authState === AuthState.SignedIn && userAuthState\n\n const onTikTokAuthRequest = () => {\n setIsDoingLogin(true)\n\n // save source+destination+requestUri in session storage, so it will be persistent\n // (will resist to page refresh on same tab) and we will still allow user to complete\n // bbu flow by opening multiple tabs. Each tab will have its own persistent data\n window.sessionStorage.setItem(\n PersistentLocalStorageKeys.bbuPersistentData,\n JSON.stringify(integrationsMeta)\n )\n\n // after auth flow, tiktok will redirect user to https://leadsbridge.com/app/tiktokAccount/new?state=bounce_to_evo_production&auth_code=xxxxxxxxxxx&code=xxxxxxxx'\n // v1 will read state param and redirect back to our app https://app.leadsbridge.com/auth/tt/callback?lb_code=xxxxxxxxx\n const urlParams = [\n `app_id=${process.env.REACT_OAUTH_TIKTOK_APP_ID}`,\n `state=${process.env.REACT_OAUTH_TIKTOK_STATE}`,\n `redirect_uri=${encodeURIComponent(\n process.env.REACT_OAUTH_TIKTOK_REDIRECT_URI || ''\n )}`,\n 'rid=kb5sq2ywj9',\n ]\n const tikTokUrl =\n `https://ads.tiktok.com/marketing_api/auth?` + urlParams.join('&')\n\n if (process.env.REACT_USE_MOCK_API === 'true') {\n window.location.href =\n window.location.origin +\n appRoutes.bridgeByUrlCallback.makeUrl({\n partnerFullName: BbuParnersFullName.tiktok,\n }) +\n '?lb_code=12323'\n } else {\n // open TikTok auth in a pop-up window\n const newPopup = window.open(tikTokUrl, '_blank', 'width=800,height=600')\n if (!newPopup) {\n setIsDoingLogin(false)\n console.error('Pop-up blocked or failed to open')\n return\n }\n setPopup(newPopup)\n setIsPopupOpen(true)\n }\n }\n\n useEffect(() => {\n if (!popup) return\n\n const popupTimer = setInterval(() => {\n if (!popup || popup.closed) {\n clearInterval(popupTimer)\n setIsDoingLogin(false)\n setIsPopupOpen(false) // pop-up is closed\n setPopup(null)\n return\n }\n\n try {\n // check if the pop-up URL matches the callback URL\n if (popup.location.href.includes('lb_code')) {\n // extract lb_code from the URL\n const params = new URLSearchParams(popup.location.search)\n const lbCode = params.get('lb_code')\n\n // close the pop-up and clear the interval\n popup.close()\n clearInterval(popupTimer)\n setIsDoingLogin(false)\n setIsPopupOpen(false)\n setPopup(null)\n\n // redirect the main window to continue the user flow\n if (lbCode) {\n console.log(\n 'redirecting to',\n `/auth/tiktok/callback?lb_code=${lbCode}`\n )\n window.location.href = `/auth/tiktok/callback?lb_code=${lbCode}`\n }\n }\n } catch (e) {\n // catch cross-origin errors while the pop-up is on TikTok's domain\n }\n }, 500)\n\n // clean up the interval when the component unmounts or when popup is closed\n return () => {\n if (popupTimer) {\n clearInterval(popupTimer)\n }\n }\n }, [popup])\n\n switch (partnerName) {\n case BbuPartnersName.facebook:\n case BbuPartnersName.facebookConversionLeads:\n return (\n <div>\n {isDoingLogin && <Loader $active $dimmer />}\n <ButtonProvider\n provider={'Facebook'}\n scope={'NoScope'}\n onBeforeAuth={() => {\n setIsDoingLogin(true)\n }}\n onAuthError={(_, errorCode) => {\n console.log(errorCode)\n if (\n errorCode === 'auth-provider-email-not-received' &&\n !userIsLogged\n ) {\n // redirect user to new app survey\n history.push(\n appRoutes.signupBbuFallbackSurvey.makeUrl({\n partnerName: partnerName,\n source: urlParams.source,\n destination: urlParams.destination,\n })\n )\n }\n setIsDoingLogin(false)\n }}\n onAuthSuccess={async (userInfo) => {\n // auth success\n console.log('auth ', userInfo)\n\n // we wait to have the user identified before sending the track event\n await identifyUserByUserData(userInfo).catch(() => {\n console.log('not identified - segment not active')\n })\n\n trackEvent({\n eventName: userInfo.newUser ? 'SignUp' : 'SignIn',\n feature: 'Authentication',\n step: userInfo.newUser ? 'Signup' : 'Signin',\n params: {\n custom: {\n planId: userInfo.pricing.cbPlanId,\n mrr: (userInfo?.pricing?.mrr || 0) / 100,\n channel: partnerName,\n sourceId: integrationsMeta?.source?.id,\n sourceName: integrationsMeta?.source?.name,\n destinationId: integrationsMeta?.destination?.id,\n destinationName: integrationsMeta?.destination?.name,\n },\n },\n })\n }}\n />\n </div>\n )\n case BbuPartnersName.tiktok:\n return (\n <div style={{ marginBottom: '2rem' }}>\n <Button\n $fluid\n $variant={'tiktok'}\n onClick={onTikTokAuthRequest}\n $loading={isDoingLogin}\n $size={'large'}\n disabled={isDoingLogin}\n >\n {t('bbu.ctaTikTok')}\n </Button>\n {isPopupOpen && (\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n background: 'rgba(0, 0, 0, 0.8)',\n flexDirection: 'column',\n textAlign: 'center',\n color: '#fff',\n borderRadius: '1rem',\n zIndex: 1,\n }}\n >\n <span style={{ marginTop: '2rem' }}>\n {t('bbu.ctaCheckPopup')}\n </span>\n <span\n onClick={() => popup!.focus()}\n style={{\n fontWeight: 600,\n textDecoration: 'underline',\n cursor: 'pointer',\n }}\n >\n Click here to view\n </span>\n </div>\n )}\n </div>\n )\n case BbuPartnersName.app:\n // this is for nbee bbu, we don't need to display any connect button\n return null\n default:\n return <div>Partner not valid</div>\n }\n}\n","import React, { useState } from 'react'\nimport { Col, Row } from 'react-grid-system'\nimport ToolSquare from '@components/ToolSquare'\nimport { Accordion, Segment, Icon as SemanticIcon } from 'semantic-ui-react'\nimport { BsArrowRight } from 'react-icons/bs'\nimport Typography from '@components/Basic/Typography'\nimport styled from 'styled-components'\nimport { useFetchIntegrationsMetaForBridgeByUrl } from '@app/api/integrationTools'\nimport AuthContainer, {\n AuthContainerLinks,\n} from '@features/auth/components/AuthContainer'\nimport { PartnerConnectButton } from '@features/auth/bridgeByUrl/PartnerConnectButton'\nimport { useAppSelector } from '@app/store/hooks'\nimport { appRoutes } from '@app/routes'\nimport { Link } from 'react-router-dom'\nimport { BbuPartnersName } from '@app/enums/bridgeByUrl'\nimport { getInvalidBbuUrlErrors } from '@features/auth/bridgeByUrl/utils'\n\nconst SignInWrapper = styled.div`\n padding-bottom: 1rem;\n @media (min-height: 801px) {\n min-height: 275px;\n }\n`\nconst LogoGroupStyled = styled(Row)`\n max-width: 80%;\n margin: 0 auto !important;\n`\nconst AlreadyLoggedWrapper = styled.div`\n padding: 1rem 0;\n text-align: center;\n`\n\nconst HeadlineStyled = styled.h2`\n margin-bottom: 1rem !important;\n font-size: 1.2rem;\n font-weight: 600;\n\n @media (min-width: 801px) {\n font-size: 1.4rem;\n }\n`\n\ninterface Props {\n partnerName: BbuPartnersName\n formComponent?: React.ReactNode\n links?: AuthContainerLinks\n}\n\nexport const SignInBridgeByUrl: React.FC<Props> = ({\n partnerName,\n formComponent,\n links,\n}) => {\n // Fetch bridge-by-url integration data\n const pathnameParts = window.location.pathname.split('/')\n const sourceName = pathnameParts[3]\n const destinationName = pathnameParts[4]\n const { isLoading, error, data } = useFetchIntegrationsMetaForBridgeByUrl(\n sourceName,\n destinationName\n )\n\n const canLogin = !isLoading && !error\n const noData = canLogin && !data\n // when partner is app (nbee bbu) we show login form expanded already since there's no oauth\n const loginFormIsInitallyOpen = partnerName === 'app'\n const [showLoginForm, setShowLoginForm] = useState(loginFormIsInitallyOpen)\n\n const cognitoUser = useAppSelector((state) => state.user.auth)\n\n const integrationLogos = data ? (\n <SignInWrapper>\n <LogoGroupStyled nogutter={true} align={'center'} className={'my-2'}>\n <Col>\n <ToolSquare\n name={data.source.name}\n logoUri={data.source.logoSmallUri}\n />\n </Col>\n <Col sm={2}>\n <BsArrowRight />\n </Col>\n <Col>\n <ToolSquare\n name={data.destination.name}\n logoUri={data.destination.logoSmallUri}\n />\n </Col>\n </LogoGroupStyled>\n <HeadlineStyled>\n {data.meta.headline ||\n `Use LeadsBridge to connect ${data.source.name} with ${data.destination.name}`}\n </HeadlineStyled>\n </SignInWrapper>\n ) : null\n\n return (\n <AuthContainer\n loading={isLoading}\n header={integrationLogos}\n slot={\n canLogin && !noData ? (\n <PartnerConnectButton\n partnerName={partnerName}\n integrationsMeta={{\n source: {\n id: data?.source.id || 0,\n name: data?.source?.name || '',\n logo: data?.source?.logoSmallUri || '',\n },\n destination: {\n id: data?.destination.id || 0,\n name: data?.destination?.name || '',\n logo: data?.destination?.logoSmallUri || '',\n },\n // request uri is the full url, including domain\n requestUri: window.location.href,\n }}\n />\n ) : (\n <div>\n <p>{getInvalidBbuUrlErrors(partnerName).message}</p>\n <p>\n <a\n href={getInvalidBbuUrlErrors(partnerName).link}\n target='_blank'\n rel='noreferrer'\n >\n {getInvalidBbuUrlErrors(partnerName).linkText}\n </a>\n </p>\n </div>\n )\n }\n form={\n canLogin && !noData && formComponent ? (\n <Accordion className={'my-2'}>\n {!loginFormIsInitallyOpen ? (\n <Accordion.Title\n className={'text-secondary text-center'}\n active={showLoginForm}\n index={0}\n onClick={() => setShowLoginForm((state) => !state)}\n >\n <SemanticIcon name='dropdown' />\n Already have an account?\n </Accordion.Title>\n ) : null}\n <Accordion.Content active={showLoginForm}>\n <Segment>{formComponent}</Segment>\n </Accordion.Content>\n </Accordion>\n ) : cognitoUser && !error ? (\n <AlreadyLoggedWrapper>\n <div>\n You are logged as <b>{cognitoUser.attributes.email}</b>\n </div>\n <div>\n (\n <Link\n to={appRoutes.logout.makeUrl({ redirectTo: location.pathname })}\n >\n Not you?\n </Link>\n )\n </div>\n </AlreadyLoggedWrapper>\n ) : null\n }\n links={links}\n />\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { useSelector } from 'react-redux'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { RootState } from '@app/index'\nimport { matchPath, useHistory, useLocation } from 'react-router-dom'\nimport SignInUtilities from '../functions/SignInUtilities'\nimport AuthContainer from '@features/auth/components/AuthContainer'\nimport {\n sendToast,\n setLoginLayout,\n} from '@app/store/actions/ApplicationConfigurationActions'\nimport queryString from 'query-string'\nimport { appRoutes, bridgeByUrlPartnersPaths } from '@app/routes'\nimport { SignInBridgeByUrl } from '@features/auth/bridgeByUrl/SignInBridgeByUrl'\nimport { BbuRouteParams } from 'LeadsBridgeApp'\nimport { BbuPartnersName } from '@app/enums/bridgeByUrl'\n\nimport { Button } from '@components/Basic/Button'\nimport { InputField } from '@components/Form/InputField'\nimport Typography from '@components/Basic/Typography'\nimport { Row, Col } from 'react-grid-system'\nimport { Divider, Icon } from 'semantic-ui-react'\nimport { ButtonProvider } from '@components/ButtonProvider'\nimport { Loader } from '@components/Basic/Loader'\nimport { useTranslation } from 'react-i18next'\nimport { ButtonLoginContainer } from '../components/AuthContainer.styled'\nimport { useGetUserInfo } from '@app/api/getUserInfo'\n\nconst SignIn: React.FC = () => {\n const history = useHistory()\n const location = useLocation()\n const { t } = useTranslation()\n\n const [shouldFetchUserData, setShouldFetchUserData] = useState(false)\n const { data: userData, isLoading: isLoadingUser } =\n useGetUserInfo(shouldFetchUserData)\n\n const [doingLogin, setDoingLogin] = useState<boolean>(false)\n const [loggedIn, setLoggedIn] = useState<boolean>(false)\n const [doingSingin, setDoingSignin] = useState<boolean>(false)\n\n // const dispatch: Dispatch<AppDispatch> = useDispatch();\n const dispatch = useAppDispatch()\n const [email, setEmail] = useState<string>('')\n const [emailError, setEmailError] = useState<string>('')\n const [emailValided, setEmailValided] = useState<boolean>(false)\n\n const [pw, setPw] = useState<string>('')\n const [pwIsVisible, setPwIsVisible] = useState<boolean>(false)\n const [pwError, setPwError] = useState<string>('')\n const [formError, setFormError] = useState<string>('')\n\n const signInUtilities = new SignInUtilities(\n setEmailError,\n setPwError,\n setDoingLogin,\n setLoggedIn,\n dispatch\n )\n const loginLayout: string | null = useSelector(\n (state: RootState) => state.application.loginLayout\n )\n\n const bbuMatchUrl = matchPath<BbuRouteParams>(location.pathname, {\n path: bridgeByUrlPartnersPaths,\n exact: true,\n })\n\n const bbuPartnerName = bbuMatchUrl?.params.partnerName\n const isBbuValidPartnerName =\n bbuPartnerName && Object.values(BbuPartnersName).includes(bbuPartnerName)\n const downgradeStatus = userData?.user.downgradeStatus\n\n useEffect(() => {\n ;/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.+[A-Z]{2,12}$/i.test(email)\n ? setEmailValided(true)\n : setEmailValided(false)\n }, [email])\n\n useEffect(() => {\n if (loggedIn) {\n setShouldFetchUserData(true)\n }\n }, [loggedIn])\n\n useEffect(() => {\n if (!isLoadingUser && userData && downgradeStatus !== 'no') {\n window.location.href = `/pricing?reason=${downgradeStatus}`\n }\n }, [loggedIn])\n\n // Identify what type of login layout we need to display depending on different URL or query string\n useEffect(() => {\n // react router get param\n // leadsbrdige.com/?url\n // const isInBridgeByUrl: boolean = window.location.pathname.includes('bc/fb/')\n\n // example ?type=partner - Deprecated\n const isInPartnerSignIn: boolean =\n queryString.parse(window.location.search).type === 'partner'\n if (isInPartnerSignIn) {\n dispatch(setLoginLayout('partner'))\n return\n }\n\n // example: /bc/fb/facebook-lead-ads/google-sheets\n // example: /bc/tt/souce/dest\n if (bbuMatchUrl && isBbuValidPartnerName) {\n dispatch(setLoginLayout('bridge-by-url'))\n return\n } else if (bbuMatchUrl && !isBbuValidPartnerName) {\n history.push(appRoutes.signin.makeUrl())\n }\n\n // generic login layout\n dispatch(setLoginLayout('generic'))\n }, [])\n\n const handleValidateEmail = () => {\n if (!emailValided) {\n setEmailError('Please enter an email address.')\n }\n return null\n }\n\n const forgotPassword = () => {\n history.push(appRoutes.forgotPassword.makeUrl())\n }\n\n const saml = () => {\n history.push(appRoutes.saml.makeUrl())\n }\n\n const pricing = () => {\n window.location.href = 'https://leadsbridge.com/pricing'\n }\n\n const links = [\n { callback: forgotPassword, label: t('auth.signin.lostPassword') },\n { callback: saml, label: t('auth.signin.withSaml') },\n { callback: pricing, label: t('auth.signin.newAccount') },\n ]\n\n const showGenericError = (message: string) => {\n setDoingSignin(false)\n dispatch(\n sendToast({\n title: 'Error',\n messages: [message],\n color: 'negative',\n })\n )\n }\n\n const formBody = () => {\n return (\n <>\n <InputField\n onFocus={() => setEmailError('')}\n placeholder='Your email'\n value={email}\n autoComplete={'email'}\n name={'email'}\n type='email'\n $hasMargin\n $status={{ error: emailError }}\n label={t('auth.signin.email')}\n onChange={(e) => {\n setEmail(e.target.value)\n setEmailError('')\n }}\n data-testid={'signin-email'}\n />\n <InputField\n $fluid\n $hasMargin\n slotRight={\n pw ? (\n <Icon\n name={pwIsVisible ? 'eye slash' : 'eye'}\n link\n onClick={() => setPwIsVisible((prevState) => !prevState)}\n />\n ) : (\n <></>\n )\n }\n value={pw}\n type={pwIsVisible ? 'text' : 'password'}\n name='password'\n id='password'\n label={t('auth.signin.password')}\n $status={{ error: pwError }}\n autoComplete={'password'}\n // data-lp ignore=\"true\"\n onChange={(e) => {\n setPw(e.target.value)\n handleValidateEmail()\n }}\n placeholder='Your password'\n data-testid={'signin-password'}\n />\n\n {formError !== '' && <p className={'input-error'}>{formError}</p>}\n {loginLayout === 'bridge-by-url' ? (\n <Button\n type={'button'}\n $variant={'link'}\n onClick={() => {\n history.push(appRoutes.forgotPassword.makeUrl())\n }}\n >\n {t('auth.signin.lostPassword')}\n </Button>\n ) : (\n <></>\n )}\n\n <ButtonLoginContainer>\n <Button\n $fluid\n type={'submit'}\n $variant={'secondary'}\n $loading={doingLogin}\n disabled={doingLogin || loggedIn || !emailValided || !pw}\n onClick={() => signInUtilities.handleSignIn(email, pw)}\n data-testid={'signin-submit'}\n >\n {loggedIn ? 'Success' : t('auth.signin.ctaLoginViaEmail')}\n </Button>\n </ButtonLoginContainer>\n </>\n )\n }\n\n const formContainer = () => {\n return (\n <>\n <Row align='center' className={'my-1 form-divider'}>\n <Col>\n <Divider />\n </Col>\n <Col width={'fit-content'} className={'text-secondary text-center'}>\n {loginLayout === 'generic'\n ? 'OR'\n : t('auth.signin.alreadyHaveAnAccount')}\n </Col>\n <Col>\n <Divider />\n </Col>\n </Row>\n {formBody()}\n </>\n )\n }\n\n // Bridge By URL\n if (bbuPartnerName && loginLayout === 'bridge-by-url') {\n return (\n <SignInBridgeByUrl\n partnerName={bbuPartnerName}\n formComponent={formBody()}\n links={links}\n />\n )\n }\n\n // All other loginLayouts\n return (\n <AuthContainer\n header={\n <Typography className={'custom-class-theme'} tagName='h2'>\n Welcome back\n </Typography>\n }\n slot={\n <div style={{ position: 'relative' }}>\n {doingSingin && <Loader $active $dimmer />}\n <ButtonProvider\n provider={'Google'}\n scope={'SignIn'}\n onBeforeAuth={() => {\n setDoingSignin(true)\n }}\n onAuthError={showGenericError}\n />\n <div className={'mt-1'}>\n <ButtonProvider\n dataWidth={350}\n provider={'Facebook'}\n scope={'SignIn'}\n onBeforeAuth={() => {\n setDoingSignin(true)\n }}\n onAuthError={showGenericError}\n />\n </div>\n </div>\n }\n form={formContainer()}\n links={links}\n />\n )\n}\n\nexport default SignIn\n","import React, { forwardRef } from 'react'\nimport { Header, Icon, List } from 'semantic-ui-react'\nimport styled from 'styled-components'\nimport Typography from '@components/Basic/Typography'\n\nconst PasswordHelperStyled = styled.div<{ visible: boolean }>`\n /* This renders the buttons above... Edit me! */\n position: absolute;\n background: white;\n box-sizing: border-box;\n border-radius: 5px;\n box-shadow: 0 2px 2px 0 rgb(0 0 0 / 14%), 0 3px 1px -2px rgb(0 0 0 / 20%),\n 0 1px 5px 0 rgb(0 0 0 / 12%);\n @media screen and (max-width: 720px) {\n box-shadow: 0 -7px 15px 0px rgb(0 0 0 / 10%),\n 0 3px 1px -2px rgb(0 0 0 / 20%), 0 1px 5px 0 rgb(0 0 0 / 12%);\n }\n z-index: 99;\n @media screen and (min-width: 721px) {\n left: calc(100% + 50px);\n top: 0;\n }\n @media screen and (max-width: 720px) {\n left: 0;\n right: 100%;\n top: 80px;\n width: 100%;\n }\n // Animation show/hide ------------\n //display: ${(props) => (props.visible ? 'block' : 'none')};\n opacity: ${(props) => (props.visible ? '1' : '0')};\n width: ${(props) => (props.visible ? 'fit-content' : '0')};\n min-width: ${(props) => (props.visible ? '390px' : '0')};\n max-height: ${(props) => (props.visible ? 'auto' : '0')};\n overflow: ${(props) => (props.visible ? 'visible' : 'hidden')};\n transform: ${(props) =>\n props.visible ? 'translateX(0)' : 'translateX(-5px)'};\n transition: opacity 0.16s ease-out, transform 0.16s ease-out;\n &:after {\n @media screen and (max-width: 720px) {\n content: ' ';\n position: absolute;\n top: 0;\n left: 35px;\n margin-top: -20px;\n border-width: 10px;\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n @media screen and (min-width: 721px) {\n content: ' ';\n position: absolute;\n top: 35px; /* At the bottom of the tooltip */\n left: 0;\n margin-left: -20px;\n border-width: 10px;\n border-style: solid;\n border-color: transparent white transparent transparent;\n }\n }\n ul li {\n padding: 5px 10px;\n transition: all 0.16s ease-out;\n }\n .check {\n color: forestgreen;\n }\n .close {\n color: red;\n }\n ul li.checked span {\n //color: #2ecc71;\n opacity: 0.3;\n text-decoration: line-through;\n transition: all 0.16s ease-out;\n }\n .title {\n margin-top: 1rem !important;\n margin-bottom: 5px;\n }\n`\nconst PasswordHelper = forwardRef(\n (\n props: {\n displayPwHelper: boolean\n validLen: boolean\n validUpperCase: boolean\n validLowercase: boolean\n validDigit: boolean\n validSpecial: boolean\n visible: boolean\n },\n ref\n ) => {\n const dotSVG = (\n <svg\n xmlns='http://www.w3.org/2000/svg'\n width='10'\n height='10'\n viewBox='0 0 24 24'\n >\n <path d='M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12z' />\n </svg>\n )\n // alert(props.visible);\n return (\n <PasswordHelperStyled visible={props.visible}>\n <Typography className={'title mx-1 text-bold'}>\n <Icon name={'shield alternate'} />\n {'Password security rules'.toUpperCase()}\n </Typography>\n <Typography className={'mx-1 text-secondary'}>\n Your password must follow these rules:\n </Typography>\n <ul className={'list list-odd unlisted'}>\n <li className={props.validLen ? 'checked' : ''}>\n <Typography className={'small'}>\n <Icon name={props.validLen ? 'check' : 'close'} />{' '}\n <span>Must be between 8 and 30 characters.</span>\n </Typography>\n </li>\n <li className={props.validUpperCase ? 'checked' : ''}>\n <Typography className={'small'}>\n <Icon name={props.validUpperCase ? 'check' : 'close'} />{' '}\n <span>\n Must contain at least one uppercase, or capital, letter (ex: A,B\n etc.)\n </span>\n </Typography>\n </li>\n <li className={props.validLowercase ? 'checked' : ''}>\n <Typography className={'small'}>\n <Icon name={props.validLowercase ? 'check' : 'close'} />{' '}\n <span>Must contain at least one lowercase letter.</span>\n </Typography>\n </li>\n <li className={props.validDigit ? 'checked' : ''}>\n <Typography className={'small'}>\n <Icon name={props.validDigit ? 'check' : 'close'} />{' '}\n <span>\n Must contain at least one number digit (ex: 0,1,2,3 etc)\n </span>\n </Typography>\n </li>\n <li className={props.validSpecial ? 'checked' : ''}>\n <Typography className={'small'}>\n <Icon name={props.validSpecial ? 'check' : 'close'} />{' '}\n <span>\n Must contain at least one special character <br />\n (ex: $,#,@,!,$,^,&,*,(,),-)\n </span>\n </Typography>\n </li>\n </ul>\n </PasswordHelperStyled>\n )\n }\n)\nexport default PasswordHelper\n","import React, { Dispatch, useEffect, useRef, useState } from 'react'\nimport { Auth } from 'aws-amplify'\nimport { Message, Icon } from 'semantic-ui-react'\nimport PasswordHelper from '../components/PasswordHelper'\nimport AuthContainer from '@features/auth/components/AuthContainer'\nimport Typography from '@components/Basic/Typography'\nimport { getCustomErrorCognitoMessage } from '../../../utils/cognitoErrors'\nimport { Col, Row } from 'react-grid-system'\nimport { Button } from '@components/Basic/Button'\nimport { sendToast } from '../../../store/actions/ApplicationConfigurationActions'\nimport { useDispatch } from 'react-redux'\nimport { useHistory, useLocation } from 'react-router-dom'\nimport { appRoutes } from '@app/routes'\nimport { InputField } from '@components/Form/InputField'\nimport { Trans, useTranslation } from 'react-i18next'\n\ninterface FormStatus {\n type: string\n message: string\n}\n\nconst LostPassword: React.FC = () => {\n const dispatch: Dispatch<any> = useDispatch()\n const { t } = useTranslation()\n const [formError, setFormError] = useState<string>('')\n const [formStatus, setFormStatus] = useState<FormStatus | null>()\n const [formEmailStatus, setFormEmailStatus] = useState<FormStatus | null>()\n const [formCodeStatus, setFormCodeStatus] = useState<FormStatus | null>()\n const [doingReset, setDoingReset] = useState<boolean>(false)\n\n const [email, setEmail] = useState<string>('')\n const [emailValidated, setEmailValidated] = useState<boolean>(false)\n const [emailSent, setEmailSent] = useState<boolean>(false)\n const [resetCode, setResetCode] = useState<boolean>(false)\n\n const [form2Error, setForm2Error] = useState<string>('')\n const [verificationCode, setVerificationCode] = useState<string>('')\n const [verificationCodeError, setVerificationCodeError] =\n useState<boolean>(false)\n const [newPassword, setNewPassword] = useState<string>('')\n const [newPasswordConfirmation, setNewPasswordConfirmation] =\n useState<string>('')\n const [doingReset2, setDoingReset2] = useState<boolean>(false)\n const [newPasswordIsValid, setNewPasswordIsValid] = useState<boolean>(false)\n const [passwordError, setPasswordError] = useState<string>('')\n\n const [validLen, setValidLen] = useState<boolean>(false)\n const [validUpperCase, setValidUppercase] = useState<boolean>(false)\n const [validLowercase, setValidLowercase] = useState<boolean>(false)\n const [validDigit, setValidDigit] = useState<boolean>(false)\n const [validSpecial, setValidSpecial] = useState<boolean>(false)\n const [displayPwHelper, setDisplayPwHelper] = useState<boolean>(false)\n\n const [pwIsVisible, setPwIsVisible] = useState<boolean>(false)\n const [activeIndex, setActiveIndex] = useState<number>(0)\n\n const history = useHistory()\n const location = useLocation()\n // keep `redirectTo` query string param alive when users goes back to signin page\n const redirectToQueryString = location.search?.includes('redirectTo=')\n ? location.search\n : ''\n\n useEffect(() => {\n if (newPassword.length > 0) {\n setValidDigit(new RegExp(/\\d/).test(newPassword))\n setValidUppercase(new RegExp(/[A-Z]/).test(newPassword))\n setValidLowercase(new RegExp(/[a-z]/).test(newPassword))\n setValidSpecial(new RegExp(/\\W/).test(newPassword))\n setValidLen(newPassword.length > 7 && newPassword.length < 31)\n } else {\n setValidDigit(false)\n setValidUppercase(false)\n setValidLowercase(false)\n setValidSpecial(false)\n setValidLen(false)\n\n setDisplayPwHelper(false)\n }\n if (\n !validDigit ||\n !validUpperCase ||\n !validLowercase ||\n !validSpecial ||\n !validLen\n ) {\n setDisplayPwHelper(true)\n }\n }, [newPassword])\n\n useEffect(() => {\n setFormStatus(null)\n // handleCheckNewPasswordValid();\n if (newPassword.length !== newPasswordConfirmation.length) {\n setNewPasswordIsValid(false)\n } else {\n setNewPasswordIsValid(true)\n }\n }, [newPassword, newPasswordConfirmation])\n\n useEffect(() => {\n ;/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,12}$/i.test(email)\n ? setEmailValidated(true)\n : setEmailValidated(false)\n }, [email])\n\n useEffect(() => {\n setVerificationCodeError(false)\n if (verificationCode.length == 6) {\n setResetCode(true)\n } else if (verificationCode.length > 6) {\n setVerificationCode(verificationCode.slice(0, 6))\n } else {\n setResetCode(false)\n }\n }, [verificationCode])\n\n const handleCheckNewPasswordValid = () => {\n if (\n !validDigit ||\n !validUpperCase ||\n !validLowercase ||\n !validSpecial ||\n !validLen\n ) {\n setDisplayPwHelper(true)\n // alert('true');\n // console.log('checking');\n return true\n }\n setDisplayPwHelper(false)\n return false\n }\n const abortResetPwdFlow = () => {\n setActiveIndex(0)\n setFormEmailStatus(null)\n setEmailSent(false)\n setVerificationCode('')\n setNewPassword('')\n setNewPasswordConfirmation('')\n }\n const handleValidateCode = (event: any) => {\n const value = event.target.value\n setVerificationCode(value)\n setFormEmailStatus(null)\n if (value.length == 6) {\n setResetCode(true)\n // setDoingReset2(true);\n } else {\n setResetCode(false)\n }\n }\n const handleGetVerificationCode = () => {\n setEmailSent(false)\n if (emailValidated) {\n setDoingReset(true)\n setVerificationCode('')\n Auth.forgotPassword(email)\n .then((res) => {\n // console.log(res);\n setEmailSent(true)\n setFormEmailStatus({\n type: 'success',\n message: 'Code has been sent! Check your inbox.',\n })\n })\n .catch((err) => {\n /* error Mock by Cognito\n {\n \"code\": \"UserNotFoundException\",\n \"name\": \"UserNotFoundException\",\n \"message\": \"Username/client id combination not found.\"\n }\n */\n setFormEmailStatus({\n type: 'error',\n message: getCustomErrorCognitoMessage(err),\n })\n })\n .finally(() => {\n setDoingReset(false)\n })\n } else {\n // setFormError('Check the Email');\n setFormEmailStatus({\n type: 'error',\n message: 'Code has been sent! Check your inbox.',\n })\n }\n }\n\n const confirmReset = () => {\n if (newPassword !== newPasswordConfirmation) {\n setFormStatus({\n type: 'error',\n message: \"ERROR: Passwords doesn't match!\",\n })\n return\n }\n if (\n !validDigit ||\n !validUpperCase ||\n !validLowercase ||\n !validSpecial ||\n !validLen\n ) {\n // setFormStatus({'type':'error','message':'Passwords do not match!'});\n setNewPasswordIsValid(false)\n setDoingReset2(false)\n return\n }\n setNewPasswordIsValid(true)\n setDoingReset2(true)\n\n Auth.forgotPasswordSubmit(email, verificationCode, newPassword)\n .then((res) => {\n history.push(appRoutes.signin.makeUrl())\n dispatch(\n sendToast({\n title: 'Success',\n message: 'Password restored',\n color: 'positive',\n })\n )\n })\n .catch((err) => {\n // console.log('err resp',err.message, err);\n // dispatch(sendToast({title: 'Error', message: 'Login falied', color: 'negative'}));\n // setFormStatus({type:'error', message:err.message});\n switch (err.code) {\n case 'CodeMismatchException':\n const verificationCodeBackup = verificationCode\n abortResetPwdFlow()\n dispatch(\n sendToast({\n title: 'Error',\n message: err.message,\n color: 'negative',\n })\n )\n setVerificationCode(verificationCodeBackup)\n setEmailSent(true)\n setVerificationCodeError(true)\n break\n default:\n dispatch(\n sendToast({\n title: 'Error',\n message: err.message,\n color: 'negative',\n })\n )\n abortResetPwdFlow()\n break\n }\n })\n .finally(() => {\n setDoingReset2(false)\n })\n }\n const switchComponent = () => {\n setActiveIndex(1)\n setEmailSent(false)\n }\n\n const headlineStep = () => {\n switch (activeIndex) {\n case 0:\n // return LangSignIn.buttons.steps.step0;\n return 'Recover your password'\n case 1:\n return 'Recover your password'\n }\n }\n\n const descriptionStep = () => {\n switch (activeIndex) {\n /* steps: {\n step0: 'Get the authentication code to be able to reset your password',\n step1: 'Go next 1',\n }\n */\n case 0:\n return 'Get the verification code to be able to reset your password'\n case 1:\n return 'Create a new password following the validation rules'\n }\n }\n\n return (\n <>\n <AuthContainer\n header={\n <>\n <Typography className={'custom-class-theme'} tagName='h2'>\n {headlineStep()}\n </Typography>\n <Typography className={'text-secondary'}>\n {descriptionStep()}\n </Typography>\n </>\n }\n form={\n <>\n <>\n {\n // 1. email\n // 1.2 code review + resend link\n // Se codice quello giusto:\n // New password (with strong password check)\n // COnfirm password + Save new passowrd\n }\n {activeIndex === 0 && (\n <>\n {/* Email + get the code button */}\n {/* TODO: creare animazione per il \"code sent\" */}\n <InputField\n name={'email'}\n disabled={!(verificationCode.length < 1)}\n value={email}\n type={'email'}\n placeholder='Your email'\n label='Insert your account email'\n $hasMargin\n onFocus={() => setFormError('')}\n onChange={(e) => {\n setEmail(e.target.value)\n setFormError('')\n }}\n $status={{\n error:\n (formEmailStatus?.type === 'error' &&\n formEmailStatus?.message) ||\n undefined,\n success:\n (formEmailStatus?.type === 'success' &&\n formEmailStatus?.message) ||\n undefined,\n }}\n slotRight={\n <Button\n onClick={() => handleGetVerificationCode()}\n disabled={!emailValidated}\n $loading={doingReset}\n >\n {!emailSent ? 'Get the code' : 'Resend the code'}\n </Button>\n }\n />\n\n {/* Code review */}\n <InputField\n name={'code'}\n type={'number'}\n $fluid\n $hasMargin\n label={'Type the six-digit verification code'}\n $status={{\n error:\n (formCodeStatus?.type === 'error' &&\n formCodeStatus?.message) ||\n undefined,\n }}\n onFocus={() => {\n setFormCodeStatus(null)\n }}\n disabled={!emailSent}\n placeholder={'000000'}\n value={verificationCode}\n onChange={(event) => handleValidateCode(event)}\n />\n\n <Button\n $variant={'primary'}\n $fluid\n disabled={!resetCode}\n // $loading={!!(verificationCode && emailSent)}\n // handleReset()\n onClick={() => switchComponent()}\n >\n {t('auth.signin.ctaResetPassword')}\n </Button>\n </>\n )}\n\n {activeIndex === 1 && (\n <>\n <InputField\n name={'new-password'}\n type={pwIsVisible ? 'text' : 'password'}\n label={'New password'}\n $fluid\n $hasMargin\n slotRight={\n <Icon\n name={pwIsVisible ? 'eye slash' : 'eye'}\n link\n onClick={() =>\n setPwIsVisible((prevState) => !prevState)\n }\n />\n }\n $status={{ error: passwordError }}\n placeholder={'Insert here a new password'}\n onBlur={() => {\n handleCheckNewPasswordValid()\n }}\n value={newPassword}\n onChange={(e) => setNewPassword(e.target.value)}\n autoComplete='off'\n onFocus={() => {\n setPasswordError('')\n handleCheckNewPasswordValid()\n }}\n />\n <PasswordHelper\n displayPwHelper={displayPwHelper}\n validLen={validLen}\n validUpperCase={validUpperCase}\n validLowercase={validLowercase}\n validDigit={validDigit}\n validSpecial={validSpecial}\n visible={displayPwHelper}\n />\n\n <InputField\n name={'confirm-password'}\n type={pwIsVisible ? 'text' : 'password'}\n label={'Confirm new password'}\n $fluid\n $hasMargin\n slotRight={\n <Icon\n name={pwIsVisible ? 'eye slash' : 'eye'}\n link\n onClick={() =>\n setPwIsVisible((prevState) => !prevState)\n }\n />\n }\n $status={{ error: passwordError }}\n autoComplete='off'\n onFocus={() => {\n setPasswordError('')\n }}\n placeholder={'Confirm the new password'}\n onBlur={() => {}}\n value={newPasswordConfirmation}\n onChange={(e) => setNewPasswordConfirmation(e.target.value)}\n />\n\n <Message\n style={{ marginTop: '40px' }}\n success\n content={'Password updated successfully'}\n />\n <Message\n style={{ marginTop: '40px' }}\n error\n content={formError}\n />\n {formStatus?.message !== '' && (\n <Typography className={`input-${formStatus?.type}`}>\n {formStatus?.message}\n </Typography>\n )}\n\n <Button\n $variant={'primary'}\n $fluid\n $loading={doingReset2}\n disabled={!newPasswordIsValid || doingReset2}\n onClick={() => confirmReset()}\n >\n Create new password\n </Button>\n\n {/*\n <ThemedButton fluid onClick={() => backComponent()} style={{\n padding: '0',\n height: '36px',\n background: '#22A7F0',\n fontStyle: 'normal',\n fontWeight: 600,\n fontSize: '14px',\n lineHeight: '21px',\n marginTop: '28px',\n }}>\n <Icon name={'arrow left'}/>\n Back\n </ThemedButton>\n */}\n </>\n )}\n </>\n\n <Row>\n <Col className={'text-center my-1'}>\n <Typography\n className={'text-link'}\n onClick={() => {\n abortResetPwdFlow()\n\n history.push(appRoutes.signin.makeUrl())\n\n // resetting url path manually handled in AuthContainer component\n // and keeping existing query string in url (to handke redirections)\n history.push(\n appRoutes.signin.makeUrl() + redirectToQueryString\n )\n }}\n >\n Go back to login page\n </Typography>\n <div\n style={{\n marginTop: '2rem',\n fontSize: '.9rem',\n }}\n >\n <Trans\n i18nKey={'auth.signin.lostPasswordHelp'}\n components={{ a: <a /> }}\n />\n </div>\n </Col>\n </Row>\n </>\n }\n links={[]}\n />\n </>\n )\n}\nexport default LostPassword\n","import * as yup from 'yup'\n\ntype ChangePasswordTypes = {\n oldPassword: string\n newPassword: string\n confirmPassword: string\n}\n\nexport const validationSchema = yup.object().shape({\n oldPassword: yup.string().required('Required'),\n newPassword: yup\n .string()\n .min(8, 'At least 8 char')\n .matches(/.*[a-z].*/, 'At least one lowercase')\n .matches(/.*[A-Z].*/, 'At least one uppercase')\n .matches(/.*[0-9].*/, 'At least one number digit')\n .matches(/.*[^A-Za-z0-9].*/, 'At least one special character'),\n confirmPassword: yup\n .string()\n .oneOf([yup.ref('newPassword'), null], \"Passwords don't match\")\n .required('Required'), // NOTE: If changed, we need to change it also in CustomInputError.tsx\n})\n\nexport const initialFormValues: ChangePasswordTypes = {\n oldPassword: '',\n newPassword: '',\n confirmPassword: '',\n}\n","import React, { useEffect, useState } from 'react'\nimport styled from 'styled-components'\n\ninterface Props {\n errors: string[]\n}\n\nconst UlErrorStyled = styled.ul`\n text-align: left;\n font-size: 0.9rem;\n list-style: none;\n padding: 0;\n margin-top: 0.5rem;\n`\n\nconst LiErrorStyled = styled.li<{ isChecked?: boolean }>`\n color: ${({ isChecked }) => (isChecked ? '#0c783a' : '#cc2029')};\n display: flex;\n line-height: 1.3;\n\n &:before {\n content: ${({ isChecked }) => (isChecked ? \"'✓'\" : \"'ð„‚'\")};\n display: inline-block;\n line-height: 1.1;\n padding-left: 0.1rem;\n width: 1.2rem;\n }\n`\n\nexport const CustomInputError: React.FC<Props> = ({ errors }) => {\n const [errorsCopy, setErrorsCopy] = useState<string[]>()\n\n useEffect(() => {\n setErrorsCopy(errors)\n }, [])\n\n return (\n <div>\n <UlErrorStyled>\n {errorsCopy?.map((error, idx) => {\n const isChecked = !errors.includes(error)\n // displays only the errors in the array that do NOT include the 'Required' string.\n // If we did not do this, we would see Required in the list of errors, repeated multiple times.\n // if in the future we will change the 'Required' message in formConfig.ts, we will need to change it here as well.\n const isRequired = error.includes('Required')\n if (!isRequired) {\n return (\n <LiErrorStyled isChecked={isChecked} key={idx}>\n {error}\n </LiErrorStyled>\n )\n } else {\n return null\n }\n })}\n </UlErrorStyled>\n </div>\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { Auth } from 'aws-amplify'\nimport {\n AUTH_STATE_CHANGE_EVENT,\n AuthState,\n CognitoUserInterface,\n UI_AUTH_CHANNEL,\n} from '@aws-amplify/ui-components'\nimport { Hub, HubCapsule } from '@aws-amplify/core'\nimport { sendToast } from '../../../../store/actions/ApplicationConfigurationActions'\nimport { Formik, Form } from 'formik'\nimport AuthContainer from '@features/auth/components/AuthContainer'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport {\n initialFormValues,\n validationSchema,\n} from '@features/auth/slots/ChangePassword/formConfig'\nimport {\n HeaderStyled,\n ButtonGoBackStyled,\n FooterStyled,\n InputFieldStyled,\n InputWrapperStyled,\n} from './styled'\nimport { CustomInputError } from './CustomInputError'\nimport { ImEye, ImEyeBlocked } from 'react-icons/im'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { useTranslation } from 'react-i18next'\nimport { useHistory } from 'react-router-dom'\nimport { GlobalLoginStyle } from '@features/auth/components/AuthContainer.styled'\nimport { appRoutes } from '@app/routes'\n\nconst ChangePassword: React.FC = () => {\n const [user, setUser] = React.useState<CognitoUserInterface | undefined>()\n const [newPasswordErrors, setNewPasswordErrors] = useState([])\n const [showPwRules, setShowPwRules] = useState(false)\n const [pwIsVisible, setPwIsVisible] = useState({\n oldPassword: false,\n newPassword: false,\n confirmPassword: false,\n })\n const dispatch = useAppDispatch()\n const { t } = useTranslation()\n const history = useHistory()\n\n const [doingReset, setDoingReset] = useState<boolean>(false)\n\n const HandleShowPassword = (name: string) => {\n setPwIsVisible((prevState) => {\n // @ts-ignore\n return { ...pwIsVisible, [name]: !prevState[name] }\n })\n }\n\n useEffect(() => {\n let subscribed = true\n Hub.listen(UI_AUTH_CHANNEL, (data: HubCapsule) => {\n if (subscribed && data.payload && data.payload.data) {\n if (data.payload.data && data.payload.data.username) {\n setUser(data.payload.data)\n }\n }\n })\n return () => {\n subscribed = false\n }\n }, [])\n\n useEffect(() => {\n let subscribed = true\n Auth.currentAuthenticatedUser()\n .then((res) => {\n if (subscribed && res && res.username) {\n setUser(res)\n }\n })\n .catch((err) => {\n // console.log('err', err);\n })\n return () => {\n subscribed = false\n }\n }, [])\n\n const handleReset = (oldPassword: string, newPassword: string) => {\n if (!user) {\n Hub.dispatch(UI_AUTH_CHANNEL, {\n event: AUTH_STATE_CHANGE_EVENT,\n message: AuthState.SignIn,\n data: null,\n })\n }\n\n setDoingReset(true)\n\n Auth.changePassword(user, oldPassword, newPassword)\n .then(() => {\n dispatch(\n sendToast({\n title: 'Success',\n messages: ['Password successfully updated!'],\n color: 'positive',\n })\n )\n Auth.signOut({ global: true })\n .then(() => {\n history.push(appRoutes.logout.makeUrl({ redirectTo: '' }))\n })\n .catch((err) => {\n console.log(err)\n })\n })\n .catch(() => {\n dispatch(\n sendToast({\n title: 'Error',\n message: t('auth.changePassword.passwordError'),\n color: 'negative',\n })\n )\n })\n .finally(() => {\n setDoingReset(false)\n })\n }\n\n const fullValidatorForSchema = (schema: any) => (values: any) =>\n schema\n .validate(values, {\n abortEarly: false,\n strict: false,\n })\n .then(() => setNewPasswordErrors([]))\n .catch((error: any) => {\n setNewPasswordErrors(error.errors)\n setShowPwRules(true)\n })\n\n const EyeIcon = (name: string) => {\n // @ts-ignore\n return !pwIsVisible[name] ? (\n <ImEyeBlocked\n cursor={'pointer'}\n onClick={() => HandleShowPassword(name)}\n />\n ) : (\n <ImEye cursor={'pointer'} onClick={() => HandleShowPassword(name)} />\n )\n }\n\n return (\n <>\n <GlobalLoginStyle />\n <AuthContainer\n isFormik\n header={<HeaderStyled>{t('auth.changePassword.title')}</HeaderStyled>}\n form={\n <Formik\n data-testid={'change-password-form'}\n initialValues={initialFormValues}\n validationSchema={validationSchema}\n validate={fullValidatorForSchema(validationSchema)}\n validateOnMount\n onSubmit={(values) => {\n if (values.oldPassword === values.newPassword) {\n dispatch(\n sendToast({\n title: 'Error',\n message: t('auth.changePassword.equalPassword'),\n color: 'negative',\n })\n )\n } else {\n handleReset(values.oldPassword, values.newPassword)\n }\n }}\n >\n {({ isValid, values, getFieldProps, errors }) => {\n const passWordsMatch =\n isValid && values.newPassword === values.confirmPassword\n return (\n <Form>\n <InputWrapperStyled>\n <InputFieldStyled\n name={'oldPassword'}\n type={pwIsVisible.oldPassword ? 'text' : 'password'}\n label={'Old password'}\n $hasMargin\n slotRight={\n values.oldPassword\n ? EyeIcon(getFieldProps('oldPassword').name)\n : null\n }\n />\n </InputWrapperStyled>\n <InputWrapperStyled>\n <InputFieldStyled\n name={'newPassword'}\n type={pwIsVisible.newPassword ? 'text' : 'password'}\n label={'New password'}\n $isMatch={passWordsMatch}\n $hasMargin\n slotRight={\n values.newPassword\n ? EyeIcon(getFieldProps('newPassword').name)\n : null\n }\n />\n {errors.newPassword ? (errors.newPassword = '') : null}\n {newPasswordErrors.length || showPwRules ? (\n <CustomInputError errors={newPasswordErrors} />\n ) : null}\n </InputWrapperStyled>\n <InputWrapperStyled>\n <InputFieldStyled\n name={'confirmPassword'}\n type={pwIsVisible.confirmPassword ? 'text' : 'password'}\n label={'Confirm password'}\n $isMatch={passWordsMatch}\n $hasMargin\n slotRight={\n values.confirmPassword\n ? EyeIcon(getFieldProps('confirmPassword').name)\n : null\n }\n />\n </InputWrapperStyled>\n <Button\n type={'submit'}\n style={{ marginTop: '.2rem' }}\n $variant={'primary'}\n $loading={doingReset}\n disabled={!isValid}\n $fluid\n >\n {t('auth.changePassword.ctaSubmit')}\n </Button>\n <FooterStyled>\n <a href={`${process.env.REACT_APP_V1_URL}/app/profile`}>\n <ButtonGoBackStyled\n type={'button'}\n $variant={'link-secondary'}\n >\n {t('common.goBack')}\n </ButtonGoBackStyled>\n </a>\n </FooterStyled>\n </Form>\n )\n }}\n </Formik>\n }\n />\n </>\n )\n}\n\nexport default ChangePassword\n","import React from 'react'\nimport SignIn from './slots/SignIn'\nimport LostPassword from './slots/LostPassword'\nimport { Route, Switch } from 'react-router-dom'\nimport { appRoutes } from '@app/routes'\nimport ChangePassword from '@features/auth/slots/ChangePassword/ChangePassword'\n\nexport const AuthRouter: React.FC = () => {\n return (\n <div className={'auth-slot-container'}>\n <div className={'login-slot'}>\n <Switch>\n <Route\n path={appRoutes.changePassword.makUrl()}\n component={ChangePassword}\n />\n <Route\n path={appRoutes.forgotPassword.makeUrl()}\n component={LostPassword}\n />\n <Route component={SignIn} />\n </Switch>\n </div>\n </div>\n )\n}\n","import styled, { createGlobalStyle, css } from 'styled-components'\nimport { mediaIframeOnly } from '@app/styles/iframeUtils'\n\ninterface BackgroundProps {\n backgroundUrl?: string\n}\nexport const AuthBackgroundStyled = styled.div<BackgroundProps>`\n background-image: ${(props) => `url(\"${props.backgroundUrl}\")`};\n width: 100%;\n background-size: 90%;\n background-repeat: no-repeat;\n background-position: center center;\n @media screen and (max-width: 801px) {\n background-image: none;\n }\n\n ${mediaIframeOnly(css`\n display: flex;\n align-items: center;\n min-height: 100vh;\n `)}\n\n &::after {\n background-color: #23278a;\n mix-blend-mode: lighten;\n }\n`\n\nexport const ButtonLoginContainer = styled.div`\n margin-top: 2rem;\n @media screen and (max-height: 695px) {\n margin-top: 15px !important;\n margin-bottom: 5px !important;\n }\n`\nexport const GlobalLoginStyle = createGlobalStyle`\n div[hidden] {\n display: none!important;\n }\n \n .auth-container{\n margin: 0 !important;\n width: 100% !important;\n }\n \n amplify-authenticator,\n .auth-slot-container {\n --container-display: block !important;\n .auth-container{\n display: block !important;\n }\n \n .login-slot,\n [slot=\"sign-in\"],\n [slot=\"forgot-password\"],\n [slot=\"require-new-password\"],\n [slot=\"confirm-sign-in\"] {\n background: linear-gradient(128deg, #0095C7 32.52%, #0083AF 109.23%);\n min-height: calc(100vh);\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n \n @media screen and (max-width: 900px) and (min-width: 800px) {\n .resource-wrapper{\n min-width: auto;\n max-width: 44% !important;\n }\n }\n /* Avoid scroll bar */\n @media screen and (max-height: 695px) {\n .sign-in-form__wrapper{\n min-height: 400px !important;\n }\n .sign-in-form__body {\n & div[type]{\n margin-top: 5px !important;\n margin-bottom: 5px !important;\n }\n }\n .sign-in-form__head .divider{\n margin: 0 !important;\n }\n .sign-in-form__head img{\n width: 100px;\n }\n #form-login-button{\n margin: 0 !important;\n }\n .sign-in-form__footer{\n margin-top: 0 !important;\n & > div{\n padding: 0;\n }\n }\n .form-divider{\n margin: 0 !important;\n }\n }\n @media screen and (max-width: 800px) {\n .resource-wrapper{\n min-width: 460px;\n }\n .login-slot,\n [slot=\"sign-in\"],\n [slot=\"forgot-password\"] {\n padding: 0;\n min-height: auto;\n background: white;\n }\n }\n }\n`\n","import styled, { css } from 'styled-components'\nimport { mediaIframeOnly } from '@app/styles/iframeUtils'\n\nexport const SignInForm = styled.div`\n height: 100%;\n padding: 1em;\n\n .sign-in-form {\n &__wrapper {\n width: 100%;\n min-height: 600px;\n padding: 1rem 2rem 0.5rem 2rem;\n background: #ffffff;\n box-shadow: 0 2px 2px 0 rgb(0 0 0 / 14%), 0 3px 1px -2px rgb(0 0 0 / 20%),\n 0 1px 5px 0 rgb(0 0 0 / 12%);\n border-radius: 20px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n @media screen and (min-width: 721px) {\n min-width: 423px;\n }\n @media screen and (max-width: 720px) {\n padding: 0;\n min-height: auto;\n box-shadow: none;\n }\n\n ${mediaIframeOnly(css`\n padding: 0 2rem;\n `)}\n }\n &__head {\n width: 100%;\n img {\n margin: 1rem auto;\n }\n }\n &__body {\n width: 100%;\n .my-2 {\n margin-top: 1em;\n }\n }\n &__footer {\n margin-top: 1rem;\n & p {\n cursor: pointer;\n opacity: 0.8;\n &:hover {\n text-decoration: underline;\n opacity: 1;\n }\n }\n .ui.grid > .column:not(.row),\n .ui.grid > .row > .column {\n padding-left: 0;\n padding-right: 0;\n text-align: center;\n }\n }\n }\n`\n","import brandLogo from '@assets/images/logo_lb_extended.svg'\nimport { Image } from 'semantic-ui-react'\nimport React from 'react'\n\ninterface Props {\n width?: number\n className?: string\n}\nconst BrandLogo: React.FC<Props> = (props) => {\n return (\n <>\n <Image\n className={props?.className}\n width={props?.width}\n src={brandLogo}\n alt={'LeadsBridge Brand Logo'}\n />\n <img\n src='https://d21y75miwcfqoq.cloudfront.net/37f55128'\n style={{ position: 'absolute' }}\n referrerPolicy='no-referrer-when-downgrade'\n alt={'Logo'}\n />\n </>\n )\n}\nexport default BrandLogo\n","import React from 'react'\nimport Typography from '@components/Basic/Typography'\nimport styled from 'styled-components'\nimport { Icon } from 'semantic-ui-react'\nimport { Col, Row } from 'react-grid-system'\n\nexport const LinkDivisor = styled.div`\n color: rgb(255 255 255 / 12%);\n @media screen and (max-width: 992px) {\n display: none;\n }\n`\nexport const NavStyled = styled(Row)`\n @media screen and (min-width: 992px) {\n display: flex;\n justify-content: center;\n }\n\n padding: 0;\n`\nexport const LinkStyled = styled.a`\n color: white;\n cursor: pointer;\n text-align: center;\n margin-left: 10px;\n margin-right: 10px;\n opacity: 0.7;\n font-size: small;\n &:hover {\n color: white;\n opacity: 1;\n text-decoration: underline;\n }\n`\nexport const Divisor = styled.div`\n width: 100%;\n border-bottom: 2px solid rgb(255 255 255 / 12%);\n margin: 20px 0;\n`\nexport const BadgeStyled = styled(Col)`\n display: flex;\n flex-wrap: nowrap;\n img {\n max-width: 100%;\n height: auto;\n }\n`\nexport const FooterStyled = styled.div`\n text-align: right;\n justify-content: flex-end;\n align-items: center;\n img {\n height: 45px;\n margin-left: 10px;\n }\n`\n\nexport const ImageStyled = styled.img`\n max-width: 400px;\n`\n\nexport const ClaimLoginStyled = styled.div`\n h2,\n p {\n color: white;\n }\n`\nconst ClaimLogin: React.FC = () => {\n return (\n <ClaimLoginStyled className={'text-center '}>\n <Typography tagName={'h2'}>\n Let Facebook, Google and LinkedIn communicate with your CRM\n </Typography>\n <Typography>\n We offer you over 380 integrations and tailor-made solutions, depending\n on your needs. Our experts are ready to make it happen.\n </Typography>\n <ImageStyled\n src={\n 'https://leadsbridge.s3-us-west-2.amazonaws.com/assets/img/logos/leadsbridge-tools-sync.png'\n }\n width={'100%'}\n />\n <Divisor />\n <FooterStyled>\n <Row align={'center'} justify={'end'}>\n <Col sm={12} md={5} lg={6}>\n <NavStyled nogutter={true}>\n <LinkStyled\n href={'https://leadsbridge.com/tos/'}\n target={'_blank'}\n >\n Terms of Service\n </LinkStyled>\n <LinkDivisor>•</LinkDivisor>\n <LinkStyled\n href={'https://leadsbridge.com/contact-us/'}\n target={'_blank'}\n >\n Contact us\n </LinkStyled>\n </NavStyled>\n </Col>\n <BadgeStyled sm={12} md={7} lg={6}>\n <img\n src={\n 'https://leadsbridge.com/wp-content/themes/leadsbridge/img/fb-official-partner.jpg'\n }\n />\n <img\n src={\n 'https://www.gstatic.com/partners/badge/images/PremierBadge.png'\n }\n />\n </BadgeStyled>\n </Row>\n </FooterStyled>\n </ClaimLoginStyled>\n )\n}\n\nexport default ClaimLogin\n","import React from 'react'\nimport { Col, Hidden, Row } from 'react-grid-system'\nimport Typography from '@components/Basic/Typography'\nimport { Button, Icon } from 'semantic-ui-react'\nimport styled from 'styled-components'\ninterface ResourceItemProps {\n type: string\n head: string\n title: string\n text: string\n buttonLink: string\n buttonLabel: string\n icon?: string\n divisor?: boolean\n}\nexport const IconStyled = styled(Icon)`\n margin-right: 0 !important;\n`\nexport const Text = styled(Typography)`\n opacity: 0.6;\n`\nexport const Title = styled(Typography)`\n font-size: 21px !important;\n margin-top: 1.2rem !important;\n a {\n color: white;\n &:hover {\n color: white;\n opacity: 0.8;\n }\n }\n`\nexport const ButtonLink = styled(Button)`\n color: white;\n white-space: nowrap;\n &:hover {\n color: white;\n opacity: 0.8;\n transition: all 0.16s ease;\n }\n`\nexport const Head = styled(Typography)`\n span {\n opacity: 0.4;\n }\n`\nexport const ResourceItemStyled__Icon = styled('div')`\n background-color: rgba(255, 255, 255, 0.2);\n padding: 1rem;\n width: 70px;\n height: 70px;\n margin: 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 10px;\n`\nexport const ResourceItemStyled = styled('div')`\n color: white;\n\n &.divisor {\n padding-bottom: 3rem;\n border-bottom: 2px dashed rgb(255 255 255 / 12%);\n margin-bottom: 3rem;\n /* Avoid scroll bar */\n @media screen and (max-height: 695px) {\n margin-bottom: 2rem;\n padding-bottom: 0.5rem;\n }\n }\n\n /* Avoid scroll bar */\n h6 {\n @media screen and (max-height: 585px) and (max-width: 895px) {\n font-size: smaller;\n letter-spacing: 1.2px;\n }\n }\n h4 {\n font-weight: 400 !important;\n @media screen and (max-height: 695px) {\n font-size: small;\n letter-spacing: normal;\n }\n @media screen and (max-height: 585px) and (max-width: 895px) {\n font-size: smaller;\n line-height: 1.3;\n }\n }\n`\nconst ResourceItem: React.FC<ResourceItemProps> = ({ ...props }) => {\n const head = props.head.split('/')\n\n const icon = () => {\n switch (props.type) {\n case 'blog':\n return 'bookmark outline'\n case 'whitepaper':\n return 'book'\n default:\n return 'bolt'\n }\n }\n\n return (\n <ResourceItemStyled className={props.divisor ? 'divisor' : ''}>\n <Row>\n <Hidden xs sm md>\n <Col xs={0} lg={2}>\n <ResourceItemStyled__Icon>\n <IconStyled name={icon()} />\n </ResourceItemStyled__Icon>\n </Col>\n </Hidden>\n <Col xs={12} sm={12} lg={10}>\n <Row align='center' nogutter={true}>\n <Col xs={6} md={7}>\n <Head tagName={'h6'}>\n {`${head[0]} /`}\n <span>{head[1]}</span>\n </Head>\n </Col>\n <Col xs={6} md={5} className={'text-right'}>\n <Button\n href={props.buttonLink}\n target='_blank'\n size='tiny'\n content={props.buttonLabel}\n icon='right arrow'\n labelPosition='right'\n inverted\n basic\n />\n </Col>\n </Row>\n <Title tagName={'h4'}>\n <a target='_blank' href={props.buttonLink} rel='noreferrer'>\n {props.title}\n </a>\n </Title>\n </Col>\n </Row>\n </ResourceItemStyled>\n )\n}\nexport default ResourceItem\n","import React, { forwardRef } from 'react'\nimport { AuthState } from '@aws-amplify/ui-components'\nimport { Col, Container, Hidden, Row } from 'react-grid-system'\nimport { SignInForm } from './SignInForm.styled'\nimport BrandLogo from '@components/Basic/BrandLogo'\nimport { Divider, Form } from 'semantic-ui-react'\nimport Typography from '@components/Basic/Typography'\nimport SignInUtilities from '../functions/SignInUtilities'\nimport ClaimLogin from '../slots/ClaimLogin'\nimport ResourceItem from '@features/auth/components/ResourceItem'\nimport { useSelector } from 'react-redux'\nimport { RootState } from '@app/index'\nimport { AuthBackgroundStyled } from './AuthContainer.styled'\nimport { Loader } from '@components/Basic/Loader'\n\nexport type AuthContainerLinks = {\n label: string\n data?: any\n callback?: any\n message?: AuthState\n}[]\n\nconst AuthContainer = forwardRef(\n (\n props: {\n header: any\n form: any\n isFormik?: boolean\n loading?: boolean\n formStatus?: { error?: boolean; success?: boolean }\n slot?: any\n links?: AuthContainerLinks\n onSubmit?: () => void\n },\n ref\n ) => {\n const loginLayout: string | null = useSelector(\n (state: RootState) => state.application.loginLayout\n )\n\n const rightSide = () => {\n switch (loginLayout) {\n case 'partner':\n return (\n <Hidden xs md sm>\n {/* <Hidden > */}\n <Col xs={12} sm={12} md={6} lg={6} className={'my-2'}>\n <ClaimLogin />\n </Col>\n </Hidden>\n )\n case 'generic':\n return (\n <>\n <Hidden xs sm md>\n {/* <Hidden > */}\n <Col\n xs={12}\n sm={12}\n md={6}\n lg={6}\n className={'my-2 resource-wrapper'}\n >\n {SignInUtilities.resourceItems().map((resource, index) => {\n return (\n <ResourceItem\n divisor={index < 2}\n key={index}\n head={resource.head}\n title={resource.title}\n text={resource.text}\n buttonLabel={resource.buttonLabel}\n buttonLink={resource.buttonLink}\n type={resource.type}\n />\n )\n })}\n </Col>\n </Hidden>\n </>\n )\n case 'bridge-by-url':\n return <></>\n }\n }\n const backgroundUrl =\n loginLayout === 'bridge-by-url'\n ? 'https://leadsbridge.kinsta.cloud/wp-content/themes/leadsbridge-2021/assets/images/bridge-svg.php?fillcolor=rgba(65,166,220,0.2)'\n : undefined\n\n return (\n <AuthBackgroundStyled backgroundUrl={backgroundUrl}>\n <Container style={{ maxWidth: 1150, width: '100%' }}>\n <Row\n align='center'\n justify={\n loginLayout === 'bridge-by-url' || window.innerWidth <= 800\n ? 'center'\n : 'between'\n }\n className={loginLayout === '__facebook__' ? 'flex-row-reverse' : ''}\n nogutter={false}\n >\n <Col\n xs={12}\n sm={12}\n md={8}\n lg={loginLayout === 'bridge-by-url' ? 6 : 5}\n >\n <SignInForm>\n <Row nogutter={true} className={'sign-in-form__wrapper'}>\n {props.loading ? (\n <Loader $active />\n ) : (\n <>\n <div className={'sign-in-form__head'}>\n <BrandLogo width={150} />\n <Divider />\n </div>\n <div className={'sign-in-form__body'}>\n <div\n className={\n 'text-center ' + (props.isFormik ? 'my-1' : 'my-2')\n }\n >\n {props.header}\n {props.slot}\n {props.isFormik ? (\n props.form\n ) : (\n <Form\n style={{ textAlign: 'left', marginTop: 0 }}\n success={props.formStatus?.success}\n error={props.formStatus?.error}\n onSubmit={props.onSubmit}\n >\n {props.form}\n </Form>\n )}\n </div>\n </div>\n <div className={'sign-in-form__footer'}>\n {loginLayout === 'generic' &&\n props.links &&\n props.links.length > 0 && (\n <Row\n nogutter\n className={'py-1'}\n style={{ justifyContent: 'space-evenly' }}\n >\n {props.links?.map(\n (\n link: {\n label: string\n data?: any\n callback?: any\n message?: AuthState\n },\n index\n ) => {\n return (\n <Col key={index} className={'text-center'}>\n <Typography\n className={'small'}\n onClick={() => {\n link.callback()\n }}\n >\n {link.label}\n </Typography>\n </Col>\n )\n }\n )}\n </Row>\n )}\n </div>\n </>\n )}\n </Row>\n </SignInForm>\n </Col>\n {rightSide()}\n </Row>\n </Container>\n </AuthBackgroundStyled>\n )\n }\n)\nAuthContainer.displayName = 'AuthContainer'\nexport default AuthContainer\n","import React from 'react'\nimport { getCustomErrorCognitoMessage } from '../../../utils/cognitoErrors'\nimport { Auth } from 'aws-amplify'\nimport { Hub } from '@aws-amplify/core'\nimport {\n AUTH_STATE_CHANGE_EVENT,\n AuthState,\n UI_AUTH_CHANNEL,\n} from '@aws-amplify/ui-components'\nimport AuthService from '../../../services/AuthService'\nimport { sendToast } from '../../../store/actions/ApplicationConfigurationActions'\nimport axios from 'axios'\nimport { CognitoErrorResponse } from 'LeadsBridgeApp'\nimport t from 'public/locales/en-US.json'\n\nexport default class SignInUtilities {\n setEmailError: any\n setPwError: any\n setDoingLogin: any\n setLoggedIn: any\n dispatch: any\n\n constructor(\n setEmailError: any,\n setPwError: any,\n setDoingLogin: any,\n setLoggedIn: any,\n dispatch: any\n ) {\n this.setEmailError = setEmailError\n this.setPwError = setPwError\n this.setDoingLogin = setDoingLogin\n this.setLoggedIn = setLoggedIn\n this.dispatch = dispatch\n }\n\n handleSignIn = (email: string, pw: string, temp_password?: string) => {\n const password = temp_password || pw\n // console.log('password:', password);\n const username = email\n if (email === '') {\n this.setEmailError(t.auth.signin.error.emailError)\n return\n }\n if (password === '') {\n this.setPwError(t.auth.signin.error.passwordError)\n return\n }\n\n this.setDoingLogin(true)\n\n Auth.signIn({\n username,\n password,\n validationData: [],\n })\n .then((user) => {\n // console.log('user challange name', user.challengeName);\n switch (user.challengeName) {\n case 'SMS_MFA':\n case 'SOFTWARE_TOKEN_MFA':\n Hub.dispatch(UI_AUTH_CHANNEL, {\n event: AUTH_STATE_CHANGE_EVENT,\n message: AuthState.ConfirmSignIn,\n data: user,\n })\n break\n case 'NEW_PASSWORD_REQUIRED':\n Hub.dispatch(UI_AUTH_CHANNEL, {\n event: AUTH_STATE_CHANGE_EVENT,\n message: AuthState.ResetPassword,\n data: user,\n })\n break\n case 'MFA_SETUP':\n // TODO totp is optional in our system\n // This happens when the MFA method is TOTP\n // The user needs to setup the TOTP before using it\n // More info please check the Enabling MFA part\n // Auth.setupTOTP(user);\n break\n default:\n this.dispatch(\n sendToast({\n title: 'Success',\n message: 'Login successful. Welcome back!',\n color: 'positive',\n })\n )\n this.setLoggedIn(true)\n AuthService.onLogin(false, this.dispatch)\n }\n })\n .catch(async (err: CognitoErrorResponse) => {\n // console.log('code', err.code);\n switch (err.code) {\n case 'UserNotConfirmedException':\n Hub.dispatch(UI_AUTH_CHANNEL, {\n event: AUTH_STATE_CHANGE_EVENT,\n message: AuthState.ConfirmSignUp,\n data: null,\n })\n break\n case 'PasswordResetRequiredException':\n this.dispatch(\n sendToast({\n title: 'Error',\n messages: [getCustomErrorCognitoMessage(err)],\n color: 'negative',\n })\n )\n Hub.dispatch(UI_AUTH_CHANNEL, {\n event: AUTH_STATE_CHANGE_EVENT,\n message: AuthState.ResetPassword,\n data: null,\n })\n break\n case 'NotAuthorizedException':\n this.setPwError(getCustomErrorCognitoMessage(err))\n this.setEmailError('')\n // dispatch(sendToast({title: 'Error', messages: [err.message], color: 'negative'}));\n break\n case 'UserNotFoundException':\n // console.log('Calling handleLegacyUser');\n await axios\n .post(\n process.env.REACT_APP_V1_API + '/auth/v2/handleLegacyUser',\n {\n username: username,\n password: password,\n }\n )\n .then(async (res) => {\n // console.log('Legacy User verified');\n this.handleSignIn(email, pw)\n })\n .catch((err2) => {\n if (err2.response && err2.response.status === 403) {\n this.handleSignIn(\n email,\n pw,\n err2.response.data.temporary_password\n )\n } else {\n this.setPwError(getCustomErrorCognitoMessage(err))\n this.setEmailError('')\n }\n })\n // dispatch(sendToast({title: 'Error', messages: [err.message], color: 'negative'}));\n break\n default:\n this.dispatch(\n sendToast({\n title: 'Error',\n messages: [err.message],\n color: 'negative',\n })\n )\n }\n })\n .finally(() => {\n this.setDoingLogin(false)\n })\n }\n\n static resourceItems = (): any[] => {\n return [\n {\n head: 'RESOURCES / WEBINAR',\n title:\n 'Discussing Lead Optimization with Meta: How to bring in higher quality leads with your lead generation campaigns',\n text: '',\n buttonLabel: 'Sign up now',\n buttonLink:\n 'https://lp.leadsbridge.com/discussing-lead-optimization-with-meta',\n },\n {\n head: 'RESOURCES / GUIDES',\n title:\n 'Google Lead Form Ads: The Complete, Always-Updated Guide to Google Lead Generation',\n text: 'Every business owner already knows that putting a good lead generation strategy in place helps to target high-quality prospects that are more likely to convert into customers. Like Facebook Lead Ads and LinkedIn Lead Gen Forms, Google has also developed its own native lead generation ads, namely Google Lead Form Extensions and YouTube TrueView for Action Form Ads. ',\n buttonLabel: 'Read more',\n buttonLink: 'https://leadsbridge.com/blog/guides/google-lead-form-ads/',\n },\n {\n type: 'blog',\n head: 'RESOURCES / GUIDES',\n title: 'How to setup Facebook Conversions API – Benefits and more',\n text: 'Advertising is all about timing. You need to reach out at the perfect time, on the ideal platform, and to the right people. It’s an art to say the least, and one that not a whole lot of people have mastered. This is where Facebook Conversions API comes in handy.',\n buttonLabel: 'Read more',\n buttonLink:\n 'https://leadsbridge.com/blog/guides/how-to-setup-facebook-conversions-api/',\n },\n // {\n // type: 'blog',\n // head: 'RESOURCES / GUIDES',\n // title:\n // 'LinkedIn Matched Audiences: improve the efficiency of your retargeting campaigns',\n // text: 'LinkedIn Matched Audiences is a tool that allows businesses to build audiences from email lists, website traffic, and high-value LinkedIn accounts. With it, you can upload a list of companies or contacts you may like to target, retarget people, integrate contacts from a third-party system, and create a lookalike audience.',\n // buttonLabel: 'Read more',\n // buttonLink:\n // 'https://leadsbridge.com/blog/guides/linkedin-matched-audiences/',\n // },\n ]\n }\n}\n","import { CognitoUserInterface } from '@aws-amplify/ui-components'\n\n// original `cognitoUser` object is too deep to be directly sent to Redux\n// so let's create a simplified version of it\nexport const parseAuthUser = (\n cognitoUser: Partial<CognitoUserInterface>\n): CognitoUserInterface => ({\n Session: cognitoUser?.Session,\n authenticationFlowType: cognitoUser?.authenticationFlowType,\n client: {\n endpoint: cognitoUser?.client?.endpoint,\n userAgent: cognitoUser?.client?.userAgent,\n },\n keyPrefix: cognitoUser?.keyPrefix,\n username: cognitoUser?.username,\n userConfirmed: cognitoUser?.userConfirmed,\n challengeName: cognitoUser?.challengeName || '',\n challengeParam: cognitoUser?.challengeParam || {},\n attributes: cognitoUser?.attributes\n ? {\n ...cognitoUser.attributes,\n }\n : {},\n})\n","import { useLocation } from 'react-router-dom'\nimport * as queryString from 'query-string'\nimport { appRoutes } from '@routes/index'\n\ntype RedirectToQs = {\n redirectTo?: string\n}\n\n// When user lands on our app he's not yet logged until AmplifyAuthenticator is initialiased and set a valid user session\n// So everytime user lands on our app he will be taken to /signin\n// if it has landed from a specific url (only accessible behind login), we need to append that url as ?redirectTo query string param\n// and redirect it again once /signin session has been established\nexport const useFirstLandRedirect = () => {\n const location = useLocation()\n\n // this is the query string that will be attached to /signin path\n // eg: if user arrives directy from app.leadsbridge.com/dashboard/?foo=bar, we need to build signin url storing the /dashboard part\n // in this case -> /signin?redirectTo=/dashboard%3Ffoo%3Dbar\n const encodedSearch = location.search\n ? encodeURIComponent(location.search)\n : undefined\n const encodedHash = location.hash\n ? encodeURIComponent(location.hash)\n : undefined\n const redirectUrlQuery =\n location.pathname && location.pathname !== '/'\n ? `?redirectTo=${location.pathname}${encodedSearch || ''}${\n encodedHash || ''\n }`\n : ''\n const initialSigninUrl = appRoutes.signin.makeUrl() + redirectUrlQuery\n\n // parsing query string\n // if user is already logged in, he will reach the `initialSigninUrl` above, so we can parse it and do the proper redirect\n const parsedQueryString = queryString.parse(location.search) as RedirectToQs\n const redirectsToWhenLogged = parsedQueryString.redirectTo || '/'\n\n return {\n initialSigninUrl,\n redirectsToWhenLogged,\n }\n}\n","import React, { useEffect, useState } from 'react'\nimport CognitoApiService, {\n CognitoProvider,\n} from '../../../services/CognitoApiService'\nimport AuthContainer from '@features/auth/components/AuthContainer'\nimport Typography from '@components/Basic/Typography'\nimport { Col, Row } from 'react-grid-system'\nimport { Link } from 'react-router-dom'\nimport { appRoutes } from '@routes/index'\nimport { setLoginLayout } from '@app/store/actions/ApplicationConfigurationActions'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { InputField } from '@components/Form/InputField'\nimport { Button } from '@components/Basic/Button'\nimport { useTranslation } from 'react-i18next'\nconst Saml: React.FC = () => {\n const [email, setEmail] = useState<string>('')\n const [isValidEmail, setIsValidEmail] = useState<boolean>(true)\n const [isFormTouched, setIsFormTouched] = useState<boolean>(false)\n const [verifyInProgress, setVerifyInProgress] = useState<boolean>(false)\n const [identityProviders, setIdentityProviders] = useState<CognitoProvider[]>(\n []\n )\n const [apiError, setApiError] = useState<string>()\n const dispatch = useAppDispatch()\n const { t } = useTranslation()\n\n useEffect(() => {\n dispatch(setLoginLayout('generic'))\n }, [])\n\n // loading cognito identity providers on component mounts\n useEffect(() => {\n CognitoApiService.listIdentityProviders()\n .then((res) => {\n setIdentityProviders(res.Providers)\n })\n .catch(() => {\n setApiError('Cannot find any identity provider')\n })\n }, [])\n\n // handle email validation\n useEffect(() => {\n setApiError('')\n\n if (!email) {\n setIsValidEmail(false)\n return\n }\n setIsValidEmail(true)\n /*\n if (/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i.test(email)) {\n setIsValidEmail(true);\n } else {\n setIsValidEmail(false);\n }\n */\n }, [email])\n\n const handleSubmit = async () => {\n setApiError('')\n setIsFormTouched(true)\n const userEmailDomain = email.split('@').reverse()[0]\n setVerifyInProgress(true)\n\n // find the identity provider who matches my email domain\n const validProvider = identityProviders.find(\n (provider) => provider.ProviderName === userEmailDomain\n )\n const providerName = validProvider?.ProviderName\n\n await new Promise((resolve) => {\n setTimeout(resolve, 1680)\n })\n\n if (!providerName) {\n setApiError('Your email does not match any authorized identity provider')\n setVerifyInProgress(false)\n return\n }\n\n // redirecting to valid SAML provider screen\n\n CognitoApiService.describeIdentityProvider(providerName)\n .then((identityProvider) => {\n const redirectUrl = process.env.REACT_APP_SAML_REDIRECT_URL\n sessionStorage.setItem('saml-email', email)\n sessionStorage.setItem('saml-provider', providerName)\n window.location.assign(\n `${process.env.REACT_APP_COGNITO_URL}.amazoncognito.com/oauth2/authorize?identity_provider=${providerName}&redirect_uri=${redirectUrl}&response_type=CODE&client_id=${process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID}&scope=aws.cognito.signin.user.admin email openid profile`\n )\n })\n .catch(() => {\n setApiError('Cannot communicate with SAML provider')\n setVerifyInProgress(false)\n })\n }\n\n const inputHasError = !isValidEmail || Boolean(apiError)\n const inputErrorMessage =\n inputHasError && isFormTouched\n ? apiError || 'Email format is not valid'\n : undefined\n\n return (\n <div className={'auth-slot-container'}>\n <div className={'login-slot'}>\n <AuthContainer\n header={\n <>\n <Typography className={'custom-class-theme'} tagName='h2'>\n Login with your domain\n </Typography>\n <Typography className={'text-secondary'}>\n You will be redirected to your domain login screen\n </Typography>\n </>\n }\n slot={<></>}\n onSubmit={handleSubmit}\n form={\n <>\n <InputField\n // error={(!isValidEmail || Boolean(apiError)) && isFormTouched}\n $status={{ error: inputErrorMessage }}\n name={'email'}\n label={t('auth.signin.samlDomain')}\n $fluid\n $hasMargin\n placeholder={t('auth.signin.samlDomainPlaceholder')}\n value={email}\n onChange={(e) => {\n setEmail(e.target.value)\n }}\n type='text'\n id={'email-input'}\n />\n\n <Button\n $fluid\n $variant={'primary'}\n $loading={verifyInProgress}\n disabled={\n verifyInProgress ||\n !isValidEmail ||\n Boolean(apiError) ||\n !email\n }\n >\n Sign in with company account\n </Button>\n\n <Row>\n <Col className={'text-center my-1'}>\n <Link\n to={appRoutes.signin.makeUrl()}\n className={'text-link text-black'}\n >\n Go back to login page\n </Link>\n </Col>\n </Row>\n </>\n }\n links={[]}\n />\n </div>\n </div>\n )\n}\nexport default Saml\n","import React from 'react'\nimport {\n InputSmartSelect,\n SelectValue,\n} from '@components/Form/InputSmartSelect'\nimport { InputField } from '@components/Form/InputField'\nimport { FiltersIcons } from '@components/Basic/FiltersIcons'\nimport { FilterRowStyled } from '../styled'\nimport { BridgeFilterCondition } from 'Nbee'\nimport { InputSmartCreatableSelect } from '@components/Form/InputSmartSelect/Creatable'\n// import { useTranslation } from 'react-i18next'\n\ninterface ModalProps {\n index: number\n filterRule: BridgeFilterCondition\n fieldSelectDefaultValue: SelectValue | SelectValue[] | undefined\n fieldSelectInitialValues: SelectValue[]\n onFieldChange: (idx: number, { label, value }: SelectValue) => void\n operatorSelectDefaultValue: SelectValue | SelectValue[] | undefined\n operatorSelectInitialValues: SelectValue[]\n onOperatorChange: (idx: number, operator: string) => void\n inputValueType: string | undefined\n onValueChange: (idx: number, value: string | string[] | []) => void\n onCopyFilterRule: (idx: number) => void\n onAddFilterRule: (idx: number) => void\n onRemoveFilterRule: (idx: number) => void\n isRemoveFilterRuleDisabled: boolean\n isDefaultValueNotInSourceAnymore: boolean\n isBridgeDisabled: boolean\n}\n\nconst SmartSelectProps = {\n hasCustomSearch: false,\n upDownIconsStyle: true,\n placeholder: '',\n}\n\nexport const FilterRuleRow: React.FC<ModalProps> = ({\n index,\n filterRule,\n fieldSelectDefaultValue,\n fieldSelectInitialValues,\n onFieldChange,\n operatorSelectDefaultValue,\n operatorSelectInitialValues,\n onOperatorChange,\n inputValueType,\n onValueChange,\n onCopyFilterRule,\n onAddFilterRule,\n onRemoveFilterRule,\n isRemoveFilterRuleDisabled,\n isDefaultValueNotInSourceAnymore,\n isBridgeDisabled,\n}) => {\n const { values, operator, field } = filterRule\n // const { t } = useTranslation()\n return (\n <FilterRowStyled>\n <InputSmartSelect\n data-testid='field-dropdown'\n initialValues={fieldSelectInitialValues}\n defaultValue={fieldSelectDefaultValue}\n onSelect={(selectedOption) =>\n onFieldChange(index, selectedOption as SelectValue)\n }\n defaultLabel={'Select Field'}\n floatingLabel={'Field'}\n fieldIsUnavailable={isDefaultValueNotInSourceAnymore}\n isClearable={false}\n isDisabled={isBridgeDisabled}\n // tooltipMessage={\n // (isDefaultValueNotInSourceAnymore &&\n // t('nbee.filters.tooltipFieldNotFound')) ||\n // undefined\n // }\n {...SmartSelectProps}\n />\n <InputSmartSelect\n data-testid='condition-dropdown'\n initialValues={operatorSelectInitialValues}\n onSelect={(selectedOption) => {\n onOperatorChange(\n index,\n !(selectedOption instanceof Array) ? `${selectedOption.value}` : ''\n )\n }}\n defaultValue={operatorSelectDefaultValue}\n defaultLabel={'Select Condition'}\n floatingLabel={'Condition'}\n fieldIsUnavailable={isDefaultValueNotInSourceAnymore}\n isDisabled={isBridgeDisabled || (operator === '' && field.id === '-1')}\n {...SmartSelectProps}\n isClearable={false}\n />\n\n {/* Possible inputValueType are: 'text', 'disabled' and 'tags' */}\n {inputValueType === 'tags' ? (\n <InputSmartCreatableSelect\n name={'filter-value'}\n placeholder={''}\n floatingLabel={'Values'}\n defaultLabel={'Insert values'}\n defaultValue={\n // we must be sure default is an array or string\n values instanceof Array ? values : []\n }\n onSelect={(newValues) => onValueChange(index, newValues)}\n isClearable={false}\n showDropdownIndicator={false}\n isDisabled={isBridgeDisabled}\n />\n ) : (\n <InputField\n name={'filter-value'}\n type={'text'}\n defaultLabel={'Insert value'}\n floatingLabel={'Value'}\n value={filterRule.values}\n onChange={(e) => onValueChange(index, e.target.value)}\n fieldIsUnavailable={isDefaultValueNotInSourceAnymore}\n disabled={\n isBridgeDisabled || operator === '' || inputValueType === 'disabled'\n }\n />\n )}\n\n <FiltersIcons\n handleCopy={() => onCopyFilterRule(index)}\n handleAdd={() => onAddFilterRule(index)}\n handleDelete={() => onRemoveFilterRule(index)}\n // isCopyDisabled={hasEmptyFilterRules}\n // isAddDisabled={hasEmptyFilterRules}\n isDeleteDisabled={isRemoveFilterRuleDisabled}\n isBridgeDisabled={isBridgeDisabled}\n />\n </FilterRowStyled>\n )\n}\n","import { BridgeFormValues, PartialConfiguredApp } from 'Nbee'\nimport all from 'public/locales/en-US.json'\n\ntype ConfiguredAppErrors = Record<keyof PartialConfiguredApp, string>\ntype BridgeFormValuesErrors = Record<keyof BridgeFormValues, string>\n\nconst validateAppConfiguration = (configuredApp: PartialConfiguredApp) => {\n const errors: Partial<ConfiguredAppErrors> = {}\n if (!configuredApp.appId) {\n errors.appId = all.nbee.bridgeBuilder.validation.appSelector\n }\n\n return errors\n}\n\nexport const validateBridgeChooserForm = (values: BridgeFormValues) => {\n const errors: Partial<BridgeFormValuesErrors> = {}\n\n const sourceErrors = validateAppConfiguration(values.source)\n const destinationErrors = validateAppConfiguration(values.destination)\n\n const computedErrors = {\n ...errors,\n source: Object.keys(sourceErrors).length ? sourceErrors : undefined,\n destination: Object.keys(destinationErrors).length\n ? destinationErrors\n : undefined,\n }\n\n if (!computedErrors.source) {\n delete computedErrors.source\n }\n if (!computedErrors.destination) {\n delete computedErrors.destination\n }\n\n return computedErrors\n}\n","import React from 'react'\nimport { FieldToggleStatus } from '@features/nbee/EmailReceipt/FieldToggleStatus'\nimport styled from 'styled-components'\nimport { appRoutes } from '@app/routes'\nimport { useTranslation } from 'react-i18next'\nimport { DropdownIconWrapper } from '@components/Dropdown/styled'\nimport { useHistory } from 'react-router-dom'\nimport { StarterLabel } from '@features/nbee/AddFilterButton/styled'\nimport { FaLock } from 'react-icons/fa'\nimport { minimumPlanName } from '@features/nbee/FieldsMappingForm'\nimport { useUpdateBridgeToPricing } from '@features/nbee/utils'\n\nconst Wrapper = styled.div`\n // pointer-events: none;\n display: flex;\n gap: 1rem;\n cursor: pointer;\n`\n\nconst UpdateMessage = styled.div`\n padding: 0.5rem 0;\n text-align: right;\n font-size: 0.9rem;\n color: ${({ theme }) => theme.input.disabled.color};\n`\n\ninterface Props {\n requiredLbPlanId?: number\n moduleReceiptId?: string\n bridgeId?: string | number | undefined\n}\n\nexport const FeatureNotAvailable: React.VFC<Props> = ({\n requiredLbPlanId,\n moduleReceiptId,\n bridgeId,\n}) => {\n const updateBridgeToPricing = useUpdateBridgeToPricing(\n bridgeId,\n moduleReceiptId,\n requiredLbPlanId\n )\n\n return (\n <div>\n <Wrapper onClick={() => updateBridgeToPricing()}>\n <FieldToggleStatus forcedDisabled />\n </Wrapper>\n </div>\n )\n}\n","import React from 'react'\nimport { useField } from 'formik'\nimport { InputSmartCreatableSelect } from '@components/Form/InputSmartSelect/Creatable'\nimport { EmailReceiptStyled } from '@features/nbee/EmailReceipt/styled'\nimport { InputFeedback } from '@components/Basic/InputFeedback'\nimport { useTranslation } from 'react-i18next'\nimport { useGetUserInfo } from '@app/api/getUserInfo'\n\ninterface Props {\n /* name: string */\n disabled?: boolean\n error?: string | null\n}\n\nconst { FieldGroup, FieldRow } = EmailReceiptStyled\n\nexport const FieldRecipients: React.VFC<Props> = ({ disabled, error }) => {\n const { t } = useTranslation()\n const [field, meta, helpers] = useField<string[]>(\n 'settings.emailReceipt.recipients'\n )\n\n return (\n <FieldGroup>\n <FieldRow>\n <label>{t('nbee.emailReceipt.labelReceivers')}</label>\n <InputSmartCreatableSelect\n isDisabled={disabled}\n placeholder={t('nbee.emailReceipt.placeholderReceivers')}\n isClearable={false}\n defaultValue={field.value}\n onSelect={(values) => {\n helpers.setValue(values)\n }}\n onBlur={() => {\n helpers.setTouched(true)\n }}\n />\n </FieldRow>\n\n <FieldRow>\n <div />\n {error ? <InputFeedback $status={{ error }} /> : null}\n </FieldRow>\n </FieldGroup>\n )\n}\n","import React from 'react'\nimport { EmailReceiptStyled } from '@features/nbee/EmailReceipt/styled'\nimport { InputFeedback } from '@components/Basic/InputFeedback'\nimport { useField } from 'formik'\nimport { InputField } from '@components/Form/InputField'\nimport { useTranslation } from 'react-i18next'\n\ninterface Props {\n disabled?: boolean\n error?: string | null\n}\n\nconst { FieldGroup, FieldRow } = EmailReceiptStyled\n\nexport const FieldSubject: React.VFC<Props> = ({ disabled, error }) => {\n const { t } = useTranslation()\n const [field, meta, helpers] = useField<string>(\n 'settings.emailReceipt.subject'\n )\n\n const handleBlur = () => {\n helpers.setTouched(true)\n }\n\n return (\n <FieldGroup>\n <FieldRow>\n <label>{t('nbee.emailReceipt.labelSubject')}</label>\n <InputField\n {...field}\n type={'text'}\n placeholder={t('nbee.emailReceipt.placeholderSubject')}\n disabled={disabled}\n onBlur={handleBlur}\n />\n </FieldRow>\n\n <FieldRow>\n <div />\n {error ? <InputFeedback $status={{ error }} /> : null}\n </FieldRow>\n </FieldGroup>\n )\n}\n","import React from 'react'\nimport { InputToggle } from '@components/Form/InputToggle'\nimport { useField } from 'formik'\nimport styled from 'styled-components'\nimport { useTranslation } from 'react-i18next'\n\nconst Wrapper = styled.div`\n display: flex;\n gap: 1rem;\n align-items: center;\n margin-bottom: 1rem;\n\n p {\n font-size: 0.9rem;\n margin: 0;\n }\n`\n\ninterface Props {\n onStatusChange?: (newState: boolean) => void\n forcedDisabled?: boolean\n}\n\nexport const FieldToggleStatus: React.VFC<Props> = ({\n onStatusChange,\n forcedDisabled,\n}) => {\n const { t } = useTranslation()\n const [field, meta, helpers] = useField<boolean>(\n 'settings.emailReceipt.active'\n )\n\n return (\n <Wrapper>\n <p>{t('nbee.emailReceipt.labelEnableFeature')}</p>\n <div>\n <InputToggle\n $variant={'primary'}\n $isChecked={field.value}\n onChange={() => {\n const newState = !field.value\n helpers.setValue(newState)\n if (onStatusChange) {\n onStatusChange(newState)\n }\n }}\n disabled={forcedDisabled}\n />\n </div>\n </Wrapper>\n )\n}\n","import * as yup from 'yup'\nimport t from 'public/locales/en-US.json'\n\nexport const emailReceiptValidationSchema = yup.object().shape({\n active: yup.boolean(),\n recipients: yup\n .array()\n .of(\n yup\n .string()\n // eslint-disable-next-line no-template-curly-in-string\n .email('${value} is not a valid email address')\n .typeError('Invalid email format')\n )\n .min(1, t.common.genericFieldIsRequired),\n subject: yup.string().required(t.common.genericFieldIsRequired),\n})\n","import { useState, useEffect } from 'react'\nimport * as yup from 'yup'\nimport { emailReceiptValidationSchema } from '@features/nbee/EmailReceipt/validation'\nimport { BridgeFormValues, EmailReceiptSettings } from 'Nbee'\n\ninterface EmailReceiptValidationErrors {\n subject: string | null\n recipients: string | null\n}\n\nexport const useEmailReceiptValidation = (values: BridgeFormValues) => {\n const [errors, setErrors] = useState<EmailReceiptValidationErrors>({\n subject: null,\n recipients: null,\n })\n\n useEffect(() => {\n const isActive = values.settings?.emailReceipt?.active\n\n if (isActive === false) {\n setErrors({\n subject: null,\n recipients: null,\n })\n return\n }\n\n const validateField = async (\n field: keyof EmailReceiptSettings,\n value: string | string[]\n ) => {\n try {\n await emailReceiptValidationSchema.validateAt(field, { [field]: value })\n setErrors((prev) => ({ ...prev, [field]: null }))\n } catch (error) {\n if (error instanceof yup.ValidationError) {\n setErrors((prev) => ({\n ...prev,\n [field]: (error as yup.ValidationError).message,\n }))\n }\n }\n }\n\n const emailReceipt = values.settings?.emailReceipt\n if (emailReceipt) {\n validateField('subject', emailReceipt.subject || '')\n validateField('recipients', emailReceipt.recipients || [])\n }\n }, [values.settings?.emailReceipt])\n\n return errors\n}\n","import React from 'react'\nimport { useTranslation } from 'react-i18next'\nimport styled from 'styled-components'\nimport { Translate } from '@components/Translate'\n\ninterface Props {\n fieldLabels: string[]\n}\n\nconst Wrapper = styled.div``\n\nconst ErrorMessage = styled.div`\n color: #db3c3c;\n font-weight: 600;\n`\n\nconst SupportMessage = styled.div``\n\nexport const PopupContentMappingError: React.VFC<Props> = ({ fieldLabels }) => {\n const { t } = useTranslation()\n\n const fieldLabelsTrimmed =\n fieldLabels.length > 3\n ? fieldLabels.slice(0, 3).concat([' and more'])\n : fieldLabels\n\n return (\n <Wrapper>\n <ErrorMessage>{t('nbee.fieldsMapping.testError.message')}</ErrorMessage>\n <ErrorMessage>\n <Translate\n i18nKey={'nbee.fieldsMapping.testError.listOfFields'}\n count={fieldLabelsTrimmed.length}\n values={{\n fields: fieldLabelsTrimmed.join(', '),\n }}\n />\n </ErrorMessage>\n <SupportMessage>\n <Translate i18nKey={'nbee.fieldsMapping.testError.supportText'} />\n </SupportMessage>\n </Wrapper>\n )\n}\n","import React, { useContext, useEffect } from 'react'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport {\n fromApiTestReponseToFormErrors,\n transformFormValuesToTestMappingRequest,\n} from './SendTestLeadSubForm/utils'\nimport { useTranslation } from 'react-i18next'\nimport { useTestFieldsMapping } from '@app/api/testFieldsMapping'\nimport { FormikProps } from 'formik'\nimport { BridgeFormValues } from 'Nbee'\nimport { ApiBridgeFieldDefinition, ApiErrorResponse } from 'BackendApi'\nimport { PanelPopupContext } from '@components/Panel'\nimport mappingErrorImage from '@assets/images/illustrations/field-mapping-test-error.svg'\nimport { PopupContentMappingError } from '@features/nbee/FieldsMappingForm/popupContent/PopupContentMappingError'\nimport { useUpdateBridge } from '@app/api/updateBridge'\nimport { transformBridgeFormValuesToApiSaveBridgeBody } from '@app/api/utils/bridge'\nimport { InputFeedback } from '@components/Basic/InputFeedback'\nimport { parseApiError } from '@app/api/utils/error'\nimport { sendToast } from '@app/store/actions/ApplicationConfigurationActions'\nimport { useAppDispatch } from '@app/store/hooks'\n\ninterface Props {\n onSuccess: () => void\n formikProps: FormikProps<BridgeFormValues>\n scope: 'test' | 'save'\n isDisabledFromParent?: boolean\n isSavingFromParent?: boolean\n bridgeId: number\n destinationFields: ApiBridgeFieldDefinition[]\n}\n// We use this button to test mapping with API, before proceeding to next step\n// next step (or scope) could be `test` or `save`.\n// `test` is used for reaching screen to test with a new lead\n// `save` is to handle the saving of the mapping (Save and Publish action)\n// The look of the button (variant and text) is controlled by the `scope` prop.\n// Once test is successful we run `onSuccess` callback to proceed to the next step/scope\nexport const ButtonTestBeforeProceeding: React.FC<Props> = ({\n onSuccess,\n formikProps,\n scope,\n isDisabledFromParent,\n isSavingFromParent,\n bridgeId,\n destinationFields,\n}) => {\n const dispatch = useAppDispatch()\n const { t } = useTranslation()\n const panelContext = useContext(PanelPopupContext)\n const formValues = formikProps.values\n const integrationId = formValues?.destination?.integrationId\n\n const { mutate: updateBridge, isLoading: isUpdatingBridge } =\n useUpdateBridge()\n\n const {\n mutate: testFieldsMapping,\n data: testFieldsMappingResult,\n isLoading: isTestingFieldsMapping,\n error: testFieldsMappingError,\n } = useTestFieldsMapping()\n\n useEffect(() => {\n formikProps.setSubmitting(isTestingFieldsMapping || isUpdatingBridge)\n }, [isTestingFieldsMapping || isUpdatingBridge])\n\n useEffect(() => {\n if (!panelContext || !panelContext.sendPopup) {\n return\n }\n\n // in case of error we open a popup to inform user about it\n // we can have an hard error like 400/500 but also when is 200\n // we will receive a list of fields that have not passed the test\n // so popup error needs to be triggered also if response is 200 and has data\n const response = testFieldsMappingResult?.data?.errors || []\n const someFieldsHaveError = response.length\n if (testFieldsMappingError || someFieldsHaveError) {\n // update form errors state\n formikProps.setErrors(\n fromApiTestReponseToFormErrors(destinationFields, response)\n )\n\n // show popup\n panelContext.sendPopup({\n content: <PopupContentMappingError fieldLabels={[]} />,\n dismissable: true,\n image: mappingErrorImage,\n })\n }\n }, [testFieldsMappingError])\n\n useEffect(() => {\n if (testFieldsMappingResult && scope === 'test') {\n const updateBridgeData = transformBridgeFormValuesToApiSaveBridgeBody(\n formValues,\n { step: 2 }\n )\n\n updateBridge(\n {\n bridgeData: updateBridgeData,\n bridgeId: `${bridgeId}`,\n },\n {\n onSuccess: () => {\n onSuccess() // setScreenState\n },\n onError: (error: ApiErrorResponse) => {\n // show popup\n panelContext &&\n panelContext.sendPopup &&\n panelContext.sendPopup({\n content: (\n <InputFeedback\n $status={{ error: parseApiError(error).message }}\n />\n ),\n dismissable: true,\n image: mappingErrorImage,\n })\n },\n }\n )\n }\n\n if (testFieldsMappingResult && scope === 'save') {\n onSuccess() // updates bridge + publish\n }\n }, [testFieldsMappingResult])\n return (\n <Button\n // keep the type as button (also if it should be `submit`), this is because\n // we don't want a direct form submit, instead we manually run\n // formikProps.submitForm() on success\n type={'button'}\n $variant={scope === 'save' ? 'primary' : 'secondary'}\n disabled={\n isDisabledFromParent || isSavingFromParent || formikProps.isSubmitting\n }\n $loading={\n isSavingFromParent || isTestingFieldsMapping || isUpdatingBridge\n }\n onClick={() => {\n if (bridgeId) {\n testFieldsMapping(\n {\n bridgeId,\n fieldsToTest: transformFormValuesToTestMappingRequest(\n formikProps.values.fieldsMapping\n ),\n },\n {\n onError: (apiError) => {\n const ErrorMessages =\n apiError?.response?.data?.data?.errors?.map(\n (item) => item.message\n ) as string[]\n\n dispatch(\n sendToast({\n title: 'Error',\n messages: ErrorMessages,\n color: 'negative',\n })\n )\n },\n }\n )\n }\n }}\n >\n {scope === 'save'\n ? t('nbee.fieldsMapping.saveAndPublish')\n : t('nbee.fieldsMapping.testFieldsMapping')}\n </Button>\n )\n}\n","import React, { useState } from 'react'\nimport { useField, useFormikContext } from 'formik'\nimport { BridgeFormValues, MappedField, MappedFieldMapping } from 'Nbee'\nimport { FakeInput } from '@components/Basic/FakeInput'\nimport {\n InputFeedback,\n InputFeedbackStatus,\n} from '@components/Basic/InputFeedback'\nimport { StateIcon, ValidationStates } from '@components/Basic/StateIcon'\nimport {\n MultiCreatableCustom,\n SelectValueMulti,\n} from '@app/components/Form/MultiCreatableCustom'\nimport { FormulaModal } from '@features/nbee/FieldsMappingForm/FormulaModal'\nimport {\n BinIconWrapper,\n DeleteIcon,\n DestinationFieldLabel,\n DestinationFieldsWrapper,\n ErrorWrapper,\n RowFeedback,\n RowStyled,\n RowWrapper,\n SourceFieldsWrapper,\n StateIconErrorWrapper,\n} from './styled'\nimport { LabelWithDocTooltip } from '@components/Form/LabelWithDocTooltip'\nimport { RowProps, flattenErrors } from '.'\nimport { regenerateMappingIds } from '@components/Form/MultiCreatableCustom/utils'\n\nexport const FieldMappingRow: React.FC<RowProps> = ({\n selectOptions,\n index,\n formulaUserModule,\n formulaSchema,\n showWelcomeMessage,\n sourceLogoUri,\n onRedirectToPricing,\n}) => {\n const { values } = useFormikContext<BridgeFormValues>()\n\n const fieldName = `fieldsMapping.${index}`\n const [field, meta, helpers] = useField<MappedField>(fieldName)\n const fieldValue = field.value\n\n const [isModalOpen, toggleIsModalOpen] = useState<boolean>(false)\n const [selectedMapping, setSelectedMapping] = useState<MappedFieldMapping>()\n\n const userHasFormulaEnabled = formulaUserModule?.enabled\n\n const handleMappingChange = (newMapping: MappedFieldMapping[]) => {\n // on mapping change we need to regenerate the unique ids for each mapping item\n const mappingWithNewIds = regenerateMappingIds(newMapping, index)\n helpers.setValue({\n ...fieldValue,\n mapping: mappingWithNewIds,\n })\n }\n\n const handleOpenModal = () => toggleIsModalOpen(true)\n const handleCloseModal = () => {\n setSelectedMapping(undefined) // reset selectedMapping\n toggleIsModalOpen(false)\n }\n\n const picklistOptions: SelectValueMulti[] = (fieldValue.picklist || []).map(\n (item) => {\n return {\n value: `${item.id}`, // we want this to be a string\n label: item.text,\n fieldType: 'custom',\n }\n }\n )\n\n const sourceFieldOptions = selectOptions.filter(\n (option) => option.fieldType === 'source'\n )\n\n const hasValue =\n fieldValue.destinationText ||\n fieldValue.mapping.some(\n (item) =>\n item.text ||\n item.sourceFieldId ||\n (item.formula?.id && item.formula?.params[0]?.values)\n )\n const hasError = meta.error as Partial<MappedField> | undefined // we are using a custom yup schema\n\n const errorStatusMessage = hasError && flattenErrors(hasError).join(', ')\n\n const errorStatus: InputFeedbackStatus | undefined = hasError\n ? {\n error: errorStatusMessage,\n }\n : undefined\n\n const validationIconState: ValidationStates = hasError\n ? 'error'\n : hasValue\n ? 'success'\n : 'default'\n\n return (\n <RowWrapper showWelcomeMessage={showWelcomeMessage}>\n {showWelcomeMessage && (\n <LabelWithDocTooltip label={fieldValue?.destinationFieldLabel || ''} />\n )}\n\n <RowStyled showWelcomeMessage={showWelcomeMessage}>\n {/* Bin icon */}\n {!showWelcomeMessage && (\n <BinIconWrapper>\n {!values.ui?.isBridgeEnabled && fieldValue.mapping.length > 0 ? (\n <DeleteIcon\n onClick={() => {\n helpers.setValue({\n ...fieldValue,\n mappingType: 'manual',\n mapping: [],\n })\n }}\n visible={\n fieldValue?.mapping?.some(\n (item) =>\n item.sourceFieldId || item.formula?.id || item.text\n )\n ? 'visible'\n : 'hidden'\n }\n />\n ) : null}\n </BinIconWrapper>\n )}\n\n {/* Source fields */}\n <SourceFieldsWrapper fullWidth={showWelcomeMessage}>\n <MultiCreatableCustom\n isDisabled={values.ui?.isBridgeEnabled}\n onMappingChange={handleMappingChange}\n sourceOptions={selectOptions}\n picklistOptions={picklistOptions}\n mappedField={fieldValue}\n formulaSchema={formulaSchema}\n userHasFormulaEnabled={userHasFormulaEnabled}\n onFormulaSelect={(mappingWithFormula) => {\n setSelectedMapping(mappingWithFormula)\n handleOpenModal()\n }}\n fieldIndex={index}\n sourceLogoUri={sourceLogoUri}\n onRedirectToPricing={onRedirectToPricing}\n />\n </SourceFieldsWrapper>\n {/* Destination fields */}\n <DestinationFieldsWrapper>\n {!showWelcomeMessage ? (\n <>\n <StateIconErrorWrapper>\n <StateIcon state={validationIconState} />\n\n <ErrorWrapper>\n {errorStatus && (\n <RowFeedback showWelcomeMessage={showWelcomeMessage}>\n <InputFeedback $status={errorStatus} />\n </RowFeedback>\n )}\n </ErrorWrapper>\n </StateIconErrorWrapper>\n <DestinationFieldLabel>\n <FakeInput\n required={fieldValue?.isRequired}\n text={fieldValue?.destinationFieldLabel}\n />\n </DestinationFieldLabel>\n </>\n ) : null}\n </DestinationFieldsWrapper>\n\n {/* Formula Modal */}\n\n <FormulaModal\n isOpen={isModalOpen}\n onCloseModal={handleCloseModal}\n index={index}\n sourceFieldOptions={sourceFieldOptions}\n selectedMapping={selectedMapping}\n />\n </RowStyled>\n </RowWrapper>\n )\n}\n","import styled, { css } from 'styled-components'\nimport { SideLogoProps } from './HeaderSearchComponent'\n\nexport const HeaderSearchWrapper = styled.div`\n width: 100%;\n`\nexport interface TopHeaderMiddleProps {\n isReloadingAllBridgeFields: boolean\n}\nexport const TopHeaderMiddle = styled.div<TopHeaderMiddleProps>`\n display: flex;\n align-items: center;\n > span {\n transition: 0.16s all ease-out;\n margin-right: 0.5rem;\n cursor: pointer;\n svg {\n fill: ${({ theme }) => theme.button.primary.backgroundColor};\n ${({ isReloadingAllBridgeFields }) =>\n isReloadingAllBridgeFields\n ? css`\n animation: rotate360 0.68s ease-in-out;\n `\n : null}\n }\n &:hover {\n transition: 0.16s all ease-in;\n svg {\n fill: ${({ theme }) => theme.button.primary.backgroundColorHover};\n }\n }\n }\n`\n\nexport const TopHeader = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 14px;\n line-height: 19px;\n\n h4,\n h5 {\n margin-top: 0;\n margin-bottom: 0;\n }\n`\n\nexport const SubHeader = styled.div`\n display: flex;\n align-items: center;\n margin-top: 1.25rem;\n\n button {\n flex: 1;\n }\n`\n\nexport const InputWrapper = styled.div`\n flex: 3;\n margin: 0 1.5rem 0 0;\n\n #field {\n margin: 0;\n }\n\n input {\n height: 1.9rem;\n }\n`\n\nexport const SideLogoStyled = styled.div<SideLogoProps>`\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: ${({ logoPosition }) =>\n logoPosition === 'left' ? 'row' : 'row-reverse'};\n gap: 0.6rem;\n\n p {\n color: #191919;\n }\n\n img {\n width: 1.9rem;\n }\n`\n\nexport const ClearInputButton = styled.div`\n display: flex;\n cursor: pointer;\n padding-right: 0.5rem;\n svg {\n width: 1rem;\n height: 1rem;\n }\n`\n","import React from 'react'\nimport styled, { css, keyframes } from 'styled-components'\n\ninterface ProgressBarProps {\n maxFields: number\n mappedFields: number\n}\n\n/*const wiggle = keyframes`\n 0% { transform: rotate(0deg); }\n 25% { transform: rotate(-4deg); }\n 50% { transform: rotate(0deg); }\n 75% { transform: rotate(4deg); }\n 100% { transform: rotate(0deg); }\n`*/\n\n// To move to ProgressBarContainer if we want to animate it\n/*\n ${({ percentage }) =>\n percentage === 100 &&\n css`\n animation: 0.2s ${wiggle} 0.5s;\n `}\n */\n\nconst ProgressBarContainer = styled.div<{ percentage: number }>`\n width: 100%;\n background-color: #f3f3f3;\n border-radius: 5px;\n overflow: hidden;\n margin-top: 0.5rem;\n`\n\nconst Fill = styled.div<{ percentage: number }>`\n height: 10px;\n width: ${(props) => props.percentage}%;\n background-color: ${(props) =>\n props.percentage <= 100 ? '#3fb1f2;' : '#cc2029'};\n transition: width 0.5s;\n`\n\nexport const FieldsProgressBar: React.FC<ProgressBarProps> = ({\n maxFields,\n mappedFields,\n}) => {\n const percentage = (mappedFields / maxFields) * 100\n\n return (\n <ProgressBarContainer percentage={percentage}>\n <Fill percentage={percentage} />\n </ProgressBarContainer>\n )\n}\n","import React from 'react'\nimport { InputField } from '@components/Form/InputField'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport { Trans, useTranslation } from 'react-i18next'\nimport {\n HeaderSearchWrapper,\n TopHeader,\n SubHeader,\n InputWrapper,\n SideLogoStyled,\n ClearInputButton,\n TopHeaderMiddle,\n} from './styled'\nimport { AiOutlineCloseCircle, AiOutlineSearch } from 'react-icons/ai'\nimport { MdOutlineRefresh } from 'react-icons/md'\nimport ReactTooltip from 'react-tooltip'\nimport { FieldsProgressBar } from '@features/nbee/FieldsMappingForm/HeaderSearch/FieldsProgressBar'\nimport { WelcomeMessageProps } from '@features/nbee/FieldsMappingForm'\n\nexport interface HeaderSearchProps {\n totalFields: number\n mappedFields: number\n sourceName: string\n sourceLogoUri: string\n destinationName: string\n destinationLogoUri: string\n showAllFields: boolean\n onShowAllFieldsRequest: (showAllFields: boolean) => void\n inputValue: string\n onInputChange: (value: string) => void\n isInTestScreen?: boolean\n showFilterButton: boolean\n onRefetchFieldRequest: () => void\n isReloadingAllBridgeFields: boolean\n isReadonlyModeEnabled?: boolean\n maxFields?: number\n welcomeMessageProps?: WelcomeMessageProps\n}\n\nexport type SideLogoProps = {\n logoPosition: 'left' | 'right'\n logoUri?: string\n name?: string\n}\n\nconst SideLogo: React.FC<SideLogoProps> = ({ logoPosition, logoUri, name }) => {\n return (\n <SideLogoStyled logoPosition={logoPosition}>\n <img src={logoUri} alt={name} title={name} />\n {name && <p>{name}</p>}\n </SideLogoStyled>\n )\n}\n\nexport const HeaderSearchComponent: React.FC<HeaderSearchProps> = ({\n totalFields,\n mappedFields,\n sourceName,\n sourceLogoUri,\n destinationName,\n destinationLogoUri,\n inputValue,\n onInputChange,\n showAllFields,\n onShowAllFieldsRequest,\n isInTestScreen,\n showFilterButton,\n onRefetchFieldRequest,\n isReloadingAllBridgeFields,\n isReadonlyModeEnabled,\n maxFields,\n welcomeMessageProps,\n}) => {\n const { t } = useTranslation()\n\n return (\n <HeaderSearchWrapper>\n <TopHeader>\n <SideLogo\n logoPosition={'left'}\n name={sourceName}\n logoUri={sourceLogoUri}\n />\n {welcomeMessageProps?.isWelcomeMessageForm ? (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n {welcomeMessageProps.isSmsForm ? (\n <span>\n {t('nbee.fieldsMapping.welcomeMessageSmsDescription')}\n </span>\n ) : (\n <span>\n {t('nbee.fieldsMapping.welcomeMessageEmailDescription')}\n </span>\n )}\n </div>\n ) : null}\n\n {isInTestScreen || !totalFields ? null : (\n <div style={{ textAlign: 'center' }}>\n <TopHeaderMiddle\n isReloadingAllBridgeFields={isReloadingAllBridgeFields}\n >\n {!isReadonlyModeEnabled ? (\n <>\n <ReactTooltip\n id='topbar-refetch'\n place='top'\n type='dark'\n textColor='white'\n effect='solid'\n >\n <span>\n {t('nbee.fieldsMapping.refetchBridgeFieldButton')}\n </span>\n </ReactTooltip>\n <span\n data-tip\n data-for='topbar-refetch'\n onClick={() => {\n onRefetchFieldRequest()\n }}\n >\n <MdOutlineRefresh size={24} />\n </span>\n </>\n ) : null}\n {maxFields ? (\n <>\n <ReactTooltip\n id='max-fields'\n place='top'\n type='dark'\n textColor='white'\n effect='solid'\n >\n <span>\n <Trans\n ns={'all'}\n i18nKey={'nbee.fieldsMapping.fieldCounterLimitation'}\n components={{\n br: <br />,\n }}\n values={{ maxFields: maxFields }}\n />\n </span>\n </ReactTooltip>\n <p\n data-tip\n data-for='max-fields'\n style={{\n color: mappedFields > maxFields ? '#cc2029' : '#121232',\n cursor: 'help',\n }}\n >\n {t('nbee.fieldsMapping.totalMaxField', {\n mappedFields,\n maxFields,\n })}\n </p>\n </>\n ) : (\n t('nbee.fieldsMapping.totalMapped', {\n mappedFields,\n totalFields,\n })\n )}\n </TopHeaderMiddle>\n {maxFields && (\n <div>\n <FieldsProgressBar\n maxFields={maxFields}\n mappedFields={mappedFields}\n />\n </div>\n )}\n </div>\n )}\n <SideLogo\n logoPosition={'right'}\n name={destinationName}\n logoUri={destinationLogoUri}\n />\n </TopHeader>\n {!isInTestScreen && totalFields > 0 ? (\n <SubHeader>\n <InputWrapper>\n <InputField\n $fluid\n name={'search-input'}\n type={'text'}\n placeholder={t('nbee.fieldsMapping.searchFields')}\n value={inputValue}\n onChange={({ target: { value } }) => {\n onInputChange(value)\n }}\n slotLeft={\n <AiOutlineSearch size={'1em'} style={{ marginLeft: '.8rem' }} />\n }\n slotRight={\n inputValue ? (\n <ClearInputButton\n onClick={() => {\n onInputChange('')\n }}\n >\n <AiOutlineCloseCircle />\n </ClearInputButton>\n ) : null\n }\n />\n </InputWrapper>\n {showFilterButton ? (\n <Button\n type={'button'}\n onClick={() => {\n onShowAllFieldsRequest(!showAllFields)\n }}\n $variant={'filter'}\n >\n {showAllFields\n ? t('nbee.fieldsMapping.hideUnmapped')\n : t('nbee.fieldsMapping.showUnmapped')}\n </Button>\n ) : null}\n </SubHeader>\n ) : null}\n </HeaderSearchWrapper>\n )\n}\n","import React, { useContext, useEffect } from 'react'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport { useTranslation } from 'react-i18next'\nimport { usePostTestLead } from '@app/api/postTestLead'\nimport { useFormikContext } from 'formik'\nimport { BridgeFormValues } from 'Nbee'\nimport { InputFeedback } from '@components/Basic/InputFeedback'\nimport { parseApiError } from '@app/api/utils/error'\nimport { PanelPopupContext } from '@components/Panel'\nimport { trackEvent } from '@app/dataTracking'\n\ntype SendTestLeadFeedback = {\n status: 'success' | 'error'\n debugUri?: string\n errorMessage?: string\n}\n\ninterface Props {\n bridgeId: number\n onSendTestLead: ({\n status,\n debugUri,\n errorMessage,\n }: SendTestLeadFeedback) => void\n}\n\nexport const ButtonSendTestLead: React.VFC<Props> = ({\n bridgeId,\n onSendTestLead,\n}) => {\n const { t } = useTranslation()\n const { values, setSubmitting } = useFormikContext<BridgeFormValues>()\n const fieldMappingTestingValues = values.ui?.fieldMappingTesting || []\n const panelContext = useContext(PanelPopupContext)\n\n // test lead can be submitted only when at least one field has a value\n const canSubmit =\n !!fieldMappingTestingValues.length &&\n fieldMappingTestingValues.some((field) => field.value)\n\n const {\n mutate: sendTestLead,\n isLoading: isSendingTestLead,\n error: sendTestLeadApiError,\n data: sendTestResult,\n } = usePostTestLead()\n\n const debugUri = sendTestResult?.data?.debugUri\n\n const submitTestLead = () => {\n if (!canSubmit) {\n return\n }\n\n const testLead = fieldMappingTestingValues\n .filter((field) => {\n return field.value && field.value.trim() !== ''\n }) // filter out fields with empty values from the array\n .map((field) => ({\n fieldId: field.id,\n lastValue: field.value,\n }))\n\n sendTestLead({\n bridgeId: bridgeId,\n requestBody: {\n testLead,\n debug: true,\n },\n })\n }\n\n useEffect(() => {\n setSubmitting(false)\n // api can returns 200 with `result: false` if test lead was not successful\n const returnIsError = sendTestResult && sendTestResult.data.result === false\n const hasDebugError =\n sendTestResult && sendTestResult.data.debugError !== ''\n const debugErrorMsg = hasDebugError ? sendTestResult?.data.debugError : ''\n\n if (returnIsError) {\n onSendTestLead({\n status: 'error',\n debugUri,\n errorMessage: debugErrorMsg,\n })\n return\n }\n\n if (sendTestResult?.data.result) {\n trackEvent({\n eventName: 'TestSuccess',\n step: 'Test',\n feature: 'NBEE',\n })\n onSendTestLead({ status: 'success', debugUri })\n }\n }, [sendTestResult])\n\n // opening up a popup to tell user about auto-mapping (only first time)\n useEffect(() => {\n if (!panelContext.sendPopup) {\n return\n }\n\n panelContext.sendPopup(undefined)\n if (panelContext?.sendPopup && sendTestLeadApiError) {\n trackEvent({\n eventName: 'TestFailure',\n step: 'Test',\n feature: 'NBEE',\n sendEventToIntercom: true,\n })\n panelContext.sendPopup({\n content: (\n <div>\n <InputFeedback\n $status={{\n error: parseApiError(sendTestLeadApiError).message,\n }}\n />\n </div>\n ),\n dismissable: true,\n position: 'floating',\n })\n }\n }, [sendTestLeadApiError])\n\n return (\n <div>\n <Button\n type={'button'}\n $variant={'primary'}\n disabled={!canSubmit || isSendingTestLead}\n $loading={isSendingTestLead}\n onClick={submitTestLead}\n >\n {t('nbee.fieldsMapping.runTest')}\n </Button>\n </div>\n )\n}\n","import { BridgeFormValues, MappedField, BridgePicklistValues } from 'Nbee'\nimport { ApiBridgeFieldsListResponse } from 'BackendApi'\nimport { useEffect } from 'react'\nimport { sendAlertMessage } from '@app/store/actions/ApplicationConfigurationActions'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { useTranslation } from 'react-i18next'\nimport { encodeToBase64 } from '@app/utils/base64'\n\nexport interface FieldMappingMatched {\n initialValues: BridgeFormValues | null\n notFoundFields: {\n destination: string[]\n source: string[]\n }\n}\n\n// This function returns a list of all destination fields to map filled with already mapped (existing in case of edit)\n// or auto mapped values. This list is used as `initialValues` for the fields mapping form.\n// It also checks if some previously mapped fields do not exists anymore in source or destination\n// and fill an array of missing field ids (notFoundFields.destination and notFoundFields.source)\n// The missing values are removed from the initialValues, this means that our initialValues should never includes not existing values\nexport const makeFieldsMappingInitialValuesAndListNotMatchingFields = (\n bridgeFormValues?: BridgeFormValues,\n allBridgeFields?: ApiBridgeFieldsListResponse\n): FieldMappingMatched => {\n const alreadyMappedFields = bridgeFormValues?.fieldsMapping || []\n const autoMappedFields = allBridgeFields?.data?.autoMapping || []\n const allFieldsToMap = allBridgeFields?.data?.destination || []\n\n const mappedDestinationFieldsNotAvailable = alreadyMappedFields\n .filter(\n (value) =>\n !allFieldsToMap.find((field) => field.id === value.destinationFieldId)\n )\n .map((el) => el.destinationFieldId || '')\n\n const mappedSourceFieldsNotAvailable = alreadyMappedFields\n .filter((value) =>\n value.mapping.some(\n (mapping) =>\n mapping.fieldType === 'source' &&\n !allBridgeFields?.data?.source.find(\n (field) => field.id === mapping.sourceFieldId\n )\n )\n )\n .flatMap((el) =>\n el.mapping.map((m) => m.sourceFieldId || '').filter((id) => id)\n )\n\n const filledFieldsMappingValues: MappedField[] = allFieldsToMap\n .map((field) => {\n const existingValue = alreadyMappedFields.find(\n (o) => o.destinationFieldId === field.id\n )\n const autoMapped = autoMappedFields.find(\n (o) => o.destinationFieldId === field.id\n )\n\n const extraDataForUi = {\n destinationFieldLabel: field.label,\n isRequired: field.required || false,\n testLeadValue: '',\n picklist:\n (field.values\n ?.map((v) => ({ text: v.text.toString(), id: v.id.toString() }))\n ?.sort((a, b) =>\n a.text.localeCompare(b.text)\n ) as BridgePicklistValues[]) || [],\n }\n\n if (existingValue) {\n return { ...existingValue, ...extraDataForUi }\n }\n\n if (autoMapped) {\n return { ...autoMapped, mappingType: 'auto', ...extraDataForUi }\n }\n return {\n destinationFieldId: field.id,\n mappingType: 'manual',\n destinationText: '',\n ...extraDataForUi,\n mapping: [\n {\n fieldType: field.values?.length ? 'custom' : 'source',\n sourceFieldId: '',\n text: '',\n formula: null,\n },\n ],\n }\n })\n .sort((a, b) => {\n const indexA = alreadyMappedFields.findIndex(\n (mappedField) => mappedField.destinationFieldId === a.destinationFieldId\n )\n const indexB = alreadyMappedFields.findIndex(\n (mappedField) => mappedField.destinationFieldId === b.destinationFieldId\n )\n\n if (indexA === -1 && indexB === -1) {\n return 0 // Both are new fields, maintain their relative order\n }\n if (indexA === -1) {\n return 1 // `a` is a new field, place it after `b`\n }\n if (indexB === -1) {\n return -1 // `b` is a new field, place it after `a`\n }\n return indexA - indexB // Maintain the order of alreadyMappedFields\n }) as MappedField[]\n\n const clearedFieldMapping = filledFieldsMappingValues.map((mappedField) => ({\n ...mappedField,\n mapping: mappedField.mapping.filter(\n (m) => !mappedSourceFieldsNotAvailable.includes(m.sourceFieldId || '')\n ),\n }))\n\n return {\n initialValues: bridgeFormValues\n ? { ...bridgeFormValues, fieldsMapping: clearedFieldMapping }\n : null,\n notFoundFields: {\n destination: mappedDestinationFieldsNotAvailable,\n source: mappedSourceFieldsNotAvailable,\n },\n }\n}\n// This hook is used to dispatch an alert message when `notFoundFields` has data\nexport const useNotifyUserOfMissingMappedFields = (\n fieldsMappingMatched: FieldMappingMatched | null,\n bridgeId: number | string\n) => {\n const { t } = useTranslation()\n const dispatch = useAppDispatch()\n\n // we make one single array, at this stage we show one generic message that includes both source and destination missing field\n // In future we can work with UX to generate a better message and notify if missing fields are relative to source or destination (or both)\n const notFoundPreviouslyMappedFieldsDestination =\n fieldsMappingMatched?.notFoundFields.destination || []\n const notFoundPreviouslyMappedFieldsSource =\n fieldsMappingMatched?.notFoundFields.source || []\n const notFoundPreviouslyMappedFields = [\n ...notFoundPreviouslyMappedFieldsDestination,\n ...notFoundPreviouslyMappedFieldsSource,\n ]\n\n // this is a workaround: the alert pops-up too often because every time a field refresh is called (inside the form)\n // a new notFoundPreviouslyMappedFields is generated, and since this also sets initialValues can't be memoized.\n // So we store user action when alert is closed\n const encodedFields = encodeToBase64(notFoundPreviouslyMappedFields)\n const persistentKey = `missingFieldsNotification:${bridgeId}`\n const persistentEncodedFields = localStorage.getItem(persistentKey)\n const alreadyNotified = persistentEncodedFields === encodedFields\n\n useEffect(() => {\n if (\n notFoundPreviouslyMappedFields &&\n notFoundPreviouslyMappedFields.length &&\n !alreadyNotified\n ) {\n dispatch(\n sendAlertMessage({\n isDismissable: true,\n message: t('nbee.fieldsMapping.missingMappedFields', {\n listOfNotFoundIds: notFoundPreviouslyMappedFields.join(', '),\n }),\n onClose: () => {\n localStorage.setItem(persistentKey, encodedFields)\n },\n })\n )\n }\n }, [notFoundPreviouslyMappedFields])\n}\n","import React from 'react'\nimport { useTranslation } from 'react-i18next'\nimport styled from 'styled-components'\n\nconst Wrapper = styled.div``\n\nconst ErrorMessage = styled.div`\n color: #db3c3c;\n font-weight: 600;\n`\n\nexport const PopupContentNoSelectOptions: React.VFC = () => {\n const { t } = useTranslation()\n\n return (\n <Wrapper>\n <ErrorMessage>{t('nbee.fieldsMapping.noOptionsError')}</ErrorMessage>\n </Wrapper>\n )\n}\n","import { MappedField } from 'Nbee'\nimport { isFieldMapped } from '@features/nbee/FieldsMappingForm/utils'\n\nexport const sortByFieldLabel = (a: MappedField, b: MappedField) => {\n const aLabel = a.destinationFieldLabel || ''\n const bLabel = b.destinationFieldLabel || ''\n return aLabel.localeCompare(bLabel)\n}\n\nexport const getSortedFields = (\n filteredFields: MappedField[]\n): MappedField[] => {\n const fields = [...filteredFields]\n\n const requiredNotMappedFields = fields\n .filter((f) => f.isRequired && !isFieldMapped(f))\n .sort(sortByFieldLabel)\n\n const requiredMappedFields = fields\n .filter((f) => f.isRequired && isFieldMapped(f))\n .sort(sortByFieldLabel)\n\n const notRequiredNotMappedFields = fields\n .filter((f) => !f.isRequired && !isFieldMapped(f))\n .sort(sortByFieldLabel)\n\n const notRequiredMappedFields = fields\n .filter((f) => !f.isRequired && isFieldMapped(f))\n .sort(sortByFieldLabel)\n\n return [\n ...requiredNotMappedFields,\n ...requiredMappedFields,\n ...notRequiredNotMappedFields,\n ...notRequiredMappedFields,\n ]\n}\n","import * as yup from 'yup'\nimport { MappedField, MappedFieldFormulaParam } from 'Nbee'\n\nexport const makeFieldMappingValidationSchema = () => {\n const welcomeMessageSchema = yup.object({\n subject: yup.string().required('Subject is required'),\n body: yup.string().required('Body is required'),\n })\n\n const mappedItemSchema = yup.lazy((value: MappedField) => {\n if (value.isRequired && value.mapping.length === 0) {\n return yup.object({\n sourceFieldId: yup.string().required('Required'),\n })\n }\n\n return yup.object()\n }) as never // https://github.com/jquense/yup/issues/1283\n\n return yup.object().shape({\n name: yup.string().required(),\n fieldsMapping: yup.array().of(mappedItemSchema),\n templateBasedFieldsMapping: yup.lazy((values) =>\n values ? welcomeMessageSchema : yup.mixed().notRequired()\n ),\n })\n}\n","import styled from 'styled-components'\n\nexport const Header = styled.header`\n width: 100%;\n min-height: 35px;\n padding: 0.5rem 2rem;\n margin-bottom: 2rem;\n background-color: #3fb1f3;\n display: flex;\n align-items: center;\n`\n\nexport const Body = styled.div`\n padding: 0 1rem;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n align-items: center;\n`\n\nexport const Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n padding-bottom: 1rem;\n\n a {\n align-self: flex-end;\n font-size: 0.8rem;\n margin-bottom: 1rem;\n }\n`\n\nexport const Title = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-bottom: 0.9rem;\n\n h2 {\n margin-top: 1.5rem;\n font-size: 1.3rem;\n }\n`\n\nexport const Paragraph = styled.p`\n font-size: 1rem;\n margin-top: 1rem;\n text-align: center;\n color: #363636;\n`\n\nexport const Label = styled.label`\n margin: 1.5rem 0 1rem;\n color: #abb4bd;\n`\n\nexport const ButtonWrapper = styled.div`\n width: 280px;\n margin: 1.5rem 0 1.5rem;\n text-align: center;\n`\n\nexport const Disclaimer = styled.div`\n display: grid;\n grid-template-columns: auto 1fr;\n gap: 1rem;\n max-width: 520px;\n color: #919eab;\n font-size: 0.9rem;\n`\n","import styled from 'styled-components'\n\nexport const Header = styled.header`\n width: 100%;\n min-height: 35px;\n padding: 0.5rem 2rem;\n margin-bottom: 2rem;\n background-color: #3fb1f3;\n display: flex;\n align-items: center;\n`\n\nexport const Body = styled.div`\n padding: 0 1rem;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n align-items: center;\n`\n\nexport const Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n padding-bottom: 1rem;\n\n a {\n align-self: flex-end;\n font-size: 0.8rem;\n margin-bottom: 1rem;\n }\n`\n\nexport const Title = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-bottom: 0.9rem;\n\n h2 {\n margin-top: 1.5rem;\n font-size: 1.3rem;\n }\n`\n\nexport const Paragraph = styled.p`\n font-size: 0.8rem;\n color: #363636;\n`\n\nexport const ButtonWrapper = styled.div`\n margin-left: auto;\n margin-right: auto;\n margin-top: 3.1rem;\n width: 60%;\n`\n","import styled, { css } from 'styled-components'\nimport { Props } from './index'\n\nexport const Header = styled.header`\n width: 100%;\n min-height: 35px;\n padding: 0.5rem 2rem;\n margin-bottom: 2rem;\n background-color: #3fb1f3;\n display: flex;\n align-items: center;\n position: fixed;\n z-index: 10;\n`\n\nexport const TableHeader = styled.div<Pick<Props, 'isHeaderStuck'>>`\n padding: 0.8rem 0.1rem;\n font-size: 0.8rem;\n color: #191919;\n position: sticky;\n top: 35px;\n width: 100vw;\n background-color: #fff;\n z-index: 10;\n\n ${({ isHeaderStuck }) =>\n isHeaderStuck\n ? css`\n box-shadow: 0px 1px 10px 0px rgba(25, 25, 25, 0.1);\n `\n : null}\n`\n\nexport const ElementWrapper = styled.div`\n display: grid;\n grid-template-columns: 1fr 3fr 3fr;\n max-width: 600px;\n margin: 0 auto;\n\n div {\n padding-left: 0.75rem;\n font-weight: 600;\n }\n`\n\nexport const Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n padding-bottom: 1rem;\n`\n\nexport const Body = styled.div`\n margin-top: 4rem;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n align-items: center;\n .custom-tooltip {\n width: 25rem;\n box-shadow: 0px 4px 10px 0px #808080;\n border-radius: 5px;\n }\n`\n\nexport const Title = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-bottom: 0.9rem;\n\n h2 {\n margin-top: 1.5rem;\n font-size: 1.3rem;\n }\n`\n\nexport const BodyInner = styled.div`\n width: 100%;\n padding-bottom: 80px;\n`\n\nexport const WarningMessage = styled.div`\n margin-top: 2rem;\n color: #cc2029;\n font-weight: 600;\n`\n\nexport const UserFeedback = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n margin-top: 1rem;\n\n p {\n margin: 0 1rem 0 0;\n }\n\n svg {\n margin-right: 1rem;\n cursor: pointer;\n }\n`\n\nexport const Paragraph = styled.p`\n font-size: 0.8rem;\n color: #363636;\n margin-bottom: 1.5rem;\n padding: 0 1rem;\n`\n\nexport const ButtonWrapper = styled.div`\n display: flex;\n justify-content: center;\n gap: 2rem;\n button {\n width: 25%;\n }\n`\n\nexport const FooterWrapper = styled.div`\n min-height: 60px;\n padding: 1.5rem 0;\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgb(255 255 255 / 60%);\n backdrop-filter: blur(5px);\n z-index: ${({ theme }) => theme.zIndex.panelFooter};\n`\n","import styled from 'styled-components'\n\nexport const Header = styled.header`\n width: 100%;\n min-height: 35px;\n padding: 0.5rem 2rem;\n margin-bottom: 2rem;\n background-color: #3fb1f3;\n display: flex;\n align-items: center;\n`\n\nexport const Body = styled.div`\n padding: 0 1rem;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-top: 4rem;\n`\n\nexport const Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n padding-bottom: 1rem;\n\n a {\n align-self: flex-end;\n font-size: 0.8rem;\n margin-bottom: 1rem;\n }\n`\n\nexport const Title = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-bottom: 0.9rem;\n\n h2 {\n margin-top: 1.5rem;\n font-size: 1.1rem;\n }\n`\n\nexport const Paragraph = styled.p`\n font-size: 0.8rem;\n color: #363636;\n margin: 1rem 0;\n`\n\nexport const ButtonWrapper = styled.div`\n width: 280px;\n margin-top: 3.1rem;\n`\n","import React from 'react'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport { Button as ButtonBrand } from '@components/Basic/Button'\nimport { useTranslation } from 'react-i18next'\n\ninterface Props {\n isLoading?: boolean\n isDisabled: boolean\n appName: string\n isStepName: boolean\n action?: 'update' | 'save-new'\n onSubmitRequest?: () => void\n}\n\n// This is just a wrapper around our 2 buttons\n// in case app name contains either `facebook` or `google`, we show the branded button\n// submit action and behaviours are the same\n// this only happens on first step, where action is \"authorize\"\nexport const SubmitButton: React.VFC<Props> = ({\n isLoading,\n isDisabled,\n appName,\n isStepName,\n action,\n onSubmitRequest,\n}) => {\n const { t } = useTranslation()\n const isFacebook = appName.toLowerCase().includes('facebook')\n const isGoogle = appName.toLowerCase().includes('google')\n\n // in case we are in the first step, we need to show a branded version of the button for google or facebook\n // in future we might want to handle other branded button variants, in case we'll add new partners\n const showBrandedOAuthButton = (isGoogle || isFacebook) && !isStepName\n const brandedButtonStyle = isGoogle\n ? 'google'\n : isFacebook\n ? 'facebook'\n : 'primary'\n\n return showBrandedOAuthButton ? (\n <ButtonBrand\n type={'submit'}\n disabled={isDisabled}\n $loading={isLoading}\n $variant={brandedButtonStyle}\n $fluid\n >\n {t('common.authorize')}\n </ButtonBrand>\n ) : (\n <Button\n type={'submit'}\n $variant={action === 'save-new' ? 'secondary' : 'primary'}\n $size={'standard'}\n disabled={isDisabled}\n $loading={isLoading}\n onClick={onSubmitRequest}\n >\n {action === 'update'\n ? t('integrationAuthPopup.integrationUpdate')\n : action === 'save-new'\n ? t('integrationAuthPopup.integrationSaveAsNew')\n : isStepName\n ? t('common.continue')\n : t('common.authorize')}\n </Button>\n )\n}\n","import React from 'react'\nimport { useField } from 'formik'\nimport { IntegrationFormField } from 'Nbee'\nimport {\n InputFeedback,\n InputFeedbackStatus,\n} from '@components/Basic/InputFeedback'\nimport { InputDomain } from '@components/Form/InputDomain'\n\ninterface Props {\n index: number\n isLoading?: boolean\n}\n\nexport const CredentialFieldDomain: React.FC<Props> = ({\n index,\n isLoading,\n}) => {\n const [{ value: field, onBlur }, { touched, error }, { setValue }] =\n useField<IntegrationFormField>(`credentials.${index}`)\n\n const [_, __, { setValue: setTriggerSettingsUpdate }] = useField<number>(\n `ui.triggerSettingsUpdate`\n )\n\n // safe to cast since if we load this componnet value must be a string\n const currentValue = field.value as string\n\n const parts = (field.format || 'https://xxxx.domain.com').split('xxx')\n // error could a string or an object with value: string\n const parsedError = error ? (error as any).value || error : null\n const status: InputFeedbackStatus | undefined =\n touched && error\n ? {\n error: parsedError,\n }\n : undefined\n\n const handleFreshContentRequest = () => {\n if (field.hasChild) {\n setTriggerSettingsUpdate(new Date().getTime())\n }\n }\n\n return (\n <div>\n <InputDomain\n id={field.id}\n $protocolLabel={parts[0] || 'https://'}\n $domainLabel={parts[1] || '.domain.com'}\n value={currentValue}\n onChange={({ target: { value } }) => {\n setValue({\n ...field,\n value,\n })\n }}\n onBlur={(e) => {\n handleFreshContentRequest()\n onBlur(e)\n }}\n disabled={field.hasChild && isLoading}\n />\n {status ? <InputFeedback $status={status} /> : null}\n </div>\n )\n}\n","import React from 'react'\nimport { InputField } from '@components/Form/InputField'\nimport { useField } from 'formik'\nimport { Textarea } from '@components/Form/Textarea'\nimport { IntegrationFormField } from 'Nbee'\nimport { InputFeedbackStatus } from '@components/Basic/InputFeedback'\n\ninterface Props {\n index: number\n isLoading?: boolean\n}\n\nexport const CredentialFieldInput: React.FC<Props> = ({ index, isLoading }) => {\n const [{ value: field, onBlur }, { touched, error }, { setValue }] =\n useField<IntegrationFormField>(`credentials.${index}`)\n\n const [_, __, { setValue: setTriggerSettingsUpdate }] = useField<number>(\n `ui.triggerSettingsUpdate`\n )\n\n const fieldType = field.type\n // safe to cast since if we load this componnet value must be a string\n const currentValue = field.value as string\n\n // error could a string or an object with value: string\n const parsedError = error ? (error as any).value || error : null\n const status: InputFeedbackStatus | undefined =\n touched && error\n ? {\n error: parsedError,\n }\n : undefined\n\n const handOnChange = (value: string) => {\n setValue({\n ...field,\n value,\n })\n }\n\n const handleFreshContentRequest = () => {\n if (field.hasChild) {\n setTriggerSettingsUpdate(new Date().getTime())\n }\n }\n\n return (\n <div>\n {fieldType === 'textarea' ? (\n <Textarea\n id={field.id}\n name={field.id}\n value={currentValue}\n onChange={({ target: { value } }) => {\n handOnChange(value)\n }}\n onBlur={(e) => {\n handleFreshContentRequest()\n onBlur(e)\n }}\n $status={status}\n disabled={field.hasChild && isLoading}\n />\n ) : (\n <InputField\n type={\n fieldType === 'password'\n ? 'password'\n : fieldType === 'email'\n ? 'email'\n : fieldType === 'url'\n ? 'url'\n : fieldType === 'number'\n ? 'number'\n : 'text'\n }\n autoComplete={fieldType === 'password' ? 'new-password' : 'off'}\n id={field.id}\n name={field.id}\n value={currentValue}\n onChange={({ target: { value } }) => {\n handOnChange(value)\n }}\n onBlur={(e) => {\n handleFreshContentRequest()\n onBlur(e)\n }}\n $status={status}\n disabled={field.hasChild && isLoading}\n />\n )}\n </div>\n )\n}\n","import React from 'react'\nimport { IntegrationFormField } from 'Nbee'\nimport { useField } from 'formik'\nimport { InputFeedbackStatus } from '@components/Basic/InputFeedback'\nimport { InputSmartCreatableSelect } from '@components/Form/InputSmartSelect/Creatable'\n\ninterface Props {\n index: number\n isLoading?: boolean\n}\n\nexport const CredentialFieldSmartCreatableSelect: React.FC<Props> = ({\n index,\n isLoading,\n}) => {\n const [{ value: field, onBlur }, { touched, error }, { setValue }] =\n useField<IntegrationFormField>(`credentials.${index}`)\n const [_, __, { setValue: setTriggerSettingsUpdate }] = useField<number>(\n `ui.triggerSettingsUpdate`\n )\n\n const defaultValue = field.value as unknown as string | string[]\n\n // error could a string or an object with value: string\n const parsedError = error ? (error as any).value || error : null\n const status: InputFeedbackStatus | undefined =\n touched && error\n ? {\n error: parsedError,\n }\n : undefined\n\n const handleFreshContentRequest = () => {\n if (field.hasChild) {\n setTriggerSettingsUpdate(new Date().getTime())\n }\n }\n\n return (\n <div>\n <InputSmartCreatableSelect\n isClearable={false}\n defaultValue={\n // we must be sure default is an array or string\n Array.isArray(defaultValue) ? defaultValue : [defaultValue]\n }\n $status={status}\n placeholder={'type to add...'}\n onSelect={(newValues) => {\n setValue({\n ...field,\n value: newValues,\n })\n }}\n onBlur={(e) => {\n handleFreshContentRequest()\n onBlur(e)\n }}\n isDisabled={field.hasChild && isLoading}\n />\n </div>\n )\n}\n","import React, { useEffect } from 'react'\nimport {\n InputSmartSelect,\n SelectValue,\n} from '@components/Form/InputSmartSelect'\nimport { IntegrationFormField, IntegrationFormValues } from 'Nbee'\nimport { useField, useFormikContext } from 'formik'\nimport {\n InputFeedback,\n InputFeedbackStatus,\n} from '@components/Basic/InputFeedback'\nimport { Loader } from '@components/Basic/Loader'\nimport { BiRefresh } from 'react-icons/bi'\nimport { TinyTextualButton } from '@components/Basic/TinyTextualButton'\nimport { useTranslation } from 'react-i18next'\n\ninterface Props {\n index: number\n isLoading?: boolean\n apiHasError: boolean\n}\n\nexport const CredentialFieldSmartSelect: React.FC<Props> = ({\n index,\n isLoading,\n apiHasError,\n}) => {\n const { t } = useTranslation()\n const [{ value: field, onBlur }, { touched, error }, { setValue }] =\n useField<IntegrationFormField>(`credentials.${index}`)\n const { values, validateForm, setFieldValue } =\n useFormikContext<IntegrationFormValues>()\n\n const selectOptions: SelectValue[] = (field.selectValues || []).map(\n (option) => ({\n label: typeof option === 'string' ? option : option.text,\n value: typeof option === 'string' ? option : option.id,\n })\n )\n const currentFieldValue =\n field.value || field.value === 0\n ? selectOptions.find((option) => option.value === field.value)\n : undefined\n\n // When the field is required and it has only one option available,\n // it pre-select that option and show the field in a read-only mode (disabled).\n const isSingleValue = field.selectValues?.length === 1\n\n const handleFreshContentRequest = () => {\n setTimeout(() => {\n // just to be sure formik state is updated\n setFieldValue(`ui.triggerSettingsUpdate`, new Date().getTime())\n }, 100)\n }\n\n useEffect(() => {\n if (!field.isRequired) {\n return\n }\n // if we have a value there's nothing to set\n if (currentFieldValue && currentFieldValue.value) {\n return\n }\n\n if (isSingleValue) {\n // ok to cast as any, since we checked the existance with isSingleValue\n const singleDefaultValue = (field.selectValues as any)[0].id\n setValue({\n ...field,\n value: singleDefaultValue,\n })\n if (field.hasChild) {\n handleFreshContentRequest()\n }\n\n setTimeout(() => {\n // we need to re-validate the form since pre-selected values might not be registered\n validateForm()\n }, 200)\n }\n }, [isSingleValue])\n\n // if value is not present enymore in the list we need to remove it from formik state\n // example we had a dropdown child that returns different options depending on parent choice\n useEffect(() => {\n const availableOptionKeys = selectOptions.map((o) => o.value)\n const currentValue = currentFieldValue?.value as string\n if (currentValue && !availableOptionKeys.includes(currentValue)) {\n setValue({\n ...field,\n value: '',\n })\n }\n }, [selectOptions])\n\n // error could a string or an object with value: string\n const parsedError = error ? (error as any).value || error : null\n const fieldValidationStatus: InputFeedbackStatus | undefined =\n touched && error\n ? {\n error: parsedError,\n }\n : undefined\n\n const isRefreshingFromApi = Boolean(\n values.ui?.refresh && values.ui.refresh.includes(field.id)\n )\n\n return (\n <div style={{ position: 'relative' }}>\n {isRefreshingFromApi && !apiHasError && <Loader $active $dimmer />}\n <InputSmartSelect\n isClearable={false}\n initialValues={selectOptions}\n defaultValue={currentFieldValue}\n key={currentFieldValue?.value}\n isDisabled={isSingleValue || (field.hasChild && isLoading)}\n tooltipMessage={\n isSingleValue && !isLoading\n ? t('common.selectDisabledWithSingleOption')\n : undefined\n }\n onSelect={(selectedValue) => {\n const newValue = selectedValue as SelectValue | null\n setValue({\n ...field,\n value: newValue?.value || '',\n })\n if (field.hasChild) {\n handleFreshContentRequest()\n }\n }}\n onBlur={onBlur}\n />\n\n {/* Following block shows a grid with validation error message and refresh icon */}\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '1fr auto',\n gap: '1rem',\n }}\n >\n {fieldValidationStatus ? (\n <InputFeedback $status={fieldValidationStatus} />\n ) : (\n <div />\n )}\n {field.refreshable ? (\n <div style={{ textAlign: 'right' }}>\n <TinyTextualButton\n onClick={() => {\n // we prepare the request to get fresh content (not cached) from api for current field id\n setFieldValue('ui.refresh', [field.id])\n // we send the api request\n handleFreshContentRequest()\n }}\n disabled={isLoading}\n >\n <BiRefresh /> {t('nbee.bridgeBuilder.refreshDropdownListCta')}\n </TinyTextualButton>\n </div>\n ) : null}\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { InputToggle } from '@components/Form/InputToggle'\nimport { useField } from 'formik'\nimport { IntegrationFormField } from 'Nbee'\nimport {\n InputFeedback,\n InputFeedbackStatus,\n} from '@components/Basic/InputFeedback'\n\ninterface Props {\n index: number\n isLoading?: boolean\n}\n\nexport const CredentialFieldToggle: React.FC<Props> = ({\n index,\n isLoading,\n}) => {\n const [{ value: field, onBlur }, { touched, error }, { setValue }] =\n useField<IntegrationFormField>(`credentials.${index}`)\n const [_, __, { setValue: setTriggerSettingsUpdate }] = useField<number>(\n `ui.triggerSettingsUpdate`\n )\n\n const isChecked = Boolean(field.value) || false\n\n // error could a string or an object with value: string\n const parsedError = error ? (error as any).value || error : null\n const status: InputFeedbackStatus | undefined =\n touched && error\n ? {\n error: parsedError,\n }\n : undefined\n\n const handleFreshContentRequest = () => {\n if (field.hasChild) {\n setTimeout(() => {\n // just to be sure formik state is updated\n setTriggerSettingsUpdate(new Date().getTime())\n }, 100)\n }\n }\n\n return (\n <div>\n <InputToggle\n onChange={() => {\n setValue({\n ...field,\n value: !isChecked,\n })\n handleFreshContentRequest()\n }}\n $isChecked={isChecked}\n $labelRight={field.label}\n $variant={'primary'}\n onBlur={onBlur}\n disabled={field.hasChild && isLoading}\n />\n {status ? <InputFeedback $status={status} /> : null}\n </div>\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport {\n InputSmartSelect,\n SelectValue,\n} from '@components/Form/InputSmartSelect'\nimport { IntegrationFormField, IntegrationFormValues } from 'Nbee'\nimport { useField, useFormikContext } from 'formik'\nimport { Loader } from '@components/Basic/Loader'\nimport { useTranslation } from 'react-i18next'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport { InputWrapper } from '@features/nbee/IntegrationCredentialsContent/styled'\nimport { useSendCode } from '@app/api/postSendCode'\nimport { ApiUserVerifiedEmailsObj } from '@app/@typings/Api/user'\nimport { Modal } from '@components/Basic/Modal'\nimport styled from 'styled-components'\nimport ReactInputVerificationCode from 'react-input-verification-code'\nimport { useVerifyCode } from '@app/api/postVerifyCode'\n\nconst emailRegex =\n /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\n\nconst ModalInnerWrapper = styled.div`\n margin: 0 auto;\n line-height: 2em;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n max-width: 400px;\n text-align: center;\n --ReactInputVerificationCode-itemWidth: 2.5rem;\n --ReactInputVerificationCode-itemHeight: 3.5rem;\n\n .ReactInputVerificationCode__item {\n position: relative;\n color: #22a7f0;\n font-weight: 800;\n // box-shadow: none;\n }\n\n .ReactInputVerificationCode__item.is-active {\n // box-shadow: none;\n }\n\n .ReactInputVerificationCode__item:after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n bottom: 0;\n right: 0;\n height: 3px;\n // background-color: #ebebeb;\n transition: background-color 0.2s ease-out;\n }\n\n .ReactInputVerificationCode__item.is-active:after {\n background-color: #046cde;\n }\n`\n\ninterface Props {\n index: number\n isLoading?: boolean\n apiHasError: boolean\n handleAddRecipient: (typeId: string) => void\n isLast?: boolean\n idx?: number\n emailsUpdated: ApiUserVerifiedEmailsObj[] | undefined\n handleNewValue: (newValue: ApiUserVerifiedEmailsObj) => void\n handleEmailsRefetch: () => void\n}\n\nexport const CredentialFieldVerifyEmail: React.FC<Props> = ({\n index,\n apiHasError,\n handleAddRecipient,\n isLast,\n idx,\n emailsUpdated,\n handleNewValue,\n handleEmailsRefetch,\n}) => {\n const { t } = useTranslation()\n const [{ value: field }, { error }, { setValue }] =\n useField<IntegrationFormField>(`credentials.${index}`)\n const { values } = useFormikContext<IntegrationFormValues>()\n const [newValue, setNewValue] = useState<ApiUserVerifiedEmailsObj>()\n const [showModal, toggleShowModal] = useState(false)\n const [code, setCode] = useState('')\n const handleOpenModal = () => toggleShowModal(true)\n const handleCloseModal = () => toggleShowModal(false)\n const [showAddButton, setShowAddButton] = useState(false)\n const [showRemoveButton, setShowRemoveAddButton] = useState(true)\n const [allVerified, setAllVerified] = useState(false)\n\n const emailValidation =\n field.type === 'validate_email' || field.type === 'validate_email_multi'\n const isMulti = field.type === 'validate_email_multi'\n\n const { mutate: sendCode, isLoading: sendCodeLoading } = useSendCode()\n\n const {\n data: verifyCodeResponse,\n mutate: verifyCode,\n isLoading: verifyCodeLoading,\n isError: verifyCodeError,\n } = useVerifyCode()\n\n const selectOptions: SelectValue[] = emailsUpdated\n ? emailsUpdated.map((option) => ({\n label: option.email,\n value: option.email,\n isVerified: option.status === 'verified',\n }))\n : []\n\n const currentFieldValue =\n field.type === 'validate_email' && field.value\n ? selectOptions.find((option) => option.value === field.value)\n : Array.isArray(field.value as string[]) && idx !== undefined\n ? selectOptions.find(\n (option) => option.value === (field.value as string[])[idx]\n )\n : undefined\n\n const handleCodeSubmit = () => {\n if (code && currentFieldValue) {\n verifyCode({\n email: currentFieldValue.value as string,\n code: code as string,\n })\n }\n }\n\n const handleInputChange = (inputValue: string) => {\n setNewValue({\n email: inputValue,\n status: 'unverified',\n })\n }\n\n const handleRemoveRecipient = () => {\n if (Array.isArray(field.value)) {\n setValue({\n ...field,\n value:\n field.value.length === 1\n ? ['']\n : field.value.filter((item, index) => idx !== index),\n })\n if (!currentFieldValue?.isVerified) {\n // add here the logic to remove the value from emailsDataState\n handleEmailsRefetch()\n }\n } else {\n setValue({\n ...field,\n value: '',\n })\n }\n }\n\n const handleKeyDown = () => {\n if (newValue && !emailRegex.test(newValue?.email)) {\n return\n }\n if (newValue && emailsUpdated) {\n if (emailsUpdated.some((item) => item.email === newValue.email)) {\n return\n }\n if (Array.isArray(field.value) && field.value.includes(newValue.email)) {\n return\n }\n handleNewValue(newValue)\n if (Array.isArray(field.value)) {\n setValue({\n ...field,\n value:\n idx !== undefined\n ? (() => {\n field.value[idx] = newValue?.email as string\n return [...field.value]\n })()\n : '',\n })\n } else {\n setValue({ ...field, value: newValue.email })\n }\n }\n }\n\n useEffect(() => {\n if (field.isRequired && typeof idx === 'number') {\n let email: string\n if (field.type === 'validate_email') {\n email = field.value as string\n } else {\n email = (field.value as string[])[idx]\n }\n\n const emailExists = emailsUpdated?.some((data) => data.email === email)\n\n if (!emailExists && email !== '') {\n const newValue = {\n email,\n status: 'unverified',\n created_at: undefined,\n updated_at: undefined,\n }\n handleNewValue(newValue)\n }\n }\n }, [field.value, idx, emailsUpdated])\n\n useEffect(() => {\n if (\n (Array.isArray(field.value) &&\n field.value.length === 1 &&\n field.value[0] === '') ||\n field.value === ''\n ) {\n setShowRemoveAddButton(false)\n } else setShowRemoveAddButton(true)\n }, [field])\n\n const handleVerifyEmail = () => {\n if (currentFieldValue) {\n sendCode({ email: currentFieldValue.value as string })\n handleOpenModal()\n }\n }\n\n useEffect(() => {\n const hasUnverifiedEmail = emailsUpdated?.some(\n (emailData) =>\n emailData.email === currentFieldValue?.value &&\n emailData.status === 'unverified'\n )\n if (hasUnverifiedEmail) {\n setAllVerified(false)\n } else {\n setAllVerified(true)\n }\n }, [emailsUpdated])\n\n useEffect(() => {\n if (isLast && currentFieldValue && allVerified) {\n setShowAddButton(true)\n }\n }, [currentFieldValue, isLast])\n\n useEffect(() => {\n if (verifyCodeResponse === 1) {\n handleCloseModal() // closes out the modal when the email was successfully validated\n handleEmailsRefetch()\n }\n }, [verifyCodeResponse])\n\n const isRefreshingFromApi = Boolean(\n values.ui?.refresh && values.ui.refresh.includes(field.id)\n )\n\n return (\n <div style={{ position: 'relative' }}>\n {isRefreshingFromApi && !apiHasError && <Loader $active $dimmer />}\n <InputWrapper isVerified={currentFieldValue?.isVerified}>\n <InputSmartSelect\n placeholder={'Select or type a new email'}\n noIcon\n emailValidation={emailValidation}\n isSearchable={emailValidation}\n isClearable={false}\n initialValues={selectOptions}\n defaultValue={currentFieldValue}\n key={currentFieldValue?.value}\n noOptionsMessageText={t(\n 'nbee.bridgeBuilder.inputEmailValidationPlaceholder'\n )}\n onSelect={(selectedValue) => {\n const newValue = selectedValue as SelectValue | null\n if (field.type === 'validate_email') {\n setValue({\n ...field,\n value: newValue?.value || '',\n })\n } else {\n if (newValue?.value === currentFieldValue?.value) {\n return\n }\n if (Array.isArray(field.value)) {\n if (!newValue?.value) {\n return\n }\n const strings = field.value.map(String)\n if (strings.includes(String(newValue?.value))) {\n setValue({\n ...field,\n value: [...field.value.slice(0, -1), ''],\n })\n } else {\n setValue({\n ...field,\n value:\n field.value.length === 0\n ? [newValue?.value as string]\n : idx !== undefined\n ? (() => {\n field.value[idx] = newValue?.value as string\n return [...field.value]\n })()\n : '',\n })\n }\n }\n }\n }}\n onBlur={handleKeyDown}\n onInputChange={handleInputChange}\n keyDown={(e) => {\n if (e.key === 'Enter') handleKeyDown()\n }}\n isVerified={currentFieldValue?.isVerified}\n />\n {!currentFieldValue?.isVerified && currentFieldValue?.value && (\n <Button\n onClick={handleVerifyEmail}\n type={'button'}\n $variant={'link-primary'}\n >\n Verify email\n </Button>\n )}\n </InputWrapper>\n <div\n style={\n showAddButton || showRemoveButton\n ? {\n display: 'flex',\n justifyContent: 'space-between',\n marginTop: '.2rem',\n }\n : {}\n }\n >\n {isMulti && showAddButton ? (\n <>\n <Button\n type={'button'}\n style={{ padding: '.2rem .1rem', fontSize: '12px' }}\n $variant={'link-primary'}\n onClick={() => {\n handleAddRecipient(field.id)\n }}\n >\n {t('nbee.bridgeBuilder.integrationAddInput')}\n </Button>\n </>\n ) : (\n <div></div>\n )}\n {showRemoveButton && (\n <Button\n type={'button'}\n style={{\n padding: '.2rem .1rem',\n fontSize: '12px',\n color: '#fe2c55',\n }}\n $variant={'link-primary'}\n onClick={handleRemoveRecipient}\n >\n Remove\n </Button>\n )}\n </div>\n {showModal && (\n <Modal\n isResizable={false}\n isOpen={showModal}\n onCloseModal={handleCloseModal}\n >\n <ModalInnerWrapper>\n <h3 style={{ fontWeight: 500 }}>Email Verification</h3>\n <p>\n An email verification code has been sent to {''}\n {newValue && newValue.email}\n </p>\n <div style={{ marginBottom: '1.5em' }}>\n <ReactInputVerificationCode\n autoFocus={true}\n length={6}\n onChange={setCode}\n value={code}\n placeholder={''}\n type={'text'}\n />\n </div>\n\n {verifyCodeError && (\n <p style={{ color: 'red', marginBottom: '1.5em' }}>\n {\"It looks like you've inserted an invalid code.\"}\n </p>\n )}\n\n {(verifyCodeLoading || sendCodeLoading) && (\n <Loader $active $dimmer $size={'large'} />\n )}\n\n <Button\n $variant={'primary'}\n style={{ marginBottom: '1.5em', width: '80%' }}\n onClick={handleCodeSubmit}\n >\n Verify Email\n </Button>\n\n <Button\n $variant={'link-primary'}\n style={{ marginBottom: '1.5em' }}\n onClick={() =>\n currentFieldValue &&\n sendCode({\n email: currentFieldValue.value as string,\n })\n }\n >\n {\"Didn't receive the code? Resend\"}\n </Button>\n </ModalInnerWrapper>\n </Modal>\n )}\n\n {/* Following block shows a grid with validation error message and refresh icon */}\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '1fr auto',\n gap: '1rem',\n }}\n ></div>\n </div>\n )\n}\n","import React from 'react'\nimport { InputField } from '@components/Form/InputField'\nimport { useField } from 'formik'\nimport styled from 'styled-components'\n\nexport const IntegrationName = styled.div`\n display: inline-grid;\n align-items: center;\n grid-template-columns: 1fr auto;\n gap: 0.2rem;\n padding: 0.67857143em 1em; /* to emulate same input sizing */\n > * {\n padding: 0.3rem 0.5rem;\n }\n\n svg {\n cursor: pointer;\n }\n`\n\ninterface Props {\n appName: string\n}\n\nexport const IntegrationNameInput: React.FC<Props> = ({ appName }) => {\n const [{ value, onBlur, onChange, name }, { touched, error }] =\n useField<string>(`name`)\n\n return (\n <div>\n <InputField\n name={name}\n type={'text'}\n value={value}\n $hasMargin\n onChange={onChange}\n onBlur={onBlur}\n placeholder={appName ? `ex: ${appName}` : undefined}\n $status={touched && error ? { error } : undefined}\n />\n </div>\n )\n}\n","import { ApiSettingValue } from 'BackendApi'\nimport { useEffect } from 'react'\nimport { makeIntegrationFormItemFromApiSchemaField } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/utils'\nimport { useFormikContext } from 'formik'\nimport { IntegrationFormValues } from 'Nbee'\nimport { useRetrieveAppCredentials } from '@app/api/postRetrieveAppCredentials'\n\n// every time a field who has child as true is updated it will trigger also a change\n// in formik state `values.ui.triggerSettingsUpdate` that will trigger a new post calll\n// to retrieve new credential settings\nexport const useRefetchCredentialSchema = (appId: number) => {\n const { values, setValues } = useFormikContext<IntegrationFormValues>()\n const {\n data: appAuthSchemaResponse,\n mutate: retrieveAuthSchema,\n isLoading: isLoadingAppAuthSchema,\n error: errorApiAppAuthSchema,\n } = useRetrieveAppCredentials()\n\n const authSchemaApiRequest: ApiSettingValue[] = values.credentials\n // .filter((c) => c.value !== '')\n .map(({ id, value }) => ({\n key: id,\n value,\n }))\n\n // every time we detect a change on `ui.triggerSettingsUpdate` we retrieve new schema\n const triggerFieldUpdates = values.ui?.triggerSettingsUpdate\n useEffect(() => {\n // we execute this also on mount so we get the updated values with default set\n retrieveAuthSchema({\n appId,\n settings: authSchemaApiRequest,\n refresh: values.ui?.refresh || [],\n })\n }, [triggerFieldUpdates])\n\n // every time a new schema is returned from server we update formik (and UI) state\n useEffect(() => {\n const newFieldsFromApi = appAuthSchemaResponse?.data?.credentials?.fields\n if (newFieldsFromApi) {\n //\n // we adapt new fields from api to form values and fill them with existing content\n const newFormCredentialsValues = newFieldsFromApi.map((field) => {\n // We found the actual value of the field so we can \"attach\" it to the new fetched schema\n const existingFieldFromFormValues = authSchemaApiRequest.find(\n ({ key }) => key === field.id\n )\n // It's also possible that an existing value is not yet in the formik state, bacause it's part of\n // an already saved integration but not yet in schema, since it was child of another field.\n // This is way we kept data of the existing integration (from api) in formik value under `ui.existingIntegrationCredentials`\n // So se can retrive it once we have the updated schema with the relative child\n const existingFieldFromApiValues =\n values.ui?.existingIntegrationCredentials?.find(\n ({ key }) => key === field.id\n )\n\n // Now finally we can make field obj that will be store in formik state\n return makeIntegrationFormItemFromApiSchemaField({\n field,\n existingField:\n existingFieldFromFormValues || existingFieldFromApiValues,\n })\n })\n\n setValues(\n {\n ...values,\n credentials: newFormCredentialsValues,\n ui: {\n ...values.ui,\n refresh: [], // we always reset the refresh array to be sure we don't call for cache invalidation when not requested\n },\n },\n true\n )\n }\n }, [appAuthSchemaResponse])\n\n return {\n isLoadingAppAuthSchema,\n errorApiAppAuthSchema,\n }\n}\n","import * as yup from 'yup'\nimport { IntegrationFormField } from 'Nbee'\nimport t from 'public/locales/en-US.json'\n\nexport const makeAuthCredentialValidationSchema = (isStepName: boolean) => {\n const mappedItemSchema = yup.lazy((field: IntegrationFormField) => {\n const yupFieldArray =\n field.format === 'email'\n ? yup\n .array()\n .of(\n yup\n .string()\n .email('Invalid email format')\n .typeError('Invalid email format')\n )\n : yup.array().of(yup.string())\n const yupFieldSchema =\n field.type === 'email'\n ? yup\n .string()\n .email('Invalid email format')\n .typeError('Invalid email format')\n : field.type === 'toggle'\n ? yup.boolean().typeError('Invalid format')\n : field.type === 'tags' || field.type === 'validate_email_multi'\n ? yupFieldArray\n : yup.string().typeError('Invalid format')\n\n // not required, early return\n if (!field.isRequired) {\n return yup.object().shape({\n value: yupFieldSchema,\n })\n }\n\n const a = yup.array().of(yup.string())\n const isEmptyArray = Array.isArray(field.value) && !field.value.length\n if (isEmptyArray || !field.value) {\n return yup.object().shape({\n value:\n field.type === 'tags'\n ? yupFieldArray.min(1, t.common.genericFieldIsRequired)\n : yupFieldSchema.required(t.common.genericFieldIsRequired),\n })\n }\n\n return yup.object().shape({\n value: yupFieldSchema,\n })\n }) as never // https://github.com/jquense/yup/issues/1283\n\n return yup.object().shape({\n name: isStepName\n ? yup.string().required(t.common.genericFieldIsRequired)\n : yup.string(),\n credentials: yup.array().of(mappedItemSchema),\n })\n}\n","import React, { useState } from 'react'\nimport ReactTooltip from 'react-tooltip'\nimport { StyledAuthorizationPopup } from './styled'\nimport { useGetAppById } from '@app/api/getAppById'\nimport ReactPlayer from 'react-player'\nimport { Modal } from '@components/Basic/Modal'\nimport { useTranslation } from 'react-i18next'\nimport { Loader } from '@components/Basic/Loader'\nimport { trackEvent } from '@app/dataTracking'\nimport { ReactComponent as VideoIcon } from '@assets/images/video_tutorial.svg'\nimport { ReactComponent as DocIcon } from '@assets/images/manual.svg'\nimport { ReactComponent as HelpCenter } from '@assets/images/support.svg'\nimport { helpCenterUrl } from '@app/App'\n\nconst { IconsWrapper, IconRow, InfoSectionWrapper, InfoSectionTitle } =\n StyledAuthorizationPopup\n\ninterface Props {\n appId: number\n integrationId?: number\n integrationName?: string\n bridgeId?: number\n}\n\nexport const InfoSection: React.VFC<Props> = ({\n appId,\n integrationId,\n integrationName,\n bridgeId,\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false)\n const [isLoadingVideoPlayer, setIsLoadingVideoPlayer] = useState(true)\n\n const { t } = useTranslation()\n\n const { data: appData } = useGetAppById(appId)\n\n const videoId = appData?.video\n const docUrl = appData?.docUrl\n\n return (\n <InfoSectionWrapper>\n <InfoSectionTitle>How to connect the integration</InfoSectionTitle>\n <IconsWrapper>\n {videoId && (\n <IconRow\n data-tip={''}\n data-for={'video-tooltip'}\n onClick={() => {\n trackEvent({\n eventName: 'HowToVideoPlayClicked',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId,\n appName: appData?.name,\n integrationId,\n integrationName,\n bridgeId,\n },\n })\n setIsModalOpen(true)\n }}\n >\n <VideoIcon />\n <p>Video Tutorial</p>\n <ReactTooltip\n id={'video-tooltip'}\n place={'top'}\n getContent={() => t('nbee.bridgeBuilder.integrationVideoTooltip')}\n />\n </IconRow>\n )}\n\n {docUrl && (\n <IconRow\n data-tip={''}\n data-for={'doc-tooltip'}\n onClick={() => {\n trackEvent({\n eventName: 'HowToDocuClicked',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId,\n appName: appData?.name,\n integrationId,\n integrationName,\n },\n })\n window.open(docUrl)\n }}\n >\n <DocIcon />\n <p>Manual</p>\n <ReactTooltip\n id={'doc-tooltip'}\n place={'top'}\n getContent={() => t('nbee.bridgeBuilder.integrationDocTooltip')}\n />\n </IconRow>\n )}\n </IconsWrapper>\n <Modal\n isOpen={isModalOpen}\n onCloseModal={() => setIsModalOpen(false)}\n isResizable\n hideCloseButton\n >\n {isLoadingVideoPlayer && (\n <Loader $active={isLoadingVideoPlayer} $size={'large'} $dimmer />\n )}\n\n <div style={{ position: 'relative', paddingTop: '56.25%' }}>\n <ReactPlayer\n width='100%'\n height='100%'\n style={{\n padding: '1rem',\n position: 'absolute',\n top: 0,\n left: 0,\n }}\n controls\n volume={1}\n muted\n onReady={() => {\n setIsLoadingVideoPlayer(false)\n }}\n config={{\n wistia: {\n options: { autoPlay: true },\n },\n }}\n url={`https://home.wistia.com/medias/${videoId}`}\n />\n </div>\n </Modal>\n </InfoSectionWrapper>\n )\n}\n","import styled from 'styled-components'\n\nexport const ModalWrapper = styled.div`\n padding: 3rem 2rem;\n`\nexport const ModalHeader = styled.div`\n font-weight: 600;\n margin-bottom: 1.2rem;\n font-size: 1.2rem;\n`\nexport const ModalBody = styled.div`\n font-size: 0.9rem;\n margin-bottom: 2rem;\n\n svg {\n width: 18rem;\n display: block;\n margin: 2.2rem auto;\n }\n`\nexport const ModalFooter = styled.div`\n width: 50%;\n margin: 0 auto;\n`\n","import React, { useEffect, useState } from 'react'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport { trackEvent } from '@app/dataTracking'\nimport { makeNbeeTrackingParams } from '@app/dataTracking/utils'\nimport { useTranslation } from 'react-i18next'\nimport { makeSupportUrl } from '@features/nbee/SimpleBridgeBuilderForm/appsCompatibility/utils'\nimport { useFormikContext } from 'formik'\nimport { BridgeFormValues } from 'Nbee'\nimport all from 'public/locales/en-US.json'\nimport { Translate } from '@components/Translate'\nimport { InputFeedback } from '@components/Basic/InputFeedback'\n\ninterface Props {\n appsInWaitingList: string\n appsCount: number\n appId: number\n isInStep1: boolean\n}\n\nexport const WaitingListInfoMessage: React.FC<Props> = ({\n appsInWaitingList,\n appsCount,\n appId,\n isInStep1,\n}) => {\n const { t } = useTranslation()\n const { values } = useFormikContext<BridgeFormValues>()\n const [updateRequest, setUpdateRequest] = useState(false)\n\n // we need to force a custom type cast since we are checking dynamic `customMessageKey` existance\n const customMessageKey = (\n all.nbee.checkCompatibility as Record<string, string>\n )[`waitingListTextCustomMessage${appId}`] as string | undefined\n\n useEffect(() => {\n trackEvent({\n eventName: 'WaitingListSelected',\n feature: 'NBEE',\n step: isInStep1 ? 'Apps' : 'BridgeChooser',\n params: {\n ...makeNbeeTrackingParams(values),\n },\n })\n }, [appId])\n\n return customMessageKey ? (\n <div>\n <Translate i18nKey={customMessageKey} />\n <a\n href={makeSupportUrl(appsInWaitingList)}\n target={'_blank'}\n rel={'noopener noreferrer'}\n style={{ display: 'block', marginTop: '1rem' }}\n >\n <Button type={'button'} $variant={'action'}>\n {t('nbee.checkCompatibility.waitingListCta')}\n </Button>\n </a>\n </div>\n ) : (\n <div>\n {t('nbee.checkCompatibility.waitingListText', {\n appsInWaitingList,\n count: appsCount,\n })}\n <div\n style={{\n display: 'flex',\n marginTop: '1rem',\n alignItems: 'center',\n gap: '1rem',\n }}\n >\n <Button\n type={'button'}\n $variant={'primary'}\n disabled={updateRequest}\n onClick={() => {\n setUpdateRequest(true)\n trackEvent({\n eventName: 'InterestedInWaitingList',\n feature: 'NBEE',\n step: isInStep1 ? 'Apps' : 'BridgeChooser',\n params: {\n ...makeNbeeTrackingParams(values),\n },\n })\n }}\n >\n {t('nbee.checkCompatibility.waitingListTextSubscribeCta')}\n </Button>\n\n {updateRequest && (\n <InputFeedback\n $status={{\n success: t(\n 'nbee.checkCompatibility.waitingListTextSubscribeResponse'\n ),\n }}\n />\n )}\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { ApiAppsCompatibility } from 'BackendApi'\nimport { Link } from 'react-router-dom'\nimport { FormikProps } from 'formik'\nimport { BridgeFormValues } from 'Nbee'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport { appRoutes } from '@app/routes'\nimport { FiRefreshCcw } from 'react-icons/fi'\nimport { TFunction } from 'i18next'\nimport styled from 'styled-components'\nimport { trackEvent } from '@app/dataTracking'\nimport { makeNbeeTrackingParams } from '@app/dataTracking/utils'\nimport { WaitingListInfoMessage } from '@features/nbee/SimpleBridgeBuilderForm/appsCompatibility/WaitingListInfoMessage'\nimport { isInIframe } from '@app/utils/isInFrame'\nimport all from 'public/locales/en-US.json'\nimport { Translate } from '@components/Translate'\n\n// we need to be sure new lines added in i18n json works\nconst Paragraph = styled.p`\n white-space: pre-wrap;\n`\n\nconst isIframe = isInIframe()\n\nexport const switchApps = (formikProps: FormikProps<BridgeFormValues>) => {\n // storing IDs to switch\n const sourceAppIdToSwitch = formikProps.values.source.appId\n const destinationAppIdToSwitch = formikProps.values.destination.appId\n\n // unsetting fields, so sub-items will be cleared as well\n formikProps.setFieldValue('source.appId', undefined)\n formikProps.setFieldValue('destination.appId', undefined)\n\n // set new apps in reverse order\n setTimeout(() => {\n formikProps.setFieldValue('source.appId', destinationAppIdToSwitch)\n formikProps.setFieldValue('destination.appId', sourceAppIdToSwitch)\n }, 100)\n}\n\nexport const makeSupportUrl = (crmName: string) =>\n `${\n process.env.REACT_APP_V1_URL\n }/support?t=BETA_REQUEST&crmName=${encodeURIComponent(crmName)}`\n\nexport const getAppCompatibilityPopupContent = (\n apiResponse: ApiAppsCompatibility,\n formikProps: FormikProps<BridgeFormValues>,\n t: TFunction,\n options: {\n isInStep1: boolean\n }\n) => {\n const { source, destination, combination } = apiResponse\n const isInStep1 = !!options?.isInStep1\n\n const bothInWaitingListing =\n (source.sourceWaitingList || source.destinationWaitingList) &&\n (destination.destinationWaitingList || destination.sourceWaitingList)\n const appsInWaitingList = bothInWaitingListing\n ? `${source.name} and ${destination.name}`\n : source.sourceWaitingList || source.destinationWaitingList\n ? source.name\n : destination.destinationWaitingList || destination.sourceWaitingList\n ? destination.name\n : ''\n\n console.log(\n 'bothInWaitingListing',\n bothInWaitingListing,\n 'appsInWaitingList',\n appsInWaitingList\n )\n const waitingListMessage = (\n <div>\n <h5>{t('nbee.checkCompatibility.waitingListTitle')}</h5>\n <WaitingListInfoMessage\n appsInWaitingList={appsInWaitingList}\n appsCount={bothInWaitingListing ? 2 : 1}\n appId={source.sourceWaitingList ? source.id : destination.id}\n isInStep1={isInStep1}\n />\n </div>\n )\n\n // In case one or no compatibility\n if (combination.compatibility === 'none') {\n trackEvent({\n eventName: 'NotCompatibleApps',\n feature: 'NBEE',\n step: isInStep1 ? 'Apps' : 'BridgeChooser',\n params: {\n ...makeNbeeTrackingParams(formikProps.values),\n },\n })\n\n const customMessageKey =\n (all.nbee.checkCompatibility as Record<string, string>)[\n `noCompatibilityTextCustomMessage${source.id}-${destination.id}`\n ] ||\n ((all.nbee.checkCompatibility as Record<string, string>)[\n `noCompatibilityTextCustomMessage${destination.id}-${source.id}`\n ] as string | undefined)\n\n const customUrl =\n (all.nbee.checkCompatibility as Record<string, string>)[\n `noCompatibilityCustomUrl${source.id}-${destination.id}`\n ] ||\n ((all.nbee.checkCompatibility as Record<string, string>)[\n `noCompatibilityCustomUrl${destination.id}-${source.id}`\n ] as string | undefined)\n\n const notCompatibleMessage = (\n <div>\n <h5>\n {t('nbee.checkCompatibility.noneTitle', {\n sourceName: source.name,\n destinationName: destination.name,\n })}\n </h5>\n <div>{t('nbee.checkCompatibility.noneText')}</div>\n </div>\n )\n\n return appsInWaitingList !== '' ? (\n waitingListMessage\n ) : customMessageKey ? (\n <div>\n <Translate i18nKey={customMessageKey} />\n <a\n href={customUrl}\n target={'_blank'}\n rel={'noopener noreferrer'}\n style={{ display: 'block', marginTop: '1rem' }}\n onClick={() => {\n trackEvent({\n eventName: 'NotCompatibleAppsGuideClicked',\n feature: 'NBEE',\n step: isInStep1 ? 'Apps' : 'BridgeChooser',\n params: {\n ...makeNbeeTrackingParams(formikProps.values),\n },\n })\n }}\n >\n <Button type={'button'} $variant={'action'}>\n {t('nbee.checkCompatibility.noCompatibilityReadArticleCta')}\n </Button>\n </a>\n </div>\n ) : (\n notCompatibleMessage\n )\n }\n\n // In case one or both apps are in waiting list\n if (\n source.sourceWaitingList ||\n source.destinationWaitingList ||\n destination.sourceWaitingList ||\n destination.destinationWaitingList\n ) {\n return waitingListMessage\n }\n\n // In case one or both apps require a different plan\n if (source.upgrade || destination.upgrade) {\n const bothNeedUpgrade = Boolean(source.upgrade && destination.upgrade)\n const appTextToUpgrade = bothNeedUpgrade\n ? `${source.name} and ${destination.name}`\n : source.upgrade\n ? source.name\n : destination.name\n\n trackEvent({\n eventName: 'UpgradeButtonShown',\n step: 'Apps',\n feature: 'NBEE',\n params: {\n ...makeNbeeTrackingParams(formikProps.values),\n },\n })\n\n return (\n <div>\n <div>\n <h5>{t('nbee.checkCompatibility.updatePlanTitle')}</h5>\n <Paragraph>\n {t('nbee.checkCompatibility.updatePlanText', {\n appsToUpgrade: appTextToUpgrade,\n count: bothNeedUpgrade ? 2 : 1,\n })}\n </Paragraph>\n <Link\n to={\n appRoutes.pricing.makeUrl() +\n '?reason=app-only-available-in-pro-plan'\n }\n target={isIframe ? '_blank' : undefined}\n >\n <Button type={'button'} $variant={'action'}>\n {t('nbee.checkCompatibility.updatePlanCta')}\n </Button>\n </Link>\n </div>\n </div>\n )\n }\n\n if (combination.compatibility === 'switch' && appsInWaitingList === '') {\n return (\n <div>\n <h5>{t('nbee.checkCompatibility.switchTitle')}</h5>\n <Paragraph>{t('nbee.checkCompatibility.switchText')}</Paragraph>\n <Button\n type={'button'}\n $variant={'action'}\n $hasIcon\n onClick={() => {\n switchApps(formikProps)\n }}\n >\n <FiRefreshCcw size={'1em'} /> {t('nbee.checkCompatibility.switchCta')}\n </Button>\n </div>\n )\n }\n\n // data tracking for `CompatibleApps`\n // here combination is compatible somehow\n if (\n combination.compatibility === 'both' ||\n combination.compatibility === 'direct'\n ) {\n trackEvent({\n eventName: 'CompatibleApps',\n step: isInStep1 ? 'Apps' : 'BridgeChooser',\n feature: 'NBEE',\n params: {\n ...makeNbeeTrackingParams(formikProps.values),\n custom: {\n nbee: Boolean(combination.nbeeUri),\n obe: Boolean(combination.obeUri),\n },\n },\n })\n }\n\n // In case obeUri is returned it means it will be possible to proceed.\n // But if nbeeUri is missing we need to inform the user that the only way to proceed is with the old bridge experience\n // Update (May2023): We decided to seamelessly redirect to the old bridge experience by allowing the user to hit a button that simply says \"Continue\"\n if (combination.obeUri && !combination.nbeeUri) {\n return (\n <div\n style={{\n minHeight: '60px',\n padding: '1.5rem ',\n position: 'fixed',\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgb(255 255 255 / 60%)',\n backdropFilter: 'blur(5px)',\n zIndex: 50,\n }}\n >\n <div\n style={{\n minWidth: '420px',\n maxWidth: '1080px',\n padding: '0 2rem',\n width: '100%',\n margin: '0 auto',\n position: 'relative',\n display: 'flex',\n flexDirection: 'row-reverse',\n }}\n >\n <a\n href={combination.obeUri}\n target={isIframe ? '_blank' : undefined}\n rel='noreferrer'\n onClick={() => {\n trackEvent({\n eventName: 'ComplexBridgeClicked',\n step: 'BridgeChooser',\n feature: 'NBEE',\n params: {\n ...makeNbeeTrackingParams(formikProps.values),\n sourceAppId: source.id,\n sourceAppName: source.name,\n destinationAppId: destination.id,\n destinationAppName: destination.name,\n },\n })\n }}\n >\n <Button type={'button'} $variant={'primary'} $minWidth>\n {'Continue'}\n </Button>\n </a>\n </div>\n </div>\n )\n }\n\n return null\n}\n","import { useContext, useEffect, useState } from 'react'\nimport { useCheckAppsCompatibility } from '@app/api/checkAppsCompatibility'\nimport { getAppCompatibilityPopupContent } from './utils'\nimport { useFormikContext } from 'formik'\nimport { BridgeFormValues } from 'Nbee'\nimport { PanelPopupContext } from '@components/Panel'\nimport { useTranslation } from 'react-i18next'\nimport { useRouteMatch } from 'react-router-dom'\nimport { bridgeBuilderStep1Paths, bridgeByUrlPartnersPaths } from '@app/routes'\nimport { trackEvent } from '@app/dataTracking'\nimport { makeNbeeTrackingParams } from '@app/dataTracking/utils'\nimport { parseApiError } from '@app/api/utils/error'\n\n// This hook only works when formik context of type `BridgeFormValues` is available\n// it will read the selected source and destination apps id and will show a popup and prevent the submit\n// if apps are not compatibile or if user needs to switch them or upgrade plan\nexport const useHandleAppsCompatibility = () => {\n const popupCtx = useContext(PanelPopupContext)\n const formikProps = useFormikContext<BridgeFormValues>()\n const { t } = useTranslation()\n const [appsAreCompatible, setAppsAreCompatible] = useState(false)\n\n // we need this to proper build the analytics track event\n const step1MatchRoute = useRouteMatch([\n ...bridgeBuilderStep1Paths,\n ...bridgeByUrlPartnersPaths,\n ])\n const isInStep1 = !!step1MatchRoute?.isExact\n\n const sourceId = formikProps?.values.source?.appId\n const destinationId = formikProps?.values.destination?.appId\n\n const [emailFeatureAvailable, setEmailFeatureAvailable] =\n useState<boolean>(false)\n\n // checking apps compatibility when source + destination is selected\n const {\n data: appCompatibilityCheck,\n isLoading: isCheckingAppsCompatibility,\n isRefetching: isReCheckingAppsCompatibility,\n error: apiError,\n } = useCheckAppsCompatibility(sourceId, destinationId)\n\n // if apps are note compatible we must inform the user\n useEffect(() => {\n if (\n isCheckingAppsCompatibility &&\n isReCheckingAppsCompatibility &&\n popupCtx?.sendPopup\n ) {\n formikProps.setSubmitting(true)\n popupCtx.sendPopup(undefined)\n }\n\n if (appCompatibilityCheck) {\n // we build popup content depending on result and set status of popup item\n // only if we have content that has been handled inside getAppCompatibilityPopupContent\n // otherwise popup can be cleared\n const content = getAppCompatibilityPopupContent(\n appCompatibilityCheck,\n formikProps,\n t,\n {\n isInStep1,\n }\n )\n\n const isNotCompatible =\n appCompatibilityCheck?.combination.compatibility === 'none'\n\n if (popupCtx?.sendPopup && content) {\n // it means we have some compatibility error\n formikProps.setSubmitting(true)\n setAppsAreCompatible(false)\n popupCtx.sendPopup({\n content,\n position: 'bottom',\n dismissable: isNotCompatible,\n onClose: () => {\n // we want to remove src and dest when the user closes the popup, so it can choose new apps\n // using `resetForm` utils from Formik is the best way to re-set the initialState\n if (isNotCompatible) {\n formikProps.resetForm()\n }\n },\n })\n } else {\n // apps are compatibile\n formikProps.setSubmitting(false)\n setAppsAreCompatible(true)\n\n setEmailFeatureAvailable(\n appCompatibilityCheck?.combination?.availableBridgeFeatures?.some(\n (feature) =>\n feature.moduleId === 'email-receipt' && feature.available\n )\n )\n }\n }\n }, [\n appCompatibilityCheck,\n isCheckingAppsCompatibility,\n isReCheckingAppsCompatibility,\n ])\n\n useEffect(() => {\n if (apiError) {\n const parsedError = parseApiError(apiError)\n trackEvent({\n eventName: 'UnexpectedErrorThrown',\n feature: 'NBEE',\n step: isInStep1 ? 'Apps' : 'BridgeChooser',\n params: {\n ...makeNbeeTrackingParams(formikProps?.values),\n custom: {\n errorCode: parsedError.code,\n errorDescription: parsedError.message,\n },\n },\n sendEventToIntercom: true,\n })\n }\n }, [apiError])\n\n // when source or destination changes, we need to remove the popup (in case is open)\n useEffect(() => {\n // const appsNotSelected = !sourceId || !destinationId\n const popupIsOpen = popupCtx?.popup?.content\n if (popupIsOpen) {\n popupCtx.sendPopup!(undefined)\n }\n }, [sourceId, destinationId])\n\n return {\n appsAreCompatible,\n emailFeatureAvailable,\n }\n}\n","import React, { useState } from 'react'\nimport { InputField } from '@components/Form/InputField'\nimport { ApiAppSetting } from 'BackendApi'\nimport { AppConfigurationType, BridgeFormValues } from 'Nbee'\nimport { useFormikContext } from 'formik'\nimport { getSettingFieldError } from '@features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/utils'\nimport { Textarea } from '@components/Form/Textarea'\nimport { LabelWithDocTooltip } from '@components/Form/LabelWithDocTooltip'\nimport { useTriggerSettingsUpdate } from '@features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/useTriggerSettingsUpdate'\nimport { trackEvent } from '@app/dataTracking'\n\ninterface Props {\n fieldSchema: ApiAppSetting\n type: AppConfigurationType\n isLoading: boolean\n index: number\n}\n\nexport const SettingFieldInput: React.FC<Props> = ({\n fieldSchema,\n isLoading,\n type,\n index,\n}) => {\n const {\n values: formValues,\n setFieldValue,\n setFieldTouched,\n touched,\n errors,\n } = useFormikContext<BridgeFormValues>()\n\n const { refetchSettings } = useTriggerSettingsUpdate(type)\n\n const settingFieldName = `${type}.settings`\n const currentSettingsValues = formValues[type].settings || []\n\n const fieldId = fieldSchema.id\n const fieldType = fieldSchema.type\n\n const currentFieldValue = currentSettingsValues.find((v) => v.key === fieldId)\n\n // if we hare here value can't be boolean, so it's safe to cast\n const initialValue = currentFieldValue\n ? (currentFieldValue.value as string | number)\n : ''\n\n const [internalInputValue, setInternalInputValue] = useState(\n initialValue === 0 ? '' : initialValue\n )\n\n const { isTouched, fieldStatus } = getSettingFieldError({\n type,\n touched,\n errors,\n index,\n })\n\n const onBlurUpdateFormikState = () => {\n // if formik value is equal to internalInputValue we can skip the update\n const wasEmptyIsStillEmpty = !currentFieldValue && !internalInputValue\n const wasFilledStillHasSameValue =\n currentFieldValue && currentFieldValue.value === internalInputValue\n const skipUpdate = wasEmptyIsStillEmpty || wasFilledStillHasSameValue\n if (skipUpdate) {\n return\n }\n\n // if new value is empty, we need to remove the key from formikState\n if (!internalInputValue) {\n // removing from formik state if no value is added\n const newSettings = currentSettingsValues.filter(\n (setting) => setting.key !== fieldId\n )\n setFieldValue(settingFieldName, newSettings)\n if (fieldSchema.hasChild) {\n refetchSettings()\n }\n return\n }\n\n const parsedValue =\n internalInputValue && fieldType === 'number'\n ? parseInt(`${internalInputValue}`, 10)\n : internalInputValue\n\n const newValue = {\n key: fieldId,\n value: parsedValue,\n }\n const newSettings = currentFieldValue\n ? currentSettingsValues.map((setting) =>\n setting.key === fieldId ? newValue : setting\n )\n : [...currentSettingsValues, newValue]\n\n setFieldValue(settingFieldName, newSettings)\n\n trackEvent({\n eventName: 'IntegrationSettingSelected',\n step: 'Apps',\n feature: 'NBEE',\n params: {\n custom: {\n fieldId,\n value: parsedValue,\n },\n },\n })\n\n // we trigger the retrival of new setting only if is a setting with a child\n if (fieldSchema.hasChild) {\n refetchSettings()\n }\n }\n\n return (\n <div>\n <LabelWithDocTooltip\n label={fieldSchema.label}\n isRequired={fieldSchema.required}\n tooltip={fieldSchema.tooltip}\n docUrl={fieldSchema.docUrl}\n />\n {fieldType === 'textarea' || fieldType === 'code' ? (\n <Textarea\n disabled={isLoading || formValues.ui?.isBridgeEnabled}\n id={fieldId}\n name={fieldId}\n value={internalInputValue}\n onChange={({ target: { value } }) => {\n setInternalInputValue(value)\n }}\n onBlur={() => {\n setFieldTouched(`${settingFieldName}.${index}`, true)\n onBlurUpdateFormikState()\n }}\n $status={isTouched ? fieldStatus : undefined}\n />\n ) : (\n <InputField\n type={\n fieldType === 'password'\n ? 'password'\n : fieldType === 'email'\n ? 'email'\n : fieldType === 'url'\n ? 'url'\n : fieldType === 'number'\n ? 'number'\n : 'text'\n }\n disabled={isLoading || formValues.ui?.isBridgeEnabled}\n id={fieldId}\n autoComplete={fieldType === 'password' ? 'new-password' : 'off'}\n name={fieldId}\n value={internalInputValue}\n onChange={({ target: { value } }) => {\n setInternalInputValue(value)\n }}\n onBlur={() => {\n setFieldTouched(`${settingFieldName}.${index}`, true)\n onBlurUpdateFormikState()\n }}\n onKeyPress={(event) => {\n // we trigger formik change on enter key press, we do this so we can trigger validation while submit button is disabled\n if (event.key === 'Enter') {\n setFieldTouched(`${settingFieldName}.${index}`, true)\n onBlurUpdateFormikState()\n }\n }}\n $status={isTouched ? fieldStatus : undefined}\n />\n )}\n </div>\n )\n}\n","import React, { useState } from 'react'\nimport { AppConfigurationType, BridgeFormValues } from 'Nbee'\nimport { useFormikContext } from 'formik'\nimport { ApiAppSetting } from 'BackendApi'\nimport { InputSmartCreatableSelect } from '@components/Form/InputSmartSelect/Creatable'\nimport { getSettingFieldError } from '@features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/utils'\nimport { LabelWithDocTooltip } from '@components/Form/LabelWithDocTooltip'\nimport { useTriggerSettingsUpdate } from '@features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/useTriggerSettingsUpdate'\nimport { trackEvent } from '@app/dataTracking'\nimport { makeNbeeTrackingParams } from '@app/dataTracking/utils'\n\ninterface Props {\n isLoading: boolean\n fieldSchema: ApiAppSetting\n type: AppConfigurationType\n index: number\n}\n\nexport const SettingFieldSmartCreatableSelect: React.FC<Props> = ({\n isLoading,\n type,\n fieldSchema,\n index,\n}) => {\n // some formik helpers\n const {\n values: formValues,\n setFieldValue,\n setFieldTouched,\n touched,\n errors,\n } = useFormikContext<BridgeFormValues>()\n const { refetchSettings } = useTriggerSettingsUpdate(type)\n\n const [internalInputValue, setInternalInputValue] = useState<string[]>([])\n\n const settingFieldName = `${type}.settings`\n const currentSettingsValues = formValues[type].settings || []\n\n const fieldId = fieldSchema.id\n\n const currentFieldValue = currentSettingsValues.find((v) => v.key === fieldId)\n const initialValues = (fieldSchema?.data || []).map((o) => o.text)\n\n const defaultValue = currentFieldValue?.value as string[]\n\n const { isTouched, fieldStatus } = getSettingFieldError({\n type,\n touched,\n errors,\n index,\n })\n\n const updateFieldOnBlur = () => {\n const internalStateIsEmpty = !internalInputValue.length\n const wasEmptyIsStillEmpty = !currentFieldValue && internalStateIsEmpty\n const wasFilledStillHasSameValue =\n (defaultValue || []).join(',') === (internalInputValue || []).join(',')\n const skipUpdate = wasEmptyIsStillEmpty || wasFilledStillHasSameValue\n if (skipUpdate) {\n return\n }\n\n // if new value is empty, we need to remove the key from formikState\n if (internalStateIsEmpty) {\n // removing from formik state if no value is added\n const newSettings = currentSettingsValues.filter(\n (setting) => setting.key !== fieldId\n )\n setFieldValue(settingFieldName, newSettings)\n return\n }\n\n const newValue = {\n key: fieldId,\n value: internalInputValue,\n }\n\n trackEvent({\n eventName: 'IntegrationSettingSelected',\n step: 'Apps',\n feature: 'NBEE',\n params: {\n ...makeNbeeTrackingParams(formValues, type),\n custom: {\n fieldId: newValue.key,\n value: (internalInputValue || []).join(', '),\n },\n },\n })\n\n const newSettings = currentFieldValue\n ? currentSettingsValues.map((setting) =>\n setting.key === fieldId ? newValue : setting\n )\n : [...currentSettingsValues, newValue]\n\n setFieldValue(settingFieldName, newSettings)\n\n // we trigger the retrival of new setting only if is a setting with a child\n if (fieldSchema.hasChild) {\n refetchSettings()\n }\n }\n\n return (\n <div>\n <LabelWithDocTooltip\n label={fieldSchema.label}\n isRequired={fieldSchema.required}\n tooltip={fieldSchema.tooltip}\n docUrl={fieldSchema.docUrl}\n />\n <InputSmartCreatableSelect\n isLoading={isLoading}\n initialValues={initialValues}\n defaultValue={defaultValue}\n isClearable={false}\n isDisabled={formValues.ui?.isBridgeEnabled}\n onSelect={(newSettings) => {\n // saving internal state to update formik state onBlur\n setInternalInputValue(newSettings)\n }}\n placeholder={'type to add...'}\n onBlur={() => {\n setFieldTouched(`${settingFieldName}.${index}`, true)\n updateFieldOnBlur()\n }}\n $status={(isTouched && fieldStatus) || undefined}\n />\n </div>\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { Modal } from '@components/Basic/Modal'\nimport { ApiAppSetting } from 'BackendApi'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport { useFormikContext } from 'formik'\nimport { BridgeFormValues, AppConfigurationType } from 'Nbee'\nimport { LabelWithDocTooltip } from '@components/Form/LabelWithDocTooltip'\nimport { InputToggle } from '@components/Form/InputToggle'\nimport { InputField } from '@components/Form/InputField'\nimport { useAddDropdownOption } from '@app/api/postAddDropdownOption'\nimport { Message } from '@components/Basic/Message'\nimport { parseApiError } from '@app/api/utils/error'\nimport { ModalAddOptionCard, ModalAddOptionErrorMessage } from './styled'\nimport { InputFeedback } from '@components/Basic/InputFeedback'\nimport { useTranslation } from 'react-i18next'\nimport {\n InputSmartSelect,\n SelectValue,\n} from '@components/Form/InputSmartSelect'\nimport { MultiCreatableCustom } from '@components/Form/MultiCreatableCustom'\n\ninterface Props {\n isOpen: boolean\n onCloseModal: () => void\n onSuccessCreation: (newOptionId: number | string) => void\n fieldSchema: ApiAppSetting\n type: AppConfigurationType\n}\n\nexport const SmartSelectAddOptionApiModal: React.FC<Props> = ({\n isOpen,\n onCloseModal,\n fieldSchema,\n type,\n onSuccessCreation,\n}) => {\n const { t } = useTranslation()\n const [validationMessage, setValidationMessage] = useState('')\n const [settingsValues, setSettingsValues] = useState<\n Record<string, string | boolean>\n >({})\n const { values } = useFormikContext<BridgeFormValues>()\n const addOptionSettings = fieldSchema.addOption?.apiSettings || []\n\n const {\n mutate: addOptionMutation,\n data: addOptionResponse,\n isLoading: isAddingOption,\n error: apiError,\n } = useAddDropdownOption()\n\n // init empty state for inputs\n useEffect(() => {\n if (addOptionSettings) {\n const intialSettingsValuesState = Object.fromEntries(\n addOptionSettings.map(({ id, type }) => [\n id,\n type === 'toggle' ? false : '',\n ])\n )\n\n setSettingsValues(intialSettingsValuesState)\n }\n }, [addOptionSettings])\n\n // on success\n useEffect(() => {\n if (addOptionResponse && addOptionResponse.data?.instanceId) {\n onSuccessCreation(addOptionResponse.data.instanceId)\n }\n }, [addOptionResponse])\n\n const addOptionSchema = fieldSchema.addOption!\n const apiScope = addOptionSchema.apiScope || ''\n const apiSettings = Object.keys(settingsValues).map((o) => ({\n key: o,\n value: settingsValues[o],\n }))\n\n // Check that there are no required fields with empty values\n const isFormValid = addOptionSettings.every((field) => {\n const isRequired = field.required !== false // Treat undefined/null as true\n return (\n !isRequired || // Skip validation for non-required fields\n (settingsValues[field.id] !== undefined &&\n settingsValues[field.id] !== '' &&\n settingsValues[field.id] !== false)\n )\n })\n\n const addOptionSubmit = () => {\n setValidationMessage('')\n\n if (!isFormValid) {\n setValidationMessage('All fields are required')\n return\n }\n\n addOptionMutation({\n integrationId: values[type].integrationId!,\n appId: values[type].appId!,\n type: type,\n settings: values[type].settings || [],\n apiScope,\n apiSettings,\n })\n }\n\n return (\n <Modal\n isOpen={isOpen}\n onCloseModal={() => {\n // we don't want the user closes the modal while posting the new data\n if (!isAddingOption) {\n onCloseModal()\n }\n }}\n >\n <ModalAddOptionCard>\n <h1>Create new {fieldSchema.label}</h1>\n\n {addOptionSettings.map((field) => (\n <div key={field.id}>\n {field.type === 'toggle' ? (\n <InputToggle\n $isChecked={!!settingsValues[field.id]}\n onChange={() => {\n setSettingsValues({\n ...settingsValues,\n [field.id]: !settingsValues[field.id],\n })\n }}\n $variant={'primary'}\n $labelRight={field.label}\n />\n ) : field.type === 'dropdown' ? (\n <>\n <LabelWithDocTooltip\n label={field.label}\n isRequired={field.required === false ? false : true}\n />\n <InputSmartSelect\n initialValues={\n field.data\n ? field.data.map(({ text, ...rest }) => ({\n label: text,\n value: text,\n ...rest,\n }))\n : []\n }\n onSelect={(value) => {\n const singleValue = value as SelectValue\n if (singleValue) {\n setSettingsValues({\n ...settingsValues,\n [field.id]: singleValue.id,\n })\n }\n }}\n />\n </>\n ) : field.type === 'multi' ? (\n <>\n <LabelWithDocTooltip\n label={field.label}\n isRequired={field.required === false ? false : true}\n />\n <MultiCreatableCustom\n isCreatable={false}\n excludeSelected={true}\n onMappingChange={(values) => {\n setSettingsValues({\n ...settingsValues,\n [field.id]: values.map(\n (field) => field.sourceFieldId\n ) as any,\n })\n }}\n sourceOptions={field.data?.map(({ id, text }) => ({\n label: text,\n value: id,\n fieldType: 'source',\n }))}\n />\n </>\n ) : (\n <>\n <LabelWithDocTooltip\n label={field.label}\n isRequired={field.required === false ? false : true}\n />\n <InputField\n name={field.id}\n type={'text'}\n value={settingsValues[field.id] as string}\n required\n placeholder={'Type a name'}\n onChange={({ currentTarget: { value } }) => {\n setSettingsValues({\n ...settingsValues,\n [field.id]: value,\n })\n }}\n />\n </>\n )}\n </div>\n ))}\n\n {apiError ? (\n <Message $status={'error'}>\n <ModalAddOptionErrorMessage\n dangerouslySetInnerHTML={{\n __html: parseApiError(apiError).message,\n }}\n />\n </Message>\n ) : null}\n\n {validationMessage ? (\n <div>\n <InputFeedback $status={{ error: validationMessage }} />\n </div>\n ) : null}\n\n <div style={{ paddingTop: '1rem', textAlign: 'right' }}>\n <Button\n type={'button'}\n disabled={isAddingOption || !isFormValid}\n $loading={isAddingOption}\n $variant={'primary'}\n onClick={addOptionSubmit}\n >\n {t('nbee.bridgeBuilder.addNewGeneric')}\n </Button>\n </div>\n </ModalAddOptionCard>\n </Modal>\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { InputSmartSelect } from '@components/Form/InputSmartSelect'\nimport {\n AppConfigurationType,\n AppIntegrationSetting,\n BridgeFormValues,\n} from 'Nbee'\nimport { useFormikContext } from 'formik'\nimport { ApiAppSetting } from 'BackendApi'\nimport {\n getSettingFieldError,\n handleCreateNewFacebookForm,\n transformSettingDataInSelectOptions,\n} from './utils'\nimport { useTranslation } from 'react-i18next'\nimport { LabelWithDocTooltip } from '@components/Form/LabelWithDocTooltip'\nimport { TinyTextualButton } from '@components/Basic/TinyTextualButton'\nimport { BiRefresh } from 'react-icons/bi'\nimport { Loader } from '@components/Basic/Loader'\nimport { InputFeedback } from '@components/Basic/InputFeedback'\nimport { useTriggerSettingsUpdate } from '@features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/useTriggerSettingsUpdate'\nimport { SmartSelectAddOptionApiModal } from '@features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/SmartSelectAddOptionApiModal'\nimport { trackEvent } from '@app/dataTracking'\nimport { makeNbeeTrackingParams } from '@app/dataTracking/utils'\n\ninterface Props {\n isLoading: boolean\n fieldSchema: ApiAppSetting\n type: AppConfigurationType\n index: number\n apiHasError: boolean\n}\n\nexport const SettingFieldSmartSelect: React.FC<Props> = ({\n isLoading,\n type,\n fieldSchema,\n index,\n apiHasError,\n}) => {\n const [addOptionApiModalOpen, setAddOptionApiModalOpen] = useState(false)\n // some formik helpers\n const {\n values: formValues,\n setFieldValue,\n setFieldTouched,\n errors,\n touched,\n validateForm,\n } = useFormikContext<BridgeFormValues>()\n\n const { t } = useTranslation()\n const { refetchSettings } = useTriggerSettingsUpdate(type)\n\n const settingFieldName = `${type}.settings`\n const currentSettingsValues = formValues[type].settings || []\n\n const fieldId = fieldSchema.id\n\n const currentFieldValue = currentSettingsValues.find((v) => v.key === fieldId)\n const initialValues = transformSettingDataInSelectOptions(fieldSchema.data)\n\n // if we load this component `currentFieldValue.value` can only be string or string[]\n // so it's safe to case.\n const currentFieldValueCasted = currentFieldValue\n ? (currentFieldValue.value as string | string[])\n : undefined\n\n // getting default value from the list\n // in case is tags (multi-select) we need to filter within an array\n // if is a single value then it's ok to return a single value from the options lsit\n const defaultValue = currentFieldValueCasted\n ? Array.isArray(currentFieldValueCasted)\n ? initialValues.filter((option) =>\n currentFieldValueCasted.includes(`${option.value}`)\n )\n : initialValues.find((option) => option.value === currentFieldValueCasted)\n : undefined\n\n const { isTouched, fieldStatus } = getSettingFieldError({\n type,\n touched,\n errors,\n index,\n })\n\n const updateFormSettings = (newValue: AppIntegrationSetting) => {\n // old logic with update settings in bulk\n // const newSettings = currentFieldValue\n // ? currentSettingsValues.map((setting) =>\n // setting.key === fieldId ? newValue : setting\n // )\n // : [...currentSettingsValues, newValue]\n // setFieldValue(settingFieldName, newSettings)\n\n // updating single setting to avoid overrides when fetching in bg\n setFieldValue(`${settingFieldName}.${index}`, newValue)\n\n // we trigger the retrival of new setting only if is a setting with a child\n if (fieldSchema.hasChild) {\n refetchSettings()\n }\n }\n\n const handleFieldRefreshRequest = () => {\n trackEvent({\n eventName: 'DropdownRefreshClicked',\n feature: 'NBEE',\n step: 'Apps',\n params: {\n ...makeNbeeTrackingParams(formValues, type),\n custom: {\n fieldId,\n },\n },\n })\n\n // we prepare the request to get fresh content (not cached) from api for current field id\n setFieldValue(`ui.${type}.refresh`, [fieldSchema.id])\n // we send the api request\n refetchSettings()\n }\n\n // if value is not present anymore in the list we need to remove it from formik state\n // example we had a dropdown child that returns different options depending on parent choice\n useEffect(() => {\n const availableOptionKeys = initialValues.map((o) => o.value)\n const currentValue = currentFieldValue?.value as string\n if (currentValue && !availableOptionKeys.includes(currentValue)) {\n updateFormSettings({\n key: fieldId,\n value: '',\n })\n }\n }, [initialValues])\n\n // When the field is required and it has only one option available,\n // it pre-select that option and show the field in a read-only mode (disabled).\n const fieldHasOnlyOneOption =\n fieldSchema.data && fieldSchema.data[0] && fieldSchema.data.length === 1\n const isRequiredFieldDisabled =\n fieldSchema.required &&\n !fieldSchema.addOption &&\n fieldHasOnlyOneOption &&\n !!currentFieldValue?.value // we also check if current value is set, since during re-fething we might get different results and end-up with a disabled select with no values\n\n const isRequiredFieldClearable = fieldSchema && !fieldSchema.required\n useEffect(() => {\n if (!fieldSchema.required) {\n return\n }\n\n // if we have a value there's nothing to set\n if (currentFieldValue && currentFieldValue.value) {\n return\n }\n\n if (fieldSchema && fieldHasOnlyOneOption) {\n const singleDefaultValue = fieldSchema.data![0].id\n updateFormSettings({ key: fieldId, value: singleDefaultValue })\n\n setTimeout(() => {\n // we need to re-validate the form since pre-selected values might not be registered\n validateForm()\n }, 200)\n\n // we force a new update if this field hasChild, but we need to wait a bit to avoid endless loop\n if (fieldSchema.hasChild) {\n setTimeout(() => {\n refetchSettings()\n }, 500)\n }\n }\n }, [fieldSchema])\n\n const isRefreshingFromApi = Boolean(\n formValues.ui && formValues.ui[type]?.refresh?.includes(fieldSchema.id)\n )\n\n // we generate an hashed key from the key/value object contained in our defaultValue,\n // se we can keep always the component updated with the new default value returned from the API\n // the concatenation of `unescape(encodeURIComponent(..))` is required because btoa can't decode not Latin chars\n const renderKey =\n defaultValue &&\n window.btoa(unescape(encodeURIComponent(JSON.stringify(defaultValue))))\n\n return (\n <div style={{ position: 'relative' }}>\n {/* we show the loader when is hard refreshing from api, but if we received an error we can't show the loading status or user will be stuck */}\n {isRefreshingFromApi && !apiHasError && <Loader $active $dimmer />}\n <LabelWithDocTooltip\n label={fieldSchema.label}\n isRequired={fieldSchema.required}\n tooltip={fieldSchema.tooltip}\n docUrl={fieldSchema.docUrl}\n />\n <InputSmartSelect\n isLoading={isLoading}\n isDisabled={isRequiredFieldDisabled || formValues.ui?.isBridgeEnabled}\n tooltipMessage={\n isRequiredFieldDisabled && !isLoading\n ? t('common.selectDisabledWithSingleOption')\n : undefined\n }\n isClearable={isRequiredFieldClearable}\n initialValues={initialValues}\n defaultValue={defaultValue}\n key={renderKey}\n onSelect={(selectedValue) => {\n if (!selectedValue) {\n updateFormSettings({\n key: fieldId,\n value: '',\n })\n return\n }\n\n const newValue: AppIntegrationSetting = {\n key: fieldId,\n value: Array.isArray(selectedValue)\n ? selectedValue.map((v) => v.value.toString())\n : selectedValue.value || '',\n }\n\n trackEvent({\n eventName: 'IntegrationSettingSelected',\n step: 'Apps',\n feature: 'NBEE',\n params: {\n ...makeNbeeTrackingParams(formValues, type),\n custom: {\n fieldId: newValue.key,\n value: Array.isArray(newValue.value)\n ? newValue.value.join(', ')\n : newValue.value,\n },\n },\n })\n\n // if `newValue.value` is an empty array we need to remove it from formik state\n const newValueIsEmptyArray =\n Array.isArray(newValue.value) && newValue.value.length === 0\n if (newValueIsEmptyArray) {\n const newSettings = currentSettingsValues.filter(\n (setting) => setting.key !== fieldId\n )\n setFieldValue(settingFieldName, newSettings)\n return\n }\n updateFormSettings(newValue)\n\n // any form has always \"999\" as id\n if (newValue.value === '999') {\n trackEvent({\n eventName: 'AnyFormSelected',\n feature: 'NBEE',\n step: 'Apps',\n params: {\n ...makeNbeeTrackingParams(formValues, type),\n },\n })\n }\n }}\n addNewOptionButton={\n fieldSchema.addOption?.type === 'fb_forms'\n ? {\n label: t('nbee.bridgeBuilder.addNewForm'),\n onClick: () => {\n trackEvent({\n eventName: 'CreateFormClicked',\n feature: 'NBEE',\n step: 'Apps',\n params: makeNbeeTrackingParams(formValues, type),\n })\n handleCreateNewFacebookForm(\n currentSettingsValues,\n (payload) => {\n console.log('FB Payload', payload)\n if (payload) {\n updateFormSettings({\n key: fieldId,\n value: payload.formID,\n })\n handleFieldRefreshRequest()\n }\n }\n )\n },\n }\n : fieldSchema.addOption?.redirectUri\n ? {\n label: t('nbee.bridgeBuilder.viewDocumentation'),\n onClick: () => {\n window\n .open(fieldSchema.addOption?.redirectUri, '_blank')\n ?.focus()\n },\n }\n : fieldSchema.addOption?.type === 'api'\n ? {\n label: t('nbee.bridgeBuilder.addNewGeneric'),\n onClick: () => {\n setAddOptionApiModalOpen(true)\n },\n }\n : undefined\n }\n onBlur={() => {\n setFieldTouched(`${settingFieldName}.${index}`, true)\n }}\n />\n\n {/* Modal add new option for type API */}\n {addOptionApiModalOpen && (\n <SmartSelectAddOptionApiModal\n isOpen={addOptionApiModalOpen}\n type={type}\n fieldSchema={fieldSchema}\n onCloseModal={() => {\n setAddOptionApiModalOpen(false)\n }}\n onSuccessCreation={(newOptionId) => {\n handleFieldRefreshRequest()\n updateFormSettings({\n key: fieldId,\n value: newOptionId,\n })\n setAddOptionApiModalOpen(false)\n }}\n />\n )}\n\n {/* Following block shows a grid with validation error message and refresh icon */}\n {!formValues.ui?.isBridgeEnabled ? (\n <div\n style={{\n display: 'grid',\n gridTemplateColumns: '1fr auto',\n gap: '1rem',\n }}\n >\n {isTouched && fieldStatus ? (\n <InputFeedback $status={fieldStatus} />\n ) : (\n <div />\n )}\n {fieldSchema.refreshable ? (\n <div style={{ textAlign: 'right' }}>\n <TinyTextualButton\n onClick={handleFieldRefreshRequest}\n disabled={isLoading}\n >\n <BiRefresh /> {t('nbee.bridgeBuilder.refreshDropdownListCta')}\n </TinyTextualButton>\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n )\n}\n","import React from 'react'\nimport { InputToggle } from '@components/Form/InputToggle'\nimport { useFormikContext } from 'formik'\nimport { AppConfigurationType, BridgeFormValues } from 'Nbee'\nimport { ApiAppSetting } from 'BackendApi'\nimport { getSettingFieldError } from '@features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/utils'\nimport { InputFeedback } from '@components/Basic/InputFeedback'\nimport { LabelWithDocTooltip } from '@components/Form/LabelWithDocTooltip'\nimport { useTriggerSettingsUpdate } from '@features/nbee/SimpleBridgeBuilderForm/fields/IntegrationSettings/useTriggerSettingsUpdate'\nimport { trackEvent } from '@app/dataTracking'\n\ninterface Props {\n fieldSchema: ApiAppSetting\n type: AppConfigurationType\n isLoading: boolean\n index: number\n}\n\nexport const SettingFieldToggle: React.FC<Props> = ({\n isLoading,\n type,\n fieldSchema,\n index,\n}) => {\n const {\n values: formValues,\n setFieldValue,\n setFieldTouched,\n touched,\n errors,\n } = useFormikContext<BridgeFormValues>()\n\n const { refetchSettings } = useTriggerSettingsUpdate(type)\n\n const settingFieldName = `${type}.settings`\n const currentSettingsValues = formValues[type].settings || []\n\n const fieldId = fieldSchema.id\n const fieldLabel = fieldSchema.required\n ? `${fieldSchema.label} (*)`\n : fieldSchema.label\n\n const currentFieldValue = currentSettingsValues.find((v) => v.key === fieldId)\n const isChecked = Boolean(currentFieldValue?.value) || false\n\n const { isTouched, fieldStatus } = getSettingFieldError({\n type,\n touched,\n errors,\n index,\n })\n\n return (\n <div>\n {fieldSchema.docUrl || fieldSchema.tooltip ? (\n <LabelWithDocTooltip\n label={fieldSchema.label}\n isRequired={fieldSchema.required}\n tooltip={fieldSchema.tooltip}\n docUrl={fieldSchema.docUrl}\n />\n ) : null}\n <InputToggle\n $isDisabled={formValues.ui?.isBridgeEnabled}\n onChange={() => {\n if (isLoading) {\n return\n }\n\n const newValue = {\n key: fieldId,\n value: !isChecked,\n }\n\n trackEvent({\n eventName: 'IntegrationSettingSelected',\n step: 'Apps',\n feature: 'NBEE',\n params: {\n custom: {\n fieldId: newValue.key,\n value: newValue.value,\n },\n },\n })\n\n const newSettings = currentFieldValue\n ? currentSettingsValues.map((setting) =>\n setting.key === fieldId ? newValue : setting\n )\n : [...currentSettingsValues, newValue]\n\n setFieldValue(settingFieldName, newSettings)\n\n // we trigger the retrival of new setting only if is a setting with a child\n if (fieldSchema.hasChild) {\n refetchSettings()\n }\n }}\n $isChecked={isChecked}\n $labelRight={fieldLabel}\n $variant={'primary'}\n onBlur={() => {\n setFieldTouched(`${settingFieldName}.${index}`, true)\n }}\n />\n {isTouched && fieldStatus ? (\n <InputFeedback $status={fieldStatus} />\n ) : null}\n </div>\n )\n}\n","import { FormikProps } from 'formik'\nimport { BridgeFormValues } from 'Nbee'\n\nexport const touchAllSettings = (\n formikProps: FormikProps<BridgeFormValues>\n) => {\n formikProps.validateForm()\n const allSourceSettings = formikProps.values.source?.settings || []\n const allDestinationSettings = formikProps.values.destination?.settings || []\n const newTouched = {\n ...formikProps.touched,\n source: {\n ...formikProps.touched.source,\n settings: allSourceSettings.map(() => true),\n },\n destination: {\n ...formikProps.touched.destination,\n settings: allDestinationSettings.map(() => true),\n },\n }\n // there's an issue with our touched state for settings and formik interface definition\n formikProps.setTouched(newTouched as never)\n}\n","import React, { useContext, useEffect, useState } from 'react'\nimport { InputFeedback } from '@components/Basic/InputFeedback'\nimport { parseApiError } from '@app/api/utils/error'\nimport { PanelPopupContext } from '@components/Panel'\nimport { ApiErrorResponse } from 'BackendApi'\nimport { useFormikContext } from 'formik'\nimport { BridgeFormValues, AppConfigurationType } from 'Nbee'\nimport { Trans } from 'react-i18next'\nimport { useDispatch } from 'react-redux'\nimport { triggerConnectAccountPopup } from '@app/store/actions/ApplicationConfigurationActions'\n\ntype PopupError = ApiErrorResponse | null\n\nexport const usePopupError = ({\n type,\n showLogo,\n}: {\n type: AppConfigurationType\n showLogo?: boolean\n}) => {\n const dispatch = useDispatch()\n const panelContext = useContext(PanelPopupContext)\n const { values, setFieldValue } = useFormikContext<BridgeFormValues>()\n const [error, setError] = useState<PopupError>(null)\n const [selectedIntegrationId, setSelectedIntegrationId] = useState<\n number | null\n >(null)\n const errorCodes = ['integration-error', 'integration-reauthorize']\n const logoUri = values.ui && values.ui[type] && values.ui[type]?.logoUri\n\n useEffect(() => {\n if (!panelContext.sendPopup) {\n return\n }\n panelContext.sendPopup(undefined)\n setFieldValue(`ui.${type}.hasSettingsApiError`, false)\n setFieldValue(`ui.${type}.hasIntegrationApiError`, false)\n if (error) {\n // showing popup\n const parsedError = parseApiError(error)\n setFieldValue(`ui.${type}.hasSettingsApiError`, true)\n panelContext.sendPopup({\n content: (\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: '0.6rem',\n }}\n >\n {showLogo && logoUri ? (\n <img src={logoUri} width={'20'} alt={'logo'} />\n ) : null}\n <InputFeedback\n $status={{\n error:\n parsedError.code === 'integration-reauthorize' ? (\n <Trans\n ns={'all'}\n i18nKey={\n 'nbee.bridgeBuilder.validation.integrationApiError'\n }\n components={{\n span: (\n <span\n style={{\n textDecoration: 'underline',\n cursor: 'pointer',\n }}\n onClick={() => {\n if (selectedIntegrationId) {\n dispatch(\n triggerConnectAccountPopup(\n selectedIntegrationId\n )\n )\n }\n }}\n />\n ),\n }}\n />\n ) : (\n parsedError.message\n ),\n }}\n />\n </div>\n ),\n dismissable: true,\n position: 'bottom',\n })\n\n // if we detect an error related to the integration dropdown we set it a specific error state\n if (parsedError && errorCodes.includes(String(parsedError.code))) {\n setFieldValue(`ui.${type}.hasIntegrationApiError`, true)\n }\n }\n }, [error])\n\n const showPopupError = (error: PopupError) => {\n setError(error)\n }\n\n const clearPopupError = () => {\n setError(null)\n }\n\n const setIntegrationId = (integrationId: number) => {\n setSelectedIntegrationId(integrationId)\n }\n\n return {\n showPopupError,\n clearPopupError,\n setIntegrationId,\n }\n}\n","import { useField } from 'formik'\nimport { AppConfigurationType } from 'Nbee'\n\nexport const useTriggerSettingsUpdate = (type: AppConfigurationType) => {\n const [field, _meta, helpers] = useField<number>(\n `ui.${type}.triggerSettingsUpdate`\n )\n\n const refetchSettings = () => {\n helpers.setValue(new Date().getTime())\n }\n\n return {\n lastUpdate: field.value,\n refetchSettings,\n }\n}\n","import {\n AppConfigurationType,\n BridgeFormValues,\n PartialConfiguredApp,\n EmailReceiptSettings,\n} from 'Nbee'\nimport * as yup from 'yup'\nimport t from 'public/locales/en-US.json'\nimport { emailValidator } from '@app/utils/validators/RegExp'\nimport { emailReceiptValidationSchema } from '@features/nbee/EmailReceipt/validation'\n\ntype ConfiguredAppErrors = Record<keyof PartialConfiguredApp, string>\ntype BridgeFormValuesErrors = Record<keyof BridgeFormValues, string> & {\n ui?: {\n source?: {\n requiredSettingFields?: Record<string, string>[]\n }\n destination?: {\n requiredSettingFields?: Record<string, string>[]\n }\n }\n emailReceiptErrors?: Record<string, string>\n}\n\ntype EmailReceiptErrors = {\n recipients?: string\n subject?: string\n}\n\nconst validateAppConfiguration = (configuredApp: PartialConfiguredApp) => {\n const errors: Partial<ConfiguredAppErrors> = {}\n if (!configuredApp.appId) {\n errors.appId = t.nbee.bridgeBuilder.validation.appSelector\n }\n\n if (!configuredApp.integrationId) {\n errors.integrationId = t.nbee.bridgeBuilder.validation.integrationSelector\n }\n\n return errors\n}\n\nconst validateAppSettings = (\n values: BridgeFormValues,\n type: AppConfigurationType\n) => {\n // build object structure as same as form values, starting from ui.type.required\n\n const errors = {\n [type]: {\n settings: [] as string[],\n },\n }\n\n // get array of all settings\n const allSettingsFields =\n (values.ui &&\n values.ui[type] &&\n values.ui[type]?.allRetrivedSettingFields) ||\n []\n // cycle through it to see if required onces have correspondant key in form values\n allSettingsFields.forEach((setting, index) => {\n // reset validation\n errors[type].settings[index] = ''\n\n // getting the value fo the field\n const formSettings = values[type]?.settings || []\n const fieldSettingValue = formSettings.find(\n (item) => item.key === setting.id\n )?.value\n\n // validate type also for not required settings\n if (\n setting.type === 'email' &&\n fieldSettingValue &&\n !emailValidator(fieldSettingValue as string)\n ) {\n errors[type].settings[index] = 'Invalid email format'\n }\n\n // validate type of array of emails\n if (setting.type === 'tags' && setting.format === 'email') {\n const allArrayItemsAreValidEmail = (\n (fieldSettingValue as string[]) || []\n ).every((email) => emailValidator(email))\n errors[type].settings[index] = !allArrayItemsAreValidEmail\n ? 'Invalid email format'\n : ''\n }\n\n // if setting is not required we are ok to proceed\n if (!setting.required) {\n return\n }\n\n // here we need to control if `fieldSettingValue` is falsy (which includes false for toggle) or is an empty array\n const isEmptyArray =\n Array.isArray(fieldSettingValue) && fieldSettingValue.length === 0\n if (!fieldSettingValue || isEmptyArray) {\n errors[type].settings[index] = `${setting.label} is required`\n } else {\n errors[type].settings[index] = ''\n }\n })\n\n // check if we have some errors, otherwise return an empty object\n // this because we cannot filter-out empty items or we break array length and\n // error index will not match the same index of setting fields\n const hasSomeErrors = errors[type].settings.some((s) => !!s)\n return hasSomeErrors ? errors : {}\n}\n\nexport const validateNbeeForm = (values: BridgeFormValues) => {\n const errors: Partial<BridgeFormValuesErrors> = {}\n\n if (!values.name) {\n errors.name = t.nbee.bridgeBuilder.validation.name\n }\n\n const sourceErrors = validateAppConfiguration(values.source)\n const destinationErrors = validateAppConfiguration(values.destination)\n // validating required app settings\n const sourceSettingErrors = validateAppSettings(values, 'source')\n const destinationSettingErrors = validateAppSettings(values, 'destination')\n\n const computedErrors = {\n ...errors,\n source: Object.keys(sourceErrors).length ? sourceErrors : undefined,\n destination: Object.keys(destinationErrors).length\n ? destinationErrors\n : undefined,\n ...sourceSettingErrors,\n ...destinationSettingErrors,\n }\n\n if (!computedErrors.source) {\n delete computedErrors.source\n }\n if (!computedErrors.destination) {\n delete computedErrors.destination\n }\n\n return computedErrors\n}\n","import React from 'react'\nimport { PageEditor } from '@app/layouts/PageEditor'\n\nimport styled from 'styled-components'\nimport superHeroImg from '@assets/images/superhero.svg'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport { useTranslation } from 'react-i18next'\nimport { isInIframe } from '@app/utils/isInFrame'\n\nexport const InfoStepWrapper = styled.div`\n background-color: #fff;\n box-shadow: 2px 2px 9px 2px rgba(0, 0, 0, 0.15);\n border-radius: 6px;\n display: flex;\n flex-direction: column;\n text-align: center;\n padding: 3rem 2.5rem;\n width: 750px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n\n h1 {\n font-size: 1.3rem;\n color: #273649;\n }\n\n p {\n font-size: 1rem;\n width: 90%;\n margin: 0 auto;\n color: #273649;\n }\n\n img {\n width: 320px;\n margin: 1.9rem auto;\n }\n\n button {\n margin: 3rem auto 0;\n width: 20rem;\n }\n`\n\nexport const InfoPage: React.FC = () => {\n const { t } = useTranslation()\n\n return (\n <PageEditor>\n <InfoStepWrapper>\n <h1>{t('nbee.bridgeBuilder.infoPageTitle')}</h1>\n <p>{t('nbee.bridgeBuilder.infoPageSubtitle')}</p>\n <img src={superHeroImg} alt={'super hero'} />\n <p>{t('nbee.bridgeBuilder.infoPageDescription')}</p>\n <a\n rel='noreferrer'\n href={`${process.env.REACT_APP_V1_URL}/bridges`}\n target={isInIframe() ? '_blank' : undefined}\n >\n <Button $size={'large'} $variant={'primary'}>\n {t('nbee.bridgeBuilder.continueToLeadsbridge')}\n </Button>\n </a>\n </InfoStepWrapper>\n </PageEditor>\n )\n}\n","import { Icon } from 'semantic-ui-react'\nimport { Button } from '@components/Basic/ButtonNbe'\nimport React from 'react'\nimport {\n StyledNewFeatureChip,\n StyledBannerWrapper,\n StyledHeading,\n StyledParagraph,\n StepImage,\n} from '@features/nbee/StepCompleted/styled'\nimport { useTranslation } from 'react-i18next'\nimport { usePostPerformanceBoosterByBridgeId } from '@app/api/postPerformanceBoosterByBridgeId'\nimport PerformanceBoosterFinishImage from '@assets/images/illustrations/grow.svg'\nimport FinishImage from '@assets/images/illustrations/nbee-completed.svg'\n\ninterface Props {\n existingPerformanceBoosterAvailable?: boolean\n handleCreatePerformanceBoosterAndRedirect?: () => void\n bridgeId: string\n existingPbId?: number\n}\n\nexport const PerformanceBoosterBanner: React.FC<Props> = ({\n existingPerformanceBoosterAvailable,\n bridgeId,\n existingPbId,\n}) => {\n const { t } = useTranslation()\n const vueAppBaseUr = process.env.VUE_APP_BASE_URL\n const {\n mutateAsync: createPerformanceBooster,\n isLoading: isCreatingPerformanceBooster,\n error: errorCreatingPerformanceBooster,\n } = usePostPerformanceBoosterByBridgeId()\n\n const handleCreatePerformanceBoosterAndRedirect = async () => {\n if (existingPerformanceBoosterAvailable) {\n window.location.href = `${vueAppBaseUr}/pb/${existingPbId}/edit`\n } else {\n await createPerformanceBooster(\n { bridgeId: bridgeId?.toString() || '' },\n {\n onSuccess: (data) => {\n window.location.href = `${vueAppBaseUr}/pb/${data?.data?.performanceBooster?.id}/edit`\n },\n }\n )\n }\n }\n return (\n <StyledBannerWrapper>\n <div style={{ minWidth: '385px' }}>\n <StyledNewFeatureChip>\n <Icon name='star' size={'tiny'} />\n <span\n style={{\n fontSize: '10px',\n fontWeight: 600,\n whiteSpace: 'nowrap',\n }}\n >\n {t('pb.bannerChip') || 'NEW FEATURE'}\n </span>\n </StyledNewFeatureChip>\n <StyledHeading>\n {t('pb.bannerTitle') || 'What’s Next? Boost Your Ad Performance!'}\n </StyledHeading>\n <StyledParagraph>\n {t('pb.bannerP1') ||\n 'Enhance your ad performance with Performance Booster in a few simple steps.'}\n </StyledParagraph>\n <StyledParagraph>\n {t('pb.bannerP2') ||\n 'LeadsBridge will automatically transfer your lead conversion events to Facebook, providing seamless ad optimization.'}\n </StyledParagraph>\n\n <Button\n $variant={'primary'}\n style={{}}\n $loading={isCreatingPerformanceBooster}\n onClick={handleCreatePerformanceBoosterAndRedirect}\n >\n {existingPerformanceBoosterAvailable\n ? 'Go to Performance Booster'\n : t('pb.bannerCta') || 'Add Performance Booster'}\n </Button>\n </div>\n <StepImage\n style={{ marginLeft: '16px', width: '282px' }}\n src={PerformanceBoosterFinishImage}\n alt={t('nbee.bridgeBuilder.step3Title')}\n />\n </StyledBannerWrapper>\n )\n}\n","import { Icon } from 'semantic-ui-react'\nimport React from 'react'\nimport {\n StyledPercentage,\n StyledTipHeading,\n StyledTipParagraph,\n StyledTipWrapper,\n} from '@features/nbee/StepCompleted/styled'\nimport { useTranslation } from 'react-i18next'\n\nexport const PerformanceBoosterTip: React.FC = () => {\n const { t } = useTranslation()\n return (\n <StyledTipWrapper>\n <StyledTipHeading>\n <Icon\n name='lightbulb'\n style={{\n color: '#41A7DC',\n fontSize: '12px',\n margin: 0,\n position: 'relative',\n top: '-4px',\n padding: 0,\n display: 'block',\n }}\n />\n <div style={{ fontWeight: 600, lineHeight: '12px' }}>\n {t('pb.tipTitle') || 'Tip'}\n </div>\n </StyledTipHeading>\n <StyledTipParagraph\n style={{\n marginTop: '12px',\n }}\n >\n {t('pb.tipP1') || 'Add performance booster to'}\n </StyledTipParagraph>\n\n <StyledTipParagraph>\n {t('pb.tipP2') || 'your bridge to see an average'}\n </StyledTipParagraph>\n <div style={{ display: 'flex', flexDirection: 'column' }}>\n <StyledPercentage>{t('pb.tipPercentage') || '44%'}</StyledPercentage>\n <StyledTipParagraph\n style={{\n marginTop: '6px',\n fontWeight: 600,\n }}\n >\n {t('pb.tipIncrease') || 'increase in conversion rate'}\n </StyledTipParagraph>\n </div>\n </StyledTipWrapper>\n )\n}\n","import { useGetPerformanceBoosterByBridgeId } from '@app/api/getPerformanceBoosterByBridgeId'\nimport { useEffect, useState } from 'react'\nimport { useCheckAppsCompatibility } from '@app/api/checkAppsCompatibility'\nimport { usePostPerformanceBoosterByBridgeId } from '@app/api/postPerformanceBoosterByBridgeId'\n\nexport const handlePerformanceBoosterRedirectUri = ({\n bridgeId,\n sourceId,\n destinationId,\n}: {\n bridgeId?: string\n sourceId?: number\n destinationId?: number\n}) => {\n const [performanceBoosterAvailable, setPerformanceBoosterAvailable] =\n useState<boolean>(false)\n const [\n existingPerformanceBoosterAvailable,\n setExistingPerformanceBoosterAvailable,\n ] = useState<boolean>(false)\n\n const {\n data: appCompatibilityCheck,\n isLoading: isCheckingAppsCompatibility,\n error: apiError,\n } = useCheckAppsCompatibility(sourceId, destinationId)\n\n const {\n data: performanceBooster,\n isLoading: isLoadingPerformanceBooster,\n error: errorGettingPerformanceBooster,\n } = useGetPerformanceBoosterByBridgeId(performanceBoosterAvailable, bridgeId)\n\n // Run compatibility check and set performance booster availability\n useEffect(() => {\n if (!isCheckingAppsCompatibility && appCompatibilityCheck) {\n const isAvailable =\n appCompatibilityCheck?.combination?.availableBridgeFeatures?.some(\n (feature) =>\n feature.moduleId === 'performance-booster' && feature.available\n )\n setPerformanceBoosterAvailable(isAvailable)\n }\n }, [appCompatibilityCheck])\n\n // Handle redirection logic\n useEffect(() => {\n if (!isLoadingPerformanceBooster && performanceBoosterAvailable) {\n if (performanceBooster?.data?.performanceBooster?.id) {\n setExistingPerformanceBoosterAvailable(true)\n }\n }\n }, [performanceBooster, isLoadingPerformanceBooster])\n\n return {\n performanceBoosterAvailable,\n existingPerformanceBoosterAvailable,\n errorGettingPerformanceBooster: apiError,\n existingPbId: performanceBooster?.data?.performanceBooster?.id,\n }\n}\n","import React, { forwardRef } from 'react'\nimport {\n DropDownItemStyled,\n DropDownStyled,\n} from '@features/nbee/WelcomeMessageForm/styled'\nimport { VariableObjType } from '@features/nbee/WelcomeMessageForm'\n\ninterface DropdownProps {\n items: VariableObjType[]\n onSelect: (item: VariableObjType) => void\n isVisible: boolean\n position: { x: number; y: number }\n highlightedIndex: number\n setHighlightedIndex: (index: number) => void\n}\n\nexport const Dropdown = forwardRef<HTMLDivElement, DropdownProps>(\n (\n {\n items,\n onSelect,\n isVisible,\n position,\n highlightedIndex,\n setHighlightedIndex,\n },\n ref\n ) => {\n const handleItemClick = (item: VariableObjType) => {\n onSelect(item)\n }\n\n const handleMouseEnter = (index: number) => {\n setHighlightedIndex(index)\n }\n\n const handleMouseLeave = () => {\n setHighlightedIndex(0)\n }\n\n return (\n <DropDownStyled\n ref={ref}\n isVisible={isVisible}\n position={position}\n tabIndex={0}\n >\n {items.map((item, index) => (\n <DropDownItemStyled\n key={item.id}\n onClick={() => handleItemClick(item)}\n isHighlighted={\n highlightedIndex === index || (!highlightedIndex && index === 0)\n }\n index={index}\n onMouseEnter={() => handleMouseEnter(index)}\n onMouseLeave={handleMouseLeave}\n >\n <span style={{ fontWeight: 600 }}>[{item.id}]</span>\n <span style={{ color: 'grey', textAlign: 'right' }}>\n {item.label}\n </span>\n </DropDownItemStyled>\n ))}\n </DropDownStyled>\n )\n }\n)\n","export const calculateLineHeight = (\n element: HTMLInputElement | HTMLTextAreaElement\n): number => {\n const computedStyle = window.getComputedStyle(element)\n const lineHeightStr = computedStyle.lineHeight\n if (lineHeightStr && lineHeightStr !== 'normal') {\n return parseInt(lineHeightStr, 10)\n }\n const testDiv = document.createElement('div')\n testDiv.style.position = 'absolute'\n testDiv.style.visibility = 'hidden'\n testDiv.style.width = `${element.clientWidth}px`\n testDiv.innerHTML = '<br>'\n document.body.appendChild(testDiv)\n const lineHeight = testDiv.offsetHeight\n document.body.removeChild(testDiv)\n\n return lineHeight\n}\n\nexport const calculateDropdownPosition = (\n element: HTMLInputElement | HTMLTextAreaElement,\n value: string,\n dropdownHeight: number,\n indexOfLastOpenBracket: number\n): { x: number; y: number } => {\n const rect = element.getBoundingClientRect()\n const lineHeight = calculateLineHeight(element)\n const textUpToCursor = value.substring(0, indexOfLastOpenBracket + 1)\n const lastNewLineIndex = value.lastIndexOf('\\n', indexOfLastOpenBracket)\n\n const textAfterLastNewLine =\n lastNewLineIndex !== -1\n ? value.substring(lastNewLineIndex + 1, indexOfLastOpenBracket + 1)\n : textUpToCursor\n\n const textLines = textUpToCursor.split('\\n')\n const dropdownY =\n rect.top +\n (textLines.length - 1) * lineHeight -\n dropdownHeight -\n (element.scrollHeight - element.clientHeight)\n\n const ghostSpan = document.createElement('span')\n ghostSpan.style.visibility = 'hidden'\n ghostSpan.style.position = 'absolute'\n ghostSpan.style.whiteSpace = 'pre'\n ghostSpan.textContent = textAfterLastNewLine\n document.body.appendChild(ghostSpan)\n\n const computedStyle = window.getComputedStyle(element)\n ghostSpan.style.font = computedStyle.font\n ghostSpan.style.letterSpacing = computedStyle.letterSpacing\n ghostSpan.style.paddingLeft = computedStyle.paddingLeft\n ghostSpan.style.paddingRight = computedStyle.paddingRight\n\n const ghostRect = ghostSpan.getBoundingClientRect()\n const dropdownX = rect.left + ghostRect.width - element.scrollLeft\n\n document.body.removeChild(ghostSpan)\n\n return { x: dropdownX, y: dropdownY }\n}\n","import React, { ReactNode } from 'react'\nimport { ContentWrapperStyled, HeaderTextStyled, SubTextStyled } from './styled'\n\ninterface ContentProps {\n section?: ReactNode\n headerText?: string\n subText?: string\n}\n\nexport const Content: React.FC<ContentProps> = ({\n section,\n headerText,\n subText,\n}) => {\n return (\n <ContentWrapperStyled>\n {section}\n <HeaderTextStyled>{headerText}</HeaderTextStyled>\n <SubTextStyled>{subText}</SubTextStyled>\n </ContentWrapperStyled>\n )\n}\n","import * as yup from 'yup'\nimport all from 'public/locales/en-US.json'\nimport { yupRequiredBoolean } from '@app/utils/validators/yupCustomValidators'\n\ntype SignupFormValues = {\n firstName: string\n lastName: string\n email: string\n privacyConsent: boolean\n industry: string\n couponCode?: string\n}\n\nexport const validationSchema = yup.object().shape({\n firstName: yup.string().required(all.common.genericFieldIsRequired),\n lastName: yup.string().required(all.common.genericFieldIsRequired),\n email: yup.string().email().required(all.common.genericFieldIsRequired),\n privacyConsent: yupRequiredBoolean(all.common.genericFieldIsRequired),\n})\n\nexport const initialFormValues: SignupFormValues = {\n firstName: '',\n lastName: '',\n email: '',\n privacyConsent: false,\n industry: '',\n}\n\n// SIGN UP APPSUMO TYPES\n\ntype SignupFormValuesAppsumo = {\n firstName: string\n lastName: string\n email: string\n industry: string\n couponCode: string\n privacyConsent: boolean\n}\n\nexport const validationSchemaAppsumo = validationSchema.shape({\n couponCode: yup.string().required(all.common.genericFieldIsRequired),\n privacyConsent: yupRequiredBoolean(all.common.genericFieldIsRequired),\n})\n\nexport const initialFormValuesAppsumo: SignupFormValuesAppsumo = {\n firstName: '',\n lastName: '',\n email: '',\n industry: '',\n couponCode: '',\n privacyConsent: false,\n}\n","import AuthService from '@app/services/AuthService'\nimport { ApiUserCredentials } from 'BackendApi'\nimport { signInUserSessionCognito } from '@app/services/apiAuthClient/utils'\n\ninterface HandleSignupWithEmailSuccessProps {\n credentials?: ApiUserCredentials\n onError: (message: string) => void\n}\n\nexport const handleSignupWithEmailSuccess = async ({\n credentials,\n onError,\n}: HandleSignupWithEmailSuccessProps) => {\n if (\n !credentials ||\n !credentials.username ||\n !credentials.idToken ||\n !credentials.accessToken ||\n !credentials.refreshToken\n ) {\n onError('Received invalid credentials')\n return\n }\n\n signInUserSessionCognito({\n username: credentials.username,\n idToken: credentials.idToken,\n accessToken: credentials.accessToken,\n refreshToken: credentials.refreshToken,\n })\n\n try {\n await AuthService.setSessionCookie()\n } catch (error) {\n onError(error instanceof Error ? error.message : 'Unknown error')\n }\n}\n","import { useHistory, useLocation } from 'react-router-dom'\nimport queryString from 'query-string'\n\nconst localStorageKey = 'LB_SIGNUP'\nconst defaultTrialDays = 14\n\ntype SignupParams = {\n cbPlan: string\n couponCode?: string\n trialDays: number\n sourceId?: string\n destinationId?: string\n ref?: string\n}\n\nconst defaultParams: SignupParams = {\n cbPlan: 'freemium',\n trialDays: defaultTrialDays,\n}\n\nexport const useHideParamsFromString = () => {\n const history = useHistory()\n const location = useLocation()\n\n const parsedUrl = queryString.parse(location.search)\n const cbPlan = parsedUrl && (parsedUrl.cbPlan as string)\n const couponCode = parsedUrl && (parsedUrl.cc as string | undefined)\n const trialDays =\n (parsedUrl && (parsedUrl.td as string)) || `${defaultTrialDays}`\n\n const sourceId = parsedUrl && (parsedUrl.sourceId as string)\n const destinationId = parsedUrl && (parsedUrl.destinationId as string)\n\n const ref = parsedUrl && (parsedUrl.ref as string)\n\n if (!Object.keys(parsedUrl).length) {\n // prevent endless redirection loop\n return\n }\n\n const paramsFromQuery: SignupParams = {\n cbPlan: cbPlan || 'freemium',\n couponCode,\n trialDays: parseInt(trialDays, 10),\n sourceId,\n destinationId,\n ref,\n }\n\n // storing in base64 encode\n localStorage.setItem(localStorageKey, btoa(JSON.stringify(paramsFromQuery)))\n\n // remove params from url\n history.replace(location.pathname)\n}\n\nexport const getPersistentSignupParams = () => {\n try {\n // decode from base64\n const savedString = atob(localStorage.getItem(localStorageKey) || '')\n return JSON.parse(savedString) as SignupParams\n } catch (e) {\n return defaultParams\n }\n}\n\nexport const deletePersistendSignupParms = () => {\n localStorage.removeItem(localStorageKey)\n}\n","/* tslint:disable */\n/* eslint-disable */\n// this is an auto generated file. This will be overwritten\n\nexport const createIntegration = /* GraphQL */ `\n mutation CreateIntegration(\n $input: CreateIntegrationInput!\n $condition: ModelIntegrationConditionInput\n ) {\n createIntegration(input: $input, condition: $condition) {\n id\n platformId\n name\n icon\n coordinates\n isBeta\n isVisible\n createdAt\n updatedAt\n }\n }\n`;\nexport const updateIntegration = /* GraphQL */ `\n mutation UpdateIntegration(\n $input: UpdateIntegrationInput!\n $condition: ModelIntegrationConditionInput\n ) {\n updateIntegration(input: $input, condition: $condition) {\n id\n platformId\n name\n icon\n coordinates\n isBeta\n isVisible\n createdAt\n updatedAt\n }\n }\n`;\nexport const deleteIntegration = /* GraphQL */ `\n mutation DeleteIntegration(\n $input: DeleteIntegrationInput!\n $condition: ModelIntegrationConditionInput\n ) {\n deleteIntegration(input: $input, condition: $condition) {\n id\n platformId\n name\n icon\n coordinates\n isBeta\n isVisible\n createdAt\n updatedAt\n }\n }\n`;\nexport const createFbAppStoreStatus = /* GraphQL */ `\n mutation CreateFbAppStoreStatus(\n $input: CreateFbAppStoreStatusInput!\n $condition: ModelFbAppStoreStatusConditionInput\n ) {\n createFbAppStoreStatus(input: $input, condition: $condition) {\n id\n status\n owner\n crmId\n createdAt\n updatedAt\n }\n }\n`;\nexport const updateFbAppStoreStatus = /* GraphQL */ `\n mutation UpdateFbAppStoreStatus(\n $input: UpdateFbAppStoreStatusInput!\n $condition: ModelFbAppStoreStatusConditionInput\n ) {\n updateFbAppStoreStatus(input: $input, condition: $condition) {\n id\n status\n owner\n crmId\n createdAt\n updatedAt\n }\n }\n`;\nexport const deleteFbAppStoreStatus = /* GraphQL */ `\n mutation DeleteFbAppStoreStatus(\n $input: DeleteFbAppStoreStatusInput!\n $condition: ModelFbAppStoreStatusConditionInput\n ) {\n deleteFbAppStoreStatus(input: $input, condition: $condition) {\n id\n status\n owner\n crmId\n createdAt\n updatedAt\n }\n }\n`;\n","/* tslint:disable */\n/* eslint-disable */\n// this is an auto generated file. This will be overwritten\n\nexport const getIntegration = /* GraphQL */ `\n query GetIntegration($id: ID!) {\n getIntegration(id: $id) {\n id\n platformId\n name\n icon\n coordinates\n isBeta\n isVisible\n createdAt\n updatedAt\n }\n }\n`;\nexport const listIntegrations = /* GraphQL */ `\n query ListIntegrations(\n $filter: ModelIntegrationFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listIntegrations(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n platformId\n name\n icon\n coordinates\n isBeta\n isVisible\n createdAt\n updatedAt\n }\n nextToken\n }\n }\n`;\nexport const getFbAppStoreStatus = /* GraphQL */ `\n query GetFbAppStoreStatus($id: ID!) {\n getFbAppStoreStatus(id: $id) {\n id\n status\n owner\n crmId\n createdAt\n updatedAt\n }\n }\n`;\nexport const listFbAppStoreStatuss = /* GraphQL */ `\n query ListFbAppStoreStatuss(\n $filter: ModelFbAppStoreStatusFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listFbAppStoreStatuss(\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n status\n owner\n crmId\n createdAt\n updatedAt\n }\n nextToken\n }\n }\n`;\n","/* tslint:disable */\n/* eslint-disable */\n// this is an auto generated file. This will be overwritten\n\nexport const onCreateIntegration = /* GraphQL */ `\n subscription OnCreateIntegration {\n onCreateIntegration {\n id\n platformId\n name\n icon\n coordinates\n isBeta\n isVisible\n createdAt\n updatedAt\n }\n }\n`;\nexport const onUpdateIntegration = /* GraphQL */ `\n subscription OnUpdateIntegration {\n onUpdateIntegration {\n id\n platformId\n name\n icon\n coordinates\n isBeta\n isVisible\n createdAt\n updatedAt\n }\n }\n`;\nexport const onDeleteIntegration = /* GraphQL */ `\n subscription OnDeleteIntegration {\n onDeleteIntegration {\n id\n platformId\n name\n icon\n coordinates\n isBeta\n isVisible\n createdAt\n updatedAt\n }\n }\n`;\nexport const onCreateFbAppStoreStatus = /* GraphQL */ `\n subscription OnCreateFbAppStoreStatus($owner: String) {\n onCreateFbAppStoreStatus(owner: $owner) {\n id\n status\n owner\n crmId\n createdAt\n updatedAt\n }\n }\n`;\nexport const onUpdateFbAppStoreStatus = /* GraphQL */ `\n subscription OnUpdateFbAppStoreStatus($owner: String) {\n onUpdateFbAppStoreStatus(owner: $owner) {\n id\n status\n owner\n crmId\n createdAt\n updatedAt\n }\n }\n`;\nexport const onDeleteFbAppStoreStatus = /* GraphQL */ `\n subscription OnDeleteFbAppStoreStatus($owner: String) {\n onDeleteFbAppStoreStatus(owner: $owner) {\n id\n status\n owner\n crmId\n createdAt\n updatedAt\n }\n }\n`;\n","import { useEffect } from 'react'\nimport Pusher from 'pusher-js'\nimport { ApiIntegrationListenerField } from '@app/@typings/Api/integration'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { setIntegrationListenerFields } from '@app/store/actions/IntegrationListenerActions'\n\nexport type PusherEventData = {\n data: { recognizedFields: ApiIntegrationListenerField[] }\n}\n\n/* *** EXAMPLE DATA FROM PUSHER ***\n{\n \"data\": {\n \"recognizedFields\": [\n {\n \"id\": \"email\",\n \"label\": \"email\",\n \"lastValue\": \"test\",\n \"enabled\": true\n },\n {\n \"id\": \"id\",\n \"label\": \"id\",\n \"lastValue\": \"abcId\",\n \"enabled\": true\n },\n {\n \"id\": \"name\",\n \"label\": \"name\",\n \"lastValue\": \"John Doe2\",\n \"enabled\": true\n },\n {\n \"id\": \"XDEBUG_SESSION_START\",\n \"label\": \"XDEBUG_SESSION_START\",\n \"lastValue\": \"PHPSTORM\",\n \"enabled\": true\n }\n ]\n }\n}\n\n\n*/\n\nexport const usePusherChannel = (\n channelName: string,\n eventName: string,\n subscribeCondition: boolean,\n onUnsuscribe: () => void,\n onSubscriptionReceived: () => void\n): void => {\n const dispatch = useAppDispatch()\n\n useEffect(() => {\n // No Pusher instance created if condition is not met.\n if (!subscribeCondition) return\n\n if (process.env.NODE_ENV !== 'production') Pusher.logToConsole = true\n\n const pusher = new Pusher(process.env.REACT_APP_PUSHER_ENV ?? '', {\n cluster: `${process.env.REACT_APP_PUSHER_CLUSTER}` ?? '',\n })\n\n const channel = pusher.subscribe(channelName)\n\n // Bind the specified event name to a function that sets data.\n channel.bind(eventName, () => {\n if (onSubscriptionReceived) {\n onSubscriptionReceived()\n }\n })\n\n // Cleanup function\n return () => {\n // Unbind the event handler...\n channel.unbind(eventName)\n // Unsubscribe from the channel...\n pusher.unsubscribe(channelName)\n onUnsuscribe()\n onSubscriptionReceived()\n }\n }, [channelName, eventName, subscribeCondition, dispatch])\n}\n","import i18n from 'i18next'\nimport { initReactI18next } from 'react-i18next'\nimport all from 'public/locales/en-US.json'\n\nconst resources = {\n en: {\n all,\n },\n}\n\ni18n.use(initReactI18next).init({\n resources,\n lng: 'en',\n defaultNS: 'all',\n interpolation: {\n escapeValue: false, // react already safes from xss\n },\n})\n\nconst w = window as any\nw.showLocaleKeys = (showKeys: boolean) =>\n i18n.changeLanguage(showKeys ? 'cimode' : 'en')\n\nexport default i18n\n"],"names":["AlertProgressBar","timer","progress","AlertStyled","theme","zIndex","overallNotifications","isVisible","AlertProgressBarWrapper","button","primary","backgroundColor","AlertProgressBarStyled","AlertWrapper","AlertHeader","AlertButtonClose","color","link","AlertBody","AlertBodyContent","AlertImageWrapper","AlertFooter","FakeInputStyled","required","paddingTop","$size","getSize","margin","LoaderDimmer","LoaderStyled","$active","$text","$inverted","skeletonElementSizes","width","height","marginBottom","marginTop","label","select","input","toggle","StateIconStyled","GlobalTypographyStyled","Typography","tagName","otherProps","Tag","sizing","className","defaultProps","Message","error","ButtonErrorUi","scope","t","bbuMatchUrl","location","pathname","path","exact","isFbBbu","params","partnerName","signupBbuRoute","source","destination","undefined","disabled","i18nKey","components","a","to","id","FacebookButtonCustom","onTokenRetrived","onSdkLoadError","doingLoginFb","setDoingLoginFb","useState","useEffect","then","catch","buttonLabel","SignUp","SignIn","NoScope","onClick","fb","window","FB","login","response","accessToken","authResponse","FacebookNativeButtonWrapper","FacebookButtonNative","dataSize","dataWidth","useContinueAs","customFbAppScopes","String","createFbOnLoginFunction","fnName","getLoginStatus","initFbScriptOrCreate","Promise","resolve","reject","script","document","createElement","src","async","onload","onerror","Error","body","appendChild","init","appId","cookie","xfbml","version","GoogleButtonCustom","onGoogleLegacySdkInitError","onGoogleLegacySdkInitSuccess","isLoading","setIsLoading","isDisabled","setIsDisabled","gapi","load","auth2","client_id","injectGoogleScript","getAuthInstance","signIn","googleUser","id_token","getAuthResponse","checkGoogleScriptOrCreate","google","scopeToGoogleContext","GoogleButtonStyled","GoogleButtonNative","initGoogleButton","buttonId","accounts","initialize","callback","credentialResponse","w","onGoogleTokenRetrived","credential","renderButton","getElementById","type","size","text","locale","initGoogleSignin","e","cancel","GooglePicker","fieldSchema","index","apiHasError","values","formValues","setFieldValue","setFieldTouched","errors","touched","FILE_ID_PREFIX","setAccessToken","fileName","setFileName","fileId","setFileId","fieldId","setFieldId","internalError","setInternalError","settingFieldName","isBridgeEnabled","ui","isTouched","fieldStatus","pickerCallback","data","action","picker","Action","CANCEL","PICKED","docs","name","newValue","key","value","updateFormSettings","eventName","step","feature","custom","openPicker","client","drive","about","get","fields","access_token","metaFileType","format","ViewId","FORMS","toString","viewId","mimeType","SPREADSHEETS","view","DocsView","setMimeTypes","setMode","DocsViewMode","LIST","PickerBuilder","enableFeature","Feature","NAV_HIDDEN","setDeveloperKey","setAppId","setOAuthToken","addView","DocsUploadView","setCallback","build","setVisible","length","initData","isRefreshingFromApi","Boolean","refresh","includes","style","position","isRequired","tooltip","docUrl","border","cursor","onBlur","textAlign","display","gridTemplateColumns","gap","ConfettiStyled","myCanvas","resize","useWorker","myConfetti","particleCount","spread","origin","y","DestinationContentSample","initialData","setInitialData","initialDataError","setInitialDataError","initialDataTimoutId","useRef","initialDataRef","messageReceiverFn","event","isLbMessage","current","addEventListener","removeEventListener","setTimeout","clearTimeout","close","JSON","stringify","parentWindow","opener","postMessage","payload","Wrapper","LogoWrapper","Container","ButtonWrapper","ErrorPage","alt","target","href","rel","initialFormValues","email","phone","industry","privacyConsent","validationSchema","shape","Form","onSubmitSuccess","storeSurveyData","getIndustries","dispatch","initialValues","onSubmit","mutate","onSuccess","cognitoResponse","Auth","bypassCache","cognitoUser","parseAuthUser","AuthService","onError","title","message","handleSubmit","FormikInputField","FormikInputSelect","FormikInputCheckbox","Button","isSuccess","borderStyle","InputDomainStyled","CustomInput","props","c","onPaste","selectProps","children","CustomMenu","MenuList","addNewOptionButton","setNullSelectValue","setValue","addActionClick","strokeWidth","borderRadius","padding","fontFamily","CustomOption","hasLogo","logoUri","inputHasValue","inputValue","hasExtraLabel","extraLabel","isVerified","emailValidation","isFormulas","hasPadding","hasHoverEffect","isFocused","secondaryLabel","fontSize","dropdownPrimaryLabel","toUpperCase","icon","CustomSingleValue","elementInnerRef","selectedSingleValueEl","floatingLabel","floatingSingleValueStyles","fieldIsUnavailable","ref","justifyContent","flex","CustomControl","isCreatable","showIcon","isSearchable","hasValue","noIcon","defaultLabel","currentValue","getValue","isFloating","CustomValueContainer","tooltipId","tooltipInternalLabel","tooltipExternalMessage","innerProps","tooltipMessage","CustomIndicatorsContainer","isMenuOpen","menuIsOpen","upDownIconsStyle","largeUpDownIconsStyle","isClearable","clearValue","marginRight","CustomMultiValueRemove","createOptions","map","v","InputSmartCreatableSelect","onSelect","placeholder","defaultValue","$status","showDropdownIndicator","extraProps","noDropdownIndicator","DropdownIndicator","IndicatorSeparator","options","Option","SingleValue","Control","Menu","MultiValueRemove","Input","isMulti","noOptionsMessage","styles","onChange","selectedValue","newValues","Tooltip","place","getContent","useIsLabelTooLong","wrapperEl","outerWidth","setOuterWidth","singleValueWidth","setSingleValueWidth","useLayoutEffect","extraElementsWidth","Array","isArray","querySelector","clientWidth","offsetWidth","isLabelTooLong","labelWidth","sliderWidthHeight","transitionSize","parseFloat","replace","originalLeftSpace","bgColorChecked","$variant","bgColorNotChecked","WrapperStyled","commonStyle","$isChecked","LabelStyled","$isDisabled","SpanStyled","CustomMultiValue","isFormula","fieldType","isHovering","setIsHovering","valueContainerRef","containerSize","setContainerSize","handleRemoveClick","sourceLogoComponent","getBoundingClientRect","shouldShowTooltip","onMouseEnter","onMouseLeave","effect","chars","split","char","renderTooltipContent","onMouseDown","preventDefault","stopPropagation","isNewFormula","getOptionLabel","CustomMenuList","activeTab","handleTabChange","userHasFormulaEnabled","hasPicklist","hasFormula","handleTabClick","tab","isActive","onRedirectToPricing","formulaDescription","lastValue","regenerateMappingIds","newMapping","fieldIndex","mapping","sourceFieldId","formula","convertToMapping","mappedField","option","isText","selectId","find","m","sourceFields","picklistOptions","formulas","category","formulaCategory","findFieldLabel","field","f","createDefaultValues","item","isSource","isCustom","firstParam","join","rest","meta","DataTable","FieldsRow","InputBox","ValueBox","percentage","ProgressBar","StepBarItem","onStepClick","subLabel","onClickHandler","logTrackCallback","enableTrackingDebug","isSegmentEnabled","isEmbedded","trackEvent","sendEventToIntercom","analytics","user","userId","accountId","auth","eventParams","properties","lbAccountId","embedded","track","identifyUserByUserData","userData","uid","slaveUserId","intercomUserHash","external","intercom","userHash","identify","integrations","Intercom","user_hash","forgetUser","reset","useTrackPageView","isUserLoggedIn","isInExcludedPath","strict","page","AppStoreStatus","BbuPartnersName","BbuParnersFullName","PersistentCookiesKeys","PersistentLocalStorageKeys","PersistentSessionStorageKeys","ToolSquareStyled","PartnerConnectButton","integrationsMeta","useTranslation","history","urlParams","isDoingLogin","setIsDoingLogin","popup","setPopup","isPopupOpen","setIsPopupOpen","authState","state","userAuthState","userIsLogged","onTikTokAuthRequest","sessionStorage","setItem","tikTokUrl","encodeURIComponent","REACT_USE_MOCK_API","partnerFullName","newPopup","open","popupTimer","setInterval","closed","clearInterval","lbCode","URLSearchParams","search","Loader","ButtonProvider","provider","onBeforeAuth","onAuthError","_","errorCode","push","onAuthSuccess","userInfo","newUser","planId","pricing","cbPlanId","mrr","channel","sourceId","sourceName","destinationId","destinationName","alignItems","top","bottom","left","right","background","flexDirection","focus","fontWeight","textDecoration","SignInWrapper","LogoGroupStyled","AlreadyLoggedWrapper","HeadlineStyled","SignInBridgeByUrl","formComponent","links","pathnameParts","canLogin","noData","loginFormIsInitallyOpen","showLoginForm","setShowLoginForm","integrationLogos","nogutter","align","logoSmallUri","sm","headline","AuthContainer","loading","header","slot","logo","requestUri","linkText","form","Accordion","active","Segment","attributes","redirectTo","shouldFetchUserData","setShouldFetchUserData","isLoadingUser","doingLogin","setDoingLogin","loggedIn","setLoggedIn","doingSingin","setDoingSignin","setEmail","emailError","setEmailError","emailValided","setEmailValided","pw","setPw","pwIsVisible","setPwIsVisible","pwError","setPwError","formError","setFormError","signInUtilities","SignInUtilities","loginLayout","application","bbuPartnerName","isBbuValidPartnerName","Object","downgradeStatus","test","showGenericError","messages","formBody","InputField","onFocus","autoComplete","slotRight","Icon","prevState","handleSignIn","Divider","PasswordHelperStyled","visible","forwardRef","xmlns","viewBox","d","validLen","validUpperCase","validLowercase","validDigit","validSpecial","formStatus","setFormStatus","formEmailStatus","setFormEmailStatus","formCodeStatus","setFormCodeStatus","doingReset","setDoingReset","emailValidated","setEmailValidated","emailSent","setEmailSent","resetCode","setResetCode","form2Error","setForm2Error","verificationCode","setVerificationCode","verificationCodeError","setVerificationCodeError","newPassword","setNewPassword","newPasswordConfirmation","setNewPasswordConfirmation","doingReset2","setDoingReset2","newPasswordIsValid","setNewPasswordIsValid","passwordError","setPasswordError","setValidLen","setValidUppercase","setValidLowercase","setValidDigit","setValidSpecial","displayPwHelper","setDisplayPwHelper","activeIndex","setActiveIndex","redirectToQueryString","RegExp","slice","handleCheckNewPasswordValid","abortResetPwdFlow","headlineStep","descriptionStep","success","res","err","finally","handleValidateCode","content","code","verificationCodeBackup","confirmReset","Trans","oldPassword","min","matches","confirmPassword","oneOf","UlErrorStyled","LiErrorStyled","isChecked","CustomInputError","errorsCopy","setErrorsCopy","idx","setUser","newPasswordErrors","setNewPasswordErrors","showPwRules","setShowPwRules","HandleShowPassword","subscribed","Hub","username","EyeIcon","isFormik","validate","schema","abortEarly","validateOnMount","global","isValid","getFieldProps","passWordsMatch","I","AuthRouter","component","AuthBackgroundStyled","backgroundUrl","ButtonLoginContainer","GlobalLoginStyle","SignInForm","Image","referrerPolicy","LinkDivisor","NavStyled","LinkStyled","Divisor","BadgeStyled","FooterStyled","ImageStyled","ClaimLoginStyled","justify","md","lg","IconStyled","Title","Head","ResourceItemStyled__Icon","ResourceItemStyled","head","divisor","xs","buttonLink","labelPosition","inverted","basic","maxWidth","innerWidth","resource","rightSide","displayName","constructor","temp_password","password","this","validationData","challengeName","err2","status","temporary_password","resourceItems","Session","authenticationFlowType","endpoint","userAgent","keyPrefix","userConfirmed","challengeParam","useFirstLandRedirect","encodedSearch","encodedHash","hash","redirectUrlQuery","initialSigninUrl","redirectsToWhenLogged","isValidEmail","setIsValidEmail","isFormTouched","setIsFormTouched","verifyInProgress","setVerifyInProgress","identityProviders","setIdentityProviders","apiError","setApiError","Providers","inputErrorMessage","userEmailDomain","reverse","validProvider","ProviderName","providerName","identityProvider","assign","SmartSelectProps","hasCustomSearch","FilterRuleRow","filterRule","fieldSelectDefaultValue","fieldSelectInitialValues","onFieldChange","operatorSelectDefaultValue","operatorSelectInitialValues","onOperatorChange","inputValueType","onValueChange","onCopyFilterRule","onAddFilterRule","onRemoveFilterRule","isRemoveFilterRuleDisabled","isDefaultValueNotInSourceAnymore","isBridgeDisabled","operator","selectedOption","handleCopy","handleAdd","handleDelete","isDeleteDisabled","validateAppConfiguration","configuredApp","validateBridgeChooserForm","sourceErrors","destinationErrors","computedErrors","keys","FeatureNotAvailable","requiredLbPlanId","moduleReceiptId","bridgeId","updateBridgeToPricing","forcedDisabled","FieldGroup","FieldRow","FieldRecipients","helpers","setTouched","FieldSubject","FieldToggleStatus","onStatusChange","newState","emailReceiptValidationSchema","recipients","of","typeError","subject","useEmailReceiptValidation","setErrors","settings","emailReceipt","validateField","validateAt","prev","ErrorMessage","SupportMessage","PopupContentMappingError","fieldLabels","fieldLabelsTrimmed","concat","Translate","count","ButtonTestBeforeProceeding","formikProps","isDisabledFromParent","isSavingFromParent","destinationFields","panelContext","useContext","Panel","updateBridge","isUpdatingBridge","testFieldsMapping","testFieldsMappingResult","isTestingFieldsMapping","testFieldsMappingError","setSubmitting","sendPopup","dismissable","image","updateBridgeData","bridgeData","InputFeedback","isSubmitting","fieldsToTest","fieldsMapping","ErrorMessages","FieldMappingRow","selectOptions","formulaUserModule","formulaSchema","showWelcomeMessage","sourceLogoUri","fieldName","fieldValue","isModalOpen","toggleIsModalOpen","selectedMapping","setSelectedMapping","enabled","picklist","sourceFieldOptions","filter","destinationText","some","hasError","errorStatusMessage","errorStatus","validationIconState","destinationFieldLabel","mappingType","fullWidth","onMappingChange","mappingWithNewIds","sourceOptions","onFormulaSelect","mappingWithFormula","isOpen","onCloseModal","HeaderSearchWrapper","TopHeaderMiddle","isReloadingAllBridgeFields","backgroundColorHover","TopHeader","SubHeader","InputWrapper","SideLogoStyled","logoPosition","ClearInputButton","ProgressBarContainer","Fill","FieldsProgressBar","maxFields","mappedFields","SideLogo","HeaderSearchComponent","totalFields","destinationLogoUri","onInputChange","showAllFields","onShowAllFieldsRequest","isInTestScreen","showFilterButton","onRefetchFieldRequest","isReadonlyModeEnabled","welcomeMessageProps","isWelcomeMessageForm","isSmsForm","textColor","ns","br","slotLeft","marginLeft","ButtonSendTestLead","onSendTestLead","fieldMappingTestingValues","fieldMappingTesting","canSubmit","sendTestLead","isSendingTestLead","sendTestLeadApiError","sendTestResult","debugUri","result","errorMessage","debugError","testLead","trim","requestBody","debug","makeFieldsMappingInitialValuesAndListNotMatchingFields","bridgeFormValues","allBridgeFields","alreadyMappedFields","autoMappedFields","autoMapping","allFieldsToMap","mappedDestinationFieldsNotAvailable","destinationFieldId","el","mappedSourceFieldsNotAvailable","flatMap","filledFieldsMappingValues","existingValue","o","autoMapped","extraDataForUi","testLeadValue","sort","b","localeCompare","indexA","findIndex","indexB","clearedFieldMapping","notFoundFields","useNotifyUserOfMissingMappedFields","fieldsMappingMatched","notFoundPreviouslyMappedFields","encodedFields","persistentKey","alreadyNotified","localStorage","getItem","isDismissable","listOfNotFoundIds","onClose","PopupContentNoSelectOptions","sortByFieldLabel","getSortedFields","filteredFields","makeFieldMappingValidationSchema","welcomeMessageSchema","mappedItemSchema","templateBasedFieldsMapping","notRequired","Header","Body","Paragraph","Label","Disclaimer","TableHeader","isHeaderStuck","ElementWrapper","BodyInner","WarningMessage","FooterWrapper","panelFooter","SubmitButton","appName","isStepName","onSubmitRequest","isFacebook","toLowerCase","isGoogle","CredentialFieldDomain","__","setTriggerSettingsUpdate","parts","hasChild","Date","getTime","CredentialFieldInput","handOnChange","handleFreshContentRequest","CredentialFieldSmartCreatableSelect","CredentialFieldSmartSelect","validateForm","selectValues","currentFieldValue","isSingleValue","singleDefaultValue","availableOptionKeys","fieldValidationStatus","refreshable","CredentialFieldToggle","emailRegex","ModalInnerWrapper","CredentialFieldVerifyEmail","handleAddRecipient","isLast","emailsUpdated","handleNewValue","handleEmailsRefetch","setNewValue","showModal","toggleShowModal","setCode","handleCloseModal","showAddButton","setShowAddButton","showRemoveButton","setShowRemoveAddButton","allVerified","setAllVerified","sendCode","sendCodeLoading","verifyCodeResponse","verifyCode","verifyCodeLoading","isError","verifyCodeError","handleKeyDown","created_at","updated_at","hasUnverifiedEmail","emailData","noOptionsMessageText","keyDown","isResizable","autoFocus","IntegrationNameInput","useRefetchCredentialSchema","setValues","appAuthSchemaResponse","retrieveAuthSchema","isLoadingAppAuthSchema","errorApiAppAuthSchema","authSchemaApiRequest","credentials","triggerFieldUpdates","triggerSettingsUpdate","newFieldsFromApi","newFormCredentialsValues","existingFieldFromFormValues","existingFieldFromApiValues","existingIntegrationCredentials","existingField","makeAuthCredentialValidationSchema","yupFieldArray","yupFieldSchema","IconsWrapper","IconRow","InfoSectionWrapper","InfoSectionTitle","InfoSection","integrationId","integrationName","setIsModalOpen","isLoadingVideoPlayer","setIsLoadingVideoPlayer","appData","videoId","video","hideCloseButton","controls","volume","muted","onReady","config","wistia","autoPlay","url","ModalWrapper","ModalHeader","ModalBody","ModalFooter","WaitingListInfoMessage","appsInWaitingList","appsCount","isInStep1","updateRequest","setUpdateRequest","customMessageKey","makeSupportUrl","isIframe","crmName","getAppCompatibilityPopupContent","apiResponse","combination","bothInWaitingListing","sourceWaitingList","destinationWaitingList","waitingListMessage","compatibility","customUrl","notCompatibleMessage","upgrade","bothNeedUpgrade","appTextToUpgrade","appsToUpgrade","sourceAppIdToSwitch","destinationAppIdToSwitch","switchApps","nbee","nbeeUri","obe","obeUri","minHeight","backdropFilter","minWidth","sourceAppId","sourceAppName","destinationAppId","destinationAppName","useHandleAppsCompatibility","popupCtx","appsAreCompatible","setAppsAreCompatible","step1MatchRoute","isExact","emailFeatureAvailable","setEmailFeatureAvailable","appCompatibilityCheck","isCheckingAppsCompatibility","isRefetching","isReCheckingAppsCompatibility","isNotCompatible","resetForm","availableBridgeFeatures","moduleId","available","parsedError","errorDescription","SettingFieldInput","refetchSettings","currentSettingsValues","initialValue","internalInputValue","setInternalInputValue","onBlurUpdateFormikState","newSettings","setting","parsedValue","parseInt","onKeyPress","SettingFieldSmartCreatableSelect","internalStateIsEmpty","wasEmptyIsStillEmpty","wasFilledStillHasSameValue","updateFieldOnBlur","SmartSelectAddOptionApiModal","onSuccessCreation","validationMessage","setValidationMessage","settingsValues","setSettingsValues","addOptionSettings","addOption","apiSettings","addOptionMutation","addOptionResponse","isAddingOption","intialSettingsValuesState","fromEntries","instanceId","apiScope","isFormValid","every","Modal","InputToggle","LabelWithDocTooltip","InputSmartSelect","singleValue","MultiCreatableCustom","excludeSelected","currentTarget","dangerouslySetInnerHTML","__html","SettingFieldSmartSelect","addOptionApiModalOpen","setAddOptionApiModalOpen","useTriggerSettingsUpdate","currentFieldValueCasted","handleFieldRefreshRequest","fieldHasOnlyOneOption","isRequiredFieldDisabled","isRequiredFieldClearable","renderKey","btoa","unescape","formID","redirectUri","newOptionId","TinyTextualButton","SettingFieldToggle","fieldLabel","touchAllSettings","allSourceSettings","allDestinationSettings","newTouched","usePopupError","showLogo","setError","selectedIntegrationId","setSelectedIntegrationId","errorCodes","span","showPopupError","clearPopupError","setIntegrationId","_meta","lastUpdate","validateAppSettings","allRetrivedSettingFields","forEach","fieldSettingValue","allArrayItemsAreValidEmail","isEmptyArray","s","validateNbeeForm","sourceSettingErrors","destinationSettingErrors","InfoStepWrapper","InfoPage","PerformanceBoosterBanner","existingPerformanceBoosterAvailable","existingPbId","vueAppBaseUr","mutateAsync","createPerformanceBooster","isCreatingPerformanceBooster","whiteSpace","performanceBooster","PerformanceBoosterTip","lineHeight","handlePerformanceBoosterRedirectUri","performanceBoosterAvailable","setPerformanceBoosterAvailable","setExistingPerformanceBoosterAvailable","isLoadingPerformanceBooster","u","isAvailable","errorGettingPerformanceBooster","Dropdown","items","highlightedIndex","setHighlightedIndex","handleMouseLeave","tabIndex","handleItemClick","isHighlighted","handleMouseEnter","calculateDropdownPosition","element","dropdownHeight","indexOfLastOpenBracket","rect","lineHeightStr","getComputedStyle","testDiv","visibility","innerHTML","offsetHeight","removeChild","calculateLineHeight","textUpToCursor","substring","lastNewLineIndex","lastIndexOf","textAfterLastNewLine","textLines","dropdownY","scrollHeight","clientHeight","ghostSpan","textContent","computedStyle","font","letterSpacing","paddingLeft","paddingRight","ghostRect","dropdownX","scrollLeft","x","Content","section","headerText","subText","firstName","lastName","validationSchemaAppsumo","couponCode","initialFormValuesAppsumo","handleSignupWithEmailSuccess","idToken","refreshToken","localStorageKey","defaultParams","cbPlan","trialDays","useHideParamsFromString","parsedUrl","cc","td","paramsFromQuery","getPersistentSignupParams","savedString","atob","parse","deletePersistendSignupParms","removeItem","createFbAppStoreStatus","listFbAppStoreStatuss","onUpdateFbAppStoreStatus","usePusherChannel","channelName","subscribeCondition","onUnsuscribe","onSubscriptionReceived","pusher","cluster","subscribe","bind","unbind","unsubscribe","resources","en","all","lng","defaultNS","interpolation","escapeValue","showLocaleKeys","showKeys"],"sourceRoot":""}