@tap-payments/auth-jsconnect 1.0.89 → 1.0.93-test

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +86 -135
  2. package/build/@types/app.d.ts +9 -0
  3. package/build/@types/app.js +9 -0
  4. package/build/@types/form.d.ts +2 -0
  5. package/build/api/availabilityServices.d.ts +2 -0
  6. package/build/api/axios.js +1 -2
  7. package/build/api/index.d.ts +2 -2
  8. package/build/api/index.js +2 -2
  9. package/build/app/rootReducer.d.ts +0 -1
  10. package/build/app/rootReducer.js +1 -3
  11. package/build/app/store.d.ts +0 -2
  12. package/build/components/AnimationFlow/BottomSheet.js +1 -1
  13. package/build/components/Button/Button.d.ts +6 -1
  14. package/build/components/Button/Button.js +61 -23
  15. package/build/components/Footer/Footer.d.ts +0 -2
  16. package/build/components/Footer/Footer.js +0 -1
  17. package/build/constants/api.d.ts +3 -1
  18. package/build/constants/api.js +6 -2
  19. package/build/constants/app.d.ts +0 -1
  20. package/build/constants/app.js +0 -8
  21. package/build/features/app/bank/bankStore.d.ts +5 -1
  22. package/build/features/app/bank/bankStore.js +38 -1
  23. package/build/features/app/business/businessStore.d.ts +5 -1
  24. package/build/features/app/business/businessStore.js +40 -5
  25. package/build/features/app/connect/connectStore.d.ts +2 -1
  26. package/build/features/app/connect/connectStore.js +19 -8
  27. package/build/features/app/individual/individualStore.d.ts +5 -1
  28. package/build/features/app/individual/individualStore.js +36 -0
  29. package/build/features/app/password/passwordStore.d.ts +5 -1
  30. package/build/features/app/password/passwordStore.js +37 -1
  31. package/build/features/app/tax/taxStore.d.ts +5 -1
  32. package/build/features/app/tax/taxStore.js +39 -2
  33. package/build/features/bank/Bank.js +9 -4
  34. package/build/features/bank/screens/BankDetails/BankDetails.js +6 -1
  35. package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +3 -0
  36. package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +67 -0
  37. package/build/features/bank/screens/BankDetails/validation.d.ts +3 -0
  38. package/build/features/bank/screens/BankDetails/validation.js +2 -1
  39. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  40. package/build/features/bank/screens/Verify/OTPInput.d.ts +3 -1
  41. package/build/features/bank/screens/Verify/OTPInput.js +6 -1
  42. package/build/features/bank/screens/Verify/Verify.js +3 -2
  43. package/build/features/business/Business.js +9 -4
  44. package/build/features/business/screens/Activities/ActivitiesList.d.ts +1 -1
  45. package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
  46. package/build/features/business/screens/Customers/RefundPolicy.d.ts +1 -1
  47. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -1
  48. package/build/features/business/screens/Verify/OTPInput.d.ts +3 -1
  49. package/build/features/business/screens/Verify/OTPInput.js +6 -1
  50. package/build/features/business/screens/Verify/Verify.js +3 -2
  51. package/build/features/connect/Connect.js +5 -3
  52. package/build/features/connect/screens/Mobile/Mobile.js +1 -1
  53. package/build/features/connect/screens/NID/NID.js +1 -1
  54. package/build/features/featuresScreens.d.ts +0 -1
  55. package/build/features/featuresScreens.js +0 -7
  56. package/build/features/individual/Individual.js +9 -4
  57. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +3 -3
  58. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  59. package/build/features/individual/screens/Verify/OTPInput.d.ts +3 -1
  60. package/build/features/individual/screens/Verify/OTPInput.js +6 -1
  61. package/build/features/individual/screens/Verify/Verify.js +3 -2
  62. package/build/features/password/Password.js +9 -4
  63. package/build/features/password/screens/CreatePassword/CreatePassword.js +5 -1
  64. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  65. package/build/features/password/screens/Verify/OTPInput.d.ts +3 -1
  66. package/build/features/password/screens/Verify/OTPInput.js +6 -1
  67. package/build/features/password/screens/Verify/Verify.js +3 -2
  68. package/build/features/shared/AcceptancePayouts/AcceptancePayouts.js +1 -1
  69. package/build/features/shared/Background/Background.js +3 -3
  70. package/build/features/shared/Background/LogoBackground.js +1 -4
  71. package/build/features/shared/Button/AbsherButton.d.ts +1 -2
  72. package/build/features/shared/Button/AbsherButton.js +5 -32
  73. package/build/features/shared/Button/EmailProvidersButtons.js +13 -48
  74. package/build/features/shared/Button/FlowsButtons.d.ts +4 -1
  75. package/build/features/shared/Button/FlowsButtons.js +51 -46
  76. package/build/features/shared/Button/MobileButton.d.ts +1 -2
  77. package/build/features/shared/Button/MobileButton.js +3 -29
  78. package/build/features/shared/Button/SuccessButton.js +18 -16
  79. package/build/features/shared/Footer/Footer.js +1 -1
  80. package/build/features/shared/OTP/OTP.d.ts +2 -1
  81. package/build/features/shared/OTP/OTP.js +10 -2
  82. package/build/features/tax/Tax.js +9 -4
  83. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  84. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +3 -0
  85. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +66 -0
  86. package/build/features/tax/screens/TaxDetails/TaxDetails.js +9 -2
  87. package/build/features/tax/screens/TaxDetails/VATId.js +13 -2
  88. package/build/features/tax/screens/TaxDetails/validation.d.ts +3 -0
  89. package/build/features/tax/screens/TaxDetails/validation.js +2 -1
  90. package/build/features/tax/screens/Verify/OTPInput.d.ts +3 -1
  91. package/build/features/tax/screens/Verify/OTPInput.js +6 -1
  92. package/build/features/tax/screens/Verify/Verify.js +3 -2
  93. package/build/hooks/index.d.ts +1 -0
  94. package/build/hooks/index.js +1 -0
  95. package/build/hooks/useAppConfig.js +11 -1
  96. package/build/hooks/useAppDispatch.d.ts +0 -1
  97. package/build/hooks/useErrorListener.d.ts +1 -1
  98. package/build/hooks/useErrorListener.js +4 -6
  99. package/build/hooks/useStepStartedListener.d.ts +1 -0
  100. package/build/hooks/useStepStartedListener.js +10 -0
  101. package/build/index.d.ts +2 -3
  102. package/build/index.js +2 -5
  103. package/build/theme/theme.js +10 -0
  104. package/build/utils/locale.js +2 -2
  105. package/build/utils/string.d.ts +3 -1
  106. package/build/utils/string.js +35 -2
  107. package/package.json +127 -126
  108. package/build/features/Landing/Landing.d.ts +0 -7
  109. package/build/features/Landing/Landing.js +0 -55
  110. package/build/features/Landing/index.d.ts +0 -1
  111. package/build/features/Landing/index.js +0 -1
  112. package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.d.ts +0 -5
  113. package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.js +0 -41
  114. package/build/features/Landing/screens/VerifyAndRedirect/index.d.ts +0 -2
  115. package/build/features/Landing/screens/VerifyAndRedirect/index.js +0 -2
  116. package/build/features/app/landing/landingStore.d.ts +0 -22
  117. package/build/features/app/landing/landingStore.js +0 -103
