@tap-payments/auth-jsconnect 2.11.14-development → 2.11.14-sandbox

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 (54) hide show
  1. package/build/@types/form.d.ts +2 -2
  2. package/build/api/account.d.ts +2 -2
  3. package/build/api/account.js +7 -4
  4. package/build/api/auth.d.ts +1 -1
  5. package/build/api/auth.js +7 -3
  6. package/build/api/headers.d.ts +5 -0
  7. package/build/api/headers.js +3 -0
  8. package/build/api/index.d.ts +4 -4
  9. package/build/api/operator.d.ts +1 -1
  10. package/build/api/operator.js +5 -2
  11. package/build/assets/locales/ar.json +5 -0
  12. package/build/assets/locales/en.json +7 -2
  13. package/build/components/Tooltip/Tooltip.js +1 -1
  14. package/build/constants/app.d.ts +1 -0
  15. package/build/constants/app.js +105 -18
  16. package/build/constants/flows.d.ts +1 -0
  17. package/build/constants/flows.js +2 -1
  18. package/build/features/app/auth/authStore.js +64 -54
  19. package/build/features/app/bank/bankStore.js +24 -20
  20. package/build/features/app/board/boardStore.js +11 -7
  21. package/build/features/app/brand/brandStore.js +22 -18
  22. package/build/features/app/business/businessStore.js +30 -26
  23. package/build/features/app/connect/connectStore.js +26 -22
  24. package/build/features/app/connectExpress/connectExpressStore.js +20 -7
  25. package/build/features/app/entity/entityStore.js +21 -17
  26. package/build/features/app/individual/individualStore.js +33 -28
  27. package/build/features/app/password/passwordStore.js +44 -46
  28. package/build/features/app/signIn/signInStore.js +12 -16
  29. package/build/features/app/tax/taxStore.js +20 -16
  30. package/build/features/app/terminal/terminalStore.js +5 -3
  31. package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +10 -7
  32. package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +4 -1
  33. package/build/features/auth/screens/AuthenticationList/EntityLicenseType.js +6 -4
  34. package/build/features/auth/screens/AuthenticationList/EntityList.js +9 -1
  35. package/build/features/business/screens/BusinessType/BusinessType.js +2 -3
  36. package/build/features/business/screens/BusinessType/LicenseList.js +5 -5
  37. package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +10 -10
  38. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +4 -1
  39. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +6 -4
  40. package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +9 -1
  41. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +6 -11
  42. package/build/features/connectExpress/screens/Mobile/Mobile.js +7 -6
  43. package/build/features/featuresScreens.js +60 -0
  44. package/build/features/shared/OTPVerifySecurityError/OTPVerifySecurityError.d.ts +3 -0
  45. package/build/features/shared/OTPVerifySecurityError/OTPVerifySecurityError.js +9 -0
  46. package/build/features/shared/OTPVerifySecurityError/index.d.ts +2 -0
  47. package/build/features/shared/OTPVerifySecurityError/index.js +2 -0
  48. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +59 -14
  49. package/build/features/terminal/screens/POSDeviceListPage/POSDeviceListPage.js +5 -2
  50. package/build/features/terminal/screens/Verify/Verify.js +6 -2
  51. package/build/utils/common.js +3 -3
  52. package/build/utils/error.d.ts +1 -0
  53. package/build/utils/error.js +3 -0
  54. package/package.json +2 -2
@@ -17,7 +17,7 @@ import Collapse from '@mui/material/Collapse';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
18
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
19
19
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
20
- import { deepCopy, isKW, sendCustomEventToGTM } from '../../../../utils';
20
+ import { deepCopy, isKW, isSA, sendCustomEventToGTM } from '../../../../utils';
21
21
  import { AuthForType } from '../../../../@types';
22
22
  import Form from '../../../../components/Form';
23
23
  import { ScreenContainer } from '../../../shared/Containers';
@@ -29,20 +29,20 @@ import BrandList from './BrandList';
29
29
  import EntityList from './EntityList';
30
30
  import LicenseNumber from './LicenseNumber';
31
31
  import EntityLegalName from './EntityLegalName';
32
- import LicenseType from './EntityLicenseType';
32
+ import EntityLicenseType from './EntityLicenseType';
33
33
  var ListType;
34
34
  (function (ListType) {
35
35
  ListType["BrandList"] = "BrandList";
36
36
  ListType["EntityList"] = "EntityList";
37
37
  })(ListType || (ListType = {}));
