@tap-payments/auth-jsconnect 2.10.12-beta → 2.10.12-development

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 (176) hide show
  1. package/README.md +2 -2
  2. package/build/@types/app.d.ts +4 -2
  3. package/build/@types/app.js +2 -0
  4. package/build/@types/form.d.ts +3 -0
  5. package/build/@types/index.d.ts +1 -0
  6. package/build/@types/index.js +1 -0
  7. package/build/@types/terminal.d.ts +116 -0
  8. package/build/@types/terminal.js +1 -0
  9. package/build/api/auth.d.ts +10 -1
  10. package/build/api/index.d.ts +7 -1
  11. package/build/api/index.js +3 -1
  12. package/build/api/terminal.d.ts +28 -0
  13. package/build/api/terminal.js +45 -0
  14. package/build/app/rootReducer.d.ts +1 -0
  15. package/build/app/rootReducer.js +3 -1
  16. package/build/app/settings.d.ts +1 -0
  17. package/build/app/settings.js +7 -3
  18. package/build/app/store.d.ts +2 -0
  19. package/build/assets/currencies/AEDSymbol.d.ts +7 -0
  20. package/build/assets/currencies/AEDSymbol.js +28 -0
  21. package/build/assets/currencies/SARSymbol.d.ts +7 -0
  22. package/build/assets/currencies/SARSymbol.js +28 -0
  23. package/build/assets/currencies/index.d.ts +2 -0
  24. package/build/assets/currencies/index.js +2 -0
  25. package/build/assets/currencies/utils.d.ts +4 -0
  26. package/build/assets/currencies/utils.js +6 -0
  27. package/build/assets/locales/ar.json +43 -6
  28. package/build/assets/locales/en.json +46 -9
  29. package/build/components/DeviceCard/DeviceCard.d.ts +18 -0
  30. package/build/components/DeviceCard/DeviceCard.js +103 -0
  31. package/build/components/DeviceCard/index.d.ts +3 -0
  32. package/build/components/DeviceCard/index.js +2 -0
  33. package/build/components/OTPTimer/OTPTimer.d.ts +2 -1
  34. package/build/components/OTPTimer/OTPTimer.js +4 -4
  35. package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
  36. package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
  37. package/build/components/TextWithCurrency/index.d.ts +2 -0
  38. package/build/components/TextWithCurrency/index.js +2 -0
  39. package/build/components/Tooltip/Tooltip.js +1 -1
  40. package/build/constants/api.d.ts +0 -1
  41. package/build/constants/api.js +0 -2
  42. package/build/constants/app.d.ts +14 -3
  43. package/build/constants/app.js +128 -6
  44. package/build/constants/assets.d.ts +11 -6
  45. package/build/constants/assets.js +118 -107
  46. package/build/constants/dummy.js +27 -20
  47. package/build/constants/flows.d.ts +15 -0
  48. package/build/constants/flows.js +15 -0
  49. package/build/constants/validation.d.ts +1 -0
  50. package/build/constants/validation.js +1 -0
  51. package/build/features/app/auth/authStore.d.ts +24 -5
  52. package/build/features/app/auth/authStore.js +136 -71
  53. package/build/features/app/connectExpress/connectExpressStore.js +38 -19
  54. package/build/features/app/individual/individualStore.js +0 -1
  55. package/build/features/app/tax/taxStore.js +1 -1
  56. package/build/features/app/terminal/terminalStore.d.ts +110 -0
  57. package/build/features/app/terminal/terminalStore.js +676 -0
  58. package/build/features/auth/screens/OTP/OTP.d.ts +13 -2
  59. package/build/features/auth/screens/OTP/OTP.js +15 -3
  60. package/build/features/auth/screens/OTP/index.d.ts +1 -2
  61. package/build/features/auth/screens/Passcode/Passcode.d.ts +16 -0
  62. package/build/features/auth/screens/Passcode/Passcode.js +82 -0
  63. package/build/features/auth/screens/Passcode/PasscodeInput.d.ts +6 -0
  64. package/build/features/auth/screens/Passcode/PasscodeInput.js +42 -0
  65. package/build/features/auth/screens/Passcode/index.d.ts +2 -0
  66. package/build/features/auth/screens/Passcode/index.js +2 -0
  67. package/build/features/auth/screens/Passcode/validation.d.ts +8 -0
  68. package/build/features/auth/screens/Passcode/validation.js +4 -0
  69. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -8
  70. package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -8
  71. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +3 -7
  72. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +3 -7
  73. package/build/features/featuresScreens.d.ts +1 -0
  74. package/build/features/featuresScreens.js +72 -0
  75. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
  76. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
  77. package/build/features/shared/Background/LogoBackground.js +1 -1
  78. package/build/features/shared/Button/Button.js +2 -3
  79. package/build/features/shared/Button/FlowsButtons.js +1 -1
  80. package/build/features/shared/Input/Input.d.ts +1 -1
  81. package/build/features/shared/PushNotification/PushNotification.d.ts +11 -0
  82. package/build/features/shared/PushNotification/PushNotification.js +34 -0
  83. package/build/features/shared/PushNotification/index.d.ts +2 -0
  84. package/build/features/shared/PushNotification/index.js +2 -0
  85. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +2 -2
  86. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
  87. package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
  88. package/build/features/terminal/Terminal.d.ts +14 -0
  89. package/build/features/terminal/Terminal.js +95 -0
  90. package/build/features/terminal/index.d.ts +1 -0
  91. package/build/features/terminal/index.js +1 -0
  92. package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.d.ts +3 -0
  93. package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +69 -0
  94. package/build/features/terminal/screens/LinkNewTerminal/index.d.ts +2 -0
  95. package/build/features/terminal/screens/LinkNewTerminal/index.js +2 -0
  96. package/build/features/terminal/screens/LinkNewTerminal/styles.d.ts +10 -0
  97. package/build/features/terminal/screens/LinkNewTerminal/styles.js +28 -0
  98. package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.d.ts +3 -0
  99. package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +51 -0
  100. package/build/features/terminal/screens/LinkedSuccess/index.d.ts +2 -0
  101. package/build/features/terminal/screens/LinkedSuccess/index.js +2 -0
  102. package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.d.ts +3 -0
  103. package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +55 -0
  104. package/build/features/terminal/screens/LinkedTerminalInfo/index.d.ts +2 -0
  105. package/build/features/terminal/screens/LinkedTerminalInfo/index.js +2 -0
  106. package/build/features/terminal/screens/Loading/Loading.d.ts +4 -0
  107. package/build/features/terminal/screens/Loading/Loading.js +10 -0
  108. package/build/features/terminal/screens/Loading/index.d.ts +2 -0
  109. package/build/features/terminal/screens/Loading/index.js +2 -0
  110. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.d.ts +3 -0
  111. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +56 -0
  112. package/build/features/terminal/screens/NoTerminalDeviceLinked/index.d.ts +2 -0
  113. package/build/features/terminal/screens/NoTerminalDeviceLinked/index.js +2 -0
  114. package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.d.ts +36 -0
  115. package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.js +34 -0
  116. package/build/features/terminal/screens/OperatorError/OperatorError.d.ts +5 -0
  117. package/build/features/terminal/screens/OperatorError/OperatorError.js +9 -0
  118. package/build/features/terminal/screens/OperatorError/index.d.ts +2 -0
  119. package/build/features/terminal/screens/OperatorError/index.js +2 -0
  120. package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +3 -0
  121. package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +21 -0
  122. package/build/features/terminal/screens/ResetPasswordSuccess/index.d.ts +2 -0
  123. package/build/features/terminal/screens/ResetPasswordSuccess/index.js +2 -0
  124. package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
  125. package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +31 -0
  126. package/build/features/terminal/screens/SuccessWithFlowButtons/index.d.ts +2 -0
  127. package/build/features/terminal/screens/SuccessWithFlowButtons/index.js +2 -0
  128. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +9 -0
  129. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +20 -0
  130. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.d.ts +3 -0
  131. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +153 -0
  132. package/build/features/terminal/screens/TerminalDeviceList/index.d.ts +2 -0
  133. package/build/features/terminal/screens/TerminalDeviceList/index.js +2 -0
  134. package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +9 -0
  135. package/build/features/terminal/screens/TerminalDeviceList/styles.js +13 -0
  136. package/build/features/terminal/screens/TerminalListPage/TerminalListPage.d.ts +3 -0
  137. package/build/features/terminal/screens/TerminalListPage/TerminalListPage.js +47 -0
  138. package/build/features/terminal/screens/TerminalListPage/index.d.ts +2 -0
  139. package/build/features/terminal/screens/TerminalListPage/index.js +2 -0
  140. package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.d.ts +3 -0
  141. package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +53 -0
  142. package/build/features/terminal/screens/UnlinkedSuccess/index.d.ts +2 -0
  143. package/build/features/terminal/screens/UnlinkedSuccess/index.js +2 -0
  144. package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.d.ts +3 -0
  145. package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +98 -0
  146. package/build/features/terminal/screens/UnlinkedTerminalInfo/index.d.ts +2 -0
  147. package/build/features/terminal/screens/UnlinkedTerminalInfo/index.js +2 -0
  148. package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +26 -0
  149. package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +30 -0
  150. package/build/features/terminal/screens/Verify/OTPInput.d.ts +7 -0
  151. package/build/features/terminal/screens/Verify/OTPInput.js +51 -0
  152. package/build/features/terminal/screens/Verify/Verify.d.ts +5 -0
  153. package/build/features/terminal/screens/Verify/Verify.js +85 -0
  154. package/build/features/terminal/screens/Verify/index.d.ts +2 -0
  155. package/build/features/terminal/screens/Verify/index.js +2 -0
  156. package/build/features/terminal/screens/Verify/validation.d.ts +8 -0
  157. package/build/features/terminal/screens/Verify/validation.js +4 -0
  158. package/build/features/terminal/screens/shared/Header.d.ts +10 -0
  159. package/build/features/terminal/screens/shared/Header.js +30 -0
  160. package/build/features/terminal/screens/shared/TerminalList.d.ts +11 -0
  161. package/build/features/terminal/screens/shared/TerminalList.js +25 -0
  162. package/build/features/terminal/screens/shared/index.d.ts +5 -0
  163. package/build/features/terminal/screens/shared/index.js +5 -0
  164. package/build/features/terminal/screens/shared/styles.d.ts +196 -0
  165. package/build/features/terminal/screens/shared/styles.js +155 -0
  166. package/build/features/terminal/screens/shared/utils.d.ts +7 -0
  167. package/build/features/terminal/screens/shared/utils.js +24 -0
  168. package/build/hooks/useAppDispatch.d.ts +1 -0
  169. package/build/index.d.ts +3 -2
  170. package/build/index.js +4 -2
  171. package/build/theme/palette.js +12 -0
  172. package/build/theme/typography.js +4 -0
  173. package/build/utils/common.js +4 -4
  174. package/build/utils/string.d.ts +3 -2
  175. package/build/utils/string.js +10 -1
  176. package/package.json +2 -2