@@ -10,58 +10,71 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import React from 'react';
14
13
  import Button from '../../../components/Button';
15
- import { alpha, styled, useTheme } from '@mui/material/styles';
14
+ import { alpha, styled } from '@mui/material/styles';
16
15
  import Box from '@mui/material/Box';
17
16
  import Link from '@mui/material/Link';
18
17
  import { ICONS_NAMES } from '../../../constants';
19
18
  import CheckIcon from '@mui/icons-material/Check';
20
19
  import { useAppDispatch } from '../../../hooks';
21
- import { handleOpen } from '../../../app/settings';
22
- import useMediaQuery from '@mui/material/useMediaQuery';
23
- var Image = styled('img', { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
20
+ import { handleOpen, handleCurrentActiveScreen } from '../../../app/settings';
21
+ import { getScreenNameBasedOnFlow } from '../../../utils';
22
+ var Image = styled('img')(function (_a) {
24
23
  var theme = _a.theme;
25
24
  return ({
26
25
  width: theme.spacing(3),
27
26
  height: theme.spacing(3),
28
27
  fontSize: theme.spacing(3),
29
- marginInlineStart: theme.spacing(1),
30
- transform: theme.direction === 'rtl' ? 'scaleX(-1)' : 'scaleX(1)'
28
+ marginInlineStart: theme.spacing(1)
31
29
  });
32
30
  });
33
31
  var ButtonBoxStyled = styled(Box)(function (_a) {
32
+ var _b;
34
33
  var theme = _a.theme;
35
- return ({
36
- margin: theme.spacing(0, 2.5, 2.5, 2.5)
37
- });
34
+ return (_b = {
35
+ margin: theme.spacing(0, 2.5, 2.5, 2.5)
36
+ },
37
+ _b[theme.breakpoints.down('sm')] = {
38
+ margin: theme.spacing(0, 2.5, 0.25, 2.5)
39
+ },
40
+ _b);
38
41
  });
39
42
  var ButtonStyled = styled(Button, {
40
- shouldForwardProp: function (prop) { return !['isCompleted', 'touched'].includes(prop.toString()); }
43
+ shouldForwardProp: function (prop) { return prop !== 'isCompleted'; }
41
44
  })(function (_a) {
42
45
  var _b;
43
- var theme = _a.theme, isCompleted = _a.isCompleted, touched = _a.touched;
44
- return (__assign(__assign({ width: '100%', textTransform: 'none', paddingInlineStart: theme.spacing(0.75), backgroundColor: theme.palette.common.white, border: "1px solid ".concat(theme.palette.primary.main), color: theme.palette.primary.main }, (isCompleted && {
45
- paddingInlineEnd: theme.spacing(1.625),
46
- color: theme.palette.success.main,
47
- border: "1px solid ".concat(theme.palette.success.main)
48
- })), (_b = { '&:hover': __assign({ backgroundColor: theme.palette.primary.main, color: theme.palette.common.white }, (isCompleted && {
46
+ var theme = _a.theme, isCompleted = _a.isCompleted;
47
+ return ({
48
+ '&.MuiButton-outlined': __assign(__assign({}, (isCompleted && {
49
+ paddingInlineEnd: theme.spacing(1.625),
50
+ color: theme.palette.success.main,
51
+ border: "1px solid ".concat(theme.palette.success.main)
52
+ })), (_b = { '&:hover': __assign({}, (isCompleted && {
53
+ backgroundColor: theme.palette.common.white,
54
+ border: "1px solid ".concat(theme.palette.success.main),
55
+ color: theme.palette.success.main,
56
+ cursor: 'initial',
57
+ img: {
58
+ filter: 'none'
59
+ }
60
+ })) }, _b[theme.breakpoints.down('sm')] = {
61
+ '&:hover': __assign({ backgroundColor: theme.palette.common.white, border: "1px solid ".concat(theme.palette.primary.main), img: {
62
+ filter: 'none'
63
+ }, color: theme.palette.primary.main }, (isCompleted && {
49
64
  backgroundColor: theme.palette.common.white,
50
65
  border: "1px solid ".concat(theme.palette.success.main),
66
+ paddingInlineEnd: theme.spacing(1.625),
51
67
  color: theme.palette.success.main,
52
- cursor: 'initial'
53
- })) }, _b[theme.breakpoints.down('sm')] = {
54
- '&:hover': __assign({ backgroundColor: touched ? theme.palette.primary.main : theme.palette.common.white, border: "1px solid ".concat(theme.palette.primary.main), color: touched ? theme.palette.common.white : theme.palette.primary.main }, (isCompleted && {
68
+ cursor: 'initial',
69
+ img: {
70
+ filter: 'none'
71
+ }
72
+ }))
73
+ }, _b['&:disabled'] = {
55
74
  backgroundColor: theme.palette.common.white,
56
- border: "1px solid ".concat(theme.palette.success.main),
57
- paddingInlineEnd: theme.spacing(1.625),
58
- color: theme.palette.success.main,
59
- cursor: 'initial'
60
- }))
61
- }, _b['&:disabled'] = {
62
- backgroundColor: theme.palette.common.white,
63
- color: alpha(theme.palette.primary.main, 0.3)
64
- }, _b)));
75
+ color: alpha(theme.palette.primary.main, 0.3)
76
+ }, _b))
77
+ });
65
78
  });
66
79
  var CheckIconStyled = styled(CheckIcon)(function (_a) {
67
80
  var theme = _a.theme;
@@ -72,33 +85,25 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
72
85
  });
73
86
  });
