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AK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,KAAK,MAAM,IAAOmrB,EAAoB,SAC5V,IAAIyE,EAAsBzE,EAAoBQ,OAAE3rB,EAAW,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,KAAK,MAAM,IAAOmrB,EAAoB,SACtXyE,EAAsBzE,EAAoBQ,EAAEiE,I","sources":["webpack://leadsbridge/webpack/runtime/chunk loaded","webpack://leadsbridge/webpack/runtime/load script","webpack://leadsbridge/./src/@typings/Api/bridgeFieldsArrayTypes.ts","webpack://leadsbridge/./src/lang/LangFbAppStore.tsx","webpack://leadsbridge/./src/pages/AppStore/Close.tsx","webpack://leadsbridge/./src/services/FbAppStoreService.tsx","webpack://leadsbridge/./src/pages/AppStore/components/PlatformAuthentication.tsx","webpack://leadsbridge/./src/utils/appStore/FbAppStoreStepper.tsx","webpack://leadsbridge/./src/pages/AppStore/components/PlatformConfiguration.tsx","webpack://leadsbridge/./src/pages/AppStore/components/SpreadSheetSelection.tsx","webpack://leadsbridge/./src/pages/AppStore/components/SyncData.tsx","webpack://leadsbridge/./src/pages/AppStore/partials/FbTopBar.tsx","webpack://leadsbridge/./src/pages/AppStore/partials/FbStepGroup.tsx","webpack://leadsbridge/./src/pages/AppStore/FbAppStore.tsx","webpack://leadsbridge/./src/store/actions/FbAppStoreActions.tsx","webpack://leadsbridge/./src/pages/AppStore/FbAppStoreTest.tsx","webpack://leadsbridge/./src/pages/BridgeByUrlCallback/useGenericBbuAuth.ts","webpack://leadsbridge/./src/pages/Fbe.tsx","webpack://leadsbridge/./src/pages/FbeCallback.tsx","webpack://leadsbridge/./src/pages/IncomingData/IncomingDataScreen.tsx","webpack://leadsbridge/./src/pages/IncomingData/IncomingDataScreenFields.tsx","webpack://leadsbridge/./src/pages/IncomingData/IncomingDataScreenSave.tsx","webpack://leadsbridge/./src/pages/Integration/IntegrationAuthCallback.tsx","webpack://leadsbridge/./src/pages/Integration/IntegrationAuthCallback2.tsx","webpack://leadsbridge/./src/pages/Integration/IntegrationAuthScreen.tsx","webpack://leadsbridge/./src/pages/Integration/IntegrationAuthScreenEdit.tsx","webpack://leadsbridge/./src/pages/Integration/IntegrationAuthVerifiedEmailScreenLegacy.tsx","webpack://leadsbridge/./src/pages/Integration/IntegrationHome.tsx","webpack://leadsbridge/./src/pages/LegacyRedirect.tsx","webpack://leadsbridge/./src/pages/Logout/clearPersistentData.ts","webpack://leadsbridge/./src/pages/Nbee/BridgeChooser.tsx","webpack://leadsbridge/./src/pages/Nbee/NbeeHome.tsx","webpack://leadsbridge/./src/pages/Nbee/Step1.tsx","webpack://leadsbridge/./src/pages/Nbee/Step1Edit.tsx","webpack://leadsbridge/./src/pages/Nbee/Step2.tsx","webpack://leadsbridge/./src/pages/Nbee/Step3.tsx","webpack://leadsbridge/./src/pages/Page404.tsx","webpack://leadsbridge/./src/pages/SamlRedirect.tsx","webpack://leadsbridge/./src/pages/TestComponents.tsx","webpack://leadsbridge/./src/routes/byFeature/nbee.ts","webpack://leadsbridge/./src/routes/byFeature/integration.ts","webpack://leadsbridge/./src/routes/byFeature/billing.ts","webpack://leadsbridge/./src/routes/byFeature/facebook.ts","webpack://leadsbridge/./src/utils/seralizeQueryString.ts","webpack://leadsbridge/./src/routes/byFeature/auth.ts","webpack://leadsbridge/./src/routes/byFeature/googleAdsAccount.ts","webpack://leadsbridge/./src/routes/byFeature/admin.ts","webpack://leadsbridge/./src/routes/index.ts","webpack://leadsbridge/./src/routes/byFeature/bbu.ts","webpack://leadsbridge/./src/services/ApplicationV1Bridge.tsx","webpack://leadsbridge/./src/services/AuthService.tsx","webpack://leadsbridge/./src/services/CognitoApiService.tsx","webpack://leadsbridge/./src/services/FacebookService.tsx","webpack://leadsbridge/./src/services/apiAuthClient/index.ts","webpack://leadsbridge/./src/services/apiPublicClient/index.ts","webpack://leadsbridge/./src/services/axiosInterceptor.tsx","webpack://leadsbridge/./src/store/actions/ApplicationConfigurationActions.tsx","webpack://leadsbridge/./src/store/actions/IntegrationListenerActions.tsx","webpack://leadsbridge/./src/store/actions/UserActions.tsx","webpack://leadsbridge/./src/store/hooks.tsx","webpack://leadsbridge/./src/store/reducers/ApplicationConfigurationReducer.tsx","webpack://leadsbridge/./src/store/reducers/FbAppStoreReducer.tsx","webpack://leadsbridge/./src/store/reducers/IntegrationListenerReducer.tsx","webpack://leadsbridge/./src/store/reducers/UserReducer.tsx","webpack://leadsbridge/./src/store/types/ApplicationConfigurationTypes.tsx","webpack://leadsbridge/./src/store/types/FbAppStoreTypes.tsx","webpack://leadsbridge/./src/store/types/IntegrationListenerTypes.tsx","webpack://leadsbridge/./src/store/types/UserTypes.tsx","webpack://leadsbridge/./src/styles/modules/SemanticOverwrites.styled.tsx","webpack://leadsbridge/./src/styles/modules/Utilities.styled.tsx","webpack://leadsbridge/./src/styles/modules/Animations.styled.tsx","webpack://leadsbridge/./src/styles/modules/CommonCss.styled.tsx","webpack://leadsbridge/./src/styles/GlobalAppStyle.tsx","webpack://leadsbridge/./src/styles/iframeUtils.ts","webpack://leadsbridge/./src/styles/theme/default.ts","webpack://leadsbridge/./src/utils/PostMessages.tsx","webpack://leadsbridge/./src/utils/base64.ts","webpack://leadsbridge/./src/utils/cognitoErrors.ts","webpack://leadsbridge/./src/utils/cookieUtils.ts","webpack://leadsbridge/./src/utils/envUtils.ts","webpack://leadsbridge/./src/utils/helpers.ts","webpack://leadsbridge/./src/utils/isInFrame.ts","webpack://leadsbridge/./src/utils/randomIdGenerator.tsx","webpack://leadsbridge/./src/utils/sentry/ignoreList.ts","webpack://leadsbridge/./src/utils/validators/RegExp.tsx","webpack://leadsbridge/./src/utils/validators/phoneNumber.ts","webpack://leadsbridge/./src/utils/validators/yupCustomValidators.ts","webpack://leadsbridge/webpack/bootstrap","webpack://leadsbridge/webpack/runtime/compat get default export","webpack://leadsbridge/webpack/runtime/define property getters","webpack://leadsbridge/webpack/runtime/ensure chunk","webpack://leadsbridge/webpack/runtime/get javascript chunk filename","webpack://leadsbridge/webpack/runtime/global","webpack://leadsbridge/webpack/runtime/harmony module decorator","webpack://leadsbridge/webpack/runtime/hasOwnProperty shorthand","webpack://leadsbridge/webpack/runtime/make namespace object","webpack://leadsbridge/webpack/runtime/node module decorator","webpack://leadsbridge/webpack/runtime/publicPath","webpack://leadsbridge/webpack/runtime/jsonp chunk loading","webpack://leadsbridge/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"leadsbridge:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","import { ApiBridgeFieldDefinitionType } from 'BackendApi'\n\nexport const apiBridgeFieldTypes: ApiBridgeFieldDefinitionType[] = [\n 'text',\n 'dropdown',\n 'number',\n 'date',\n 'time',\n 'datetime',\n 'boolean',\n]\n","export const LangFbAppStore: any = {\n popupLocked:\n 'Your browser is blocking popups, please allow them to proceed: More info: https://support.mozilla.org/en-US/kb/pop-blocker-settings-exceptions-troubleshooting',\n\n 101: {\n title: 'Initial configuration required',\n description:\n 'The platform encountered an error retrieving information from Facebook.
To be able to continue the configuration, you need to create an initial setting (on the Business Manager page).',\n helpers: [\n {\n title: 'Manage access to external data in Facebook',\n description: 'Control how Facebook imports data from apps.',\n },\n {\n title: 'Manage data connections',\n description:\n 'Determine whether apps can import data to Facebook on a continuous basis.',\n },\n ],\n },\n\n messages: {\n tokenError:\n 'hey something happened and we are not able to properly connect to FB. Sometimes (only the 1st time) this happens and it’s normal, can you please Retry and enjoy?!',\n },\n}\n","import React, { useEffect } from 'react'\n\nconst Close: React.FC = () => {\n useEffect(() => {\n window.close()\n }, [])\n\n return
\n}\n\nexport default Close\n","import { AxiosInstance, AxiosResponse } from 'axios'\nimport * as React from 'react'\nimport { FacebookParameters } from 'LeadsBridgeApp'\nimport { axiosInterceptor } from './axiosInterceptor'\n\nexport default class FbAppStoreService {\n // 25-may forse versione definitiva???\n public static getSheetsUrl: string = '/fbAppStore/v2/getSpreedSheets'\n public static getSpreedSheetTabsUrl: string =\n '/fbAppStore/v2/getSpreedSheetTabs' // TODO getSpreedSheetTabs ? era sbagliata.\n\n // TODO DA CONTROLLARE\n public static getPlatformAuthUrl: string = '/fbAppStore/v2/getPlatformAuth'\n public static doPlatformAuthUrl: string = '/fbAppStore/v2/doPlatformAuth'\n public static generateExternalBusinessIdUrl: string =\n '/fbAppStore/v2/generateExternalBusinessId'\n\n public static saveSheetSelectionUrl: string =\n '/fbAppStore/v2/doSpreedSheetConfig'\n\n public static saveSegmentSelectionUrl: string =\n '/fbAppStore/v2/doSegmentConfig'\n\n public static getSegmentTypesUrl: string = '/fbAppStore/v2/getSegmentTypes'\n public static segmentUrls: string = '/fbAppStore/v2/getSegments'\n\n // platform configuraiton\n public static getPlatformCapabilitiesUrl: string =\n '/fbAppStore/v2/getPlatformCapabilities'\n\n public static doPublishBridgesUrl: string = '/fbAppStore/v2/doPublishBridges'\n public static getSyncDataLinksUrl: string = '/fbAppStore/v2/getSyncDataLinks'\n\n // 25-may forse versione definitiva???\n static getSheets = async (platformId: number): Promise => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .get(\n process.env.REACT_APP_V1_API +\n FbAppStoreService.getSheetsUrl +\n '?platformId=' +\n platformId\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n static getSpreadSheetTabs = async (\n platformId: number,\n selectedSheetId: string\n ): Promise => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .get(\n process.env.REACT_APP_V1_API +\n FbAppStoreService.getSpreedSheetTabsUrl +\n '?platformId=' +\n platformId +\n '&sheetId=' +\n selectedSheetId\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n // TODO DA RICONTROLLARE\n\n static getPlatformAuth = async (platformId: number): Promise => {\n // console.log('getPlatformAuth platformId', platformId);\n const url =\n process.env.REACT_APP_V1_API + FbAppStoreService.getPlatformAuthUrl\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .get(url + '?platformId=' + platformId)\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n static doPlatformAuth = async (\n fields: object,\n platformId: number\n ): Promise => {\n const url =\n process.env.REACT_APP_V1_API + FbAppStoreService.doPlatformAuthUrl\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .post(url + '?platformId=' + platformId, {\n fields,\n })\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n static generateExternalBusinessId = async (): Promise => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .get(\n process.env.REACT_APP_V1_API +\n FbAppStoreService.generateExternalBusinessIdUrl,\n {}\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n static segmentTypes = async (platformId: number): Promise => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .get(\n process.env.REACT_APP_V1_API +\n FbAppStoreService.getSegmentTypesUrl +\n '?platformId=' +\n platformId\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n static getSegments = async (\n platformId: number,\n selectedSheetId: string\n ): Promise => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .get(\n process.env.REACT_APP_V1_API +\n FbAppStoreService.segmentUrls +\n '?segmentType=' +\n selectedSheetId +\n '&platformId=' +\n platformId\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n static saveSegmentSelection = async (\n platformId: number,\n selectedSheetId: string,\n selectedTabId: string\n ): Promise => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .post(\n process.env.REACT_APP_V1_API +\n FbAppStoreService.saveSegmentSelectionUrl,\n {\n segmentType: selectedSheetId,\n segmentId: selectedTabId,\n platformId: platformId,\n }\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n static saveSheetSelection = async (\n platformId: number,\n selectedSheetId: string,\n selectedTabId: string\n ): Promise => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .post(\n process.env.REACT_APP_V1_API +\n FbAppStoreService.saveSheetSelectionUrl,\n {\n sheetId: selectedSheetId,\n tabId: selectedTabId,\n }\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n // platform configuration\n static getPlatformCapabilities = async (platformId: number): Promise => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .get(\n process.env.REACT_APP_V1_API +\n FbAppStoreService.getPlatformCapabilitiesUrl +\n '?platformId=' +\n platformId\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n static doPublishBridges = async (\n platformId: number,\n entities: string[],\n limitedDataUse: boolean,\n adsDeliveryOptimization: boolean\n ): Promise => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .post(\n process.env.REACT_APP_V1_API + FbAppStoreService.doPublishBridgesUrl,\n {\n platformId: platformId,\n entities: entities,\n limitedDataUse: limitedDataUse,\n adsDeliveryOptimization: adsDeliveryOptimization,\n }\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n static getSyncDataLinks = async (): Promise => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .get(\n process.env.REACT_APP_V1_API + FbAppStoreService.getSyncDataLinksUrl\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n}\n","import React, { useEffect, useState } from 'react'\nimport { useSelector } from 'react-redux'\nimport { RootState } from '../../../index'\nimport FbAppStoreService from '../../../services/FbAppStoreService'\nimport {\n Button,\n Dimmer,\n Form,\n Icon,\n Label,\n Loader,\n Message,\n Segment,\n} from 'semantic-ui-react'\nimport { LangFbAppStore } from '../../../lang/LangFbAppStore'\nimport { doPostMessage, Messages } from '../../../utils/PostMessages'\n\nconst PlatformAuthentication: React.FC<{ setOpen: any; setAPIresponse: any }> =\n ({ setOpen, setAPIresponse }) => {\n const platformId: number = useSelector(\n (state: RootState) => state.appStore.platformId\n )\n const [loading, setLoading] = useState(true)\n\n const [fields, setFields] = useState({})\n const [helpUrl, setHelpUrl] = useState('')\n const [labels, setLabels] = useState({})\n\n const [formError, setFormError] = useState('')\n\n useEffect(() => {\n let subscribed = true\n\n // helpUrl: \"https://leadsbridge.com/documentation/google-sheets\"\n // oauth2RedirectUrl: \"https://leadsbridge.com/fbAppStore/v1/doOauth2\"\n if (platformId > 0) {\n // setRedirectUrl(process.env.REACT_APP_V1_API + '/fbAppStore/v1/doOauth2');\n\n doPostMessage(Messages.PlatformInvoked)\n FbAppStoreService.getPlatformAuth(platformId)\n .then((res) => {\n if (subscribed && res.oauth2RedirectUrl) {\n // setRedirectUrl(res.oauth2RedirectUrl);\n } else {\n setHelpUrl(res.helpUrl)\n const newObj: any = {}\n Object.keys(res.authFields).map((key: string) => {\n newObj[key] = ''\n })\n setFields(newObj)\n setLabels(res.authFields)\n }\n })\n .catch((res) => {\n switch (res.response.data.errorCode) {\n case 101:\n setAPIresponse(res.response.data)\n setOpen(true)\n break\n default:\n return null\n }\n })\n .finally(() => {\n setLoading(false)\n })\n }\n\n return () => {\n subscribed = false\n }\n }, [platformId])\n\n const doOauth2 = () => {\n const url =\n process.env.REACT_APP_V1_API +\n '/fbAppStore/v2/doOauth2?platformId=' +\n platformId\n const width = 1120\n const left = window.screen.width / 2 - width / 2\n const newWin = window.open(\n url,\n 'ModalPopUp',\n `toolbar=no,\n scrollbars=no, location=no, statusbar=no, menubar=no,\n resizable=0, width=${width}, height=720, left=${left}, top=234`\n )\n if (!newWin || newWin.closed || typeof newWin.closed === 'undefined') {\n setFormError(LangFbAppStore.popupLocked)\n setTimeout(() => setFormError(''), 5000)\n doPostMessage(Messages.PlatformError)\n } else {\n doPostMessage(Messages.PlatformAuthorized)\n }\n }\n\n const doAuth = () => {\n let emptyField = false\n Object.values(fields).forEach((value: any) => {\n if (value === '') {\n emptyField = true\n }\n })\n if (emptyField) {\n setFormError('All fields are required')\n return\n }\n setLoading(true)\n FbAppStoreService.doPlatformAuth(fields, platformId)\n .then((r) => {\n doPostMessage(Messages.PlatformAuthorized)\n })\n .catch((err) => {\n doPostMessage(Messages.PlatformError)\n setFormError(err.response?.data?.errorMessage ?? 'Error')\n })\n .finally(() => {\n setLoading(false)\n })\n }\n\n return (\n \n \n Loading\n \n\n {!loading && platformId !== 0 && (\n \n
\n \n
\n
\n\n {!fields || Object.keys(fields).length === 0 ? (\n
\n \n Authorize\n \n
\n ) : (\n <>\n {Object.keys(fields).map((key: string, index: number) => {\n return (\n {\n const oldFields = { ...fields }\n oldFields[key] = e.target.value\n setFields(oldFields)\n }}\n />\n )\n })}\n

\n * Fields mandatory\n

\n\n \n \n \n
\n \n Authorize\n \n
\n \n )}\n\n {formError !== '' && (\n \n )}\n \n )}\n
\n )\n }\n\nexport default PlatformAuthentication\n","import { AppStoreStatus } from '../../enums/AppStoreStatus'\n\nexport const FbAppStoreStepper = {\n googleSheet: [\n {\n index: 0,\n values: [AppStoreStatus.PLATFORMAUTHENTICATION, AppStoreStatus.NONE],\n name: 'Connect',\n },\n {\n index: 1,\n values: [AppStoreStatus.SPREADSHEETSELECTION],\n name: 'Select document',\n },\n {\n index: 2,\n values: [AppStoreStatus.PLATFORMCONFIGURATION],\n name: 'Review & confirm',\n },\n {\n index: 3,\n values: [AppStoreStatus.PUBLISH],\n name: 'Sync data',\n },\n ],\n newType: [\n {\n index: 0,\n values: [AppStoreStatus.PLATFORMAUTHENTICATION, AppStoreStatus.NONE],\n name: 'Connect',\n },\n {\n index: 1,\n values: [AppStoreStatus.STATUS_SEGMENTATION_SELECTION],\n name: 'Select document',\n },\n {\n index: 2,\n values: [AppStoreStatus.PLATFORMCONFIGURATION],\n name: 'Review & confirm',\n },\n {\n index: 3,\n values: [AppStoreStatus.PUBLISH],\n name: 'Sync data',\n },\n ],\n default: [\n {\n index: 0,\n values: [AppStoreStatus.PLATFORMAUTHENTICATION, AppStoreStatus.NONE],\n name: 'Connect',\n },\n {\n index: 1,\n values: [AppStoreStatus.PLATFORMCONFIGURATION],\n name: 'Review & confirm',\n },\n {\n index: 2,\n values: [AppStoreStatus.PUBLISH],\n name: 'Sync data',\n },\n ],\n}\n","import React, { Dispatch, forwardRef, useEffect, useState } from 'react'\nimport {\n Button,\n Checkbox,\n Dimmer,\n Form,\n Header,\n Label,\n List,\n Loader,\n Message,\n Radio,\n Segment,\n} from 'semantic-ui-react'\nimport { FbAppStoreStep } from 'LeadsBridgeApp'\nimport { FbAppStoreStepper } from '../../../utils/appStore/FbAppStoreStepper'\nimport FbAppStoreService from '../../../services/FbAppStoreService'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { RootState } from '../../../index'\nimport { sendToast } from '../../../store/actions/ApplicationConfigurationActions'\nimport { doPostMessage, Messages } from '../../../utils/PostMessages'\n\nconst PlatformConfiguration = forwardRef(\n (props: { steps: FbAppStoreStep[] }, ref) => {\n const dispatch: Dispatch = useDispatch()\n const platformId: number = useSelector(\n (state: RootState) => state.appStore.platformId\n )\n const [type, setType] = useState('default')\n const [platformName, setPlatformName] = useState('')\n const [entities, setEntities] = useState([])\n const [checkedEntity, setCheckedEntity] = useState('')\n const [checkedEntities, setCheckedEntities] = useState([])\n\n const [privacy1, setPrivacy1] = useState(false)\n const [privacy2, setPrivacy2] = useState(false)\n const [saving, setSaving] = useState(false)\n const [loadingEntities, setLoadingEntities] = useState(true)\n\n useEffect(() => {\n if (FbAppStoreStepper.googleSheet === props.steps) {\n setType('google')\n }\n // do post getPlatformCapabilities passandogli come parametro platformId\n }, [])\n\n useEffect(() => {\n if (platformId > 0) {\n FbAppStoreService.getPlatformCapabilities(platformId)\n .then((res) => {\n setPlatformName(res.PlatformName || 'source')\n setEntities(res.Entities)\n })\n .finally(() => setLoadingEntities(false))\n }\n }, [platformId])\n\n const entityCheck = (value: any) => {\n setCheckedEntity(value)\n }\n\n const saveConfiguration = () => {\n const parsedEntities: string[] = (\n type === 'google' ? [checkedEntity] : checkedEntities\n ).filter(function (el) {\n return el != null && el !== ''\n })\n if (parsedEntities.length === 0) {\n dispatch(\n sendToast({\n title: 'Warning',\n messages: ['Fields are required'],\n color: 'warning',\n })\n )\n return\n }\n\n setSaving(true)\n doPostMessage(Messages.PlatformCompleted)\n FbAppStoreService.doPublishBridges(\n platformId,\n parsedEntities,\n privacy1,\n privacy2\n )\n .then((res) => {})\n .catch((e) => {\n const error =\n e.response?.data?.errorMessage ??\n 'An internal error occurred, please try again later.'\n dispatch(\n sendToast({\n title: 'An error occurred',\n messages: [error],\n color: 'negative',\n })\n )\n })\n .finally(() => {\n setSaving(false)\n })\n }\n\n return (\n
\n
Review configuration
\n\n \n Loading\n \n\n

\n {type === 'google' ? 'Choose ' : 'Select '} the objects to sync and\n check below some examples of the data that will be synced.\n
\n Continuing to the next step you authorize LeadsBridge sends these data\n to Facebook.\n

\n \n {Object.keys(entities).map((key: any, index: number) => {\n return (\n {\n if (type === 'google') {\n entityCheck(key)\n } else {\n const newCheckedEntities = [...checkedEntities]\n const keyIndex = newCheckedEntities.indexOf(key)\n if (keyIndex >= 0) {\n newCheckedEntities.splice(keyIndex, 1)\n } else {\n newCheckedEntities.push(key)\n }\n setCheckedEntities(newCheckedEntities)\n }\n }}\n key={'entity-' + index}\n >\n {type === 'google' ? (\n \n ) : (\n = 0} />\n )}\n \n \n {entities[key].Label}\n \n \n {Object.keys(entities[key].SourceMappedFields).map(\n (k: any) => {\n return (\n \n )\n }\n )}\n \n \n \n )\n })}\n \n\n \n Changes in Service\n

\n Decide what Facebook can do automatically with data from{' '}\n {platformName}\n

\n
\n \n setPrivacy1(!privacy1)}\n checked={privacy1}\n />\n \n Allow Facebook to make subtle adjustements to your campaing to\n maximize performance.\n

\n
\n \n setPrivacy2(!privacy2)}\n checked={privacy2}\n />\n \n {' '}\n Communicate when customer in California have opted out of the\n sale of data as defined by the CCPA.\n