@@ -1,5 +1,16 @@
1
1
  import * as React from 'react';
2
- export interface OTPProps {
3
- }
2
+ export declare const PasscodeLoginStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
3
+ align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
4
+ children?: React.ReactNode;
5
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
6
+ gutterBottom?: boolean | undefined;
7
+ noWrap?: boolean | undefined;
8
+ paragraph?: boolean | undefined;
9
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
10
+ variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | undefined;
11
+ variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline", string>> | undefined;
12
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
13
+ ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
14
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | ("left" | "right" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
4
15
  declare const _default: React.MemoExoticComponent<() => JSX.Element>;
5
16
  export default _default;
@@ -14,9 +14,9 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useForm, FormProvider } from 'react-hook-form';
16
16
  import Box from '@mui/material/Box/Box';
17
- import { styled } from '@mui/material/styles';
17
+ import { styled, useTheme } from '@mui/material/styles';
18
18
  import Text from '../../../../components/Text';
19
- import { clearError, authSelector, verifyMobileOtp, resetOTPValue, verifyEmailOtp } from '../../../app/auth/authStore';
19
+ import { clearError, authSelector, verifyMobileOtp, resetOTPValue, verifyEmailOtp, createEmailAuth, createMobileAuth } from '../../../app/auth/authStore';
20
20
  import Button from '../../../shared/Button';
