@tap-payments/auth-jsconnect 2.12.1-beta → 2.13.0-beta

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 (34) hide show
  1. package/build/@types/form.d.ts +2 -0
  2. package/build/api/entity.d.ts +3 -0
  3. package/build/api/lead.d.ts +1 -0
  4. package/build/assets/locales/ar.json +48 -12
  5. package/build/assets/locales/en.json +51 -40
  6. package/build/constants/app.d.ts +9 -0
  7. package/build/constants/app.js +6 -3
  8. package/build/constants/validation.d.ts +1 -0
  9. package/build/constants/validation.js +1 -0
  10. package/build/features/app/business/businessStore.js +15 -10
  11. package/build/features/app/connectExpress/connectExpressStore.js +19 -4
  12. package/build/features/app/tax/taxStore.js +1 -1
  13. package/build/features/auth/screens/AuthenticationList/EntityList.js +2 -2
  14. package/build/features/business/screens/BusinessType/BusinessType.js +13 -2
  15. package/build/features/business/screens/BusinessType/EntityLicenseList.js +11 -5
  16. package/build/features/business/screens/BusinessType/LicenseList.js +15 -7
  17. package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +35 -0
  18. package/build/features/business/screens/BusinessType/UnifiedNumber.js +84 -0
  19. package/build/features/business/screens/BusinessType/validation.d.ts +6 -3
  20. package/build/features/business/screens/BusinessType/validation.js +31 -10
  21. package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +2 -2
  22. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -0
  23. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +23 -7
  24. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
  25. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +1 -1
  26. package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +36 -0
  27. package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.js +81 -0
  28. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +6 -3
  29. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +57 -21
  30. package/build/features/entity/screens/EntityName/EntityName.js +2 -1
  31. package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
  32. package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
  33. package/build/features/entity/screens/EntityName/validation.js +14 -3
  34. package/package.json +1 -1