\n
\n
\n
\n\n
\n saveConfiguration()}\n >\n Start sync\n \n
\n
\n )\n }\n)\n\nexport default PlatformConfiguration\n","import React, {\n createRef,\n Dispatch,\n forwardRef,\n useEffect,\n useState,\n} from 'react'\nimport {\n Button,\n Form,\n Header,\n Icon,\n Message,\n Search,\n SearchProps,\n SearchResultData,\n Segment,\n} from 'semantic-ui-react'\nimport { filter, debounce, escapeRegExp } from 'lodash-es'\nimport { FbAppStoreStepper } from '../../../utils/appStore/FbAppStoreStepper'\nimport { FbAppStoreStep } from 'LeadsBridgeApp'\nimport FbAppStoreService from '../../../services/FbAppStoreService'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { RootState } from '../../../index'\nimport ReactDOM from 'react-dom'\nimport { sendToast } from '../../../store/actions/ApplicationConfigurationActions'\nimport styled from 'styled-components'\n\nconst SearchStyled = styled.div`\n display: flex;\n width: 100%;\n .search {\n width: 100%;\n }\n &#document-search .results {\n // use searchResultHeight\n max-height: 210px;\n overflow-y: auto;\n }\n &#worksheet-search .results {\n max-height: 150px;\n overflow-y: auto;\n }\n`\n\nconst SpreadSheetSelection = forwardRef(\n (props: { steps: FbAppStoreStep[] }, ref) => {\n const dispatch: Dispatch = useDispatch()\n\n const platformId: number = useSelector(\n (state: RootState) => state.appStore.platformId\n )\n const [formError, setFormError] = useState('')\n\n const [sheetTemplateUrl, setSheetTemplateUrl] = useState('')\n const [documentationTemplateUrl, setDocumentationTemplateUrl] =\n useState('')\n\n const [isFilteringSheets, setIsFilteringSheets] = useState(true)\n const [sheet, setSheet] = useState('')\n const [sheetId, setSheetId] = useState('')\n\n const [results, setResults] = useState([])\n\n const [isFilteringWorksheets, setIsFilteringWorksheets] =\n useState(false)\n const [worksheet, setWorksheet] = useState('')\n\n const searchRef = createRef()\n const [worksheetId, setWorksheetId] = useState('')\n const [workResults, setWorkResults] = useState([])\n\n const search2Ref = createRef()\n const [sheets, setSheets] = useState<{ title: string; value: string }[]>([])\n const [worksheets, setWorksheets] = useState<\n { title: string; value: string }[]\n >([])\n\n const [refreshingList, setRefreshingList] = useState(false)\n const [type, setType] = useState('')\n\n const [nextStep, setNextStep] = useState(false)\n\n const handleSearchChange = (\n e: React.MouseEvent,\n data: SearchProps\n ) => {\n setIsFilteringSheets(true)\n const dataValue = data.value!.toString()\n setSheet(dataValue)\n setTimeout(() => {\n const re = new RegExp(escapeRegExp(data.value), 'i')\n const isMatch = (result: { title: string; value: string }) =>\n re.test(result.title)\n setIsFilteringSheets(false)\n setResults(filter(sheets, isMatch))\n }, 300)\n }\n const handleResultSelect = (e: any, value: SearchResultData) => {\n const result: { title: string; value: string } = value.result\n setWorksheet('')\n setSheet(result.title)\n setSheetId(result.value)\n }\n\n const handleSearchChangeWork = (\n e: React.MouseEvent,\n data: SearchProps\n ) => {\n setIsFilteringWorksheets(true)\n const dataValue = data.value!.toString()\n setWorksheet(dataValue)\n setTimeout(() => {\n const re = new RegExp(escapeRegExp(data.value), 'i')\n const isMatch = (result: { title: string; value: string }) =>\n re.test(result.title)\n setIsFilteringWorksheets(false)\n const filteredResults = filter(worksheets, isMatch)\n setWorkResults(filteredResults)\n }, 300)\n }\n const handleResultSelectWork = (e: any, value: SearchResultData) => {\n const result: { title: string; value: string } = value.result\n setWorksheet(result.title)\n setWorksheetId(result.value)\n }\n\n const refreshTheList = () => {\n setRefreshingList(true)\n // backend api\n setTimeout(() => setRefreshingList(false), 1000)\n }\n\n useEffect(() => {\n if (sheetId !== '' && type !== '') {\n clickListener()\n setIsFilteringWorksheets(true)\n if (type === 'google') {\n FbAppStoreService.getSpreadSheetTabs(platformId, sheetId)\n .then((res) => {\n //\n setWorksheets(res.Tabs)\n })\n .catch((e) => {\n const error =\n e.response?.data?.errorMessage ??\n 'An internal error occurred, please try again later.'\n dispatch(\n sendToast({\n title: 'An error occurred',\n messages: [error],\n color: 'negative',\n })\n )\n })\n .finally(() => {\n setIsFilteringWorksheets(false)\n })\n } else {\n FbAppStoreService.getSegments(platformId, sheetId)\n .then((res) => {\n setWorksheets(res.segments)\n })\n .catch((e) => {\n const error =\n e.response?.data?.errorMessage ??\n 'An internal error occurred, please try again later.'\n dispatch(\n sendToast({\n title: 'An error occurred',\n messages: [error],\n color: 'negative',\n })\n )\n })\n .finally(() => {\n setIsFilteringWorksheets(false)\n })\n }\n }\n }, [sheetId, type])\n\n useEffect(() => {\n if (worksheetId !== '') {\n clickListener()\n }\n }, [worksheetId])\n\n const next = () => {\n if (worksheetId === '' || sheet === '') {\n setFormError('All fields are required')\n return\n }\n setNextStep(true)\n if (type === 'google') {\n FbAppStoreService.saveSheetSelection(platformId, sheetId, worksheetId)\n .then(() => {})\n .catch((e) => {\n const error =\n e.response?.data?.errorMessage ??\n 'An internal error occurred, please try again later.'\n dispatch(\n sendToast({\n title: 'An error occurred',\n messages: [],\n color: 'negative',\n })\n )\n })\n .finally(() => {\n setNextStep(false)\n })\n } else {\n FbAppStoreService.saveSegmentSelection(platformId, sheetId, worksheetId)\n .then(() => {})\n .catch((e) => {\n const error =\n e.response?.data?.errorMessage ??\n 'An internal error occurred, please try again later.'\n dispatch(\n sendToast({\n title: 'An error occurred',\n messages: [],\n color: 'negative',\n })\n )\n })\n .finally(() => {\n setNextStep(false)\n })\n }\n }\n\n let onClickEVent: any = null\n\n const clickListener = () => {\n const res = document.getElementsByClassName('results')\n for (let k = 0; k < res.length; k++) {\n // @ts-ignore\n res[k].style.display = 'none'\n }\n document.removeEventListener('click', clickListener)\n onClickEVent = null\n }\n\n const eventClick = (e: any) => {\n clickListener()\n setFormError('')\n if (sheet === '' && !isFilteringSheets) {\n const element = ReactDOM.findDOMNode(searchRef.current) as Element\n const res = element?.getElementsByClassName('results')\n for (let k = 0; k < res.length; k++) {\n // @ts-ignore\n res[k].style.display = 'block'\n }\n setResults(sheets)\n if (!onClickEVent) {\n onClickEVent = document.addEventListener('click', clickListener)\n }\n }\n }\n const eventClickSearch2 = (e: any) => {\n clickListener()\n setFormError('')\n if (worksheet === '' && !isFilteringWorksheets) {\n const element = ReactDOM.findDOMNode(search2Ref.current) as Element\n const res = element?.getElementsByClassName('results')\n for (let k = 0; k < res.length; k++) {\n // @ts-ignore\n res[k].style.display = 'block'\n }\n setWorkResults(worksheets)\n\n if (!onClickEVent) {\n onClickEVent = document.addEventListener('click', clickListener)\n }\n }\n }\n\n useEffect(() => {\n if (platformId > 0 && type !== '') {\n if (type === 'google') {\n FbAppStoreService.getSheets(platformId)\n .then((res: any) => {\n setSheetTemplateUrl(res.sheetTemplateUrl)\n setDocumentationTemplateUrl(res.documentationTemplateUrl)\n const shits = []\n for (let k = 0; k < res.sheets.length; k++) {\n const c = { ...res.sheets[k] }\n c.key = c.sheetId\n shits.push(c)\n }\n setSheets(shits)\n })\n .finally(() => {\n setIsFilteringSheets(false)\n })\n } else {\n FbAppStoreService.segmentTypes(platformId)\n .then((res: any) => {\n setSheets(res.segmentTypes)\n })\n .finally(() => {\n setIsFilteringSheets(false)\n })\n }\n }\n }, [platformId, type])\n\n useEffect(() => {\n if (FbAppStoreStepper.newType === props.steps) {\n setType('newType')\n } else {\n setType('google')\n }\n }, [])\n\n return (\n <>\n {type === 'google' && (\n \n
STEP 1
\n

\n In order to enable our mapping configuration, please use our\n google sheet template and place it in your Google Drive.\n

\n

Download our template and follow the instructions.

\n
\n {\n window.open(sheetTemplateUrl, '_blank')\n }}\n >\n Download the template\n \n {\n window.open(documentationTemplateUrl, '_blank')\n }}\n >\n How to configure the document\n \n
\n
\n )}\n \n
STEP {type === 'google' ? 2 : 1}
\n

\n Select the {type === 'google' ? 'document' : 'segment'} where you\n have the data to sync.\n

\n\n \n {\n eventClick(e)\n }}\n results={results}\n placeholder={\n type === 'google' ? 'Select Sheet' : 'Select Segment Type'\n }\n value={sheet}\n ref={searchRef}\n />\n \n \n\n \n {\n eventClickSearch2(e)\n }}\n onSearchChange={debounce(handleSearchChangeWork, 500, {\n leading: true,\n })}\n results={workResults}\n value={worksheet}\n ref={search2Ref}\n />\n \n
\n\n \n
STEP {type === 'google' ? 3 : 2}
\n
\n {formError}\n \n

\n All done. Click on the 'Next' button to start mapping.\n