38
38
  var AuthenticationList = function (_a) {
39
- var _b;
39
+ var _b, _c;
40
40
  var settingsData = useAppSelector(settingsSelector).data;
41
- var _c = useAppSelector(connectExpressSelector), data = _c.data, loading = _c.loading, error = _c.error;
42
- var _d = data.authenticationData, brandInfo = _d.brandInfo, entityInfo = _d.entityInfo;
43
- var _e = React.useState(), listActive = _e[0], setListActive = _e[1];
41
+ var _d = useAppSelector(connectExpressSelector), data = _d.data, loading = _d.loading, error = _d.error;
42
+ var _e = data.authenticationData, brandInfo = _e.brandInfo, entityInfo = _e.entityInfo;
43
+ var _f = React.useState(), listActive = _f[0], setListActive = _f[1];
44
44
  var brandList = (((_b = data.responseData) === null || _b === void 0 ? void 0 : _b.authenticationData) || {}).brandList;
45
- var _f = React.useState(false), isAddEntity = _f[0], setIsAddEntity = _f[1];
45
+ var _g = React.useState(false), isAddEntity = _g[0], setIsAddEntity = _g[1];
46
46
  var otpData = data.otpData;
47
47
  var startWithNID = otpData.authFor === AuthForType.NATIONAL_ID;
48
48
  React.useEffect(function () {
@@ -63,6 +63,8 @@ var AuthenticationList = function (_a) {
63
63
  var t = useTranslation().t;
64
64
  var isAr = useLanguage().isAr;
65
65
  var dispatch = useAppDispatch();
66
+ var code = (_c = settingsData.businessCountry) === null || _c === void 0 ? void 0 : _c.iso2;
67
+ var isSACountry = React.useMemo(function () { return isSA(code); }, [code]);
66
68
  var onSubmit = function (formData) {
67
69
  if (isAddEntity) {
68
70
  var licenseNumber = formData.licenseNumber, legalName = formData.legalName, brandInfo_1 = formData.brandInfo, licenseType = formData.licenseType;
@@ -73,7 +75,6 @@ var AuthenticationList = function (_a) {
73
75
  dispatch(getMerchantListAsync(deepCopy(formData)));
74
76
  };
75
77
  var onBack = function () {
76
- var _a;
77
78
  if (isAddEntity) {
78
79
  setIsAddEntity(false);
79
80
  methods.setValue('licenseNumber', '');
@@ -82,7 +83,6 @@ var AuthenticationList = function (_a) {
82
83
  methods.setValue('entityInfo', undefined, { shouldValidate: true });
83
84
  return;
84
85
  }
85
- var code = (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2;
86
86
  var screen = startWithNID ? (isKW(code) ? 'CONNECT_EXPRESS_CIVIL_ID_STEP' : 'CONNECT_EXPRESS_NID_STEP') : 'CONNECT_EXPRESS_MOBILE_STEP';
87
87
  dispatch(resetAuthenticationScreen());
88
88
  dispatch(handlePrevScreenStep(screen));
@@ -99,6 +99,6 @@ var AuthenticationList = function (_a) {
99
99
  };
100
100
  var isBrandList = listActive === ListType.BrandList;
101
101
  var isEntityList = listActive === ListType.EntityList;
102
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, handleAddEntity: function (flag) { return setIsAddEntity(flag); }, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(LicenseType, {}), _jsx(LicenseNumber, {})] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: isAddEntity ? t('create_new_entity') : t('next') })) }))] })) })) }));
102
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, handleAddEntity: function (flag) { return setIsAddEntity(flag); }, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(EntityLicenseType, { show: isSACountry }), _jsx(LicenseNumber, {})] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: isAddEntity ? t('create_new_entity') : t('next') })) }))] })) })) }));
103
103
  };
104
104
  export default React.memo(AuthenticationList);
@@ -27,5 +27,8 @@ export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledCom
27
27
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "fr" | "in" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "mode" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "origin" | "method" | "operator" | "spacing" | "elevation" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
28
28
  ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
29
29
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
30
- declare const Type: () => JSX.Element;
30
+ declare type TypeProps = {
31
+ show: boolean;
32
+ };
33
+ declare const Type: ({ show }: TypeProps) => JSX.Element;
31
34
  export default Type;
@@ -26,6 +26,7 @@ import Tooltip from '../../../../components/Tooltip';
26
26
  import Radio from '../../../../components/Radio';
27
27
  import { clearError, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
28
28
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
29
+ import Collapse from '../../../../components/Collapse';
29
30
  var LabelTextStyled = styled(Text)(function (_a) {
30
31
  var theme = _a.theme;
31
32
  return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
@@ -70,12 +71,13 @@ export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
70
71
  display: 'inline-flex'
71
72
  });
72
73
  });