21
21
  import { ScreenContainer } from '../../../shared/Containers';
22
22
  import { useAppDispatch, useAppSelector, useLanguage, useSanitizedTranslation } from '../../../../hooks';
@@ -46,8 +46,13 @@ var FormStyled = styled(Form)(function () { return ({
46
46
  display: 'flex',
47
47
  flexDirection: 'column'
48
48
  }); });
49
+ export var PasscodeLoginStyled = styled(Text)(function (_a) {
50
+ var _b = _a.theme, spacing = _b.spacing, palette = _b.palette, typography = _b.typography;
51
+ return (__assign(__assign({}, typography.caption), { color: palette.primary.main, lineHeight: 1.75, textAlign: 'center', marginTop: spacing(5), cursor: 'pointer' }));
52
+ });
49
53
  var OTP = function () {
50
54
  var _a;
55
+ var spacing = useTheme().spacing;
51
56
  var dispatch = useAppDispatch();
52
57
  var _b = useAppSelector(authSelector), data = _b.data, loading = _b.loading, error = _b.error;
53
58
  var t = useTranslation().t;
@@ -112,7 +117,14 @@ var OTP = function () {
112
117
  screen = 'AUTH_EMAIL_STEP';
113
118
  dispatch(handlePrevScreenStep(screen));
114
119
  };
120
+ var onOTPLoginClick = function () {
121
+ if (isEmailAuth)
122
+ dispatch(createEmailAuth({ email: data.emailData.email }));
123
+ else
124
+ dispatch(createMobileAuth({ mobile: data.mobileData.mobile, countryCode: data.mobileData.countryCode }));
125
+ };
115
126
  var disabled = !methods.formState.isValid;
116
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : getTitle(), !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: getNumber() }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
127
+ var showLoginWithPasscode = data.passcodeData.allowOTPToPasscodeRedirection;
128
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : getTitle(), !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: getNumber() }))] }) }), _jsx(OTPInput, {}), showLoginWithPasscode && _jsx(PasscodeLoginStyled, __assign({ onClick: onOTPLoginClick }, { children: st('login_with_passcode') })), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, (showLoginWithPasscode && { sx: { marginTop: spacing(2.25) } }), { children: t('next') }))] })) })) }));
117
129
  };
118
130
  export default React.memo(OTP);