\n\n next()}\n >\n Next\n \n \n \n
\n \n )\n }\n)\n\nSpreadSheetSelection.displayName = 'SpreadSheetSelection'\n\nexport default SpreadSheetSelection\n","import React, { Dispatch, useEffect, useState } from 'react'\nimport {\n Button,\n Card,\n Dimmer,\n Header,\n Icon,\n Loader,\n Segment,\n} from 'semantic-ui-react'\nimport FbAppStoreService from '../../../services/FbAppStoreService'\nimport { sendToast } from '../../../store/actions/ApplicationConfigurationActions'\nimport { useDispatch } from 'react-redux'\nimport Confetti from '../../../components/Confetti'\nimport styled from 'styled-components'\n\nconst IconSync = styled(Icon)`\n font-size: 15px;\n position: absolute;\n bottom: 0;\n right: -8px;\n background: white;\n border-radius: 100%;\n //border: 2px solid #1877F2;\n padding: 3px;\n`\nconst IconStepStyled = styled.div`\n box-shadow: 0 1px 1px 0 rgb(66 66 66 / 8%), 0 1px 3px 1px rgb(66 66 66 / 16%);\n position: relative;\n display: flex;\n margin: 5px auto 1em auto;\n padding: 10px;\n border-radius: 10px;\n i {\n margin-bottom: 0 !important;\n }\n .sync {\n font-size: 25px !important;\n bottom: 5px;\n right: 5px;\n color: #1877f2;\n padding: 5px;\n }\n`\nconst CardGroupStyled = styled(Segment)`\n max-width: 640px;\n margin: 2em auto !important;\n background-color: #f3f4f5 !important;\n`\nconst SyncData: React.FC = () => {\n const dispatch: Dispatch = useDispatch()\n const [contactsLink, setContactsLink] = useState('')\n const [eventsLink, setEventsLink] = useState('')\n const [link, setLink] = useState('')\n const [isLoading, setIsLoading] = useState(true)\n\n useEffect(() => {\n FbAppStoreService.getSyncDataLinks()\n .then((res) => {\n setContactsLink(res.contactsLink)\n setEventsLink(res.eventsLink)\n setLink(res.leadsbridgeLink)\n })\n .catch((e) => {\n const error = e.response?.data?.errorMessage\n ? 'An internal error occurred, please try again later.'\n : 'Unknown Error'\n dispatch(\n sendToast({\n title: 'An error occurred',\n messages: [error],\n color: 'negative',\n })\n )\n })\n .finally(() => {\n setIsLoading(false)\n })\n }, [])\n\n return (\n
\n {isLoading ? <> : }\n
\n \n \n \n \n We started syncing your data - You can proceed with the navigation.\n \n We will send you an email once the sync is completed.\n \n
\n \n Loading\n \n\n

\n Please note that the process will take some time, based on the amount of\n your data.\n

\n \n
\n You can now return to Facebook - explore your data, as soon as the\n sync is done.\n
\n \n
\n
\n )\n}\n\nexport default SyncData\n","import { Dispatch } from '@reduxjs/toolkit'\nimport React from 'react'\nimport { useDispatch } from 'react-redux'\nimport { toggleVerticalSidebar } from '../../../store/actions/ApplicationConfigurationActions'\nimport { Menu } from 'semantic-ui-react'\nimport styled from 'styled-components'\n\nconst MenuStyled = styled(Menu)`\n justify-content: space-between;\n .steps {\n flex: 1;\n margin-top: 0;\n border: 0;\n .step {\n padding: 5px;\n }\n }\n .item {\n padding: 10px;\n flex: 1 !important;\n }\n`\n\nconst FbTopBar: React.FC = ({ children }) => {\n const dispatch: Dispatch = useDispatch()\n\n return (\n \n dispatch(toggleVerticalSidebar())}>\n \n \n\n {children}\n\n {/*\n \n {\n window.location.href = window.location.origin + \"/logout\";\n //history.push(\"/logout\");\n }}\n name='logout'\n />\n \n */}\n \n )\n}\n\nexport default FbTopBar\n","import { FbAppStoreStep } from 'LeadsBridgeApp'\nimport { Image, Step } from 'semantic-ui-react'\nimport React from 'react'\nimport { useSelector } from 'react-redux'\nimport { RootState } from '../../../index'\n\ninterface FbStepGroupProsp {\n isLoading: boolean\n status: any\n steps: any\n}\nconst FbStepGroup: React.FC = ({\n isLoading,\n steps,\n status,\n}) => {\n const platformId: number = useSelector(\n (state: RootState) => state.appStore.platformId\n )\n return (\n <>\n {!isLoading && (\n \n {steps.length > 0 &&\n steps.map((step: FbAppStoreStep) => {\n const included = step.values.includes(status)\n const exists = steps.find((s: FbAppStoreStep) =>\n step.values.includes(status)\n )\n return (\n \n \n \n {step.index === 0 ? (\n \n ) : (\n <>\n )}\n {step.index === steps.length - 1 ? (\n \n ) : (\n <>\n )}\n {step.name}\n \n \n \n )\n })}\n \n )}\n \n )\n}\n\nexport default FbStepGroup\n","import React, { Dispatch, useEffect, useState } from 'react'\nimport * as QueryString from 'querystring'\nimport { AppStoreStatus } from '../../enums/AppStoreStatus'\nimport PlatformAuthentication from './components/PlatformAuthentication'\nimport PlatformConfiguration from './components/PlatformConfiguration'\nimport SpreadSheetSelection from './components/SpreadSheetSelection'\nimport { useDispatch, useSelector } from 'react-redux'\nimport { RootState } from '../../index'\nimport {\n setPlatformIdAction,\n setStatusAction,\n} from '../../store/actions/FbAppStoreActions'\nimport { doPostMessage, Messages } from '../../utils/PostMessages'\nimport {\n Button,\n Container,\n Dimmer,\n Icon,\n List,\n Loader,\n Message,\n Modal,\n} from 'semantic-ui-react'\nimport { FbAppStoreStepper } from '../../utils/appStore/FbAppStoreStepper'\nimport {\n FbAppStoreStep,\n GraphQLResult,\n FacebookParameters,\n} from 'LeadsBridgeApp'\nimport { onUpdateFbAppStoreStatus } from '../../graphql/subscriptions'\nimport { API, Auth, graphqlOperation } from 'aws-amplify'\nimport { listFbAppStoreStatuss } from '../../graphql/queries'\n\nimport { Observable } from 'zen-observable-ts'\nimport SyncData from './components/SyncData'\nimport LoginV1Service from '../../services/ApplicationV1Bridge'\n\nimport { createFbAppStoreStatus } from '../../graphql/mutations'\nimport { ParsedUrlQuery } from 'querystring'\nimport { LangFbAppStore } from '../../lang/LangFbAppStore'\nimport FbTopBar from './partials/FbTopBar'\nimport FbStepGroup from './partials/FbStepGroup'\n\nconst FbAppStore: React.FC = () => {\n const dispatch: Dispatch = useDispatch()\n const [isLoading, setIsLoading] = useState(true)\n const [open, setOpen] = useState(false)\n const [APIresponse, setAPIresponse] = useState({})\n\n const platformId: number = useSelector(\n (state: RootState) => state.appStore.platformId\n )\n\n const setPlatformId = React.useCallback(\n (platformId: number) => dispatch(setPlatformIdAction(platformId)),\n [dispatch]\n )\n // test\n const status: AppStoreStatus = useSelector(\n (state: RootState) => state.appStore.status\n )\n const setStatus = React.useCallback(\n (status: AppStoreStatus) => dispatch(setStatusAction(status)),\n [dispatch]\n )\n const [steps, setSteps] = useState([])\n\n const doFacebookRedirect = (redirectUrl: string) => {\n LoginV1Service.facebookParameters(\n 'APP_STORE',\n '',\n window.location.href\n ).then((res: FacebookParameters) => {\n const urlObject = new URL(redirectUrl)\n let qs: string = urlObject.search.slice(1)\n const qsObject: ParsedUrlQuery = QueryString.parse(qs)\n qsObject.extras = JSON.stringify(res.extras)\n qs = QueryString.encode(qsObject)\n const url: string =\n urlObject.href.replace(urlObject.search, '') + '?' + qs\n window.location.replace(url)\n })\n }\n\n useEffect(() => {\n // alert(platformId);\n\n // import { hotjar } from \"react-hotjar\";\n // TODO hotjar.initialize(2000196, 5);\n\n let subscribed: boolean = true\n const params = QueryString.parse(window.location.search.replace('?', ''))\n const redirectUrl: string = params.redirect_uri as string\n if (redirectUrl) {\n doPostMessage(Messages.AppInvoked)\n doPostMessage(Messages.UserLogged)\n doFacebookRedirect(redirectUrl)\n } else {\n setIsLoading(false)\n }\n if (params.crm_id && parseInt(params.crm_id as string) > 0) {\n setPlatformId(parseInt(params.crm_id as string))\n }\n if (params.crm_id && parseInt(params.crm_id as string) === 63) {\n setSteps(FbAppStoreStepper.googleSheet)\n } else if (params.crm_id && parseInt(params.crm_id as string) === 85) {\n setSteps(FbAppStoreStepper.newType)\n } else {\n setSteps(FbAppStoreStepper.default)\n }\n\n // TODO\n // me lo passava un response.data.alreadyPublished di backend\n // 'You already connected this platform with Facebook through LeadsBridge. Click Continue to proceed with an additional integration or Exit to restart with Facebook.',\n\n // modale popup {action: 'redirect', url: 'https://business.facebook.com/business/app-store', text: 'Exit'} oppure continua\n\n return () => {\n subscribed = false\n }\n }, [])\n\n const retrieveStatusAndSubscribe = async (\n username: string\n ): Promise => {\n const subClient = (await API.graphql(\n graphqlOperation(onUpdateFbAppStoreStatus, {\n owner: username,\n })\n )) as Observable\n\n return subClient.subscribe({\n next: (data: any) => {\n if (\n data.value &&\n data.value.data &&\n data.value.data.onUpdateFbAppStoreStatus\n ) {\n const item = data.value.data.onUpdateFbAppStoreStatus\n setStatus(item.status)\n }\n },\n error: (error: any) => console.warn('subscription c1 error: ', error),\n })\n }\n\n // [{userId: user.username}]\n useEffect(() => {\n let subscription: ZenObservable.Subscription | undefined\n\n if (platformId > 0) {\n Auth.currentAuthenticatedUser()\n .then(async (user) => {\n const {\n data: {\n listFbAppStoreStatuss: { items, nextToken },\n },\n } = (await API.graphql(\n graphqlOperation(listFbAppStoreStatuss, {\n owner: user.username,\n filter: {\n crmId: { eq: platformId.toString() },\n },\n })\n )) as GraphQLResult\n\n if (items.length === 0) {\n await API.graphql(\n graphqlOperation(createFbAppStoreStatus, {\n input: {\n owner: user.username,\n crmId: platformId.toString(),\n status: AppStoreStatus.PLATFORMAUTHENTICATION,\n },\n })\n )\n } else {\n // I just take the first. (A duplicate should not exists...)\n let oldStatus = items[0].status\n if (oldStatus === AppStoreStatus.PUBLISH) {\n oldStatus = AppStoreStatus.PLATFORMAUTHENTICATION\n }\n setStatus(oldStatus)\n }\n\n subscription = await retrieveStatusAndSubscribe(user.username) //\n })\n .catch((err) => {\n console.warn('Subscription error', err)\n })\n }\n\n return () => {\n if (subscription !== undefined) {\n subscription.unsubscribe()\n }\n }\n }, [platformId])\n\n // NELLO SWITCH if (message == 'Complete-Oauth2') { inviare post message doPostMessage(Messages.PlatformAuthorized);\n // oppure doPostMessage(Messages.PlatformError); in caso di errore\n\n const getPageComponent = () => {\n switch (status) {\n case AppStoreStatus.PLATFORMCONFIGURATION:\n return \n case AppStoreStatus.SPREADSHEETSELECTION:\n return \n case AppStoreStatus.STATUS_SEGMENTATION_SELECTION:\n return \n case AppStoreStatus.PUBLISH:\n return \n case AppStoreStatus.NONE:\n case AppStoreStatus.PLATFORMAUTHENTICATION:\n return (\n \n )\n default:\n return (\n <>\n
\n \n Loading\n \n
\n \n )\n }\n }\n\n const errorObject: any = LangFbAppStore[APIresponse.errorCode]\n ? LangFbAppStore[APIresponse.errorCode]\n : { title: '', description: '', helpers: [] }\n\n return (\n <>\n \n \n \n \n
\n \n {errorObject.title}\n \n \n \n
\n \n \n \n You can update your settings to:\n \n \n {errorObject.helpers.map((item: any) => {\n return (\n \n \n {item.title}\n \n {item.description}\n \n \n \n )\n })}\n \n \n
\n
\n \n \n Go to Configuration Page\n \n \n
\n {getPageComponent()}\n
\n
\n \n )\n}\n\nexport default FbAppStore\n","import {\n FbAppStoreTypes,\n SET_PLATFORM_ID,\n SET_STATUS,\n} from '../types/FbAppStoreTypes'\nimport { AppStoreStatus } from '../../enums/AppStoreStatus'\n\nexport const setStatusAction = (status: AppStoreStatus): FbAppStoreTypes => {\n return {\n type: SET_STATUS,\n payload: status,\n }\n}\n\nexport const setPlatformIdAction = (platformId: number): FbAppStoreTypes => {\n return {\n type: SET_PLATFORM_ID,\n payload: platformId,\n }\n}\n","import React from 'react'\n\n// 63\n// 491\nconst FbAppStoreTest: React.FC = () => {\n return (\n
\n \n
\n )\n}\n\nexport default FbAppStoreTest\n","import axios from 'axios'\nimport { Auth } from 'aws-amplify'\nimport { CognitoErrorResponse, PersistentBbuData } from 'LeadsBridgeApp'\nimport { getCustomErrorCognitoMessage } from '@app/utils/cognitoErrors'\nimport { useEffect, useRef, useState } from 'react'\nimport { AuthState, CognitoUserInterface } from '@aws-amplify/ui-components'\nimport { useAppDispatch, useAppSelector } from '@app/store/hooks'\nimport { endpoints, getApiErrorMessage } from '@app/api/config'\nimport { PersistentLocalStorageKeys } from '@app/enums/persistentLocalStorageKeys'\nimport { parseAuthUser } from '@app/features/auth/functions/parseAuthUser'\nimport {\n setAuthStateAction,\n setCurrentUserAction,\n} from '@app/store/actions/UserActions'\nimport { trackEvent } from '@app/dataTracking'\nimport { BbuPartnersName } from '@app/enums/bridgeByUrl'\n\ninterface HandleOauthUserResponse {\n username: string\n password: string\n userStatus: string\n Pricing?: {\n cbPlanId: string\n mrr: number\n }\n}\n\ninterface UseGenericBbuAuthParms {\n provider?: string\n authCode?: string\n requestUri?: string\n bbuData?: PersistentBbuData | null\n}\n\nexport const useGenericBbuAuth = ({\n provider,\n authCode,\n requestUri,\n bbuData,\n}: UseGenericBbuAuthParms) => {\n const dispatch = useAppDispatch()\n const [apiError, setApiError] = useState('')\n const isMountedRef = useRef(false)\n const [userStatus, setUserStatus] = useState('')\n\n const { authState } = useAppSelector((state) => state.user)\n\n // we want to\n const isNotSignedIn = authState === AuthState.SignIn\n const canProceed = authCode && provider && requestUri\n const canProceedWithNotLoggedInFlow = canProceed && isNotSignedIn\n\n useEffect(() => {\n isMountedRef.current = true\n // in case user is already logged our component will be unmounted and re-mounted\n // so let's handle this scenario in useEffect cleanup\n const authCancelRequest = axios.CancelToken.source()\n if (canProceedWithNotLoggedInFlow) {\n console.log('STARTING NOT LOGGED IN FLOW')\n axios\n .post(\n endpoints.handleOauthNotLoggedUser,\n {\n provider,\n authCode,\n requestUri,\n },\n {\n cancelToken: authCancelRequest.token,\n }\n )\n .then((response) => {\n const { username, password, userStatus, Pricing } = response.data\n\n // we need to keep it persistent, because after login, component will be refreshed\n // and we need this information to handle the show or not of the survey\n // to consider if would be good to keep this info in cognito user attributes\n localStorage.setItem(\n PersistentLocalStorageKeys.bbuPersistentUserStatus,\n userStatus\n )\n Auth.signIn({\n username,\n password,\n validationData: [],\n })\n .then((res) => {\n if (isMountedRef.current) {\n const cognitoUser = parseAuthUser(res as CognitoUserInterface)\n dispatch(setAuthStateAction(AuthState.SignedIn))\n dispatch(setCurrentUserAction(cognitoUser))\n setUserStatus(userStatus)\n\n // User has just been registered and this is the first login\n // we run the SignUp trackEvent here (and not at the previus response level) so we can also attach userId received after the login\n // we also add some delay because we want to be sure user is added in redux store and will be readed inside the trackEvent function\n console.log('track!')\n setTimeout(() => {\n trackEvent({\n eventName: 'SignUp',\n feature: 'Authentication',\n step: 'Signup',\n params: {\n custom: {\n planId: Pricing?.cbPlanId,\n mrr: (Pricing?.mrr || 0) / 100,\n channel:\n provider &&\n BbuPartnersName[\n provider as keyof typeof BbuPartnersName\n ], // eg: \"tt\" for tiktok\n sourceId: bbuData?.source?.id,\n sourceName: bbuData?.source.name,\n destinationId: bbuData?.destination?.id,\n destinationName: bbuData?.destination?.name,\n },\n },\n sendEventToIntercom: true,\n })\n }, 500)\n }\n })\n .catch((cognitoError: CognitoErrorResponse) => {\n if (isMountedRef.current) {\n setApiError(getCustomErrorCognitoMessage(cognitoError))\n }\n })\n })\n .catch((error) => {\n setApiError(\n getApiErrorMessage({\n error,\n fallbackMessage: 'We could not authenticate you',\n })\n )\n })\n }\n\n return () => {\n isMountedRef.current = false\n authCancelRequest.cancel('Aborted since user is already logged')\n }\n }, [canProceedWithNotLoggedInFlow])\n\n useEffect(() => {\n if (apiError) {\n trackEvent({\n eventName: 'UnexpectedErrorThrown',\n feature: 'Authentication',\n step: 'Signup',\n params: {\n custom: {\n errorDescription: apiError,\n },\n },\n sendEventToIntercom: true,\n })\n }\n }, [apiError])\n\n return {\n userStatus,\n apiError,\n }\n}\n","import React, { useEffect, useState } from 'react'\nimport QueryString from 'querystring'\nimport LoginV1Service from '../services/ApplicationV1Bridge'\nimport { FacebookParameters } from 'LeadsBridgeApp'\nimport { Button, Dimmer, Loader, Message } from 'semantic-ui-react'\nimport createPersistedState from 'use-persisted-state'\nimport { useSelector } from 'react-redux'\nimport { RootState } from '../index'\nimport { AuthState } from '@aws-amplify/ui-components'\n\nconst Fbe: React.FC = () => {\n const [callInProgress, setCallInProgress] = useState(true)\n const [errorMessage, setErrorMessage] = useState('')\n const useRequestUriState = createPersistedState('requestUri')\n const [persistentUri, setPersistentUri] = useRequestUriState('')\n const usePersisteIsFlowForNbee = createPersistedState('isFlowForNbee')\n const [persistentIsFlowForNbee, setPersistentIsFlowForNbee] =\n usePersisteIsFlowForNbee(false)\n const authState = useSelector((state: RootState) => state.user.authState)\n\n useEffect(() => {\n const urlObj = new URL(String(window.location.href))\n const requestUri = urlObj.pathname\n setPersistentUri(requestUri)\n\n const url = process.env.REACT_APP_FACEBOOK_OAUTH\n const params = QueryString.parse(window.location.search.slice(1))\n const flowType: string = params.flowType as string\n const instanceId: string = params.instanceId as string\n\n // we need to persist this value, in order to read it in the fbe/callback (after redirect)\n // Test Deploy\n const nbee = params.nbee as string | undefined\n setPersistentIsFlowForNbee(nbee === 'true')\n\n const hasRequiredParams = flowType || requestUri\n if (hasRequiredParams && authState === AuthState.SignedIn) {\n LoginV1Service.facebookParameters(flowType, instanceId, requestUri)\n .then((res: FacebookParameters) => {\n const encodedExtras: string = encodeURIComponent(\n JSON.stringify(res.extras)\n )\n const backendUrl: string = encodeURIComponent(\n window.location.origin + '/fbe/callback'\n )\n\n let parameters = `&client_id=` + res.fbAppId\n parameters += `&display=page`\n parameters += `&redirect_uri=${backendUrl}`\n parameters += `&response_type=code`\n parameters += `&scope=` + res.scopes\n\n const fb: string = `${url}?extras=${encodedExtras}` + parameters\n\n window.location.replace(fb)\n })\n .catch((error) => {\n // Found here https://stackoverflow.com/questions/2631001/test-for-existence-of-nested-javascript-object-key\n const errorMessage = error.response?.data?.errorMessage\n ? error.response.data.errorMessage\n : '-'\n setErrorMessage(errorMessage)\n })\n .finally(() => {\n setCallInProgress(false)\n })\n } else if (hasRequiredParams && authState !== AuthState.SignedIn) {\n // here we are not ready to do api request, since user is still logging in\n // once `authState` will be updated they will be able to proceed as intended\n } else if (!hasRequiredParams) {\n setCallInProgress(false)\n setErrorMessage('Invalid Flow Type or requestUri')\n }\n }, [authState])\n\n return (\n <>\n \n Loading\n \n {errorMessage !== '' && (\n \n An error occurred!\n

{errorMessage}

\n {/*\n we can't rely on react router , since url/path is exaclty the same\n and click action will be ignored, so let's just refresh the page\n */}\n {persistentUri && (\n \n )}\n
\n )}\n \n )\n}\n\nexport default Fbe\n","import React, { useEffect, useState } from 'react'\nimport LoginV1Service from '../services/ApplicationV1Bridge'\nimport { Button, Dimmer, Loader, Message } from 'semantic-ui-react'\nimport QueryString from 'querystring'\nimport createPersistedState from 'use-persisted-state'\nimport { LangFbAppStore } from '@app/lang/LangFbAppStore'\n\nconst FbeCallback: React.FC = () => {\n const [callInProgress, setCallInProgress] = useState(true)\n const [errorMessage, setErrorMessage] = useState('')\n const [errorStyle, setErrorStyle] = useState('')\n const useRequestUriState = createPersistedState('requestUri')\n const usePersisteIsFlowForNbee = createPersistedState('isFlowForNbee')\n const [requestUri] = useRequestUriState('')\n\n // this allow us to understand if `setupInstance` needs to return a v1 or v2 url\n const [persistentIsFlowForNbee] = usePersisteIsFlowForNbee()\n\n useEffect(() => {\n const params = QueryString.parse(window.location.search.slice(1))\n const error: string = params.lb_error as string\n if (error) {\n const errorCode: string = params.lb_error_code as string\n const errorDescription: string = params.lb_error_description as string\n LoginV1Service.fbeCancel({\n error: error,\n errorCode: errorCode,\n errorDescription: errorDescription,\n })\n .catch((error) => {\n console.log(error)\n })\n .finally(() => {\n setCallInProgress(false)\n window.location.replace(process.env.REACT_APP_V1_URL + '')\n })\n } else {\n LoginV1Service.setupInstance({ nbee: !!persistentIsFlowForNbee })\n .then((callback: { callbackPath: string }) => {\n localStorage.removeItem('isFlowForNbee')\n localStorage.removeItem('requestUri')\n window.location.replace(callback.callbackPath)\n })\n .catch((error) => {\n // Found here https://stackoverflow.com/questions/2631001/test-for-existence-of-nested-javascript-object-key\n const errorMessage = error.response?.data?.errorMessage\n ? error.response.data.errorMessage\n : '-'\n if (errorMessage.includes('systemUser.RetrieveAccessTokenError')) {\n setErrorMessage(LangFbAppStore.messages.tokenError)\n } else {\n setErrorMessage(errorMessage)\n setErrorStyle('negative')\n }\n })\n .finally(() => {\n setCallInProgress(false)\n })\n }\n }, [])\n\n return (\n <>\n \n Loading\n \n {errorMessage !== '' && (\n \n {errorStyle === 'negative' && (\n An error occurred!\n )}\n

{errorMessage}

\n {requestUri && (\n {\n // `requestUri` comes from localStorage (stored as persistent state during previus step)\n location.href = requestUri\n }}\n >\n Retry\n \n )}\n
\n )}\n \n )\n}\n\nexport default FbeCallback\n","import React, { useEffect } from 'react'\nimport { IncomingDataInitialStep } from '@features/nbee/IncomingDataContent/IncomingDataInitialStep'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { appRoutes } from '@app/routes'\nimport { IncomingDataParams } from 'LeadsBridgeApp'\nimport { useGetIntegrationListener } from '@app/api/getIntegrationListener'\nimport { Loader } from '@app/components/Basic/Loader'\nimport {\n setIntegrationListenerAction,\n setIntegrationListenerStatus,\n} from '@app/store/actions/IntegrationListenerActions'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { parseApiError } from '@app/api/utils/error'\nimport { sendAlertMessage } from '@app/store/actions/ApplicationConfigurationActions'\nimport { useUpdateIntegrationListener } from '@app/api/updateIntegrationListener'\nimport { useGetAppById } from '@app/api/getAppById'\nimport { getListenerAppName } from '@features/nbee/IncomingDataContent/utils'\n\nexport const IncomingDataScreen: React.FC = () => {\n const dispatch = useAppDispatch()\n\n const params = useParams()\n const appId = params?.appId\n const integrationId = params?.integrationId\n const history = useHistory()\n\n const {\n data: integrationListenerData,\n isLoading: isGettingIntegrationListener,\n error: errorGettingIntegrationListener,\n } = useGetIntegrationListener(integrationId)\n\n const {\n mutate: updateIntegrationListener,\n isLoading: isUpdatingIntegrationListener,\n error: errorUpdatingIntegrationListener,\n } = useUpdateIntegrationListener()\n\n const {\n data: appData,\n isLoading: isLoadingApp,\n error: errorApiGetApp,\n } = useGetAppById(appId)\n\n const isLoading =\n isGettingIntegrationListener ||\n isUpdatingIntegrationListener ||\n isLoadingApp\n\n const isError =\n errorGettingIntegrationListener ||\n errorUpdatingIntegrationListener ||\n errorApiGetApp\n\n const handleContinue = () => {\n if (\n integrationListenerData?.fields &&\n integrationListenerData.fields.length > 0\n ) {\n history.push(\n appRoutes.incomingDataScreenFields.makeUrl({\n appId,\n integrationId,\n })\n )\n } else {\n updateIntegrationListener(\n {\n requestBody: {\n status: 1,\n },\n integrationId: `${integrationId}`,\n },\n {\n onSuccess: () => {\n dispatch(setIntegrationListenerStatus(1))\n history.push(\n appRoutes.incomingDataScreenFields.makeUrl({\n appId,\n integrationId,\n })\n )\n },\n }\n )\n }\n }\n\n // dispatch integration listener data to redux store\n useEffect(() => {\n if (integrationListenerData) {\n dispatch(setIntegrationListenerAction({ data: integrationListenerData }))\n }\n }, [integrationListenerData, dispatch])\n\n // In case of error when getting the integration listener\n useEffect(() => {\n if (isError) {\n const error = isError\n const errorMessage = parseApiError(error!)\n\n dispatch(\n sendAlertMessage({\n isDismissable: false,\n message: errorMessage.message,\n useTranslation: true,\n })\n )\n }\n }, [isError])\n\n return (\n <>\n {isLoading || errorGettingIntegrationListener ? (\n \n ) : null}\n \n \n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { IncomingDataTableStep } from '@features/nbee/IncomingDataContent/IncomingDataTableStep'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { IncomingDataParams } from 'LeadsBridgeApp'\nimport { useAppDispatch, useAppSelector } from '@app/store/hooks'\nimport { useUpdateIntegrationListener } from '@app/api/updateIntegrationListener'\nimport { ApiIntegrationListenerField } from '@app/@typings/Api/integration'\nimport {\n setIntegrationListenerFields,\n setIntegrationListenerStatus,\n} from '@app/store/actions/IntegrationListenerActions'\nimport { appRoutes } from '@app/routes'\nimport { usePusherChannel } from '@app/hooks/usePusherChannel'\nimport { Loader } from '@app/components/Basic/Loader'\nimport { parseApiError } from '@app/api/utils/error'\nimport { sendAlertMessage } from '@app/store/actions/ApplicationConfigurationActions'\nimport { useGetIntegrationUsage } from '@app/api/getIntegrationUsage'\nimport { useGetAppById } from '@app/api/getAppById'\nimport { getListenerAppName } from '@features/nbee/IncomingDataContent/utils'\nimport { useGetIntegrationFields } from '@app/api/getIntegrationListenerFields'\n\nexport const IncomingDataScreenFields: React.FC = () => {\n const { appId, integrationId } = useParams()\n const dispatch = useAppDispatch()\n const history = useHistory()\n\n // when isRecognizingFields is true, the loader is shown and the channel is subscribed\n const [isRecognizingFields, setIsRecognizingFields] = useState(true)\n\n const [isConfirmingReload, setIsConfirmingReload] = useState(0)\n\n const integrationListener = useAppSelector(\n (state) => state.integrationListener\n )\n\n const { data: integrationUsage, isLoading: isGettingIntegrationUsage } =\n useGetIntegrationUsage(integrationId)\n\n const {\n data: integrationFields,\n isLoading: isLoadingIntegrationFields,\n refetch: refetchIntegrationFields,\n } = useGetIntegrationFields(integrationId)\n\n const {\n data: appData,\n isLoading: isLoadingApp,\n error: errorApiGetApp,\n } = useGetAppById(appId)\n\n const activeBridges = integrationUsage?.data.activeBridges ?? 0\n const totalBridges = integrationUsage?.data.totalBridges ?? 0\n\n const fields = integrationListener.data\n ?.fields as ApiIntegrationListenerField[]\n\n useEffect(() => {\n if (integrationFields) {\n dispatch(setIntegrationListenerFields(integrationFields))\n }\n }, [integrationFields])\n\n const {\n mutate: updateIntegrationListener,\n isLoading: isUpdatingIntegrationListener,\n error: errorUpdatingIntegrationListener,\n } = useUpdateIntegrationListener()\n\n useEffect(() => {\n if (history.action === 'POP') {\n history.push(\n appRoutes.incomingDataScreen.makeUrl({ appId, integrationId })\n )\n }\n }, [])\n\n const handleReload = () => {\n if (isConfirmingReload < 1 && totalBridges && activeBridges) {\n setIsConfirmingReload((prevState) => prevState + 1)\n } else {\n updateIntegrationListener(\n {\n requestBody: { status: 1 },\n integrationId: `${integrationId}`,\n },\n {\n onSuccess: () => {\n dispatch(setIntegrationListenerStatus(1))\n setIsConfirmingReload(0)\n setIsRecognizingFields(true)\n },\n }\n )\n }\n }\n\n const handleContinue = () => {\n updateIntegrationListener(\n {\n requestBody:\n fields?.length > 0 ? { status: 2, fields: fields } : { status: 3 },\n integrationId: `${integrationId}`,\n },\n {\n onSuccess: () => {\n history.push(\n appRoutes.incomingDataScreenSave.makeUrl({ appId, integrationId })\n )\n },\n }\n )\n }\n\n // Subscribe to the channel only when the integrationListener is new and when the status is loading\n usePusherChannel(\n integrationListener.data?.channel || 'test-channel',\n 'webhookdata.parsed',\n integrationListener.data?.status === 1 && isRecognizingFields,\n () =>\n updateIntegrationListener(\n {\n integrationId: `${integrationId}`,\n requestBody: fields?.length > 0 ? { status: 2 } : { status: 3 },\n },\n {\n onSuccess: () => {\n dispatch(setIntegrationListenerStatus(fields?.length > 0 ? 2 : 3))\n },\n }\n ),\n () => {\n refetchIntegrationFields()\n }\n )\n\n // When the fields are recognized, the loader is hidden\n useEffect(() => {\n if (Array.isArray(fields) && fields.length > 0) {\n setIsRecognizingFields(false)\n }\n }, [fields])\n\n // In case of error when updating the integration listener\n useEffect(() => {\n if (errorUpdatingIntegrationListener) {\n setIsRecognizingFields(false)\n const error = errorUpdatingIntegrationListener\n const errorMessage = parseApiError(error!)\n\n dispatch(\n sendAlertMessage({\n isDismissable: true,\n message: errorMessage.message,\n useTranslation: true,\n })\n )\n }\n }, [errorUpdatingIntegrationListener])\n\n const isLoading =\n isUpdatingIntegrationListener || isGettingIntegrationUsage || isLoadingApp\n\n return (\n <>\n {isLoading ? : null}\n \n \n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { IncomingDataFinalStep } from '@features/nbee/IncomingDataContent/IncomingDataFinalStep'\nimport { useUpdateIntegration } from '@app/api/updateIntegration'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { IncomingDataParams } from 'LeadsBridgeApp'\nimport { Loader } from '@app/components/Basic/Loader'\nimport { parseApiError } from '@app/api/utils/error'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { sendAlertMessage } from '@app/store/actions/ApplicationConfigurationActions'\nimport { appRoutes } from '@app/routes'\nimport { useGetIntegrationById } from '@app/api/getIntegrationById'\nimport { sendIntegrationDataToParentWindow } from '@app/features/nbee/IntegrationCredentialsContent/utils'\nimport { useGetAppById } from '@app/api/getAppById'\n\nexport const IncomingDataScreenSave: React.FC = () => {\n const { appId, integrationId } = useParams()\n const dispatch = useAppDispatch()\n const history = useHistory()\n\n const {\n data: integrationData,\n isLoading: isFetchingIntegrationData,\n error: integrationDataApiError,\n } = useGetIntegrationById(integrationId)\n\n const {\n mutate: updateIntegration,\n isLoading: isUpdatingIntegration,\n error: integrationUpdateApiError,\n } = useUpdateIntegration()\n\n const {\n data: appData,\n isLoading: isLoadingApp,\n error: errorApiGetApp,\n } = useGetAppById(appId)\n\n const [integrationName, setIntegrationName] = useState(\n (integrationData && integrationData.name) || \"Integration's name\"\n )\n\n useEffect(() => {\n if (integrationData && integrationData.name) {\n setIntegrationName(integrationData.name)\n }\n }, [integrationData])\n\n const handleSave = () => {\n updateIntegration(\n {\n requestBody: {\n name: integrationName,\n appId: parseInt(appId),\n credentials: [],\n },\n integrationId: `${integrationId}`,\n },\n {\n onSuccess: (newIntegration) => {\n sendIntegrationDataToParentWindow(\n (newIntegration && Number(newIntegration.id)) || 0,\n (newIntegration && newIntegration.name) || ''\n )\n },\n }\n )\n }\n\n // TODO: decide if on cancel we just close the window or if we want to redirect the user back to step1 of incoming data screen\n const handleCancel = () => {\n // Alt.:\n // window.close()\n history.push(\n appRoutes.incomingDataScreenEdit.makeUrl({ appId, integrationId })\n )\n }\n\n // In case of error when updating the integration\n useEffect(() => {\n if (\n integrationUpdateApiError ||\n integrationDataApiError ||\n errorApiGetApp\n ) {\n const error =\n integrationUpdateApiError || integrationDataApiError || errorApiGetApp\n const errorMessage = parseApiError(error!)\n\n dispatch(\n sendAlertMessage({\n isDismissable: true,\n message: errorMessage.message,\n useTranslation: true,\n })\n )\n }\n }, [integrationUpdateApiError, integrationDataApiError, errorApiGetApp])\n\n const isLoading =\n isUpdatingIntegration || isFetchingIntegrationData || isLoadingApp\n return (\n <>\n {isLoading ? : null}\n {integrationData ? (\n \n ) : null}\n \n )\n}\n","import React, { useEffect } from 'react'\nimport queryString from 'query-string'\nimport { useHistory, useLocation } from 'react-router-dom'\nimport { PersistentSessionStorageKeys } from '@app/enums/persistentLocalStorageKeys'\nimport { Loader } from '@components/Basic/Loader'\nimport { useGetIntegrationByLegacyId } from '@app/api/getIntegrationByLegacyId'\nimport { Message } from '@components/Basic/Message'\nimport { parseApiError } from '@app/api/utils/error'\nimport { appRoutes } from '@app/routes'\nimport { trackEvent } from '@app/dataTracking'\n\nexport const IntegrationAuthCallback: React.FC = () => {\n const location = useLocation()\n const history = useHistory()\n\n // preparing data required to proceed\n const legacyIntegrationId = queryString.parse(location.search)\n .instanceId as string\n const instanceType = queryString.parse(location.search).instanceType as string\n const appId = sessionStorage.getItem(\n PersistentSessionStorageKeys.integrationAuthFlowAppId\n )\n const legacyIntegrationError = queryString.parse(location.search).error\n\n // getting integration id from legacyId params\n const params =\n appId && legacyIntegrationId && instanceType\n ? {\n appId: appId,\n instanceId: legacyIntegrationId,\n instanceType: instanceType,\n }\n : undefined\n const { data: integrationData, error: getIntegrationApiError } =\n useGetIntegrationByLegacyId(params)\n\n useEffect(() => {\n if (integrationData && integrationData.id && appId) {\n trackEvent({\n eventName: 'AuthorizeSuccess',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId: parseInt(appId, 10),\n integrationId: integrationData.id,\n integrationName: integrationData.name,\n oauth: true,\n },\n })\n\n // redirect to IntegrationAuthScreen as edit integration and step 2 active (name selection)\n history.push(\n appRoutes.integrationAuthScreenEditStep2.makeUrl({\n integrationId: `${integrationData.id}`,\n appId: appId,\n })\n )\n }\n }, [integrationData])\n\n useEffect(() => {\n if (!appId || !legacyIntegrationId || getIntegrationApiError) {\n const errorCode = getIntegrationApiError\n ? parseApiError(getIntegrationApiError).code\n : 'UI-Error'\n const errorDescription = getIntegrationApiError\n ? parseApiError(getIntegrationApiError).message\n : 'Missing appId or legacyIntegrationId'\n\n trackEvent({\n eventName: 'AuthorizeFailure',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId: appId ? parseInt(appId, 10) : undefined,\n integrationId: integrationData?.id,\n integrationName: integrationData?.name,\n oauth: true,\n custom: {\n errorCode,\n errorDescription,\n },\n },\n sendEventToIntercom: true,\n })\n }\n }, [appId, legacyIntegrationId, getIntegrationApiError])\n\n if (!appId) {\n return (\n \n App ID not found. This probably means you have not started the\n Authorization flow from a trusted source (eg. NBEE) or session storage\n is empty.\n \n )\n }\n\n if (!legacyIntegrationId) {\n return (\n \n {legacyIntegrationError || 'We could not read instanceId from URL.'}\n \n )\n }\n\n return getIntegrationApiError ? (\n \n {parseApiError(getIntegrationApiError).message}\n \n ) : (\n \n \n \n )\n}\n","import React, { useEffect, useState } from 'react'\nimport queryString from 'query-string'\nimport { useHistory, useLocation } from 'react-router-dom'\nimport { PersistentSessionStorageKeys } from '@app/enums/persistentLocalStorageKeys'\nimport { Loader } from '@components/Basic/Loader'\nimport { Message } from '@components/Basic/Message'\nimport { parseApiError } from '@app/api/utils/error'\nimport { appRoutes } from '@app/routes'\nimport { trackEvent } from '@app/dataTracking'\nimport { useAuthFromGrantCode } from '@app/api/postAuthfromGrantCode'\nimport { retrieveStoredCredentials } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/utils'\n\nexport const IntegrationAuthCallback2: React.FC = () => {\n const location = useLocation()\n const history = useHistory()\n\n const {\n mutate: postAuthGrantCode,\n isLoading: isLoadingAuthGrantCode,\n error: authGrantCodeApiError,\n data: authGrantCodeData,\n } = useAuthFromGrantCode()\n\n // Preparing data required to proceed\n const appId = sessionStorage.getItem(\n PersistentSessionStorageKeys.integrationAuthFlowAppId\n )\n const integrationId = sessionStorage.getItem('instanceId')\n // get the stored credentials from the session storage\n const credentials = retrieveStoredCredentials() ?? []\n\n const paramsFromUrl = new URLSearchParams(window.location.search)\n const paramsObject = Object.fromEntries(paramsFromUrl)\n\n const appIdInt = Number(appId)\n const integrationIdInt = Number(integrationId)\n\n const payloadArray = Object.keys(paramsObject).map((key) => ({\n key: key,\n value: paramsObject[key],\n }))\n const credentialsArray = Object.keys(credentials).map((key) => ({\n key: key,\n value: credentials[key],\n }))\n\n useEffect(() => {\n postAuthGrantCode(\n {\n appId: appIdInt,\n integrationId: integrationIdInt || undefined,\n payload: payloadArray.concat(credentialsArray),\n },\n {\n onSuccess: (data) => {\n const integrationData = data?.data?.integration\n if (integrationData && integrationData.id && appId) {\n trackEvent({\n eventName: 'AuthorizeSuccess',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId: parseInt(appId, 10),\n integrationId: integrationData.id,\n integrationName: integrationData.name,\n oauth: true,\n },\n })\n\n history.push(\n appRoutes.integrationAuthScreenEditStep2.makeUrl({\n integrationId: `${integrationData.id}`,\n appId: appId,\n })\n )\n }\n },\n }\n )\n }, [])\n\n useEffect(() => {\n if (!appId || !integrationId || authGrantCodeApiError) {\n const errorCode = authGrantCodeApiError\n ? parseApiError(authGrantCodeApiError).code\n : 'UI-Error'\n const errorDescription = authGrantCodeApiError\n ? parseApiError(authGrantCodeApiError).message\n : 'Missing appId or legacyIntegrationId'\n\n trackEvent({\n eventName: 'AuthorizeFailure',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId: appId ? parseInt(appId, 10) : undefined,\n integrationId: authGrantCodeData?.data?.integration?.id,\n integrationName: authGrantCodeData?.data?.integration?.name,\n oauth: true,\n custom: {\n errorCode,\n errorDescription,\n },\n },\n sendEventToIntercom: true,\n })\n }\n }, [appId, integrationId, authGrantCodeApiError])\n\n if (!appId) {\n return (\n \n App ID not found. This probably means you have not started the\n Authorization flow from a trusted source (eg. NBEE) or session storage\n is empty.\n \n )\n }\n\n return authGrantCodeApiError ? (\n \n {parseApiError(authGrantCodeApiError).message}\n \n ) : (\n \n \n \n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { IntegrationCredentialsContent } from '@features/nbee/IntegrationCredentialsContent'\nimport { useParams } from 'react-router-dom'\nimport { IntegrationCredentialParams } from 'LeadsBridgeApp'\nimport { usePostNewIntegration } from '@app/api/postNewIntegration'\nimport {\n makeIntegrationFormInitialValues,\n transformIntegrationFormValuesToApiSaveRequestBody,\n} from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/utils'\nimport { IntegrationFormValues } from 'Nbee'\nimport { ApiErrorResponse } from 'BackendApi'\nimport { FormikHelpers } from 'formik'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { parseApiError } from '@app/api/utils/error'\nimport { sendToast } from '@app/store/actions/ApplicationConfigurationActions'\nimport { Loader } from '@components/Basic/Loader'\nimport { sendIntegrationDataToParentWindow } from '@features/nbee/IntegrationCredentialsContent/utils'\nimport { Message } from '@components/Basic/Message'\nimport { useGetAppById } from '@app/api/getAppById'\nimport { useRetrieveAppCredentials } from '@app/api/postRetrieveAppCredentials'\nimport { useTestIntegrationCredentialsById } from '@app/api/testIntegrationCredentialsById'\nimport { useTranslation } from 'react-i18next'\nimport { useUpdateIntegration } from '@app/api/updateIntegration'\nimport { trackEvent } from '@app/dataTracking'\n\n// This page is supposed to be always opened inside a popup window with reduced dimensions\n// In future we might add an additional check and prevent the component to render if `window.opener` is not set\n// this means that this component has not been mounted in a page generated from a parent window\nexport const IntegrationAuthScreen: React.FC = () => {\n const { appId } = useParams()\n const { t } = useTranslation()\n const [newIntegration, setNewIntegration] =\n useState<{ id: number; name: string }>()\n const appIdNumber = parseInt(appId, 10)\n // this will be used to keep the loading spinner while sending data to parent and modal is about to be closed\n const [isAboutToClosingModal, setIsAboutToClosingModal] = useState(false)\n\n const dispatch = useAppDispatch()\n\n const {\n data: appData,\n isLoading: isLoadingApp,\n error: errorApiGetApp,\n } = useGetAppById(appId)\n\n const {\n data: appAuthSchemaResponse,\n mutate: retrieveAuthSchema,\n isLoading: isLoadingAppAuthSchema,\n error: errorApiAppAuthSchema,\n } = useRetrieveAppCredentials()\n\n const {\n mutate: saveNewIntegration,\n isLoading: isSavingNewIntegration,\n error: integrationSaveApiError,\n data: savedIntegration,\n } = usePostNewIntegration()\n\n const {\n mutate: updateIntegration,\n isLoading: isUpdatingIntegration,\n error: integrationUpdateApiError,\n data: updatedIntegrationData,\n } = useUpdateIntegration()\n\n // if error we notify the user\n useEffect(() => {\n const error = integrationUpdateApiError || integrationSaveApiError\n if (error) {\n const errorMessage = parseApiError(error).message\n dispatch(\n sendToast({\n title: 'Error',\n messages: [errorMessage],\n color: 'negative',\n })\n )\n }\n }, [integrationUpdateApiError, integrationSaveApiError])\n\n // retrieving auth schema on mount\n useEffect(() => {\n retrieveAuthSchema({\n appId: appIdNumber,\n settings: [],\n })\n }, [appIdNumber])\n\n const {\n data: testIntegrationResults,\n error: integrationTestError,\n isLoading: isCheckingValidIntegration,\n isRefetching: isReCheckingValidIntegration,\n refetch: reTestValidIntegration,\n } = useTestIntegrationCredentialsById(newIntegration?.id)\n\n // we build the full auth schema by merging existing data into the full app auth schema\n // we also consider `optimisticIntegrationData` as data just saved, so in case of test error\n // we fill initial state with the new saved data\n const optimisticIntegrationData = savedIntegration?.data?.integration\n const appAuthSchema = appAuthSchemaResponse?.data?.credentials.fields || []\n const isOauthUri = appAuthSchemaResponse?.data?.credentials.type === 'oauth2'\n const initialValues = appData\n ? makeIntegrationFormInitialValues(\n appAuthSchema,\n appData.name,\n optimisticIntegrationData\n )\n : null\n\n // handle success save/updated\n useEffect(() => {\n const isSuccessResponse =\n updatedIntegrationData || savedIntegration?.data?.integration\n if (isSuccessResponse) {\n const integrationId = isSuccessResponse.id\n const integrationName = isSuccessResponse.name\n if (newIntegration?.id) {\n // in case `newIntegration` is already set the `useTestIntegrationCredentialsById` hook\n // will not re-run, so re refetch data manually\n reTestValidIntegration()\n }\n setNewIntegration({ id: integrationId, name: integrationName })\n }\n }, [updatedIntegrationData, savedIntegration])\n\n // on mount events\n const isReady = Boolean(appData && initialValues && appAuthSchemaResponse)\n useEffect(() => {\n if (isReady) {\n trackEvent({\n eventName: 'NewIntegrationShown',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId: appData?.id,\n appName: appData?.name,\n oauth: isOauthUri,\n },\n })\n }\n }, [isReady])\n\n const trackEventError = (\n apiError: ApiErrorResponse,\n formValues: IntegrationFormValues\n ) => {\n const parsedError = parseApiError(apiError)\n trackEvent({\n eventName: 'UnexpectedErrorThrown',\n feature: 'NBEE',\n step: 'Apps',\n params: {\n appId: parseInt(appId, 10),\n appName: appData?.name,\n integrationId: newIntegration?.id,\n integrationName: formValues.name,\n custom: {\n errorCode: parsedError.code,\n errorDescription: parsedError.message,\n },\n },\n sendEventToIntercom: true,\n })\n }\n\n const saveIntegration = (\n formValues: IntegrationFormValues,\n formikHelpers: FormikHelpers\n ) => {\n formikHelpers.setSubmitting(true)\n\n // in we already saved the integration and we received an error\n // next action will be an updated and not a saved new\n // we know this by checking newIntegration object\n if (newIntegration?.id) {\n updateIntegration(\n {\n integrationId: `${newIntegration.id}`,\n requestBody: transformIntegrationFormValuesToApiSaveRequestBody(\n formValues,\n appIdNumber\n ),\n },\n {\n onError: (apiError) => {\n formikHelpers.setSubmitting(false)\n trackEventError(apiError, formValues)\n },\n }\n )\n\n return\n }\n\n saveNewIntegration(\n {\n requestBody: transformIntegrationFormValuesToApiSaveRequestBody(\n formValues,\n appIdNumber\n ),\n },\n {\n onError: (apiError) => {\n formikHelpers.setSubmitting(false)\n trackEventError(apiError, formValues)\n },\n }\n )\n }\n\n // Proceeding when test is successful\n useEffect(() => {\n if (testIntegrationResults?.data?.result && newIntegration) {\n setIsAboutToClosingModal(true)\n\n if (!isOauthUri) {\n // when test is OK and we are not in oauth flow, before sending the SaveClicked Event, we need to send\n // the `AuthorizeSuccess` so we can simulate the same events order of the oauth integration\n trackEvent({\n eventName: 'AuthorizeSuccess',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId: appData?.id,\n appName: appData?.name,\n integrationId: newIntegration.id,\n integrationName: newIntegration.name,\n oauth: false,\n },\n })\n }\n\n trackEvent({\n eventName: 'SaveClicked',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId: appData?.id,\n appName: appData?.name,\n integrationId: newIntegration.id,\n integrationName: newIntegration.name,\n oauth: isOauthUri,\n },\n })\n\n sendIntegrationDataToParentWindow(newIntegration.id, newIntegration.name)\n }\n }, [testIntegrationResults])\n\n // In case of test failure\n useEffect(() => {\n // in case test fails we send the `AuthorizeFailure` tracking event only if is not an oauth flow\n // for oauth integrations we send this event during the oauth flow, insice IntegrationAuthCallback component\n if (integrationTestError && !isOauthUri) {\n const parsedTestError = parseApiError(integrationTestError)\n trackEvent({\n eventName: 'AuthorizeFailure',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId: appData?.id,\n appName: appData?.name,\n integrationId: newIntegration?.id,\n integrationName: newIntegration?.name,\n oauth: false,\n custom: {\n errorCode: parsedTestError.code,\n errorDescription: parsedTestError.message,\n },\n },\n sendEventToIntercom: true,\n })\n }\n }, [integrationTestError])\n\n const isLoadingAll =\n isLoadingApp ||\n isLoadingAppAuthSchema ||\n isCheckingValidIntegration ||\n isReCheckingValidIntegration ||\n !initialValues ||\n isAboutToClosingModal\n const apiError = errorApiAppAuthSchema || errorApiGetApp\n\n if (!appId) {\n return
Missing Parameter
\n }\n\n return isLoadingAll ? (\n \n \n \n ) : appData && initialValues ? (\n \n ) : (\n \n {apiError ? parseApiError(apiError).message : 'Missing data'}\n \n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { IntegrationCredentialsContent } from '@features/nbee/IntegrationCredentialsContent'\nimport { matchPath, useLocation, useParams } from 'react-router-dom'\nimport { IntegrationCredentialEditParams } from 'LeadsBridgeApp'\nimport {\n makeIntegrationFormInitialValues,\n transformIntegrationFormValuesToApiSaveRequestBody,\n} from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm/utils'\nimport { IntegrationFormValues } from 'Nbee'\nimport { ApiErrorResponse } from 'BackendApi'\nimport { FormikHelpers } from 'formik'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { parseApiError } from '@app/api/utils/error'\nimport { sendToast } from '@app/store/actions/ApplicationConfigurationActions'\nimport { Loader } from '@components/Basic/Loader'\nimport { sendIntegrationDataToParentWindow } from '@features/nbee/IntegrationCredentialsContent/utils'\nimport { Message } from '@components/Basic/Message'\nimport { useGetIntegrationById } from '@app/api/getIntegrationById'\nimport { useUpdateIntegration } from '@app/api/updateIntegration'\nimport { useGetAppById } from '@app/api/getAppById'\nimport { appRoutes } from '@app/routes'\nimport { useRetrieveAppCredentials } from '@app/api/postRetrieveAppCredentials'\nimport { SubmitAction } from '@features/nbee/IntegrationCredentialsContent/AppAuthCredentialForm'\nimport { usePostNewIntegration } from '@app/api/postNewIntegration'\nimport { useTestIntegrationCredentialsById } from '@app/api/testIntegrationCredentialsById'\nimport { useTranslation } from 'react-i18next'\nimport { trackEvent } from '@app/dataTracking'\n\n// This page is supposed to be always opened inside a popup window with reduced dimensions\n// In future we might add an additional check and prevent the component to render if `window.opener` is not set\n// this means that this component has not been mounted in a page generated from a parent window\nexport const IntegrationAuthScreenEdit: React.FC = () => {\n const { t } = useTranslation()\n const { appId, integrationId, bridgeId } =\n useParams()\n const appIdNumber = parseInt(appId, 10)\n const [newIntegration, setNewIntegration] =\n useState<{ id: number; name: string }>()\n // this will be used to keep the loading spinner while sending data to parent and modal is about to be closed\n const [isAboutToClosingModal, setIsAboutToClosingModal] = useState(false)\n\n const dispatch = useAppDispatch()\n const location = useLocation()\n const isSaveStep = matchPath(location.pathname, {\n path: appRoutes.integrationAuthScreenEditStep2.path,\n exact: true,\n strict: true,\n })\n\n const {\n data: appData,\n isLoading: isLoadingApp,\n error: errorApiGetApp,\n } = useGetAppById(appId)\n\n const {\n data: appAuthSchemaResponse,\n mutate: retrieveAuthSchema,\n isLoading: isLoadingAppAuthSchema,\n error: errorApiAppAuthSchema,\n } = useRetrieveAppCredentials()\n\n const {\n data: existingIntegration,\n isLoading: isLoadingExistingIntegration,\n error: errorApiGetIntegration,\n } = useGetIntegrationById(integrationId)\n\n const {\n mutate: updateIntegration,\n isLoading: isUpdatingIntegration,\n error: integrationUpdateApiError,\n data: updatedIntegrationData,\n } = useUpdateIntegration()\n\n const {\n mutate: saveNewIntegration,\n isLoading: isSavingNewIntegration,\n error: integrationSaveApiError,\n data: savedIntegrationData,\n } = usePostNewIntegration()\n\n const {\n data: testIntegrationResults,\n error: integrationTestError,\n isLoading: isCheckingValidIntegration,\n isRefetching: isReCheckingValidIntegration,\n refetch: reTestValidIntegration,\n } = useTestIntegrationCredentialsById(newIntegration?.id)\n\n const trackEventError = (\n apiError: ApiErrorResponse,\n formValues: IntegrationFormValues\n ) => {\n const parsedError = parseApiError(apiError)\n trackEvent({\n eventName: 'UnexpectedErrorThrown',\n feature: 'NBEE',\n step: 'Apps',\n params: {\n appId: appIdNumber,\n appName: appData?.name,\n integrationId: parseInt(integrationId, 10),\n integrationName: formValues.name,\n custom: {\n errorCode: parsedError.code,\n errorDescription: parsedError.message,\n },\n },\n sendEventToIntercom: true,\n })\n }\n\n // if error we notify the user\n useEffect(() => {\n const error = integrationUpdateApiError || integrationSaveApiError\n if (error) {\n const errorMessage = parseApiError(error).message\n dispatch(\n sendToast({\n title: 'Error',\n message: errorMessage,\n color: 'negative',\n })\n )\n }\n }, [integrationUpdateApiError, integrationSaveApiError])\n\n // retrieving auth schema on mount\n useEffect(() => {\n retrieveAuthSchema({\n appId: appIdNumber,\n settings: [],\n })\n }, [appIdNumber])\n\n // data just saved\n const optimisticIntegrationData =\n updatedIntegrationData || savedIntegrationData?.data?.integration\n\n // we build the full auth schema by merging existing data into the full app auth schema\n const appAuthSchema = appAuthSchemaResponse?.data?.credentials.fields || []\n const isOauthUri = appAuthSchemaResponse?.data?.credentials.type === 'oauth2'\n const initialValues = appData\n ? makeIntegrationFormInitialValues(\n appAuthSchema,\n appData.name,\n optimisticIntegrationData || existingIntegration\n )\n : null\n\n // on mount events\n const isReady = Boolean(appData && initialValues && appAuthSchemaResponse)\n useEffect(() => {\n if (isReady && !isSaveStep) {\n trackEvent({\n eventName: 'EditIntegrationShown',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId: appData?.id,\n appName: appData?.name,\n integrationId: parseInt(integrationId, 10),\n integrationName: initialValues?.name,\n oauth: isOauthUri,\n },\n })\n }\n }, [isReady])\n\n const updateIntegrationHandler = (\n formValues: IntegrationFormValues,\n formikHelpers: FormikHelpers,\n action: SubmitAction\n ) => {\n formikHelpers.setSubmitting(true)\n\n if (action === 'update') {\n updateIntegration(\n {\n integrationId: integrationId,\n requestBody: transformIntegrationFormValuesToApiSaveRequestBody(\n formValues,\n appIdNumber\n ),\n },\n {\n onError: (apiError) => {\n formikHelpers.setSubmitting(false)\n trackEventError(apiError, formValues)\n },\n }\n )\n }\n\n if (action === 'save-new') {\n saveNewIntegration(\n {\n requestBody: transformIntegrationFormValuesToApiSaveRequestBody(\n formValues,\n appIdNumber\n ),\n },\n {\n onError: (apiError) => {\n formikHelpers.setSubmitting(false)\n trackEventError(apiError, formValues)\n },\n }\n )\n }\n }\n\n // handle success save/updated\n useEffect(() => {\n const isSuccessResponse =\n updatedIntegrationData || savedIntegrationData?.data?.integration\n if (isSuccessResponse) {\n const integrationId = isSuccessResponse.id\n const integrationName = isSuccessResponse.name\n if (newIntegration?.id) {\n // in case `newIntegration` is already set the `useTestIntegrationCredentialsById` hook\n // will not re-run, so re refetch data manually\n reTestValidIntegration()\n }\n setNewIntegration({ id: integrationId, name: integrationName })\n }\n }, [updatedIntegrationData, savedIntegrationData])\n\n // Proceeding when test is successful\n useEffect(() => {\n if (testIntegrationResults?.data?.result && newIntegration) {\n setIsAboutToClosingModal(true)\n\n if (!isOauthUri) {\n // when test is OK and we are not in oauth flow, before sending the SaveClicked Event, we need to send\n // the `AuthorizeSuccess` so we can simulate the same events order of the oauth integration\n trackEvent({\n eventName: 'AuthorizeSuccess',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId: appData?.id,\n appName: appData?.name,\n integrationId: newIntegration.id,\n integrationName: newIntegration.name,\n oauth: false,\n },\n })\n }\n\n trackEvent({\n eventName: 'SaveClicked',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId: appData?.id,\n appName: appData?.name,\n integrationId: newIntegration.id,\n integrationName: newIntegration.name,\n oauth: isOauthUri,\n },\n })\n\n sendIntegrationDataToParentWindow(newIntegration.id, newIntegration.name)\n }\n }, [testIntegrationResults])\n\n // In case of test failure\n useEffect(() => {\n // in case test fails we send the `AuthorizeFailure` tracking event only if is not an oauth flow\n // for oauth integrations we send this event during the oauth flow, insice IntegrationAuthCallback component\n if (integrationTestError && !isOauthUri) {\n const parsedTestError = parseApiError(integrationTestError)\n trackEvent({\n eventName: 'AuthorizeFailure',\n feature: 'NBEE',\n step: 'Integration',\n params: {\n appId: appData?.id,\n appName: appData?.name,\n integrationId: newIntegration?.id,\n integrationName: newIntegration?.name,\n oauth: false,\n custom: {\n errorCode: parsedTestError.code,\n errorDescription: parsedTestError.message,\n },\n },\n sendEventToIntercom: true,\n })\n }\n }, [integrationTestError])\n\n const isLoadingAll =\n isLoadingAppAuthSchema ||\n isLoadingApp ||\n isLoadingExistingIntegration ||\n isCheckingValidIntegration ||\n isReCheckingValidIntegration ||\n isAboutToClosingModal\n const apiError =\n errorApiAppAuthSchema || errorApiGetIntegration || errorApiGetApp\n\n if (!appId) {\n return
Missing Parameter
\n }\n\n return isLoadingAll ? (\n \n \n \n ) : appData && initialValues ? (\n \n ) : apiError ? (\n {parseApiError(apiError).message}\n ) : null\n}\n","import React, { useEffect } from 'react'\nimport { useLocation } from 'react-router-dom'\nimport queryString from 'query-string'\nimport { useVerifyLink } from '@app/api/postVerifyLink'\nimport { Loader } from '@components/Basic/Loader'\nimport LbLogoSvg from '@assets/images/logo-lb-small.svg'\nimport { StyledAuthorizationPopup } from '@features/nbee/IntegrationCredentialsContent/styled'\nimport { useTranslation } from 'react-i18next'\n\nexport const IntegrationAuthVerifiedEmailScreenLegacy: React.VFC = () => {\n const { Wrapper, Header, Body, Title, SubTitle } = StyledAuthorizationPopup\n const { t } = useTranslation()\n const location = useLocation()\n const queryStringParam = queryString.parse(location.search) as {\n code: string\n }\n\n const {\n data: verifyLinkResponse,\n mutate: verifyLink,\n isLoading: verifyLinkLoading,\n isError: verifyLinkError,\n } = useVerifyLink()\n\n useEffect(() => {\n if (queryStringParam.code) {\n verifyLink(queryStringParam)\n }\n }, [])\n\n return (\n \n
\n {'leadsbridge-logo'}\n
\n \n {t('emailValidationLegacyExperience.pageTitle')}\n {verifyLinkLoading && (\n <>\n \n {t('emailValidationLegacyExperience.loadingMessage')}\n \n \n \n )}\n {verifyLinkResponse && (\n \n {t('emailValidationLegacyExperience.successMessage')}\n \n )}\n {verifyLinkError && (\n \n {t('emailValidationLegacyExperience.errorMessage')}\n \n )}\n \n
\n )\n}\n","import React from 'react'\n\nexport const IntegrationHome: React.VFC = () => {\n return null\n}\n","import React, { useEffect } from 'react'\nimport { useLocation } from 'react-router-dom'\nimport { Dimmer, Loader } from 'semantic-ui-react'\n\ninterface Props {}\n\nconst LegacyRedirect: React.FC = () => {\n const location = useLocation()\n\n useEffect(() => {\n const redirectUrl =\n process.env.REACT_APP_V1_URL! + location.pathname + location.search\n // some time redirect from v1 to v2 is not stripping out the '/app' part\n // that is already present in `process.env.REACT_APP_V1_URL`, causing\n // the computation of an URL of type `https://leadsbridge.com/app/` + `/app/path/to/page/`\n // This is something not related to v2 app, since some time it receives\n // `/bridges/edit/` and some times `app/page-abc/`.\n // We can fix this by replaceing `/app/app/` with a single `/app/` :D\n const parsedRedirectUrl = redirectUrl.replace('/app/app/', '/app/')\n window.location.href = parsedRedirectUrl\n }, [])\n\n return (\n
\n \n Loading\n \n
\n )\n}\n\nexport default LegacyRedirect\n","import Cookies from 'universal-cookie'\nimport { PersistentCookiesKeys } from '@app/enums/persistentCookiesKeys'\nimport LoginV1Service from \"@app/services/ApplicationV1Bridge\";\n\nexport const clearPersistentData = async () => {\n const cookies = new Cookies()\n\n localStorage.clear()\n sessionStorage.clear()\n await LoginV1Service.cancelSessionCookie(process.env.REACT_APP_V1_COOKIE_DOMAIN ?? \"\")\n cookies.remove(PersistentCookiesKeys.LbImp, {\n path: '/',\n domain: process.env.REACT_APP_V1_COOKIE_DOMAIN,\n })\n cookies.remove(PersistentCookiesKeys.CognitoSession, {\n path: '/',\n domain: process.env.REACT_APP_V1_COOKIE_DOMAIN,\n })\n cookies.remove('fbm_939660826071336', {\n path: '/',\n domain: process.env.REACT_APP_V1_COOKIE_DOMAIN,\n })\n cookies.remove('fbsr_939660826071336', {\n path: '/',\n domain: process.env.REACT_APP_V1_COOKIE_DOMAIN,\n })\n}\n","import React from 'react'\nimport { BridgeFormValues } from 'Nbee'\nimport { BridgeChooserForm } from '@features/nbee/BridgeChooserForm'\nimport { BridgeChooserRedirector } from '@features/nbee/BridgeChooserRedirector'\nimport { Route, Switch, useHistory } from 'react-router-dom'\nimport { appRoutes } from '@app/routes'\n\nconst emptyBridge: BridgeFormValues = {\n name: `New bridge ${new Date().getTime()}`,\n source: {\n appId: undefined,\n integrationId: undefined,\n settings: [],\n },\n destination: {\n appId: undefined,\n integrationId: undefined,\n settings: [],\n },\n settings: {\n emailReceipt: {\n active: false,\n },\n },\n}\n\nexport const BridgeChooser: React.FC = () => {\n const initialValues = emptyBridge\n const history = useHistory()\n\n return (\n \n {/* Step 1: App selections */}\n \n {\n // on submit we redirect to step 2\n history.push(\n appRoutes.nbeeBridgeChooserStep2.makeUrl({\n sourceAppId: `${formValues.source.appId}`,\n destinationAppId: `${formValues.destination.appId}`,\n })\n )\n }}\n />\n \n {/*\n Step 2: Editor selection\n > NB: For some combinations, there is no 'complex bridge'. Within this Route, we check compatibility and manage the automatic redirect!\n */}\n\n \n \n )\n}\n","import React from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { appRoutes } from '@app/routes'\nimport { NbeeStepCompletedState } from '@app/pages/Nbee/Step3'\nimport { isDebug } from '@app/utils/envUtils'\n\nexport const NbeeHome: React.FC = () => {\n const history = useHistory()\n\n if (!isDebug) {\n // prevent this page to appear in production :)\n return null\n }\n\n return (\n
\n

NBEE Home

\n\n
    \n
  • \n {\n history.push(appRoutes.nbeeBridgeChooserStep1.makeUrl())\n }}\n >\n Bridge Chooser Step 1\n \n
  • \n\n
  • \n {\n history.push(\n appRoutes.nbeeBridgeChooserStep2.makeUrl({\n sourceAppId: '63',\n destinationAppId: '45',\n })\n )\n }}\n >\n Bridge Chooser Step 2\n \n
  • \n\n
  • \n {\n history.push(appRoutes.nbeeStep1New.makeUrl())\n }}\n >\n New bridge empty\n \n
  • \n\n
  • \n {\n history.push({\n pathname: appRoutes.nbeeStep1New.makeUrl(),\n search: 'sourceId=63',\n })\n }}\n >\n New bridge empty with sourceId selected\n \n
  • \n\n
  • \n {\n // redirect to NBEE form with source and destination prefilled\n history.push(\n appRoutes.signupBbu.makeUrl({\n source: 'facebook-lead-ads',\n destination: 'google-sheets',\n })\n )\n }}\n >\n New bridge form with BBU\n \n
  • \n\n
  • \n {\n history.push(appRoutes.nbeeStep1Edit.makeUrl('321'))\n }}\n >\n Edit bridge\n \n
  • \n\n
  • \n {\n history.push(appRoutes.nbeeStep2.makeUrl('321'))\n }}\n >\n Step2\n \n
  • \n\n
  • \n {\n const step3State: NbeeStepCompletedState = { success: true }\n history.push(appRoutes.nbeeStep3.makeUrl('321'), step3State)\n }}\n >\n Step3\n \n
  • \n\n
  • \n {\n history.push('/test-components')\n }}\n >\n Test Components\n \n
  • \n