73
- var Type = function () {
74
+ var Type = function (_a) {
75
+ var show = _a.show;
74
76
  var t = useTranslation().t;
75
77
  var control = useFormContext().control;
76
78
  var error = useAppSelector(connectExpressSelector).error;
77
- var _a = React.useState(false), isCRHovered = _a[0], setIsCRHovered = _a[1];
78
- var _b = React.useState(false), isFLHovered = _b[0], setIsFLHovered = _b[1];
79
+ var _b = React.useState(false), isCRHovered = _b[0], setIsCRHovered = _b[1];
80
+ var _c = React.useState(false), isFLHovered = _c[0], setIsFLHovered = _c[1];
79
81
  var typeControl = useController({ control: control, name: 'licenseType' });
80
82
  var dispatch = useAppDispatch();
81
83
  var handleOnChange = function (_a) {
@@ -85,6 +87,6 @@ var Type = function () {
85
87
  typeControl.field.onChange(target.value);
86
88
  };
87
89
  var typeValue = typeControl.field.value;
88
- return (_jsxs(ScreenContainer, __assign({ sx: { pb: 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: typeValue ? (typeValue === LicenseType.FL ? LicenseType.FL : LicenseType.CR) : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: LicenseType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: LicenseType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })));
90
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: typeValue ? (typeValue === LicenseType.FL ? LicenseType.FL : LicenseType.CR) : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: LicenseType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: LicenseType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })) })));
89
91
  };
90
92
  export default Type;
@@ -43,9 +43,12 @@ import SimpleList from '../../../../components/SimpleList';
43
43
  import Text from '../../../../components/Text';
44
44
  import ExpandIcon from '../../../../components/ExpandIcon';
45
45
  import Collapse from '../../../../components/Collapse';
46
+ import { LicenseType } from '../../../../@types';
46
47
  import Icon from '../../../../components/Icon';
47
48
  import { connectExpressSelector } from '../../../../features/app/connectExpress/connectExpressStore';
48
49
  import { ADD_ENTITY } from '../../../../constants';
50
+ import { isSA } from '../../../../utils';
51
+ import { settingsSelector } from '../../../../app/settings';
49
52
  var EntityContainer = styled(Box)(function () { return ({
50
53
  display: 'flex',
51
54
  alignItems: 'center'
@@ -70,9 +73,11 @@ var EntityList = function (_a) {
70
73
  var isAr = useLanguage().isAr;
71
74
  var _f = useFormContext(), control = _f.control, watch = _f.watch, setValue = _f.setValue, getValues = _f.getValues;
72
75
  var data = useAppSelector(connectExpressSelector).data;
76
+ var businessCountry = useAppSelector(settingsSelector).data.businessCountry;
73
77
  var brandInfo = watch('brandInfo');
74
78
  var entityList = ((_c = (_b = data.responseData) === null || _b === void 0 ? void 0 : _b.authenticationData) === null || _c === void 0 ? void 0 : _c.entityList) || [];
75
79
  var selectedEntityControl = useController({ control: control, name: 'entityInfo' });
80
+ var isSACountry = React.useMemo(function () { return isSA(businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.iso2); }, [businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.iso2]);
76
81
  React.useEffect(function () {
77
82
  if (entityList.length > 0) {
78
83
  var filteredEntityList = entityList.filter(function (entity) { return (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) && entity.business_id === brandInfo.business_id; }) || [];
@@ -120,8 +125,11 @@ var EntityList = function (_a) {
120
125
  };
121
126
  var onSelectItem = function (entity) {
122
127
  selectedEntityControl.field.onChange(entity);
123
- if (entity.id === ADD_ENTITY)
128
+ if (entity.id === ADD_ENTITY) {
129
+ if (!isSACountry)
130
+ setValue('licenseType', LicenseType.CR);
124
131
  handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(true);
132
+ }
125
133
  else {
126
134
  setValue('licenseNumber', '');
127
135
  setValue('legalName', '');
@@ -28,9 +28,9 @@ import Box from '@mui/material/Box';
28
28
  import { styled } from '@mui/material/styles';
29
29
  import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
30
30
  import { BusinessType } from '../../../../@types';
31
- import { isKW, isOtherLicense, isOtherThanKWOrSA, isSA } from '../../../../utils';
31
+ import { isKW, isOtherLicense, isSA } from '../../../../utils';
32
32
  import { settingsSelector } from '../../../../app/settings';
33
- import { OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../../constants';
33
+ import { OTHER_CR_LICENSE } from '../../../../constants';
34
34
  import SimpleList from '../../../../components/SimpleList';
35
35
  import Text from '../../../../components/Text';
36
36
  import ExpandIcon from '../../../../components/ExpandIcon';
@@ -40,7 +40,6 @@ import InputSelect from '../../../shared/InputSelect';
40
40
  import CheckIcon from '../../../shared/CheckIcon';
41
41
  import { connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
42
42
  import LicenseNumber from './LicenseNumber';
43
- import LicenseType from './LicenseType';
44
43
  import UnifiedNumber from './UnifiedNumber';
45
44
  var InputStyled = styled(InputSelect)(function (_a) {
46
45
  var theme = _a.theme;
@@ -81,7 +80,6 @@ var LicenseList = function (_a) {
81
80
  setAnchorEl(null);
82
81
  (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
83
82
  };
84
- var isOtherThanKWOrSACountry = React.useMemo(function () { return isOtherThanKWOrSA(country_code); }, [country_code]);
85
83
  var isKWCountry = React.useMemo(function () { return isKW(country_code); }, [country_code]);
86
84
  var isSACountry = React.useMemo(function () { return isSA(country_code); }, [country_code]);
87
85
  React.useEffect(function () {
@@ -97,11 +95,8 @@ var LicenseList = function (_a) {
97
95
  }
98
96
  }, [licenseList, selectedLicense]);
99
97
  React.useEffect(function () {
100
- if (!!country_code) {
101
- if (isKWCountry) {
102
- var license = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR ? OTHER_CR_LICENSE : OTHER_FL_LICENSE;
103
- setValue('selectedLicense', license, { shouldValidate: true });
104
- }
98
+ if (!!country_code && !isSACountry) {
99
+ setValue('selectedLicense', OTHER_CR_LICENSE, { shouldValidate: true });
105
100
  }
106
101
  }, [country_code]);
107
102
  var getLicenseNumber = function (item) {
@@ -149,8 +144,8 @@ var LicenseList = function (_a) {
149
144
  var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.CR;
150
145
  var isFL = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.FL;
151
146
  var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : getLicenseNumber(selected);
152
- return (_jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: isSACountry || isOtherThanKWOrSACountry }, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly: readOnly, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: (isCR ? t(getLicenseName(selected)) : flValue) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
147
+ return (_jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: isSACountry }, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly: readOnly, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: (isCR ? t(getLicenseName(selected)) : flValue) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
153
148
  return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selected) }, { children: isOtherLicense(item) ? t(getLicenseName(item)) : getLicenseFullName(item) })) }), getLicenseNumber(item) === getLicenseNumber(selected) && _jsx(CheckIcon, {})] }));
154
- } }) }))] })), _jsx(LicenseType, { show: show && isKWCountry, readOnly: readOnly }), _jsx(LicenseNumber, { show: showLicenseNumber(), readOnly: licenseReadonly }), _jsx(UnifiedNumber, { show: isSACountry && isCR && show, readOnly: licenseReadonly })] }));
149
+ } }) }))] })), _jsx(LicenseNumber, { show: showLicenseNumber(), readOnly: licenseReadonly }), _jsx(UnifiedNumber, { show: isSACountry && isCR && show, readOnly: licenseReadonly })] }));
155
150
  };