74
87
  export default function FlowsButtons(_a) {
75
- var buttons = _a.buttons;
76
- var _b = React.useState(), index = _b[0], setIndex = _b[1];
77
- var _c = React.useState(false), touched = _c[0], setTouched = _c[1];
88
+ var buttons = _a.buttons, flowName = _a.flowName;
78
89
  var dispatch = useAppDispatch();
79
- var theme = useTheme();
80
- var isMobile = useMediaQuery(theme.breakpoints.down('sm'));
81
- var handleTouch = function () {
82
- setTouched(true);
83
- };
84
90
  var onRedirect = function (item) {
85
91
  if (item.isCompleted)
86
92
  return;
93
+ if (flowName === item.name && item.name !== 'password') {
94
+ dispatch(handleCurrentActiveScreen(getScreenNameBasedOnFlow(item.name)));
95
+ return;
96
+ }
87
97
  dispatch(handleOpen(false));
88
98
  setTimeout(function () {
89
99
  window.location.href = item.href;
90
100
  }, 500);
91
101
  };
92
102
  return (_jsx(ButtonBoxStyled, { children: buttons.map(function (_a, idx) {
93
- var title = _a.title, href = _a.href, src = _a.src, hoverSrc = _a.hoverSrc, isCompleted = _a.isCompleted, sx = _a.sx;
103
+ var title = _a.title, href = _a.href, src = _a.src, hoverSrc = _a.hoverSrc, isCompleted = _a.isCompleted, sx = _a.sx, name = _a.name;
94
104
  var isLast = idx === buttons.length - 1;
95
- return (_jsx(Link, __assign({ underline: 'none', onMouseEnter: function () { return !isCompleted && setIndex(idx); }, onMouseLeave: function () { return setIndex(undefined); }, onClick: function () {
96
- setTouched(false);
97
- onRedirect({ title: title, href: href, src: src, hoverSrc: hoverSrc, isCompleted: isCompleted });
98
- } }, { children: _jsx(ButtonStyled, __assign({ onTouchStart: handleTouch, touched: touched, isCompleted: isCompleted, sx: __assign({ mb: isLast ? 0 : 1.8 }, sx), endIcon: isCompleted ? (_jsx(CheckIconStyled, {})) : isMobile ? (_jsx(Image, { sx: { height: 15 }, src: index === idx
99
- ? touched
100
- ? ICONS_NAMES.Arrow_white_right_icon
101
- : ICONS_NAMES.Arrow_filled_right_icon
102
- : ICONS_NAMES.Arrow_filled_right_icon })) : (_jsx(Image, { sx: { height: 15 }, src: index === idx ? ICONS_NAMES.Arrow_white_right_icon : ICONS_NAMES.Arrow_filled_right_icon })), startIcon: isMobile ? (_jsx(Image, { src: index === idx ? (touched ? hoverSrc : src) : src, alt: title })) : (_jsx(Image, { src: index === idx ? hoverSrc : src, alt: title })), type: 'button' }, { children: title })) }), idx));
105
+ return (_jsx(Link, __assign({ underline: 'none', onClick: function () {
106
+ onRedirect({ title: title, href: href, src: src, hoverSrc: hoverSrc, isCompleted: isCompleted, name: name });
107
+ } }, { children: _jsx(ButtonStyled, __assign({ variant: 'outlined', isCompleted: isCompleted, sx: __assign({ mb: isLast ? 2.5 : 1.8 }, sx), endIcon: isCompleted ? (_jsx(CheckIconStyled, {})) : (_jsx(Image, { sx: { height: 15, transform: 'unset' }, src: ICONS_NAMES.Arrow_filled_right_icon })), startIcon: _jsx(Image, { src: src, alt: title }), type: 'button' }, { children: title })) }), idx));
103
108
  }) }));
104
109
  }