@@ -1,3 +1,2 @@
1
- import OTP, { OTPProps } from './OTP';
2
- export type { OTPProps };
1
+ import OTP from './OTP';
3
2
  export default OTP;
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ export declare const OTPSignInStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
3
+ align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
4
+ children?: React.ReactNode;
5
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
6
+ gutterBottom?: boolean | undefined;
7
+ noWrap?: boolean | undefined;
8
+ paragraph?: boolean | undefined;
9
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
10
+ variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | undefined;
11
+ variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline", string>> | undefined;
12
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
13
+ ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
14
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | ("left" | "right" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
15
+ declare const _default: React.MemoExoticComponent<() => JSX.Element>;
16
+ export default _default;
@@ -0,0 +1,82 @@
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 * as React from 'react';
14
+ import Box from '@mui/material/Box/Box';
15
+ import { yupResolver } from '@hookform/resolvers/yup';
16
+ import { useForm, FormProvider } from 'react-hook-form';
17
+ import { styled, useTheme } from '@mui/material/styles';
18
+ import Form from '../../../../components/Form';
19
+ import Text from '../../../../components/Text';
20
+ import { deepCopy } from '../../../../utils';
21
+ import Button from '../../../shared/Button';
22
+ import { handlePrevScreenStep } from '../../../../app/settings';
23
+ import { ScreenContainer } from '../../../shared/Containers';
24
+ import { AuthForType } from '../../../../@types';
25
+ import { useAppDispatch, useAppSelector, useLanguage, useSanitizedTranslation } from '../../../../hooks';
26
+ import { clearError, authSelector, verifyPasscode, createEmailAuth, createMobileAuth } from '../../../app/auth/authStore';
27
+ import { validation } from './validation';
28
+ import PasscodeInput from './PasscodeInput';
29
+ var TitleContainerStyled = styled(Box)(function (_a) {
30
+ var theme = _a.theme;
31
+ return ({
32
+ background: theme.palette.common.white,
33
+ border: '1px solid',
34
+ borderColor: theme.palette.divider,
35
+ direction: theme.direction,
36
+ borderRadius: theme.spacing(0, 0, 1.25, 1.25),
37
+ marginBottom: theme.spacing(5.75)
38
+ });
39
+ });
40
+ var TitleStyled = styled(Text)(function (_a) {
41
+ var theme = _a.theme;
42
+ return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.75, whiteSpace: 'pre-line' }));
43
+ });
44
+ var FormStyled = styled(Form)(function () { return ({
45
+ display: 'flex',
46
+ flexDirection: 'column'
47
+ }); });
48
+ export var OTPSignInStyled = styled(Text)(function (_a) {
49
+ var _b = _a.theme, spacing = _b.spacing, palette = _b.palette, typography = _b.typography;
50
+ return (__assign(__assign({}, typography.caption), { color: palette.primary.main, lineHeight: 1.75, textAlign: 'center', marginTop: spacing(11.625), cursor: 'pointer' }));
51
+ });
52
+ var Passcode = function () {
53
+ var spacing = useTheme().spacing;
54
+ var isAr = useLanguage().isAr;
55
+ var dispatch = useAppDispatch();
56
+ var st = useSanitizedTranslation();
57
+ var _a = useAppSelector(authSelector), _b = _a.data, passcodeData = _b.passcodeData, otpData = _b.otpData, emailData = _b.emailData, mobileData = _b.mobileData, loading = _a.loading, error = _a.error;
58
+ var methods = useForm({
59
+ resolver: yupResolver(validation),
60
+ defaultValues: passcodeData,
61
+ mode: 'onChange'
62
+ });
63
+ React.useEffect(function () {
64
+ if (error)
65
+ dispatch(clearError());
66
+ }, [methods.formState.isValid]);
67
+ var startWithEmail = otpData.authFor === AuthForType.EMAIL;
68
+ var onSubmit = function (formData) {
69
+ dispatch(verifyPasscode(deepCopy(formData)));
70
+ };
71
+ var onBack = function () {
72
+ dispatch(handlePrevScreenStep(startWithEmail ? 'AUTH_EMAIL_STEP' : 'AUTH_MOBILE_STEP'));
73
+ };
74
+ var onOTPLoginClick = function () {
75
+ if (startWithEmail)
76
+ dispatch(createEmailAuth({ email: emailData.email, skipPasscode: true }));
77
+ else
78
+ dispatch(createMobileAuth({ mobile: mobileData.mobile, countryCode: mobileData.countryCode, skipPasscode: true }));
79
+ };
80
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(TitleContainerStyled, { children: _jsx(TitleStyled, { children: loading ? st('ide_otp_waiting_title') : st('passcode_title') }) }), _jsx(PasscodeInput, { disableResend: true }), _jsx(OTPSignInStyled, __assign({ onClick: onOTPLoginClick }, { children: st('sign_in_with_otp') })), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: !methods.formState.isValid, isAr: isAr, loading: loading, error: st(error || ''), sx: { marginTop: spacing(2.5) } }, { children: st('next') }))] })) })) }));
81
+ };
82
+ export default React.memo(Passcode);
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface PasscodeInputProps {
3
+ disableResend?: boolean;
4
+ }
5
+ declare const _default: React.MemoExoticComponent<({ disableResend }: PasscodeInputProps) => JSX.Element>;
6
+ export default _default;
@@ -0,0 +1,42 @@
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 } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import Box from '@mui/material/Box/Box';
15
+ import { styled } from '@mui/material/styles';
16
+ import { useController, useFormContext } from 'react-hook-form';
17
+ import OTPField from '../../../shared/OTP';
18
+ import { DEFAULT_TIMER_VALUE } from '../../../../constants';
19
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
20
+ import { authSelector, clearError } from '../../../app/auth/authStore';
21
+ var BoxStyled = styled(Box)(function (_a) {
22
+ var theme = _a.theme;
23
+ return ({
24
+ display: 'flex',
25
+ flexDirection: 'column',
26
+ fontFamily: theme.typography.fontFamily
27
+ });
28
+ });
29
+ var PasscodeInput = function (_a) {
30
+ var disableResend = _a.disableResend;
31
+ var dispatch = useAppDispatch();
32
+ var control = useFormContext().control;
33
+ var error = useAppSelector(authSelector).error;
34
+ var _b = useController({ name: 'passcode', control: control }).field, value = _b.value, onChange = _b.onChange;
35
+ var handleOnPasscodeChange = function (passcode) {
36
+ if (error)
37
+ dispatch(clearError());
38
+ onChange(passcode);
39
+ };
40
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, __assign({}, (!disableResend && { timerInSeconds: DEFAULT_TIMER_VALUE }), { value: value, onChange: function (number) { return handleOnPasscodeChange(number.toString()); } })) })));
41
+ };
42
+ export default React.memo(PasscodeInput);
@@ -0,0 +1,2 @@
1
+ import Passcode from './Passcode';
2
+ export default Passcode;
@@ -0,0 +1,2 @@
1
+ import Passcode from './Passcode';
2
+ export default Passcode;
@@ -0,0 +1,8 @@
1
+ import * as yup from 'yup';
2
+ export declare const validation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ passcode: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
5
+ passcode: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
+ passcode: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
+ }>>>;
@@ -0,0 +1,4 @@
1
+ import * as yup from 'yup';
2
+ export var validation = yup.object().shape({
3
+ passcode: yup.string().min(6).required('passcode_required')
4
+ });
@@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import Box from '@mui/material/Box';
17
17
  import { styled } from '@mui/material/styles';