\n
\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { SimpleBridgeBuilderForm } from '@features/nbee/SimpleBridgeBuilderForm'\nimport { useGetBridgeByTemplate } from '@app/api/getBridgeByTemplate'\nimport { BridgeFormValues } from 'Nbee'\nimport { transformBridgeFormValuesToApiSaveBridgeBody } from '@app/api/utils/bridge'\nimport { useCreateNewBridge } from '@app/api/createNewBridge'\nimport { matchPath, useHistory, useLocation } from 'react-router-dom'\nimport { appRoutes, bridgeByUrlPartnersPaths } from '@app/routes'\nimport { parseApiError } from '@app/api/utils/error'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { sendToast } from '@app/store/actions/ApplicationConfigurationActions'\nimport { LoadingStep } from '@features/nbee/LoadingStep'\nimport { BbuRouteParams } from 'LeadsBridgeApp'\nimport { trackEvent } from '@app/dataTracking'\nimport { makeNbeeTrackingParams } from '@app/dataTracking/utils'\nimport { useSetupBridgeById } from '@app/api/postSetupBridge'\nimport { FormikHelpers } from 'formik'\nimport { useUpdateBridge } from '@app/api/updateBridge'\nimport queryString from 'query-string'\nimport { useGetUserModules } from '@app/api/getUserModules'\nimport { UserDefault } from 'BackendApi'\nimport { useGetUserInfo } from '@app/api/getUserInfo'\nimport { ModalTrialInfo } from '@features/nbee/ModalTrialInfo'\n\nconst makeEmptyBridge = (\n sourceAppId?: number,\n destinationAppId?: number,\n emailReceiptDefaults?: UserDefault\n): BridgeFormValues => ({\n name: `New bridge`,\n source: {\n appId: sourceAppId,\n integrationId: undefined,\n settings: [],\n },\n destination: {\n appId: destinationAppId,\n integrationId: undefined,\n settings: [],\n },\n settings: {\n emailReceipt: {\n active: Boolean(emailReceiptDefaults?.active ?? false),\n recipients: emailReceiptDefaults?.recipients ?? [],\n subject: emailReceiptDefaults?.subject ?? '',\n },\n },\n})\n\nexport const Step1: React.FC = () => {\n const history = useHistory()\n const location = useLocation()\n const dispatch = useAppDispatch()\n\n const [isModalOpen, setIsModalOpen] = useState(false)\n const handleOpenModal = () => setIsModalOpen(true)\n const handleCloseModal = () => setIsModalOpen(false)\n\n const {\n data: user,\n isLoading: isLoadingUser,\n error: userError,\n } = useGetUserInfo()\n\n const loginParams = queryString.parse(window.location.search)\n const showSurpriseMessage =\n loginParams.currentPlan === 'freemium' ||\n loginParams?.currentPlan?.includes('starter')\n const lbfsgn = loginParams.lbfsgn === 'true'\n\n const planName =\n loginParams.currentPlan === 'freemium'\n ? 'Free'\n : loginParams?.currentPlan?.includes('starter')\n ? 'Starter'\n : ''\n\n const isFirstLogin = user?.newUser || lbfsgn\n\n useEffect(() => {\n if (isFirstLogin) handleOpenModal()\n }, [isFirstLogin])\n\n const [bridgeFormikProps, setBridgeFormikProps] = useState<{\n formValues: BridgeFormValues\n formikHelpers: FormikHelpers\n } | null>(null)\n\n // if is bbu uri: `/bc/(app|lb)/facebook-lead-ads/google-sheets`\n const bbuMatchUrl = matchPath(location.pathname, {\n path: bridgeByUrlPartnersPaths,\n exact: true,\n })\n\n const bbuUri = bbuMatchUrl\n ? `${window.location.origin}${bbuMatchUrl.url}`\n : undefined\n\n const { data: bridgeTemplateValues, isLoading: isLoadingBridgeTemplate } =\n useGetBridgeByTemplate(bbuUri)\n\n const urlParsed = queryString.parse(location.search, {\n parseNumbers: true,\n })\n const sourceAppIdFromQueryString =\n urlParsed && urlParsed.sourceId\n ? parseInt(`${urlParsed.sourceId}`, 10)\n : undefined\n const destinationAppIdFromQueryString =\n urlParsed && urlParsed.destinationId\n ? parseInt(`${urlParsed.destinationId}`, 10)\n : undefined\n\n const {\n data: userModulesResponse,\n isLoading: isLoadingUserModules,\n error: apiUserModulesError,\n } = useGetUserModules()\n const userModules = userModulesResponse?.modules || []\n const emailReceiptUserModule = userModules.find(\n (m) => m.id === 'email-receipt'\n )\n\n // prepare initial values base on BBU data or empty bridge\n // in case we have sourceId or destinationId in query string we prefill them\n const initialValues =\n bbuUri && bridgeTemplateValues\n ? bridgeTemplateValues\n : makeEmptyBridge(\n sourceAppIdFromQueryString,\n destinationAppIdFromQueryString,\n emailReceiptUserModule?.userDefaults\n )\n\n // Save bridge\n const {\n mutate: createNewBridge,\n data: createNewBridgeResponse,\n error: createNewBridgeError,\n isLoading: isCreatingNewBridge,\n } = useCreateNewBridge()\n\n // Update bridge\n const {\n mutate: updateBridge,\n data: updateBridgeResponse,\n error: updateBridgeError,\n isLoading: isUpdatingBridge,\n } = useUpdateBridge()\n\n // Setup bridge\n const {\n mutate: setupBridge,\n data: bridgeSetupResponse,\n error: bridgeSetupApiError,\n isLoading: isSettingUpBridge,\n } = useSetupBridgeById()\n\n const isSavingApi =\n isCreatingNewBridge || isSettingUpBridge || isUpdatingBridge\n const apiError =\n createNewBridgeError || bridgeSetupApiError || updateBridgeError\n const createdBridgeId = createNewBridgeResponse?.data?.bridge?.id // when is the first time user saves the bridge\n const updatedBridgeId = updateBridgeResponse?.data?.bridge?.id // in case setup bridge fails, the second save bridge attemps needs to be done as update since we already have a bridge id\n\n // when createNewBridgeResponse returns success we need to call the bridge setup endpoint\n useEffect(() => {\n const bridgeId = createdBridgeId || updatedBridgeId\n if (bridgeId) {\n setupBridge({ bridgeId })\n }\n }, [createdBridgeId, updatedBridgeId])\n\n // when setup bridge is completed we can redirect the user to next step\n useEffect(() => {\n if (bridgeSetupResponse && createdBridgeId) {\n history.push(appRoutes.nbeeStep2.makeUrl(createdBridgeId.toString()))\n }\n }, [bridgeSetupResponse])\n\n // in case of error we notify the user\n useEffect(() => {\n if (apiError) {\n const parsedError = parseApiError(apiError)\n dispatch(\n sendToast({\n title: 'Error',\n message: parsedError.message,\n color: 'negative',\n })\n )\n\n if (bridgeFormikProps) {\n bridgeFormikProps.formikHelpers.setSubmitting(false)\n\n trackEvent({\n eventName: 'UnexpectedErrorThrown',\n feature: 'NBEE',\n step: 'Apps',\n params: {\n ...makeNbeeTrackingParams(bridgeFormikProps.formValues),\n custom: {\n errorCode: parsedError.code,\n errorDescription: parsedError.message,\n },\n },\n sendEventToIntercom: true,\n })\n }\n }\n }, [apiError])\n\n return isLoadingBridgeTemplate || isLoadingUserModules ? (\n \n ) : (\n <>\n \n {\n const newBridgeData = transformBridgeFormValuesToApiSaveBridgeBody(\n formValues,\n { step: 1 }\n )\n // we store all formik handlers in order to access them in the component scope\n setBridgeFormikProps({ formValues, formikHelpers })\n\n // The first time we call the create (save) new bridge endpoint and in case of success the setup bridge will be called right after (check useEffect -> setupBridge)\n // If setup bridge fails, the user will need to edit the bridge configuration and the second save attemp needs to be done by calling the update bridge endpoint\n if (!createdBridgeId) {\n createNewBridge(newBridgeData)\n } else {\n updateBridge({\n bridgeData: newBridgeData,\n bridgeId: `${createdBridgeId}`,\n })\n }\n }}\n />\n \n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { SimpleBridgeBuilderForm } from '@features/nbee/SimpleBridgeBuilderForm'\nimport { useGetBridgeById } from '@app/api/getBridgeById'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { useUpdateBridge } from '@app/api/updateBridge'\nimport { transformBridgeFormValuesToApiSaveBridgeBody } from '@app/api/utils/bridge'\nimport { appRoutes } from '@app/routes'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { parseApiError } from '@app/api/utils/error'\nimport { sendToast } from '@app/store/actions/ApplicationConfigurationActions'\nimport { LoadingStep } from '@features/nbee/LoadingStep'\nimport { NbeeError } from '@features/nbee/NbeeError'\nimport { trackEvent } from '@app/dataTracking'\nimport { makeNbeeTrackingParams } from '@app/dataTracking/utils'\nimport { useSetupBridgeById } from '@app/api/postSetupBridge'\nimport { FormikHelpers } from 'formik'\nimport { BridgeFormValues } from 'Nbee'\nimport { useFetchAllApps } from '@app/api/getAllApps'\nimport { useGetUserInfo } from '@app/api/getUserInfo'\nimport { useGetUserModules } from '@app/api/getUserModules'\n\nexport const Step1Edit: React.FC = () => {\n const { bridgeId }: { bridgeId: string } = useParams()\n const history = useHistory()\n const dispatch = useAppDispatch()\n const [bridgeFormikProps, setBridgeFormikProps] = useState<{\n formValues: BridgeFormValues\n formikHelpers: FormikHelpers\n } | null>(null)\n\n const {\n data: allApps,\n isLoading: isLoadingApps,\n error: allAppsApiError,\n } = useFetchAllApps()\n\n const {\n data: bridgeFormValues,\n isLoading: isLoadingBridge,\n error: bridgeApiError,\n } = useGetBridgeById(bridgeId)\n\n const {\n data: user,\n isLoading: isLoadingUser,\n error: userError,\n } = useGetUserInfo()\n\n const {\n data: userModulesResponse,\n isLoading: isLoadingUserModules,\n error: apiUserModulesError,\n } = useGetUserModules()\n const userModules = userModulesResponse?.modules || []\n const emailReceiptUserModule = userModules.find(\n (m) => m.id === 'email-receipt'\n )\n\n const apiInitialDataError = allAppsApiError || bridgeApiError\n\n // Update bridge\n const {\n mutate: updateBridge,\n data: updateBridgeResponse,\n error: updateBridgeError,\n isLoading: isUpdatingBridge,\n } = useUpdateBridge()\n\n // Setup bridge\n const {\n mutate: setupBridge,\n data: bridgeSetupResponse,\n error: bridgeSetupApiError,\n isLoading: isSettingUpBridge,\n } = useSetupBridgeById()\n\n const isSavingApi = isSettingUpBridge || isUpdatingBridge\n const apiError = bridgeSetupApiError || updateBridgeError\n const updatedBridgeId = updateBridgeResponse?.data?.bridge?.id\n\n useEffect(() => {\n if (updatedBridgeId) {\n setupBridge({ bridgeId: updatedBridgeId })\n }\n }, [updatedBridgeId])\n\n // when setup bridge is completed we can redirect the user to next step\n useEffect(() => {\n if (bridgeSetupResponse) {\n history.push(appRoutes.nbeeStep2.makeUrl(bridgeId))\n }\n }, [bridgeSetupResponse])\n\n // if error we notify the user\n useEffect(() => {\n if (apiError) {\n const parsedError = parseApiError(apiError)\n dispatch(\n sendToast({\n title: 'Error',\n message: parsedError.message,\n color: 'negative',\n })\n )\n\n if (bridgeFormikProps) {\n bridgeFormikProps.formikHelpers.setSubmitting(false)\n\n trackEvent({\n eventName: 'UnexpectedErrorThrown',\n feature: 'NBEE',\n step: 'Apps',\n params: {\n ...makeNbeeTrackingParams(bridgeFormikProps.formValues),\n custom: {\n errorCode: parsedError.code,\n errorDescription: parsedError.message,\n },\n },\n sendEventToIntercom: true,\n })\n }\n }\n }, [apiError])\n\n return isLoadingBridge || isLoadingApps ? (\n \n ) : bridgeFormValues && allApps ? (\n {\n const updateBridgeData = transformBridgeFormValuesToApiSaveBridgeBody(\n formValues,\n { step: 1 }\n )\n\n // we store all formik handlers in order to access them in the component scope\n setBridgeFormikProps({ formValues, formikHelpers })\n\n updateBridge({\n bridgeData: updateBridgeData,\n bridgeId,\n })\n }}\n />\n ) : apiInitialDataError ? (\n \n ) : null\n}\n","import React, { useEffect, useState } from 'react'\nimport { FieldsMappingForm } from '@features/nbee/FieldsMappingForm'\nimport { LoadingStep } from '@features/nbee/LoadingStep'\nimport { transformBridgeFormValuesToApiSaveBridgeBody } from '@app/api/utils/bridge'\nimport { NbeeError } from '@features/nbee/NbeeError'\nimport { parseApiError } from '@app/api/utils/error'\nimport { useGetBridgeById } from '@app/api/getBridgeById'\nimport { useUpdateBridge } from '@app/api/updateBridge'\nimport { useHistory, useParams } from 'react-router-dom'\nimport { useGetBridgeAllFields } from '@app/api/getBridgeAllFields'\nimport {\n makeFieldsMappingInitialValuesAndListNotMatchingFields,\n FieldMappingMatched,\n useNotifyUserOfMissingMappedFields,\n} from '@features/nbee/FieldsMappingForm/initialStateUtils'\nimport { useAppDispatch } from '@app/store/hooks'\nimport { sendAlertMessage } from '@app/store/actions/ApplicationConfigurationActions'\nimport { appRoutes } from '@app/routes'\nimport { NbeeStepCompletedState } from '@app/pages/Nbee/Step3'\nimport { usePublishBridge } from '@app/api/publishBridge'\nimport { FormikHelpers } from 'formik'\nimport { BridgeFormValues } from 'Nbee'\nimport { Button } from '@components/Basic/Button'\nimport { useTranslation } from 'react-i18next'\nimport { trackEvent } from '@app/dataTracking'\nimport { makeNbeeTrackingParams } from '@app/dataTracking/utils'\nimport { useGetUserInfo } from '@app/api/getUserInfo'\nimport { useGetBridgeAvailablePermissionChecks } from '@app/api/getBridgeAvailablePermissionChecks'\nimport { useRunBridgePermissionChecks } from '@app/api/postRunBridgePermissionChecks'\nimport { ApiErrorResponse } from 'BackendApi'\nimport { calculateInitialShouldCheckPermissionsState } from '@app/features/nbee/utils'\n\nexport const Step2: React.FC = () => {\n const params: { bridgeId: string } = useParams()\n const bridgeId = parseInt(params.bridgeId, 10)\n\n const dispatch = useAppDispatch()\n const history = useHistory()\n const { t } = useTranslation()\n\n // Each of these hooks handles the fetching, loading state, and error state for each respective API call\n const {\n data: user,\n isLoading: isLoadingUser,\n error: userError,\n } = useGetUserInfo()\n\n const {\n data: bridgeFormValues,\n error: errorGettingBridge,\n refetch: onRefetchBridgeFormValues,\n isLoading: isLoadingBridge,\n isRefetching: isReloadingBridge,\n } = useGetBridgeById(`${bridgeId}`, true)\n\n const {\n data: availablePermissionChecks,\n error: errorGettingAvailablePermissionChecks,\n isLoading: isLoadingAvailablePermissionChecks,\n } = useGetBridgeAvailablePermissionChecks(bridgeId)\n\n const {\n data: allBridgeFields,\n error: allBridgeFieldsError,\n isLoading: loadingAllBridgeFields,\n isRefetching: isReloadingAllBridgeFields,\n } = useGetBridgeAllFields(bridgeId)\n\n // Each of these hooks handles the mutation, loading state, and error state for each respective API call\n const {\n mutate: updateBridge,\n error: updateBridgeError,\n isLoading: isUpdatingBridge,\n } = useUpdateBridge()\n\n const {\n mutate: publishBridge,\n data: publishBridgeResponse,\n error: publishBridgeApiError,\n isLoading: isPublishingBridge,\n } = usePublishBridge()\n\n const {\n mutate: runPermissionChecks,\n error: errorRunningPermissionChecks,\n isLoading: isRunningPermissionChecks,\n } = useRunBridgePermissionChecks()\n\n // prepare data for UI\n // we are not checking `isReloadingAllBridgeFields` here because we want to leave that loading state internal to the form\n // in this way non saved mapping (form state) will not be lost\n const isLoadingAll =\n isLoadingBridge ||\n isReloadingBridge ||\n loadingAllBridgeFields ||\n isLoadingAvailablePermissionChecks ||\n isRunningPermissionChecks\n\n const apiError =\n errorGettingBridge ||\n allBridgeFieldsError ||\n errorGettingAvailablePermissionChecks\n\n const allDataReady = Boolean(\n bridgeFormValues && allBridgeFields && availablePermissionChecks\n )\n\n const showWelcomeMessage =\n !!allBridgeFields?.data?.requiresTemplateBasedFieldsMapping\n\n // we need to know if we should perform permission checks at form submission or not\n const [shouldCheckPermissions, setShouldCheckPermissions] = useState(\n availablePermissionChecks?.shouldCheckPermissions || false\n )\n\n // we want to ensure that the data is ready before we calculate the initial state of shouldCheckPermissions\n useEffect(() => {\n setShouldCheckPermissions(\n calculateInitialShouldCheckPermissionsState(\n availablePermissionChecks || undefined\n )\n )\n }, [availablePermissionChecks])\n\n // every time we receive new bridgeFormValues or new allBridgeFields we create a new fieldMappingMatched state\n const [fieldsMappingMatched, setFieldsMappingMatched] =\n useState(null)\n\n useEffect(() => {\n // we also need to be sure that when we have data ready there is not refetching in action or we will generate\n // a new fieldMappingMatched state with non fresh data\n if (\n bridgeFormValues &&\n allBridgeFields &&\n availablePermissionChecks &&\n !isReloadingBridge &&\n !isReloadingAllBridgeFields\n ) {\n setFieldsMappingMatched(\n makeFieldsMappingInitialValuesAndListNotMatchingFields(\n bridgeFormValues,\n allBridgeFields\n )\n )\n }\n }, [\n availablePermissionChecks,\n bridgeFormValues,\n allBridgeFields,\n isReloadingBridge,\n isReloadingAllBridgeFields,\n ])\n\n // we want to pass down to FieldsMappingForm via props both the existing filter rules and the form initial values\n const bridgeFilterRules = bridgeFormValues?.sourceFilters?.conditions || []\n\n const initialValues = fieldsMappingMatched?.initialValues\n\n // we notify users by displaying an alert message if `fieldsMappingMatched` contains not found fields\n useNotifyUserOfMissingMappedFields(fieldsMappingMatched, bridgeId)\n\n const handleApiError = (\n error: ApiErrorResponse,\n formikValues: BridgeFormValues,\n formikHelpers: FormikHelpers\n ) => {\n formikHelpers.setSubmitting(false)\n const parsedError = parseApiError(error)\n trackEvent({\n eventName: 'UnexpectedErrorThrown',\n feature: 'NBEE',\n step: 'Apps',\n params: {\n ...makeNbeeTrackingParams(formikValues),\n custom: {\n errorCode: parsedError.code,\n errorDescription: parsedError.message,\n },\n },\n sendEventToIntercom: true,\n })\n }\n\n // whenever an error occurs, we want to notify the user on both update bridge, publish bridge and check permissions actions\n useEffect(() => {\n if (\n updateBridgeError ||\n publishBridgeApiError ||\n errorRunningPermissionChecks\n ) {\n const error =\n updateBridgeError ||\n publishBridgeApiError ||\n errorRunningPermissionChecks\n const errorMessage = parseApiError(error!)\n\n if (errorMessage.code === 'bridge-limit-reached' && bridgeFormValues) {\n trackEvent({\n eventName: 'UpgradeButtonShown',\n step: 'Apps',\n feature: 'NBEE',\n params: {\n ...makeNbeeTrackingParams(bridgeFormValues),\n },\n })\n }\n\n dispatch(\n sendAlertMessage({\n isDismissable: true,\n message: errorMessage.message,\n useTranslation: true,\n buttons:\n errorMessage.code === 'bridge-limit-reached' ? (\n \n \n \n ) : undefined,\n })\n )\n }\n }, [updateBridgeError, publishBridgeApiError, errorRunningPermissionChecks])\n\n // once bridge is updated we can publish it we need to setSubmitting(false)\n // not only on error but also when success but result is false.\n // useEffect below will handle the error displaying or the redirection in case of success\n const handlePublishBridge = (\n formikValues: BridgeFormValues,\n formikHelpers: FormikHelpers\n ) => {\n publishBridge(\n { bridgeId },\n {\n onError: (apiError) => {\n formikHelpers.setSubmitting(false)\n const parsedError = parseApiError(apiError)\n trackEvent({\n eventName: 'UnexpectedErrorThrown',\n feature: 'NBEE',\n step: 'Apps',\n params: {\n ...makeNbeeTrackingParams(formikValues),\n custom: {\n errorCode: parsedError.code,\n errorDescription: parsedError.message,\n },\n },\n sendEventToIntercom: true,\n })\n },\n onSuccess: (response) => {\n if (response.data?.result === false) {\n formikHelpers.setSubmitting(false)\n } else {\n // track event on real publish success\n trackEvent({\n eventName: 'BridgePublished',\n feature: 'NBEE',\n step: 'Publish',\n params: {\n ...makeNbeeTrackingParams(formikValues),\n },\n sendEventToIntercom: Boolean(formikValues?.source.appId === 370), // only send to intercom if source is Facebook Lead Ads\n })\n }\n },\n }\n )\n }\n\n const handleUpdateBridgeSuccess = (\n formikValues: BridgeFormValues,\n formikHelpers: FormikHelpers\n ) => {\n if (shouldCheckPermissions) {\n runPermissionChecks(\n {\n bridgeId,\n permissionChecklist:\n availablePermissionChecks?.data.permissionChecklist || [],\n },\n {\n // both onSuccess and onError, we want to not process the permission checks anymore during this session\n onSuccess: () => {\n // if all permission checks are ok, we can publish the bridge\n setShouldCheckPermissions(false)\n handlePublishBridge(formikValues, formikHelpers)\n },\n onError: (error) => {\n // if one of the permission checks fails, we want to display the error to the user and stop the flow once\n setShouldCheckPermissions(false)\n handleApiError(error, formikValues, formikHelpers)\n },\n }\n )\n } else {\n handlePublishBridge(formikValues, formikHelpers)\n }\n }\n\n // when bridge is published we check the status and is 200\n const publishedBridgeReponse = publishBridgeResponse?.data\n const isUserPro = user?.pricing.cbPlanId.split('_')[0] === 'pro'\n\n useEffect(() => {\n if (publishedBridgeReponse && publishedBridgeReponse.result) {\n // bridge has been published, we can redirect the user\n const firstBridge = publishedBridgeReponse.firstBridge && isUserPro\n const step3State: NbeeStepCompletedState = { success: true, firstBridge }\n history.push(appRoutes.nbeeStep3.makeUrl(bridgeId.toString()), step3State)\n }\n }, [publishedBridgeReponse])\n\n return apiError ? (\n \n ) : isLoadingAll || !fieldsMappingMatched ? (\n \n ) : allDataReady && initialValues && allBridgeFields ? (\n {\n const updateBridgeData = transformBridgeFormValuesToApiSaveBridgeBody(\n formValues,\n { step: 2 }\n )\n updateBridge(\n {\n bridgeData: updateBridgeData,\n bridgeId: `${bridgeId}`,\n },\n {\n onSuccess: () =>\n handleUpdateBridgeSuccess(formValues, formikHelpers),\n onError: (error) =>\n handleApiError(error, formValues, formikHelpers),\n }\n )\n }}\n />\n ) : null\n}\n","import React from 'react'\nimport { StepCompleted } from '@features/nbee/StepCompleted'\nimport { useLocation, useParams } from 'react-router-dom'\nimport { useGetBridgeById } from '@app/api/getBridgeById'\nimport { LoadingStep } from '@features/nbee/LoadingStep'\nimport { NbeeError } from '@features/nbee/NbeeError'\nimport { parseApiError } from '@app/api/utils/error'\nimport { useFetchConnectedApps } from '@app/api/getConnectedApps'\nimport { useGetRedirectUriBySourceAndDestination } from '@app/api/getRedirectUriBySourceAndDestination'\n\nexport type NbeeStepCompletedState = {\n success: boolean\n firstBridge?: boolean\n}\n\nexport const Step3: React.VFC = () => {\n const { bridgeId }: { bridgeId: string } = useParams()\n const { state } = useLocation()\n\n const {\n data: bridgeFormValues,\n isLoading: isLoadingBridge,\n error: errorGettingBridge,\n } = useGetBridgeById(bridgeId)\n\n // we need for app full names\n const { data: connectedApps, isLoading: isLoadingConnectedApps } =\n useFetchConnectedApps()\n\n // if (!state?.success) {\n // // we are not allowing user seeing this page without coming from a step2\n // // where set the location state `success` as true\n // return \n // }\n\n const sourceId = bridgeFormValues?.source.appId\n const destinationId = bridgeFormValues?.destination.appId\n const sourceAppName = sourceId\n ? (connectedApps || []).find(({ id }) => id === sourceId)?.name\n : undefined\n const destinationAppName = sourceId\n ? (connectedApps || []).find(({ id }) => id === destinationId)?.name\n : undefined\n\n const IsTestEnableProp = bridgeFormValues?.ui?.testEnabled\n\n const { data: redirectUri, isLoading: isLoadingBridgeUri } =\n useGetRedirectUriBySourceAndDestination(sourceId, destinationId)\n\n const isLoadingAll =\n isLoadingBridge || isLoadingConnectedApps || isLoadingBridgeUri\n\n return isLoadingAll ? (\n \n ) : bridgeFormValues && connectedApps && redirectUri ? (\n \n ) : errorGettingBridge ? (\n \n ) : null\n}\n","import React from 'react'\n\nconst Page404: React.FC = () => {\n return
404
\n}\n\nexport default Page404\n","import React, { useEffect, useState } from 'react'\nimport { Dimmer, Loader, Segment } from 'semantic-ui-react'\nimport QueryString from 'querystring'\nimport axios from 'axios'\nimport { Auth } from 'aws-amplify'\nimport AuthService from '../services/AuthService'\nimport { Link } from 'react-router-dom'\n\nconst SamlRedirect: React.FC = () => {\n const [loading, setLoading] = useState(true)\n const [loginError, setLoginError] = useState('')\n\n useEffect(() => {\n const handleSamlLogin = async () => {\n const params = QueryString.parse(window.location.search.slice(1))\n const samlProvider = sessionStorage.getItem('saml-provider')\n\n if (!params.code || !samlProvider) {\n setLoginError('Missing code or provider name')\n return\n }\n\n const redirect_uri = `${process.env.REACT_APP_SAML_REDIRECT_URL}`\n const body = new URLSearchParams()\n body.append('grant_type', 'authorization_code')\n body.append('client_id', process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID!)\n body.append('redirect_uri', redirect_uri)\n body.append('code', params.code.toString())\n\n try {\n // checking if user exists in cognito\n const responseCognito = await axios.post<{ access_token: string }>(\n `${process.env.REACT_APP_COGNITO_URL}.amazoncognito.com/oauth2/token`,\n body,\n {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n }\n )\n const accessToken = responseCognito.data.access_token\n if (!accessToken) {\n setLoginError('Missing access token from cognito oauth2')\n return\n }\n\n // login user in our backend\n const responseHandleSamlUser = await axios.post<{\n username: string\n password: string\n }>(\n process.env.REACT_APP_V1_API + '/auth/v2/handleSamlUser',\n {\n provider: samlProvider,\n },\n {\n headers: { access_token: accessToken },\n }\n )\n const { username, password } = responseHandleSamlUser.data\n if (!username || !password) {\n setLoginError('We could not find your user in our system')\n return\n }\n\n const signInResponse = await Auth.signIn({\n username,\n password,\n validationData: [],\n })\n\n // setting cookies and other login stuff\n if (signInResponse) {\n AuthService.onLogin(false)\n // we give some time to onLogin, before redirecting user to app\n setTimeout(() => {\n window.location.replace(process.env.REACT_APP_V1_URL || '/')\n }, 500)\n } else {\n setLoginError(\n 'Login failed: we could validate your SAML session, but it seems we failed to create a valid session for your user'\n )\n return\n }\n } catch (err) {\n if (axios.isAxiosError(err)) {\n const message = err.response?.data?.message || err.message\n setLoginError(message)\n } else if (err instanceof Error) {\n setLoginError(err.message)\n }\n }\n }\n\n handleSamlLogin()\n }, [])\n\n useEffect(() => {\n if (loginError) {\n setLoading(false)\n }\n }, [loginError])\n\n return (\n
\n {loading ? (\n \n \n Loading\n \n \n ) : (\n
\n {/* TODO: add valid UI */}\n \n
\n {loginError}\n
\n {/*

SAML authentication failed

*/}\n Login again\n
\n )}\n
\n )\n}\n\nexport default SamlRedirect\n// https://localhost/auth/redirect?code=35a1770f-3369-4af7-818e-4fc73628e54c\n","import React from 'react'\nimport {\n MultiCreatableCustom,\n SelectValueMulti,\n} from '@components/Form/MultiCreatableCustom'\nimport { MappedField } from 'Nbee'\nexport const TestComponents: React.FC = () => {\n const isProduction = process.env.NODE_ENV !== 'development'\n if (isProduction) {\n // prevent this page to appear in production :) test\n return null\n }\n\n const mockedSourceOptions: SelectValueMulti[] = [\n {\n value: '2022-02-02____Cell R1C30',\n label: '2022-02-02 ›› creationDate',\n fieldType: 'source',\n },\n {\n value: '2022-02-02____Cell R1C29',\n label: '2022-02-02 ›› leads.bothEarsHearingLoss',\n fieldType: 'source',\n },\n {\n value: '2022-02-02____Cell R1C3',\n label: '2022-02-02 ›› leads.city',\n fieldType: 'source',\n },\n {\n value: '2022-02-02____Cell R1C6',\n label: '2022-02-02 ›› leads.country',\n fieldType: 'source',\n },\n ]\n\n const mockedPicklistOptions: SelectValueMulti[] = [\n {\n value: '0',\n label: 'NO',\n fieldType: 'custom',\n },\n {\n value: '1',\n label: 'YES',\n fieldType: 'custom',\n },\n ]\n\n const mockedMappedField: MappedField = {\n destinationFieldId: 'opt_out',\n mappingType: 'manual',\n destinationText: '',\n destinationFieldLabel: 'Opt Out',\n isRequired: false,\n testLeadValue: '',\n picklist: [\n {\n id: '0',\n text: 'NO',\n },\n {\n id: '1',\n text: 'YES',\n },\n ],\n mapping: [],\n }\n\n return (\n
\n null}\n />\n
\n )\n}\n","import { BbuRouteParams, BridgeChooserStep2RouteParams } from 'LeadsBridgeApp'\n\nconst nbeeBasePath = 'nbee'\n\nexport default {\n nbee: {\n path: `/${nbeeBasePath}`,\n makeUrl: () => `/${nbeeBasePath}`,\n },\n nbeeBridgeChooserStep1: {\n path: `/${nbeeBasePath}/bridge`,\n makeUrl: () => `/${nbeeBasePath}/bridge`,\n },\n nbeeBridgeChooserStep2: {\n path: `/${nbeeBasePath}/bridge/select-editor/:sourceAppId/:destinationAppId`,\n makeUrl: ({\n sourceAppId,\n destinationAppId,\n }: BridgeChooserStep2RouteParams) =>\n `/${nbeeBasePath}/bridge/select-editor/${sourceAppId}/${destinationAppId}`,\n },\n nbeeStep1New: {\n path: `/${nbeeBasePath}/bridge/new`,\n makeUrl: () => `/${nbeeBasePath}/bridge/new`,\n },\n nbeeAppBbu: {\n path: `/bc/app/:source/:destination`,\n makeUrl: ({ source, destination }: BbuRouteParams) =>\n `/bc/app/${source}/${destination}`,\n },\n nbeeStep1Edit: {\n path: `/${nbeeBasePath}/bridge/edit/:bridgeId`,\n makeUrl: (bridgeId: string) => `/${nbeeBasePath}/bridge/edit/${bridgeId}`,\n },\n nbeeStep2: {\n path: `/${nbeeBasePath}/bridge/fields-mapping/:bridgeId`,\n makeUrl: (bridgeId: string) =>\n `/${nbeeBasePath}/bridge/fields-mapping/${bridgeId}`,\n },\n nbeeStep3: {\n path: `/${nbeeBasePath}/bridge/status/:bridgeId`,\n makeUrl: (bridgeId: string) => `/${nbeeBasePath}/bridge/status/${bridgeId}`,\n },\n nbeeInfoPage: {\n path: `/${nbeeBasePath}/bridge/status/info`,\n makeUrl: () => `/${nbeeBasePath}/bridge/status/info`,\n },\n}\n","import {\n IncomingDataParams,\n IntegrationCredentialEditParams,\n IntegrationCredentialParams,\n} from 'LeadsBridgeApp'\n\nconst integrationPath = 'integration'\n\nexport default {\n integration: {\n path: `/${integrationPath}`,\n makeUrl: ({ appId }: IntegrationCredentialParams) =>\n `/${integrationPath}/credentials/${appId}/new`,\n },\n integrationAuthScreen: {\n path: `/${integrationPath}/credentials/:appId/new`,\n makeUrl: ({ appId }: IntegrationCredentialParams) =>\n `/${integrationPath}/credentials/${appId}/new`,\n },\n integrationAuthScreenEdit: {\n path: `/${integrationPath}/credentials/:appId/edit/:integrationId`,\n makeUrl: ({ integrationId, appId }: IntegrationCredentialEditParams) =>\n `/${integrationPath}/credentials/${appId}/edit/${integrationId}`,\n },\n integrationAuthScreenEditWithBridgeId: {\n path: `/${integrationPath}/credentials/:appId/edit/:integrationId/bridge/:bridgeId`,\n makeUrl: ({\n integrationId,\n appId,\n bridgeId,\n }: IntegrationCredentialEditParams) =>\n `/${integrationPath}/credentials/${appId}/edit/${integrationId}/bridge/${bridgeId}`,\n },\n integrationAuthScreenEditStep2: {\n path: `/${integrationPath}/credentials/:appId/edit/:integrationId/save`,\n makeUrl: ({ integrationId, appId }: IntegrationCredentialEditParams) =>\n `/${integrationPath}/credentials/${appId}/edit/${integrationId}/save`,\n },\n integrationAuthScreenCallback: {\n path: `/${integrationPath}/oauth/callback`,\n makeUrl: () => `/${integrationPath}/oauth/callback`,\n },\n\n // NEW OAUTH ROUTE\n integrationAuthScreenCallback2: {\n path: `/${integrationPath}/oauth2/callback`,\n makeUrl: () => `/${integrationPath}/oauth2/callback`,\n },\n\n // Incoming data routes\n incomingData: {\n path: `/${integrationPath}/incoming-data`,\n makeUrl: () => `/${integrationPath}/incoming-data`,\n },\n\n incomingDataScreen: {\n path: `/${integrationPath}/incoming-data/:appId/new/:integrationId`,\n makeUrl: ({ appId, integrationId }: IncomingDataParams) =>\n `/${integrationPath}/incoming-data/${appId}/new/${integrationId}`,\n },\n incomingDataScreenEdit: {\n path: `/${integrationPath}/incoming-data/:appId/edit/:integrationId`,\n makeUrl: ({ appId, integrationId }: IncomingDataParams) =>\n `/${integrationPath}/incoming-data/${appId}/edit/${integrationId}`,\n },\n incomingDataScreenFields: {\n path: `/${integrationPath}/incoming-data/:appId/fields/:integrationId?`,\n makeUrl: ({ appId, integrationId }: IncomingDataParams) =>\n `/${integrationPath}/incoming-data/${appId}/fields/${integrationId}?`,\n },\n\n incomingDataScreenSave: {\n path: `/${integrationPath}/incoming-data/:appId/save/:integrationId?`,\n makeUrl: ({ appId, integrationId }: IncomingDataParams) =>\n `/${integrationPath}/incoming-data/${appId}/save/${integrationId}`,\n },\n}\n","import { ThankYouPageState } from '@app/pages/ThankYouPage'\n\nexport default {\n pricing: {\n path: `/pricing`,\n makeUrl: () => `/pricing`,\n makeUrlWithState: (reasonId?: string, minimumPlanRequired?: number) => ({\n pathname: '/pricing/',\n search:\n reasonId && minimumPlanRequired\n ? `reason=${reasonId}&suggestPlan=${minimumPlanRequired}`\n : '',\n }),\n },\n checkout: {\n path: `/checkout`,\n makeUrl: (planId?: string) => `/checkout${planId ? `/?pid=${planId}` : ''}`,\n },\n checkoutThankYouPage: {\n path: `/checkout/success`,\n makeUrl: (state: ThankYouPageState) => ({\n pathname: `/checkout/success`,\n state: state,\n }),\n },\n}\n","export default {\n fbe: {\n path: `/fbe`,\n makeUrl: () => `/fbe`,\n },\n fbeCallback: {\n path: `/fbe/callback`,\n makeUrl: () => `/fbe/callback`,\n },\n fbAppStore: {\n path: `/fbAppStore`,\n makeUrl: () => `/fbAppStore`,\n },\n fbAppStoreDone: {\n path: `/fbAppStore/done`,\n makeUrl: () => `/fbAppStore/done`,\n },\n}\n","export const serializeQueryString = function ({\n obj,\n prefix,\n}: {\n obj: Record\n prefix?: string\n}): string {\n const str = []\n let p\n for (p in obj) {\n // eslint-disable-next-line no-prototype-builtins\n if (obj.hasOwnProperty(p)) {\n const k = prefix ? prefix + '[' + p + ']' : p\n const v = obj[p]\n str.push(\n v !== null && typeof v === 'object'\n ? serializeQueryString({\n obj: v,\n prefix: k,\n })\n : encodeURIComponent(k) + '=' + encodeURIComponent(v)\n )\n }\n }\n return str.join('&')\n}\n","import { BbuRouteParams, LogoutRouteParams } from 'LeadsBridgeApp'\nimport { serializeQueryString } from '@app/utils/seralizeQueryString'\n\nexport const signinBasePath = 'signin'\n\nexport const makeQueryStringForLogout = ({\n redirectTo,\n toastMessage,\n}: LogoutRouteParams) => {\n // prepare path, if `redirectTo` exists or we set empty object\n const path = redirectTo ? { path: redirectTo } : {}\n\n // prepare message object ore return empty one is toast is not passed\n const message =\n toastMessage && toastMessage.message\n ? {\n message: btoa(JSON.stringify(toastMessage)),\n }\n : {}\n\n // we serialize our objects into a query string\n const serializedQs = serializeQueryString({\n obj: {\n ...path,\n ...message,\n },\n })\n return serializedQs ? `?${serializedQs}` : ''\n}\n\nexport default {\n signup: {\n path: `/signup`,\n makeUrl: () => `/signup`,\n },\n signupBbu: {\n path: `/bc/lb/:source/:destination`,\n makeUrl: ({\n source,\n destination,\n }: {\n source: string\n destination: string\n }) => `/bc/lb/${source}/${destination}`,\n },\n signupBbuFallbackSurvey: {\n path: `/signup-survey/:partnerName/:source/:destination`,\n makeUrl: ({ partnerName, source, destination }: BbuRouteParams) =>\n `/signup-survey/${partnerName}/${source}/${destination}`,\n },\n signupPartner: {\n path: `/deals/:partner/:couponCode?`,\n makeUrl: () => `/deals/:partner/:couponCode`,\n },\n signin: {\n path: `/${signinBasePath}`, // --> /signin\n makeUrl: () => `/${signinBasePath}`,\n },\n forgotPassword: {\n path: `/${signinBasePath}/forgotpassword`,\n makeUrl: () => `/${signinBasePath}/forgotpassword`,\n },\n changePassword: {\n path: `/changepassword`,\n makUrl: () => `/changepassword`,\n },\n saml: {\n path: `/${signinBasePath}/saml`,\n makeUrl: () => `/${signinBasePath}/saml`,\n },\n samlRedirect: {\n path: `/auth/redirect`,\n makeUrl: () => `/auth/redirect`,\n },\n logout: {\n path: `/logout`,\n makeUrl: ({ redirectTo, toastMessage }: LogoutRouteParams) => {\n const queryString = makeQueryStringForLogout({ redirectTo, toastMessage })\n return `/logout${queryString ? `?${queryString}` : ''}`\n },\n },\n}\n","import {\n GoogleAdsAccountRouteParams,\n IntegrationCredentialEditParams,\n} from 'LeadsBridgeApp'\n\nexport default {\n googleAdsAccountFormCreate: {\n path: `/google-ads-account/create`,\n makeUrl: () => `/google-ads-account/create`,\n },\n\n googleAdsAccountFormCreated: {\n path: `/google-ads-account/create/:customerId`,\n makeUrl: ({ customerId }: GoogleAdsAccountRouteParams) =>\n `/google-ads-account/create/${customerId}`,\n },\n googleAdsAccountActivate: {\n path: `/google-ads-account/activate`,\n makeUrl: () => `/google-ads-account/activate`,\n },\n googleAdsAccountConnect: {\n path: `/google-ads-account/connect`,\n makeUrl: () => `/google-ads-account/connect`,\n },\n}\n","const adminPath = 'admin-private'\n\nexport default {\n adminPrivateRoot: {\n path: `/${adminPath}`,\n makeUrl: () => `/${adminPath}`,\n },\n adminPrivateValidateFbToken: {\n path: `/${adminPath}/validate-facebook-token`,\n makeUrl: () => `/${adminPath}/validate-facebook-token`,\n },\n}\n","import nbeeRoutes from '@app/routes/byFeature/nbee'\nimport integrationRoutes from '@app/routes/byFeature/integration'\nimport billingRoutes from '@app/routes/byFeature/billing'\nimport bbuRoutes from '@app/routes/byFeature/bbu'\nimport facebookRoutes from '@app/routes/byFeature/facebook'\nimport authRoutes from '@app/routes/byFeature/auth'\nimport googleAdsAccountRoutes from '@app/routes/byFeature/googleAdsAccount'\nimport adminRoutes from '@app/routes/byFeature/admin'\n\n// How to use routes:\n// When patter matching is required (eg: react router ) use appRoutes..path\n// When you need to render the url (eg: , then use the appRoutes..markeUrl()\nexport const appRoutes = {\n ...authRoutes, // signin, signup, saml, etc...\n ...bbuRoutes, // bbu and callbacks\n ...facebookRoutes, // Fbe and AppStore\n ...nbeeRoutes,\n ...googleAdsAccountRoutes, // Google Ads Account Feature\n ...integrationRoutes,\n ...billingRoutes,\n ...adminRoutes,\n}\n\nexport const bridgeBuilderStep1Paths = [\n appRoutes.nbeeStep1New.path,\n appRoutes.nbeeStep1Edit.path,\n appRoutes.nbeeAppBbu.path,\n appRoutes.signupBbu.path,\n]\n\n// this is meant to be used to match path for bbu parter only BBUs.\n// Example /bc/fb or /ebc/fc, but not to be used for /bc/lb/ since /lb/ is not a partner\nexport const bridgeByUrlPartnersPaths = [\n appRoutes.bridgeByUrl.path,\n appRoutes.bridgeByUrlEmbedded.path,\n]\n","import { BbuCallbackRouteParams, BbuRouteParams } from 'LeadsBridgeApp'\n\nexport default {\n bridgeByUrl: {\n path: '/bc/:partnerName/:source?/:destination?',\n makeUrl: ({ partnerName, source, destination }: BbuRouteParams) =>\n `/bc/${partnerName}/${source}/${destination}`,\n },\n bridgeByUrlEmbedded: {\n path: '/ebc/:partnerName/:source?/:destination?',\n makeUrl: ({ partnerName, source, destination }: BbuRouteParams) =>\n `/ebc/${partnerName}/${source}/${destination}`,\n },\n bridgeByUrlCallback: {\n path: '/auth/:partnerFullName/callback',\n makeUrl: ({ partnerFullName }: BbuCallbackRouteParams) =>\n `/auth/${partnerFullName}/callback`,\n },\n}\n","import { axiosInterceptor } from './axiosInterceptor'\nimport axios, { AxiosInstance, AxiosResponse } from 'axios'\nimport { FacebookParameters } from 'LeadsBridgeApp'\n\nexport default class LoginV1Service {\n public static authorizeUrl: string = '/auth/v2/initUser'\n public static handleFbeParametersUrl: string = '/fbe/v2/handleFbeParameters'\n public static setupInstanceUrl: string = '/fbe/v2/setupInstance'\n public static fbeCancelUrl: string = '/fbe/v2/fbeCancel'\n public static evoToken: string = '/auth/v2/evoToken'\n\n static authorize = async (): Promise<{}> => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .post(process.env.REACT_APP_V1_API + LoginV1Service.authorizeUrl, {})\n .then((res: AxiosResponse) => {\n return res.data\n })\n .catch((error) => {\n return null\n })\n })\n }\n\n static facebookParameters = async (\n flowType: string,\n instanceId: string,\n url: string\n ): Promise => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .post(\n process.env.REACT_APP_V1_API + LoginV1Service.handleFbeParametersUrl,\n {\n flowType: flowType,\n instanceId: instanceId,\n requestUri: url,\n }\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n // test deploy\n static setupInstance = async (\n data: Record\n ): Promise<{ callbackPath: string }> => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .post(\n process.env.REACT_APP_V1_API + LoginV1Service.setupInstanceUrl,\n data\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n static fbeCancel = async (data: object): Promise<{}> => {\n return await axiosInterceptor().then((ax: AxiosInstance) => {\n return ax\n .post(process.env.REACT_APP_V1_API + LoginV1Service.fbeCancelUrl, data)\n .then((res: AxiosResponse) => {\n return res.data\n })\n })\n }\n\n static setupSessionCookie = async (\n jwt: string, domain: string\n ): Promise<{ callbackPath: string }> => {\n return await axios.post(process.env.REACT_APP_V1_API + LoginV1Service.evoToken,\n {\n token: jwt,\n domain: domain\n },\n { withCredentials: true })\n .then((res) => {\n return res.data\n }).catch((error) => {\n return null\n })\n }\n\n static cancelSessionCookie = async (domain: string): Promise<{ callbackPath: string }> => {\n return await axios.delete(process.env.REACT_APP_V1_API + LoginV1Service.evoToken, { data: {domain: domain}, withCredentials: true })\n .then((res) => {\n return res.data\n }).catch((error) => {\n return null\n })\n }\n}\n","import * as React from 'react'\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 { doPostMessage, Messages } from '../utils/PostMessages'\nimport { Auth } from 'aws-amplify'\nimport Cookies from 'universal-cookie'\nimport { PersistentCookiesKeys } from '@app/enums/persistentCookiesKeys'\nimport LoginV1Service from '@app/services/ApplicationV1Bridge'\nimport { AppDispatch } from '@app/index'\nimport { setTrackSignIn } from '@app/store/actions/ApplicationConfigurationActions'\n\nconst persistAuthExpiration = () => {\n const date = new Date()\n localStorage.setItem(\n 'auth-expiration',\n String(date.setDate(date.getDate() + 1))\n )\n}\n\nexport default class AuthService {\n static setSessionCookie = async () => {\n await Auth.currentSession().then(async (session: any) => {\n const accessToken = session.getAccessToken()\n const jwt = accessToken.getJwtToken()\n await LoginV1Service.setupSessionCookie(\n jwt,\n process.env.REACT_APP_V1_COOKIE_DOMAIN ?? ''\n )\n })\n }\n\n static onLogin = async (keepMeLogged: boolean, dispatch?: AppDispatch) => {\n const urlPath: string = window.location.pathname\n await AuthService.setSessionCookie()\n // to be safe, every time an user does a login we delete the LB_imp cookie (SB-522)\n const cookies = new Cookies()\n cookies.remove(PersistentCookiesKeys.LbImp, {\n path: '/',\n domain: process.env.REACT_APP_V1_COOKIE_DOMAIN,\n })\n\n if (!keepMeLogged) {\n persistAuthExpiration()\n }\n if (urlPath.includes('/fbAppStore')) {\n doPostMessage(Messages.AppInvoked)\n doPostMessage(Messages.UserLogged)\n }\n Hub.dispatch(UI_AUTH_CHANNEL, {\n event: AUTH_STATE_CHANGE_EVENT,\n message: AuthState.SignedIn,\n data: null,\n })\n if (dispatch) {\n dispatch(setTrackSignIn(true))\n }\n }\n\n static onLoginAsync = async (\n keepMeLogged: boolean,\n dispatch?: AppDispatch\n ) => {\n return await AuthService.setSessionCookie().then(() => {\n if (!keepMeLogged) {\n persistAuthExpiration()\n }\n Hub.dispatch(UI_AUTH_CHANNEL, {\n event: AUTH_STATE_CHANGE_EVENT,\n message: AuthState.SignedIn,\n data: null,\n })\n if (dispatch) {\n dispatch(setTrackSignIn(true))\n }\n })\n }\n}\n","import axios, { AxiosResponse } from 'axios'\n\nexport type CognitoProvider = {\n CreationDate: string\n LastModifiedDate: string\n ProviderName: string\n ProviderType: string\n}\n\nexport default class CognitoApiService {\n public static federatedToCognitoUrl: string =\n '/federated/federatedToCognitoUser'\n\n public static describeIdentityProviderUrl: string =\n '/cognitoAPI/DescribeIdentityProvider'\n\n public static listIdentityProvidersUrl: string =\n '/cognitoAPI/ListIdentityProviders'\n\n static listIdentityProviders = async (): Promise<{\n Providers: CognitoProvider[]\n }> => {\n return await axios\n .get(\n process.env.REACT_APP_LAMBDA_GATEWAY_API +\n CognitoApiService.listIdentityProvidersUrl\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n }\n\n static describeIdentityProvider = async (name: string): Promise => {\n return await axios\n .post(\n process.env.REACT_APP_LAMBDA_GATEWAY_API +\n CognitoApiService.describeIdentityProviderUrl,\n { name: name }\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n }\n\n static federatedToCognito = async (\n token: string,\n provider: 'FACEBOOK' | 'GOOGLE',\n email: string,\n requestUri: string\n ): Promise => {\n return await axios\n .post(\n process.env.REACT_APP_LAMBDA_GATEWAY_API +\n CognitoApiService.federatedToCognitoUrl,\n {\n id_token: token,\n provider: provider,\n email: email,\n requestUri: requestUri,\n }\n )\n .then((res: AxiosResponse) => {\n return res.data\n })\n }\n}\n","import { Auth } from 'aws-amplify'\nimport CognitoApiService from './CognitoApiService'\nimport { sendToast } from '../store/actions/ApplicationConfigurationActions'\nimport AuthService from './AuthService'\n\nexport default class FacebookService {\n static initFB = () => {\n const fb = window.FB\n // @ts-ignore\n // console.log('FB SDK initialized');\n }\n\n static fbAsyncInit = () => {\n // init the fb sdk client\n const fb = window.FB\n fb.init({\n appId: '939660826071336',\n cookie: true,\n xfbml: true,\n version: 'v2.11',\n })\n }\n\n static createScriptFb = () => {\n // load the sdk\n // @ts-ignore\n window.fbAsyncInit = FacebookService.fbAsyncInit\n const script = document.createElement('script')\n script.src = 'https://connect.facebook.net/en_US/sdk.js'\n script.async = true\n script.onload = FacebookService.initFB\n document.body.appendChild(script)\n }\n\n // ASYNC\n // static createScriptFbAsync = () =>\n // new Promise((resolve) => {\n // // load the sdk\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 // FacebookService.fbAsyncInit()\n // resolve(null)\n // }\n // document.body.appendChild(script)\n // })\n\n // ASYNC\n // static getAccessTokenAsync = (): Promise =>\n // new Promise((resolve) => {\n // const fb = window.FB\n // fb.Event.subscribe('auth.authResponseChange', (response) => {\n // console.log('response')\n // const fbAccessToken = response.authResponse?.accessToken\n // if (fbAccessToken) {\n // // if `accessToken` exists we need to pass it to backend api\n // resolve(fbAccessToken)\n // }\n // })\n // })\n\n static getAWSCredentials = async (\n response: any,\n location: any,\n dispatch: any\n ) => {\n return new Promise((resolve, reject) => {\n const { accessToken, expiresIn } = response\n const date = new Date()\n const expires_at = expiresIn * 1000 + date.getTime()\n if (!accessToken) {\n return\n }\n // @ts-ignore\n const fb = window.FB\n // todo account id\n fb.api('/me', { fields: 'name,email' }, async (response: any) => {\n const user = {\n name: response.name,\n email: response.email,\n }\n\n await CognitoApiService.federatedToCognito(\n accessToken,\n 'FACEBOOK',\n user.email,\n window.location.href\n )\n .then((r: any) => {\n const username = user.email\n const password = r.password\n Auth.signIn({\n username,\n password,\n validationData: [],\n }).then((user) => {\n AuthService.onLogin(false, dispatch)\n })\n })\n .catch((err) => {\n // console.log('Err');\n if (err.response.status === 400) {\n dispatch(\n sendToast({\n title: 'Cannot login',\n messages: [\n 'You are registered without a social account. Log in with your account credentials.',\n ],\n color: 'warning',\n })\n )\n reject()\n } else {\n dispatch(\n sendToast({\n title: 'Error',\n messages: [\n err.response?.data ? err.response.data : 'Unknown error',\n ],\n color: 'negative',\n })\n )\n reject()\n }\n })\n })\n })\n }\n\n static signInWithFacebook = async (location: any, dispatch: any) => {\n return new Promise((resolve, reject) => {\n // @ts-ignore\n const fb = window.FB\n fb.getLoginStatus(async (response: any) => {\n if (response.status === 'connected') {\n // console.log('response status === connected');\n FacebookService.getAWSCredentials(\n response.authResponse,\n location,\n dispatch\n ).finally(() => resolve(true))\n } else {\n // console.log('response status:', response.status);\n await fb.login(\n async (response: any) => {\n if (!response || !response.authResponse) {\n reject()\n return\n }\n // console.log('facebook auth response', response.authResponse);\n FacebookService.getAWSCredentials(\n response.authResponse,\n location,\n dispatch\n ).finally(() => resolve(true))\n },\n {\n // the authorized scopes\n scope: 'public_profile,email',\n }\n )\n }\n })\n })\n }\n}\n","import axios from 'axios'\nimport {\n getCognitoPersistentSession,\n fetchAndPersistCognitoSession,\n} from '@app/services/apiAuthClient/utils'\nimport { appRoutes } from '@app/routes'\nimport { isDebug } from '@app/utils/envUtils'\nimport Cookies from 'universal-cookie'\nimport { PersistentCookiesKeys } from '@app/enums/persistentCookiesKeys'\nimport { matchPath } from 'react-router'\n\nexport const apiAuthClient = axios.create()\n\n// Sign outgoing requests\napiAuthClient.interceptors.request.use(async (config) => {\n // getting cognito session from cache (cookie).\n // If no cache is found, we call cognito sdk endpoints and cache it\n const cognitoSessionData =\n getCognitoPersistentSession() || (await fetchAndPersistCognitoSession())\n\n if (!cognitoSessionData) {\n // something is wrong with cognito session retrival, we can't enhance axios config\n return config\n }\n\n // setting required axios headers\n const { accessToken, deviceKey } = cognitoSessionData\n config.headers.Authorization = `Bearer ${accessToken}`\n config.headers['Content-Type'] = 'application/json'\n config.headers['device-id'] = deviceKey\n config.headers['mapping-version'] = '2'\n\n // https://leadsbridge.atlassian.net/browse/SB-843\n const match = matchPath<{ bridgeId?: string }>(window.location.pathname, {\n path: [\n appRoutes.nbeeStep1Edit.path,\n appRoutes.nbeeStep2.path,\n appRoutes.nbeeStep3.path,\n ],\n exact: true,\n strict: false,\n })\n const bridgeId = match?.params?.bridgeId\n if (bridgeId) {\n config.headers['X-bridge-id'] = bridgeId\n }\n\n // user impersonification (SB-522)\n const cookies = new Cookies()\n const impValue = cookies.get(PersistentCookiesKeys.LbImp)\n if (impValue) {\n config.headers['X-logged-as-Id'] = impValue\n }\n\n return config\n})\n\n// Intercept incoming reponses\napiAuthClient.interceptors.response.use(undefined, (error) => {\n // we might want to log user out from our app in case api returns 401 (unauthorized)\n // I will keep this one disabled in development/debug\n const currentPath = window.location.pathname\n if (error.response?.status === 401) {\n const logoutUrl = `${window.location.origin}${appRoutes.logout.makeUrl({\n redirectTo: currentPath,\n toastMessage: {\n message: \"You've been logged out.\", // This is a placeholder message, it's handled by phrase in the logout page\n type: 'positive',\n },\n })}`\n window.location.assign(logoutUrl)\n }\n\n // return default axios error\n return Promise.reject(error)\n})\n","import axios from 'axios'\n\nexport const apiPublicClient = axios.create()\n\napiPublicClient.interceptors.request.use(async (config) => {\n config.headers['Content-Type'] = 'application/json'\n return config\n})\n","import axios, { AxiosInstance, AxiosRequestConfig } from 'axios'\nimport { Auth } from 'aws-amplify'\nimport Cookies from 'universal-cookie'\nimport { PersistentCookiesKeys } from '@app/enums/persistentCookiesKeys'\n\nconst interceptor = axios.create({\n baseURL: process.env.REACT_APP_V1_API,\n timeout: 60000,\n})\n\nexport const axiosInterceptor = async (): Promise => {\n const { accessToken, expiration } = await Auth.currentSession().then(\n (session) => {\n const expiration = session.getIdToken().getExpiration()\n const accessToken = session.getAccessToken()\n const jwt = accessToken.getJwtToken()\n return { accessToken: jwt, expiration: expiration }\n }\n )\n\n const currentTimeSeconds = Math.round(+new Date() / 1000)\n if (expiration < currentTimeSeconds) {\n // console.log('token expired TODO REFRESH');\n }\n\n const exp: string | null = localStorage.getItem('auth-expiration')\n if (exp) {\n const date = new Date()\n const date2 = Date.parse(exp)\n if (date.getTime() >= date2) {\n localStorage.clear()\n await Auth.signOut()\n return Promise.reject('Session Expired')\n }\n }\n\n const user = await Auth.currentAuthenticatedUser().then((user) => {\n return user\n })\n await user.getCachedDeviceKeyAndPassword()\n\n interceptor.interceptors.request.use(\n (config: AxiosRequestConfig) => {\n config.headers.Authorization = `Bearer ${accessToken}`\n config.headers['Content-Type'] = 'application/json'\n\n // user impersonification (SB-522)\n const cookies = new Cookies()\n const impValue = cookies.get(PersistentCookiesKeys.LbImp)\n if (impValue) {\n config.headers['X-logged-as-Id'] = impValue\n }\n\n return config\n },\n (error) => {\n return Promise.reject(error)\n }\n )\n\n return interceptor\n}\n","import {\n ApplicationConfigurationTypes,\n CLOSE_ALERT_MESSAGE,\n RESET_PATH,\n SEND_ALERT_MESSAGE,\n SEND_TOAST,\n SET_LOGIN_LAYOUT,\n TRIGGER_CONNECT_ACCOUNT_POPUP,\n RESET_TRIGGER_CONNECT_ACCOUNT_POPUP,\n SET_TRACK_SIGNIN,\n SET_PATH,\n TOGGLE_SIDEBAR,\n} from '../types/ApplicationConfigurationTypes'\nimport { Alert, Toast } from 'LeadsBridgeApp'\n\nexport const toggleVerticalSidebar = (): ApplicationConfigurationTypes => {\n return {\n type: TOGGLE_SIDEBAR,\n }\n}\nexport function sendToast(toast: Toast): ApplicationConfigurationTypes {\n return {\n type: SEND_TOAST,\n payload: toast,\n }\n}\nexport function sendAlertMessage(\n alertMessage: Alert\n): ApplicationConfigurationTypes {\n return {\n type: SEND_ALERT_MESSAGE,\n payload: alertMessage,\n }\n}\n\nexport const closeAlertMessage = (): ApplicationConfigurationTypes => {\n return {\n type: CLOSE_ALERT_MESSAGE,\n }\n}\n\nexport const setLoginLayout = (\n source: string\n): ApplicationConfigurationTypes => {\n return {\n type: SET_LOGIN_LAYOUT,\n payload: source,\n }\n}\n\nexport const setTrackSignIn = (\n state: boolean\n): ApplicationConfigurationTypes => {\n return {\n type: SET_TRACK_SIGNIN,\n payload: state,\n }\n}\n\nexport const triggerConnectAccountPopup = (\n integrationId: number\n): ApplicationConfigurationTypes => {\n return {\n type: TRIGGER_CONNECT_ACCOUNT_POPUP,\n payload: integrationId,\n }\n}\n\nexport const resetTriggerConnectAccountPopup =\n (): ApplicationConfigurationTypes => {\n return {\n type: RESET_TRIGGER_CONNECT_ACCOUNT_POPUP,\n }\n }\n\nexport const setPath = (path: string): ApplicationConfigurationTypes => {\n return {\n type: SET_PATH,\n payload: path,\n }\n}\n\nexport const resetPath = (): ApplicationConfigurationTypes => {\n return {\n type: RESET_PATH,\n }\n}\n","import { ApiIntegrationListenerStatus } from '@app/@typings/Api/integration'\nimport {\n IntegrationListenerActionTypes,\n IntegrationListenerState,\n SET_INTEGRATION_LISTENER,\n UNSET_INTEGRATION_LISTENER,\n} from '../types/IntegrationListenerTypes'\nimport { PusherEventData } from '@app/hooks/usePusherChannel'\n\nexport const setIntegrationListenerAction = (\n integrationListener: IntegrationListenerState\n) => {\n return {\n type: SET_INTEGRATION_LISTENER,\n payload: integrationListener.data,\n }\n}\n\nexport const unsetIntegrationListenerAction = () => {\n return {\n type: UNSET_INTEGRATION_LISTENER,\n }\n}\n\nexport const setIntegrationListenerFields = (\n pusherEventData: PusherEventData\n) => {\n return {\n type: 'SET_INTEGRATION_LISTENER_FIELDS',\n payload: pusherEventData,\n }\n}\n\nexport const setIntegrationListenerStatus = (\n status: ApiIntegrationListenerStatus\n): IntegrationListenerActionTypes => {\n return {\n type: 'SET_INTEGRATION_LISTENER_STATUS',\n payload: status,\n }\n}\n","import { AuthState, CognitoUserInterface } from '@aws-amplify/ui-components'\nimport {\n SET_AUTH_STATE,\n UNSET_AUTH_STATE,\n SET_CURRENT_USER,\n UNSET_CURRENT_USER,\n UserTypes,\n} from '../types/UserTypes'\n\nexport const setCurrentUserAction = (user: CognitoUserInterface): UserTypes => {\n return {\n type: SET_CURRENT_USER,\n payload: user,\n }\n}\n\nexport const unsetCurrentUserAction = (): UserTypes => {\n return {\n type: UNSET_CURRENT_USER,\n }\n}\n\nexport const setAuthStateAction = (authState: AuthState): UserTypes => {\n return {\n type: SET_AUTH_STATE,\n payload: authState,\n }\n}\n\nexport const unsetAuthStateAction = (): UserTypes => {\n return {\n type: UNSET_AUTH_STATE,\n }\n}\n","import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'\nimport { AppDispatch, RootState } from '../index'\n\n// Use throughout your app instead of plain `useDispatch` and `useSelector`\nexport const useAppDispatch = () => useDispatch()\nexport const useAppSelector: TypedUseSelectorHook = useSelector\n","import { createReducer } from '@reduxjs/toolkit'\nimport {\n ApplicationConfigurationState,\n SEND_TOAST,\n SEND_ALERT_MESSAGE,\n TOGGLE_SIDEBAR,\n SET_LOGIN_LAYOUT,\n CLOSE_ALERT_MESSAGE,\n SET_PATH,\n RESET_PATH,\n TRIGGER_CONNECT_ACCOUNT_POPUP,\n RESET_TRIGGER_CONNECT_ACCOUNT_POPUP,\n SET_TRACK_SIGNIN,\n} from '../types/ApplicationConfigurationTypes'\n\nconst initialState: ApplicationConfigurationState = {\n displayVerticalSidebar: false,\n toast: null,\n alert: null,\n user: undefined,\n loginLayout: null,\n path: null,\n trackSignIn: false,\n integrationId: null,\n}\n\nexport const ApplicationConfigurationReducer = createReducer(\n initialState,\n (builder) => {\n builder\n .addCase(\n TOGGLE_SIDEBAR,\n (state: ApplicationConfigurationState, action: any) => {\n state.displayVerticalSidebar = !state.displayVerticalSidebar\n }\n )\n .addCase(\n SEND_TOAST,\n (state: ApplicationConfigurationState, action: any) => {\n state.toast = action.payload\n }\n )\n .addCase(\n SEND_ALERT_MESSAGE,\n (state: ApplicationConfigurationState, action: any) => {\n state.alert = action.payload\n }\n )\n .addCase(\n CLOSE_ALERT_MESSAGE,\n (state: ApplicationConfigurationState, action: any) => {\n state.alert = null\n }\n )\n .addCase(\n SET_LOGIN_LAYOUT,\n (state: ApplicationConfigurationState, action: any) => {\n state.loginLayout = action.payload\n }\n )\n .addCase(\n SET_PATH,\n (state: ApplicationConfigurationState, action: any) => {\n state.path = action.payload\n }\n )\n .addCase(\n RESET_PATH,\n (state: ApplicationConfigurationState, action: any) => {\n state.path = null\n }\n )\n .addCase(\n SET_TRACK_SIGNIN,\n (state: ApplicationConfigurationState, action: any) => {\n state.trackSignIn = action.payload\n }\n )\n .addCase(\n TRIGGER_CONNECT_ACCOUNT_POPUP,\n (state: ApplicationConfigurationState, action: any) => {\n state.integrationId = action.payload\n }\n )\n .addCase(\n RESET_TRIGGER_CONNECT_ACCOUNT_POPUP,\n (state: ApplicationConfigurationState, action: any) => {\n state.integrationId = null\n }\n )\n }\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport {\n FbAppStoreState,\n SET_PLATFORM_ID,\n SET_STATUS,\n} from '../types/FbAppStoreTypes'\nimport { AppStoreStatus } from '../../enums/AppStoreStatus'\n\nconst initialState: FbAppStoreState = {\n status: AppStoreStatus.NONE,\n platformId: 0,\n}\n\nexport const FbAppStoreReducer = createReducer(initialState, (builder) => {\n builder\n .addCase(SET_STATUS, (state: FbAppStoreState, action: any) => {\n state.status = action.payload\n })\n .addCase(SET_PLATFORM_ID, (state: FbAppStoreState, action: any) => {\n state.platformId = action.payload\n })\n})\n","import { createReducer } from '@reduxjs/toolkit'\nimport {\n IntegrationListenerState,\n UNSET_INTEGRATION_LISTENER,\n} from '../types/IntegrationListenerTypes'\n\nconst initialState: IntegrationListenerState = {\n data: null,\n}\nexport const IntegrationListenerReducer = createReducer(\n initialState,\n (builder) => {\n builder\n .addCase(\n 'SET_INTEGRATION_LISTENER',\n (state: IntegrationListenerState, action: any) => {\n state.data = action.payload\n }\n )\n .addCase(\n 'SET_INTEGRATION_LISTENER_FIELDS',\n (state: IntegrationListenerState, action: any) => {\n if (state.data && action.payload.data) {\n state.data.fields = [...action.payload.data.recognizedFields]\n }\n }\n )\n .addCase(\n 'SET_INTEGRATION_LISTENER_STATUS',\n (state: IntegrationListenerState, action: any) => {\n if (state.data) {\n state.data.status = action.payload\n }\n }\n )\n .addCase(UNSET_INTEGRATION_LISTENER, () => {\n return initialState\n })\n }\n)\n","import { createReducer } from '@reduxjs/toolkit'\nimport {\n SET_AUTH_STATE,\n SET_CURRENT_USER,\n UNSET_AUTH_STATE,\n UNSET_CURRENT_USER,\n UserState,\n} from '../types/UserTypes'\nimport { AuthState } from '@aws-amplify/ui-components'\n\nconst initialState: UserState = {\n auth: undefined,\n authState: undefined,\n}\n\nexport const UserReducer = createReducer(initialState, (builder) => {\n builder\n .addCase(SET_CURRENT_USER, (state: UserState, action: any) => {\n state.auth = action.payload\n })\n .addCase(UNSET_CURRENT_USER, (state: UserState) => {\n state.auth = undefined\n })\n .addCase(SET_AUTH_STATE, (state: UserState, action: any) => {\n state.authState = action.payload\n })\n .addCase(UNSET_AUTH_STATE, (state: UserState) => {\n state.authState = AuthState.SignIn\n })\n})\n","import { Alert, Toast } from 'LeadsBridgeApp'\nimport { CognitoUserInterface } from '@aws-amplify/ui-components'\n\nexport const TOGGLE_SIDEBAR = 'TOGGLE_SIDEBAR'\nexport const SEND_TOAST = 'SEND_TOAST'\nexport const SEND_ALERT_MESSAGE = 'SEND_ALERT_MESSAGE'\nexport const CLOSE_ALERT_MESSAGE = 'CLOSE_ALERT_MESSAGE'\nexport const SET_LOGIN_LAYOUT = 'SET_LOGIN_LAYOUT'\nexport const SET_PATH = 'SET_PATH'\nexport const RESET_PATH = 'RESET_PATH'\nexport const SET_TRACK_SIGNIN = 'SET_TRACK_SIGNIN'\nexport const TRIGGER_CONNECT_ACCOUNT_POPUP = 'TRIGGER_CONNECT_ACCOUNT_POPUP'\nexport const RESET_TRIGGER_CONNECT_ACCOUNT_POPUP =\n 'RESET_TRIGGER_CONNECT_ACCOUNT_POPUP'\n\ntype LoginLayout = 'generic' | 'partner' | 'bridge-by-url'\n\nexport interface ApplicationConfigurationState {\n displayVerticalSidebar: boolean\n toast: Toast | null\n alert: Alert | null\n user: CognitoUserInterface | undefined\n loginLayout: LoginLayout | null\n trackSignIn: boolean\n integrationId: number | null\n path: string | null\n}\n\ninterface ToggleVerticalSidebar {\n type: typeof TOGGLE_SIDEBAR\n}\n\ninterface SendToast {\n type: typeof SEND_TOAST\n payload: Toast\n}\ninterface SendAlertMessage {\n type: typeof SEND_ALERT_MESSAGE\n payload: Alert\n}\n\ninterface CloseAlertMessage {\n type: typeof CLOSE_ALERT_MESSAGE\n}\ninterface SetLoginLayout {\n type: typeof SET_LOGIN_LAYOUT\n payload: string\n}\n\ninterface SetPath {\n type: typeof SET_PATH\n payload: string\n}\n\ninterface ResetPath {\n type: typeof RESET_PATH\n}\n\ninterface SetTrackSignIn {\n type: typeof SET_TRACK_SIGNIN\n payload: boolean\n}\n\ninterface TriggerConnectAccountPopup {\n type: typeof TRIGGER_CONNECT_ACCOUNT_POPUP\n payload: number\n}\n\ninterface ResetTriggerConnectAccountPopup {\n type: typeof RESET_TRIGGER_CONNECT_ACCOUNT_POPUP\n}\n\nexport type ApplicationConfigurationTypes =\n | ToggleVerticalSidebar\n | SendToast\n | SendAlertMessage\n | SetLoginLayout\n | CloseAlertMessage\n | SetPath\n | ResetPath\n | SetTrackSignIn\n | TriggerConnectAccountPopup\n | ResetTriggerConnectAccountPopup\n","import { AppStoreStatus } from '../../enums/AppStoreStatus'\n\nexport const SET_STATUS = 'SET_STATUS'\nexport const SET_PLATFORM_ID = 'SET_PLATFORM_ID'\n\nexport interface FbAppStoreState {\n status: AppStoreStatus\n platformId: number\n}\n\ninterface SetStatus {\n type: typeof SET_STATUS\n payload: AppStoreStatus\n}\n\ninterface SetPlatformId {\n type: typeof SET_PLATFORM_ID\n payload: number\n}\n\nexport type FbAppStoreTypes = SetStatus | SetPlatformId\n","import {\n ApiIntegrationListener,\n ApiIntegrationListenerField,\n} from '@app/@typings/Api/integration'\n\n// Action types\nexport const SET_INTEGRATION_LISTENER = 'SET_INTEGRATION_LISTENER'\nexport const SET_INTEGRATION_LISTENER_FIELDS = 'SET_INTEGRATION_LISTENER_FIELDS'\nexport const SET_INTEGRATION_LISTENER_STATUS = 'SET_INTEGRATION_LISTENER_STATUS'\nexport const UNSET_INTEGRATION_LISTENER = 'UNSET_INTEGRATION_LISTENER'\n\n// State\nexport type IntegrationListenerState = {\n data: ApiIntegrationListener | null\n}\n\n// Actions\ninterface SetIntegrationListener {\n type: typeof SET_INTEGRATION_LISTENER\n payload: ApiIntegrationListener\n}\n\ninterface SetIntegrationListenerFields {\n type: typeof SET_INTEGRATION_LISTENER_FIELDS\n payload: ApiIntegrationListenerField[]\n}\n\ninterface SetIntegrationListenerStatus {\n type: typeof SET_INTEGRATION_LISTENER_STATUS\n payload: 0 | 1 | 2 | 3\n}\n\n// Combine them into an 'any' union type\nexport type IntegrationListenerActionTypes =\n | SetIntegrationListener\n | SetIntegrationListenerFields\n | SetIntegrationListenerStatus\n","import { AuthState, CognitoUserInterface } from '@aws-amplify/ui-components'\n\nexport const SET_CURRENT_USER = 'SET_CURRENT_USER'\nexport const UNSET_CURRENT_USER = 'UNSET_CURRENT_USER'\nexport const SET_AUTH_STATE = 'SET_AUTH_STATE'\nexport const UNSET_AUTH_STATE = 'UNSET_AUTH_STATE'\n\nexport interface UserState {\n auth: CognitoUserInterface | undefined\n authState: AuthState | undefined\n}\n\ninterface SetCurrentUser {\n type: typeof SET_CURRENT_USER\n payload: CognitoUserInterface\n}\n\ninterface UnsetCurrentUser {\n type: typeof UNSET_CURRENT_USER\n}\ninterface SetAuthState {\n type: typeof SET_AUTH_STATE\n payload: AuthState | undefined\n}\n\ninterface UnsetAuthState {\n type: typeof UNSET_AUTH_STATE\n}\n\nexport type UserTypes =\n | SetCurrentUser\n | UnsetCurrentUser\n | SetAuthState\n | UnsetAuthState\n","import { createGlobalStyle } from 'styled-components'\n\n// !important everywhere!!! We know and we'll get rid of semantic at some point.\n// Until then, this is the only way\n\nexport const SemanticOverwrites = createGlobalStyle`\n html, body {\n font-family: 'Open Sans', sans-serif !important;\n }\n .ui.input.error > input {\n background-color: #FEF5F4 !important;\n border-color: #CC2029 !important;\n color: #9f3a38 !important;\n box-shadow: none !important;\n }\n \n .ui.bulleted.list {\n margin-left: 13px !important;\n }\n \n .ui.bulleted.list .item::before {\n color: #A1A4B1 !important;\n font-size: 22px;\n line-height: 0.36;\n margin-left: -13px !important;\n }\n\n .ui.form .field .prompt.label{\n padding-right: 0;\n padding-left: 0;\n border-color: white !important;\n margin-top: 0;\n }\n .ui.form .field .prompt.label:before{\n content: unset;\n }\n`\n","import { css, createGlobalStyle } from 'styled-components'\n\nexport const sizing = [0, 1, 2, 3, 4, 5]\n\nexport const ClassNameUtils = createGlobalStyle`\n .fitContent{\n max-width: fit-content;\n max-width: max-content;\n }\n\n .text-center{\n text-align: center;\n }\n\n ${sizing.map(\n (index) => css`\n\n .m-${index} {\n margin: ${index}rem;\n }\n \n .mt-${index} {\n margin-top: ${index}rem;\n }\n\n .mb-${index} {\n margin-bottom: ${index}rem;\n }\n\n .ml-${index} {\n margin-left: ${index}rem;\n }\n\n .mr-${index} {\n margin-right: ${index}rem;\n }\n\n .my-${index} {\n margin-top: ${index}rem;\n margin-bottom: ${index}rem;\n }\n\n .mx-${index} {\n margin-left: ${index}rem;\n margin-right: ${index}rem;\n }\n \n // Padding\n \n .p-${index} {\n padding: : ${index}rem;\n }\n \n .pt-${index} {\n padding-top: ${index}rem;\n }\n\n .pb-${index} {\n padding-bottom: ${index}rem;\n }\n\n .pl-${index} {\n padding-left: ${index}rem;\n }\n\n .pr-${index} {\n padding-right: ${index}rem;\n }\n\n .py-${index} {\n padding-top: ${index}rem;\n padding-bottom: ${index}rem;\n }\n\n .px-${index} {\n padding-left: ${index}rem;\n padding-right: ${index}rem;\n }\n `\n )}\n \n \n .divisor-label{\n position: relative;\n }\n .divisor-label > * {\n position: absolute;\n left: 0;\n right: 0;\n text-align: center;\n width: 100%;\n padding: 0 10px;\n background-color: white;\n }\n\n /* do we need this? */\n .list {\n &.unlisted{\n list-style: none;\n padding-left: 0 ;\n }\n \n &.list-even li:nth-child(even),\n &.list-odd li:nth-child(odd) {\n background-color: whitesmoke\n }\n }\n \n [autocomplete=\"off\"]:-webkit-autofill {\n display: none!important;\n }\n\n .flex-row-reverse {\n flex-direction: row-reverse;\n }\n \n .reactTooltipSmall {\n max-width: 40rem;\n }\n\n .reactTooltipFilterIcons {\n padding: 0 1rem !important;\n font-size: .7rem !important;\n }\n\n .customTooltipIcon {\n width: 15rem;\n box-shadow: 0px 4px 10px 0px #808080;\n border-radius: 5px;\n }\n\n .customTooltipInput {\n max-width: 70%;\n box-shadow: 0px 4px 10px 0px #808080;\n border-radius: 5px;\n word-break: break-all;\n }\n \n`\n","import { createGlobalStyle } from 'styled-components'\n\nexport const AnimationsUtils = createGlobalStyle`\n @keyframes rotate360 {\n from {\n transform: rotate(0deg);\n transform-origin: center;\n }\n\n to {\n transform: rotate(360deg);\n transform-origin: center;\n }\n }\n\n @keyframes fillProgressBar {\n from {width: 1%;}\n to {width: 100%;}\n }\n`\n","import { createGlobalStyle } from 'styled-components'\n\n// !important everywhere!!! We know and we'll get rid of semantic at some point.\n// Until then, this is the only way\n\nexport const CommonCss = createGlobalStyle`\n html, body {\n font-family: 'Open Sans', sans-serif !important;\n font-size: 16px!important;\n -webkit-font-smoothing: antialiased;\n box-sizing: border-box;\n }\n \n *, *:before, *:after {\n box-sizing: inherit;\n }\n \n h1, h2, h3, h4, h5 {\n font-family: 'Open Sans', sans-serif !important;\n font-weight: 600;\n }\n \n /* Fix last pass plugin */\n input[autocomplete=\"off\"]:-webkit-autofill{\n display: block !important\n }\n img[id^=\"__lpform_\"]{\n cursor: pointer !important;\n }\n .gtx-trans-icon{\n display: none;\n }\n`\n","import React from 'react'\nimport { SemanticOverwrites } from '@app/styles/modules/SemanticOverwrites.styled'\nimport { ClassNameUtils } from '@app/styles/modules/Utilities.styled'\nimport { AnimationsUtils } from '@app/styles/modules/Animations.styled'\nimport { CommonCss } from '@app/styles/modules/CommonCss.styled'\n\nexport const GlobalAppStyle: React.FC = () => {\n return (\n <>\n \n \n \n \n \n )\n}\n","import {\n css,\n DefaultTheme,\n ThemeProps,\n FlattenInterpolation,\n} from 'styled-components'\n\ntype CustomStyledCss = FlattenInterpolation>\n\n// we consider embeddable everything between this tuple\nconst iframeWidthRange: [number, number] = [768, 800]\n\nconst minWidth = `${iframeWidthRange[0]}px`\nconst maxWidth = `${iframeWidthRange[1]}px`\nconst maxWidthUp = `${iframeWidthRange[1] + 1}px` // 801\n\nexport const mediaIframeOnly = (customCss: CustomStyledCss) => css`\n @media (min-width: ${minWidth}) and (max-width: ${maxWidth}) {\n ${customCss}\n }\n`\n\nexport const mediaIframeUp = (customCss: CustomStyledCss) => css`\n @media (min-width: ${maxWidthUp}) {\n ${customCss}\n }\n`\n","export const defaultTheme = {\n brand: {\n primary: {\n background: '#fd9645',\n color: '#fff',\n boxShadow: '1px 3px 6px 0 rgba(253, 150, 69, 0.3)',\n },\n },\n chips: {\n text: {\n backgroundColor: 'rgba(128,128,128,0.90)',\n closeIconColorHover: 'rgb(206,206,206)',\n backgroundColorHover: 'rgba(128,128,128,1)',\n },\n formula: {\n backgroundColor: 'rgba(40,59,84,0.90)',\n closeIconColorHover: '#dbe7ff',\n backgroundColorHover: 'rgba(40,59,84,1)',\n },\n custom: {\n backgroundColor: 'rgba(65,131,196,0.90)',\n closeIconColorHover: '#d1e8ff',\n backgroundColorHover: 'rgba(65,131,196,1)',\n },\n source: {\n backgroundColor: 'rgba(34,167,240,0.90)',\n closeIconColorHover: '#c9e4fd',\n backgroundColorHover: 'rgba(34,167,240,1)',\n },\n },\n input: {\n default: {\n placeholder: '#808080',\n backgroundColor: '#fff',\n borderColor: 'rgba(34, 36, 38, 0.15)',\n color: 'rgba(0, 0, 0, 0.87)',\n },\n disabled: {\n background: 'rgba(34, 36, 38, 0.03)',\n color: 'rgb(128 128 128)',\n },\n error: {\n backgroundColor: '#fef5f4',\n borderColor: '#cc2029',\n color: 'rgba(0, 0, 0, 0.87)',\n },\n success: {\n backgroundColor: 'rgba(46, 204, 113, 0.1)',\n borderColor: '#0c783a',\n color: 'rgba(0, 0, 0, 0.87)',\n },\n },\n button: {\n facebook: {\n backgroundColor: '#3778ea',\n backgroundColorHover: '#2f6edd',\n color: '#fff',\n },\n tiktok: {\n backgroundColor: '#fe2c55',\n color: '#fff',\n },\n primary: {\n backgroundColor: '#22a7f0',\n backgroundColorHover: '#2987cd',\n color: '#fff',\n },\n secondary: {\n backgroundColor: '#121232',\n backgroundColorHover: '#28304a',\n color: '#fff',\n },\n link: {\n backgroundColor: 'none',\n color: '#3778EA',\n },\n },\n container: {\n medium: '768px',\n large: '1080px',\n extralarge: '1280px',\n },\n font: {\n family: '\"Open Sans\", sans-serif',\n },\n color: {\n primary: '#41a6dc',\n action: '#fd9645',\n link: '#4183c4',\n green: '#2ecc71',\n error: '#cc2029',\n },\n zIndex: {\n modal: 1000,\n panelFooter: 50,\n dropdown: 60,\n overallNotifications: 9999, // for toasts and alerts\n },\n utils: {\n boxShadow:\n 'rgb(0 0 0 / 2%) 0px -4px 6px -1px, rgb(0 0 0 / 4%) 0px -2px 4px -1px',\n },\n}\n\nexport type CustomDefaultTheme = typeof defaultTheme\n","export const Messages = {\n AppInvoked: 'app_invoked',\n UserCreated: 'account_created',\n UserLogged: 'account_logged_in',\n PlatformInvoked: 'platform_invoked',\n PlatformError: 'platform_error',\n PlatformAuthorized: 'platform_authorized',\n PlatformCompleted: 'platform_completed',\n}\n\nexport const doPostMessage = (event: any) => {\n const timestamp = Date.now()\n const message = JSON.stringify({\n timestamp: timestamp,\n event: event,\n })\n window.parent.postMessage(message, '*')\n}\n","const arrayItemSeparator = ','\n\nexport const encodeToBase64 = (value: string | number | boolean | string[]) => {\n const valueToEncode = Array.isArray(value)\n ? value.join(arrayItemSeparator)\n : value\n return window.btoa(unescape(encodeURIComponent(valueToEncode)))\n}\n\n// if original encoded value was an array, we pass `parseArray` as tru\nexport const decodeFromBase64 = (\n encodedValue: string,\n parseArray?: boolean\n) => {\n const decodedValue = decodeURIComponent(escape(window.atob(encodedValue)))\n if (parseArray) {\n // handling array and prevent to not create [''] from []\n return decodedValue === '' ? [] : decodedValue.split(arrayItemSeparator)\n }\n return decodedValue\n}\n","import { CognitoErrorResponse } from 'LeadsBridgeApp'\nimport t from 'public/locales/en-US.json'\n\ntype CognitoErrorCodeI18n = keyof typeof t.cognitoErrors\n\n// Please keep it synched with -> https://leadsbridge.atlassian.net/wiki/spaces/LH/pages/885030923/Custom+mapping+of+Cognito+Responses\nexport const getCustomErrorCognitoMessage = (res: CognitoErrorResponse) => {\n return (\n t.cognitoErrors[res.code as CognitoErrorCodeI18n] ||\n res.message ||\n 'Something is wrong, this is an unexpected error'\n )\n}\n","import Cookies from 'universal-cookie'\n\nconst cookies = new Cookies()\n\nexport const setCookie = (\n name: string,\n value: string,\n days: number = 1\n): void => {\n const oneDay = 24 * 60 * 60\n const maxAge = days ? days * oneDay : oneDay\n cookies.set(name, value, {\n path: '/',\n domain: process.env.REACT_APP_V1_COOKIE_DOMAIN,\n maxAge: maxAge,\n })\n}\n\nexport const getCookie = (name: string): string | undefined => {\n return cookies.get(name)\n}\n\nexport type AffiliateIdDataFromCookies = {\n tapClickId: string | undefined\n tapVisitorId: string | undefined\n}\n\n/**\n * Fetches the Tapfiliate IDs from cookies.\n * @returns An object containing tapClickId and tapVisitorId or undefined if not found.\n */\nexport const getAffiliateIdFromCookies = ():\n | AffiliateIdDataFromCookies\n | undefined => {\n const tapId = getCookie('tap.id')\n const tapVid = getCookie('tap.vid')\n\n if (tapId && tapVid) {\n return {\n tapClickId: tapId,\n tapVisitorId: tapVid,\n }\n }\n}\n","export const isDebug = process.env.WEBPACK_KEEP_CONSOLE_LOGS === 'true'\n","export const sleep = (timeMs: number) =>\n new Promise((resolve) => setTimeout(resolve, timeMs))\n\nexport const openZendeskChat = (zE: any) => {\n zE('webWidget', 'show')\n zE('webWidget', 'open')\n zE('webWidget:on', 'close', function () {\n zE('webWidget', 'hide')\n })\n}\n","export const isInIframe = () => {\n try {\n return window.self !== window.top\n } catch (e) {\n return true\n }\n}\n","// generates random id;\nexport const generateRandomId = () => {\n const labelId = () => {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1)\n }\n // return id of format 'aaaaaaaa'-'aaaa'-'aaaa'-'aaaa'-'aaaaaaaaaaaa'\n return (\n // test deploy\n labelId() +\n labelId() +\n '-' +\n labelId() +\n '-' +\n labelId() +\n '-' +\n labelId() +\n '-' +\n labelId() +\n labelId() +\n labelId()\n )\n}\n","import { BrowserOptions } from '@sentry/react'\n\ntype SentryIgnoreList = Pick<\n BrowserOptions,\n 'ignoreErrors' | 'denyUrls' | 'whitelistUrls'\n>\n\n// Keep ignore list updated as specified here -> https://docs.sentry.io/clients/javascript/tips/\nexport const ignoreList: SentryIgnoreList = {\n // regex should match both https://app.leadsbridge.com and https://staging-app.leadsbridge.com\n whitelistUrls: [/https?:\\/\\/([a-z0-9-]+[.])?leadsbridge\\.com/],\n ignoreErrors: [\n 'top.GLOBALS',\n 'originalCreateNotification',\n 'canvas.contentDocument',\n 'MyApp_RemoveAllHighlights',\n 'http://tt.epicplay.com',\n \"Can't find variable: ZiteReader\",\n 'jigsaw is not defined',\n 'ComboSearch is not defined',\n 'http://loading.retry.widdit.com/',\n 'atomicFindClose',\n 'fb_xd_fragment',\n 'bmi_SafeAddOnload',\n 'EBCallBackMessageReceived',\n 'conduitPage',\n 'Script error.',\n '_avast_submit',\n //\n // custom from LB here...\n 'Pending sign-in attempt already in progress', // internal cognito\n 'consentCookieParser is not defined', // some marketing tracking script injected in page\n 'TypeError: Failed to fetch',\n 'Failed to fetch',\n ],\n denyUrls: [\n /pagead\\/js/i,\n /graph\\.facebook\\.com/i,\n /connect\\.facebook\\.net\\/en_US\\/all\\.js/i,\n /eatdifferent\\.com\\.woopra-ns\\.com/i,\n /static\\.woopra\\.com\\/js\\/woopra\\.js/i,\n /extensions\\//i,\n /^chrome:\\/\\//i,\n /127\\.0\\.0\\.1:4001\\/isrunning/i,\n /webappstoolbarba\\.texthelp\\.com\\//i,\n /metrics\\.itunes\\.apple\\.com\\.edgesuite\\.net\\//i,\n //\n // custom LB here:\n /cdn\\.segment\\.com/i,\n /static\\.woopra\\.com/i,\n /snap\\.licdn\\.com/i,\n ],\n}\n","export default class RegExpLibrary {\n static email: RegExp = new RegExp(\n /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])/\n )\n\n static password: RegExp = new RegExp(\n /^(?=.{9,}$)(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*\\W).*$/\n )\n}\n\nexport const emailValidator = (email: string) => {\n return /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.+[A-Z]{2,12}$/i.test(email)\n}\n","import * as yup from 'yup'\n\n// This is a simple and maybe poor optmized phone validation function\n// We might want to consider to implement a specific library in future in order to replace this\nexport const isValidPhoneNumber = (value: string) => {\n if (!value) {\n return false\n }\n\n // setup\n const firstChar = value.charAt(0)\n const onlyNumbersRegex = /^\\d+$/\n const onlyNumbersAndSpacesRegex = /^(?=.*\\d)[\\d ]+$/\n const minLenght = 4\n const maxLengh = 20\n const valueWithoutWhiteSpaces = value.replace(/ /g, '')\n\n // checking conditions\n const hasValidFirstCharacter =\n firstChar === '+' || onlyNumbersRegex.test(firstChar)\n const hasOnlyNumbersAndSpaces = onlyNumbersAndSpacesRegex.test(\n value.substr(1)\n )\n const isCorrectLenght =\n valueWithoutWhiteSpaces.length > minLenght &&\n valueWithoutWhiteSpaces.length <= maxLengh\n\n // we return true if all conditions are satified\n return hasValidFirstCharacter && hasOnlyNumbersAndSpaces && isCorrectLenght\n}\n","import * as Yup from 'yup'\nimport { isValidPhoneNumber } from '@app/utils/validators/phoneNumber'\n\nexport const yupPhoneNumber = (\n errorMessage = 'Please enter a valid phone number'\n) =>\n Yup.string().test('is-valid-phone', errorMessage, (value) => {\n if (!value) {\n return true\n }\n return isValidPhoneNumber(value)\n })\n\nexport const yupRequiredBoolean = (errorMessage?: string) =>\n Yup.bool()\n .required()\n .oneOf([true], errorMessage || 'This field is required')\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"static/js/\" + chunkId + \".\" + {\"221\":\"8d56f5f22b5852bf8e3c\",\"1125\":\"a96fad535ba5547de058\",\"1455\":\"de5c248c6858f774c765\",\"1852\":\"86e88f793b922b2b3858\",\"8346\":\"bc8155e639bd2d95d48d\",\"9985\":\"5a0ef02d6a6ffce58505\"}[chunkId] + \".chunk.js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.hmd = (module) => {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: () => {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.p = \"/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t2756: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkleadsbridge\"] = self[\"webpackChunkleadsbridge\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\n__webpack_require__.O(undefined, [7405,9715,1101,4592,1968,10,2626,4329,5348,6766,2823,9161,7621,4625,9366,6030,4201,556,9868,8901,8789,1868,8227,5973,7523,7638,1958,4359,3771,3617,4087,1043,9857,5687,9602,9713,1714,1153,5691,7548,8350,6241,6889,9904,5568,4673,7165,4927,8094,2850,1791,2223,6658,225,7219,3061,6680,376], () => (__webpack_require__(37902)))\nvar __webpack_exports__ = __webpack_require__.O(undefined, [7405,9715,1101,4592,1968,10,2626,4329,5348,6766,2823,9161,7621,4625,9366,6030,4201,556,9868,8901,8789,1868,8227,5973,7523,7638,1958,4359,3771,3617,4087,1043,9857,5687,9602,9713,1714,1153,5691,7548,8350,6241,6889,9904,5568,4673,7165,4927,8094,2850,1791,2223,6658,225,7219,3061,6680,376], () => (__webpack_require__(12085)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","inProgress","dataWebpackPrefix","apiBridgeFieldTypes","LangFbAppStore","popupLocked","title","description","helpers","messages","tokenError","useEffect","window","close","FbAppStoreService","getSheetsUrl","getSpreedSheetTabsUrl","getPlatformAuthUrl","doPlatformAuthUrl","generateExternalBusinessIdUrl","saveSheetSelectionUrl","saveSegmentSelectionUrl","getSegmentTypesUrl","segmentUrls","getPlatformCapabilitiesUrl","doPublishBridgesUrl","getSyncDataLinksUrl","getSheets","platformId","axiosInterceptor","then","ax","get","res","data","getSpreadSheetTabs","selectedSheetId","getPlatformAuth","url","doPlatformAuth","fields","post","generateExternalBusinessId","segmentTypes","getSegments","saveSegmentSelection","selectedTabId","segmentType","segmentId","saveSheetSelection","sheetId","tabId","getPlatformCapabilities","doPublishBridges","entities","limitedDataUse","adsDeliveryOptimization","getSyncDataLinks","setOpen","setAPIresponse","state","appStore","loading","setLoading","useState","setFields","helpUrl","setHelpUrl","labels","setLabels","formError","setFormError","subscribed","oauth2RedirectUrl","newObj","Object","keys","authFields","map","key","catch","response","errorCode","finally","Segment","style","border","boxShadow","Dimmer","inverted","active","marginTop","Loader","Form","paddingTop","paddingBottom","method","error","textAlign","alt","src","length","index","label","onChange","e","oldFields","target","value","opacity","href","rel","Label","Icon","name","Button","color","size","fluid","className","onClick","emptyField","values","forEach","r","err","errorMessage","left","screen","width","newWin","open","closed","setTimeout","Message","header","content","FbAppStoreStepper","googleSheet","AppStoreStatus","newType","default","PlatformConfiguration","forwardRef","props","ref","dispatch","type","setType","platformName","setPlatformName","setEntities","checkedEntity","setCheckedEntity","checkedEntities","setCheckedEntities","privacy1","setPrivacy1","privacy2","setPrivacy2","saving","setSaving","loadingEntities","setLoadingEntities","steps","PlatformName","Entities","Header","as","List","divided","relaxed","display","alignItems","padding","newCheckedEntities","keyIndex","indexOf","push","splice","Radio","checked","Checkbox","marginLeft","SourceMappedFields","k","marginBottom","disabled","parsedEntities","filter","el","saveConfiguration","SearchStyled","SpreadSheetSelection","sheetTemplateUrl","setSheetTemplateUrl","documentationTemplateUrl","setDocumentationTemplateUrl","isFilteringSheets","setIsFilteringSheets","sheet","setSheet","setSheetId","results","setResults","isFilteringWorksheets","setIsFilteringWorksheets","worksheet","setWorksheet","searchRef","createRef","worksheetId","setWorksheetId","workResults","setWorkResults","search2Ref","sheets","setSheets","worksheets","setWorksheets","refreshingList","setRefreshingList","nextStep","setNextStep","clickListener","Tabs","segments","onClickEVent","document","getElementsByClassName","removeEventListener","shits","c","icon","labelPosition","id","Search","flex","marginRight","onResultSelect","result","onSearchChange","debounce","dataValue","toString","re","RegExp","escapeRegExp","test","leading","element","current","addEventListener","eventClick","placeholder","eventClickSearch2","filteredResults","justifyContent","margin","displayName","IconSync","IconStepStyled","CardGroupStyled","contactsLink","setContactsLink","eventsLink","setEventsLink","link","setLink","isLoading","setIsLoading","leadsbridgeLink","Confetti","MenuStyled","Menu","children","pointing","secondary","status","Step","step","included","includes","exists","find","s","Image","borderRadius","avatar","APIresponse","setPlatformId","payload","setPlatformIdAction","setStatus","setStatusAction","setSteps","params","location","search","replace","redirectUrl","redirect_uri","urlObject","URL","qs","slice","qsObject","extras","JSON","stringify","doFacebookRedirect","crm_id","parseInt","subscription","Auth","user","listFbAppStoreStatuss","items","API","owner","username","crmId","eq","input","oldStatus","subscribe","next","onUpdateFbAppStoreStatus","console","warn","undefined","unsubscribe","errorObject","Container","maxWidth","Modal","dangerouslySetInnerHTML","__html","warning","item","primary","errorLink","minHeight","getPageComponent","height","useGenericBbuAuth","provider","authCode","requestUri","bbuData","apiError","setApiError","isMountedRef","useRef","userStatus","setUserStatus","authState","canProceedWithNotLoggedInFlow","authCancelRequest","log","cancelToken","token","password","Pricing","localStorage","setItem","validationData","cognitoUser","eventName","feature","custom","planId","cbPlanId","mrr","channel","sourceId","source","sourceName","destinationId","destination","destinationName","sendEventToIntercom","cognitoError","fallbackMessage","cancel","errorDescription","callInProgress","setCallInProgress","setErrorMessage","useRequestUriState","persistentUri","setPersistentUri","usePersisteIsFlowForNbee","persistentIsFlowForNbee","setPersistentIsFlowForNbee","String","pathname","flowType","instanceId","nbee","hasRequiredParams","encodedExtras","encodeURIComponent","backendUrl","origin","parameters","fbAppId","scopes","negative","reload","errorStyle","setErrorStyle","lb_error","lb_error_code","lb_error_description","callback","removeItem","callbackPath","IncomingDataScreen","appId","integrationId","history","integrationListenerData","isGettingIntegrationListener","errorGettingIntegrationListener","mutate","updateIntegrationListener","isUpdatingIntegrationListener","errorUpdatingIntegrationListener","appData","isLoadingApp","errorApiGetApp","isError","isDismissable","message","useTranslation","appLogoUri","logoUriSmall","appName","onContinueRequest","requestBody","onSuccess","IncomingDataScreenFields","isRecognizingFields","setIsRecognizingFields","isConfirmingReload","setIsConfirmingReload","integrationListener","integrationUsage","isGettingIntegrationUsage","integrationFields","refetch","refetchIntegrationFields","activeBridges","totalBridges","action","Array","isArray","onReload","prevState","onContinue","resetConfirmingReload","listenerType","IncomingDataScreenSave","integrationData","isFetchingIntegrationData","integrationDataApiError","updateIntegration","isUpdatingIntegration","integrationUpdateApiError","integrationName","setIntegrationName","onEditIntegrationName","onSave","credentials","newIntegration","Number","onCancel","IntegrationAuthCallback","legacyIntegrationId","instanceType","sessionStorage","getItem","legacyIntegrationError","getIntegrationApiError","oauth","code","position","IntegrationAuthCallback2","postAuthGrantCode","authGrantCodeApiError","authGrantCodeData","paramsFromUrl","URLSearchParams","paramsObject","fromEntries","appIdInt","integrationIdInt","payloadArray","credentialsArray","concat","integration","IntegrationAuthScreen","t","setNewIntegration","appIdNumber","isAboutToClosingModal","setIsAboutToClosingModal","appAuthSchemaResponse","retrieveAuthSchema","isLoadingAppAuthSchema","errorApiAppAuthSchema","saveNewIntegration","isSavingNewIntegration","integrationSaveApiError","savedIntegration","updatedIntegrationData","settings","testIntegrationResults","integrationTestError","isCheckingValidIntegration","isRefetching","isReCheckingValidIntegration","reTestValidIntegration","optimisticIntegrationData","appAuthSchema","isOauthUri","initialValues","isSuccessResponse","isReady","Boolean","trackEventError","formValues","parsedError","parsedTestError","isSavingApi","onSubmit","formikHelpers","setSubmitting","onError","isNotValidIntegrationErrorMessage","IntegrationAuthScreenEdit","bridgeId","isSaveStep","path","exact","strict","existingIntegration","isLoadingExistingIntegration","errorApiGetIntegration","savedIntegrationData","skipParams","isExact","IntegrationAuthVerifiedEmailScreenLegacy","Wrapper","Body","Title","SubTitle","queryStringParam","verifyLinkResponse","verifyLink","verifyLinkLoading","verifyLinkError","IntegrationHome","parsedRedirectUrl","clearPersistentData","cookies","clear","remove","domain","emptyBridge","Date","getTime","emailReceipt","BridgeChooser","sourceAppId","destinationAppId","component","NbeeHome","success","Step1","isModalOpen","setIsModalOpen","loginParams","showSurpriseMessage","currentPlan","lbfsgn","planName","isFirstLogin","newUser","bridgeFormikProps","setBridgeFormikProps","bbuMatchUrl","bbuUri","bridgeTemplateValues","isLoadingBridgeTemplate","urlParsed","parseNumbers","sourceAppIdFromQueryString","destinationAppIdFromQueryString","userModulesResponse","isLoadingUserModules","emailReceiptUserModule","modules","m","emailReceiptDefaults","recipients","subject","makeEmptyBridge","userDefaults","createNewBridge","createNewBridgeResponse","createNewBridgeError","isCreatingNewBridge","updateBridge","updateBridgeResponse","updateBridgeError","isUpdatingBridge","setupBridge","bridgeSetupResponse","bridgeSetupApiError","isSettingUpBridge","createdBridgeId","bridge","updatedBridgeId","activeStepIndex","isOpen","onCloseModal","userData","newBridgeData","bridgeData","Step1Edit","allApps","isLoadingApps","allAppsApiError","bridgeFormValues","isLoadingBridge","bridgeApiError","apiInitialDataError","updateBridgeData","statusCode","Step2","errorGettingBridge","onRefetchBridgeFormValues","isReloadingBridge","availablePermissionChecks","errorGettingAvailablePermissionChecks","isLoadingAvailablePermissionChecks","allBridgeFields","allBridgeFieldsError","loadingAllBridgeFields","isReloadingAllBridgeFields","publishBridge","publishBridgeResponse","publishBridgeApiError","isPublishingBridge","runPermissionChecks","errorRunningPermissionChecks","isRunningPermissionChecks","u","isLoadingAll","allDataReady","showWelcomeMessage","requiresTemplateBasedFieldsMapping","shouldCheckPermissions","setShouldCheckPermissions","fieldsMappingMatched","setFieldsMappingMatched","bridgeFilterRules","sourceFilters","conditions","handleApiError","formikValues","buttons","handlePublishBridge","publishedBridgeReponse","isUserPro","pricing","split","step3State","firstBridge","loadingText","F","bridgeFilterRulesList","permissionChecklist","handleUpdateBridgeSuccess","Step3","connectedApps","isLoadingConnectedApps","sourceAppName","destinationAppName","IsTestEnableProp","ui","testEnabled","redirectUri","isLoadingBridgeUri","S","bridgeName","uri","isTestEnabledProp","loginError","setLoginError","samlProvider","body","append","accessToken","headers","access_token","responseHandleSamlUser","Error","to","TestComponents","makeUrl","nbeeBridgeChooserStep1","nbeeBridgeChooserStep2","nbeeStep1New","nbeeAppBbu","nbeeStep1Edit","nbeeStep2","nbeeStep3","nbeeInfoPage","integrationAuthScreen","integrationAuthScreenEdit","integrationAuthScreenEditWithBridgeId","integrationAuthScreenEditStep2","integrationAuthScreenCallback","integrationAuthScreenCallback2","incomingData","incomingDataScreen","incomingDataScreenEdit","incomingDataScreenFields","incomingDataScreenSave","makeUrlWithState","reasonId","minimumPlanRequired","checkout","checkoutThankYouPage","fbe","fbeCallback","fbAppStore","fbAppStoreDone","serializeQueryString","obj","prefix","str","p","hasOwnProperty","v","join","signup","signupBbu","signupBbuFallbackSurvey","partnerName","signupPartner","signin","forgotPassword","changePassword","makUrl","saml","samlRedirect","logout","redirectTo","toastMessage","queryString","btoa","serializedQs","makeQueryStringForLogout","googleAdsAccountFormCreate","googleAdsAccountFormCreated","customerId","googleAdsAccountActivate","googleAdsAccountConnect","adminPath","adminPrivateRoot","adminPrivateValidateFbToken","appRoutes","auth","bridgeByUrl","bridgeByUrlEmbedded","bridgeByUrlCallback","partnerFullName","facebook","googleAdsAccount","billing","admin","bridgeBuilderStep1Paths","bridgeByUrlPartnersPaths","LoginV1Service","authorizeUrl","handleFbeParametersUrl","setupInstanceUrl","fbeCancelUrl","evoToken","authorize","facebookParameters","setupInstance","fbeCancel","setupSessionCookie","jwt","withCredentials","cancelSessionCookie","persistAuthExpiration","date","setDate","getDate","AuthService","setSessionCookie","session","getAccessToken","getJwtToken","onLogin","keepMeLogged","urlPath","event","onLoginAsync","CognitoApiService","federatedToCognitoUrl","describeIdentityProviderUrl","listIdentityProvidersUrl","listIdentityProviders","describeIdentityProvider","federatedToCognito","email","id_token","FacebookService","initFB","fbAsyncInit","FB","init","cookie","xfbml","version","createScriptFb","script","createElement","async","onload","appendChild","getAWSCredentials","Promise","resolve","reject","expiresIn","api","signInWithFacebook","fb","getLoginStatus","authResponse","login","scope","apiAuthClient","interceptors","request","use","config","cognitoSessionData","deviceKey","Authorization","match","impValue","currentPath","logoutUrl","assign","apiPublicClient","interceptor","baseURL","timeout","expiration","getIdToken","getExpiration","exp","Math","round","date2","parse","getCachedDeviceKeyAndPassword","toggleVerticalSidebar","sendToast","toast","sendAlertMessage","alertMessage","closeAlertMessage","setLoginLayout","setTrackSignIn","triggerConnectAccountPopup","setPath","resetPath","setIntegrationListenerAction","setIntegrationListenerFields","pusherEventData","setIntegrationListenerStatus","setCurrentUserAction","unsetCurrentUserAction","setAuthStateAction","unsetAuthStateAction","useAppDispatch","useAppSelector","ApplicationConfigurationReducer","displayVerticalSidebar","alert","loginLayout","trackSignIn","builder","addCase","FbAppStoreReducer","initialState","IntegrationListenerReducer","recognizedFields","UserReducer","TOGGLE_SIDEBAR","SEND_TOAST","SEND_ALERT_MESSAGE","CLOSE_ALERT_MESSAGE","SET_LOGIN_LAYOUT","SET_PATH","RESET_PATH","SET_TRACK_SIGNIN","TRIGGER_CONNECT_ACCOUNT_POPUP","RESET_TRIGGER_CONNECT_ACCOUNT_POPUP","SET_STATUS","SET_PLATFORM_ID","SET_INTEGRATION_LISTENER","UNSET_INTEGRATION_LISTENER","SET_CURRENT_USER","UNSET_CURRENT_USER","SET_AUTH_STATE","UNSET_AUTH_STATE","SemanticOverwrites","ClassNameUtils","AnimationsUtils","CommonCss","GlobalAppStyle","iframeWidthRange","minWidth","maxWidthUp","mediaIframeOnly","customCss","mediaIframeUp","defaultTheme","brand","background","chips","text","backgroundColor","closeIconColorHover","backgroundColorHover","formula","borderColor","button","tiktok","container","medium","large","extralarge","font","family","green","zIndex","modal","panelFooter","dropdown","overallNotifications","utils","Messages","AppInvoked","UserCreated","UserLogged","PlatformInvoked","PlatformError","PlatformAuthorized","PlatformCompleted","doPostMessage","timestamp","now","parent","postMessage","encodeToBase64","valueToEncode","unescape","getCustomErrorCognitoMessage","setCookie","days","set","maxAge","getCookie","getAffiliateIdFromCookies","tapId","tapVid","tapClickId","tapVisitorId","isDebug","sleep","timeMs","openZendeskChat","zE","isInIframe","self","top","generateRandomId","labelId","floor","random","substring","ignoreList","whitelistUrls","ignoreErrors","denyUrls","RegExpLibrary","emailValidator","yupPhoneNumber","firstChar","charAt","valueWithoutWhiteSpaces","hasValidFirstCharacter","hasOnlyNumbersAndSpaces","substr","isValidPhoneNumber","yupRequiredBoolean","required","oneOf","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","loaded","__webpack_modules__","call","O","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","every","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","f","chunkId","all","reduce","promises","g","globalThis","this","Function","hmd","create","prop","prototype","l","done","needAttach","scripts","getElementsByTagName","getAttribute","charset","nc","setAttribute","onScriptComplete","prev","onerror","clearTimeout","doneFns","parentNode","removeChild","bind","head","Symbol","toStringTag","nmd","paths","installedChunks","installedChunkData","promise","errorType","realSrc","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""}