@@ -1,9 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { ButtonProps } from '../../../components/Button';
3
3
  interface MobileButtonProps extends ButtonProps {
4
- isAr: boolean;
5
4
  loading?: boolean;
6
5
  hideIcon?: boolean;
7
6
  }
8
- export default function MobileButton({ children, isAr, hideIcon, disabled, ...props }: MobileButtonProps): JSX.Element;
7
+ export default function MobileButton({ children, hideIcon, disabled, ...props }: MobileButtonProps): JSX.Element;
9
8
  export {};
@@ -21,10 +21,9 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import React from 'react';
25
24
  import Button from '../../../components/Button';
26
25
  import Icon from '../../../components/Icon';
27
- import { alpha, styled } from '@mui/material/styles';
26
+ import { styled } from '@mui/material/styles';
28
27
  import Box from '@mui/material/Box';
29
28
  import { ICONS_NAMES } from '../../../constants';
30
29
  var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
@@ -39,32 +38,7 @@ var ButtonBoxStyled = styled(Box)(function (_a) {
39
38
  margin: theme.spacing(0, 2.5, 2.5, 2.5)
40
39
  });
41
40
  });
42
- var ButtonStyled = styled(Button, { shouldForwardProp: function (prop) { return prop !== 'touched'; } })(function (_a) {
43
- var theme = _a.theme, touched = _a.touched;
44
- return ({
45
- paddingInlineStart: theme.spacing(0.75),
46
- textTransform: 'none',
47
- backgroundColor: touched ? theme.palette.primary.main : theme.palette.common.white,
48
- border: "1px solid ".concat(theme.palette.primary.main),
49
- color: touched ? theme.palette.common.white : theme.palette.primary.main,
50
- '&:hover': {
51
- backgroundColor: touched ? theme.palette.primary.main : theme.palette.common.white,
52
- color: touched ? theme.palette.common.white : theme.palette.primary.main,
53
- img: {
54
- filter: touched ? 'brightness(0) invert(1)' : ''
55
- }
56
- },
57
- '&:disabled': {
58
- backgroundColor: theme.palette.common.white,
59
- color: alpha(theme.palette.primary.main, 0.3)
60
- }
61
- });
62
- });
63
41
  export default function MobileButton(_a) {
64
- var children = _a.children, isAr = _a.isAr, hideIcon = _a.hideIcon, disabled = _a.disabled, props = __rest(_a, ["children", "isAr", "hideIcon", "disabled"]);
65
- var _b = React.useState(false), touched = _b[0], setTouched = _b[1];
66
- var handleTouch = function () {
67
- setTouched(true);
68
- };
69
- return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ onTouchStart: handleTouch, touched: touched, disabled: disabled, type: 'button', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.MOBILE_ICON }) }, props, { children: children })) }));
42
+ var children = _a.children, hideIcon = _a.hideIcon, disabled = _a.disabled, props = __rest(_a, ["children", "hideIcon", "disabled"]);
43
+ return (_jsx(ButtonBoxStyled, { children: _jsx(Button, __assign({ disabled: disabled, type: 'button', variant: 'outlined', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.MOBILE_ICON }) }, props, { children: children })) }));
70
44
  }
@@ -26,23 +26,25 @@ import Button from './Button';
26
26
  import { styled } from '@mui/material/styles';
27
27
  import Box from '@mui/material/Box';