18
- import { getCurrencyByCountryIso2, isExist } from '../../../../utils';
18
+ import { isExist } from '../../../../utils';
19
19
  import { useLanguage, useAppSelector, useAppDispatch } from '../../../../hooks';
20
20
  import { settingsSelector } from '../../../../app/settings';
21
21
  import SimpleList from '../../../../components/SimpleList';
@@ -29,6 +29,7 @@ import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
29
29
  import CheckIcon from '../../../shared/CheckIcon';
30
30
  import { InputLabelStyled, NameContainer } from './CustomerBase';
31
31
  import { MandatoryStyled } from './ActivitiesList';
32
+ import TextWithCurrency from '../../../../components/TextWithCurrency';
32
33
  var InputStyled = styled(InputSelect)(function (_a) {
33
34
  var theme = _a.theme;
34
35
  return ({
@@ -71,7 +72,6 @@ var ExpectedSalesRange = function (_a) {
71
72
  var brandActivities = data.brandActivities;
72
73
  var expectedSales = (brandActivities.responseBody || {}).expectedSales;
73
74
  var expectedSalesRangeValue = expectedSaleControl.field.value;
74
- var countryCode = settingsData.businessCountry;
75
75
  var handleOpenMainMenu = function (event) {
76
76
  if (readOnly)
77
77
  return;
@@ -95,9 +95,6 @@ var ExpectedSalesRange = function (_a) {
95
95
  var handleCloseSubMenu = function () {
96
96
  setSubIndex('');
97
97
  };
98
- var getCurrency = React.useMemo(function () {
99
- return t(getCurrencyByCountryIso2(countryCode.iso2));
100
- }, [countryCode.iso2]);
101
98
  React.useEffect(function () {
102
99
  if ((expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales.length) > 0) {
103
100
  setExpectedSalesRangeList(expectedSales);
@@ -126,9 +123,7 @@ var ExpectedSalesRange = function (_a) {
126
123
  if (item)
127
124
  setSubIndex(item.id);
128
125
  }, [anchorEl, expectedSalesRangeValue]);
129
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('expected_sales_monthly', {
130
- currency: getCurrency
131
- }), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(InputStyled, { readOnly: readOnly, value: isAr ? (_b = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar) !== null && _b !== void 0 ? _b : '' : (_c = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) !== null && _c !== void 0 ? _c : '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
126
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [_jsx(TextWithCurrency, { text: t('expected_sale_per_month'), countryCode: settingsData.businessCountry.iso2 }), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(InputStyled, { readOnly: readOnly, value: isAr ? (_b = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar) !== null && _b !== void 0 ? _b : '' : (_c = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) !== null && _c !== void 0 ? _c : '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
132
127
  var isOnlyOneItem = !item.sub || item.sub.length === 1;
133
128
  if (isOnlyOneItem)
134
129
  onSelectItem(item);
@@ -22,12 +22,13 @@ import Collapse from '../../../../components/Collapse';
22
22
  import ExpandIcon from '../../../../components/ExpandIcon';
23
23
  import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
24
24
  import { businessSelector, clearError } from '../../../app/business/businessStore';
25
- import { getCurrencyByCountryIso2, isExist } from '../../../../utils';
25
+ import { isExist } from '../../../../utils';
26
26
  import { ScreenContainer } from '../../../shared/Containers';
27
27
  import Search from '../../../shared/Search';
28
28
  import InputSelect from '../../../shared/InputSelect';
29
29
  import CheckIcon from '../../../shared/CheckIcon';
30
30
  import { InputLabelStyled, NameContainer } from './CustomerLocations';
31
+ import TextWithCurrency from '../../../../components/TextWithCurrency';
31
32
  var InputStyled = styled(InputSelect)(function (_a) {
32
33
  var theme = _a.theme;
33
34
  return ({
@@ -69,7 +70,6 @@ var ExpectedSalesRange = function (_a) {
69
70
  var activitiesData = data.activitiesData;
70
71
  var expectedSales = (activitiesData.responseBody || {}).expectedSales;
71
72
  var expectedSalesRangeValue = expectedSaleControl.field.value;
72
- var countryCode = settingsData.businessCountry;
73
73
  var handleOpenMainMenu = function (event) {
74
74
  if (readOnly)
75
75
  return;
@@ -121,12 +121,7 @@ var ExpectedSalesRange = function (_a) {
121
121
  if (item)
122
122
  setSubIndex(item.id);
123
123
  }, [anchorEl, expectedSalesRangeValue]);
124
- var getCurrency = React.useMemo(function () {
125
- return t(getCurrencyByCountryIso2(countryCode.iso2));
126
- }, [countryCode.iso2]);
127
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_monthly', {
128
- currency: getCurrency
129
- }) }), _jsx(InputStyled, { readOnly: readOnly, value: (isAr ? expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar : expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
124
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: _jsx(TextWithCurrency, { text: t('expected_sale_per_month'), countryCode: settingsData.businessCountry.iso2 }) }), _jsx(InputStyled, { readOnly: readOnly, value: (isAr ? expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar : expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
130
125
  var isOnlyOneItem = !item.sub || item.sub.length === 1;
131
126
  if (isOnlyOneItem)
132
127
  onSelectItem(item);
@@ -15,11 +15,12 @@ import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
17
17
  import { settingsSelector } from '../../../../app/settings';
18
- import { formatNumberAsCurrency, getCurrencyByCountryIso2, removeAllCharsFromNumber } from '../../../../utils';
18
+ import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
19
19
  import { ScreenContainer } from '../../../shared/Containers';
20
20
  import Input from '../../../shared/Input';
21
21
  import { clearError } from '../../../app/entity/entityStore';
22
22
  import { EndAdornment } from '../../../shared/EndAdornment';
23
+ import TextWithCurrency from '../../../../components/TextWithCurrency';
23
24
  var CapitalPaid = function (_a) {
24
25
  var _b;
25
26
  var readOnly = _a.readOnly, isVerified = _a.isVerified;
@@ -34,14 +35,9 @@ var CapitalPaid = function (_a) {
34
35
  var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
35
36
  capitalPaidControl.field.onChange(value);
36
37
  };
37
- var getCurrency = React.useMemo(function () {
38
- return t(getCurrencyByCountryIso2(settingsData.businessCountry.iso2));
39
- }, [settingsData.businessCountry.iso2]);
40
38
  var capitalPaidControl = useController({ control: control, name: 'capitalPaid' });
41
39
  var capitalPaidValue = capitalPaidControl.field.value;
42
40
  var error = (_b = capitalPaidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
43
- return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_paid_label', {
44
- currency: getCurrency
45
- }), required: true, onChange: handleChange, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalPaidValue, isVerified: isVerified }) }) })));
41
+ return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: _jsx(TextWithCurrency, { text: t('capital_paid_input_label'), countryCode: settingsData.businessCountry.iso2 }), required: true, onChange: handleChange, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalPaidValue, isVerified: isVerified }) }) })));
46
42
  };
47
43
  export default React.memo(CapitalPaid);
@@ -13,13 +13,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
- import { formatNumberAsCurrency, getCurrencyByCountryIso2, removeAllCharsFromNumber } from '../../../../utils';
16
+ import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
17
17
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
18
18
  import { settingsSelector } from '../../../../app/settings';
19
19
  import { ScreenContainer } from '../../../shared/Containers';
20
20
  import Input from '../../../shared/Input';
21
21
  import { clearError } from '../../../app/entity/entityStore';
22
22
  import { EndAdornment } from '../../../shared/EndAdornment';
23
+ import TextWithCurrency from '../../../../components/TextWithCurrency';
23
24
  var CapitalShareValue = function (_a) {
24
25
  var _b;
25
26
  var readOnly = _a.readOnly, isVerified = _a.isVerified;
@@ -34,14 +35,9 @@ var CapitalShareValue = function (_a) {
34
35
  var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
35
36
  capitalShareValueControl.field.onChange(value);
36
37
  };
37
- var getCurrency = React.useMemo(function () {
38
- return t(getCurrencyByCountryIso2(settingsData.businessCountry.iso2));
39
- }, [settingsData.businessCountry.iso2]);
40
38
  var capitalShareValueControl = useController({ control: control, name: 'capitalShareValue' });
41
39
  var capitalShareValueValue = capitalShareValueControl.field.value;
42
40
  var error = (_b = capitalShareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
43
- return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_value_label', {
44
- currency: getCurrency
45
- }), required: true, onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })));
41
+ return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: _jsx(TextWithCurrency, { text: t('capital_share_value_input_label'), countryCode: settingsData.businessCountry.iso2 }), required: true, onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })));
46
42
  };