@@ -76,8 +76,8 @@ var EntityList = function (_a) {
76
76
  var selectedEntity = selectedEntityControl.field.value;
77
77
  React.useEffect(function () {
78
78
  if (entityList.length > 0) {
79
- var filteredEntityList = entityList.filter(function (entity) { return (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) && entity.business_id === brandInfo.business_id; });
80
- var list_1 = __spreadArray(__spreadArray([], filteredEntityList, true), [entityList[entityList.length - 1]], false) || [];
79
+ var filteredEntityList = entityList.filter(function (entity) { return (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) && entity.business_id === brandInfo.business_id; }) || [];
80
+ var list_1 = __spreadArray(__spreadArray([], filteredEntityList, true), [entityList[entityList.length - 1]], false);
81
81
  setList(list_1);
82
82
  if (filteredEntityList.length) {
83
83
  setValue('entityInfo', filteredEntityList[0], { shouldValidate: true });
@@ -32,6 +32,7 @@ import Article from './Article';
32
32
  import EntityLicenseList from './EntityLicenseList';
33
33
  import LicenseNumber from './LicenseNumber';
34
34
  import EntityName from './EntityName';
35
+ import UnifiedNumber from './UnifiedNumber';
35
36
  var ListType;
36
37
  (function (ListType) {
37
38
  ListType["LicenseList"] = "LicenseList";
@@ -40,7 +41,7 @@ var ListType;
40
41
  var BusinessType = function (_a) {
41
42
  var _b = useAppSelector(businessSelector), data = _b.data, loading = _b.loading, error = _b.error, uploading = _b.uploading, uploadingArticle = _b.uploadingArticle;
42
43
  var settingsData = useAppSelector(settingsSelector).data;
43
- var _c = data.businessTypeData, selectedLicense = _c.selectedLicense, licenseNumber = _c.licenseNumber, entityLegalName = _c.entityLegalName, certificateId = _c.certificateId, articleId = _c.articleId, selectedEntityLicense = _c.selectedEntityLicense, responseBody = _c.responseBody, isPrevDob = _c.isPrevDob;
44
+ var _c = data.businessTypeData, selectedLicense = _c.selectedLicense, licenseNumber = _c.licenseNumber, entityLegalName = _c.entityLegalName, certificateId = _c.certificateId, articleId = _c.articleId, selectedEntityLicense = _c.selectedEntityLicense, responseBody = _c.responseBody, isPrevDob = _c.isPrevDob, unifiedNumber = _c.unifiedNumber;
44
45
  var entityLicenseList = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.entityLicenseList) || [];
45
46
  var t = useTranslation().t;
46
47
  var isAr = useLanguage().isAr;
@@ -73,6 +74,7 @@ var BusinessType = function (_a) {
73
74
  selectedLicense: selectedLicense,
74
75
  selectedEntityLicense: selectedEntityLicense,
75
76
  licenseNumber: licenseNumber,
77
+ unifiedNumber: unifiedNumber,
76
78
  entityLegalName: entityLegalName,
77
79
  certificateId: certificateId,
78
80
  articleId: articleId
@@ -89,6 +91,7 @@ var BusinessType = function (_a) {
89
91
  selectedLicense: data.selectedLicense,
90
92
  selectedEntityLicense: data.selectedEntityLicense,
91
93
  licenseNumber: data.licenseNumber,
94
+ unifiedNumber: data.unifiedNumber,
92
95
  entityLegalName: data.entityLegalName,
93
96
  certificateId: data.certificateId,
94
97
  articleId: data.articleId
@@ -98,17 +101,25 @@ var BusinessType = function (_a) {
98
101
  var onBack = function () {
99
102
  dispatch(handlePrevScreenStep(isPrevDob ? 'BUSINESS_DOB_STEP' : 'BUSINESS_IDBOD_STEP'));
100
103
  };
104
+ var showLicenseNumber = function () {
105
+ if (isKWCountry)
106
+ return !isAnyListActive && isCR;
107
+ if (isSACountry)
108
+ return !isAnyListActive && isFL;
109
+ return !isAnyListActive;
110
+ };
101
111
  var isLicenseListActive = listActive === ListType.LicenseList;
102
112
  var isEntityLicenseListActive = listActive === ListType.EntityLicenseList;
103
113
  var isAnyListActive = isLicenseListActive || isEntityLicenseListActive;
104
114
  var selected = methods.getValues('selectedLicense');
105
115
  var selectedLicenseEntity = methods.getValues('selectedEntityLicense');
106
116
  var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === Type.CR;
117
+ var isFL = (selected === null || selected === void 0 ? void 0 : selected.type) === Type.FL;
107
118
  var hasEntityList = !!(entityLicenseList === null || entityLicenseList === void 0 ? void 0 : entityLicenseList.length);
108
119
  var showLicenseList = hasEntityList ? (isSACountry || isOtherCountry) && isOtherLicense(selectedLicenseEntity) : isSACountry || isOtherCountry;
109
120
  var showEntityList = isKWCountry ? hasEntityList && !isLicenseListActive && isCR : hasEntityList && !isLicenseListActive;
110
121
  var disabled = !methods.formState.isValid || uploading || uploadingArticle;
111
122
  var disableBack = !data.otpData.isNID;
112
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(LicenseType, { show: !listActive && isKWCountry }), _jsx(EntityLicenseList, { show: showEntityList, onListOpen: function () { return handleMenuClick(ListType.EntityLicenseList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(LicenseList, { show: showLicenseList && !isEntityLicenseListActive, onListOpen: function () { return handleMenuClick(ListType.LicenseList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityName, { show: !isAnyListActive && isKWCountry && isCR }), _jsx(LicenseNumber, { show: isKWCountry ? !isAnyListActive && isCR : !isAnyListActive }), _jsx(LicenseCertificate, { show: !isAnyListActive && isKWCountry && isCR }), _jsx(Article, { show: !isAnyListActive && isKWCountry && isCR }), _jsx(Collapse, __assign({ in: !isAnyListActive, timeout: 500 }, { children: _jsx(Button, __assign({ disableBack: disableBack, onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
123
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(LicenseType, { show: !listActive && isKWCountry }), _jsx(EntityLicenseList, { show: showEntityList, onListOpen: function () { return handleMenuClick(ListType.EntityLicenseList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(LicenseList, { show: showLicenseList && !isEntityLicenseListActive, onListOpen: function () { return handleMenuClick(ListType.LicenseList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityName, { show: !isAnyListActive && isKWCountry && isCR }), _jsx(LicenseNumber, { show: showLicenseNumber() }), _jsx(UnifiedNumber, { show: isSACountry && isCR && !isAnyListActive }), _jsx(LicenseCertificate, { show: !isAnyListActive && isKWCountry && isCR }), _jsx(Article, { show: !isAnyListActive && isKWCountry && isCR }), _jsx(Collapse, __assign({ in: !isAnyListActive, timeout: 500 }, { children: _jsx(Button, __assign({ disableBack: disableBack, onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
113
124
  };
114
125
  export default React.memo(BusinessType);
@@ -36,7 +36,7 @@ import { businessSelector, clearError } from '../../../app/business/businessStor
36
36
  import Text from '../../../../components/Text';
37
37
  import ExpandIcon from '../../../../components/ExpandIcon';
38
38
  import Collapse from '../../../../components/Collapse';
39
- import { isKW, isOtherLicense } from '../../../../utils';
39
+ import { isKW, isOtherLicense, isSA } from '../../../../utils';
40
40
  import { settingsSelector } from '../../../../app/settings';
41
41
  import { OTHER_CR_LICENSE } from '../../../../constants';
42
42
  var InputStyled = styled(InputSelect)(function (_a) {
@@ -67,6 +67,7 @@ var EntityLicenseList = function (_a) {
67
67
  var entityLicenseList = (responseBody || {}).entityLicenseList;
68
68
  var country_code = settingsData.businessCountry.iso2;
69
69
  var isKWCountry = React.useMemo(function () { return isKW(country_code); }, [country_code]);
70
+ var isSACountry = React.useMemo(function () { return isSA(country_code); }, [country_code]);
70
71
  var onOpenLicenseList = function (event) {
71
72
  var _a;
72
73
  setAnchorEl(event.currentTarget);
@@ -90,8 +91,10 @@ var EntityLicenseList = function (_a) {
90
91
  }
91
92
  }, [entityLicenseList, selectedEntityLicense]);
92
93
  var getLicenseNumber = function (item) {
93
- var _a;
94
- return ((_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number) || '';
94
+ var _a, _b, _c;
95
+ if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.CR && isSACountry)
96
+ return ((_b = (_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number) || '';
97
+ return ((_c = item === null || item === void 0 ? void 0 : item.license) === null || _c === void 0 ? void 0 : _c.number) || '';
95
98
  };
96
99
  var getLicenseName = function (item) {
97
100
  var _a, _b;
@@ -100,6 +103,7 @@ var EntityLicenseList = function (_a) {
100
103
  return t((isAr ? (_a = item === null || item === void 0 ? void 0 : item.legal_name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.legal_name) === null || _b === void 0 ? void 0 : _b.en) || '');
101
104
  };
102
105
  var onSelectItem = function (license) {
106
+ var _a, _b, _c;
103
107
  if (error)
104
108
  dispatch(clearError());
105
109
  selectedEntityLicenseControl.field.onChange(license);
@@ -107,10 +111,12 @@ var EntityLicenseList = function (_a) {
107
111
  var license_1 = isKWCountry ? OTHER_CR_LICENSE : {};
108
112
  setValue('selectedLicense', license_1, { shouldValidate: true });
109
113
  setValue('licenseNumber', '', { shouldValidate: true });
114
+ setValue('unifiedNumber', '', { shouldValidate: true });
110
115
  }
111
116
  else {
112
117
  setValue('selectedLicense', license, { shouldValidate: true });
113
- setValue('licenseNumber', getLicenseNumber(license), { shouldValidate: true });
118
+ setValue('licenseNumber', ((_a = license === null || license === void 0 ? void 0 : license.license) === null || _a === void 0 ? void 0 : _a.number) || '', { shouldValidate: true });
119
+ setValue('unifiedNumber', ((_c = (_b = license === null || license === void 0 ? void 0 : license.license) === null || _b === void 0 ? void 0 : _b.additional_info) === null || _c === void 0 ? void 0 : _c.unified_number) || '', { shouldValidate: true });
114
120
  }
115
121
  onCloseLicenseList();
116
122
  };
@@ -122,7 +128,7 @@ var EntityLicenseList = function (_a) {
122
128
  var selected = selectedEntityLicenseControl.field.value;
123
129
  var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.CR;
124
130
  var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : getLicenseNumber(selected);
125
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('choose_entity_license'), onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_entity'), value: isCR ? t(getLicenseName(selected)) : flValue }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: entityLicenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
131
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('choose_entity_license'), onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_entity'), value: (isCR ? t(getLicenseName(selected)) : flValue) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: entityLicenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
126
132
  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, {})] }));
127
133
  } }) }))] }) })));
128
134
  };
@@ -36,7 +36,7 @@ import { businessSelector, clearError } from '../../../app/business/businessStor
36
36
  import Text from '../../../../components/Text';
37
37
  import ExpandIcon from '../../../../components/ExpandIcon';
38
38
  import Collapse from '../../../../components/Collapse';
39
- import { isKW, isOtherLicense } from '../../../../utils';
39
+ import { isKW, isOtherLicense, isSA } from '../../../../utils';
40
40
  import { OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../../constants';
41
41
  import { settingsSelector } from '../../../../app/settings';
42
42
  var InputStyled = styled(InputSelect)(function (_a) {
@@ -66,6 +66,7 @@ var LicenseList = function (_a) {
66
66
  var responseBody = businessTypeData.responseBody, selectedLicense = businessTypeData.selectedLicense, licenseNumber = businessTypeData.licenseNumber, entityLegalName = businessTypeData.entityLegalName;
67
67
  var licenseList = (responseBody || { licenseList: [] }).licenseList;
68
68
  var country_code = settingsData.businessCountry.iso2;
69
+ var isSACountry = React.useMemo(function () { return isSA(country_code); }, [country_code]);
69
70
  var onOpenLicenseList = function (event) {
70
71
  var _a;
71
72
  setAnchorEl(event.currentTarget);
@@ -99,8 +100,10 @@ var LicenseList = function (_a) {
99
100
  }
100
101
  }, [country_code]);
101
102
  var getLicenseNumber = function (item) {
102
- var _a;
103
- return ((_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number) || '';
103
+ var _a, _b, _c;
104
+ if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.CR && isSACountry)
105
+ return ((_b = (_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number) || '';
106
+ return ((_c = item === null || item === void 0 ? void 0 : item.license) === null || _c === void 0 ? void 0 : _c.number) || '';
104
107
  };
105
108
  var getLicenseName = function (item) {
106
109
  var _a, _b;
@@ -109,13 +112,18 @@ var LicenseList = function (_a) {
109
112
  return t((isAr ? (_a = item === null || item === void 0 ? void 0 : item.legal_name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.legal_name) === null || _b === void 0 ? void 0 : _b.en) || '');
110
113
  };
111
114
  var onSelectItem = function (license) {
115
+ var _a, _b, _c;
112
116
  if (error)
113
117
  dispatch(clearError());
114
118
  selectedLicenseControl.field.onChange(license);
115
- if (isOtherLicense(license))
119
+ if (isOtherLicense(license)) {
116
120
  setValue('licenseNumber', '', { shouldValidate: true });
117
- else
118
- setValue('licenseNumber', getLicenseNumber(license), { shouldValidate: true });
121
+ setValue('unifiedNumber', '', { shouldValidate: true });
122
+ }
123
+ else {
124
+ setValue('licenseNumber', ((_a = license === null || license === void 0 ? void 0 : license.license) === null || _a === void 0 ? void 0 : _a.number) || '', { shouldValidate: true });
125
+ setValue('unifiedNumber', ((_c = (_b = license === null || license === void 0 ? void 0 : license.license) === null || _b === void 0 ? void 0 : _b.additional_info) === null || _c === void 0 ? void 0 : _c.unified_number) || '', { shouldValidate: true });
126
+ }
119
127
  onCloseLicenseList();
120
128
  };
121
129
  var getLicenseFullName = function (item) {
@@ -126,7 +134,7 @@ var LicenseList = function (_a) {
126
134
  var selected = selectedLicenseControl.field.value;
127
135
  var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.CR;
128
136
  var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : getLicenseNumber(selected);
129
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('choose_any_license'), 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) {
137
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('choose_any_license'), 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) {
130
138
  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, {})] }));
131
139
  } }) }))] }) })));
132
140
  };
@@ -0,0 +1,35 @@
1
+ import * as React from 'react';
2
+ export declare const InfoIconStyled: import("@emotion/styled").StyledComponent<{
3
+ children?: React.ReactNode;
4
+ classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
5
+ color?: "inherit" | "disabled" | "error" | "info" | "success" | "action" | "primary" | "secondary" | "warning" | undefined;
6
+ fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
7
+ htmlColor?: string | undefined;
8
+ inheritViewBox?: boolean | undefined;
9
+ shapeRendering?: string | undefined;
10
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
11
+ titleAccess?: string | undefined;
12
+ viewBox?: string | undefined;
13
+ } & 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"> & {
14
+ ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
15
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
16
+ export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<{
17
+ children?: React.ReactNode;
18
+ classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
19
+ color?: "inherit" | "disabled" | "error" | "info" | "success" | "action" | "primary" | "secondary" | "warning" | undefined;
20
+ fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
21
+ htmlColor?: string | undefined;
22
+ inheritViewBox?: boolean | undefined;
23
+ shapeRendering?: string | undefined;
24
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
25
+ titleAccess?: string | undefined;
26
+ viewBox?: string | undefined;
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
+ ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
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
+ interface UnifiedNumberProps {
31
+ show: boolean;
32
+ isVerified?: boolean;
33
+ }
34
+ declare const _default: React.MemoExoticComponent<({ show, isVerified }: UnifiedNumberProps) => JSX.Element>;
35
+ export default _default;
@@ -0,0 +1,84 @@
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 { useTranslation } from 'react-i18next';
15
+ import { useController, useFormContext } from 'react-hook-form';
16
+ import { alpha, styled } from '@mui/material/styles';
17
+ import InfoIcon from '@mui/icons-material/Info';
18
+ import Box from '@mui/material/Box';
19
+ import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
20
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
+ import { isOtherLicense, removeAllCharsFromNumber } from '../../../../utils';
22
+ import Collapse from '../../../../components/Collapse';
23
+ import Tooltip from '../../../../components/Tooltip';
24
+ import Text from '../../../../components/Text';
25
+ import { ScreenContainer } from '../../../shared/Containers';
26
+ import Input from '../../../shared/Input';
27
+ import { clearError, businessSelector } from '../../../app/business/businessStore';
28
+ import { EndAdornment } from '../../../shared/EndAdornment';
29
+ var LabelContainerStyled = styled(Box)(function (_a) {
30
+ var theme = _a.theme;
31
+ return ({
32
+ display: 'flex',
33
+ justifyContent: 'space-between',
34
+ padding: theme.spacing(0, 2.5, 1, 2.5)
35
+ });
36
+ });
37
+ var InputLabelStyled = styled(Text)(function (_a) {
38
+ var theme = _a.theme;
39
+ return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
40
+ });
41
+ export var InfoIconStyled = styled(InfoIcon)(function (_a) {
42
+ var theme = _a.theme;
43
+ return ({
44
+ width: theme.spacing(2.75),
45
+ height: theme.spacing(2.125),
46
+ cursor: 'pointer',
47
+ color: alpha(theme.palette.text.primary, 0.4),
48
+ display: 'inline-flex'
49
+ });
50
+ });
51
+ export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
52
+ var theme = _a.theme;
53
+ return ({
54
+ width: theme.spacing(2.75),
55
+ height: theme.spacing(2.125),
56
+ cursor: 'pointer',
57
+ color: alpha(theme.palette.text.primary, 0.4),
58
+ display: 'inline-flex'
59
+ });
60
+ });
61
+ var UnifiedNumber = function (_a) {
62
+ var _b;
63
+ var show = _a.show, isVerified = _a.isVerified;
64
+ var t = useTranslation().t;
65
+ var bckError = useAppSelector(businessSelector).error;
66
+ var _c = useFormContext(), control = _c.control, getValues = _c.getValues;
67
+ var dispatch = useAppDispatch();
68
+ var _d = React.useState(false), hovered = _d[0], setHovered = _d[1];
69
+ var handleChange = function (_a) {
70
+ var target = _a.target;
71
+ if (bckError)
72
+ dispatch(clearError());
73
+ var value = removeAllCharsFromNumber(target.value);
74
+ unifiedNumberControl.field.onChange(value);
75
+ };
76
+ var unifiedNumberControl = useController({ control: control, name: 'unifiedNumber' });
77
+ var selectedLicense = getValues('selectedLicense');
78
+ var selectedEntityLicense = getValues('selectedEntityLicense');
79
+ var unifiedNumberValue = unifiedNumberControl.field.value;
80
+ var error = (_b = unifiedNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
81
+ var readOnly = !isOtherLicense(selectedLicense) || (selectedEntityLicense && !isOtherLicense(selectedEntityLicense));
82
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('v1_company_unified_number_label') }), _jsx(Tooltip, __assign({ title: t('v1_company_unified_number_description'), onMouseOver: function () { return setHovered(true); }, onMouseLeave: function () { return setHovered(false); }, onTouchStartCapture: function () { return setHovered(true); } }, { children: hovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(Input, { readOnly: readOnly, onChange: handleChange, value: unifiedNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('v1_company_unified_number_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: unifiedNumberValue, isVerified: isVerified }) })] })) })));
83
+ };
84
+ export default React.memo(UnifiedNumber);
@@ -1,13 +1,16 @@
1
1
  import * as yup from 'yup';
2
2
  export declare const LicenseValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
3
  selectedLicense: any;
4
- licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
+ unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
5
+ licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
5
6
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
6
7
  selectedLicense: any;
7
- licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
+ unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
9
+ licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
8
10
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
9
11
  selectedLicense: any;
10
- licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
12
+ unifiedNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
13
+ licenseNumber: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
11
14
  }>>>;
12
15
  export declare const KWLicenseValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
13
16
  selectedLicense: any;
@@ -1,34 +1,55 @@
1
1
  import * as yup from 'yup';
2
- import { REGEX_BRAND_NAME, KW_MIN_LICENSE_LENGTH, MAX_FILE_SIZE, VALID_FILE_FORMATS, FL_MIN_LICENSE_LENGTH, CR_MIN_LICENSE_LENGTH } from '../../../../constants';
2
+ import { REGEX_BRAND_NAME, KW_MIN_LICENSE_LENGTH, MAX_FILE_SIZE, VALID_FILE_FORMATS, FL_MIN_LICENSE_LENGTH, UNIFIED_NUMBER_MIN_LENGTH } from '../../../../constants';
3
3
  import { BusinessType } from '../../../../@types';
4
+ import { isOtherLicense } from '../../../../utils';
4
5
  var objectElements = {
5
6
  legal_name: yup.object().shape({
6
7
  ar: yup.string(),
7
8
  en: yup.string()
8
9
  }),
9
10
  license: yup.object().shape({
10
- number: yup.string()
11
+ number: yup.string().nullable()
11
12
  }),
12
13
  type: yup.string()
13
14
  };
14
15
  export var LicenseValidationSchema = yup.object().shape({
15
16
  selectedLicense: yup.object().shape(objectElements).required(''),
16
- licenseNumber: yup
17
- .string()
18
- .test({
17
+ unifiedNumber: yup.string().test({
18
+ name: 'unifiedNumber',
19
+ message: '',
19
20
  test: function (value) {
21
+ var _a;
22
+ var selectedEntityLicense = this.parent.selectedEntityLicense;
20
23
  var selectedLicense = this.parent.selectedLicense;
21
- var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
24
+ var isFL = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.FL;
22
25
  var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
26
+ if (!((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === null || _a === void 0 ? void 0 : _a.length))
27
+ return false;
28
+ if (isFL || !isOtherLicense(selectedEntityLicense))
29
+ return true;
23
30
  if (length === 0)
31
+ return this.createError({ message: '' });
32
+ return length >= UNIFIED_NUMBER_MIN_LENGTH ? true : this.createError({ message: 'unified_number_required' });
33
+ }
34
+ }),
35
+ licenseNumber: yup.string().test({
36
+ name: 'licenseNumber',
37
+ message: '',
38
+ test: function (value) {
39
+ var _a;
40
+ var selectedLicense = this.parent.selectedLicense;
41
+ var selectedEntityLicense = this.parent.selectedEntityLicense;
42
+ var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
43
+ var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
44
+ if (!((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === null || _a === void 0 ? void 0 : _a.length))
45
+ return false;
46
+ if (isCR || !isOtherLicense(selectedEntityLicense))
24
47
  return true;
25
- if (isCR) {
26
- return length >= CR_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'cr_max_length' });
27
- }
48
+ if (length === 0)
49
+ return this.createError({ message: '' });
28
50
  return length >= FL_MIN_LICENSE_LENGTH ? true : this.createError({ message: 'fl_max_length' });
29
51
  }
30
52
  })
31
- .required('')
32
53
  });
33
54
  export var KWLicenseValidationSchema = yup.object().shape({
34
55
  selectedLicense: yup.object().shape(objectElements).required(''),
@@ -75,8 +75,8 @@ var EntityList = function (_a) {
75
75
  var selectedEntityControl = useController({ control: control, name: 'entityInfo' });
76
76
  React.useEffect(function () {
77
77
  if (entityList.length > 0) {
78
- var filteredEntityList = entityList.filter(function (entity) { return (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) && entity.business_id === brandInfo.business_id; });
79
- var list_1 = __spreadArray(__spreadArray([], filteredEntityList, true), [entityList[entityList.length - 1]], false) || [];
78
+ var filteredEntityList = entityList.filter(function (entity) { return (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.business_id) && entity.business_id === brandInfo.business_id; }) || [];
79
+ var list_1 = __spreadArray(__spreadArray([], filteredEntityList, true), [entityList[entityList.length - 1]], false);
80
80
  setList(list_1);
81
81
  if (filteredEntityList.length) {
82
82
  setValue('entityInfo', filteredEntityList[0], { shouldValidate: true });
@@ -78,6 +78,7 @@ var CollectBusinessInfo = function (_a) {
78
78
  var onSubmit = function (data) {
79
79
  var dataValues = {
80
80
  brandName: data.brandName,
81
+ unifiedNumber: data.unifiedNumber,
81
82
  selectedLicense: data.selectedLicense,
82
83
  licenseNumber: data.licenseNumber,
83
84
  termAndConditionChecked: data.termAndConditionChecked
@@ -41,6 +41,7 @@ import CheckIcon from '../../../shared/CheckIcon';
41
41
  import { connectExpressSelector, clearError } from '../../../app/connectExpress/connectExpressStore';
42
42
  import LicenseNumber from './LicenseNumber';
43
43
  import LicenseType from './LicenseType';
44
+ import UnifiedNumber from './UnifiedNumber';
44
45
  var InputStyled = styled(InputSelect)(function (_a) {
45
46
  var theme = _a.theme;
46
47
  return ({
@@ -104,8 +105,10 @@ var LicenseList = function (_a) {
104
105
  }
105
106
  }, [country_code]);
106
107
  var getLicenseNumber = function (item) {
107
- var _a;
108
- return ((_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number) || '';
108
+ var _a, _b, _c;
109
+ if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.CR && isSACountry)
110
+ return ((_b = (_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number) || '';
111
+ return ((_c = item === null || item === void 0 ? void 0 : item.license) === null || _c === void 0 ? void 0 : _c.number) || '';
109
112
  };
110
113
  var getLicenseName = function (item) {
111
114
  var _a, _b;
@@ -114,13 +117,18 @@ var LicenseList = function (_a) {
114
117
  return t((isAr ? (_a = item === null || item === void 0 ? void 0 : item.legal_name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.legal_name) === null || _b === void 0 ? void 0 : _b.en) || '');
115
118
  };
116
119
  var onSelectItem = function (license) {
120
+ var _a, _b, _c;
117
121
  if (error)
118
122
  dispatch(clearError());
119
123
  selectedLicenseControl.field.onChange(license);
120
- if (isOtherLicense(license))
124
+ if (isOtherLicense(license)) {
121
125
  setValue('licenseNumber', '', { shouldValidate: true });
122
- else
123
- setValue('licenseNumber', getLicenseNumber(license), { shouldValidate: true });
126
+ setValue('unifiedNumber', '', { shouldValidate: true });
127
+ }
128
+ else {
129
+ setValue('licenseNumber', ((_a = license === null || license === void 0 ? void 0 : license.license) === null || _a === void 0 ? void 0 : _a.number) || '', { shouldValidate: true });
130
+ setValue('unifiedNumber', ((_c = (_b = license === null || license === void 0 ? void 0 : license.license) === null || _b === void 0 ? void 0 : _b.additional_info) === null || _c === void 0 ? void 0 : _c.unified_number) || '', { shouldValidate: true });
131
+ }
124
132
  onCloseLicenseList();
125
133
  };
126
134
  var getLicenseFullName = function (item) {
@@ -128,13 +136,21 @@ var LicenseList = function (_a) {
128
136
  return _jsx("span", { children: "".concat(getLicenseName(item), " - ").concat(getLicenseNumber(item)) });
129
137
  return _jsx("span", { children: "".concat(getLicenseNumber(item), " - ").concat(getLicenseName(item)) });
130
138
  };
139
+ var showLicenseNumber = function () {
140
+ if (isKWCountry)
141
+ return show && isCR;
142
+ if (isSACountry)
143
+ return show && isFL;
144
+ return show;
145
+ };
131
146
  var show = !anchorEl;
132
147
  var selected = selectedLicenseControl.field.value;
133
148
  var licenseReadonly = !isOtherLicense(selected);
134
149
  var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.CR;
150
+ var isFL = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.FL;
135
151
  var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : getLicenseNumber(selected);
136
- 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) {
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) {
137
153
  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, {})] }));
138
- } }) }))] })), _jsx(LicenseType, { show: show && isKWCountry, readOnly: readOnly }), _jsx(LicenseNumber, { show: isKWCountry ? isCR : show, readOnly: licenseReadonly })] }));
154
+ } }) }))] })), _jsx(LicenseType, { show: show && isKWCountry, readOnly: readOnly }), _jsx(LicenseNumber, { show: showLicenseNumber(), readOnly: licenseReadonly }), _jsx(UnifiedNumber, { show: isSACountry && isCR && show, readOnly: licenseReadonly })] }));
139
155
  };