28
28
  var ButtonStyled = styled(Button, {
29
- shouldForwardProp: function (prop) { return prop !== 'isLoading'; }
29
+ shouldForwardProp: function (prop) { return !['isLoading', 'isAr'].includes(prop); }
30
30
  })(function (_a) {
31
31
  var theme = _a.theme, isLoading = _a.isLoading;
32
- return (__assign({ width: '100%', textTransform: 'none', paddingInlineStart: theme.spacing(0.75), backgroundColor: theme.palette.common.white, color: theme.palette.primary.main, border: "1px solid ".concat(theme.palette.primary.main), '&:hover': {
33
- backgroundColor: theme.palette.common.white,
34
- color: theme.palette.primary.main
35
- }, '&:disabled': {
36
- backgroundColor: theme.palette.primary.main,
37
- color: theme.palette.common.white
38
- }, transition: theme.transitions.create(['width', 'padding'], {
39
- easing: theme.transitions.easing.easeInOut,
40
- duration: theme.transitions.duration.complex * 2
41
- }) }, (isLoading && {
42
- minWidth: 0,
43
- width: theme.spacing(6),
44
- borderRadius: 30
45
- })));
32
+ return ({
33
+ '&.MuiButton-outlined': __assign({ width: '100%', textTransform: 'none', paddingInlineStart: theme.spacing(0.75), backgroundColor: theme.palette.common.white, color: theme.palette.primary.main, border: "1px solid ".concat(theme.palette.primary.main), '&:hover': {
34
+ backgroundColor: theme.palette.common.white,
35
+ color: theme.palette.primary.main
36
+ }, '&:disabled': {
37
+ backgroundColor: theme.palette.primary.main,
38
+ color: theme.palette.common.white
39
+ }, transition: theme.transitions.create(['width', 'padding'], {
40
+ easing: theme.transitions.easing.easeInOut,
41
+ duration: theme.transitions.duration.complex * 2
42
+ }) }, (isLoading && {
43
+ minWidth: 0,
44
+ width: theme.spacing(6),
45
+ borderRadius: 30
46
+ }))
47
+ });
46
48
  });
47
49
  var ButtonBoxStyled = styled(Box)(function (_a) {
48
50
  var theme = _a.theme;
@@ -62,5 +64,5 @@ export default function SuccessButton(_a) {
62
64
  React.useEffect(function () {
63
65
  setBtnLoading(false);
64
66
  }, []);
65
- return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ isAr: isAr, isLoading: btnLoading, loading: btnLoading, disabled: disabled, type: 'button' }, props, { children: children })) }));
67
+ return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ isAr: isAr, isLoading: btnLoading, loading: btnLoading, disabled: disabled, type: 'button', variant: 'outlined' }, props, { children: children })) }));
66
68
  }
@@ -9,7 +9,7 @@ export default function CustomFooter() {
9
9
  var isEn = useLanguage().isEn;
10
10
  var t = useTranslation().t;
11
11
  var dispatch = useAppDispatch();
12
- var _a = useAppSelector(connectSelector), data = _a.data, loading = _a.loading, error = _a.error;
12
+ var data = useAppSelector(connectSelector).data;
13
13
  var handleChangeLanguage = function () {
14
14
  var language = isEn ? LanguageMode.AR : LanguageMode.EN;
15
15
  dispatch(handleLanguage(language));
@@ -4,6 +4,7 @@ interface OTPProps extends OTPFieldProps {
4
4
  timerInSeconds?: number;
5
5
  onResetClick?: () => void;
6
6
  timeEndLabel?: string;
7
+ loading?: boolean;
7
8
  }
8
- declare const _default: React.MemoExoticComponent<({ timeEndLabel, timerInSeconds, onResetClick, ...props }: OTPProps) => JSX.Element>;
9
+ declare const _default: React.MemoExoticComponent<({ timeEndLabel, loading, timerInSeconds, onResetClick, ...props }: OTPProps) => JSX.Element>;
9
10
  export default _default;
@@ -24,6 +24,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
24
24
  import * as React from 'react';
25
25
  import { styled } from '@mui/material/styles';
26
26
  import Box from '@mui/material/Box/Box';
27
+ import CircularProgress from '@mui/material/CircularProgress';
27
28
  import OTPField from '../../../components/OTPField';
28
29
  import OTPTimer from '../../../components/OTPTimer';
29
30
  import { useContainerDimensions } from '../../../hooks';
@@ -71,8 +72,15 @@ var OTPBox = styled(Box)(function (_a) {
71
72
  },
72
73
  _b);
73
74
  });
75
+ var LoaderBoxStyled = styled(OTPBox)(function (_a) {
76
+ var theme = _a.theme;
77
+ return ({
78
+ display: 'flex',
79
+ justifyContent: 'end'
80
+ });
81
+ });
74
82
  var OTPInput = function (_a) {
75
- var timeEndLabel = _a.timeEndLabel, timerInSeconds = _a.timerInSeconds, onResetClick = _a.onResetClick, props = __rest(_a, ["timeEndLabel", "timerInSeconds", "onResetClick"]);
83
+ var timeEndLabel = _a.timeEndLabel, loading = _a.loading, timerInSeconds = _a.timerInSeconds, onResetClick = _a.onResetClick, props = __rest(_a, ["timeEndLabel", "loading", "timerInSeconds", "onResetClick"]);
76
84
  var otpRef = React.useRef(null);
77
85
  var width = useContainerDimensions(otpRef).width;
78
86
  React.useEffect(function () {
@@ -80,6 +88,6 @@ var OTPInput = function (_a) {
80
88
  if (el)
81
89
  el.className = 'middle-input-element';
82
90
  }, [props.value]);
83
- return (_jsxs(_Fragment, { children: [_jsx(OTPBox, __assign({ id: 'otp-container', ref: otpRef }, { children: _jsx(OTPStyled, __assign({}, props, { parentWidth: width })) })), typeof timerInSeconds != 'undefined' && (_jsx(BoxStyled, { children: _jsx(OTPTimer, { timeEndLabel: timeEndLabel || '', timeInSeconds: timerInSeconds, onResetClick: onResetClick }) }))] }));
91
+ return (_jsxs(_Fragment, { children: [_jsx(OTPBox, __assign({ id: 'otp-container', ref: otpRef }, { children: _jsx(OTPStyled, __assign({}, props, { parentWidth: width })) })), typeof timerInSeconds != 'undefined' && (_jsx(BoxStyled, { children: loading ? (_jsx(LoaderBoxStyled, { children: _jsx(CircularProgress, { size: 20, thickness: 5 }) })) : (_jsx(OTPTimer, { timeEndLabel: timeEndLabel || '', timeInSeconds: timerInSeconds, onResetClick: onResetClick })) }))] }));
84
92
  };
85
93
  export default React.memo(OTPInput);
@@ -11,8 +11,8 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { memo, useEffect } from 'react';
14
- import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener } from '../../hooks';
15
- import { settingsSelector } from '../../app/settings';
14
+ import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener } from '../../hooks';
15
+ import { handleLanguage, settingsSelector } from '../../app/settings';
16
16
  import AnimationFlow from '../../components/AnimationFlow';