47
43
  export default React.memo(CapitalShareValue);
@@ -12,3 +12,4 @@ export declare const entityFeatureScreens: Array<FeatureScreenStep>;
12
12
  export declare const brandFeatureScreens: Array<FeatureScreenStep>;
13
13
  export declare const boardFeatureScreens: Array<FeatureScreenStep>;
14
14
  export declare const kycFeatureScreens: Array<FeatureScreenStep>;
15
+ export declare const terminalFeatureScreens: Array<FeatureScreenStep>;
@@ -57,6 +57,7 @@ import AuthAccountCreatedLoaderScreen from './auth/screens/AccountCreatedLoader'
57
57
  import AuthEmailSentScreen from './auth/screens/EmailSent';
58
58
  import AuthMigratingDataScreen from './auth/screens/MigratingData';
59
59
  import AuthOperatorError from './auth/screens/OperatorError';
60
+ import AuthPasscodeScreen from './auth/screens/Passcode';
60
61
  import CustomersPage from './business/screens/Customers';
61
62
  import IDBODPage from './business/screens/IDBOD';
62
63
  import BusinessVerifyPage from './business/screens/Verify';
@@ -140,6 +141,19 @@ import KycOperatorErrorPage from './kyc/screens/OperatorError';
140
141
  import KycSuccessPage from './kyc/screens/Success';
