@tap-payments/auth-jsconnect 2.8.88-sandbox → 2.8.91-development

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -778,6 +778,7 @@ export type CountryInfo = {
778
778
  export type BusinessCountryInfo = {
779
779
  id: number;
780
780
  title: string;
781
+ title_ar: string;
781
782
  countries: Array<CountryInfo>;
782
783
  };
783
784
  export {};
@@ -33,7 +33,7 @@ var StyledTooltip = styled(function (_a) {
33
33
  var _b;
34
34
  var theme = _a.theme;
35
35
  return (_b = {},
36
- _b["& .".concat(tooltipClasses.tooltip)] = __assign(__assign({ color: alpha(theme.palette.text.primary, 0.5), width: 'fit-content', maxHeight: 'fit-content' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight, backgroundColor: theme.palette.secondary.light, border: "1px solid ".concat(alpha(theme.palette.divider, 0.8)), zIndex: 2147483647 }),
36
+ _b["& .".concat(tooltipClasses.tooltip)] = __assign(__assign({ color: alpha(theme.palette.text.primary, 0.5), width: 'fit-content', maxHeight: 'fit-content' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight, backgroundColor: theme.palette.secondary.light, border: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) }),
37
37
  _b);
38
38
  });
39
39
  var TextStyled = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
@@ -1,6 +1,5 @@
1
1
  import { ScreenStepNavigation, BusinessType } from '../@types';
2
2
  export declare const CONNECT_DEV_URL = "https://connect.dev.tap.company";
3
- export declare const CONNECT_SANDBOX_URL = "https://connect.sandbox.tap.company";
4
3
  export declare const CONNECT_PROD_URL = "https://connect.tap.company";
5
4
  export declare const CLIENT_ORIGIN: string;
6
5
  export declare const TAP_WEBSITE = "https://www.tap.company/";
@@ -1,6 +1,5 @@
1
1
  import { BusinessType } from '../@types';
2
2
  export var CONNECT_DEV_URL = 'https://connect.dev.tap.company';
3
- export var CONNECT_SANDBOX_URL = 'https://connect.sandbox.tap.company';
4
3
  export var CONNECT_PROD_URL = 'https://connect.tap.company';
5
4
  export var CLIENT_ORIGIN = window.location.origin;
6
5
  export var TAP_WEBSITE = 'https://www.tap.company/';
@@ -596,6 +596,7 @@ export var BUSINESS_COUNTRIES = [
596
596
  {
597
597
  id: 1,
598
598
  title: 'Middle East',
599
+ title_ar: 'الشرق الأوسط',
599
600
  countries: [
600
601
  {
601
602
  id: 1,
@@ -737,6 +738,7 @@ export var BUSINESS_COUNTRIES = [
737
738
  {
738
739
  id: 2,
739
740
  title: 'Europe',
741
+ title_ar: 'أوروبا',
740
742
  countries: [
741
743
  {
742
744
  id: 6,
@@ -848,6 +850,7 @@ export var BUSINESS_COUNTRIES = [
848
850
  {
849
851
  id: 6,
850
852
  title: 'South Asia',
853
+ title_ar: 'جنوب آسيا',
851
854
  countries: [
852
855
  {
853
856
  id: 15,
@@ -884,6 +887,7 @@ export var BUSINESS_COUNTRIES = [
884
887
  {
885
888
  id: 5,
886
889
  title: 'South East Asia',
890
+ title_ar: 'جنوب شرق آسيا',
887
891
  countries: [
888
892
  {
889
893
  id: 9,
@@ -770,7 +770,7 @@ export var verifyPaciLeadIdentityAsync = createAsyncThunk('connectExpress/verify
770
770
  case 6:
771
771
  count++;
772
772
  return [3, 1];
773
- case 7: throw new Error('nafath_verification_failed');
773
+ case 7: throw new Error('paci_verification_failed');
774
774
  }
775
775
  });
776
776
  }); });
@@ -19,7 +19,7 @@ import Text from '../../../../components/Text';
19
19
  import { clearError, authSelector, verifyMobileOtp, resetOTPValue, verifyEmailOtp } from '../../../app/auth/authStore';
20
20
  import Button from '../../../shared/Button';
21
21
  import { ScreenContainer } from '../../../shared/Containers';
22
- import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
22
+ import { useAppDispatch, useAppSelector, useLanguage, useSanitizedTranslation } from '../../../../hooks';
23
23
  import { handlePrevScreenStep } from '../../../../app/settings';
24
24
  import { AuthForType, AuthTypeNumber } from '../../../../@types';
25
25
  import { yupResolver } from '@hookform/resolvers/yup';
@@ -51,6 +51,7 @@ var OTP = function () {
51
51
  var dispatch = useAppDispatch();
52
52
  var _b = useAppSelector(authSelector), data = _b.data, loading = _b.loading, error = _b.error;
53
53
  var t = useTranslation().t;
54
+ var st = useSanitizedTranslation();
54
55
  var isAr = useLanguage().isAr;
55
56
  var _c = ((_a = data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse) || {}, auth_type = _c.auth_type, email = _c.email, mobile = _c.mobile;
56
57
  var methods = useForm({
@@ -79,10 +80,10 @@ var OTP = function () {
79
80
  return t('opt_nid_sent_title', { provider: 'ABSHER' });
80
81
  if (isEmailAuth) {
81
82
  if (auth_type === AuthTypeNumber.EMAIL_OTP)
82
- return t('otp_email_sent_title');
83
- return t('ide_opt_sent_title');
83
+ return st('otp_email_sent_title');
84
+ return st('ide_opt_sent_title');
84
85
  }
85
- return t('ide_opt_sent_title');
86
+ return st('ide_opt_sent_title');
86
87
  };
87
88
  React.useEffect(function () {
88
89
  if (error)
@@ -112,6 +113,6 @@ var OTP = function () {
112
113
  dispatch(handlePrevScreenStep(screen));
113
114
  };
114
115
  var disabled = !methods.formState.isValid;
115
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : getTitle(), !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: getNumber() }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
116
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : getTitle(), !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: getNumber() }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
116
117
  };
117
118
  export default React.memo(OTP);
@@ -17,7 +17,7 @@ import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
18
  import Box from '@mui/material/Box/Box';
19
19
  import { styled } from '@mui/material/styles';
20
- import { useLanguage, useAppSelector } from '../../../../hooks';
20
+ import { useLanguage, useAppSelector, useSanitizedTranslation } from '../../../../hooks';
21
21
  import { deepCopy, maskPhone } from '../../../../utils';
22
22
  import Form from '../../../../components/Form';
23
23
  import Text from '../../../../components/Text';
@@ -48,6 +48,7 @@ var FormStyled = styled(Form)(function () { return ({
48
48
  var VerifyNumber = function (_a) {
49
49
  var _b, _c;
50
50
  var dispatch = useAppDispatch();
51
+ var st = useSanitizedTranslation();
51
52
  var _d = useAppSelector(bankSelector), data = _d.data, loading = _d.loading, error = _d.error;
52
53
  var methods = useForm({
53
54
  resolver: yupResolver(OTPValidation),
@@ -69,6 +70,6 @@ var VerifyNumber = function (_a) {
69
70
  dispatch(verifyBankLeadOTP(deepCopy(formData)));
70
71
  };
71
72
  var disabled = !methods.formState.isValid || !phone || resendLoading;
72
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
73
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : st('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
73
74
  };
74
75
  export default React.memo(VerifyNumber);
@@ -17,7 +17,7 @@ import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
18
  import Box from '@mui/material/Box/Box';
19
19
  import { styled } from '@mui/material/styles';
20
- import { useLanguage, useAppSelector } from '../../../../hooks';
20
+ import { useLanguage, useAppSelector, useSanitizedTranslation } from '../../../../hooks';
21
21
  import { deepCopy, maskPhone } from '../../../../utils';
22
22
  import Form from '../../../../components/Form';
23
23
  import Text from '../../../../components/Text';
@@ -55,6 +55,7 @@ var VerifyNumber = function (_a) {
55
55
  mode: 'onChange'
56
56
  });
57
57
  var t = useTranslation().t;
58
+ var st = useSanitizedTranslation();
58
59
  var isAr = useLanguage().isAr;
59
60
  var _e = React.useState(false), resendLoading = _e[0], setResendLoading = _e[1];
60
61
  var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to;
@@ -69,6 +70,6 @@ var VerifyNumber = function (_a) {
69
70
  dispatch(verifyBoardLeadOTP(deepCopy(formData)));
70
71
  };
71
72
  var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
72
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
73
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : st('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
73
74
  };
74
75
  export default React.memo(VerifyNumber);
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
- import { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
14
+ import { useAppDispatch, useSetFromDefaultValues, useSanitizedTranslation } from '../../../../hooks';
15
15
  import { useTranslation } from 'react-i18next';
16
16
  import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
@@ -59,6 +59,7 @@ var VerifyNumber = function (_a) {
59
59
  });
60
60
  useSetFromDefaultValues(methods, data.otpData);
61
61
  var t = useTranslation().t;
62
+ var st = useSanitizedTranslation();
62
63
  var isAr = useLanguage().isAr;
63
64
  var _e = React.useState(false), resendLoading = _e[0], setResendLoading = _e[1];
64
65
  var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to;
@@ -73,6 +74,6 @@ var VerifyNumber = function (_a) {
73
74
  dispatch(verifyBrandLeadOTP(deepCopy(formData)));
74
75
  };
75
76
  var disabled = !methods.formState.isValid || !phone || resendLoading;
76
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
77
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : st('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
77
78
  };
78
79
  export default React.memo(VerifyNumber);
@@ -102,7 +102,7 @@ var ActivityList = function (_a) {
102
102
  var controlValue = activitiesControl.field.value;
103
103
  var selectedActivity = data.activitiesData.activities;
104
104
  React.useEffect(function () {
105
- if ((selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) !== (controlValue === null || controlValue === void 0 ? void 0 : controlValue.length))
105
+ if ((selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) && selectedActivity.length !== (controlValue === null || controlValue === void 0 ? void 0 : controlValue.length))
106
106
  setValue('activities', selectedActivity);
107
107
  }, [selectedActivity]);
108
108
  var handleOpenActivityMenu = function (event) {
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
14
+ import { useAppDispatch, useAppSelector, useSanitizedTranslation } from '../../../../hooks';
15
15
  import { useTranslation } from 'react-i18next';
16
16
  import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
@@ -49,6 +49,7 @@ var FormStyled = styled(Form)(function () { return ({
49
49
  var VerifyNumber = function (_a) {
50
50
  var _b, _c;
51
51
  var dispatch = useAppDispatch();
52
+ var st = useSanitizedTranslation();
52
53
  var settingsData = useAppSelector(settingsSelector).data;
53
54
  var _d = useAppSelector(businessSelector), data = _d.data, loading = _d.loading, error = _d.error;
54
55
  var methods = useForm({
@@ -83,6 +84,6 @@ var VerifyNumber = function (_a) {
83
84
  dispatch(handlePrevScreenStep());
84
85
  };
85
86
  var disabled = !methods.formState.isValid || !phone || resendLoading;
86
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
87
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : st('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
87
88
  };
88
89
  export default React.memo(VerifyNumber);
@@ -18,9 +18,8 @@ import Text from '../../../../components/Text';
18
18
  import { clearError, connectSelector, resetOTPScreen, verifyAuth } from '../../../app/connect/connectStore';
19
19
  import Button from '../../../shared/Button';
20
20
  import { ScreenContainer } from '../../../shared/Containers';
21
- import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
21
+ import { useAppDispatch, useAppSelector, useLanguage, useSetFromDefaultValues, useSanitizedTranslation } from '../../../../hooks';
22
22
  import { handlePrevScreenStep } from '../../../../app/settings';
23
- import { useLanguage } from '../../../../hooks';
24
23
  import { AuthForType } from '../../../../@types';
25
24
  import { useForm, FormProvider } from 'react-hook-form';
26
25
  import { yupResolver } from '@hookform/resolvers/yup';
@@ -50,6 +49,7 @@ var FormStyled = styled(Form)(function () { return ({
50
49
  var OTP = function () {
51
50
  var _a;
52
51
  var dispatch = useAppDispatch();
52
+ var t = useTranslation().t;
53
53
  var _b = useAppSelector(connectSelector), data = _b.data, loading = _b.loading, error = _b.error;
54
54
  var otp = data.otpData.otp;
55
55
  var methods = useForm({
@@ -60,7 +60,7 @@ var OTP = function () {
60
60
  mode: 'onChange'
61
61
  });
62
62
  useSetFromDefaultValues(methods, data.otpData);
63
- var t = useTranslation().t;
63
+ var st = useSanitizedTranslation();
64
64
  var isAr = useLanguage().isAr;
65
65
  var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
66
66
  React.useEffect(function () {
@@ -86,7 +86,7 @@ var OTP = function () {
86
86
  var disabled = !methods.formState.isValid;
87
87
  var phone = data.mobileData.mobile ? ((_a = data.mobileData.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix) + data.mobileData.mobile : '';
88
88
  var idNumber = data.nidData.nid;
89
- var title = startWithNID ? t('opt_nid_sent_title', { provider: 'ABSHER' }) : t('ide_opt_sent_title');
90
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: startWithNID ? maskID(idNumber) : maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
89
+ var title = startWithNID ? t('opt_nid_sent_title', { provider: 'ABSHER' }) : st('ide_opt_sent_title');
90
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: startWithNID ? maskID(idNumber) : maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
91
91
  };
92
92
  export default React.memo(OTP);
@@ -18,7 +18,7 @@ import Text from '../../../../components/Text';
18
18
  import { clearError, connectExpressSelector, verifyMobileOtpAsync, resetOTPValue } from '../../../app/connectExpress/connectExpressStore';
19
19
  import Button from '../../../shared/Button';
20
20
  import { ScreenContainer } from '../../../shared/Containers';
21
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
+ import { useAppDispatch, useAppSelector, useSanitizedTranslation } from '../../../../hooks';
22
22
  import { handlePrevScreenStep } from '../../../../app/settings';
23
23
  import { useLanguage } from '../../../../hooks';
24
24
  import { useForm, FormProvider } from 'react-hook-form';
@@ -51,6 +51,7 @@ var OTP = function () {
51
51
  var dispatch = useAppDispatch();
52
52
  var _b = useAppSelector(connectExpressSelector), data = _b.data, loading = _b.loading, error = _b.error;
53
53
  var t = useTranslation().t;
54
+ var st = useSanitizedTranslation();
54
55
  var isAr = useLanguage().isAr;
55
56
  var methods = useForm({
56
57
  resolver: yupResolver(OTPValidation),
@@ -80,6 +81,6 @@ var OTP = function () {
80
81
  var disabled = !methods.formState.isValid;
81
82
  var phone = data.mobileData.mobile ? ((_a = data.mobileData.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix) + data.mobileData.mobile : '';
82
83
  var title = t('ide_opt_sent_title');
83
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
84
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
84
85
  };
85
86
  export default React.memo(OTP);
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
- import { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
14
+ import { useAppDispatch, useSetFromDefaultValues, useSanitizedTranslation } from '../../../../hooks';
15
15
  import { useTranslation } from 'react-i18next';
16
16
  import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
@@ -59,6 +59,7 @@ var VerifyNumber = function (_a) {
59
59
  });
60
60
  useSetFromDefaultValues(methods, data.otpData);
61
61
  var t = useTranslation().t;
62
+ var st = useSanitizedTranslation();
62
63
  var isAr = useLanguage().isAr;
63
64
  var _e = React.useState(false), resendLoading = _e[0], setResendLoading = _e[1];
64
65
  var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to;
@@ -73,6 +74,6 @@ var VerifyNumber = function (_a) {
73
74
  dispatch(verifyEntityLeadOTP(deepCopy(formData)));
74
75
  };
75
76
  var disabled = !methods.formState.isValid || !phone || resendLoading;
76
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
77
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : st('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
77
78
  };
78
79
  export default React.memo(VerifyNumber);
@@ -17,7 +17,7 @@ import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
18
  import Box from '@mui/material/Box/Box';
19
19
  import { styled } from '@mui/material/styles';
20
- import { useLanguage, useAppSelector } from '../../../../hooks';
20
+ import { useLanguage, useAppSelector, useSanitizedTranslation } from '../../../../hooks';
21
21
  import { deepCopy, maskPhone } from '../../../../utils';
22
22
  import Form from '../../../../components/Form';
23
23
  import Text from '../../../../components/Text';
@@ -59,6 +59,7 @@ var VerifyNumber = function (_a) {
59
59
  });
60
60
  useSetFromDefaultValues(methods, data.otpData);
61
61
  var t = useTranslation().t;
62
+ var st = useSanitizedTranslation();
62
63
  var isAr = useLanguage().isAr;
63
64
  var _e = React.useState(false), resendLoading = _e[0], setResendLoading = _e[1];
64
65
  var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to;
@@ -75,6 +76,6 @@ var VerifyNumber = function (_a) {
75
76
  var disabled = !methods.formState.isValid || !phone || resendLoading;
76
77
  var dataLoading = loading || cityLoading;
77
78
  var showMobileNumber = !loading && !cityLoading && phone;
78
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [dataLoading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), showMobileNumber && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
79
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [dataLoading ? st('ide_otp_waiting_title') : st('ide_opt_sent_title'), showMobileNumber && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
79
80
  };
80
81
  export default React.memo(VerifyNumber);
@@ -22,14 +22,13 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  import * as React from 'react';
25
- import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
25
+ import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useSanitizedTranslation, useLanguage } from '../../../../hooks';
26
26
  import { useTranslation } from 'react-i18next';
27
27
  import { useForm, FormProvider } from 'react-hook-form';
28
28
  import { yupResolver } from '@hookform/resolvers/yup';
29
29
  import Box from '@mui/material/Box/Box';
30
30
  import { styled } from '@mui/material/styles';
31
31
  import { handlePrevScreenStep } from '../../../../app/settings';
32
- import { useLanguage } from '../../../../hooks';
33
32
  import Form from '../../../../components/Form';
34
33
  import Text from '../../../../components/Text';
35
34
  import { ScreenContainer } from '../../../shared/Containers';
@@ -69,6 +68,7 @@ var OTP = function (_a) {
69
68
  });
70
69
  useSetFromDefaultValues(methods, defaultValues);
71
70
  var t = useTranslation().t;
71
+ var st = useSanitizedTranslation();
72
72
  var isAr = useLanguage().isAr;
73
73
  React.useEffect(function () {
74
74
  if (error)
@@ -85,7 +85,7 @@ var OTP = function (_a) {
85
85
  };
86
86
  var disabled = !methods.formState.isValid;
87
87
  var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.auth_info) === null || _c === void 0 ? void 0 : _c.phone;
88
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
88
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : st('ide_opt_sent_title'), !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: st('next') }))] })) })) }));
89
89
  };
90
90
  OTP.defaultProps = {};
91
91
  export default React.memo(OTP);
@@ -17,7 +17,7 @@ import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
18
  import Box from '@mui/material/Box/Box';
19
19
  import { styled } from '@mui/material/styles';
20
- import { useLanguage, useAppSelector } from '../../../../hooks';
20
+ import { useLanguage, useAppSelector, useSanitizedTranslation } from '../../../../hooks';
21
21
  import { deepCopy, maskPhone } from '../../../../utils';
22
22
  import Form from '../../../../components/Form';
23
23
  import Text from '../../../../components/Text';
@@ -59,6 +59,7 @@ var VerifyNumber = function (_a) {
59
59
  });
60
60
  useSetFromDefaultValues(methods, data.otpData);
61
61
  var t = useTranslation().t;
62
+ var st = useSanitizedTranslation();
62
63
  var isAr = useLanguage().isAr;
63
64
  var _e = React.useState(false), resendLoading = _e[0], setResendLoading = _e[1];
64
65
  var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to;
@@ -73,6 +74,6 @@ var VerifyNumber = function (_a) {
73
74
  dispatch(verifyPasswordLeadOTP(deepCopy(formData)));
74
75
  };
75
76
  var disabled = !methods.formState.isValid || !phone || resendLoading;
76
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled || resendLoading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
77
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : st('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled || resendLoading, isAr: isAr, loading: loading, error: st(error || '') }, { children: st('next') }))] })) })) }));
77
78
  };
78
79
  export default React.memo(VerifyNumber);
@@ -163,7 +163,7 @@ var BusinessCountry = function (_a) {
163
163
  handleOpenSubMenu(item.id.toString());
164
164
  }, renderItem: function (item) {
165
165
  var isSelected = !!item.countries.find(function (c) { var _a; return c.country.iso2.toLocaleLowerCase() === ((_a = countryValue === null || countryValue === void 0 ? void 0 : countryValue.country) === null || _a === void 0 ? void 0 : _a.iso2.toLocaleLowerCase()); });
166
- return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: { width: 'unset' } }, { children: [_jsx(NameContainer, __assign({ sx: { padding: 0 }, isSelected: isSelected }, { children: item.title })), _jsx(ExpandIcon, { anchorEl: subIndex === item.id.toString() })] })), _jsx(Collapse, __assign({ in: item.id.toString() === subIndex || !!searchValue }, { children: _jsx(CountryListStyled, { sx: { pt: 0, pb: 0 }, list: item.countries || [], onSelectItem: function (i, e) {
166
+ return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: { width: 'unset' } }, { children: [_jsx(NameContainer, __assign({ sx: { padding: 0 }, isSelected: isSelected }, { children: isAr ? item.title_ar : item.title })), _jsx(ExpandIcon, { anchorEl: subIndex === item.id.toString() })] })), _jsx(Collapse, __assign({ in: item.id.toString() === subIndex || !!searchValue }, { children: _jsx(CountryListStyled, { sx: { pt: 0, pb: 0 }, list: item.countries || [], onSelectItem: function (i, e) {
167
167
  e.stopPropagation();
168
168
  onSelectItem(i);
169
169
  }, listItemProps: { sx: { padding: 0, '&:last-child': { paddingBottom: 0 } } }, renderItem: function (item, idx) {
@@ -29,7 +29,7 @@ import Text from '../../../../components/Text';
29
29
  import { clearError, signInSelector, resetOTPScreen, verifyAuthOTP } from '../../../app/signIn/signInStore';
30
30
  import Button from '../../../shared/Button';
31
31
  import { ScreenContainer } from '../../../shared/Containers';
32
- import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
32
+ import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useSanitizedTranslation } from '../../../../hooks';
33
33
  import { handlePrevScreenStep } from '../../../../app/settings';
34
34
  import { useLanguage } from '../../../../hooks';
35
35
  import { useForm, FormProvider } from 'react-hook-form';
@@ -60,6 +60,7 @@ var FormStyled = styled(Form)(function () { return ({
60
60
  var OTP = function () {
61
61
  var _a;
62
62
  var dispatch = useAppDispatch();
63
+ var st = useSanitizedTranslation();
63
64
  var _b = useAppSelector(signInSelector), data = _b.data, loading = _b.loading, error = _b.error;
64
65
  var _c = data.otpData, responseBody = _c.responseBody, defaultValues = __rest(_c, ["responseBody"]);
65
66
  var methods = useForm({
@@ -87,7 +88,7 @@ var OTP = function () {
87
88
  var disabled = !methods.formState.isValid || !!error;
88
89
  var phone = data.auth.mobile ? ((_a = data.auth.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix) + data.auth.mobile : '';
89
90
  var email = data.auth.email || '';
90
- var title = t('ide_opt_sent_title');
91
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: isEmail ? maskEmail(email) : maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
91
+ var title = st('ide_opt_sent_title');
92
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: isEmail ? maskEmail(email) : maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: st('next') }))] })) })) }));
92
93
  };
93
94
  export default React.memo(OTP);
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
- import { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
14
+ import { useAppDispatch, useSetFromDefaultValues, useSanitizedTranslation } from '../../../../hooks';
15
15
  import { useTranslation } from 'react-i18next';
16
16
  import { useForm, FormProvider } from 'react-hook-form';
17
17
  import { yupResolver } from '@hookform/resolvers/yup';
@@ -49,6 +49,7 @@ var VerifyNumber = function (_a) {
49
49
  var _b, _c;
50
50
  var dispatch = useAppDispatch();
51
51
  var _d = useAppSelector(taxSelector), data = _d.data, loading = _d.loading, error = _d.error;
52
+ var st = useSanitizedTranslation();
52
53
  var methods = useForm({
53
54
  resolver: yupResolver(OTPValidation),
54
55
  defaultValues: data.otpData,
@@ -70,6 +71,6 @@ var VerifyNumber = function (_a) {
70
71
  dispatch(verifyTaxLeadOTP(deepCopy(formData)));
71
72
  };
72
73
  var disabled = !methods.formState.isValid || !phone || resendLoading;
73
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
74
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : st('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: st('next') }))] })) })) }));
74
75
  };
75
76
  export default React.memo(VerifyNumber);
@@ -22,3 +22,4 @@ export * from './useFormErrorAndUpdateReadOnly';
22
22
  export * from './useExcludeReadOnlyFelids';
23
23
  export * from './useDataVerified';
24
24
  export * from './useFormDirtyCheck';
25
+ export * from './useSanitizedTranslation';
@@ -22,3 +22,4 @@ export * from './useFormErrorAndUpdateReadOnly';
22
22
  export * from './useExcludeReadOnlyFelids';
23
23
  export * from './useDataVerified';
24
24
  export * from './useFormDirtyCheck';
25
+ export * from './useSanitizedTranslation';
@@ -0,0 +1 @@
1
+ export declare const useSanitizedTranslation: () => (key: string) => string;
@@ -0,0 +1,15 @@
1
+ import { useCallback } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ export var useSanitizedTranslation = function () {
4
+ var t = useTranslation().t;
5
+ var sanitize = useCallback(function (key) {
6
+ if (!key)
7
+ return '';
8
+ return key.replace(/[$#[\].]/g, '');
9
+ }, []);
10
+ var sanitizedTranslate = useCallback(function (key) {
11
+ var sanitizedError = sanitize(key);
12
+ return t(sanitizedError);
13
+ }, [t, sanitize]);
14
+ return sanitizedTranslate;
15
+ };
@@ -1,5 +1,5 @@
1
1
  import { axiosInstance } from '../api';
2
- import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_PROD_URL } from '../constants';
2
+ import { ENDPOINT_PATHS, CONNECT_DEV_URL, CONNECT_PROD_URL } from '../constants';
3
3
  import { objectHasValues } from './object';
4
4
  export var sleep = function (milliseconds) {
5
5
  if (milliseconds === void 0) { milliseconds = 1000; }
@@ -17,7 +17,7 @@ export var setBaseUrl = function (publicKey) {
17
17
  axiosInstance.defaults.baseURL = ENDPOINT_PATHS.PRODUCTION_BASE_URL;
18
18
  return;
19
19
  }
20
- axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
20
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
21
21
  };
22
22
  export var updateLocationUrlWithCountry = function (countryIso2) {
23
23
  var country = countryIso2.toLowerCase();
@@ -36,7 +36,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
36
36
  window.history.replaceState({}, '', newUrl);
37
37
  };
38
38
  export var openConnect = function (pk, countryCode) {
39
- var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_SANDBOX_URL);
39
+ var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_DEV_URL);
40
40
  if (countryCode) {
41
41
  newUrl.pathname = "/".concat(countryCode.toLowerCase());
42
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.8.88-sandbox",
3
+ "version": "2.8.91-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",
@@ -21,7 +21,7 @@
21
21
  "copy:files": "copyfiles -u 1 src/**/*.css build/",
22
22
  "tsc:alias": "tsc-alias -p tsconfig.json",
23
23
  "ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
24
- "push": "npm publish --access public --tag sandbox"
24
+ "push": "npm publish --access public --tag development"
25
25
  },
26
26
  "keywords": [],
27
27
  "author": {