140
156
  export default React.memo(LicenseList);
@@ -42,12 +42,12 @@ var LicenseNumber = function (_a) {
42
42
  var clearLicenseNumber = function () {
43
43
  licenseNumberControl.field.onChange('');
44
44
  };
45
- var licenseNumberValue = licenseNumberControl.field.value;
45
+ var licenseNumberValue = licenseNumberControl.field.value || '';
46
46
  var error = (_b = licenseNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
47
47
  var length = isKWCountry || isOtherThanKWOrSACountry ? KW_MAX_LICENSE_LENGTH : isCR ? CR_NUMBER_MAX_LENGTH : FL_NUMBER_MAX_LENGTH;
48
48
  var minLength = isKWCountry || isOtherThanKWOrSACountry ? KW_MIN_LICENSE_LENGTH : isCR ? CR_MIN_LICENSE_LENGTH : FL_MIN_LICENSE_LENGTH;
49
49
  var label = isCR ? 'cr_number' : 'fl_number';
50
50
  var showCheckIcon = isKWCountry || isOtherThanKWOrSACountry ? (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) >= minLength : (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) === length;
51
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, label: t(label), required: isKWCountry, onChange: handleFLNumberChange, inputProps: { maxLength: length }, value: licenseNumberValue, endAdornment: showCheckIcon || (readOnly && licenseNumberValue) ? _jsx(CheckIcon, {}) : licenseNumberValue && _jsx(ClearIcon, { onClick: clearLicenseNumber }), placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }) }) }) })));
51
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t(label), required: isKWCountry, onChange: handleFLNumberChange, inputProps: { maxLength: length }, value: licenseNumberValue, endAdornment: showCheckIcon || (readOnly && licenseNumberValue) ? _jsx(CheckIcon, {}) : licenseNumberValue && _jsx(ClearIcon, { onClick: clearLicenseNumber }), placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }) }) })) })));
52
52
  };
53
53
  export default React.memo(LicenseNumber);
@@ -77,6 +77,6 @@ var TAC = function (_a) {
77
77
  return;
78
78
  tacControl.field.onChange(checked);
79
79
  };
80
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsxs(TACContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })) })));
80
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(TACContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })) })));
81
81
  };
82
82
  export default React.memo(TAC);