141
142
  import KycTermsPage from './kyc/screens/Terms';
142
143
  import KycUsersPage from './kyc/screens/Users';
144
+ import TerminalLoadingPage from './terminal/screens/Loading';
145
+ import TerminalOperatorErrorPage from './terminal/screens/OperatorError';
146
+ import TerminalVerifyPage from './terminal/screens/Verify';
147
+ import NoTerminalDeviceLinkedPage from './terminal/screens/NoTerminalDeviceLinked';
148
+ import TerminalDeviceListPage from './terminal/screens/TerminalDeviceList';
149
+ import TerminalListPage from './terminal/screens/TerminalListPage';
150
+ import LinkNewTerminalPage from './terminal/screens/LinkNewTerminal';
151
+ import LinkedTerminalInfoPage from './terminal/screens/LinkedTerminalInfo';
152
+ import UnlinkedTerminalInfoPage from './terminal/screens/UnlinkedTerminalInfo';
153
+ import LinkedSuccessPage from './terminal/screens/LinkedSuccess';
154
+ import UnlinkedSuccessPage from './terminal/screens/UnlinkedSuccess';
155
+ import TerminalBoardPage from './terminal/screens/SuccessWithFlowButtons';
156
+ import TerminalResetPasswordSuccessPage from './terminal/screens/ResetPasswordSuccess';
143
157
  export var connectFeatureScreens = [
144
158
  {
145
159
  name: 'CONNECT_BUSINESS_COUNTRY_STEP',
@@ -325,6 +339,10 @@ export var authFeatureScreens = [
325
339
  name: 'AUTH_OTP_STEP',
326
340
  element: AuthOTPScreen
327
341
  },
342
+ {
343
+ name: 'AUTH_PASSCODE_STEP',
344
+ element: AuthPasscodeScreen
345
+ },
328
346
  {
329
347
  name: 'AUTH_PASSWORD_STEP',
330
348
  element: AuthPasswordScreen
@@ -700,3 +718,57 @@ export var kycFeatureScreens = [
700
718
  element: KycSuccessPage
701
719
  }
702
720
  ];
721
+ export var terminalFeatureScreens = [
722
+ {
723
+ name: CONNECT_FLOWS.terminal.loadingData,
724
+ element: TerminalLoadingPage
725
+ },
726
+ {
727
+ name: CONNECT_FLOWS.terminal.operatorError,
728
+ element: TerminalOperatorErrorPage
729
+ },
730
+ {
731
+ name: CONNECT_FLOWS.terminal.verify,
732
+ element: TerminalVerifyPage
733
+ },
734
+ {
735
+ name: CONNECT_FLOWS.terminal.noTerminalLinked,
736
+ element: NoTerminalDeviceLinkedPage
737
+ },
738
+ {
739
+ name: CONNECT_FLOWS.terminal.terminalDeviceList,
740
+ element: TerminalDeviceListPage
741
+ },
742
+ {
743
+ name: CONNECT_FLOWS.terminal.terminalLinkNew,
744
+ element: LinkNewTerminalPage
745
+ },
746
+ {
747
+ name: CONNECT_FLOWS.terminal.terminalList,
748
+ element: TerminalListPage
749
+ },
750
+ {
751
+ name: CONNECT_FLOWS.terminal.linkedTerminalInfo,
752
+ element: LinkedTerminalInfoPage
753
+ },
754
+ {
755
+ name: CONNECT_FLOWS.terminal.unlinkedTerminalInfo,
756
+ element: UnlinkedTerminalInfoPage
757
+ },
758
+ {
759
+ name: CONNECT_FLOWS.terminal.terminalLinkedSuccess,
760
+ element: LinkedSuccessPage
761
+ },
762
+ {
763
+ name: CONNECT_FLOWS.terminal.terminalUnlinkedSuccess,
764
+ element: UnlinkedSuccessPage
765
+ },
766
+ {
767
+ name: CONNECT_FLOWS.terminal.board,
768
+ element: TerminalBoardPage
769
+ },
770
+ {
771
+ name: CONNECT_FLOWS.terminal.resetPassword,
772
+ element: TerminalResetPasswordSuccessPage
773
+ }
774
+ ];
@@ -16,7 +16,7 @@ import { useController, useFormContext } from 'react-hook-form';
16
16
  import Box from '@mui/material/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import { settingsSelector } from '../../../../app/settings';
19
- import { getCurrencyByCountryIso2, hasVerifiedValue } from '../../../../utils';
19
+ import { hasVerifiedValue } from '../../../../utils';
20
20
  import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
21
21
  import Collapse from '../../../../components/Collapse';
22
22
  import Text from '../../../../components/Text';
@@ -26,6 +26,7 @@ import InputSelect from '../../../shared/InputSelect';
26
26
  import CheckIcon from '../../../shared/CheckIcon';
27
27
  import { ScreenContainer } from '../../../shared/Containers';
28
28
  import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
29
+ import TextWithCurrency from '../../../../components/TextWithCurrency';
29
30
  var Container = styled(Box)(function () { return ({
30
31
  display: 'flex'
31
32
  }); });
@@ -45,16 +46,12 @@ var MonthlyIncome = function (props) {
45
46
  var settingsData = useAppSelector(settingsSelector).data;
46
47
  var monthlyIncomeList = (data.individualData.responseBody || {}).monthlyIncomeList;
47
48
  var monthlyIncomeControl = useController({ control: control, name: 'monthlyIncome' });
48
- var countryCode = settingsData.businessCountry;
49
49
  var user = (data.verify.responseBody || {}).user;
50
50
  var isMonthlyIncomeVerified = function (item) {
51
51
  if (!(item === null || item === void 0 ? void 0 : item.id))
52
52
  return false;
53
53
  return hasVerifiedValue(user === null || user === void 0 ? void 0 : user.data_verification, "monthly_income.".concat(item.id));
54
54
  };
55
- var getCurrency = React.useMemo(function () {
56
- return t(getCurrencyByCountryIso2(countryCode.iso2));
57
- }, [countryCode.iso2]);
58
55
  React.useEffect(function () {
59
56
  if ((monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.length) > 0) {
60
57
  setIncomeList(monthlyIncomeList);
@@ -83,9 +80,7 @@ var MonthlyIncome = function (props) {
83
80
  };
84
81
  var income = monthlyIncomeControl.field.value;
85
82
  var error = (_a = monthlyIncomeControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
86
- return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(InputSelect, { label: t('please_enter_actual_income', {
87
- currency: getCurrency
88
- }), required: true, readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, placeholder: t('choose_any_source_of_income'), value: (isAr ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error), endAdornment: _jsx(EndAdornmentExpanded, { isVerified: isMonthlyIncomeVerified(income), anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
83
+ return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(InputSelect, { label: _jsx(TextWithCurrency, { text: t('monthly_income'), countryCode: settingsData.businessCountry.iso2 }), required: true, readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, placeholder: t('choose_any_source_of_income'), value: (isAr ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error), endAdornment: _jsx(EndAdornmentExpanded, { isVerified: isMonthlyIncomeVerified(income), anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
89
84
  return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (income === null || income === void 0 ? void 0 : income.id) }, { children: isAr ? item.range.ar : item === null || item === void 0 ? void 0 : item.range.en })) }), item.id === (income === null || income === void 0 ? void 0 : income.id) && _jsx(CheckIcon, { isVerified: isMonthlyIncomeVerified(item) })] }));
90
85
  } }) }))] })) })));
