tf-checkout-react 1.4.17 → 1.4.18
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.
- package/dist/api/index.d.ts +34 -1
- package/dist/tf-checkout-react.cjs.development.js +187 -98
- package/dist/tf-checkout-react.cjs.development.js.map +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
- package/dist/tf-checkout-react.esm.js +187 -98
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/api/index.ts +37 -1
- package/src/components/billing-info-container/index.tsx +120 -21
- package/src/components/ticketsContainer/index.tsx +1 -0
package/dist/api/index.d.ts
CHANGED
|
@@ -43,7 +43,40 @@ export declare const sendRSVPInfo: (eventId: number, data: any) => Promise<Axios
|
|
|
43
43
|
export declare const validatePhoneNumber: (phone: string) => Promise<any>;
|
|
44
44
|
export declare const getAddons: (eventId: string) => Promise<any>;
|
|
45
45
|
export declare const selectAddons: (data: any) => void;
|
|
46
|
-
export
|
|
46
|
+
export interface AttributesConfig {
|
|
47
|
+
has_add_on: boolean;
|
|
48
|
+
names_required: boolean;
|
|
49
|
+
phone_required: boolean;
|
|
50
|
+
minimum_age?: any;
|
|
51
|
+
age_required: boolean;
|
|
52
|
+
hide_phone_field: boolean;
|
|
53
|
+
event_id: string;
|
|
54
|
+
free_ticket: boolean;
|
|
55
|
+
collect_mandatory_wallet_address: boolean;
|
|
56
|
+
collect_optional_wallet_address: boolean;
|
|
57
|
+
collect_mandatory_company: boolean;
|
|
58
|
+
collect_optional_company: boolean;
|
|
59
|
+
collect_mandatory_job_title: boolean;
|
|
60
|
+
collect_optional_job_title: boolean;
|
|
61
|
+
collect_mandatory_business_category: boolean;
|
|
62
|
+
collect_optional_business_category: boolean;
|
|
63
|
+
collect_mandatory_instagram: boolean;
|
|
64
|
+
collect_optional_instagram: boolean;
|
|
65
|
+
skip_billing_page: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface ConfigsData {
|
|
68
|
+
attributes: AttributesConfig;
|
|
69
|
+
relationships: any[];
|
|
70
|
+
type: string;
|
|
71
|
+
}
|
|
72
|
+
export interface ResponseConfigs {
|
|
73
|
+
data: ConfigsData;
|
|
74
|
+
success: boolean;
|
|
75
|
+
error: boolean;
|
|
76
|
+
message: string;
|
|
77
|
+
status: number;
|
|
78
|
+
}
|
|
79
|
+
export declare const getCheckoutPageConfigs: () => Promise<ResponseConfigs>;
|
|
47
80
|
export declare const getSeatMapData: (eventId: string | number) => Promise<SeatMapDataResponse>;
|
|
48
81
|
export declare const getSeatMapStatuses: (eventId: string | number) => Promise<SeatMapStatusesResponse>;
|
|
49
82
|
export declare const reserveSeat: (eventId: string | number, tierId: string, seatId: string) => Promise<any>;
|
|
@@ -2859,7 +2859,9 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2859
2859
|
'holderLastName-0': (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
|
|
2860
2860
|
'holderEmail-0': (parsedData == null ? void 0 : parsedData.email) || ''
|
|
2861
2861
|
};
|
|
2862
|
-
|
|
2862
|
+
var extraDataJSON = window.localStorage.getItem('extraData');
|
|
2863
|
+
var extraData = extraDataJSON ? JSON.parse(extraDataJSON) : null;
|
|
2864
|
+
setValues(_extends({}, values, mappedValues, extraData != null ? extraData : {}));
|
|
2863
2865
|
setUserValues(mappedValues);
|
|
2864
2866
|
} catch (e) {}
|
|
2865
2867
|
}
|
|
@@ -2953,49 +2955,75 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
2953
2955
|
isCountryCodeEditable = _ref4$isCountryCodeEd === void 0 ? true : _ref4$isCountryCodeEd,
|
|
2954
2956
|
_ref4$onPendingVerifi = _ref4.onPendingVerification,
|
|
2955
2957
|
onPendingVerification = _ref4$onPendingVerifi === void 0 ? _identity : _ref4$onPendingVerifi;
|
|
2956
|
-
var _useState = React.useState(
|
|
2957
|
-
|
|
2958
|
-
|
|
2958
|
+
var _useState = React.useState(null),
|
|
2959
|
+
extraData = _useState[0],
|
|
2960
|
+
setExtraData = _useState[1];
|
|
2961
|
+
var _useState2 = React.useState(true),
|
|
2962
|
+
isConfigLoading = _useState2[0],
|
|
2963
|
+
setIsConfigLoading = _useState2[1];
|
|
2964
|
+
var _useState3 = React.useState(null),
|
|
2965
|
+
configs = _useState3[0],
|
|
2966
|
+
setConfigs = _useState3[1];
|
|
2967
|
+
var _useState4 = React.useState(false),
|
|
2968
|
+
isNewUser = _useState4[0],
|
|
2969
|
+
setIsNewUser = _useState4[1];
|
|
2959
2970
|
var themeMui = styles.createTheme(themeOptions);
|
|
2960
2971
|
var isWindowDefined = typeof window !== 'undefined';
|
|
2972
|
+
React.useEffect(function () {
|
|
2973
|
+
if (isWindowDefined) {
|
|
2974
|
+
var _extraData = window.localStorage.getItem('extraData');
|
|
2975
|
+
if (_extraData) {
|
|
2976
|
+
setExtraData(JSON.parse(_extraData));
|
|
2977
|
+
}
|
|
2978
|
+
}
|
|
2979
|
+
getCheckoutPageConfigs().then(function (data) {
|
|
2980
|
+
var _data$data;
|
|
2981
|
+
if (data != null && (_data$data = data.data) != null && _data$data.attributes) {
|
|
2982
|
+
setConfigs(data.data.attributes);
|
|
2983
|
+
setIsConfigLoading(false);
|
|
2984
|
+
}
|
|
2985
|
+
})["catch"](function () {
|
|
2986
|
+
setIsConfigLoading(false);
|
|
2987
|
+
});
|
|
2988
|
+
}, [isWindowDefined]);
|
|
2961
2989
|
var defaultCountry = isWindowDefined ? window.localStorage.getItem('eventCountry') : '';
|
|
2962
2990
|
var userData = isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
2963
2991
|
var access_token = isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
2964
|
-
var
|
|
2965
|
-
dataWithUniqueIds =
|
|
2966
|
-
setDataWithUniqueIds =
|
|
2992
|
+
var _useState5 = React.useState(assingUniqueIds(data)),
|
|
2993
|
+
dataWithUniqueIds = _useState5[0],
|
|
2994
|
+
setDataWithUniqueIds = _useState5[1];
|
|
2967
2995
|
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
2968
|
-
var
|
|
2969
|
-
isLoggedIn =
|
|
2970
|
-
setIsLoggedIn =
|
|
2971
|
-
var
|
|
2972
|
-
cartInfoData =
|
|
2973
|
-
setCartInfo =
|
|
2974
|
-
var
|
|
2975
|
-
countries =
|
|
2976
|
-
setCountries =
|
|
2977
|
-
var
|
|
2978
|
-
states =
|
|
2979
|
-
setStates =
|
|
2980
|
-
var _useState7 = React.useState(false),
|
|
2981
|
-
showModalLogin = _useState7[0],
|
|
2982
|
-
setShowModalLogin = _useState7[1];
|
|
2983
|
-
var _useState8 = React.useState(false),
|
|
2984
|
-
alreadyHasUser = _useState8[0],
|
|
2985
|
-
setAlreadyHasUser = _useState8[1];
|
|
2986
|
-
var _useState9 = React.useState(false),
|
|
2987
|
-
userExpired = _useState9[0],
|
|
2988
|
-
setUserExpired = _useState9[1];
|
|
2996
|
+
var _useState6 = React.useState(!!(pIsLoggedIn || xtfCookie)),
|
|
2997
|
+
isLoggedIn = _useState6[0],
|
|
2998
|
+
setIsLoggedIn = _useState6[1];
|
|
2999
|
+
var _useState7 = React.useState({}),
|
|
3000
|
+
cartInfoData = _useState7[0],
|
|
3001
|
+
setCartInfo = _useState7[1];
|
|
3002
|
+
var _useState8 = React.useState([]),
|
|
3003
|
+
countries = _useState8[0],
|
|
3004
|
+
setCountries = _useState8[1];
|
|
3005
|
+
var _useState9 = React.useState([]),
|
|
3006
|
+
states = _useState9[0],
|
|
3007
|
+
setStates = _useState9[1];
|
|
2989
3008
|
var _useState10 = React.useState(false),
|
|
2990
|
-
|
|
2991
|
-
|
|
3009
|
+
showModalLogin = _useState10[0],
|
|
3010
|
+
setShowModalLogin = _useState10[1];
|
|
2992
3011
|
var _useState11 = React.useState(false),
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
var _useState12 = React.useState(
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
var _useState13 = React.useState(
|
|
3012
|
+
alreadyHasUser = _useState11[0],
|
|
3013
|
+
setAlreadyHasUser = _useState11[1];
|
|
3014
|
+
var _useState12 = React.useState(false),
|
|
3015
|
+
userExpired = _useState12[0],
|
|
3016
|
+
setUserExpired = _useState12[1];
|
|
3017
|
+
var _useState13 = React.useState(false),
|
|
3018
|
+
showModalSignup = _useState13[0],
|
|
3019
|
+
setShowModalSignup = _useState13[1];
|
|
3020
|
+
var _useState14 = React.useState(false),
|
|
3021
|
+
showModalForgotPassword = _useState14[0],
|
|
3022
|
+
setShowModalForgotPassword = _useState14[1];
|
|
3023
|
+
var _useState15 = React.useState([]),
|
|
3024
|
+
ticketsQuantity = _useState15[0],
|
|
3025
|
+
setTicketsQuantity = _useState15[1];
|
|
3026
|
+
var _useState16 = React.useState({
|
|
2999
3027
|
firstName: '',
|
|
3000
3028
|
lastName: '',
|
|
3001
3029
|
email: '',
|
|
@@ -3010,43 +3038,55 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3010
3038
|
state: '',
|
|
3011
3039
|
zip: ''
|
|
3012
3040
|
}),
|
|
3013
|
-
userValues =
|
|
3014
|
-
setUserValues =
|
|
3015
|
-
var
|
|
3016
|
-
loading =
|
|
3017
|
-
setLoading =
|
|
3018
|
-
var _useState15 = React.useState(false),
|
|
3019
|
-
cardLoading = _useState15[0],
|
|
3020
|
-
setCardLoading = _useState15[1];
|
|
3021
|
-
var _useState16 = React.useState(true),
|
|
3022
|
-
isCountriesLoading = _useState16[0],
|
|
3023
|
-
setIsCountriesLoading = _useState16[1];
|
|
3024
|
-
var _useState17 = React.useState(null),
|
|
3025
|
-
error = _useState17[0],
|
|
3026
|
-
setError = _useState17[1];
|
|
3041
|
+
userValues = _useState16[0],
|
|
3042
|
+
setUserValues = _useState16[1];
|
|
3043
|
+
var _useState17 = React.useState(true),
|
|
3044
|
+
loading = _useState17[0],
|
|
3045
|
+
setLoading = _useState17[1];
|
|
3027
3046
|
var _useState18 = React.useState(false),
|
|
3028
|
-
|
|
3029
|
-
|
|
3047
|
+
cardLoading = _useState18[0],
|
|
3048
|
+
setCardLoading = _useState18[1];
|
|
3049
|
+
var _useState19 = React.useState(true),
|
|
3050
|
+
isCountriesLoading = _useState19[0],
|
|
3051
|
+
setIsCountriesLoading = _useState19[1];
|
|
3052
|
+
var _useState20 = React.useState(null),
|
|
3053
|
+
error = _useState20[0],
|
|
3054
|
+
setError = _useState20[1];
|
|
3055
|
+
var _useState21 = React.useState(false),
|
|
3056
|
+
phoneValidationIsLoading = _useState21[0],
|
|
3057
|
+
setPhoneValidationIsLoading = _useState21[1];
|
|
3030
3058
|
var emailLogged = _get(userData, 'email', '') || _get(userValues, 'email', '');
|
|
3031
3059
|
var firstNameLogged = _get(userData, 'first_name', '') || _get(userValues, 'first_name', '');
|
|
3032
3060
|
var lastNameLogged = _get(userData, 'last_name', '') || _get(userValues, 'last_name', '');
|
|
3033
|
-
var showDOB =
|
|
3034
|
-
var showTicketHolders =
|
|
3035
|
-
var eventId =
|
|
3061
|
+
var showDOB = configs == null ? void 0 : configs.age_required;
|
|
3062
|
+
var showTicketHolders = configs == null ? void 0 : configs.names_required;
|
|
3063
|
+
var eventId = configs == null ? void 0 : configs.event_id;
|
|
3036
3064
|
var optedInFieldValue = brandOptIn ? brandOptIn : _get(cartInfoData, 'optedIn', false);
|
|
3037
3065
|
var ttfOptIn = Boolean(_get(cartInfoData, 'ttfOptIn', false));
|
|
3038
3066
|
var isTable = Boolean(_get(cartInfoData, 'is_table', false));
|
|
3039
3067
|
var hideTtfOptIn = _get(cartInfoData, 'hide_ttf_opt_in', true);
|
|
3040
3068
|
var expirationTime = _get(cartInfoData, 'expiresAt');
|
|
3041
|
-
var flagRequirePhone =
|
|
3042
|
-
var collectMandatoryWalletAddress =
|
|
3043
|
-
var collectOptionalWalletAddress =
|
|
3044
|
-
var flagFreeTicket =
|
|
3045
|
-
var hidePhoneField =
|
|
3069
|
+
var flagRequirePhone = configs == null ? void 0 : configs.phone_required;
|
|
3070
|
+
var collectMandatoryWalletAddress = configs == null ? void 0 : configs.collect_mandatory_wallet_address;
|
|
3071
|
+
var collectOptionalWalletAddress = configs == null ? void 0 : configs.collect_optional_wallet_address;
|
|
3072
|
+
var flagFreeTicket = configs == null ? void 0 : configs.free_ticket;
|
|
3073
|
+
var hidePhoneField = configs == null ? void 0 : configs.hide_phone_field;
|
|
3046
3074
|
var hideWalletAddressField = !collectOptionalWalletAddress && !collectMandatoryWalletAddress;
|
|
3047
|
-
var
|
|
3048
|
-
|
|
3049
|
-
|
|
3075
|
+
var collectMandatoryCompany = configs == null ? void 0 : configs.collect_mandatory_company;
|
|
3076
|
+
var collectOptionalCompany = configs == null ? void 0 : configs.collect_optional_company;
|
|
3077
|
+
var hideCompanyField = !collectOptionalCompany && !collectMandatoryCompany;
|
|
3078
|
+
var collectMandatoryJobTitle = configs == null ? void 0 : configs.collect_mandatory_job_title;
|
|
3079
|
+
var collectOptionalJobTitle = configs == null ? void 0 : configs.collect_optional_job_title;
|
|
3080
|
+
var hideJobTitleField = !collectMandatoryJobTitle && !collectOptionalJobTitle;
|
|
3081
|
+
var collectMandatoryInstagram = configs == null ? void 0 : configs.collect_mandatory_instagram;
|
|
3082
|
+
var collectOptionalInstagram = configs == null ? void 0 : configs.collect_optional_instagram;
|
|
3083
|
+
var hideInstagramField = !collectMandatoryInstagram && !collectOptionalInstagram;
|
|
3084
|
+
var collectMandatoryBusinessCategory = configs == null ? void 0 : configs.collect_mandatory_business_category;
|
|
3085
|
+
var collectOptionalBusinessCategory = configs == null ? void 0 : configs.collect_optional_business_category;
|
|
3086
|
+
var hideBusinessCategoryField = !collectMandatoryBusinessCategory && !collectOptionalBusinessCategory;
|
|
3087
|
+
var _useState22 = React.useState(),
|
|
3088
|
+
pendingVerificationMessage = _useState22[0],
|
|
3089
|
+
setPendingVerificationMessage = _useState22[1];
|
|
3050
3090
|
// Get prevProps
|
|
3051
3091
|
var prevData = React.useRef(data);
|
|
3052
3092
|
var addAddOnsInAttributes = function addAddOnsInAttributes(checkoutBody) {
|
|
@@ -3290,7 +3330,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3290
3330
|
}) || {};
|
|
3291
3331
|
var initialCountry = selectedCountry.id || _get(userData, 'country', '') || '1';
|
|
3292
3332
|
var pageUrl = isBrowser ? window.location.href.split('?')[0] : '';
|
|
3293
|
-
usePixel(eventId, {
|
|
3333
|
+
usePixel(eventId || '', {
|
|
3294
3334
|
page: 'billing',
|
|
3295
3335
|
pageUrl: pageUrl
|
|
3296
3336
|
});
|
|
@@ -3299,7 +3339,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3299
3339
|
}
|
|
3300
3340
|
return React__default.createElement(styles.ThemeProvider, {
|
|
3301
3341
|
theme: themeMui
|
|
3302
|
-
}, (loading || cardLoading || isCountriesLoading) && React__default.createElement(Backdrop, {
|
|
3342
|
+
}, (loading || cardLoading || isCountriesLoading || isConfigLoading) && React__default.createElement(Backdrop, {
|
|
3303
3343
|
sx: {
|
|
3304
3344
|
color: '#fff',
|
|
3305
3345
|
backgroundColor: '#000000bd',
|
|
@@ -3311,12 +3351,18 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3311
3351
|
})), !!expirationTime && enableTimer && React__default.createElement(TimerWidget$1, {
|
|
3312
3352
|
expires_at: expirationTime,
|
|
3313
3353
|
onCountdownFinish: onCountdownFinish
|
|
3314
|
-
}), !isCountriesLoading && React__default.createElement(formik.Formik, {
|
|
3354
|
+
}), !isCountriesLoading && !isConfigLoading && React__default.createElement(formik.Formik, {
|
|
3315
3355
|
initialValues: getInitialValues(dataWithUniqueIds, _extends({
|
|
3316
3356
|
country: initialCountry,
|
|
3317
3357
|
state: _get(userData, 'state', '') || '1',
|
|
3318
3358
|
brand_opt_in: optedInFieldValue,
|
|
3319
|
-
ttf_opt_in: ttfOptIn
|
|
3359
|
+
ttf_opt_in: ttfOptIn,
|
|
3360
|
+
data_capture: {
|
|
3361
|
+
'instagram': _get(extraData, 'data_capture.instagram', ''),
|
|
3362
|
+
'company': _get(extraData, 'data_capture.company', ''),
|
|
3363
|
+
'businessCategory': _get(extraData, 'data_capture.businessCategory', ''),
|
|
3364
|
+
'jobTitle': _get(extraData, 'data_capture.jobTitle', '')
|
|
3365
|
+
}
|
|
3320
3366
|
}, initialValues), userValues),
|
|
3321
3367
|
enableReinitialize: false,
|
|
3322
3368
|
onSubmit: function () {
|
|
@@ -3326,46 +3372,56 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3326
3372
|
while (1) switch (_context6.prev = _context6.next) {
|
|
3327
3373
|
case 0:
|
|
3328
3374
|
_context6.prev = 0;
|
|
3375
|
+
if (isWindowDefined) {
|
|
3376
|
+
window.localStorage.setItem('extraData', JSON.stringify({
|
|
3377
|
+
data_capture: {
|
|
3378
|
+
'instagram': _get(values, 'data_capture.instagram', ''),
|
|
3379
|
+
'company': _get(values, 'data_capture.company', ''),
|
|
3380
|
+
'businessCategory': _get(values, 'data_capture.businessCategory', ''),
|
|
3381
|
+
'jobTitle': _get(values, 'data_capture.jobTitle', '')
|
|
3382
|
+
}
|
|
3383
|
+
}));
|
|
3384
|
+
}
|
|
3329
3385
|
if (!isLoggedIn) {
|
|
3330
|
-
_context6.next =
|
|
3386
|
+
_context6.next = 18;
|
|
3331
3387
|
break;
|
|
3332
3388
|
}
|
|
3333
3389
|
_checkoutBody = collectCheckoutBody(values, userData);
|
|
3334
3390
|
if (isWindowDefined) {
|
|
3335
3391
|
addAddOnsInAttributes(_checkoutBody);
|
|
3336
3392
|
}
|
|
3337
|
-
_context6.next =
|
|
3393
|
+
_context6.next = 7;
|
|
3338
3394
|
return postOnCheckout(_checkoutBody, access_token, flagFreeTicket);
|
|
3339
|
-
case
|
|
3395
|
+
case 7:
|
|
3340
3396
|
_res = _context6.sent;
|
|
3341
3397
|
removeReferralKey();
|
|
3342
3398
|
// After checkout is successful recover updated profile and store it on local storage if needed
|
|
3343
3399
|
if (!isWindowDefined) {
|
|
3344
|
-
_context6.next =
|
|
3400
|
+
_context6.next = 16;
|
|
3345
3401
|
break;
|
|
3346
3402
|
}
|
|
3347
|
-
_context6.next =
|
|
3403
|
+
_context6.next = 12;
|
|
3348
3404
|
return getProfileData(access_token);
|
|
3349
|
-
case
|
|
3405
|
+
case 12:
|
|
3350
3406
|
updatedUserData = _context6.sent;
|
|
3351
3407
|
_profileSpecifiedData = _get(updatedUserData, 'data.data');
|
|
3352
3408
|
_profileDataObj = setLoggedUserData$2(_profileSpecifiedData);
|
|
3353
3409
|
window.localStorage.setItem('user_data', JSON.stringify(_profileDataObj));
|
|
3354
|
-
case
|
|
3410
|
+
case 16:
|
|
3355
3411
|
handleSubmit(values, formikHelpers, eventId, _res);
|
|
3356
3412
|
return _context6.abrupt("return");
|
|
3357
|
-
case
|
|
3413
|
+
case 18:
|
|
3358
3414
|
checkoutBodyForRegistration = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
3359
3415
|
emailLogged: emailLogged,
|
|
3360
3416
|
firstNameLogged: firstNameLogged,
|
|
3361
3417
|
lastNameLogged: lastNameLogged
|
|
3362
3418
|
}, showDOB);
|
|
3363
3419
|
bodyFormData = createRegisterFormData(values, checkoutBodyForRegistration, flagFreeTicket);
|
|
3364
|
-
_context6.prev =
|
|
3420
|
+
_context6.prev = 20;
|
|
3365
3421
|
setLoading(true);
|
|
3366
|
-
_context6.next =
|
|
3422
|
+
_context6.next = 24;
|
|
3367
3423
|
return register(bodyFormData);
|
|
3368
|
-
case
|
|
3424
|
+
case 24:
|
|
3369
3425
|
resRegister = _context6.sent;
|
|
3370
3426
|
_xtfCookie = _get(resRegister, 'headers.x-tf-ecommerce');
|
|
3371
3427
|
accessToken = _get(resRegister, 'data.data.attributes.access_token');
|
|
@@ -3378,11 +3434,11 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3378
3434
|
refreshToken: refreshToken,
|
|
3379
3435
|
userProfile: userProfile
|
|
3380
3436
|
});
|
|
3381
|
-
_context6.next =
|
|
3437
|
+
_context6.next = 38;
|
|
3382
3438
|
break;
|
|
3383
|
-
case
|
|
3384
|
-
_context6.prev =
|
|
3385
|
-
_context6.t0 = _context6["catch"](
|
|
3439
|
+
case 33:
|
|
3440
|
+
_context6.prev = 33;
|
|
3441
|
+
_context6.t0 = _context6["catch"](20);
|
|
3386
3442
|
setLoading(false);
|
|
3387
3443
|
if ((_e$response3 = _context6.t0.response) != null && (_e$response3$data = _e$response3.data) != null && (_e$response3$data$dat = _e$response3$data.data) != null && _e$response3$data$dat.hasUnverifiedOrder) {
|
|
3388
3444
|
setPendingVerificationMessage((_e$response4 = _context6.t0.response) == null ? void 0 : (_e$response4$data = _e$response4.data) == null ? void 0 : _e$response4$data.message);
|
|
@@ -3406,10 +3462,10 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3406
3462
|
onRegisterError(_context6.t0, values.email);
|
|
3407
3463
|
}
|
|
3408
3464
|
return _context6.abrupt("return");
|
|
3409
|
-
case
|
|
3410
|
-
_context6.next =
|
|
3465
|
+
case 38:
|
|
3466
|
+
_context6.next = 40;
|
|
3411
3467
|
return getProfileData();
|
|
3412
|
-
case
|
|
3468
|
+
case 40:
|
|
3413
3469
|
profileData = _context6.sent;
|
|
3414
3470
|
profileSpecifiedData = _get(profileData, 'data.data');
|
|
3415
3471
|
profileDataObj = setLoggedUserData$2(profileSpecifiedData);
|
|
@@ -3420,16 +3476,16 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3420
3476
|
if (isWindowDefined) {
|
|
3421
3477
|
addAddOnsInAttributes(checkoutBody);
|
|
3422
3478
|
}
|
|
3423
|
-
_context6.next =
|
|
3479
|
+
_context6.next = 48;
|
|
3424
3480
|
return postOnCheckout(checkoutBody, undefined, flagFreeTicket);
|
|
3425
|
-
case
|
|
3481
|
+
case 48:
|
|
3426
3482
|
res = _context6.sent;
|
|
3427
3483
|
removeReferralKey();
|
|
3428
3484
|
handleSubmit(values, formikHelpers, eventId, res);
|
|
3429
|
-
_context6.next =
|
|
3485
|
+
_context6.next = 57;
|
|
3430
3486
|
break;
|
|
3431
|
-
case
|
|
3432
|
-
_context6.prev =
|
|
3487
|
+
case 53:
|
|
3488
|
+
_context6.prev = 53;
|
|
3433
3489
|
_context6.t1 = _context6["catch"](0);
|
|
3434
3490
|
setLoading(false);
|
|
3435
3491
|
if ((_e$response6 = _context6.t1.response) != null && (_e$response6$data = _e$response6.data) != null && (_e$response6$data$dat = _e$response6$data.data) != null && _e$response6$data$dat.hasUnverifiedOrder) {
|
|
@@ -3454,15 +3510,15 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3454
3510
|
}
|
|
3455
3511
|
onSubmitError(_context6.t1);
|
|
3456
3512
|
}
|
|
3457
|
-
case
|
|
3458
|
-
_context6.prev =
|
|
3513
|
+
case 57:
|
|
3514
|
+
_context6.prev = 57;
|
|
3459
3515
|
setLoading(false);
|
|
3460
|
-
return _context6.finish(
|
|
3461
|
-
case
|
|
3516
|
+
return _context6.finish(57);
|
|
3517
|
+
case 60:
|
|
3462
3518
|
case "end":
|
|
3463
3519
|
return _context6.stop();
|
|
3464
3520
|
}
|
|
3465
|
-
}, _callee6, null, [[0,
|
|
3521
|
+
}, _callee6, null, [[0, 53, 57, 60], [20, 33]]);
|
|
3466
3522
|
}));
|
|
3467
3523
|
function onSubmit(_x2, _x3) {
|
|
3468
3524
|
return _onSubmit.apply(this, arguments);
|
|
@@ -3548,18 +3604,50 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3548
3604
|
el.required = true;
|
|
3549
3605
|
}
|
|
3550
3606
|
}
|
|
3551
|
-
if (
|
|
3607
|
+
if (el.name === 'data_capture[jobTitle]') {
|
|
3608
|
+
if (collectMandatoryJobTitle) {
|
|
3609
|
+
el.required = true;
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
if (el.name === 'data_capture[businessCategory]') {
|
|
3613
|
+
if (collectMandatoryBusinessCategory) {
|
|
3614
|
+
el.required = true;
|
|
3615
|
+
}
|
|
3616
|
+
}
|
|
3617
|
+
if (el.name === 'data_capture[company]') {
|
|
3618
|
+
if (collectMandatoryCompany) {
|
|
3619
|
+
el.required = true;
|
|
3620
|
+
}
|
|
3621
|
+
}
|
|
3622
|
+
if (el.name === 'data_capture[instagram]') {
|
|
3623
|
+
if (collectMandatoryInstagram) {
|
|
3624
|
+
el.required = true;
|
|
3625
|
+
}
|
|
3626
|
+
}
|
|
3627
|
+
if (['street_address', 'country', 'state', 'city'].includes(el.name)) {
|
|
3552
3628
|
if (flagFreeTicket) {
|
|
3553
3629
|
el.required = false;
|
|
3554
3630
|
return false;
|
|
3555
3631
|
}
|
|
3556
3632
|
}
|
|
3557
|
-
if (hideWalletAddressField && el.name === 'wallet-address-info') {
|
|
3633
|
+
if (hideWalletAddressField && (el.name === 'wallet-address-info' || el.name === 'data_capture[wallet_address]')) {
|
|
3634
|
+
return false;
|
|
3635
|
+
}
|
|
3636
|
+
if (hideJobTitleField && el.name === 'data_capture[jobTitle]') {
|
|
3637
|
+
return false;
|
|
3638
|
+
}
|
|
3639
|
+
if (hideBusinessCategoryField && el.name === 'data_capture[businessCategory]') {
|
|
3640
|
+
return false;
|
|
3641
|
+
}
|
|
3642
|
+
if (hideCompanyField && el.name === 'data_capture[company]') {
|
|
3643
|
+
return false;
|
|
3644
|
+
}
|
|
3645
|
+
if (hideInstagramField && (el.name === 'data_capture[instagram]' || el.name === 'instagram-info')) {
|
|
3558
3646
|
return false;
|
|
3559
3647
|
}
|
|
3560
3648
|
return true;
|
|
3561
3649
|
}), function (element) {
|
|
3562
|
-
return ['password', 'confirmPassword', 'password-info'].includes(element.name) && isLoggedIn ? null :
|
|
3650
|
+
return ['password', 'confirmPassword', 'password-info'].includes(element.name) && isLoggedIn ? null : React__default.createElement(React__default.Fragment, {
|
|
3563
3651
|
key: element.uniqueId
|
|
3564
3652
|
}, React__default.createElement("div", {
|
|
3565
3653
|
className: element.className + " " + ((props == null ? void 0 : props.errors[element.name]) || '')
|
|
@@ -5613,6 +5701,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5613
5701
|
window.localStorage.removeItem('user_data');
|
|
5614
5702
|
}
|
|
5615
5703
|
}
|
|
5704
|
+
window.localStorage.removeItem('extraData');
|
|
5616
5705
|
}
|
|
5617
5706
|
}, []);
|
|
5618
5707
|
React.useEffect(function () {
|