17
17
  import { store } from '../../app/store';
18
18
  import { ReduxProvider, ThemeProvider } from '../../components/Providers';
@@ -28,14 +28,19 @@ var Tax = memo(function (props) {
28
28
  var theme = useAppTheme().theme;
29
29
  var dispatch = useAppDispatch();
30
30
  var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
31
- var customLoading = useAppSelector(taxSelector).customLoading;
31
+ var _b = useAppSelector(taxSelector), customLoading = _b.customLoading, taxError = _b.error;
32
32
  var loading = useAppConfig(__assign({ navigation: TAX_SCREENS_NAVIGATION }, props)).loading;
33
- useErrorListener();
33
+ useErrorListener(taxError || error);
34
+ useStepStartedListener();
34
35
  var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
35
36
  var verifyToken = function () {
36
37
  var token = getParameterByName('token');
38
+ var lang = getParameterByName('lang');
37
39
  if (!token)
38
40
  throw new Error('Auth token is not found!');
41
+ if (!lang)
42
+ throw new Error('Language is not found!');
43
+ dispatch(handleLanguage(lang));
39
44
  dispatch(verifyLeadToken(token));
40
45
  };
41
46
  useEffect(function () {
@@ -60,7 +60,6 @@ var SuccessWithFlowButtons = function () {
60
60
  var reMapFlowData = function (flows) {
61
61
  if (flows === void 0) { flows = []; }
62
62
  var images = ICONS_NAMES;
63
- var statuses = [];
64
63
  var mappedFlows = flows.map(function (_a) {
65
64
  var name = _a.name, url = _a.url, status = _a.status;
66
65
  var type = status === 'initiated' ? 'pending' : 'completed';
@@ -79,6 +78,7 @@ var SuccessWithFlowButtons = function () {
79
78
  var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
80
79
  var hoverSrc = "".concat(name, "_white_icon");
81
80
  return {
81
+ name: name,
82
82
  title: title,
83
83
  href: url,
84
84
  src: images[src],
@@ -96,6 +96,6 @@ var SuccessWithFlowButtons = function () {
96
96
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
97
97
  reMapFlowData(flows);
98
98
  }, [flows, isAr]);
99
- return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons }) })] }));
99
+ return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, flowName: data.flowName }) })] }));
100
100
  };