156
151
  export default React.memo(LicenseList);
@@ -69,16 +69,16 @@ var OrBoxStyled = styled(Box)(function (_a) {
69
69
  });
70
70
  });
71
71
  var Mobile = function (_a) {
72
- var _b, _c;
72
+ var _b, _c, _d;
73
73
  var settingData = useAppSelector(settingsSelector).data;
74
- var _d = useAppSelector(connectExpressSelector), data = _d.data, loading = _d.loading, error = _d.error;
75
- var _e = React.useState(false), anchor = _e[0], setAnchor = _e[1];
74
+ var _e = useAppSelector(connectExpressSelector), data = _e.data, loading = _e.loading, error = _e.error;
75
+ var _f = React.useState(false), anchor = _f[0], setAnchor = _f[1];
76
76
  var t = useTranslation().t;
77
77
  var isAr = useLanguage().isAr;
78
78
  var dispatch = useAppDispatch();
79
- var _f = useCountry(settingData.businessCountry.iso2), isKuwait = _f.isKuwait, isOther = _f.isOther;
79
+ var _g = useCountry((_b = settingData.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2), isKuwait = _g.isKuwait, isOther = _g.isOther;
80
80
  var responseData = data.responseData, isLeadIdPassed = data.isLeadIdPassed;
81
- var isLeadIdentityIdAvailable = (_c = (_b = responseData === null || responseData === void 0 ? void 0 : responseData.leadData) === null || _b === void 0 ? void 0 : _b.identification) === null || _c === void 0 ? void 0 : _c.id;
81
+ var isLeadIdentityIdAvailable = (_d = (_c = responseData === null || responseData === void 0 ? void 0 : responseData.leadData) === null || _c === void 0 ? void 0 : _c.identification) === null || _d === void 0 ? void 0 : _d.id;
82
82
  var methods = useForm({
83
83
  resolver: yupResolver(PhoneValidationSchema(isLeadIdPassed)),
84
84
  defaultValues: data.mobileData,
@@ -95,13 +95,14 @@ var Mobile = function (_a) {
95
95
  dispatch(createMobileAuthAsync(deepCopy(formData)));
96
96
  };
97
97
  var onBack = function () {
98
+ var _a;
98
99
  var screen = isKuwait ? 'CONNECT_EXPRESS_CIVIL_ID_STEP' : 'CONNECT_EXPRESS_NID_STEP';
99
100
  var eventAction = isKuwait ? 'PACI Click' : 'Abser Click';
100
101
  sendCustomEventToGTM({
101
102
  event: 'Send Event',
102
103
  event_category: 'User Registration Flow',
103
104
  event_action: eventAction,
104
- event_label: settingData.businessCountry.iso2
105
+ event_label: (_a = settingData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2
105
106
  });
106
107
  dispatch(handlePrevScreenStep(screen));
107
108
  };
@@ -13,6 +13,7 @@ import ConnectOTPScreen from './connect/screens/OTP';
13
13
  import ThankYouScreen from './connect/screens/ThankYou';
14
14
  import OperatorError from './connect/screens/OperatorError';
15
15
  import CollectMobileOwnership from './connect/screens/MobileOwnership';
16
+ import OTPVerifySecurityError from './shared/OTPVerifySecurityError';
16
17
  import ConnectExpressBusinessCountry from './connectExpress/screens/BusinessCountry/BusinessCountry';
17
18
  import ConnectExpressMobileScreen from './connectExpress/screens/Mobile';
18
19
  import ConnectExpressNIDScreen from './connectExpress/screens/NID';
@@ -37,6 +38,7 @@ import ConnectExpressAuthMerchantScreen from './connectExpress/screens/AuthMerch
37
38
  import ConnectExpressAuthAccountCreatedLoaderScreen from './connectExpress/screens/AccountCreatedLoader';
38
39
  import ConnectExpressOperatorError from './connectExpress/screens/OperatorError';
39
40
  import ConnectExpressCollectMobileOwnership from './connectExpress/screens/MobileOwnership';
41
+ import ConnectExpressOTPVerifySecurityError from './shared/OTPVerifySecurityError';
40
42
  import AuthBusinessCountry from './auth/screens/BusinessCountry/BusinessCountry';
41
43
  import AuthSwitchScreen from './auth/screens/AuthSwitch';
42
44
  import AuthMobileScreen from './auth/screens/Mobile';
@@ -58,6 +60,7 @@ import AuthEmailSentScreen from './auth/screens/EmailSent';
58
60
  import AuthMigratingDataScreen from './auth/screens/MigratingData';
59
61
  import AuthOperatorError from './auth/screens/OperatorError';
60
62
  import AuthPasscodeScreen from './auth/screens/Passcode';
63
+ import AuthOTPVerifySecurityError from './shared/OTPVerifySecurityError';
61
64
  import CustomersPage from './business/screens/Customers';
62
65
  import IDBODPage from './business/screens/IDBOD';
63
66
  import BusinessVerifyPage from './business/screens/Verify';
@@ -73,6 +76,7 @@ import BusVerifyPACIScreen from './business/screens/VerifyPACI';
73
76
  import BrandVerifyScreen from './business/screens/BrandDetails';
74
77
  import BusinessOperatorError from './business/screens/OperatorError';
75
78
  import BusinessCollectMobileOwnership from './business/screens/MobileOwnership';
79
+ import BusinessOTPVerifySecurityError from './shared/OTPVerifySecurityError';
76
80
  import PasswordVerifyPage from './password/screens/Verify';
77
81
  import CreatePasswordPage from './password/screens/CreatePassword';
78
82
  import PasswordDataLoadingPage from './password/screens/PrepareDataLoading';
@@ -81,6 +85,7 @@ import SuccessPasswordPage from './password/screens/Success';
81
85
  import PasswordSuccessWithFlowPage from './password/screens/SuccessWithFlowButtons';
82
86
  import PasswordResetPasswordSuccessPage from './password/screens/ResetPasswordSuccess';
83
87
  import PasswordOperatorError from './password/screens/OperatorError';
88
+ import PasswordOTPVerifySecurityError from './shared/OTPVerifySecurityError';
84
89
  import IndividualVerifyPage from './individual/screens/Verify';
85
90
  import IndividualPhoneInfoPage from './individual/screens/IndividualPhoneInfo';
86
91
  import IndividualListPage from './individual/screens/IndividualList';
@@ -91,6 +96,7 @@ import IndividualSuccessWithFlowPage from './individual/screens/SuccessWithFlowB
91
96
  import IndividualResetPasswordSuccessPage from './individual/screens/ResetPasswordSuccess';
92
97
  import IndividualDataLoadingPage from './individual/screens/PrepareDataLoading';
93
98
  import IndividualOperatorError from './individual/screens/OperatorError';
99
+ import IndividualOTPVerifySecurityError from './shared/OTPVerifySecurityError';
94
100
  import BankVerifyPage from './bank/screens/Verify';
95
101
  import BankDetailsPage from './bank/screens/BankDetails';
96
102
  import BankSuccessPage from './bank/screens/Success';
@@ -98,6 +104,7 @@ import BankSuccessWithFlowPage from './bank/screens/SuccessWithFlowButtons';
98
104
  import BankResetPasswordSuccessPage from './bank/screens/ResetPasswordSuccess';
99
105
  import BankDataLoadingPage from './bank/screens/PrepareDataLoading';
100
106
  import BankOperatorError from './bank/screens/OperatorError';
107
+ import BankOTPVerifySecurityError from './shared/OTPVerifySecurityError';
101
108
  import TaxVerifyPage from './tax/screens/Verify';
102
109
  import TaxDetailsPage from './tax/screens/TaxDetails';
103
110
  import TaxSuccessPage from './tax/screens/Success';
@@ -105,6 +112,7 @@ import TaxSuccessWithFlowPage from './tax/screens/SuccessWithFlowButtons';
105
112
  import TaxResetPasswordSuccessPage from './tax/screens/ResetPasswordSuccess';
106
113
  import TaxDataLoadingPage from './tax/screens/PrepareDataLoading';
107
114
  import TaxOperatorError from './tax/screens/OperatorError';
115
+ import TaxOTPVerifySecurityError from './shared/OTPVerifySecurityError';
108
116
  import SignInMobilePage from './signIn/screens/Mobile';
109
117
  import SignInEmailPage from './signIn/screens/Email';
110
118
  import SignInOTPPage from './signIn/screens/OTP';
@@ -118,6 +126,7 @@ import EntitySuccessWithFlowPage from './entity/screens/SuccessWithFlowButtons';
118
126
  import EntityResetPasswordSuccessPage from './entity/screens/ResetPasswordSuccess';
119
127
  import EntityDataLoadingPage from './entity/screens/PrepareDataLoading';
120
128
  import EntityOperatorError from './entity/screens/OperatorError';
129
+ import EntityOTPVerifySecurityError from './shared/OTPVerifySecurityError';
121
130
  import BrandVerifyPage from './brand/screens/Verify';
122
131
  import BrandInfoPage from './brand/screens/BrandInfo';
123
132
  import BrandSegmentPage from './brand/screens/BrandSegmentInfo';
@@ -127,11 +136,13 @@ import BrandSuccessWithFlowPage from './brand/screens/SuccessWithFlowButtons';
127
136
  import BrandResetPasswordSuccessPage from './brand/screens/ResetPasswordSuccess';
128
137
  import BrandDataLoadingPage from './brand/screens/PrepareDataLoading';
129
138
  import BrandOperatorError from './brand/screens/OperatorError';
139
+ import BrandOTPVerifySecurityError from './shared/OTPVerifySecurityError';
130
140
  import BoardVerifyPage from './board/screens/Verify';
131
141
  import BoardSuccessWithFlowPage from './board/screens/SuccessWithFlowButtons';
132
142
  import BoardResetPasswordSuccessPage from './board/screens/ResetPasswordSuccess';
133
143
  import BoardDataLoadingPage from './board/screens/PrepareDataLoading';
134
144
  import BoardOperatorError from './board/screens/OperatorError';
145
+ import BoardOTPVerifySecurityError from './shared/OTPVerifySecurityError';
135
146
  import KycLoadingPage from './kyc/screens/Loading';
136
147
  import KycTokenErrorPage from './kyc/screens/TokenError';
137
148
  import KycAlreadySubmittedPage from './kyc/screens/AlreadySubmitted';
@@ -154,6 +165,7 @@ import LinkedSuccessPage from './terminal/screens/LinkedSuccess';
154
165
  import UnlinkedSuccessPage from './terminal/screens/UnlinkedSuccess';
155
166
  import TerminalBoardPage from './terminal/screens/SuccessWithFlowButtons';
156
167
  import TerminalResetPasswordSuccessPage from './terminal/screens/ResetPasswordSuccess';
168
+ import TerminalOTPVerifySecurityError from './shared/OTPVerifySecurityError';
157
169
  export var connectFeatureScreens = [
158
170
  {
159
171
  name: 'CONNECT_BUSINESS_COUNTRY_STEP',
@@ -210,6 +222,10 @@ export var connectFeatureScreens = [
210
222
  {
211
223
  name: 'CONNECT_MOBILE_OWNERSHIP',
212
224
  element: CollectMobileOwnership
225
+ },
226
+ {
227
+ name: 'CONNECT_OTP_VERIFY_SECURITY_ERROR_STEP',
228
+ element: OTPVerifySecurityError
213
229
  }
214
230
  ];
215
231
  export var connectExpressFeatureScreens = [
@@ -308,6 +324,10 @@ export var connectExpressFeatureScreens = [
308
324
  {
309
325
  name: 'COLLECT_MOBILE_OWNERSHIP',
310
326
  element: ConnectExpressCollectMobileOwnership
327
+ },
328
+ {
329
+ name: 'CONNECT_EXPRESS_OTP_VERIFY_SECURITY_ERROR_STEP',
330
+ element: ConnectExpressOTPVerifySecurityError
311
331
  }
312
332
  ];
313
333
  export var authFeatureScreens = [
@@ -394,6 +414,10 @@ export var authFeatureScreens = [
394
414
  {
395
415
  name: 'AUTH_OPERATOR_ERROR_STEP',
396
416
  element: AuthOperatorError
417
+ },
418
+ {
419
+ name: 'AUTH_OTP_VERIFY_SECURITY_ERROR_STEP',
420
+ element: AuthOTPVerifySecurityError
397
421
  }
398
422
  ];
399
423
  export var businessFeatureScreens = [
@@ -444,6 +468,10 @@ export var businessFeatureScreens = [
444
468
  {
445
469
  name: 'BUSINESS_MOBILE_OWNERSHIP',
446
470
  element: BusinessCollectMobileOwnership
471
+ },
472
+ {
473
+ name: 'BUSINESS_OTP_VERIFY_SECURITY_ERROR_STEP',
474
+ element: BusinessOTPVerifySecurityError
447
475
  }
448
476
  ];
449
477
  export var passwordFeatureScreens = [
@@ -475,6 +503,10 @@ export var passwordFeatureScreens = [
475
503
  {
476
504
  name: 'PASSWORD_OPERATOR_ERROR_STEP',
477
505
  element: PasswordOperatorError
506
+ },
507
+ {
508
+ name: 'PASSWORD_OTP_VERIFY_SECURITY_ERROR_STEP',
509
+ element: PasswordOTPVerifySecurityError
478
510
  }
479
511
  ];
480
512
  export var individualFeatureScreens = [
@@ -514,6 +546,10 @@ export var individualFeatureScreens = [
514
546
  {
515
547
  name: 'INDIVIDUAL_OPERATOR_ERROR_STEP',
516
548
  element: IndividualOperatorError
549
+ },
550
+ {
551
+ name: 'INDIVIDUAL_OTP_VERIFY_SECURITY_ERROR_STEP',
552
+ element: IndividualOTPVerifySecurityError
517
553
  }
518
554
  ];
519
555
  export var bankFeatureScreens = [
@@ -541,6 +577,10 @@ export var bankFeatureScreens = [
541
577
  {
542
578
  name: 'BANK_OPERATOR_ERROR_STEP',
543
579
  element: BankOperatorError
580
+ },
581
+ {
582
+ name: 'BANK_OTP_VERIFY_SECURITY_ERROR_STEP',
583
+ element: BankOTPVerifySecurityError
544
584
  }
545
585
  ];
546
586
  export var taxFeatureScreens = [
@@ -568,6 +608,10 @@ export var taxFeatureScreens = [
568
608
  {
569
609
  name: 'TAX_OPERATOR_ERROR_STEP',
570
610
  element: TaxOperatorError
611
+ },
612
+ {
613
+ name: 'TAX_OTP_VERIFY_SECURITY_ERROR_STEP',
614
+ element: TaxOTPVerifySecurityError
571
615
  }
572
616
  ];
573
617
  export var signInFeatureScreens = [
@@ -621,6 +665,10 @@ export var entityFeatureScreens = [
621
665
  {
622
666
  name: 'ENTITY_OPERATOR_ERROR_STEP',
623
667
  element: EntityOperatorError
668
+ },
669
+ {
670
+ name: 'ENTITY_OTP_VERIFY_SECURITY_ERROR_STEP',
671
+ element: EntityOTPVerifySecurityError
624
672
  }
625
673
  ];
626
674
  export var brandFeatureScreens = [
@@ -656,6 +704,10 @@ export var brandFeatureScreens = [
656
704
  {
657
705
  name: 'BRAND_OPERATOR_ERROR_STEP',
658
706
  element: BrandOperatorError
707
+ },
708
+ {
709
+ name: 'BRAND_OTP_VERIFY_SECURITY_ERROR_STEP',
710
+ element: BrandOTPVerifySecurityError
659
711
  }
660
712
  ];
661
713
  export var boardFeatureScreens = [
@@ -678,6 +730,10 @@ export var boardFeatureScreens = [
678
730
  {
679
731
  name: 'BOARD_OPERATOR_ERROR_STEP',
680
732
  element: BoardOperatorError
733
+ },
734
+ {
735
+ name: 'BOARD_OTP_VERIFY_SECURITY_ERROR_STEP',
736
+ element: BoardOTPVerifySecurityError
681
737
  }
682
738
  ];
683
739
  export var kycFeatureScreens = [
@@ -770,5 +826,9 @@ export var terminalFeatureScreens = [
770
826
  {
771
827
  name: CONNECT_FLOWS.terminal.resetPassword,
772
828
  element: TerminalResetPasswordSuccessPage
829
+ },
830
+ {
831
+ name: CONNECT_FLOWS.terminal.otpVerifySecurityError,
832
+ element: TerminalOTPVerifySecurityError
773
833
  }
774
834
  ];
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const _default: React.MemoExoticComponent<() => JSX.Element>;
3
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import GenericError from '../../shared/GenericError';
5
+ var OTPVerifySecurityError = function () {
6
+ var t = useTranslation().t;
7
+ return _jsx(GenericError, { error: t('something_went_wrong'), errorTitle: t('oops') });
8
+ };
9
+ export default React.memo(OTPVerifySecurityError);
@@ -0,0 +1,2 @@
1
+ import OTPVerifySecurityError from './OTPVerifySecurityError';
2
+ export default OTPVerifySecurityError;
@@ -0,0 +1,2 @@
1
+ import OTPVerifySecurityError from './OTPVerifySecurityError';
2
+ export default OTPVerifySecurityError;
@@ -9,32 +9,77 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (_) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
12
48
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
49
  import * as React from 'react';
14
50
  import { useTranslation } from 'react-i18next';
15
51
  import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
16
52
  import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
17
- import Button from '../../../../components/Button';
18
- import Loader from '../../../../components/Loader';
19
53
  import { ICONS_NAMES } from '../../../../constants';
20
54
  import { ScreenContainer } from '../../../shared/Containers';
21
- import { linkNewTerminal, retrieveBoardDetails, retrieveBoardStatus, terminalSelector } from '../../../app/terminal/terminalStore';
55
+ import { retrieveBoardDetails, retrieveBoardStatus, retrievePOSDevices, terminalSelector } from '../../../app/terminal/terminalStore';
22
56
  import { DescriptionTypography, DeviceImage, NoTerminalDeviceLinkedContainer, TitleTypography } from './styles';
57
+ import Button from '../../../../features/shared/Button';
23
58
  var NoTerminalDeviceLinked = function () {
24
59
  var t = useTranslation().t;
25
60
  var isAr = useLanguage().isAr;
26
61
  var dispatch = useAppDispatch();
27
- var _a = useAppSelector(terminalSelector), loading = _a.loading, data = _a.data;
62
+ var _a = useAppSelector(terminalSelector), posDevicesLoading = _a.posDevicesLoading, data = _a.data;
28
63
  var _b = data.responseData || {}, boardFlows = _b.boardFlows, authData = _b.authData, boardData = _b.boardData;
29
- var handleOnClickNewTerminalLink = function () {
30
- dispatch(linkNewTerminal())
31
- .unwrap()
32
- .then(function (_a) {
33
- var nextScreen = _a.nextScreen;
34
- dispatch(handleNextScreenStep(nextScreen));
35
- })
36
- .catch(function () { });
37
- };
64
+ var handleOnClickNewTerminalLink = function () { return __awaiter(void 0, void 0, void 0, function () {
65
+ var err_1;
66
+ return __generator(this, function (_a) {
67
+ switch (_a.label) {
68
+ case 0:
69
+ _a.trys.push([0, 2, , 3]);
70
+ return [4, dispatch(retrievePOSDevices()).unwrap()];
71
+ case 1:
72
+ _a.sent();
73
+ dispatch(handleNextScreenStep());
74
+ return [3, 3];
75
+ case 2:
76
+ err_1 = _a.sent();
77
+ console.log('Error while retrieving pos devices list error', err_1);
78
+ return [3, 3];
79
+ case 3: return [2];
80
+ }
81
+ });
82
+ }); };
38
83
  var handleOnBack = function () {
39
84
  if ((boardFlows === null || boardFlows === void 0 ? void 0 : boardFlows.length) > 0) {
40
85
  dispatch(handlePrevScreenStep());
@@ -53,6 +98,6 @@ var NoTerminalDeviceLinked = function () {
53
98
  })
54
99
  .catch(function () { });
55
100
  };
56
- return (_jsxs(ScreenContainer, __assign({ sx: { ml: 2.5, mr: 2.5 }, minHeight: 280, justifyContent: 'space-between' }, { children: [_jsxs(NoTerminalDeviceLinkedContainer, { children: [_jsx(DeviceImage, { src: ICONS_NAMES.terminal_device }), _jsx(TitleTypography, { children: t('terminal_no_terminal_linked') }), _jsx(DescriptionTypography, { children: t('terminal_no_terminal_linked_description') })] }), _jsx(Button, __assign({ sx: { mb: 1.5, mt: 1.5 }, onClick: function () { return handleOnBack(); }, variant: 'text' }, { children: loading ? _jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 15, toggleAnimation: !!loading }) : t('back') }))] })));
101
+ return (_jsxs(ScreenContainer, __assign({ sx: { ml: 2.5, mr: 2.5 }, minHeight: 280, justifyContent: 'space-between' }, { children: [_jsxs(NoTerminalDeviceLinkedContainer, { children: [_jsx(DeviceImage, { src: ICONS_NAMES.terminal_device }), _jsx(TitleTypography, { children: t('terminal_no_terminal_linked') }), _jsx(DescriptionTypography, { children: t('terminal_no_terminal_linked_description') })] }), _jsx(Button, __assign({ sx: { mt: 0, ml: 0, mr: 0 }, loading: posDevicesLoading, onBackClicked: handleOnBack, onClick: handleOnClickNewTerminalLink, isAr: isAr }, { children: t('terminal_link_terminal') }))] })));
57
102
  };
58
103
  export default React.memo(NoTerminalDeviceLinked);