91
86
  };
@@ -14,13 +14,14 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import Collapse from '@mui/material/Collapse';
17
- import { formatNumberAsCurrency, getCurrencyByCountryIso2, removeAllCharsFromNumber } from '../../../../utils';
17
+ import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
18
18
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
19
19
  import { settingsSelector } from '../../../../app/settings';
20
20
  import { ScreenContainer } from '../../../shared/Containers';
21
21
  import Input from '../../../shared/Input';
22
22
  import { individualSelector, clearError } from '../../../app/individual/individualStore';
23
23
  import { EndAdornment } from '../../../shared/EndAdornment';
24
+ import TextWithCurrency from '../../../../components/TextWithCurrency';
24
25
  var ShareValue = function (_a) {
25
26
  var _b;
26
27
  var show = _a.show, readOnly = _a.readOnly;
@@ -29,7 +30,6 @@ var ShareValue = function (_a) {
29
30
  var control = useFormContext().control;
30
31
  var bckError = useAppSelector(individualSelector).error;
31
32
  var dispatch = useAppDispatch();
32
- var countryCode = settingsData.businessCountry;
33
33
  var handleChange = function (_a) {
34
34
  var target = _a.target;
35
35
  if (bckError)
@@ -37,14 +37,9 @@ var ShareValue = function (_a) {
37
37
  var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
38
38
  shareValueControl.field.onChange(value);
39
39
  };
40
- var getCurrency = React.useMemo(function () {
41
- return t(getCurrencyByCountryIso2(countryCode.iso2));
42
- }, [countryCode.iso2]);
43
40
  var shareValueControl = useController({ control: control, name: 'shareValue' });
44
41
  var shareValue = shareValueControl.field.value;
45
42
  var error = (_b = shareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
46
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('share_value_label', {
47
- currency: getCurrency
48
- }), onChange: handleChange, value: shareValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: shareValue, error: error }) }) })) })));
43
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: _jsx(TextWithCurrency, { text: t('share_value_input_label'), countryCode: settingsData.businessCountry.iso2 }), onChange: handleChange, value: shareValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: shareValue, error: error }) }) })) })));
49
44
  };
50
45
  export default React.memo(ShareValue);
@@ -10,7 +10,7 @@ var BoxStyled = styled(Box)(function (_a) {
10
10
  return (_b = {
11
11
  display: 'flex',
12
12
  justifyContent: 'center',
13
- paddingTop: theme.spacing(15.75)
13
+ paddingTop: theme.spacing(10)
14
14
  },
15
15
  _b[theme.breakpoints.down('sm')] = {
16
16
  paddingTop: theme.spacing(11)