101
101
  export default memo(SuccessWithFlowButtons);
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const ConfirmPolicy: () => JSX.Element;
3
+ export default ConfirmPolicy;
@@ -0,0 +1,66 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useTranslation } from 'react-i18next';
14
+ import { useController, useFormContext } from 'react-hook-form';
15
+ import { styled, alpha } from '@mui/material/styles';
16
+ import { ScreenContainer } from '../../../shared/Containers';
17
+ import Box from '@mui/material/Box';
18
+ import CheckBox from '../../../../components/CheckBox';
19
+ import Text from '../../../../components/Text';
20
+ import Warning from '../../../../components/Warning';
21
+ import Collapse from '../../../../components/Collapse';
22
+ var ConfirmContainerStyled = styled(Box)(function (_a) {
23
+ var theme = _a.theme;
24
+ return ({
25
+ display: 'flex',
26
+ flexDirection: 'row',
27
+ alignItems: 'center',
28
+ padding: theme.spacing(0, 2.5, 0, 2.5)
29
+ });
30
+ });
31
+ var TextStyled = styled(Text)(function (_a) {
32
+ var theme = _a.theme;
33
+ return (__assign({ color: alpha(theme.palette.text.primary, 0.4), fontWeight: theme.typography.fontWeightLight, whiteSpace: 'pre-line', height: 'fit-content' }, theme.typography.body2));
34
+ });
35
+ var CheckboxStyled = styled(CheckBox)(function (_a) {
36
+ var theme = _a.theme;
37
+ return ({
38
+ margin: theme.spacing(0),
39
+ padding: theme.spacing(0),
40
+ marginInlineEnd: theme.spacing(1.5),
41
+ color: theme.palette.primary.main,
42
+ '& .MuiSvgIcon-root': {
43
+ fontSize: theme.spacing(3.75)
44
+ },
45
+ '&.Mui-checked': {
46
+ color: theme.palette.text.primary,
47
+ borderRadius: theme.spacing(2.5)
48
+ }
49
+ });
50
+ });
51
+ var CollapseStyled = styled(Collapse)(function () { return ({
52
+ width: '100%'
53
+ }); });
54
+ var ConfirmPolicy = function () {
55
+ var _a;
56
+ var t = useTranslation().t;
57
+ var control = useFormContext().control;
58
+ var confirmControl = useController({ control: control, name: 'confirmPolicy' });
59
+ var confirmChecked = confirmControl.field.value;
60
+ var warningMessage = (_a = confirmControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
61
+ var handleConfirmCheckedChange = function (event, checked) {
62
+ confirmControl.field.onChange(checked);
63
+ };
64
+ return (_jsxs(ScreenContainer, { children: [_jsxs(ConfirmContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: confirmChecked, onChange: handleConfirmCheckedChange }), _jsx(TextStyled, { children: t('tax_confirm_information') })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
65
+ };
66
+ export default ConfirmPolicy;
@@ -20,10 +20,14 @@ import Form from '../../../../components/Form';
20
20
  import { Validation } from './validation';
21
21
  import { yupResolver } from '@hookform/resolvers/yup';
22
22
  import { taxSelector, updateTaxInfo } from '../../../app/tax/taxStore';
23
+ import { handleCurrentActiveScreen } from '../../../../app/settings';
23
24
  import VATId from './VATId';
25
+ import ConfirmPolicy from './ConfirmPolicy';
24
26
  var FormStyled = styled(Form)(function () { return ({
27
+ height: '100%',
25
28
  display: 'flex',
26
- flexDirection: 'column'
29
+ flexDirection: 'column',
30
+ justifyContent: 'space-between'
27
31
  }); });
28
32
  var TaxDetails = function () {
29
33
  var dispatch = useAppDispatch();
@@ -38,6 +42,9 @@ var TaxDetails = function () {
38
42
  var onSubmit = function (data) {
39
43
  dispatch(updateTaxInfo(data));
40
44
  };
41
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(VATId, {}), _jsx(Button, __assign({ disableBack: true, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
45
+ var onBack = function () {
46
+ dispatch(handleCurrentActiveScreen('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
47
+ };
48
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(VATId, {}), _jsx(ConfirmPolicy, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
42
49
  };
43
50
  export default TaxDetails;
@@ -1,5 +1,16 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { FeatureContainer } from '../../../shared/Containers';
13
+ import Box from '@mui/material/Box';
3
14
  import Input from '../../../shared/Input';
4
15
  import { useTranslation } from 'react-i18next';
5
16
  import { useController, useFormContext } from 'react-hook-form';
@@ -21,6 +32,6 @@ var VATId = function () {
21
32
  var clearValue = function () {
22
33
  vatControl.field.onChange('');
23
34
  };
24
- return (_jsx(FeatureContainer, { children: _jsx(Input, { label: t('vat_id'), inputProps: { maxLength: VAT_ID_LENGTH }, value: vatValue, onChange: function (event) { return handleOnChange(event.target.value); }, placeholder: '00000000000', warningType: 'alert', warningMessage: vatError && t(vatError), required: true, endAdornment: !vatError && vatValue ? _jsx(CheckIcon, {}) : vatValue && _jsx(ClearIcon, { onClick: clearValue }) }) }));
35
+ return (_jsx(Box, __assign({ sx: { height: '200px' } }, { children: _jsx(Input, { label: t('vat_id'), inputProps: { maxLength: VAT_ID_LENGTH }, value: vatValue, onChange: function (event) { return handleOnChange(event.target.value); }, placeholder: t('vat_id_placeholder'), warningType: 'alert', warningMessage: vatError && t(vatError), required: true, endAdornment: !vatError && vatValue ? _jsx(CheckIcon, {}) : vatValue && _jsx(ClearIcon, { onClick: clearValue }) }) })));
25
36
  };
26
37
  export default VATId;
@@ -1,8 +1,11 @@
1
1
  import * as yup from 'yup';
2
2
  export declare const Validation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
3
  vatId: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
+ confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
4
5
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
5
6
  vatId: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
7
+ confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
6
8
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
9
  vatId: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
10
+ confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
8
11
  }>>>;
@@ -1,4 +1,5 @@
1
1
  import * as yup from 'yup';
2
2
  export var Validation = yup.object().shape({
3
- vatId: yup.string().min(9, 'alert_vat').max(15, 'alert_vat').required('alert_vat')
3
+ vatId: yup.string().min(9, 'alert_vat').max(15, 'alert_vat').required('alert_vat'),
4
+ confirmPolicy: yup.boolean().required('alert_tax_confirm').isTrue('alert_tax_confirm')
4
5
  });
@@ -1,5 +1,7 @@
1
1
  import * as React from 'react';
2
2
  export interface OTPProps {
3
+ loading: boolean;
4
+ setLoading: (flag: boolean) => void;
3
5
  }
4
- declare const _default: React.MemoExoticComponent<({}: OTPProps) => JSX.Element>;
6
+ declare const _default: React.MemoExoticComponent<({ loading, setLoading }: OTPProps) => JSX.Element>;
5
7
  export default _default;
@@ -11,12 +11,14 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
+ import { useAppDispatch } from '../../../../hooks';
14
15
  import Box from '@mui/material/Box/Box';
15
16
  import { styled } from '@mui/material/styles';
16
17
  import OTPField from '../../../shared/OTP';
17
18
  import { useController, useFormContext } from 'react-hook-form';
18
19
  import { useTranslation } from 'react-i18next';
19
20
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
21
+ import { resendOTP } from '../../../app/tax/taxStore';
20
22
  var BoxStyled = styled(Box)(function (_a) {
21
23
  var theme = _a.theme;
22
24
  return ({
@@ -26,17 +28,20 @@ var BoxStyled = styled(Box)(function (_a) {
26
28
  });
27
29
  });
28
30
  var OTPInput = function (_a) {
31
+ var loading = _a.loading, setLoading = _a.setLoading;
29
32
  var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
30
33
  var t = useTranslation().t;
31
34
  var otpControl = useController({ name: 'otp', control: control });
35
+ var dispatch = useAppDispatch();
32
36
  var handleOnOTPChange = function (otp) {
33
37
  otpControl.field.onChange(otp);
34
38
  };
35
39
  var handleOnResendOTP = function () {
36
40
  if (otpControl.field.value)
37
41
  setValue('otp', '', { shouldValidate: true });
42
+ dispatch(resendOTP());
38
43
  };
39
44
  var otpValue = otpControl.field.value;
40
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
45
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
41
46
  };
42
47
  export default React.memo(OTPInput);
@@ -57,6 +57,7 @@ var VerifyNumber = function (_a) {
57
57
  });
58
58
  var t = useTranslation().t;
59
59
  var isAr = useLanguage().isAr;
60
+ var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
60
61
  React.useEffect(function () {
61
62
  if (error)
62
63
  dispatch(clearError());
@@ -71,7 +72,7 @@ var VerifyNumber = function (_a) {
71
72
  dispatch(handlePrevScreenStep());
72
73
  };
73
74
  var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
74
- var disabled = !methods.formState.isValid || !!error || !phone;
75
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
75
+ var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
76
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
76
77
  };
77
78
  export default React.memo(VerifyNumber);
@@ -9,3 +9,4 @@ export * from './useContainerDimensions';
9
9
  export * from './useAppConfig';
10
10
  export * from './useErrorListener';
11
11
  export * from './useWindowSize';
12
+ export * from './useStepStartedListener';
@@ -9,3 +9,4 @@ export * from './useContainerDimensions';
9
9
  export * from './useAppConfig';
10
10
  export * from './useErrorListener';
11
11
  export * from './useWindowSize';
12
+ export * from './useStepStartedListener';
@@ -60,8 +60,9 @@ import { useEffect, useState } from 'react';
60
60
  import { handleActiveFlowScreens, settingsSelector, getClientIp, getLocale, getBrowserFingerPrint, getOperator, handleSetAppConfig, handleLanguage, handleOpen, handleIsTapOrigin } from '../app/settings';
61
61
  import { useAppDispatch } from './useAppDispatch';
62
62
  import { useAppSelector } from './useAppSelector';
63
- import { setAxiosGlobalHeaders } from '../api';
63
+ import { setAxiosGlobalHeaders, axiosInstance } from '../api';
64
64
  import { getRequestHeaders, encryptString, isTapDomain } from '../utils';
65
+ import { ENDPOINT_PATHS } from '../constants';
65
66
  export var useAppConfig = function (_a) {
66
67
  var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, rest = __rest(_a, ["appInfo", "navigation", "publicKey"]);
67
68
  var _b = useState(true), loading = _b[0], setLoading = _b[1];
@@ -69,12 +70,21 @@ export var useAppConfig = function (_a) {
69
70
  var _c = useAppSelector(settingsSelector), data = _c.data, error = _c.error;
70
71
  var deviceInfo = data.deviceInfo, language = data.language, appConfig = data.appConfig;
71
72
  var device = deviceInfo.device, browser = deviceInfo.browser, connection = deviceInfo.connection;
73
+ var setBaseUrl = function () {
74
+ var isProd = publicKey.includes('pk_live');
75
+ if (isProd) {
76
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.PRODUCTION_BASE_URL;
77
+ return;
78
+ }
79
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
80
+ };
72
81
  var addAxiosHeader = function () {
73
82
  setAxiosGlobalHeaders(__assign(__assign({}, getRequestHeaders(deviceInfo)), { authorization: encryptString(publicKey), mdn: encryptString(window.location.origin) }));
74
83
  };
75
84
  var handleAppConfig = function () { return __awaiter(void 0, void 0, void 0, function () {
76
85
  return __generator(this, function (_a) {
77
86
  dispatch(handleSetAppConfig(__assign({ appInfo: appInfo, publicKey: publicKey }, rest)));
87
+ setBaseUrl();
78
88
  dispatch(handleActiveFlowScreens(navigation));
79
89
  return [2];
80
90
  });