tf-checkout-react 1.7.2 → 1.7.4
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/auth.d.ts +22 -0
- package/dist/api/index.d.ts +1 -1
- package/dist/components/confirmationContainer/index.d.ts +5 -1
- package/dist/components/loginForm/index.d.ts +1 -0
- package/dist/components/loginModal/SignUpForm.d.ts +10 -0
- package/dist/components/loginModal/constants.d.ts +39 -0
- package/dist/components/loginModal/index.d.ts +1 -0
- package/dist/components/seatMapContainer/addToCart.d.ts +2 -2
- package/dist/components/ticketsContainer/TimeSlotTicketRow.d.ts +19 -0
- package/dist/tf-checkout-react.cjs.development.js +1654 -698
- 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 +1655 -699
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/dist/validators/index.d.ts +4 -0
- package/package.json +2 -2
- package/src/api/auth.ts +49 -0
- package/src/api/index.ts +1 -1
- package/src/api/publicRequest.ts +1 -0
- package/src/components/billing-info-container/index.tsx +128 -32
- package/src/components/billing-info-container/style.css +46 -2
- package/src/components/confirmationContainer/index.tsx +24 -3
- package/src/components/loginForm/index.tsx +19 -3
- package/src/components/loginModal/SignUpForm.tsx +329 -0
- package/src/components/loginModal/constants.ts +46 -0
- package/src/components/loginModal/index.tsx +86 -9
- package/src/components/loginModal/style.css +44 -2
- package/src/components/preRegistration/constants.tsx +6 -4
- package/src/components/preRegistration/index.tsx +3 -3
- package/src/components/preRegistration/utils.ts +9 -1
- package/src/components/ticketsContainer/TimeSlotTicketRow.tsx +224 -0
- package/src/components/ticketsContainer/TimeSlotsSection.tsx +98 -24
- package/src/components/ticketsContainer/index.tsx +79 -21
- package/src/types/api/common.d.ts +1 -0
- package/src/types/api/payment.d.ts +2 -0
- package/src/types/formFields.d.ts +1 -1
- package/src/validators/index.ts +22 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CircularProgress, Modal as Modal$1, FormControl, FormHelperText, InputLabel, Snackbar, Alert, Box as Box$1, Button as Button$1, TextField as TextField$1, Backdrop as Backdrop$1, Select as Select$1 } from '@mui/material';
|
|
1
|
+
import { CircularProgress, Modal as Modal$1, FormControl, FormHelperText, InputLabel, Snackbar, Alert, Box as Box$1, Grid, Button as Button$1, TextField as TextField$1, Backdrop as Backdrop$1, Select as Select$1 } from '@mui/material';
|
|
2
2
|
import Backdrop from '@mui/material/Backdrop';
|
|
3
3
|
import Button from '@mui/material/Button';
|
|
4
4
|
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
@@ -53,6 +53,9 @@ import RadioGroup from '@mui/material/RadioGroup';
|
|
|
53
53
|
import _reverse from 'lodash-es/reverse';
|
|
54
54
|
import _sortBy from 'lodash-es/sortBy';
|
|
55
55
|
import { object, string, ref, boolean } from 'yup';
|
|
56
|
+
import Tab from '@mui/material/Tab';
|
|
57
|
+
import Tabs from '@mui/material/Tabs';
|
|
58
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
56
59
|
import Alert$1 from '@mui/material/Alert';
|
|
57
60
|
import Container from '@mui/material/Container';
|
|
58
61
|
import { Elements, useStripe, useElements, PaymentElement } from '@stripe/react-stripe-js';
|
|
@@ -496,7 +499,8 @@ if (isWindowDefined && authGuestToken) {
|
|
|
496
499
|
}
|
|
497
500
|
var publicRequest = /*#__PURE__*/axios.create({
|
|
498
501
|
baseURL: 'https://www.ticketfairy.com/api',
|
|
499
|
-
headers: headers
|
|
502
|
+
headers: headers,
|
|
503
|
+
withCredentials: true
|
|
500
504
|
});
|
|
501
505
|
publicRequest.interceptors.request.use(function (config) {
|
|
502
506
|
if (getCookieByName('X-TF-ECOMMERCE')) {
|
|
@@ -1140,6 +1144,66 @@ var logout = /*#__PURE__*/function () {
|
|
|
1140
1144
|
return _ref5.apply(this, arguments);
|
|
1141
1145
|
};
|
|
1142
1146
|
}();
|
|
1147
|
+
/**
|
|
1148
|
+
* Checks whether a given email address already exists via the `/ajax/contact-email` endpoint.
|
|
1149
|
+
*
|
|
1150
|
+
* The underlying API is expected to return a JSON object containing:
|
|
1151
|
+
* - `exists`: `1` if the email exists, `0` otherwise
|
|
1152
|
+
* - `error`: `1` if an error occurred, `0` otherwise
|
|
1153
|
+
* - `message`: an optional error message when `error === 1`
|
|
1154
|
+
*
|
|
1155
|
+
* This function normalizes that response to an object with:
|
|
1156
|
+
* - `exists`: a boolean indicating whether the email exists
|
|
1157
|
+
* - `error`: an optional string containing an error message, if any
|
|
1158
|
+
*
|
|
1159
|
+
* On network or unexpected errors, it returns `{ exists: false, error: 'Failed to check email' }`.
|
|
1160
|
+
*
|
|
1161
|
+
* @param {string} email - The email address to check for existence.
|
|
1162
|
+
* @returns {Promise<{ exists: boolean; error?: string }>} A promise that resolves to the normalized
|
|
1163
|
+
* result of the email existence check.
|
|
1164
|
+
*/
|
|
1165
|
+
var checkEmailExists = /*#__PURE__*/function () {
|
|
1166
|
+
var _ref6 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(email) {
|
|
1167
|
+
var _publicRequest$defaul, formData, baseUrl, url, response;
|
|
1168
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
1169
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
1170
|
+
case 0:
|
|
1171
|
+
_context6.prev = 0;
|
|
1172
|
+
formData = new FormData();
|
|
1173
|
+
formData.append('email', email);
|
|
1174
|
+
formData.append('is_checkout_flow', 'true');
|
|
1175
|
+
baseUrl = ((_publicRequest$defaul = publicRequest.defaults.baseURL) == null ? void 0 : _publicRequest$defaul.replace('/api', '')) || '';
|
|
1176
|
+
url = baseUrl + "/ajax/contact-email";
|
|
1177
|
+
_context6.next = 8;
|
|
1178
|
+
return publicRequest.post(url, formData, {
|
|
1179
|
+
headers: {
|
|
1180
|
+
'Content-Type': 'multipart/form-data'
|
|
1181
|
+
}
|
|
1182
|
+
});
|
|
1183
|
+
case 8:
|
|
1184
|
+
response = _context6.sent;
|
|
1185
|
+
return _context6.abrupt("return", {
|
|
1186
|
+
exists: response.data.exists === 1,
|
|
1187
|
+
error: response.data.error === 1 ? response.data.message : undefined
|
|
1188
|
+
});
|
|
1189
|
+
case 12:
|
|
1190
|
+
_context6.prev = 12;
|
|
1191
|
+
_context6.t0 = _context6["catch"](0);
|
|
1192
|
+
console.error('Error checking email:', _context6.t0);
|
|
1193
|
+
return _context6.abrupt("return", {
|
|
1194
|
+
exists: false,
|
|
1195
|
+
error: 'Failed to check email'
|
|
1196
|
+
});
|
|
1197
|
+
case 16:
|
|
1198
|
+
case "end":
|
|
1199
|
+
return _context6.stop();
|
|
1200
|
+
}
|
|
1201
|
+
}, _callee6, null, [[0, 12]]);
|
|
1202
|
+
}));
|
|
1203
|
+
return function checkEmailExists(_x4) {
|
|
1204
|
+
return _ref6.apply(this, arguments);
|
|
1205
|
+
};
|
|
1206
|
+
}();
|
|
1143
1207
|
|
|
1144
1208
|
var getOrders = /*#__PURE__*/function () {
|
|
1145
1209
|
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(page, limit, eventSlug) {
|
|
@@ -2403,6 +2467,56 @@ var usePixel = /*#__PURE__*/function () {
|
|
|
2403
2467
|
};
|
|
2404
2468
|
}();
|
|
2405
2469
|
|
|
2470
|
+
var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
2471
|
+
var combineValidators = function combineValidators() {
|
|
2472
|
+
for (var _len = arguments.length, validators = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2473
|
+
validators[_key] = arguments[_key];
|
|
2474
|
+
}
|
|
2475
|
+
return function () {
|
|
2476
|
+
for (var i = 0; i < validators.length; ++i) {
|
|
2477
|
+
var error_message = validators[i].apply(validators, arguments);
|
|
2478
|
+
if (error_message) return error_message;
|
|
2479
|
+
}
|
|
2480
|
+
};
|
|
2481
|
+
};
|
|
2482
|
+
function isFalsy(item) {
|
|
2483
|
+
try {
|
|
2484
|
+
if (!item ||
|
|
2485
|
+
// handles most, like false, 0, null, etc
|
|
2486
|
+
typeof item === 'object' && Object.keys(item).length === 0 &&
|
|
2487
|
+
// for empty objects, like {}, []
|
|
2488
|
+
!(typeof item.addEventListener === 'function') // omit webpage elements
|
|
2489
|
+
) {
|
|
2490
|
+
return true;
|
|
2491
|
+
}
|
|
2492
|
+
} catch (err) {
|
|
2493
|
+
return true;
|
|
2494
|
+
}
|
|
2495
|
+
return false;
|
|
2496
|
+
}
|
|
2497
|
+
var requiredValidator = function requiredValidator(value, message) {
|
|
2498
|
+
var errorMessage = '';
|
|
2499
|
+
if (isFalsy(typeof value === 'string' ? value.trim() : value)) {
|
|
2500
|
+
errorMessage = message || 'Required';
|
|
2501
|
+
}
|
|
2502
|
+
return errorMessage;
|
|
2503
|
+
};
|
|
2504
|
+
var emailValidator = function emailValidator(email) {
|
|
2505
|
+
return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
|
|
2506
|
+
};
|
|
2507
|
+
var passwordValidator = function passwordValidator(password) {
|
|
2508
|
+
if (!password || password.length < 6) {
|
|
2509
|
+
return 'The password must be at least 6 characters.';
|
|
2510
|
+
}
|
|
2511
|
+
return '';
|
|
2512
|
+
};
|
|
2513
|
+
var confirmPasswordValidator = function confirmPasswordValidator(confirmPassword, password) {
|
|
2514
|
+
if (confirmPassword !== password) {
|
|
2515
|
+
return 'Passwords do not match.';
|
|
2516
|
+
}
|
|
2517
|
+
return '';
|
|
2518
|
+
};
|
|
2519
|
+
|
|
2406
2520
|
var currencyNormalizerCreator = function currencyNormalizerCreator(value, currency) {
|
|
2407
2521
|
return !value ? '' : getCurrencySymbolByCurrency(currency) + " " + value;
|
|
2408
2522
|
};
|
|
@@ -2678,44 +2792,6 @@ var cartAdapter = function cartAdapter(cart) {
|
|
|
2678
2792
|
};
|
|
2679
2793
|
};
|
|
2680
2794
|
|
|
2681
|
-
var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
2682
|
-
var combineValidators = function combineValidators() {
|
|
2683
|
-
for (var _len = arguments.length, validators = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2684
|
-
validators[_key] = arguments[_key];
|
|
2685
|
-
}
|
|
2686
|
-
return function () {
|
|
2687
|
-
for (var i = 0; i < validators.length; ++i) {
|
|
2688
|
-
var error_message = validators[i].apply(validators, arguments);
|
|
2689
|
-
if (error_message) return error_message;
|
|
2690
|
-
}
|
|
2691
|
-
};
|
|
2692
|
-
};
|
|
2693
|
-
function isFalsy(item) {
|
|
2694
|
-
try {
|
|
2695
|
-
if (!item ||
|
|
2696
|
-
// handles most, like false, 0, null, etc
|
|
2697
|
-
typeof item === 'object' && Object.keys(item).length === 0 &&
|
|
2698
|
-
// for empty objects, like {}, []
|
|
2699
|
-
!(typeof item.addEventListener === 'function') // omit webpage elements
|
|
2700
|
-
) {
|
|
2701
|
-
return true;
|
|
2702
|
-
}
|
|
2703
|
-
} catch (err) {
|
|
2704
|
-
return true;
|
|
2705
|
-
}
|
|
2706
|
-
return false;
|
|
2707
|
-
}
|
|
2708
|
-
var requiredValidator = function requiredValidator(value, message) {
|
|
2709
|
-
var errorMessage = '';
|
|
2710
|
-
if (isFalsy(typeof value === 'string' ? value.trim() : value)) {
|
|
2711
|
-
errorMessage = message || 'Required';
|
|
2712
|
-
}
|
|
2713
|
-
return errorMessage;
|
|
2714
|
-
};
|
|
2715
|
-
var emailValidator = function emailValidator(email) {
|
|
2716
|
-
return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
|
|
2717
|
-
};
|
|
2718
|
-
|
|
2719
2795
|
var CheckboxField = function CheckboxField(_ref) {
|
|
2720
2796
|
var label = _ref.label,
|
|
2721
2797
|
field = _ref.field,
|
|
@@ -4761,89 +4837,158 @@ var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
|
4761
4837
|
}))));
|
|
4762
4838
|
};
|
|
4763
4839
|
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4840
|
+
// Theme colors
|
|
4841
|
+
var COLORS = {
|
|
4842
|
+
PRIMARY: '#212529',
|
|
4843
|
+
SECONDARY: '#666',
|
|
4844
|
+
BACKGROUND: '#fff',
|
|
4845
|
+
BORDER: 'white',
|
|
4846
|
+
INDICATOR: '#212529'
|
|
4847
|
+
};
|
|
4848
|
+
// Typography
|
|
4849
|
+
var TYPOGRAPHY = {
|
|
4850
|
+
FONT_FAMILY: 'Inter',
|
|
4851
|
+
FONT_WEIGHT: {
|
|
4852
|
+
SEMIBOLD: 600,
|
|
4853
|
+
BOLD: 700
|
|
4854
|
+
},
|
|
4855
|
+
FONT_SIZE: {
|
|
4856
|
+
TAB: '16px',
|
|
4857
|
+
TITLE: '18px'
|
|
4858
|
+
}
|
|
4859
|
+
};
|
|
4860
|
+
// Modal dimensions
|
|
4861
|
+
var MODAL_DIMENSIONS = {
|
|
4862
|
+
WIDTH: {
|
|
4863
|
+
DESKTOP: 480,
|
|
4864
|
+
MOBILE: 345
|
|
4865
|
+
}
|
|
4866
|
+
};
|
|
4867
|
+
// Tab configuration
|
|
4868
|
+
var TAB_STYLES = {
|
|
4869
|
+
BACKGROUND_COLOR: COLORS.BACKGROUND,
|
|
4870
|
+
MARGIN_BOTTOM: '30px',
|
|
4871
|
+
LABEL: {
|
|
4872
|
+
FONT_FAMILY: TYPOGRAPHY.FONT_FAMILY,
|
|
4873
|
+
FONT_WEIGHT: TYPOGRAPHY.FONT_WEIGHT.SEMIBOLD,
|
|
4874
|
+
FONT_SIZE: TYPOGRAPHY.FONT_SIZE.TAB,
|
|
4875
|
+
TEXT_TRANSFORM: 'none',
|
|
4876
|
+
COLOR: COLORS.SECONDARY,
|
|
4877
|
+
SELECTED_COLOR: COLORS.PRIMARY
|
|
4878
|
+
},
|
|
4879
|
+
INDICATOR: {
|
|
4880
|
+
BACKGROUND_COLOR: COLORS.INDICATOR
|
|
4881
|
+
}
|
|
4773
4882
|
};
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
_ref$alreadyHasUser = _ref.alreadyHasUser,
|
|
4778
|
-
alreadyHasUser = _ref$alreadyHasUser === void 0 ? false : _ref$alreadyHasUser,
|
|
4779
|
-
_ref$userExpired = _ref.userExpired,
|
|
4780
|
-
userExpired = _ref$userExpired === void 0 ? false : _ref$userExpired,
|
|
4883
|
+
|
|
4884
|
+
var SignUpForm = function SignUpForm(_ref) {
|
|
4885
|
+
var onSignUpSuccess = _ref.onSignUpSuccess,
|
|
4781
4886
|
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
4782
|
-
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ?
|
|
4887
|
+
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? function () {} : _ref$onGetProfileData,
|
|
4783
4888
|
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
4784
|
-
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ?
|
|
4785
|
-
|
|
4786
|
-
onForgotPassword = _ref$onForgotPassword === void 0 ? _identity : _ref$onForgotPassword,
|
|
4787
|
-
_ref$onSignup = _ref.onSignup,
|
|
4788
|
-
onSignup = _ref$onSignup === void 0 ? _identity : _ref$onSignup,
|
|
4789
|
-
_ref$modalClassname = _ref.modalClassname,
|
|
4790
|
-
modalClassname = _ref$modalClassname === void 0 ? '' : _ref$modalClassname,
|
|
4791
|
-
logo = _ref.logo,
|
|
4792
|
-
_ref$showForgotPasswo = _ref.showForgotPasswordButton,
|
|
4793
|
-
showForgotPasswordButton = _ref$showForgotPasswo === void 0 ? false : _ref$showForgotPasswo,
|
|
4794
|
-
_ref$showSignUpButton = _ref.showSignUpButton,
|
|
4795
|
-
showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton,
|
|
4796
|
-
_ref$showPoweredByIma = _ref.showPoweredByImage,
|
|
4797
|
-
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
|
|
4889
|
+
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? function () {} : _ref$onGetProfileData2,
|
|
4890
|
+
logo = _ref.logo;
|
|
4798
4891
|
var _useState = useState(''),
|
|
4799
4892
|
error = _useState[0],
|
|
4800
4893
|
setError = _useState[1];
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4894
|
+
var _useState2 = useState(false),
|
|
4895
|
+
isSubmitting = _useState2[0],
|
|
4896
|
+
setIsSubmitting = _useState2[1];
|
|
4897
|
+
var _useState3 = useState([]),
|
|
4898
|
+
countries = _useState3[0],
|
|
4899
|
+
setCountries = _useState3[1];
|
|
4900
|
+
var _useState4 = useState([]),
|
|
4901
|
+
states = _useState4[0],
|
|
4902
|
+
setStates = _useState4[1];
|
|
4903
|
+
var _useState5 = useState(false),
|
|
4904
|
+
phoneValidationIsLoading = _useState5[0],
|
|
4905
|
+
setPhoneValidationIsLoading = _useState5[1];
|
|
4906
|
+
// Fetch countries on mount
|
|
4907
|
+
useEffect(function () {
|
|
4908
|
+
var fetchCountries = /*#__PURE__*/function () {
|
|
4909
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4910
|
+
var res, mappedCountries;
|
|
4911
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4912
|
+
while (1) switch (_context.prev = _context.next) {
|
|
4913
|
+
case 0:
|
|
4914
|
+
_context.prev = 0;
|
|
4915
|
+
_context.next = 3;
|
|
4916
|
+
return getCountries();
|
|
4917
|
+
case 3:
|
|
4918
|
+
res = _context.sent;
|
|
4919
|
+
mappedCountries = _map(res.data, function (item) {
|
|
4920
|
+
return {
|
|
4921
|
+
id: item.id,
|
|
4922
|
+
name: item.name,
|
|
4923
|
+
code: item.code
|
|
4924
|
+
};
|
|
4925
|
+
});
|
|
4926
|
+
setCountries(mappedCountries);
|
|
4927
|
+
_context.next = 11;
|
|
4928
|
+
break;
|
|
4929
|
+
case 8:
|
|
4930
|
+
_context.prev = 8;
|
|
4931
|
+
_context.t0 = _context["catch"](0);
|
|
4932
|
+
console.error('Error fetching countries:', _context.t0);
|
|
4933
|
+
case 11:
|
|
4934
|
+
case "end":
|
|
4935
|
+
return _context.stop();
|
|
4936
|
+
}
|
|
4937
|
+
}, _callee, null, [[0, 8]]);
|
|
4938
|
+
}));
|
|
4939
|
+
return function fetchCountries() {
|
|
4940
|
+
return _ref2.apply(this, arguments);
|
|
4941
|
+
};
|
|
4942
|
+
}();
|
|
4943
|
+
fetchCountries();
|
|
4944
|
+
}, []);
|
|
4945
|
+
return React.createElement(Formik, {
|
|
4946
|
+
enableReinitialize: true,
|
|
4810
4947
|
initialValues: {
|
|
4948
|
+
firstName: '',
|
|
4949
|
+
lastName: '',
|
|
4811
4950
|
email: '',
|
|
4812
|
-
password: ''
|
|
4951
|
+
password: '',
|
|
4952
|
+
passwordConfirmation: '',
|
|
4953
|
+
phone: '',
|
|
4954
|
+
country: '1',
|
|
4955
|
+
city: '',
|
|
4956
|
+
state: '',
|
|
4957
|
+
streetAddress: '',
|
|
4958
|
+
zip: ''
|
|
4813
4959
|
},
|
|
4814
4960
|
onSubmit: function () {
|
|
4815
|
-
var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
4816
|
-
var
|
|
4817
|
-
return _regeneratorRuntime().wrap(function
|
|
4818
|
-
while (1) switch (
|
|
4961
|
+
var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(values) {
|
|
4962
|
+
var formData, profileResponse, profileSpecifiedData, profileDataObj, event, errorData, errorMessages;
|
|
4963
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
4964
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
4819
4965
|
case 0:
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4966
|
+
setIsSubmitting(true);
|
|
4967
|
+
setError('');
|
|
4968
|
+
_context2.prev = 2;
|
|
4969
|
+
formData = new FormData();
|
|
4970
|
+
formData.append('first_name', values.firstName);
|
|
4971
|
+
formData.append('last_name', values.lastName);
|
|
4972
|
+
formData.append('email', values.email);
|
|
4973
|
+
formData.append('password', values.password);
|
|
4974
|
+
formData.append('password_confirmation', values.passwordConfirmation);
|
|
4975
|
+
formData.append('phone', values.phone);
|
|
4976
|
+
formData.append('country', values.country);
|
|
4977
|
+
formData.append('city', values.city);
|
|
4978
|
+
formData.append('state', values.state);
|
|
4979
|
+
formData.append('street_address', values.streetAddress);
|
|
4980
|
+
formData.append('zip', values.zip);
|
|
4981
|
+
formData.append('client_id', CONFIGS.CLIENT_ID || '');
|
|
4982
|
+
formData.append('client_secret', CONFIGS.CLIENT_SECRET || '');
|
|
4983
|
+
_context2.next = 19;
|
|
4984
|
+
return register(formData);
|
|
4985
|
+
case 19:
|
|
4986
|
+
_context2.prev = 19;
|
|
4987
|
+
_context2.next = 22;
|
|
4833
4988
|
return getProfileData();
|
|
4834
|
-
case
|
|
4835
|
-
profileResponse =
|
|
4989
|
+
case 22:
|
|
4990
|
+
profileResponse = _context2.sent;
|
|
4836
4991
|
onGetProfileDataSuccess(profileResponse.data);
|
|
4837
|
-
_context.next = 18;
|
|
4838
|
-
break;
|
|
4839
|
-
case 14:
|
|
4840
|
-
_context.prev = 14;
|
|
4841
|
-
_context.t0 = _context["catch"](7);
|
|
4842
|
-
if (axios.isAxiosError(_context.t0)) {
|
|
4843
|
-
onGetProfileDataError(_context.t0);
|
|
4844
|
-
}
|
|
4845
|
-
return _context.abrupt("return");
|
|
4846
|
-
case 18:
|
|
4847
4992
|
profileSpecifiedData = profileResponse.data;
|
|
4848
4993
|
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
4849
4994
|
if (isBrowser) {
|
|
@@ -4851,23 +4996,46 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
4851
4996
|
event = new window.CustomEvent('tf-login');
|
|
4852
4997
|
window.document.dispatchEvent(event);
|
|
4853
4998
|
}
|
|
4854
|
-
|
|
4855
|
-
|
|
4999
|
+
onSignUpSuccess(_get(profileResponse, 'data.data', {}));
|
|
5000
|
+
_context2.next = 34;
|
|
4856
5001
|
break;
|
|
4857
|
-
case
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
if (
|
|
4861
|
-
|
|
4862
|
-
setError(_error);
|
|
4863
|
-
} else if (_context.t1 instanceof Error) {
|
|
4864
|
-
setError((_context.t1 == null ? void 0 : _context.t1.message) || 'Error');
|
|
5002
|
+
case 30:
|
|
5003
|
+
_context2.prev = 30;
|
|
5004
|
+
_context2.t0 = _context2["catch"](19);
|
|
5005
|
+
if (_context2.t0.isAxiosError) {
|
|
5006
|
+
onGetProfileDataError(_context2.t0);
|
|
4865
5007
|
}
|
|
4866
|
-
|
|
5008
|
+
setError('Registration successful but failed to fetch profile data');
|
|
5009
|
+
case 34:
|
|
5010
|
+
_context2.next = 40;
|
|
5011
|
+
break;
|
|
5012
|
+
case 36:
|
|
5013
|
+
_context2.prev = 36;
|
|
5014
|
+
_context2.t1 = _context2["catch"](2);
|
|
5015
|
+
errorData = _get(_context2.t1, 'response.data.message', ''); // Check if error is an object with field-specific errors
|
|
5016
|
+
if (typeof errorData === 'object' && errorData !== null) {
|
|
5017
|
+
errorMessages = Object.entries(errorData).map(function (_ref3) {
|
|
5018
|
+
var field = _ref3[0],
|
|
5019
|
+
messages = _ref3[1];
|
|
5020
|
+
var fieldName = field.replace(/_/g, ' ').replace(/\b\w/g, function (l) {
|
|
5021
|
+
return l.toUpperCase();
|
|
5022
|
+
});
|
|
5023
|
+
var messageArray = Array.isArray(messages) ? messages : [messages];
|
|
5024
|
+
return fieldName + ": " + messageArray.join(', ');
|
|
5025
|
+
}).join('\n');
|
|
5026
|
+
setError(errorMessages || 'Registration failed. Please try again.');
|
|
5027
|
+
} else {
|
|
5028
|
+
setError(String(errorData) || 'Registration failed. Please try again.');
|
|
5029
|
+
}
|
|
5030
|
+
case 40:
|
|
5031
|
+
_context2.prev = 40;
|
|
5032
|
+
setIsSubmitting(false);
|
|
5033
|
+
return _context2.finish(40);
|
|
5034
|
+
case 43:
|
|
4867
5035
|
case "end":
|
|
4868
|
-
return
|
|
5036
|
+
return _context2.stop();
|
|
4869
5037
|
}
|
|
4870
|
-
},
|
|
5038
|
+
}, _callee2, null, [[2, 36, 40, 43], [19, 30]]);
|
|
4871
5039
|
}));
|
|
4872
5040
|
function onSubmit(_x) {
|
|
4873
5041
|
return _onSubmit.apply(this, arguments);
|
|
@@ -4878,22 +5046,396 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
4878
5046
|
return React.createElement(Form, {
|
|
4879
5047
|
onSubmit: props.handleSubmit
|
|
4880
5048
|
}, React.createElement("div", {
|
|
4881
|
-
className: "modal-title"
|
|
4882
|
-
}, "Login"), React.createElement("div", {
|
|
4883
5049
|
className: "login-logo-container"
|
|
4884
5050
|
}, React.createElement("img", {
|
|
4885
5051
|
className: "login-logo-tff",
|
|
4886
5052
|
src: logo || 'https://www.ticketfairy.com/resources/images/logo-ttf-black.svg',
|
|
4887
5053
|
alt: "logo"
|
|
4888
|
-
})), React.createElement("div", {
|
|
4889
|
-
className: "server_auth__error"
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
5054
|
+
})), error && React.createElement("div", {
|
|
5055
|
+
className: "server_auth__error",
|
|
5056
|
+
style: {
|
|
5057
|
+
whiteSpace: 'pre-line'
|
|
5058
|
+
}
|
|
5059
|
+
}, error), React.createElement(Grid, {
|
|
5060
|
+
container: true,
|
|
5061
|
+
spacing: 2,
|
|
5062
|
+
sx: {
|
|
5063
|
+
padding: '15px 25px',
|
|
5064
|
+
maxHeight: '60vh',
|
|
5065
|
+
overflowY: 'auto'
|
|
5066
|
+
}
|
|
5067
|
+
}, React.createElement(Grid, {
|
|
5068
|
+
item: true,
|
|
5069
|
+
xs: 12,
|
|
5070
|
+
md: 6
|
|
5071
|
+
}, React.createElement(Field, {
|
|
5072
|
+
name: "firstName",
|
|
5073
|
+
label: "First Name",
|
|
5074
|
+
type: "text",
|
|
5075
|
+
component: CustomField,
|
|
5076
|
+
theme: "light",
|
|
5077
|
+
validate: requiredValidator
|
|
5078
|
+
})), React.createElement(Grid, {
|
|
5079
|
+
item: true,
|
|
5080
|
+
xs: 12,
|
|
5081
|
+
md: 6
|
|
5082
|
+
}, React.createElement(Field, {
|
|
5083
|
+
name: "lastName",
|
|
5084
|
+
label: "Last Name",
|
|
5085
|
+
type: "text",
|
|
5086
|
+
component: CustomField,
|
|
5087
|
+
theme: "light",
|
|
5088
|
+
validate: requiredValidator
|
|
5089
|
+
})), React.createElement(Grid, {
|
|
5090
|
+
item: true,
|
|
5091
|
+
xs: 12,
|
|
5092
|
+
md: 6
|
|
5093
|
+
}, React.createElement(Field, {
|
|
5094
|
+
name: "email",
|
|
5095
|
+
label: "Email",
|
|
5096
|
+
type: "email",
|
|
5097
|
+
component: CustomField,
|
|
5098
|
+
theme: "light",
|
|
5099
|
+
validate: function validate(value) {
|
|
5100
|
+
var required = requiredValidator(value);
|
|
5101
|
+
if (required) return required;
|
|
5102
|
+
return emailValidator(value);
|
|
5103
|
+
}
|
|
5104
|
+
})), React.createElement(Grid, {
|
|
5105
|
+
item: true,
|
|
5106
|
+
xs: 12,
|
|
5107
|
+
md: 6
|
|
5108
|
+
}, React.createElement(Field, {
|
|
5109
|
+
name: "streetAddress",
|
|
5110
|
+
label: "Street Address",
|
|
5111
|
+
type: "text",
|
|
5112
|
+
component: CustomField,
|
|
5113
|
+
theme: "light",
|
|
5114
|
+
validate: requiredValidator
|
|
5115
|
+
})), React.createElement(Grid, {
|
|
5116
|
+
item: true,
|
|
5117
|
+
xs: 12,
|
|
5118
|
+
md: 6
|
|
5119
|
+
}, React.createElement(Field, {
|
|
5120
|
+
name: "zip",
|
|
5121
|
+
label: "Zip / Postal Code",
|
|
5122
|
+
type: "text",
|
|
5123
|
+
component: CustomField,
|
|
5124
|
+
theme: "light",
|
|
5125
|
+
validate: requiredValidator
|
|
5126
|
+
})), React.createElement(Grid, {
|
|
5127
|
+
item: true,
|
|
5128
|
+
xs: 12,
|
|
5129
|
+
md: 6
|
|
5130
|
+
}, React.createElement(Field, {
|
|
5131
|
+
name: "country",
|
|
5132
|
+
label: "Country",
|
|
5133
|
+
type: "select",
|
|
5134
|
+
component: CustomField,
|
|
5135
|
+
theme: "light",
|
|
5136
|
+
validate: requiredValidator,
|
|
5137
|
+
selectOptions: _map(countries, function (item) {
|
|
5138
|
+
return {
|
|
5139
|
+
value: item.id,
|
|
5140
|
+
label: item.name
|
|
5141
|
+
};
|
|
5142
|
+
}),
|
|
5143
|
+
onChange: function onChange(e) {
|
|
5144
|
+
props.setFieldValue('country', e.target.value);
|
|
5145
|
+
props.setFieldValue('state', '');
|
|
5146
|
+
// Fetch states for selected country
|
|
5147
|
+
var fetchStatesForCountry = /*#__PURE__*/function () {
|
|
5148
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
5149
|
+
var res, mappedStates;
|
|
5150
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
5151
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
5152
|
+
case 0:
|
|
5153
|
+
_context3.prev = 0;
|
|
5154
|
+
_context3.next = 3;
|
|
5155
|
+
return getStates(e.target.value);
|
|
5156
|
+
case 3:
|
|
5157
|
+
res = _context3.sent;
|
|
5158
|
+
mappedStates = _map(res.data, function (item, key) {
|
|
5159
|
+
return {
|
|
5160
|
+
label: item,
|
|
5161
|
+
value: key
|
|
5162
|
+
};
|
|
5163
|
+
});
|
|
5164
|
+
setStates(mappedStates);
|
|
5165
|
+
_context3.next = 12;
|
|
5166
|
+
break;
|
|
5167
|
+
case 8:
|
|
5168
|
+
_context3.prev = 8;
|
|
5169
|
+
_context3.t0 = _context3["catch"](0);
|
|
5170
|
+
console.error('Error fetching states:', _context3.t0);
|
|
5171
|
+
setStates([]);
|
|
5172
|
+
case 12:
|
|
5173
|
+
case "end":
|
|
5174
|
+
return _context3.stop();
|
|
5175
|
+
}
|
|
5176
|
+
}, _callee3, null, [[0, 8]]);
|
|
5177
|
+
}));
|
|
5178
|
+
return function fetchStatesForCountry() {
|
|
5179
|
+
return _ref4.apply(this, arguments);
|
|
5180
|
+
};
|
|
5181
|
+
}();
|
|
5182
|
+
fetchStatesForCountry();
|
|
5183
|
+
}
|
|
5184
|
+
})), React.createElement(Grid, {
|
|
5185
|
+
item: true,
|
|
5186
|
+
xs: 12,
|
|
5187
|
+
md: 6
|
|
5188
|
+
}, React.createElement(Field, {
|
|
5189
|
+
name: "state",
|
|
5190
|
+
label: "State / Province",
|
|
5191
|
+
type: "select",
|
|
5192
|
+
component: CustomField,
|
|
5193
|
+
theme: "light",
|
|
5194
|
+
validate: requiredValidator,
|
|
5195
|
+
selectOptions: [{
|
|
5196
|
+
value: '',
|
|
5197
|
+
label: 'Select State/Province',
|
|
5198
|
+
disabled: true
|
|
5199
|
+
}].concat(states)
|
|
5200
|
+
})), React.createElement(Grid, {
|
|
5201
|
+
item: true,
|
|
5202
|
+
xs: 12,
|
|
5203
|
+
md: 6
|
|
5204
|
+
}, React.createElement(Field, {
|
|
5205
|
+
name: "city",
|
|
5206
|
+
label: "City",
|
|
5207
|
+
type: "text",
|
|
5208
|
+
component: CustomField,
|
|
5209
|
+
theme: "light",
|
|
5210
|
+
validate: requiredValidator
|
|
5211
|
+
})), React.createElement(Grid, {
|
|
5212
|
+
item: true,
|
|
5213
|
+
xs: 12
|
|
5214
|
+
}, React.createElement(Field, {
|
|
5215
|
+
name: "phone",
|
|
5216
|
+
label: "Phone",
|
|
5217
|
+
type: "phone",
|
|
5218
|
+
component: PhoneNumberField,
|
|
5219
|
+
fill: true,
|
|
5220
|
+
disableDropdown: false,
|
|
5221
|
+
setPhoneValidationIsLoading: setPhoneValidationIsLoading,
|
|
5222
|
+
defaultCountry: "us",
|
|
5223
|
+
isCountryCodeEditable: true
|
|
5224
|
+
})), React.createElement(Grid, {
|
|
5225
|
+
item: true,
|
|
5226
|
+
xs: 12,
|
|
5227
|
+
md: 6
|
|
5228
|
+
}, React.createElement(Field, {
|
|
5229
|
+
name: "password",
|
|
5230
|
+
label: "Password",
|
|
5231
|
+
type: "password",
|
|
5232
|
+
component: CustomField,
|
|
5233
|
+
theme: "light",
|
|
5234
|
+
validate: passwordValidator
|
|
5235
|
+
})), React.createElement(Grid, {
|
|
5236
|
+
item: true,
|
|
5237
|
+
xs: 12,
|
|
5238
|
+
md: 6
|
|
5239
|
+
}, React.createElement(Field, {
|
|
5240
|
+
name: "passwordConfirmation",
|
|
5241
|
+
label: "Confirm Password",
|
|
5242
|
+
type: "password",
|
|
5243
|
+
component: CustomField,
|
|
5244
|
+
theme: "light",
|
|
5245
|
+
validate: function validate(value) {
|
|
5246
|
+
return confirmPasswordValidator(value, props.values.password);
|
|
5247
|
+
}
|
|
5248
|
+
}))), React.createElement("div", {
|
|
5249
|
+
className: "login-modal-body"
|
|
5250
|
+
}, React.createElement("div", {
|
|
5251
|
+
className: "login-action-button"
|
|
5252
|
+
}, React.createElement("button", {
|
|
5253
|
+
type: "submit",
|
|
5254
|
+
disabled: isSubmitting || phoneValidationIsLoading
|
|
5255
|
+
}, isSubmitting ? 'Creating Account...' : 'Create Account'))));
|
|
5256
|
+
});
|
|
5257
|
+
};
|
|
5258
|
+
|
|
5259
|
+
var style$2 = {
|
|
5260
|
+
position: 'absolute',
|
|
5261
|
+
top: '50%',
|
|
5262
|
+
left: '50%',
|
|
5263
|
+
transform: 'translate(-50%, -50%)',
|
|
5264
|
+
width: MODAL_DIMENSIONS.WIDTH.DESKTOP,
|
|
5265
|
+
backgroundColor: '#e3e3e3',
|
|
5266
|
+
border: "1px solid " + COLORS.BORDER,
|
|
5267
|
+
outline: 'none'
|
|
5268
|
+
};
|
|
5269
|
+
var mobileStyle = /*#__PURE__*/_extends({}, style$2, {
|
|
5270
|
+
width: MODAL_DIMENSIONS.WIDTH.MOBILE
|
|
5271
|
+
});
|
|
5272
|
+
var LoginModal = function LoginModal(_ref) {
|
|
5273
|
+
var onClose = _ref.onClose,
|
|
5274
|
+
onLogin = _ref.onLogin,
|
|
5275
|
+
_ref$alreadyHasUser = _ref.alreadyHasUser,
|
|
5276
|
+
alreadyHasUser = _ref$alreadyHasUser === void 0 ? false : _ref$alreadyHasUser,
|
|
5277
|
+
_ref$userExpired = _ref.userExpired,
|
|
5278
|
+
userExpired = _ref$userExpired === void 0 ? false : _ref$userExpired,
|
|
5279
|
+
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
5280
|
+
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? _identity : _ref$onGetProfileData,
|
|
5281
|
+
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
5282
|
+
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? _identity : _ref$onGetProfileData2,
|
|
5283
|
+
_ref$onForgotPassword = _ref.onForgotPassword,
|
|
5284
|
+
onForgotPassword = _ref$onForgotPassword === void 0 ? _identity : _ref$onForgotPassword,
|
|
5285
|
+
_ref$onSignup = _ref.onSignup,
|
|
5286
|
+
onSignup = _ref$onSignup === void 0 ? _identity : _ref$onSignup,
|
|
5287
|
+
_ref$modalClassname = _ref.modalClassname,
|
|
5288
|
+
modalClassname = _ref$modalClassname === void 0 ? '' : _ref$modalClassname,
|
|
5289
|
+
logo = _ref.logo,
|
|
5290
|
+
_ref$showForgotPasswo = _ref.showForgotPasswordButton,
|
|
5291
|
+
showForgotPasswordButton = _ref$showForgotPasswo === void 0 ? false : _ref$showForgotPasswo,
|
|
5292
|
+
_ref$showSignUpButton = _ref.showSignUpButton,
|
|
5293
|
+
showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton,
|
|
5294
|
+
_ref$showPoweredByIma = _ref.showPoweredByImage,
|
|
5295
|
+
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
|
|
5296
|
+
var _useState = useState(''),
|
|
5297
|
+
error = _useState[0],
|
|
5298
|
+
setError = _useState[1];
|
|
5299
|
+
var _useState2 = useState('login'),
|
|
5300
|
+
activeTab = _useState2[0],
|
|
5301
|
+
setActiveTab = _useState2[1];
|
|
5302
|
+
var isMobile = useMediaQuery('(max-width:600px)');
|
|
5303
|
+
// If onSignup is provided (custom callback), use old behavior
|
|
5304
|
+
var useCustomSignup = onSignup !== _identity;
|
|
5305
|
+
var handleTabChange = function handleTabChange(_event, newValue) {
|
|
5306
|
+
setActiveTab(newValue);
|
|
5307
|
+
};
|
|
5308
|
+
return React.createElement(Modal$2, {
|
|
5309
|
+
open: true,
|
|
5310
|
+
onClose: onClose,
|
|
5311
|
+
"aria-labelledby": "modal-modal-title",
|
|
5312
|
+
"aria-describedby": "modal-modal-description",
|
|
5313
|
+
className: "login-modal " + modalClassname
|
|
5314
|
+
}, React.createElement(Box, {
|
|
5315
|
+
style: isMobile ? mobileStyle : style$2
|
|
5316
|
+
}, React.createElement("div", null, showSignUpButton && !useCustomSignup && React.createElement(Tabs, {
|
|
5317
|
+
value: activeTab,
|
|
5318
|
+
onChange: handleTabChange,
|
|
5319
|
+
variant: "fullWidth",
|
|
5320
|
+
sx: {
|
|
5321
|
+
backgroundColor: TAB_STYLES.BACKGROUND_COLOR,
|
|
5322
|
+
marginBottom: TAB_STYLES.MARGIN_BOTTOM,
|
|
5323
|
+
'& .MuiTabs-indicator': {
|
|
5324
|
+
backgroundColor: TAB_STYLES.INDICATOR.BACKGROUND_COLOR
|
|
5325
|
+
}
|
|
5326
|
+
}
|
|
5327
|
+
}, React.createElement(Tab, {
|
|
5328
|
+
label: "Login",
|
|
5329
|
+
value: "login",
|
|
5330
|
+
sx: {
|
|
5331
|
+
fontFamily: TAB_STYLES.LABEL.FONT_FAMILY,
|
|
5332
|
+
fontWeight: TAB_STYLES.LABEL.FONT_WEIGHT,
|
|
5333
|
+
fontSize: TAB_STYLES.LABEL.FONT_SIZE,
|
|
5334
|
+
textTransform: TAB_STYLES.LABEL.TEXT_TRANSFORM,
|
|
5335
|
+
color: TAB_STYLES.LABEL.COLOR,
|
|
5336
|
+
'&.Mui-selected': {
|
|
5337
|
+
color: TAB_STYLES.LABEL.SELECTED_COLOR
|
|
5338
|
+
}
|
|
5339
|
+
}
|
|
5340
|
+
}), React.createElement(Tab, {
|
|
5341
|
+
label: "Sign Up",
|
|
5342
|
+
value: "signup",
|
|
5343
|
+
sx: {
|
|
5344
|
+
fontFamily: TAB_STYLES.LABEL.FONT_FAMILY,
|
|
5345
|
+
fontWeight: TAB_STYLES.LABEL.FONT_WEIGHT,
|
|
5346
|
+
fontSize: TAB_STYLES.LABEL.FONT_SIZE,
|
|
5347
|
+
textTransform: TAB_STYLES.LABEL.TEXT_TRANSFORM,
|
|
5348
|
+
color: TAB_STYLES.LABEL.COLOR,
|
|
5349
|
+
'&.Mui-selected': {
|
|
5350
|
+
color: TAB_STYLES.LABEL.SELECTED_COLOR
|
|
5351
|
+
}
|
|
5352
|
+
}
|
|
5353
|
+
})), activeTab === 'login' ? React.createElement(Formik, {
|
|
5354
|
+
initialValues: {
|
|
5355
|
+
email: '',
|
|
5356
|
+
password: ''
|
|
5357
|
+
},
|
|
5358
|
+
onSubmit: function () {
|
|
5359
|
+
var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
|
|
5360
|
+
var email, password, body, authRes, profileResponse, profileSpecifiedData, profileDataObj, event, _error;
|
|
5361
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5362
|
+
while (1) switch (_context.prev = _context.next) {
|
|
5363
|
+
case 0:
|
|
5364
|
+
email = _ref2.email, password = _ref2.password;
|
|
5365
|
+
_context.prev = 1;
|
|
5366
|
+
body = {
|
|
5367
|
+
email: email,
|
|
5368
|
+
password: password
|
|
5369
|
+
};
|
|
5370
|
+
_context.next = 5;
|
|
5371
|
+
return authorize(body);
|
|
5372
|
+
case 5:
|
|
5373
|
+
authRes = _context.sent;
|
|
5374
|
+
profileResponse = null;
|
|
5375
|
+
_context.prev = 7;
|
|
5376
|
+
_context.next = 10;
|
|
5377
|
+
return getProfileData();
|
|
5378
|
+
case 10:
|
|
5379
|
+
profileResponse = _context.sent;
|
|
5380
|
+
onGetProfileDataSuccess(profileResponse.data);
|
|
5381
|
+
_context.next = 18;
|
|
5382
|
+
break;
|
|
5383
|
+
case 14:
|
|
5384
|
+
_context.prev = 14;
|
|
5385
|
+
_context.t0 = _context["catch"](7);
|
|
5386
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
5387
|
+
onGetProfileDataError(_context.t0);
|
|
5388
|
+
}
|
|
5389
|
+
return _context.abrupt("return");
|
|
5390
|
+
case 18:
|
|
5391
|
+
profileSpecifiedData = profileResponse.data;
|
|
5392
|
+
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
5393
|
+
if (isBrowser) {
|
|
5394
|
+
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
5395
|
+
event = new window.CustomEvent('tf-login');
|
|
5396
|
+
window.document.dispatchEvent(event);
|
|
5397
|
+
}
|
|
5398
|
+
onLogin(_get(authRes, 'data.data', {}));
|
|
5399
|
+
_context.next = 27;
|
|
5400
|
+
break;
|
|
5401
|
+
case 24:
|
|
5402
|
+
_context.prev = 24;
|
|
5403
|
+
_context.t1 = _context["catch"](1);
|
|
5404
|
+
if (axios.isAxiosError(_context.t1)) {
|
|
5405
|
+
_error = _get(_context.t1, 'response.data.message', 'Error');
|
|
5406
|
+
setError(_error);
|
|
5407
|
+
} else if (_context.t1 instanceof Error) {
|
|
5408
|
+
setError((_context.t1 == null ? void 0 : _context.t1.message) || 'Error');
|
|
5409
|
+
}
|
|
5410
|
+
case 27:
|
|
5411
|
+
case "end":
|
|
5412
|
+
return _context.stop();
|
|
5413
|
+
}
|
|
5414
|
+
}, _callee, null, [[1, 24], [7, 14]]);
|
|
5415
|
+
}));
|
|
5416
|
+
function onSubmit(_x) {
|
|
5417
|
+
return _onSubmit.apply(this, arguments);
|
|
5418
|
+
}
|
|
5419
|
+
return onSubmit;
|
|
5420
|
+
}()
|
|
5421
|
+
}, function (props) {
|
|
5422
|
+
return React.createElement(Form, {
|
|
5423
|
+
onSubmit: props.handleSubmit
|
|
5424
|
+
}, React.createElement("div", {
|
|
5425
|
+
className: "login-logo-container"
|
|
5426
|
+
}, React.createElement("img", {
|
|
5427
|
+
className: "login-logo-tff",
|
|
5428
|
+
src: logo || 'https://www.ticketfairy.com/resources/images/logo-ttf-black.svg',
|
|
5429
|
+
alt: "logo"
|
|
5430
|
+
})), React.createElement("div", {
|
|
5431
|
+
className: "server_auth__error"
|
|
5432
|
+
}, error), alreadyHasUser && React.createElement("p", {
|
|
5433
|
+
className: "info-text-for-login"
|
|
5434
|
+
}, "It appears this email is already attached to an account. Please log in here to complete your registration."), userExpired && React.createElement("p", {
|
|
5435
|
+
className: "info-text-for-login"
|
|
5436
|
+
}, "Your session has expired, please log in again."), React.createElement("div", {
|
|
5437
|
+
className: "login-modal-body"
|
|
5438
|
+
}, React.createElement("div", {
|
|
4897
5439
|
className: "login-modal-body__email"
|
|
4898
5440
|
}, React.createElement(Field, {
|
|
4899
5441
|
name: "email",
|
|
@@ -4920,12 +5462,20 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
4920
5462
|
}, React.createElement("span", {
|
|
4921
5463
|
"aria-hidden": "true",
|
|
4922
5464
|
onClick: onForgotPassword
|
|
4923
|
-
}, "Forgot password?")), showSignUpButton && React.createElement("div", {
|
|
5465
|
+
}, "Forgot password?")), showSignUpButton && useCustomSignup && React.createElement("div", {
|
|
4924
5466
|
className: "forgot-password"
|
|
4925
5467
|
}, React.createElement("span", {
|
|
4926
5468
|
"aria-hidden": "true",
|
|
4927
|
-
onClick: onSignup
|
|
5469
|
+
onClick: onSignup,
|
|
5470
|
+
style: {
|
|
5471
|
+
cursor: 'pointer'
|
|
5472
|
+
}
|
|
4928
5473
|
}, "Sign up")), showPoweredByImage ? React.createElement(PoweredBy, null) : null));
|
|
5474
|
+
}) : React.createElement(SignUpForm, {
|
|
5475
|
+
onSignUpSuccess: onLogin,
|
|
5476
|
+
onGetProfileDataSuccess: onGetProfileDataSuccess,
|
|
5477
|
+
onGetProfileDataError: onGetProfileDataError,
|
|
5478
|
+
logo: logo
|
|
4929
5479
|
}))));
|
|
4930
5480
|
};
|
|
4931
5481
|
|
|
@@ -5986,6 +6536,7 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
5986
6536
|
email: '',
|
|
5987
6537
|
phone: ''
|
|
5988
6538
|
});
|
|
6539
|
+
var hasLoadedUserData = useRef(false);
|
|
5989
6540
|
useEffect(function () {
|
|
5990
6541
|
var fetchStates = /*#__PURE__*/function () {
|
|
5991
6542
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
@@ -6064,145 +6615,222 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
6064
6615
|
}, [values.firstName, values.lastName, values.email, values.phone, setFieldValue]);
|
|
6065
6616
|
var userDataEncoded = isBrowser ? window.localStorage.getItem('user_data') : '';
|
|
6066
6617
|
useEffect(function () {
|
|
6067
|
-
// set user data from local storage
|
|
6618
|
+
// set user data from local storage only on initial load
|
|
6068
6619
|
var getStoredUserData = function getStoredUserData() {
|
|
6069
|
-
if (isBrowser) {
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
}
|
|
6620
|
+
if (isBrowser && userDataEncoded && !hasLoadedUserData.current) {
|
|
6621
|
+
try {
|
|
6622
|
+
var parsedData = JSON.parse(userDataEncoded);
|
|
6623
|
+
var mappedValues = {
|
|
6624
|
+
firstName: (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
|
|
6625
|
+
lastName: (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
|
|
6626
|
+
email: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
6627
|
+
phone: (parsedData == null ? void 0 : parsedData.phone) || '',
|
|
6628
|
+
confirmEmail: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
6629
|
+
state: (parsedData == null ? void 0 : parsedData.state) || '',
|
|
6630
|
+
street_address: (parsedData == null ? void 0 : parsedData.street_address) || '',
|
|
6631
|
+
country: (parsedData == null ? void 0 : parsedData.country) || '1',
|
|
6632
|
+
zip: (parsedData == null ? void 0 : parsedData.zip) || '',
|
|
6633
|
+
brand_opt_in: brandOptIn ? brandOptIn : (parsedData == null ? void 0 : parsedData.brand_opt_in) || false,
|
|
6634
|
+
city: (parsedData == null ? void 0 : parsedData.city) || '',
|
|
6635
|
+
confirmPassword: '',
|
|
6636
|
+
password: '',
|
|
6637
|
+
'holderFirstName-0': (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
|
|
6638
|
+
'holderLastName-0': (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
|
|
6639
|
+
'holderEmail-0': (parsedData == null ? void 0 : parsedData.email) || '',
|
|
6640
|
+
'holderPhone-0': (parsedData == null ? void 0 : parsedData.phone) || ''
|
|
6641
|
+
};
|
|
6642
|
+
var extraDataJSON = window.localStorage.getItem('extraData');
|
|
6643
|
+
var extraData = extraDataJSON ? JSON.parse(extraDataJSON) : null;
|
|
6644
|
+
setValues(_extends({}, values, mappedValues, extraData != null ? extraData : {}));
|
|
6645
|
+
setUserValues(mappedValues);
|
|
6646
|
+
hasLoadedUserData.current = true;
|
|
6647
|
+
} catch (e) {}
|
|
6098
6648
|
}
|
|
6099
6649
|
};
|
|
6100
6650
|
getStoredUserData();
|
|
6101
|
-
|
|
6651
|
+
// Only run on mount or when userDataEncoded first becomes available
|
|
6652
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6653
|
+
}, []);
|
|
6654
|
+
return null;
|
|
6655
|
+
};
|
|
6656
|
+
// Component to check if email exists
|
|
6657
|
+
/**
|
|
6658
|
+
* A utility component that checks if an email address already exists in the system.
|
|
6659
|
+
*
|
|
6660
|
+
* Performs debounced validation and existence checking for user email addresses.
|
|
6661
|
+
* Only checks when both email and confirmEmail match, are valid, and user is not logged in.
|
|
6662
|
+
*
|
|
6663
|
+
* @param email - The primary email address to check
|
|
6664
|
+
* @param confirmEmail - The confirmation email address (must match email)
|
|
6665
|
+
* @param isLoggedIn - Whether the user is currently logged in
|
|
6666
|
+
* @param setEmailExists - Callback function to update the email existence state
|
|
6667
|
+
*
|
|
6668
|
+
* @remarks
|
|
6669
|
+
* - Uses a 500ms debounce to avoid excessive API calls
|
|
6670
|
+
* - Validates email format using regex before checking existence
|
|
6671
|
+
* - Automatically returns false if user is logged in
|
|
6672
|
+
* - Returns null as it's a logic-only component with no UI
|
|
6673
|
+
*/
|
|
6674
|
+
var EmailExistenceChecker = function EmailExistenceChecker(_ref4) {
|
|
6675
|
+
var email = _ref4.email,
|
|
6676
|
+
confirmEmail = _ref4.confirmEmail,
|
|
6677
|
+
isLoggedIn = _ref4.isLoggedIn,
|
|
6678
|
+
setEmailExists = _ref4.setEmailExists;
|
|
6679
|
+
useEffect(function () {
|
|
6680
|
+
var checkEmail = /*#__PURE__*/function () {
|
|
6681
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
6682
|
+
var result;
|
|
6683
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
6684
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
6685
|
+
case 0:
|
|
6686
|
+
if (!isLoggedIn) {
|
|
6687
|
+
_context2.next = 3;
|
|
6688
|
+
break;
|
|
6689
|
+
}
|
|
6690
|
+
setEmailExists(false);
|
|
6691
|
+
return _context2.abrupt("return");
|
|
6692
|
+
case 3:
|
|
6693
|
+
if (!(!email || !confirmEmail || email !== confirmEmail || !emailRegex.test(email))) {
|
|
6694
|
+
_context2.next = 6;
|
|
6695
|
+
break;
|
|
6696
|
+
}
|
|
6697
|
+
setEmailExists(false);
|
|
6698
|
+
return _context2.abrupt("return");
|
|
6699
|
+
case 6:
|
|
6700
|
+
_context2.prev = 6;
|
|
6701
|
+
_context2.next = 9;
|
|
6702
|
+
return checkEmailExists(email);
|
|
6703
|
+
case 9:
|
|
6704
|
+
result = _context2.sent;
|
|
6705
|
+
setEmailExists(result.exists);
|
|
6706
|
+
_context2.next = 16;
|
|
6707
|
+
break;
|
|
6708
|
+
case 13:
|
|
6709
|
+
_context2.prev = 13;
|
|
6710
|
+
_context2.t0 = _context2["catch"](6);
|
|
6711
|
+
setEmailExists(false);
|
|
6712
|
+
case 16:
|
|
6713
|
+
case "end":
|
|
6714
|
+
return _context2.stop();
|
|
6715
|
+
}
|
|
6716
|
+
}, _callee2, null, [[6, 13]]);
|
|
6717
|
+
}));
|
|
6718
|
+
return function checkEmail() {
|
|
6719
|
+
return _ref5.apply(this, arguments);
|
|
6720
|
+
};
|
|
6721
|
+
}();
|
|
6722
|
+
// Debounce the check
|
|
6723
|
+
var timeoutId = setTimeout(function () {
|
|
6724
|
+
checkEmail();
|
|
6725
|
+
}, 800);
|
|
6726
|
+
return function () {
|
|
6727
|
+
return clearTimeout(timeoutId);
|
|
6728
|
+
};
|
|
6729
|
+
}, [email, confirmEmail, isLoggedIn, setEmailExists]);
|
|
6102
6730
|
return null;
|
|
6103
6731
|
};
|
|
6104
|
-
var BillingInfoContainer = /*#__PURE__*/React.memo(function (
|
|
6732
|
+
var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
|
|
6105
6733
|
var _reviewData$payment_m, _checkoutUpdateData$a, _checkoutUpdateData$a2, _reviewData$payment_m2, _checkoutUpdateData$a3, _checkoutUpdateData$a4, _checkoutUpdateData$a5;
|
|
6106
|
-
var
|
|
6107
|
-
data =
|
|
6108
|
-
|
|
6109
|
-
ticketHoldersFields =
|
|
6734
|
+
var _ref6$data = _ref6.data,
|
|
6735
|
+
data = _ref6$data === void 0 ? [] : _ref6$data,
|
|
6736
|
+
_ref6$ticketHoldersFi = _ref6.ticketHoldersFields,
|
|
6737
|
+
ticketHoldersFields = _ref6$ticketHoldersFi === void 0 ? {
|
|
6110
6738
|
id: 1,
|
|
6111
6739
|
fields: []
|
|
6112
|
-
} :
|
|
6113
|
-
|
|
6114
|
-
initialValues =
|
|
6115
|
-
|
|
6116
|
-
buttonName =
|
|
6117
|
-
|
|
6118
|
-
freeOrderButtonName =
|
|
6119
|
-
|
|
6120
|
-
handleSubmit =
|
|
6121
|
-
|
|
6122
|
-
theme =
|
|
6123
|
-
|
|
6124
|
-
onRegisterSuccess =
|
|
6125
|
-
|
|
6126
|
-
onRegisterError =
|
|
6127
|
-
|
|
6128
|
-
onSubmitError =
|
|
6129
|
-
|
|
6130
|
-
onGetCartSuccess =
|
|
6131
|
-
|
|
6132
|
-
onGetCartError =
|
|
6133
|
-
|
|
6134
|
-
onGetCountriesSuccess =
|
|
6135
|
-
|
|
6136
|
-
onGetCountriesError =
|
|
6137
|
-
|
|
6138
|
-
onGetStatesSuccess =
|
|
6139
|
-
|
|
6140
|
-
onGetStatesError =
|
|
6141
|
-
|
|
6142
|
-
_onGetProfileDataSuccess =
|
|
6143
|
-
|
|
6144
|
-
onGetProfileDataError =
|
|
6145
|
-
onLogin =
|
|
6146
|
-
|
|
6147
|
-
onLoginSuccess =
|
|
6148
|
-
|
|
6149
|
-
onCheckoutUpdateSuccess =
|
|
6150
|
-
|
|
6151
|
-
onCheckoutUpdateError =
|
|
6152
|
-
|
|
6153
|
-
pIsLoggedIn =
|
|
6154
|
-
|
|
6155
|
-
accountInfoTitle =
|
|
6156
|
-
hideLogo =
|
|
6157
|
-
themeOptions =
|
|
6158
|
-
|
|
6159
|
-
onErrorClose =
|
|
6160
|
-
|
|
6161
|
-
hideErrorsAlertSection =
|
|
6162
|
-
|
|
6163
|
-
onSkipBillingPage =
|
|
6164
|
-
|
|
6165
|
-
skipPage =
|
|
6166
|
-
|
|
6167
|
-
canSkipHolderNames =
|
|
6168
|
-
|
|
6169
|
-
onForgotPasswordSuccess =
|
|
6170
|
-
|
|
6171
|
-
onForgotPasswordError =
|
|
6172
|
-
|
|
6173
|
-
shouldFetchCountries =
|
|
6174
|
-
|
|
6175
|
-
onCountdownFinish =
|
|
6176
|
-
|
|
6177
|
-
enableTimer =
|
|
6178
|
-
logo =
|
|
6179
|
-
|
|
6180
|
-
showForgotPasswordButton =
|
|
6181
|
-
|
|
6182
|
-
showSignUpButton =
|
|
6183
|
-
|
|
6184
|
-
brandOptIn =
|
|
6185
|
-
|
|
6186
|
-
showPoweredByImage =
|
|
6187
|
-
customFieldsOrderKeys =
|
|
6188
|
-
customFieldsTicketHolderKeys =
|
|
6189
|
-
|
|
6190
|
-
isCountryCodeEditable =
|
|
6191
|
-
|
|
6192
|
-
onPendingVerification =
|
|
6193
|
-
|
|
6194
|
-
onGetCheckoutConfigsSuccess =
|
|
6195
|
-
|
|
6196
|
-
onGetCheckoutConfigsError =
|
|
6197
|
-
|
|
6198
|
-
includeAddons =
|
|
6199
|
-
addonsProps =
|
|
6200
|
-
addOnDataWithCustomFields =
|
|
6201
|
-
|
|
6202
|
-
isSinglePageCheckout =
|
|
6203
|
-
|
|
6204
|
-
paymentProps =
|
|
6205
|
-
paymentSectionAddon =
|
|
6740
|
+
} : _ref6$ticketHoldersFi,
|
|
6741
|
+
_ref6$initialValues = _ref6.initialValues,
|
|
6742
|
+
initialValues = _ref6$initialValues === void 0 ? {} : _ref6$initialValues,
|
|
6743
|
+
_ref6$buttonName = _ref6.buttonName,
|
|
6744
|
+
buttonName = _ref6$buttonName === void 0 ? 'Submit' : _ref6$buttonName,
|
|
6745
|
+
_ref6$freeOrderButton = _ref6.freeOrderButtonName,
|
|
6746
|
+
freeOrderButtonName = _ref6$freeOrderButton === void 0 ? 'Complete Registration' : _ref6$freeOrderButton,
|
|
6747
|
+
_ref6$handleSubmit = _ref6.handleSubmit,
|
|
6748
|
+
handleSubmit = _ref6$handleSubmit === void 0 ? _identity : _ref6$handleSubmit,
|
|
6749
|
+
_ref6$theme = _ref6.theme,
|
|
6750
|
+
theme = _ref6$theme === void 0 ? 'light' : _ref6$theme,
|
|
6751
|
+
_ref6$onRegisterSucce = _ref6.onRegisterSuccess,
|
|
6752
|
+
onRegisterSuccess = _ref6$onRegisterSucce === void 0 ? _identity : _ref6$onRegisterSucce,
|
|
6753
|
+
_ref6$onRegisterError = _ref6.onRegisterError,
|
|
6754
|
+
onRegisterError = _ref6$onRegisterError === void 0 ? _identity : _ref6$onRegisterError,
|
|
6755
|
+
_ref6$onSubmitError = _ref6.onSubmitError,
|
|
6756
|
+
onSubmitError = _ref6$onSubmitError === void 0 ? _identity : _ref6$onSubmitError,
|
|
6757
|
+
_ref6$onGetCartSucces = _ref6.onGetCartSuccess,
|
|
6758
|
+
onGetCartSuccess = _ref6$onGetCartSucces === void 0 ? _identity : _ref6$onGetCartSucces,
|
|
6759
|
+
_ref6$onGetCartError = _ref6.onGetCartError,
|
|
6760
|
+
onGetCartError = _ref6$onGetCartError === void 0 ? _identity : _ref6$onGetCartError,
|
|
6761
|
+
_ref6$onGetCountriesS = _ref6.onGetCountriesSuccess,
|
|
6762
|
+
onGetCountriesSuccess = _ref6$onGetCountriesS === void 0 ? _identity : _ref6$onGetCountriesS,
|
|
6763
|
+
_ref6$onGetCountriesE = _ref6.onGetCountriesError,
|
|
6764
|
+
onGetCountriesError = _ref6$onGetCountriesE === void 0 ? _identity : _ref6$onGetCountriesE,
|
|
6765
|
+
_ref6$onGetStatesSucc = _ref6.onGetStatesSuccess,
|
|
6766
|
+
onGetStatesSuccess = _ref6$onGetStatesSucc === void 0 ? _identity : _ref6$onGetStatesSucc,
|
|
6767
|
+
_ref6$onGetStatesErro = _ref6.onGetStatesError,
|
|
6768
|
+
onGetStatesError = _ref6$onGetStatesErro === void 0 ? _identity : _ref6$onGetStatesErro,
|
|
6769
|
+
_ref6$onGetProfileDat = _ref6.onGetProfileDataSuccess,
|
|
6770
|
+
_onGetProfileDataSuccess = _ref6$onGetProfileDat === void 0 ? _identity : _ref6$onGetProfileDat,
|
|
6771
|
+
_ref6$onGetProfileDat2 = _ref6.onGetProfileDataError,
|
|
6772
|
+
onGetProfileDataError = _ref6$onGetProfileDat2 === void 0 ? _identity : _ref6$onGetProfileDat2,
|
|
6773
|
+
onLogin = _ref6.onLogin,
|
|
6774
|
+
_ref6$onLoginSuccess = _ref6.onLoginSuccess,
|
|
6775
|
+
onLoginSuccess = _ref6$onLoginSuccess === void 0 ? _identity : _ref6$onLoginSuccess,
|
|
6776
|
+
_ref6$onCheckoutUpdat = _ref6.onCheckoutUpdateSuccess,
|
|
6777
|
+
onCheckoutUpdateSuccess = _ref6$onCheckoutUpdat === void 0 ? _identity : _ref6$onCheckoutUpdat,
|
|
6778
|
+
_ref6$onCheckoutUpdat2 = _ref6.onCheckoutUpdateError,
|
|
6779
|
+
onCheckoutUpdateError = _ref6$onCheckoutUpdat2 === void 0 ? _identity : _ref6$onCheckoutUpdat2,
|
|
6780
|
+
_ref6$isLoggedIn = _ref6.isLoggedIn,
|
|
6781
|
+
pIsLoggedIn = _ref6$isLoggedIn === void 0 ? false : _ref6$isLoggedIn,
|
|
6782
|
+
_ref6$accountInfoTitl = _ref6.accountInfoTitle,
|
|
6783
|
+
accountInfoTitle = _ref6$accountInfoTitl === void 0 ? '' : _ref6$accountInfoTitl,
|
|
6784
|
+
hideLogo = _ref6.hideLogo,
|
|
6785
|
+
themeOptions = _ref6.themeOptions,
|
|
6786
|
+
_ref6$onErrorClose = _ref6.onErrorClose,
|
|
6787
|
+
onErrorClose = _ref6$onErrorClose === void 0 ? _identity : _ref6$onErrorClose,
|
|
6788
|
+
_ref6$hideErrorsAlert = _ref6.hideErrorsAlertSection,
|
|
6789
|
+
hideErrorsAlertSection = _ref6$hideErrorsAlert === void 0 ? false : _ref6$hideErrorsAlert,
|
|
6790
|
+
_ref6$onSkipBillingPa = _ref6.onSkipBillingPage,
|
|
6791
|
+
onSkipBillingPage = _ref6$onSkipBillingPa === void 0 ? _identity : _ref6$onSkipBillingPa,
|
|
6792
|
+
_ref6$skipPage = _ref6.skipPage,
|
|
6793
|
+
skipPage = _ref6$skipPage === void 0 ? false : _ref6$skipPage,
|
|
6794
|
+
_ref6$canSkipHolderNa = _ref6.canSkipHolderNames,
|
|
6795
|
+
canSkipHolderNames = _ref6$canSkipHolderNa === void 0 ? false : _ref6$canSkipHolderNa,
|
|
6796
|
+
_ref6$onForgotPasswor = _ref6.onForgotPasswordSuccess,
|
|
6797
|
+
onForgotPasswordSuccess = _ref6$onForgotPasswor === void 0 ? _identity : _ref6$onForgotPasswor,
|
|
6798
|
+
_ref6$onForgotPasswor2 = _ref6.onForgotPasswordError,
|
|
6799
|
+
onForgotPasswordError = _ref6$onForgotPasswor2 === void 0 ? _identity : _ref6$onForgotPasswor2,
|
|
6800
|
+
_ref6$shouldFetchCoun = _ref6.shouldFetchCountries,
|
|
6801
|
+
shouldFetchCountries = _ref6$shouldFetchCoun === void 0 ? true : _ref6$shouldFetchCoun,
|
|
6802
|
+
_ref6$onCountdownFini = _ref6.onCountdownFinish,
|
|
6803
|
+
onCountdownFinish = _ref6$onCountdownFini === void 0 ? _identity : _ref6$onCountdownFini,
|
|
6804
|
+
_ref6$enableTimer = _ref6.enableTimer,
|
|
6805
|
+
enableTimer = _ref6$enableTimer === void 0 ? false : _ref6$enableTimer,
|
|
6806
|
+
logo = _ref6.logo,
|
|
6807
|
+
_ref6$showForgotPassw = _ref6.showForgotPasswordButton,
|
|
6808
|
+
showForgotPasswordButton = _ref6$showForgotPassw === void 0 ? false : _ref6$showForgotPassw,
|
|
6809
|
+
_ref6$showSignUpButto = _ref6.showSignUpButton,
|
|
6810
|
+
showSignUpButton = _ref6$showSignUpButto === void 0 ? false : _ref6$showSignUpButto,
|
|
6811
|
+
_ref6$brandOptIn = _ref6.brandOptIn,
|
|
6812
|
+
brandOptIn = _ref6$brandOptIn === void 0 ? false : _ref6$brandOptIn,
|
|
6813
|
+
_ref6$showPoweredByIm = _ref6.showPoweredByImage,
|
|
6814
|
+
showPoweredByImage = _ref6$showPoweredByIm === void 0 ? false : _ref6$showPoweredByIm,
|
|
6815
|
+
customFieldsOrderKeys = _ref6.customFieldsOrderKeys,
|
|
6816
|
+
customFieldsTicketHolderKeys = _ref6.customFieldsTicketHolderKeys,
|
|
6817
|
+
_ref6$isCountryCodeEd = _ref6.isCountryCodeEditable,
|
|
6818
|
+
isCountryCodeEditable = _ref6$isCountryCodeEd === void 0 ? true : _ref6$isCountryCodeEd,
|
|
6819
|
+
_ref6$onPendingVerifi = _ref6.onPendingVerification,
|
|
6820
|
+
onPendingVerification = _ref6$onPendingVerifi === void 0 ? _identity : _ref6$onPendingVerifi,
|
|
6821
|
+
_ref6$onGetCheckoutCo = _ref6.onGetCheckoutConfigsSuccess,
|
|
6822
|
+
onGetCheckoutConfigsSuccess = _ref6$onGetCheckoutCo === void 0 ? _identity : _ref6$onGetCheckoutCo,
|
|
6823
|
+
_ref6$onGetCheckoutCo2 = _ref6.onGetCheckoutConfigsError,
|
|
6824
|
+
onGetCheckoutConfigsError = _ref6$onGetCheckoutCo2 === void 0 ? _identity : _ref6$onGetCheckoutCo2,
|
|
6825
|
+
_ref6$includeAddons = _ref6.includeAddons,
|
|
6826
|
+
includeAddons = _ref6$includeAddons === void 0 ? false : _ref6$includeAddons,
|
|
6827
|
+
addonsProps = _ref6.addonsProps,
|
|
6828
|
+
addOnDataWithCustomFields = _ref6.addOnDataWithCustomFields,
|
|
6829
|
+
_ref6$isSinglePageChe = _ref6.isSinglePageCheckout,
|
|
6830
|
+
isSinglePageCheckout = _ref6$isSinglePageChe === void 0 ? false : _ref6$isSinglePageChe,
|
|
6831
|
+
_ref6$paymentProps = _ref6.paymentProps,
|
|
6832
|
+
paymentProps = _ref6$paymentProps === void 0 ? {} : _ref6$paymentProps,
|
|
6833
|
+
paymentSectionAddon = _ref6.paymentSectionAddon;
|
|
6206
6834
|
var _useState = useState(null),
|
|
6207
6835
|
extraData = _useState[0],
|
|
6208
6836
|
setExtraData = _useState[1];
|
|
@@ -6305,6 +6933,9 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6305
6933
|
var _useState19 = useState(false),
|
|
6306
6934
|
phoneValidationIsLoading = _useState19[0],
|
|
6307
6935
|
setPhoneValidationIsLoading = _useState19[1];
|
|
6936
|
+
var _useState20 = useState(false),
|
|
6937
|
+
emailExists = _useState20[0],
|
|
6938
|
+
setEmailExists = _useState20[1];
|
|
6308
6939
|
var emailLogged = _get(userData, 'email', '') || _get(userValues, 'email', '');
|
|
6309
6940
|
var firstNameLogged = _get(userData, 'first_name', '') || _get(userValues, 'first_name', '');
|
|
6310
6941
|
var lastNameLogged = _get(userData, 'last_name', '') || _get(userValues, 'last_name', '');
|
|
@@ -6336,18 +6967,18 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6336
6967
|
var collectOptionalBusinessCategory = configs == null ? void 0 : configs.collect_optional_business_category;
|
|
6337
6968
|
var eventHasAddons = configs == null ? void 0 : configs.has_add_on;
|
|
6338
6969
|
var hideBusinessCategoryField = !collectMandatoryBusinessCategory && !collectOptionalBusinessCategory;
|
|
6339
|
-
var
|
|
6340
|
-
pendingVerificationMessage =
|
|
6341
|
-
setPendingVerificationMessage =
|
|
6342
|
-
var _useState21 = useState({}),
|
|
6343
|
-
reviewData = _useState21[0],
|
|
6344
|
-
setReviewData = _useState21[1];
|
|
6970
|
+
var _useState21 = useState(),
|
|
6971
|
+
pendingVerificationMessage = _useState21[0],
|
|
6972
|
+
setPendingVerificationMessage = _useState21[1];
|
|
6345
6973
|
var _useState22 = useState({}),
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
var _useState23 = useState(
|
|
6349
|
-
|
|
6350
|
-
|
|
6974
|
+
reviewData = _useState22[0],
|
|
6975
|
+
setReviewData = _useState22[1];
|
|
6976
|
+
var _useState23 = useState({}),
|
|
6977
|
+
checkoutData = _useState23[0],
|
|
6978
|
+
setCheckoutData = _useState23[1];
|
|
6979
|
+
var _useState24 = useState(null),
|
|
6980
|
+
checkoutUpdateData = _useState24[0],
|
|
6981
|
+
setCheckoutUpdateData = _useState24[1];
|
|
6351
6982
|
var prevData = useRef(data);
|
|
6352
6983
|
var addAddOnsInAttributes = useCallback(function (checkoutBody) {
|
|
6353
6984
|
var selectedAddOns = window.localStorage.getItem('add_ons') || '{}';
|
|
@@ -6355,9 +6986,9 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6355
6986
|
checkoutBody.attributes.add_ons = JSON.parse(selectedAddOns);
|
|
6356
6987
|
checkoutBody.attributes.add_on_data_capture = JSON.parse(addOnDataCapture);
|
|
6357
6988
|
}, []);
|
|
6358
|
-
var
|
|
6359
|
-
singleCheckoutAddons =
|
|
6360
|
-
setSingleCheckoutAddOns =
|
|
6989
|
+
var _useState25 = useState({}),
|
|
6990
|
+
singleCheckoutAddons = _useState25[0],
|
|
6991
|
+
setSingleCheckoutAddOns = _useState25[1];
|
|
6361
6992
|
var orderIsFree = !Number(checkoutData == null ? void 0 : checkoutData.total);
|
|
6362
6993
|
useEffect(function () {
|
|
6363
6994
|
var hasUniqueId = _get(dataWithUniqueIds, '[0].uniqueId');
|
|
@@ -6388,37 +7019,37 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6388
7019
|
useEffect(function () {
|
|
6389
7020
|
// fetch countries data
|
|
6390
7021
|
var fetchCountries = /*#__PURE__*/function () {
|
|
6391
|
-
var
|
|
7022
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
6392
7023
|
var res;
|
|
6393
|
-
return _regeneratorRuntime().wrap(function
|
|
6394
|
-
while (1) switch (
|
|
7024
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
7025
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
6395
7026
|
case 0:
|
|
6396
|
-
|
|
6397
|
-
|
|
7027
|
+
_context3.prev = 0;
|
|
7028
|
+
_context3.next = 3;
|
|
6398
7029
|
return getCountries();
|
|
6399
7030
|
case 3:
|
|
6400
|
-
res =
|
|
7031
|
+
res = _context3.sent;
|
|
6401
7032
|
setCustomHeader(res);
|
|
6402
7033
|
setCountries(res.data);
|
|
6403
7034
|
setIsCountriesLoading(false);
|
|
6404
7035
|
onGetCountriesSuccess(res.data);
|
|
6405
|
-
|
|
7036
|
+
_context3.next = 14;
|
|
6406
7037
|
break;
|
|
6407
7038
|
case 10:
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
if (axios.isAxiosError(
|
|
6411
|
-
onGetCountriesError(
|
|
7039
|
+
_context3.prev = 10;
|
|
7040
|
+
_context3.t0 = _context3["catch"](0);
|
|
7041
|
+
if (axios.isAxiosError(_context3.t0)) {
|
|
7042
|
+
onGetCountriesError(_context3.t0);
|
|
6412
7043
|
}
|
|
6413
7044
|
setIsCountriesLoading(false);
|
|
6414
7045
|
case 14:
|
|
6415
7046
|
case "end":
|
|
6416
|
-
return
|
|
7047
|
+
return _context3.stop();
|
|
6417
7048
|
}
|
|
6418
|
-
},
|
|
7049
|
+
}, _callee3, null, [[0, 10]]);
|
|
6419
7050
|
}));
|
|
6420
7051
|
return function fetchCountries() {
|
|
6421
|
-
return
|
|
7052
|
+
return _ref7.apply(this, arguments);
|
|
6422
7053
|
};
|
|
6423
7054
|
}();
|
|
6424
7055
|
shouldFetchCountries && fetchCountries();
|
|
@@ -6434,17 +7065,17 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6434
7065
|
}, [eventId, isSinglePageCheckout, shouldFetchCountries, onGetCountriesSuccess, onGetCountriesError]);
|
|
6435
7066
|
// fetch cart data
|
|
6436
7067
|
var fetchCart = /*#__PURE__*/function () {
|
|
6437
|
-
var
|
|
7068
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
6438
7069
|
var res, cartInfo, _cartInfo$cart, cart;
|
|
6439
|
-
return _regeneratorRuntime().wrap(function
|
|
6440
|
-
while (1) switch (
|
|
7070
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
7071
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
6441
7072
|
case 0:
|
|
6442
|
-
|
|
7073
|
+
_context4.prev = 0;
|
|
6443
7074
|
setCardLoading(true);
|
|
6444
|
-
|
|
7075
|
+
_context4.next = 4;
|
|
6445
7076
|
return getCart();
|
|
6446
7077
|
case 4:
|
|
6447
|
-
res =
|
|
7078
|
+
res = _context4.sent;
|
|
6448
7079
|
setCustomHeader(res);
|
|
6449
7080
|
cartInfo = res.data.attributes;
|
|
6450
7081
|
setCartInfo(cartInfo);
|
|
@@ -6453,44 +7084,44 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6453
7084
|
return nanoid();
|
|
6454
7085
|
}));
|
|
6455
7086
|
onGetCartSuccess(res.data);
|
|
6456
|
-
|
|
7087
|
+
_context4.next = 16;
|
|
6457
7088
|
break;
|
|
6458
7089
|
case 13:
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
if (axios.isAxiosError(
|
|
6462
|
-
onGetCartError(
|
|
7090
|
+
_context4.prev = 13;
|
|
7091
|
+
_context4.t0 = _context4["catch"](0);
|
|
7092
|
+
if (axios.isAxiosError(_context4.t0)) {
|
|
7093
|
+
onGetCartError(_context4.t0);
|
|
6463
7094
|
}
|
|
6464
7095
|
case 16:
|
|
6465
|
-
|
|
7096
|
+
_context4.prev = 16;
|
|
6466
7097
|
setCardLoading(false);
|
|
6467
|
-
return
|
|
7098
|
+
return _context4.finish(16);
|
|
6468
7099
|
case 19:
|
|
6469
7100
|
case "end":
|
|
6470
|
-
return
|
|
7101
|
+
return _context4.stop();
|
|
6471
7102
|
}
|
|
6472
|
-
},
|
|
7103
|
+
}, _callee4, null, [[0, 13, 16, 19]]);
|
|
6473
7104
|
}));
|
|
6474
7105
|
return function fetchCart() {
|
|
6475
|
-
return
|
|
7106
|
+
return _ref8.apply(this, arguments);
|
|
6476
7107
|
};
|
|
6477
7108
|
}();
|
|
6478
7109
|
// fetch user data
|
|
6479
7110
|
var fetchUserData = /*#__PURE__*/function () {
|
|
6480
|
-
var
|
|
7111
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
6481
7112
|
var userDataResponse, profileSpecifiedData, profileDataObj;
|
|
6482
|
-
return _regeneratorRuntime().wrap(function
|
|
6483
|
-
while (1) switch (
|
|
7113
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
7114
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
6484
7115
|
case 0:
|
|
6485
|
-
|
|
7116
|
+
_context5.prev = 0;
|
|
6486
7117
|
if (!isLoggedIn) {
|
|
6487
|
-
|
|
7118
|
+
_context5.next = 10;
|
|
6488
7119
|
break;
|
|
6489
7120
|
}
|
|
6490
|
-
|
|
7121
|
+
_context5.next = 4;
|
|
6491
7122
|
return getProfileData();
|
|
6492
7123
|
case 4:
|
|
6493
|
-
userDataResponse =
|
|
7124
|
+
userDataResponse = _context5.sent;
|
|
6494
7125
|
profileSpecifiedData = _get(userDataResponse, 'data');
|
|
6495
7126
|
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
6496
7127
|
setUserValues(_extends({}, profileDataObj, {
|
|
@@ -6500,22 +7131,22 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6500
7131
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
6501
7132
|
_onGetProfileDataSuccess(userDataResponse.data);
|
|
6502
7133
|
case 10:
|
|
6503
|
-
|
|
7134
|
+
_context5.next = 15;
|
|
6504
7135
|
break;
|
|
6505
7136
|
case 12:
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
if (axios.isAxiosError(
|
|
6509
|
-
onGetProfileDataError(
|
|
7137
|
+
_context5.prev = 12;
|
|
7138
|
+
_context5.t0 = _context5["catch"](0);
|
|
7139
|
+
if (axios.isAxiosError(_context5.t0)) {
|
|
7140
|
+
onGetProfileDataError(_context5.t0);
|
|
6510
7141
|
}
|
|
6511
7142
|
case 15:
|
|
6512
7143
|
case "end":
|
|
6513
|
-
return
|
|
7144
|
+
return _context5.stop();
|
|
6514
7145
|
}
|
|
6515
|
-
},
|
|
7146
|
+
}, _callee5, null, [[0, 12]]);
|
|
6516
7147
|
}));
|
|
6517
7148
|
return function fetchUserData() {
|
|
6518
|
-
return
|
|
7149
|
+
return _ref9.apply(this, arguments);
|
|
6519
7150
|
};
|
|
6520
7151
|
}();
|
|
6521
7152
|
useEffect(function () {
|
|
@@ -6524,19 +7155,19 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6524
7155
|
}, [isLoggedIn]);
|
|
6525
7156
|
useEffect(function () {
|
|
6526
7157
|
var fetchCheckoutUpdate = /*#__PURE__*/function () {
|
|
6527
|
-
var
|
|
7158
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
6528
7159
|
var checkoutUpdateResponse, checkoutAttributes, cartPriceBreakdown;
|
|
6529
|
-
return _regeneratorRuntime().wrap(function
|
|
6530
|
-
while (1) switch (
|
|
7160
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
7161
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
6531
7162
|
case 0:
|
|
6532
7163
|
if (eventId) {
|
|
6533
|
-
|
|
7164
|
+
_context6.next = 2;
|
|
6534
7165
|
break;
|
|
6535
7166
|
}
|
|
6536
|
-
return
|
|
7167
|
+
return _context6.abrupt("return");
|
|
6537
7168
|
case 2:
|
|
6538
|
-
|
|
6539
|
-
|
|
7169
|
+
_context6.prev = 2;
|
|
7170
|
+
_context6.next = 5;
|
|
6540
7171
|
return updateCheckout({
|
|
6541
7172
|
attributes: {
|
|
6542
7173
|
event_id: eventId,
|
|
@@ -6544,7 +7175,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6544
7175
|
}
|
|
6545
7176
|
});
|
|
6546
7177
|
case 5:
|
|
6547
|
-
checkoutUpdateResponse =
|
|
7178
|
+
checkoutUpdateResponse = _context6.sent;
|
|
6548
7179
|
console.log('Stripe in [useEffect] fetchCheckoutUpdate', checkoutUpdateResponse);
|
|
6549
7180
|
if (checkoutUpdateResponse.success) {
|
|
6550
7181
|
checkoutAttributes = checkoutUpdateResponse.data.attributes;
|
|
@@ -6559,71 +7190,71 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6559
7190
|
expires_at: expirationTime
|
|
6560
7191
|
}, cartPriceBreakdown));
|
|
6561
7192
|
}
|
|
6562
|
-
|
|
7193
|
+
_context6.next = 13;
|
|
6563
7194
|
break;
|
|
6564
7195
|
case 10:
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
console.error('Failed to fetch checkout update:',
|
|
7196
|
+
_context6.prev = 10;
|
|
7197
|
+
_context6.t0 = _context6["catch"](2);
|
|
7198
|
+
console.error('Failed to fetch checkout update:', _context6.t0);
|
|
6568
7199
|
case 13:
|
|
6569
7200
|
case "end":
|
|
6570
|
-
return
|
|
7201
|
+
return _context6.stop();
|
|
6571
7202
|
}
|
|
6572
|
-
},
|
|
7203
|
+
}, _callee6, null, [[2, 10]]);
|
|
6573
7204
|
}));
|
|
6574
7205
|
return function fetchCheckoutUpdate() {
|
|
6575
|
-
return
|
|
7206
|
+
return _ref10.apply(this, arguments);
|
|
6576
7207
|
};
|
|
6577
7208
|
}();
|
|
6578
7209
|
fetchCheckoutUpdate();
|
|
6579
7210
|
}, [eventId, additionalConfigs == null ? void 0 : additionalConfigs.resale]);
|
|
6580
7211
|
useEffect(function () {
|
|
6581
7212
|
var collectPaymentData = /*#__PURE__*/function () {
|
|
6582
|
-
var
|
|
7213
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
6583
7214
|
var checkoutBody, checkoutResponse;
|
|
6584
|
-
return _regeneratorRuntime().wrap(function
|
|
6585
|
-
while (1) switch (
|
|
7215
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
7216
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
6586
7217
|
case 0:
|
|
6587
7218
|
if (!(skipPage && !_isEmpty(ticketsQuantity) && !showDOB && !loading && !isNewUser)) {
|
|
6588
|
-
|
|
7219
|
+
_context7.next = 20;
|
|
6589
7220
|
break;
|
|
6590
7221
|
}
|
|
6591
7222
|
setLoading(true);
|
|
6592
7223
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity.length, userData);
|
|
6593
|
-
|
|
7224
|
+
_context7.prev = 3;
|
|
6594
7225
|
if (isBrowser) {
|
|
6595
7226
|
addAddOnsInAttributes(checkoutBody);
|
|
6596
7227
|
}
|
|
6597
|
-
|
|
7228
|
+
_context7.next = 7;
|
|
6598
7229
|
return postOnCheckout(checkoutBody, flagFreeTicket);
|
|
6599
7230
|
case 7:
|
|
6600
|
-
checkoutResponse =
|
|
7231
|
+
checkoutResponse = _context7.sent;
|
|
6601
7232
|
removeReferralKey();
|
|
6602
7233
|
removeAdditionalConfigs();
|
|
6603
7234
|
onSkipBillingPage(checkoutResponse.data.attributes);
|
|
6604
7235
|
setLoading(false);
|
|
6605
|
-
|
|
7236
|
+
_context7.next = 18;
|
|
6606
7237
|
break;
|
|
6607
7238
|
case 14:
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
onSubmitError(
|
|
6611
|
-
if (_get(
|
|
6612
|
-
setPendingVerificationMessage(_get(
|
|
7239
|
+
_context7.prev = 14;
|
|
7240
|
+
_context7.t0 = _context7["catch"](3);
|
|
7241
|
+
onSubmitError(_context7.t0);
|
|
7242
|
+
if (_get(_context7.t0, 'response.data.data.hasUnverifiedOrder')) {
|
|
7243
|
+
setPendingVerificationMessage(_get(_context7.t0, 'response.data.message'));
|
|
6613
7244
|
}
|
|
6614
7245
|
case 18:
|
|
6615
|
-
|
|
7246
|
+
_context7.next = 21;
|
|
6616
7247
|
break;
|
|
6617
7248
|
case 20:
|
|
6618
7249
|
setLoading(false);
|
|
6619
7250
|
case 21:
|
|
6620
7251
|
case "end":
|
|
6621
|
-
return
|
|
7252
|
+
return _context7.stop();
|
|
6622
7253
|
}
|
|
6623
|
-
},
|
|
7254
|
+
}, _callee7, null, [[3, 14]]);
|
|
6624
7255
|
}));
|
|
6625
7256
|
return function collectPaymentData() {
|
|
6626
|
-
return
|
|
7257
|
+
return _ref11.apply(this, arguments);
|
|
6627
7258
|
};
|
|
6628
7259
|
}();
|
|
6629
7260
|
collectPaymentData();
|
|
@@ -6751,24 +7382,24 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6751
7382
|
}),
|
|
6752
7383
|
processPayment = _useStripePayment.processPayment;
|
|
6753
7384
|
var updateCheckoutWithAddOns = useCallback( /*#__PURE__*/function () {
|
|
6754
|
-
var
|
|
7385
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(addOns) {
|
|
6755
7386
|
var mergedAddOns, _checkoutUpdateData, checkoutResponse, checkoutDataObj, errorMessage;
|
|
6756
|
-
return _regeneratorRuntime().wrap(function
|
|
6757
|
-
while (1) switch (
|
|
7387
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
7388
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
6758
7389
|
case 0:
|
|
6759
7390
|
if (addOns === void 0) {
|
|
6760
7391
|
addOns = {};
|
|
6761
7392
|
}
|
|
6762
7393
|
if (isSinglePageCheckout) {
|
|
6763
|
-
|
|
7394
|
+
_context8.next = 3;
|
|
6764
7395
|
break;
|
|
6765
7396
|
}
|
|
6766
|
-
return
|
|
7397
|
+
return _context8.abrupt("return");
|
|
6767
7398
|
case 3:
|
|
6768
7399
|
mergedAddOns = _extends({}, singleCheckoutAddons); // Update existing entries and add new ones
|
|
6769
|
-
Object.entries(addOns).forEach(function (
|
|
6770
|
-
var key =
|
|
6771
|
-
value =
|
|
7400
|
+
Object.entries(addOns).forEach(function (_ref13) {
|
|
7401
|
+
var key = _ref13[0],
|
|
7402
|
+
value = _ref13[1];
|
|
6772
7403
|
var amount = Number(value);
|
|
6773
7404
|
if (amount) {
|
|
6774
7405
|
mergedAddOns[key] = amount;
|
|
@@ -6776,7 +7407,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6776
7407
|
delete mergedAddOns[key];
|
|
6777
7408
|
}
|
|
6778
7409
|
});
|
|
6779
|
-
|
|
7410
|
+
_context8.prev = 5;
|
|
6780
7411
|
_checkoutUpdateData = {
|
|
6781
7412
|
attributes: {
|
|
6782
7413
|
event_id: eventId,
|
|
@@ -6784,51 +7415,51 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6784
7415
|
is_from_resale: additionalConfigs == null ? void 0 : additionalConfigs.resale
|
|
6785
7416
|
}
|
|
6786
7417
|
};
|
|
6787
|
-
|
|
7418
|
+
_context8.next = 9;
|
|
6788
7419
|
return updateCheckout(_checkoutUpdateData);
|
|
6789
7420
|
case 9:
|
|
6790
|
-
checkoutResponse =
|
|
7421
|
+
checkoutResponse = _context8.sent;
|
|
6791
7422
|
if (checkoutResponse.success) {
|
|
6792
7423
|
checkoutDataObj = _get(checkoutResponse, 'data.attributes.cart_price_breakdown', {});
|
|
6793
7424
|
setCheckoutData(checkoutDataObj);
|
|
6794
7425
|
setSingleCheckoutAddOns(mergedAddOns);
|
|
6795
7426
|
}
|
|
6796
|
-
|
|
7427
|
+
_context8.next = 18;
|
|
6797
7428
|
break;
|
|
6798
7429
|
case 13:
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
errorMessage = _get(
|
|
7430
|
+
_context8.prev = 13;
|
|
7431
|
+
_context8.t0 = _context8["catch"](5);
|
|
7432
|
+
errorMessage = _get(_context8.t0, 'response.data.message', 'Failed to update add-ons');
|
|
6802
7433
|
setError(errorMessage);
|
|
6803
|
-
onCheckoutUpdateError(
|
|
7434
|
+
onCheckoutUpdateError(_context8.t0);
|
|
6804
7435
|
case 18:
|
|
6805
7436
|
case "end":
|
|
6806
|
-
return
|
|
7437
|
+
return _context8.stop();
|
|
6807
7438
|
}
|
|
6808
|
-
},
|
|
7439
|
+
}, _callee8, null, [[5, 13]]);
|
|
6809
7440
|
}));
|
|
6810
7441
|
return function (_x) {
|
|
6811
|
-
return
|
|
7442
|
+
return _ref12.apply(this, arguments);
|
|
6812
7443
|
};
|
|
6813
7444
|
}(), [eventId, isSinglePageCheckout, onCheckoutUpdateError, onCheckoutUpdateSuccess]);
|
|
6814
7445
|
console.log({
|
|
6815
7446
|
checkoutData: checkoutData
|
|
6816
7447
|
});
|
|
6817
7448
|
var handleAddOnSelect = useCallback( /*#__PURE__*/function () {
|
|
6818
|
-
var
|
|
6819
|
-
return _regeneratorRuntime().wrap(function
|
|
6820
|
-
while (1) switch (
|
|
7449
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(selectedAddOns) {
|
|
7450
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
7451
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
6821
7452
|
case 0:
|
|
6822
|
-
|
|
7453
|
+
_context9.next = 2;
|
|
6823
7454
|
return updateCheckoutWithAddOns(selectedAddOns);
|
|
6824
7455
|
case 2:
|
|
6825
7456
|
case "end":
|
|
6826
|
-
return
|
|
7457
|
+
return _context9.stop();
|
|
6827
7458
|
}
|
|
6828
|
-
},
|
|
7459
|
+
}, _callee9);
|
|
6829
7460
|
}));
|
|
6830
7461
|
return function (_x2) {
|
|
6831
|
-
return
|
|
7462
|
+
return _ref14.apply(this, arguments);
|
|
6832
7463
|
};
|
|
6833
7464
|
}(), [updateCheckoutWithAddOns]);
|
|
6834
7465
|
var onAddOnSelect = useCallback(function (id, value, addon, fieldUpdates) {
|
|
@@ -6912,16 +7543,16 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6912
7543
|
}, initialValues), userValues, ticketHoldersFields, ticketsQuantity),
|
|
6913
7544
|
enableReinitialize: false,
|
|
6914
7545
|
onSubmit: function () {
|
|
6915
|
-
var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
7546
|
+
var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(values, formikHelpers) {
|
|
6916
7547
|
var _checkoutBody$attribu2, _checkoutBody$attribu3, flagRequirePhoneLocal, holdersCount, hasHolderPhoneError, i, fieldName, value, userDataObj, profileData, profileSpecifiedData, checkoutBody, storedAddOnDataCapture, checkoutResponse, checkoutUpdateResponse, paymentResponse, _checkoutResponse$dat, hash, total, paymentDataResponse, _cart$, attributes, order_details, cart, _order_details$ticket, ticket, updatedOrderData, isFreeTickets, paymentMethod, paymentPlanAvailable, hasUnverifiedOrder, message, _e$response, event;
|
|
6917
|
-
return _regeneratorRuntime().wrap(function
|
|
6918
|
-
while (1) switch (
|
|
7548
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
7549
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
6919
7550
|
case 0:
|
|
6920
|
-
|
|
7551
|
+
_context10.prev = 0;
|
|
6921
7552
|
// Validation: if phone is required for ticket holders, mark errors and stop submit
|
|
6922
7553
|
flagRequirePhoneLocal = Boolean(configs == null ? void 0 : configs.phone_required);
|
|
6923
7554
|
if (!flagRequirePhoneLocal) {
|
|
6924
|
-
|
|
7555
|
+
_context10.next = 8;
|
|
6925
7556
|
break;
|
|
6926
7557
|
}
|
|
6927
7558
|
holdersCount = ticketsQuantity.length;
|
|
@@ -6936,17 +7567,17 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6936
7567
|
}
|
|
6937
7568
|
}
|
|
6938
7569
|
if (!hasHolderPhoneError) {
|
|
6939
|
-
|
|
7570
|
+
_context10.next = 8;
|
|
6940
7571
|
break;
|
|
6941
7572
|
}
|
|
6942
|
-
return
|
|
7573
|
+
return _context10.abrupt("return");
|
|
6943
7574
|
case 8:
|
|
6944
7575
|
if (!((!elementsRef.current || !stripeRef.current) && !orderIsFree)) {
|
|
6945
|
-
|
|
7576
|
+
_context10.next = 11;
|
|
6946
7577
|
break;
|
|
6947
7578
|
}
|
|
6948
7579
|
setError('Fill in the payment details');
|
|
6949
|
-
return
|
|
7580
|
+
return _context10.abrupt("return");
|
|
6950
7581
|
case 11:
|
|
6951
7582
|
if (isBrowser) {
|
|
6952
7583
|
window.localStorage.setItem('extraData', JSON.stringify({
|
|
@@ -6961,21 +7592,21 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6961
7592
|
// Guest checkout: no need to register, just get profile if logged in
|
|
6962
7593
|
userDataObj = userData;
|
|
6963
7594
|
if (!isLoggedIn) {
|
|
6964
|
-
|
|
7595
|
+
_context10.next = 28;
|
|
6965
7596
|
break;
|
|
6966
7597
|
}
|
|
6967
|
-
|
|
6968
|
-
|
|
7598
|
+
_context10.prev = 15;
|
|
7599
|
+
_context10.next = 18;
|
|
6969
7600
|
return getProfileData();
|
|
6970
7601
|
case 18:
|
|
6971
|
-
profileData =
|
|
7602
|
+
profileData = _context10.sent;
|
|
6972
7603
|
profileSpecifiedData = _get(profileData, 'data');
|
|
6973
7604
|
userDataObj = setLoggedUserData(profileSpecifiedData);
|
|
6974
|
-
|
|
7605
|
+
_context10.next = 26;
|
|
6975
7606
|
break;
|
|
6976
7607
|
case 23:
|
|
6977
|
-
|
|
6978
|
-
|
|
7608
|
+
_context10.prev = 23;
|
|
7609
|
+
_context10.t0 = _context10["catch"](15);
|
|
6979
7610
|
// If profile fetch fails, use values from form
|
|
6980
7611
|
userDataObj = {
|
|
6981
7612
|
email: values.email,
|
|
@@ -6984,7 +7615,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
6984
7615
|
phone: values.phone
|
|
6985
7616
|
};
|
|
6986
7617
|
case 26:
|
|
6987
|
-
|
|
7618
|
+
_context10.next = 29;
|
|
6988
7619
|
break;
|
|
6989
7620
|
case 28:
|
|
6990
7621
|
// For guest checkout, use form values
|
|
@@ -7010,11 +7641,11 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
7010
7641
|
checkoutBody.attributes.add_on_data_capture = JSON.parse(storedAddOnDataCapture);
|
|
7011
7642
|
}
|
|
7012
7643
|
}
|
|
7013
|
-
|
|
7644
|
+
_context10.next = 35;
|
|
7014
7645
|
return postOnCheckout(checkoutBody, flagFreeTicket);
|
|
7015
7646
|
case 35:
|
|
7016
|
-
checkoutResponse =
|
|
7017
|
-
|
|
7647
|
+
checkoutResponse = _context10.sent;
|
|
7648
|
+
_context10.next = 38;
|
|
7018
7649
|
return updateCheckout({
|
|
7019
7650
|
attributes: {
|
|
7020
7651
|
event_id: eventId,
|
|
@@ -7023,12 +7654,12 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
7023
7654
|
}
|
|
7024
7655
|
});
|
|
7025
7656
|
case 38:
|
|
7026
|
-
checkoutUpdateResponse =
|
|
7657
|
+
checkoutUpdateResponse = _context10.sent;
|
|
7027
7658
|
console.log('Stripe checkoutUpdateResponse in billing-info-container', checkoutUpdateResponse);
|
|
7028
7659
|
setCheckoutUpdateData(checkoutUpdateResponse.data.attributes);
|
|
7029
7660
|
paymentResponse = null;
|
|
7030
7661
|
if (!isSinglePageCheckout) {
|
|
7031
|
-
|
|
7662
|
+
_context10.next = 64;
|
|
7032
7663
|
break;
|
|
7033
7664
|
}
|
|
7034
7665
|
_checkoutResponse$dat = checkoutResponse.data.attributes, hash = _checkoutResponse$dat.hash, total = _checkoutResponse$dat.total;
|
|
@@ -7036,12 +7667,12 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
7036
7667
|
hash: hash,
|
|
7037
7668
|
total: total
|
|
7038
7669
|
}));
|
|
7039
|
-
|
|
7670
|
+
_context10.next = 47;
|
|
7040
7671
|
return getPaymentData(String(hash));
|
|
7041
7672
|
case 47:
|
|
7042
|
-
paymentDataResponse =
|
|
7673
|
+
paymentDataResponse = _context10.sent;
|
|
7043
7674
|
if (!paymentDataResponse.success) {
|
|
7044
|
-
|
|
7675
|
+
_context10.next = 64;
|
|
7045
7676
|
break;
|
|
7046
7677
|
}
|
|
7047
7678
|
attributes = paymentDataResponse.data.attributes;
|
|
@@ -7072,7 +7703,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
7072
7703
|
paymentPlanAvailable: paymentPlanAvailable
|
|
7073
7704
|
});
|
|
7074
7705
|
// Process payment using the hook
|
|
7075
|
-
|
|
7706
|
+
_context10.next = 61;
|
|
7076
7707
|
return processPayment(paymentDataResponse, values, formikHelpers, checkoutResponse, checkoutUpdateResponse, {
|
|
7077
7708
|
attributes: attributes,
|
|
7078
7709
|
isFreeTickets: isFreeTickets,
|
|
@@ -7080,29 +7711,29 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
7080
7711
|
eventId: eventId
|
|
7081
7712
|
});
|
|
7082
7713
|
case 61:
|
|
7083
|
-
paymentResponse =
|
|
7714
|
+
paymentResponse = _context10.sent;
|
|
7084
7715
|
if (!(!paymentResponse && !isFreeTickets)) {
|
|
7085
|
-
|
|
7716
|
+
_context10.next = 64;
|
|
7086
7717
|
break;
|
|
7087
7718
|
}
|
|
7088
|
-
return
|
|
7719
|
+
return _context10.abrupt("return");
|
|
7089
7720
|
case 64:
|
|
7090
7721
|
removeReferralKey();
|
|
7091
7722
|
removeAdditionalConfigs();
|
|
7092
7723
|
handleSubmit(values, formikHelpers, eventId, checkoutResponse, checkoutUpdateResponse, paymentResponse);
|
|
7093
|
-
|
|
7724
|
+
_context10.next = 77;
|
|
7094
7725
|
break;
|
|
7095
7726
|
case 69:
|
|
7096
|
-
|
|
7097
|
-
|
|
7727
|
+
_context10.prev = 69;
|
|
7728
|
+
_context10.t1 = _context10["catch"](0);
|
|
7098
7729
|
setLoading(false);
|
|
7099
|
-
onSubmitError(
|
|
7100
|
-
hasUnverifiedOrder = _get(
|
|
7101
|
-
message = _get(
|
|
7730
|
+
onSubmitError(_context10.t1);
|
|
7731
|
+
hasUnverifiedOrder = _get(_context10.t1, 'response.data.data.hasUnverifiedOrder');
|
|
7732
|
+
message = _get(_context10.t1, 'response.data.message', {});
|
|
7102
7733
|
if (hasUnverifiedOrder && typeof message === 'string') {
|
|
7103
7734
|
setPendingVerificationMessage(message);
|
|
7104
|
-
} else if (axios.isAxiosError(
|
|
7105
|
-
if (((_e$response =
|
|
7735
|
+
} else if (axios.isAxiosError(_context10.t1)) {
|
|
7736
|
+
if (((_e$response = _context10.t1.response) == null ? void 0 : _e$response.status) === 401 || _get(_context10.t1, 'response.data.error') === 'invalid_token') {
|
|
7106
7737
|
if (isBrowser) {
|
|
7107
7738
|
window.localStorage.removeItem('user_data');
|
|
7108
7739
|
setUserExpired(true);
|
|
@@ -7118,17 +7749,19 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
7118
7749
|
if (message && !hideErrorsAlertSection && typeof message === 'string') {
|
|
7119
7750
|
setError(message);
|
|
7120
7751
|
}
|
|
7121
|
-
onSubmitError(
|
|
7752
|
+
onSubmitError(_context10.t1);
|
|
7122
7753
|
}
|
|
7123
|
-
|
|
7124
|
-
|
|
7754
|
+
// Keep form values intact - don't reset
|
|
7755
|
+
formikHelpers.setSubmitting(false);
|
|
7756
|
+
case 77:
|
|
7757
|
+
_context10.prev = 77;
|
|
7125
7758
|
setLoading(false);
|
|
7126
|
-
return
|
|
7127
|
-
case
|
|
7759
|
+
return _context10.finish(77);
|
|
7760
|
+
case 80:
|
|
7128
7761
|
case "end":
|
|
7129
|
-
return
|
|
7762
|
+
return _context10.stop();
|
|
7130
7763
|
}
|
|
7131
|
-
},
|
|
7764
|
+
}, _callee10, null, [[0, 69, 77, 80], [15, 23]]);
|
|
7132
7765
|
}));
|
|
7133
7766
|
function onSubmit(_x3, _x4) {
|
|
7134
7767
|
return _onSubmit.apply(this, arguments);
|
|
@@ -7150,6 +7783,11 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
7150
7783
|
onGetStatesSuccess: onGetStatesSuccess,
|
|
7151
7784
|
onGetStatesError: onGetStatesError,
|
|
7152
7785
|
shouldFetchCountries: shouldFetchCountries
|
|
7786
|
+
}), React.createElement(EmailExistenceChecker, {
|
|
7787
|
+
email: props.values.email || '',
|
|
7788
|
+
confirmEmail: props.values.confirmEmail || '',
|
|
7789
|
+
isLoggedIn: isLoggedIn,
|
|
7790
|
+
setEmailExists: setEmailExists
|
|
7153
7791
|
}), React.createElement("div", {
|
|
7154
7792
|
className: "billing-info-container " + theme
|
|
7155
7793
|
}, !!error && React.createElement(SnackbarAlert, {
|
|
@@ -7257,7 +7895,24 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
7257
7895
|
dateFormat: element.format,
|
|
7258
7896
|
isCountryCodeEditable: isCountryCodeEditable
|
|
7259
7897
|
}))));
|
|
7260
|
-
})))
|
|
7898
|
+
})), group.groupItems.some(function (el) {
|
|
7899
|
+
return el.name === 'confirmEmail';
|
|
7900
|
+
}) && emailExists && !isLoggedIn && React.createElement("div", {
|
|
7901
|
+
className: "email-registered-message"
|
|
7902
|
+
}, React.createElement("p", {
|
|
7903
|
+
className: "email-registered-text"
|
|
7904
|
+
}, "\u2713 This email is already registered. Log in to auto-fill your information"), React.createElement(Button, {
|
|
7905
|
+
type: "button",
|
|
7906
|
+
variant: "contained",
|
|
7907
|
+
className: "email-login-button",
|
|
7908
|
+
onClick: function onClick() {
|
|
7909
|
+
if (onLogin) {
|
|
7910
|
+
onLogin();
|
|
7911
|
+
} else {
|
|
7912
|
+
setShowModalLogin(true);
|
|
7913
|
+
}
|
|
7914
|
+
}
|
|
7915
|
+
}, "Log in")));
|
|
7261
7916
|
}));
|
|
7262
7917
|
}), !_isEmpty(ticketHoldersFields.fields) && React.createElement("div", {
|
|
7263
7918
|
className: "ticket-holders-fields"
|
|
@@ -7666,7 +8321,12 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
7666
8321
|
_ref$showOrderDetails = _ref.showOrderDetailsBtn,
|
|
7667
8322
|
showOrderDetailsBtn = _ref$showOrderDetails === void 0 ? false : _ref$showOrderDetails,
|
|
7668
8323
|
_ref$onOrderDetailsCl = _ref.onOrderDetailsClick,
|
|
7669
|
-
onOrderDetailsClick = _ref$onOrderDetailsCl === void 0 ? _identity : _ref$onOrderDetailsCl
|
|
8324
|
+
onOrderDetailsClick = _ref$onOrderDetailsCl === void 0 ? _identity : _ref$onOrderDetailsCl,
|
|
8325
|
+
_ref$showProductImage = _ref.showProductImage,
|
|
8326
|
+
showProductImage = _ref$showProductImage === void 0 ? true : _ref$showProductImage,
|
|
8327
|
+
eventTitle = _ref.eventTitle,
|
|
8328
|
+
eventDate = _ref.eventDate,
|
|
8329
|
+
eventLocation = _ref.eventLocation;
|
|
7670
8330
|
var inputRef = useRef(null);
|
|
7671
8331
|
var _useState = useState(null),
|
|
7672
8332
|
data = _useState[0],
|
|
@@ -7684,7 +8344,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
7684
8344
|
while (1) switch (_context.prev = _context.next) {
|
|
7685
8345
|
case 0:
|
|
7686
8346
|
if (!hash) {
|
|
7687
|
-
_context.next =
|
|
8347
|
+
_context.next = 16;
|
|
7688
8348
|
break;
|
|
7689
8349
|
}
|
|
7690
8350
|
_context.prev = 1;
|
|
@@ -7711,19 +8371,23 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
7711
8371
|
label: 'Your ticket is currently',
|
|
7712
8372
|
price: _data.currency.symbol + ((_data$product_price = _data.product_price) == null ? void 0 : _data$product_price.toFixed(2))
|
|
7713
8373
|
});
|
|
8374
|
+
// Ensure order_hash is included in the data
|
|
8375
|
+
if (!_data.order_hash) {
|
|
8376
|
+
_data.order_hash = hash;
|
|
8377
|
+
}
|
|
7714
8378
|
setData(_data);
|
|
7715
8379
|
onGetConfirmationDataSuccess(confirmationDataResponse.data.attributes);
|
|
7716
|
-
_context.next =
|
|
8380
|
+
_context.next = 16;
|
|
7717
8381
|
break;
|
|
7718
|
-
case
|
|
7719
|
-
_context.prev =
|
|
8382
|
+
case 13:
|
|
8383
|
+
_context.prev = 13;
|
|
7720
8384
|
_context.t0 = _context["catch"](1);
|
|
7721
8385
|
if (axios.isAxiosError(_context.t0)) onGetConfirmationDataError(_context.t0);
|
|
7722
|
-
case
|
|
8386
|
+
case 16:
|
|
7723
8387
|
case "end":
|
|
7724
8388
|
return _context.stop();
|
|
7725
8389
|
}
|
|
7726
|
-
}, _callee, null, [[1,
|
|
8390
|
+
}, _callee, null, [[1, 13]]);
|
|
7727
8391
|
}))();
|
|
7728
8392
|
}, [hash]);
|
|
7729
8393
|
var _useState2 = useState(false),
|
|
@@ -7763,7 +8427,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
7763
8427
|
showCopyModal: showCopyModal
|
|
7764
8428
|
}), data && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
7765
8429
|
className: "header-container"
|
|
7766
|
-
}, React.createElement("div", {
|
|
8430
|
+
}, showProductImage && React.createElement("div", {
|
|
7767
8431
|
className: "header-product-image"
|
|
7768
8432
|
}, React.createElement("img", {
|
|
7769
8433
|
alt: "",
|
|
@@ -7773,7 +8437,15 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
7773
8437
|
className: "header-product-text"
|
|
7774
8438
|
}, React.createElement("p", {
|
|
7775
8439
|
className: "title"
|
|
7776
|
-
}, data.is_payment_plan ? paymentPlanConfirmationTitle : confirmationTitle), React.createElement("div", {
|
|
8440
|
+
}, data.is_payment_plan ? paymentPlanConfirmationTitle : confirmationTitle), (eventTitle || eventDate || eventLocation) && React.createElement("div", {
|
|
8441
|
+
className: "event-details"
|
|
8442
|
+
}, eventTitle && React.createElement("div", {
|
|
8443
|
+
className: "event-title"
|
|
8444
|
+
}, eventTitle), eventDate && React.createElement("div", {
|
|
8445
|
+
className: "event-date"
|
|
8446
|
+
}, eventDate), eventLocation && React.createElement("div", {
|
|
8447
|
+
className: "event-location"
|
|
8448
|
+
}, eventLocation)), React.createElement("div", {
|
|
7777
8449
|
className: "share-message-section",
|
|
7778
8450
|
dangerouslySetInnerHTML: data.custom_confirmation_page_text && data.custom_confirmation_page_text_full_replacement ? createMarkup(data.custom_confirmation_page_text) : undefined
|
|
7779
8451
|
}, data.custom_confirmation_page_text && data.custom_confirmation_page_text_full_replacement ? undefined : React.createElement(React.Fragment, null, Boolean(data.is_payment_plan) && React.createElement(React.Fragment, null, React.createElement("span", {
|
|
@@ -8124,160 +8796,6 @@ function Countdown(_ref) {
|
|
|
8124
8796
|
}, message)));
|
|
8125
8797
|
}
|
|
8126
8798
|
|
|
8127
|
-
var generateQuantity = function generateQuantity(n) {
|
|
8128
|
-
var quantityList = [];
|
|
8129
|
-
for (var i = 1; i <= n; i++) {
|
|
8130
|
-
quantityList.push({
|
|
8131
|
-
label: i,
|
|
8132
|
-
value: i
|
|
8133
|
-
});
|
|
8134
|
-
}
|
|
8135
|
-
return quantityList;
|
|
8136
|
-
};
|
|
8137
|
-
var WaitingList = function WaitingList(_ref) {
|
|
8138
|
-
var _ref$tickets = _ref.tickets,
|
|
8139
|
-
tickets = _ref$tickets === void 0 ? {} : _ref$tickets,
|
|
8140
|
-
eventId = _ref.eventId,
|
|
8141
|
-
_ref$defaultMaxQuanti = _ref.defaultMaxQuantity,
|
|
8142
|
-
defaultMaxQuantity = _ref$defaultMaxQuanti === void 0 ? 10 : _ref$defaultMaxQuanti;
|
|
8143
|
-
var userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
8144
|
-
var _useState = useState(false),
|
|
8145
|
-
showSuccessMessage = _useState[0],
|
|
8146
|
-
setShowSuccessMessage = _useState[1];
|
|
8147
|
-
var _useState2 = useState(false),
|
|
8148
|
-
loading = _useState2[0],
|
|
8149
|
-
setLoading = _useState2[1];
|
|
8150
|
-
var ticketTypesList = Object.values(tickets).map(function (d) {
|
|
8151
|
-
return {
|
|
8152
|
-
label: d.displayName,
|
|
8153
|
-
value: d.id
|
|
8154
|
-
};
|
|
8155
|
-
});
|
|
8156
|
-
var showTicketsField = Boolean(ticketTypesList.length);
|
|
8157
|
-
var handleSubmit = /*#__PURE__*/function () {
|
|
8158
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
|
|
8159
|
-
var response;
|
|
8160
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8161
|
-
while (1) switch (_context.prev = _context.next) {
|
|
8162
|
-
case 0:
|
|
8163
|
-
_context.prev = 0;
|
|
8164
|
-
setLoading(true);
|
|
8165
|
-
_context.next = 4;
|
|
8166
|
-
return addToWaitingList(eventId, {
|
|
8167
|
-
attributes: values
|
|
8168
|
-
});
|
|
8169
|
-
case 4:
|
|
8170
|
-
response = _context.sent;
|
|
8171
|
-
if (response.success) {
|
|
8172
|
-
setShowSuccessMessage(true);
|
|
8173
|
-
}
|
|
8174
|
-
_context.next = 10;
|
|
8175
|
-
break;
|
|
8176
|
-
case 8:
|
|
8177
|
-
_context.prev = 8;
|
|
8178
|
-
_context.t0 = _context["catch"](0);
|
|
8179
|
-
case 10:
|
|
8180
|
-
_context.prev = 10;
|
|
8181
|
-
setLoading(false);
|
|
8182
|
-
return _context.finish(10);
|
|
8183
|
-
case 13:
|
|
8184
|
-
case "end":
|
|
8185
|
-
return _context.stop();
|
|
8186
|
-
}
|
|
8187
|
-
}, _callee, null, [[0, 8, 10, 13]]);
|
|
8188
|
-
}));
|
|
8189
|
-
return function handleSubmit(_x) {
|
|
8190
|
-
return _ref2.apply(this, arguments);
|
|
8191
|
-
};
|
|
8192
|
-
}();
|
|
8193
|
-
return React.createElement("div", {
|
|
8194
|
-
className: "waiting-list"
|
|
8195
|
-
}, showSuccessMessage ? React.createElement("div", {
|
|
8196
|
-
className: "success-message"
|
|
8197
|
-
}, React.createElement("p", {
|
|
8198
|
-
className: "added-success-message"
|
|
8199
|
-
}, "You've been added to the waiting list!"), React.createElement("p", null, "You'll be notified if tickets become available.")) : React.createElement(React.Fragment, null, React.createElement("h2", null, "WAITING LIST"), React.createElement(Formik, {
|
|
8200
|
-
initialValues: {
|
|
8201
|
-
ticketTypeId: '',
|
|
8202
|
-
quantity: '',
|
|
8203
|
-
firstName: userData.first_name || '',
|
|
8204
|
-
lastName: userData.last_name || '',
|
|
8205
|
-
email: userData.email || ''
|
|
8206
|
-
},
|
|
8207
|
-
onSubmit: handleSubmit
|
|
8208
|
-
}, function (_ref3) {
|
|
8209
|
-
var values = _ref3.values,
|
|
8210
|
-
setFieldValue = _ref3.setFieldValue;
|
|
8211
|
-
var selectedTicket = _find(tickets, function (n) {
|
|
8212
|
-
return n.id === values.ticketTypeId;
|
|
8213
|
-
});
|
|
8214
|
-
return React.createElement(Form, null, React.createElement(ErrorFocus, null), showTicketsField && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
8215
|
-
className: "field-item"
|
|
8216
|
-
}, React.createElement(Field, {
|
|
8217
|
-
name: "ticketTypeId",
|
|
8218
|
-
label: "Type of Ticket",
|
|
8219
|
-
type: "select",
|
|
8220
|
-
component: CustomField,
|
|
8221
|
-
onChange: function onChange(e) {
|
|
8222
|
-
setFieldValue('ticketTypeId', e.target.value);
|
|
8223
|
-
setFieldValue('quantity', '');
|
|
8224
|
-
},
|
|
8225
|
-
selectOptions: [{
|
|
8226
|
-
label: 'Type of Ticket',
|
|
8227
|
-
value: '',
|
|
8228
|
-
disabled: true
|
|
8229
|
-
}].concat(ticketTypesList)
|
|
8230
|
-
})), React.createElement("div", {
|
|
8231
|
-
className: "field-item"
|
|
8232
|
-
}, React.createElement(Field, {
|
|
8233
|
-
name: "quantity",
|
|
8234
|
-
label: "Quantity Requested",
|
|
8235
|
-
type: "select",
|
|
8236
|
-
component: CustomField,
|
|
8237
|
-
selectOptions: [{
|
|
8238
|
-
label: 'Quantity Requested',
|
|
8239
|
-
value: '',
|
|
8240
|
-
disabled: true
|
|
8241
|
-
}].concat(generateQuantity((selectedTicket == null ? void 0 : selectedTicket.waitingListMaxQuantity) || (defaultMaxQuantity != null ? defaultMaxQuantity : 10)))
|
|
8242
|
-
}))), React.createElement("div", {
|
|
8243
|
-
className: "field-item"
|
|
8244
|
-
}, React.createElement(Field, {
|
|
8245
|
-
name: "firstName",
|
|
8246
|
-
label: "First name",
|
|
8247
|
-
validate: function validate(value) {
|
|
8248
|
-
return requiredValidator(value, 'Please enter your First name');
|
|
8249
|
-
},
|
|
8250
|
-
component: CustomField
|
|
8251
|
-
})), React.createElement("div", {
|
|
8252
|
-
className: "field-item"
|
|
8253
|
-
}, React.createElement(Field, {
|
|
8254
|
-
name: "lastName",
|
|
8255
|
-
label: "Last name",
|
|
8256
|
-
validate: function validate(value) {
|
|
8257
|
-
return requiredValidator(value, 'Please enter your Last name');
|
|
8258
|
-
},
|
|
8259
|
-
component: CustomField
|
|
8260
|
-
})), React.createElement("div", {
|
|
8261
|
-
className: "field-item"
|
|
8262
|
-
}, React.createElement(Field, {
|
|
8263
|
-
name: "email",
|
|
8264
|
-
label: "Email",
|
|
8265
|
-
validate: combineValidators(function (value) {
|
|
8266
|
-
return requiredValidator(value, 'Please enter your Email');
|
|
8267
|
-
}, function (value) {
|
|
8268
|
-
return emailValidator(value);
|
|
8269
|
-
}),
|
|
8270
|
-
component: CustomField
|
|
8271
|
-
})), React.createElement(Button, {
|
|
8272
|
-
type: "submit",
|
|
8273
|
-
variant: "contained",
|
|
8274
|
-
className: "waiting-list-button"
|
|
8275
|
-
}, loading ? React.createElement(CircularProgress$1, {
|
|
8276
|
-
size: "22px"
|
|
8277
|
-
}) : 'ADD TO WAITING LIST'));
|
|
8278
|
-
})));
|
|
8279
|
-
};
|
|
8280
|
-
|
|
8281
8799
|
var getFormFieldsNotLoggedIn = function getFormFieldsNotLoggedIn(clientName) {
|
|
8282
8800
|
return [{
|
|
8283
8801
|
name: 'basic-info',
|
|
@@ -8303,13 +8821,13 @@ var getFormFieldsNotLoggedIn = function getFormFieldsNotLoggedIn(clientName) {
|
|
|
8303
8821
|
label: 'Email',
|
|
8304
8822
|
type: 'email',
|
|
8305
8823
|
required: true,
|
|
8306
|
-
onValidate:
|
|
8824
|
+
onValidate: emailValidator
|
|
8307
8825
|
}, {
|
|
8308
8826
|
name: 'confirmEmail',
|
|
8309
8827
|
label: 'Confirm Email',
|
|
8310
8828
|
type: 'email',
|
|
8311
8829
|
required: true,
|
|
8312
|
-
onValidate:
|
|
8830
|
+
onValidate: emailValidator
|
|
8313
8831
|
}]
|
|
8314
8832
|
}, {
|
|
8315
8833
|
name: 'billing-info',
|
|
@@ -8366,13 +8884,13 @@ var getFormFieldsLoggedIn = function getFormFieldsLoggedIn(clientName) {
|
|
|
8366
8884
|
label: 'Email',
|
|
8367
8885
|
type: 'email',
|
|
8368
8886
|
required: true,
|
|
8369
|
-
onValidate:
|
|
8887
|
+
onValidate: emailValidator
|
|
8370
8888
|
}, {
|
|
8371
8889
|
name: 'confirmEmail',
|
|
8372
8890
|
label: 'Confirm Email',
|
|
8373
8891
|
type: 'email',
|
|
8374
8892
|
required: true,
|
|
8375
|
-
onValidate:
|
|
8893
|
+
onValidate: emailValidator
|
|
8376
8894
|
}]
|
|
8377
8895
|
}, {
|
|
8378
8896
|
name: 'billing-info-logged-in',
|
|
@@ -8416,6 +8934,9 @@ var getValidateFunctions$1 = function getValidateFunctions(_ref) {
|
|
|
8416
8934
|
if (element.onValidate) {
|
|
8417
8935
|
validationFunctions.push(element.onValidate);
|
|
8418
8936
|
}
|
|
8937
|
+
if (element.name === 'password') {
|
|
8938
|
+
validationFunctions.push(passwordValidator);
|
|
8939
|
+
}
|
|
8419
8940
|
if (element.name === 'confirmEmail') {
|
|
8420
8941
|
var isSameEmail = function isSameEmail(confirmEmail) {
|
|
8421
8942
|
return values.email !== confirmEmail ? 'Please confirm your email address correctly' : null;
|
|
@@ -9014,11 +9535,11 @@ var PreRegistration = function PreRegistration(_ref) {
|
|
|
9014
9535
|
// Check if user already has a pre-registration when logged in
|
|
9015
9536
|
useEffect(function () {
|
|
9016
9537
|
if (!isLoggedIn || !isWindowDefined$2) return;
|
|
9017
|
-
var savedHash = window.localStorage.getItem(
|
|
9538
|
+
var savedHash = window.localStorage.getItem("pre-registration-hash-" + eventId);
|
|
9018
9539
|
if (savedHash) {
|
|
9019
9540
|
setIsPreRegistrationComplete(true);
|
|
9020
9541
|
}
|
|
9021
|
-
}, [isLoggedIn]);
|
|
9542
|
+
}, [isLoggedIn, eventId]);
|
|
9022
9543
|
var themeMui = createTheme(themeOptions);
|
|
9023
9544
|
var formFieldsLoggedIn = getFormFieldsLoggedIn(CONFIGS.CLIENT_NAME);
|
|
9024
9545
|
var formFieldsNotLoggedIn = getFormFieldsNotLoggedIn(CONFIGS.CLIENT_NAME);
|
|
@@ -9170,7 +9691,7 @@ var PreRegistration = function PreRegistration(_ref) {
|
|
|
9170
9691
|
case 13:
|
|
9171
9692
|
confirmationData = _context2.sent;
|
|
9172
9693
|
if (isWindowDefined$2) {
|
|
9173
|
-
window.localStorage.setItem(
|
|
9694
|
+
window.localStorage.setItem("pre-registration-hash-" + eventId, _get(confirmationData, 'attributes.hash'));
|
|
9174
9695
|
}
|
|
9175
9696
|
setIsPreRegistrationComplete(true);
|
|
9176
9697
|
onConfirmationSuccess(confirmationData);
|
|
@@ -9254,16 +9775,170 @@ var PreRegistration = function PreRegistration(_ref) {
|
|
|
9254
9775
|
countries: countries,
|
|
9255
9776
|
themeOptions: themeOptions
|
|
9256
9777
|
})), React.createElement("div", {
|
|
9257
|
-
className: "button-container"
|
|
9258
|
-
}, React.createElement(Button$1, {
|
|
9778
|
+
className: "button-container"
|
|
9779
|
+
}, React.createElement(Button$1, {
|
|
9780
|
+
type: "submit",
|
|
9781
|
+
variant: "contained",
|
|
9782
|
+
className: "login-register-button",
|
|
9783
|
+
disabled: props.isSubmitting
|
|
9784
|
+
}, props.isSubmitting ? React.createElement(CircularProgress, {
|
|
9785
|
+
size: 26
|
|
9786
|
+
}) : isLoggedIn ? 'Confirm Pre-Registration' : 'Create Account')));
|
|
9787
|
+
}))));
|
|
9788
|
+
};
|
|
9789
|
+
|
|
9790
|
+
var generateQuantity = function generateQuantity(n) {
|
|
9791
|
+
var quantityList = [];
|
|
9792
|
+
for (var i = 1; i <= n; i++) {
|
|
9793
|
+
quantityList.push({
|
|
9794
|
+
label: i,
|
|
9795
|
+
value: i
|
|
9796
|
+
});
|
|
9797
|
+
}
|
|
9798
|
+
return quantityList;
|
|
9799
|
+
};
|
|
9800
|
+
var WaitingList = function WaitingList(_ref) {
|
|
9801
|
+
var _ref$tickets = _ref.tickets,
|
|
9802
|
+
tickets = _ref$tickets === void 0 ? {} : _ref$tickets,
|
|
9803
|
+
eventId = _ref.eventId,
|
|
9804
|
+
_ref$defaultMaxQuanti = _ref.defaultMaxQuantity,
|
|
9805
|
+
defaultMaxQuantity = _ref$defaultMaxQuanti === void 0 ? 10 : _ref$defaultMaxQuanti;
|
|
9806
|
+
var userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
9807
|
+
var _useState = useState(false),
|
|
9808
|
+
showSuccessMessage = _useState[0],
|
|
9809
|
+
setShowSuccessMessage = _useState[1];
|
|
9810
|
+
var _useState2 = useState(false),
|
|
9811
|
+
loading = _useState2[0],
|
|
9812
|
+
setLoading = _useState2[1];
|
|
9813
|
+
var ticketTypesList = Object.values(tickets).map(function (d) {
|
|
9814
|
+
return {
|
|
9815
|
+
label: d.displayName,
|
|
9816
|
+
value: d.id
|
|
9817
|
+
};
|
|
9818
|
+
});
|
|
9819
|
+
var showTicketsField = Boolean(ticketTypesList.length);
|
|
9820
|
+
var handleSubmit = /*#__PURE__*/function () {
|
|
9821
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
|
|
9822
|
+
var response;
|
|
9823
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9824
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9825
|
+
case 0:
|
|
9826
|
+
_context.prev = 0;
|
|
9827
|
+
setLoading(true);
|
|
9828
|
+
_context.next = 4;
|
|
9829
|
+
return addToWaitingList(eventId, {
|
|
9830
|
+
attributes: values
|
|
9831
|
+
});
|
|
9832
|
+
case 4:
|
|
9833
|
+
response = _context.sent;
|
|
9834
|
+
if (response.success) {
|
|
9835
|
+
setShowSuccessMessage(true);
|
|
9836
|
+
}
|
|
9837
|
+
_context.next = 10;
|
|
9838
|
+
break;
|
|
9839
|
+
case 8:
|
|
9840
|
+
_context.prev = 8;
|
|
9841
|
+
_context.t0 = _context["catch"](0);
|
|
9842
|
+
case 10:
|
|
9843
|
+
_context.prev = 10;
|
|
9844
|
+
setLoading(false);
|
|
9845
|
+
return _context.finish(10);
|
|
9846
|
+
case 13:
|
|
9847
|
+
case "end":
|
|
9848
|
+
return _context.stop();
|
|
9849
|
+
}
|
|
9850
|
+
}, _callee, null, [[0, 8, 10, 13]]);
|
|
9851
|
+
}));
|
|
9852
|
+
return function handleSubmit(_x) {
|
|
9853
|
+
return _ref2.apply(this, arguments);
|
|
9854
|
+
};
|
|
9855
|
+
}();
|
|
9856
|
+
return React.createElement("div", {
|
|
9857
|
+
className: "waiting-list"
|
|
9858
|
+
}, showSuccessMessage ? React.createElement("div", {
|
|
9859
|
+
className: "success-message"
|
|
9860
|
+
}, React.createElement("p", {
|
|
9861
|
+
className: "added-success-message"
|
|
9862
|
+
}, "You've been added to the waiting list!"), React.createElement("p", null, "You'll be notified if tickets become available.")) : React.createElement(React.Fragment, null, React.createElement("h2", null, "WAITING LIST"), React.createElement(Formik, {
|
|
9863
|
+
initialValues: {
|
|
9864
|
+
ticketTypeId: '',
|
|
9865
|
+
quantity: '',
|
|
9866
|
+
firstName: userData.first_name || '',
|
|
9867
|
+
lastName: userData.last_name || '',
|
|
9868
|
+
email: userData.email || ''
|
|
9869
|
+
},
|
|
9870
|
+
onSubmit: handleSubmit
|
|
9871
|
+
}, function (_ref3) {
|
|
9872
|
+
var values = _ref3.values,
|
|
9873
|
+
setFieldValue = _ref3.setFieldValue;
|
|
9874
|
+
var selectedTicket = _find(tickets, function (n) {
|
|
9875
|
+
return n.id === values.ticketTypeId;
|
|
9876
|
+
});
|
|
9877
|
+
return React.createElement(Form, null, React.createElement(ErrorFocus, null), showTicketsField && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
9878
|
+
className: "field-item"
|
|
9879
|
+
}, React.createElement(Field, {
|
|
9880
|
+
name: "ticketTypeId",
|
|
9881
|
+
label: "Type of Ticket",
|
|
9882
|
+
type: "select",
|
|
9883
|
+
component: CustomField,
|
|
9884
|
+
onChange: function onChange(e) {
|
|
9885
|
+
setFieldValue('ticketTypeId', e.target.value);
|
|
9886
|
+
setFieldValue('quantity', '');
|
|
9887
|
+
},
|
|
9888
|
+
selectOptions: [{
|
|
9889
|
+
label: 'Type of Ticket',
|
|
9890
|
+
value: '',
|
|
9891
|
+
disabled: true
|
|
9892
|
+
}].concat(ticketTypesList)
|
|
9893
|
+
})), React.createElement("div", {
|
|
9894
|
+
className: "field-item"
|
|
9895
|
+
}, React.createElement(Field, {
|
|
9896
|
+
name: "quantity",
|
|
9897
|
+
label: "Quantity Requested",
|
|
9898
|
+
type: "select",
|
|
9899
|
+
component: CustomField,
|
|
9900
|
+
selectOptions: [{
|
|
9901
|
+
label: 'Quantity Requested',
|
|
9902
|
+
value: '',
|
|
9903
|
+
disabled: true
|
|
9904
|
+
}].concat(generateQuantity((selectedTicket == null ? void 0 : selectedTicket.waitingListMaxQuantity) || (defaultMaxQuantity != null ? defaultMaxQuantity : 10)))
|
|
9905
|
+
}))), React.createElement("div", {
|
|
9906
|
+
className: "field-item"
|
|
9907
|
+
}, React.createElement(Field, {
|
|
9908
|
+
name: "firstName",
|
|
9909
|
+
label: "First name",
|
|
9910
|
+
validate: function validate(value) {
|
|
9911
|
+
return requiredValidator(value, 'Please enter your First name');
|
|
9912
|
+
},
|
|
9913
|
+
component: CustomField
|
|
9914
|
+
})), React.createElement("div", {
|
|
9915
|
+
className: "field-item"
|
|
9916
|
+
}, React.createElement(Field, {
|
|
9917
|
+
name: "lastName",
|
|
9918
|
+
label: "Last name",
|
|
9919
|
+
validate: function validate(value) {
|
|
9920
|
+
return requiredValidator(value, 'Please enter your Last name');
|
|
9921
|
+
},
|
|
9922
|
+
component: CustomField
|
|
9923
|
+
})), React.createElement("div", {
|
|
9924
|
+
className: "field-item"
|
|
9925
|
+
}, React.createElement(Field, {
|
|
9926
|
+
name: "email",
|
|
9927
|
+
label: "Email",
|
|
9928
|
+
validate: combineValidators(function (value) {
|
|
9929
|
+
return requiredValidator(value, 'Please enter your Email');
|
|
9930
|
+
}, function (value) {
|
|
9931
|
+
return emailValidator(value);
|
|
9932
|
+
}),
|
|
9933
|
+
component: CustomField
|
|
9934
|
+
})), React.createElement(Button, {
|
|
9259
9935
|
type: "submit",
|
|
9260
9936
|
variant: "contained",
|
|
9261
|
-
className: "
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
}))));
|
|
9937
|
+
className: "waiting-list-button"
|
|
9938
|
+
}, loading ? React.createElement(CircularProgress$1, {
|
|
9939
|
+
size: "22px"
|
|
9940
|
+
}) : 'ADD TO WAITING LIST'));
|
|
9941
|
+
})));
|
|
9267
9942
|
};
|
|
9268
9943
|
|
|
9269
9944
|
// This section is seperate because additional changes layter may be applied to Access Code
|
|
@@ -9725,6 +10400,168 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
9725
10400
|
}));
|
|
9726
10401
|
};
|
|
9727
10402
|
|
|
10403
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10404
|
+
function decodeHTML$1(html) {
|
|
10405
|
+
var textArea = document.createElement('textarea');
|
|
10406
|
+
textArea.innerHTML = html;
|
|
10407
|
+
return textArea.value;
|
|
10408
|
+
}
|
|
10409
|
+
var TimeSlotTicketRow = function TimeSlotTicketRow(_ref) {
|
|
10410
|
+
var _availableTimeSlots$f;
|
|
10411
|
+
var ticketKey = _ref.ticketKey,
|
|
10412
|
+
ticket = _ref.ticket,
|
|
10413
|
+
availableTimeSlots = _ref.availableTimeSlots,
|
|
10414
|
+
selectedTickets = _ref.selectedTickets,
|
|
10415
|
+
selectedTimeSlots = _ref.selectedTimeSlots,
|
|
10416
|
+
handleTicketSelect = _ref.handleTicketSelect,
|
|
10417
|
+
handleTimeSlotSelect = _ref.handleTimeSlotSelect,
|
|
10418
|
+
priceSymbol = _ref.priceSymbol,
|
|
10419
|
+
isSoldOut = _ref.isSoldOut;
|
|
10420
|
+
var _useState = useState(false),
|
|
10421
|
+
visibleDescription = _useState[0],
|
|
10422
|
+
setVisibleDescription = _useState[1];
|
|
10423
|
+
var currentSelectedTimeKey = selectedTimeSlots[ticketKey] || '';
|
|
10424
|
+
var currentTicketInstance = (_availableTimeSlots$f = availableTimeSlots.find(function (slot) {
|
|
10425
|
+
return slot.timeKey === currentSelectedTimeKey;
|
|
10426
|
+
})) == null ? void 0 : _availableTimeSlots$f.ticketInstance;
|
|
10427
|
+
var currentSelectedQuantity = currentTicketInstance ? selectedTickets[currentTicketInstance.id] || 0 : 0;
|
|
10428
|
+
var maxCount = ticket.maxQuantity;
|
|
10429
|
+
var minCount = ticket.minQuantity;
|
|
10430
|
+
var multiplier = ticket.multiplier;
|
|
10431
|
+
var options = getTicketSelectOptions(maxCount, minCount, multiplier);
|
|
10432
|
+
var ticketPriceWithoutFees = priceSymbol + " " + (+ticket.cost).toFixed(2);
|
|
10433
|
+
var ticketPriceWithFees = priceSymbol + " " + (+ticket.basePrice).toFixed(2);
|
|
10434
|
+
var ticketOldPriceWithFees = priceSymbol + " " + (+ticket.oldBasePrice).toFixed(2);
|
|
10435
|
+
var ticketOldPriceWithoutFees = priceSymbol + " " + (+ticket.oldCost).toFixed(2);
|
|
10436
|
+
var ticketIsDiscounted = false;
|
|
10437
|
+
if (ticket.oldPrice && !isSoldOut && ticket.oldPrice !== ticket.price) {
|
|
10438
|
+
ticketIsDiscounted = true;
|
|
10439
|
+
}
|
|
10440
|
+
var ticketIsFree = +ticket.price === 0;
|
|
10441
|
+
var discountTicketPriceElem = CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketOldPriceWithoutFees : ticketOldPriceWithFees;
|
|
10442
|
+
var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketPriceWithoutFees : ticketPriceWithFees;
|
|
10443
|
+
var handleTimeChange = function handleTimeChange(event) {
|
|
10444
|
+
var selectedTimeKey = event.target.value;
|
|
10445
|
+
var selectedOption = availableTimeSlots.find(function (slot) {
|
|
10446
|
+
return slot.timeKey === selectedTimeKey;
|
|
10447
|
+
});
|
|
10448
|
+
if (selectedOption) {
|
|
10449
|
+
handleTimeSlotSelect(ticketKey, selectedOption.timeKey, selectedOption.ticketInstance);
|
|
10450
|
+
}
|
|
10451
|
+
};
|
|
10452
|
+
var handleQuantityChange = function handleQuantityChange(event) {
|
|
10453
|
+
var value = event.target.value;
|
|
10454
|
+
// Only allow quantity selection if a time slot is selected
|
|
10455
|
+
if (!currentSelectedTimeKey && value > 0) {
|
|
10456
|
+
return;
|
|
10457
|
+
}
|
|
10458
|
+
if (currentTicketInstance) {
|
|
10459
|
+
handleTicketSelect(ticketKey, value, currentTicketInstance);
|
|
10460
|
+
}
|
|
10461
|
+
};
|
|
10462
|
+
var handleDescriptionToggle = function handleDescriptionToggle() {
|
|
10463
|
+
setVisibleDescription(function (current) {
|
|
10464
|
+
return !current;
|
|
10465
|
+
});
|
|
10466
|
+
};
|
|
10467
|
+
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
10468
|
+
className: "event-detail__tier " + (isSoldOut ? 'disabled' : ''),
|
|
10469
|
+
id: ticketKey
|
|
10470
|
+
}, React.createElement("div", {
|
|
10471
|
+
className: "event-detail__tier-name"
|
|
10472
|
+
}, ticket.displayName || ticket.name, ticket.descriptionRich && React.createElement(React.Fragment, null, React.createElement("span", {
|
|
10473
|
+
"aria-hidden": true,
|
|
10474
|
+
className: "info-icon",
|
|
10475
|
+
onClick: handleDescriptionToggle,
|
|
10476
|
+
"data-tooltip-id": "tooltip-" + ticketKey,
|
|
10477
|
+
"data-tooltip-content": "View ticket info",
|
|
10478
|
+
style: {
|
|
10479
|
+
marginLeft: 8,
|
|
10480
|
+
cursor: 'pointer',
|
|
10481
|
+
display: 'flex'
|
|
10482
|
+
}
|
|
10483
|
+
}, React.createElement(InfoIcon, null)), React.createElement(Tooltip, {
|
|
10484
|
+
id: "tooltip-" + ticketKey,
|
|
10485
|
+
place: "top"
|
|
10486
|
+
}, ticket.description || 'No description available'))), React.createElement("div", {
|
|
10487
|
+
className: "event-tickets-container"
|
|
10488
|
+
}, React.createElement("div", {
|
|
10489
|
+
className: "event-detail__tier-price"
|
|
10490
|
+
}, ticketIsDiscounted && React.createElement("p", {
|
|
10491
|
+
className: "old-price"
|
|
10492
|
+
}, discountTicketPriceElem), React.createElement("p", {
|
|
10493
|
+
className: isSoldOut ? 'sold-out' : ''
|
|
10494
|
+
}, ticketPriceElem), !isSoldOut && !ticketIsFree && React.createElement("p", {
|
|
10495
|
+
className: "fees"
|
|
10496
|
+
}, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && (ticket.feeIncluded ? '(incl. Fees)' : '(excl. Fees)'), CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && "(" + ticketPriceWithFees + " with fees)")), !isSoldOut && React.createElement("div", {
|
|
10497
|
+
className: "event-detail__tier-state time-slot-selectors-container"
|
|
10498
|
+
}, React.createElement(Box, {
|
|
10499
|
+
sx: {
|
|
10500
|
+
display: 'flex',
|
|
10501
|
+
flexDirection: 'row',
|
|
10502
|
+
alignItems: 'center',
|
|
10503
|
+
justifyContent: 'space-between',
|
|
10504
|
+
gap: 2,
|
|
10505
|
+
marginTop: 2
|
|
10506
|
+
}
|
|
10507
|
+
}, React.createElement(FormControl$1, null, React.createElement(Select, {
|
|
10508
|
+
sx: {
|
|
10509
|
+
borderRadius: 0,
|
|
10510
|
+
minWidth: 120
|
|
10511
|
+
},
|
|
10512
|
+
value: currentSelectedTimeKey,
|
|
10513
|
+
onChange: handleTimeChange,
|
|
10514
|
+
displayEmpty: true,
|
|
10515
|
+
inputProps: {
|
|
10516
|
+
'aria-label': 'Select time slot'
|
|
10517
|
+
},
|
|
10518
|
+
MenuProps: {
|
|
10519
|
+
PaperProps: {
|
|
10520
|
+
className: 'get-tickets-paper'
|
|
10521
|
+
}
|
|
10522
|
+
}
|
|
10523
|
+
}, React.createElement(MenuItem, {
|
|
10524
|
+
value: "",
|
|
10525
|
+
disabled: true
|
|
10526
|
+
}, "Time"), availableTimeSlots.map(function (slot, index) {
|
|
10527
|
+
return React.createElement(MenuItem, {
|
|
10528
|
+
key: index,
|
|
10529
|
+
value: slot.timeKey
|
|
10530
|
+
}, moment(slot.timeKey).format('hh:mm A'));
|
|
10531
|
+
}))), React.createElement(FormControl$1, null, React.createElement(Select, {
|
|
10532
|
+
sx: {
|
|
10533
|
+
borderRadius: 0,
|
|
10534
|
+
minWidth: 60
|
|
10535
|
+
},
|
|
10536
|
+
value: currentSelectedQuantity,
|
|
10537
|
+
onChange: handleQuantityChange,
|
|
10538
|
+
displayEmpty: true,
|
|
10539
|
+
disabled: !currentSelectedTimeKey,
|
|
10540
|
+
inputProps: {
|
|
10541
|
+
'aria-label': 'Select quantity'
|
|
10542
|
+
},
|
|
10543
|
+
MenuProps: {
|
|
10544
|
+
PaperProps: {
|
|
10545
|
+
sx: {
|
|
10546
|
+
maxHeight: 150
|
|
10547
|
+
},
|
|
10548
|
+
className: 'get-tickets-paper'
|
|
10549
|
+
}
|
|
10550
|
+
}
|
|
10551
|
+
}, options.map(function (option, index) {
|
|
10552
|
+
return React.createElement(MenuItem, {
|
|
10553
|
+
key: index,
|
|
10554
|
+
value: option.value
|
|
10555
|
+
}, option.value);
|
|
10556
|
+
})))))), visibleDescription && ticket.descriptionRich && React.createElement("div", {
|
|
10557
|
+
className: "ticket-description"
|
|
10558
|
+
}, React.createElement("div", {
|
|
10559
|
+
dangerouslySetInnerHTML: {
|
|
10560
|
+
__html: decodeHTML$1(ticket.descriptionRich)
|
|
10561
|
+
}
|
|
10562
|
+
}))));
|
|
10563
|
+
};
|
|
10564
|
+
|
|
9728
10565
|
var TimeSlotsSection = function TimeSlotsSection(_ref) {
|
|
9729
10566
|
var event = _ref.event,
|
|
9730
10567
|
availableDates = _ref.availableDates,
|
|
@@ -9737,42 +10574,44 @@ var TimeSlotsSection = function TimeSlotsSection(_ref) {
|
|
|
9737
10574
|
sortBySoldOut = _ref.sortBySoldOut,
|
|
9738
10575
|
hideTicketsHeader = _ref.hideTicketsHeader,
|
|
9739
10576
|
ticketsHeaderComponent = _ref.ticketsHeaderComponent,
|
|
9740
|
-
|
|
9741
|
-
currencySymbol = _ref.currencySymbol,
|
|
9742
|
-
isSeatMapAllowed = _ref.isSeatMapAllowed;
|
|
10577
|
+
currencySymbol = _ref.currencySymbol;
|
|
9743
10578
|
var _useState = useState(false),
|
|
9744
10579
|
loading = _useState[0],
|
|
9745
10580
|
setLoading = _useState[1];
|
|
10581
|
+
var _useState2 = useState({}),
|
|
10582
|
+
selectedTimeSlots = _useState2[0],
|
|
10583
|
+
setSelectedTimeSlots = _useState2[1];
|
|
9746
10584
|
var handleDateChange = /*#__PURE__*/function () {
|
|
9747
10585
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(date) {
|
|
9748
10586
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9749
10587
|
while (1) switch (_context.prev = _context.next) {
|
|
9750
10588
|
case 0:
|
|
9751
10589
|
setSelectedDate(date);
|
|
10590
|
+
setSelectedTimeSlots({}); // Reset time slot selections when date changes
|
|
9752
10591
|
if (!date) {
|
|
9753
|
-
_context.next =
|
|
10592
|
+
_context.next = 15;
|
|
9754
10593
|
break;
|
|
9755
10594
|
}
|
|
9756
10595
|
setLoading(true);
|
|
9757
|
-
_context.prev =
|
|
9758
|
-
_context.next =
|
|
10596
|
+
_context.prev = 4;
|
|
10597
|
+
_context.next = 7;
|
|
9759
10598
|
return getTimeSlots(date);
|
|
9760
|
-
case
|
|
9761
|
-
_context.next =
|
|
10599
|
+
case 7:
|
|
10600
|
+
_context.next = 12;
|
|
9762
10601
|
break;
|
|
9763
|
-
case
|
|
9764
|
-
_context.prev =
|
|
9765
|
-
_context.t0 = _context["catch"](
|
|
10602
|
+
case 9:
|
|
10603
|
+
_context.prev = 9;
|
|
10604
|
+
_context.t0 = _context["catch"](4);
|
|
9766
10605
|
console.error('Error fetching time slots:', _context.t0);
|
|
9767
|
-
case
|
|
9768
|
-
_context.prev =
|
|
10606
|
+
case 12:
|
|
10607
|
+
_context.prev = 12;
|
|
9769
10608
|
setLoading(false);
|
|
9770
|
-
return _context.finish(
|
|
9771
|
-
case
|
|
10609
|
+
return _context.finish(12);
|
|
10610
|
+
case 15:
|
|
9772
10611
|
case "end":
|
|
9773
10612
|
return _context.stop();
|
|
9774
10613
|
}
|
|
9775
|
-
}, _callee, null, [[
|
|
10614
|
+
}, _callee, null, [[4, 9, 12, 15]]);
|
|
9776
10615
|
}));
|
|
9777
10616
|
return function handleDateChange(_x) {
|
|
9778
10617
|
return _ref2.apply(this, arguments);
|
|
@@ -9782,6 +10621,64 @@ var TimeSlotsSection = function TimeSlotsSection(_ref) {
|
|
|
9782
10621
|
var formattedDate = moment(date).format('YYYY-MM-DD');
|
|
9783
10622
|
return !availableDates.includes(formattedDate);
|
|
9784
10623
|
};
|
|
10624
|
+
// Group tickets by unique ticket type using displayName + price
|
|
10625
|
+
var uniqueTickets = useMemo(function () {
|
|
10626
|
+
var ticketMap = {};
|
|
10627
|
+
// Iterate through all time slots
|
|
10628
|
+
_map(timeSlotGroups, function (tickets, timeKey) {
|
|
10629
|
+
tickets.forEach(function (ticket) {
|
|
10630
|
+
// Use displayName + price as the unique identifier for ticket types
|
|
10631
|
+
// This handles cases where multiple ticket types share the same optionName
|
|
10632
|
+
var ticketKey = (ticket.displayName || ticket.name) + "_" + ticket.price;
|
|
10633
|
+
if (!ticketMap[ticketKey]) {
|
|
10634
|
+
ticketMap[ticketKey] = {
|
|
10635
|
+
ticket: _extends({}, ticket),
|
|
10636
|
+
availableTimeSlots: []
|
|
10637
|
+
};
|
|
10638
|
+
}
|
|
10639
|
+
// Store both the time key and the ticket instance for this slot
|
|
10640
|
+
if (!ticketMap[ticketKey].availableTimeSlots.find(function (slot) {
|
|
10641
|
+
return slot.timeKey === timeKey;
|
|
10642
|
+
})) {
|
|
10643
|
+
ticketMap[ticketKey].availableTimeSlots.push({
|
|
10644
|
+
timeKey: timeKey,
|
|
10645
|
+
ticketInstance: ticket
|
|
10646
|
+
});
|
|
10647
|
+
}
|
|
10648
|
+
});
|
|
10649
|
+
});
|
|
10650
|
+
// Convert to array and sort
|
|
10651
|
+
var ticketsArray = Object.values(ticketMap);
|
|
10652
|
+
return sortBySoldOut ? _sortBy(_sortBy(ticketsArray, function (t) {
|
|
10653
|
+
return t.ticket.sortOrder;
|
|
10654
|
+
}), function (t) {
|
|
10655
|
+
return t.ticket.soldOut;
|
|
10656
|
+
}) : _sortBy(ticketsArray, function (t) {
|
|
10657
|
+
return t.ticket.sortOrder;
|
|
10658
|
+
});
|
|
10659
|
+
}, [timeSlotGroups, sortBySoldOut]);
|
|
10660
|
+
var handleTimeSlotSelect = function handleTimeSlotSelect(ticketKey, timeKey, ticketInstance) {
|
|
10661
|
+
setSelectedTimeSlots(function (prev) {
|
|
10662
|
+
var _extends2;
|
|
10663
|
+
return _extends({}, prev, (_extends2 = {}, _extends2[ticketKey] = timeKey, _extends2));
|
|
10664
|
+
});
|
|
10665
|
+
// Reset quantity when time slot changes
|
|
10666
|
+
if (selectedTickets[ticketInstance.id]) {
|
|
10667
|
+
handleTicketSelect(ticketInstance.id, 0);
|
|
10668
|
+
}
|
|
10669
|
+
};
|
|
10670
|
+
var handleTicketSelectWithTimeSlot = function handleTicketSelectWithTimeSlot(ticketKey, quantity, ticketInstance) {
|
|
10671
|
+
var timeSlot = selectedTimeSlots[ticketKey];
|
|
10672
|
+
if (!timeSlot && quantity > 0) {
|
|
10673
|
+
return; // Don't allow quantity selection without time slot
|
|
10674
|
+
}
|
|
10675
|
+
|
|
10676
|
+
if (ticketInstance) {
|
|
10677
|
+
handleTicketSelect(ticketInstance.id, quantity);
|
|
10678
|
+
}
|
|
10679
|
+
};
|
|
10680
|
+
var symbol = _get(event, 'currency.symbol');
|
|
10681
|
+
var priceSymbol = currencySymbol || symbol;
|
|
9785
10682
|
return React.createElement(Box$1, {
|
|
9786
10683
|
sx: {
|
|
9787
10684
|
display: 'flex',
|
|
@@ -9813,30 +10710,25 @@ var TimeSlotsSection = function TimeSlotsSection(_ref) {
|
|
|
9813
10710
|
marginTop: 2,
|
|
9814
10711
|
width: '100%',
|
|
9815
10712
|
display: 'flex',
|
|
9816
|
-
flexDirection: 'column'
|
|
9817
|
-
gap: 2
|
|
10713
|
+
flexDirection: 'column'
|
|
9818
10714
|
}
|
|
9819
|
-
},
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9827
|
-
|
|
9828
|
-
|
|
10715
|
+
}, !hideTicketsHeader && ticketsHeaderComponent, uniqueTickets.map(function (_ref3) {
|
|
10716
|
+
var ticket = _ref3.ticket,
|
|
10717
|
+
availableTimeSlots = _ref3.availableTimeSlots;
|
|
10718
|
+
var ticketKey = (ticket.displayName || ticket.name) + "_" + ticket.price;
|
|
10719
|
+
var isSoldOut = ticket.sold_out || !(ticket.displayTicket || ticket.slotGroupId) || ticket.soldOut;
|
|
10720
|
+
return React.createElement(TimeSlotTicketRow, {
|
|
10721
|
+
key: ticketKey,
|
|
10722
|
+
ticketKey: ticketKey,
|
|
10723
|
+
ticket: ticket,
|
|
10724
|
+
availableTimeSlots: availableTimeSlots,
|
|
9829
10725
|
selectedTickets: selectedTickets,
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
showGroupNameBlock: showGroupNameBlock,
|
|
9837
|
-
currencySymbol: currencySymbol,
|
|
9838
|
-
isSeatMapAllowed: isSeatMapAllowed
|
|
9839
|
-
}));
|
|
10726
|
+
selectedTimeSlots: selectedTimeSlots,
|
|
10727
|
+
handleTicketSelect: handleTicketSelectWithTimeSlot,
|
|
10728
|
+
handleTimeSlotSelect: handleTimeSlotSelect,
|
|
10729
|
+
priceSymbol: priceSymbol,
|
|
10730
|
+
isSoldOut: isSoldOut
|
|
10731
|
+
});
|
|
9840
10732
|
})));
|
|
9841
10733
|
};
|
|
9842
10734
|
|
|
@@ -10258,11 +11150,45 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
10258
11150
|
}
|
|
10259
11151
|
localStorage.setItem('selectedTicketsQuantity', value.toString());
|
|
10260
11152
|
setSelectedTickets(function (prevState) {
|
|
10261
|
-
var
|
|
11153
|
+
var _ref4;
|
|
11154
|
+
// Allow multiple ticket types to be selected simultaneously when flag is enabled
|
|
11155
|
+
if ((event == null ? void 0 : event.allowMultipleTicketTypePurchases) === true) {
|
|
11156
|
+
var _extends2;
|
|
11157
|
+
// Check if we're switching between tables and regular tickets
|
|
11158
|
+
var hasExistingSelection = Object.keys(prevState).some(function (k) {
|
|
11159
|
+
return k !== 'isTable';
|
|
11160
|
+
});
|
|
11161
|
+
var switchingTicketType = hasExistingSelection && prevState.isTable !== isTable;
|
|
11162
|
+
// If switching from tables to regular tickets or vice versa, clear all selections
|
|
11163
|
+
if (switchingTicketType && Number(value) > 0) {
|
|
11164
|
+
var _ref3;
|
|
11165
|
+
return _ref3 = {}, _ref3[key] = value, _ref3.isTable = isTable, _ref3;
|
|
11166
|
+
}
|
|
11167
|
+
// If value is 0, remove this ticket from selection
|
|
11168
|
+
if (!value || Number(value) === 0) {
|
|
11169
|
+
var newState = _extends({}, prevState);
|
|
11170
|
+
delete newState[key];
|
|
11171
|
+
// If no ticket keys remain (only isTable left), return empty state
|
|
11172
|
+
var ticketKeys = Object.keys(newState).filter(function (k) {
|
|
11173
|
+
return k !== 'isTable';
|
|
11174
|
+
});
|
|
11175
|
+
if (ticketKeys.length === 0) {
|
|
11176
|
+
return {
|
|
11177
|
+
isTable: false
|
|
11178
|
+
};
|
|
11179
|
+
}
|
|
11180
|
+
return _extends({}, newState, {
|
|
11181
|
+
isTable: prevState.isTable
|
|
11182
|
+
});
|
|
11183
|
+
}
|
|
11184
|
+
// If value > 0, add or update this ticket while keeping others of the same type selected
|
|
11185
|
+
return _extends({}, prevState, (_extends2 = {}, _extends2[key] = value, _extends2.isTable = isTable, _extends2));
|
|
11186
|
+
}
|
|
11187
|
+
// Default behavior: only one ticket type at a time
|
|
10262
11188
|
if (Object.keys(prevState)[0] !== key && !value) {
|
|
10263
11189
|
return prevState;
|
|
10264
11190
|
}
|
|
10265
|
-
return
|
|
11191
|
+
return _ref4 = {}, _ref4[key] = value, _ref4.isTable = isTable, _ref4;
|
|
10266
11192
|
});
|
|
10267
11193
|
};
|
|
10268
11194
|
var handleOrdersClick = function handleOrdersClick() {
|
|
@@ -10274,9 +11200,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
10274
11200
|
setError(null);
|
|
10275
11201
|
};
|
|
10276
11202
|
var handleBook = /*#__PURE__*/function () {
|
|
10277
|
-
var
|
|
10278
|
-
var
|
|
10279
|
-
var timeSlotTickets,
|
|
11203
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
11204
|
+
var _product_options2;
|
|
11205
|
+
var timeSlotTickets, ticketsList, selectedTicketIds, ticketTypesData, totalProductCartQuantity, firstTicket, firstOptionName, firstTicketId, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$has_, _pageConfigsData$free, pageConfigsData, skipBillingPage, hasAddOn, freeTicket, hash, total, _checkoutResponse$dat, _checkoutResponse$dat2, _checkoutResponse$dat3, _checkoutResponse$dat4, userData, checkoutBody, checkoutResponse, _errorResponse$data, _errorResponse$data$d, errorResponse, _errorResponse$data2, message, _isInvalidLinkError, _isNotInvitedError;
|
|
10280
11206
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
10281
11207
|
while (1) switch (_context2.prev = _context2.next) {
|
|
10282
11208
|
case 0:
|
|
@@ -10284,54 +11210,75 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
10284
11210
|
return slots;
|
|
10285
11211
|
}));
|
|
10286
11212
|
setHandleBookIsLoading(true);
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
return Number(selectedTickets[
|
|
10291
|
-
})
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
11213
|
+
// Unified flow: works for both single and multiple ticket types
|
|
11214
|
+
ticketsList = event != null && event.isTimeSlotEvent ? timeSlotTickets : tickets; // Get all selected ticket IDs with quantity > 0 (excluding 'isTable' key)
|
|
11215
|
+
selectedTicketIds = Object.keys(selectedTickets).filter(function (key) {
|
|
11216
|
+
return key !== 'isTable' && Number(selectedTickets[key]) > 0;
|
|
11217
|
+
}); // Build ticket_types object with all selected tickets (works for 1 or N tickets)
|
|
11218
|
+
ticketTypesData = {};
|
|
11219
|
+
totalProductCartQuantity = 0;
|
|
11220
|
+
firstTicket = null;
|
|
11221
|
+
selectedTicketIds.forEach(function (ticketId) {
|
|
11222
|
+
var ticket = _find(ticketsList || [], function (item) {
|
|
11223
|
+
return String(item.id) === ticketId;
|
|
11224
|
+
});
|
|
11225
|
+
if (ticket) {
|
|
11226
|
+
var _product_options;
|
|
11227
|
+
if (!firstTicket) firstTicket = ticket;
|
|
11228
|
+
var optionName = _get(ticket, 'optionName');
|
|
11229
|
+
var quantity = +selectedTickets[ticketId];
|
|
11230
|
+
totalProductCartQuantity += quantity;
|
|
11231
|
+
ticketTypesData[ticketId] = {
|
|
11232
|
+
product_options: (_product_options = {}, _product_options[optionName] = ticketId, _product_options.ticket_price = ticket.price, _product_options),
|
|
11233
|
+
quantity: quantity
|
|
11234
|
+
};
|
|
11235
|
+
}
|
|
11236
|
+
});
|
|
11237
|
+
if (firstTicket) {
|
|
11238
|
+
_context2.next = 11;
|
|
11239
|
+
break;
|
|
11240
|
+
}
|
|
11241
|
+
setHandleBookIsLoading(false);
|
|
11242
|
+
return _context2.abrupt("return");
|
|
11243
|
+
case 11:
|
|
11244
|
+
firstOptionName = _get(firstTicket, 'optionName');
|
|
11245
|
+
firstTicketId = _get(firstTicket, 'id');
|
|
10296
11246
|
data = {
|
|
10297
11247
|
attributes: {
|
|
10298
11248
|
alternative_view_id: null,
|
|
10299
|
-
product_cart_quantity:
|
|
10300
|
-
product_options: (
|
|
11249
|
+
product_cart_quantity: totalProductCartQuantity,
|
|
11250
|
+
product_options: (_product_options2 = {}, _product_options2[firstOptionName] = firstTicketId, _product_options2),
|
|
10301
11251
|
product_id: eventId,
|
|
10302
|
-
ticket_types:
|
|
10303
|
-
product_options: (_product_options2 = {}, _product_options2[optionName] = ticketId, _product_options2.ticket_price = ticket.price, _product_options2),
|
|
10304
|
-
quantity: ticketQuantity
|
|
10305
|
-
}, _ticket_types)
|
|
11252
|
+
ticket_types: ticketTypesData
|
|
10306
11253
|
}
|
|
10307
11254
|
};
|
|
10308
|
-
_context2.prev =
|
|
11255
|
+
_context2.prev = 14;
|
|
10309
11256
|
onGetTicketsPress();
|
|
10310
|
-
_context2.next =
|
|
11257
|
+
_context2.next = 18;
|
|
10311
11258
|
return addToCart(eventId, data);
|
|
10312
|
-
case
|
|
11259
|
+
case 18:
|
|
10313
11260
|
result = _context2.sent;
|
|
10314
11261
|
if (!enableAddOns) {
|
|
10315
|
-
_context2.next =
|
|
11262
|
+
_context2.next = 25;
|
|
10316
11263
|
break;
|
|
10317
11264
|
}
|
|
10318
|
-
_context2.next =
|
|
11265
|
+
_context2.next = 22;
|
|
10319
11266
|
return getCheckoutPageConfigs();
|
|
10320
|
-
case
|
|
11267
|
+
case 22:
|
|
10321
11268
|
_context2.t0 = _context2.sent;
|
|
10322
|
-
_context2.next =
|
|
11269
|
+
_context2.next = 26;
|
|
10323
11270
|
break;
|
|
10324
|
-
case
|
|
11271
|
+
case 25:
|
|
10325
11272
|
_context2.t0 = {
|
|
10326
11273
|
status: 200,
|
|
10327
11274
|
data: {
|
|
10328
11275
|
attributes: _get(result, 'data.attributes')
|
|
10329
11276
|
}
|
|
10330
11277
|
};
|
|
10331
|
-
case
|
|
11278
|
+
case 26:
|
|
10332
11279
|
pageConfigsDataResponse = _context2.t0;
|
|
10333
11280
|
if (!(pageConfigsDataResponse.status === 200)) {
|
|
10334
|
-
_context2.next =
|
|
11281
|
+
_context2.next = 50;
|
|
10335
11282
|
break;
|
|
10336
11283
|
}
|
|
10337
11284
|
pageConfigsData = _get(pageConfigsDataResponse, 'data.attributes') || {};
|
|
@@ -10343,29 +11290,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
10343
11290
|
isBrowser && window.localStorage.removeItem('add_ons');
|
|
10344
11291
|
isBrowser && window.localStorage.removeItem('checkoutAdditionalConfigs');
|
|
10345
11292
|
if (!(skipBillingPage && !hasAddOn)) {
|
|
10346
|
-
_context2.next =
|
|
11293
|
+
_context2.next = 49;
|
|
10347
11294
|
break;
|
|
10348
11295
|
}
|
|
10349
11296
|
// Get user data for checkout data
|
|
10350
11297
|
userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '{}') : {};
|
|
10351
|
-
checkoutBody = createCheckoutDataBodyWithDefaultHolder(
|
|
11298
|
+
checkoutBody = createCheckoutDataBodyWithDefaultHolder(totalProductCartQuantity, userData);
|
|
10352
11299
|
if (!enableBillingInfoAutoCreate) {
|
|
10353
|
-
_context2.next =
|
|
11300
|
+
_context2.next = 45;
|
|
10354
11301
|
break;
|
|
10355
11302
|
}
|
|
10356
|
-
_context2.next =
|
|
11303
|
+
_context2.next = 42;
|
|
10357
11304
|
return postOnCheckout(checkoutBody, freeTicket);
|
|
10358
|
-
case
|
|
11305
|
+
case 42:
|
|
10359
11306
|
_context2.t1 = _context2.sent;
|
|
10360
|
-
_context2.next =
|
|
11307
|
+
_context2.next = 46;
|
|
10361
11308
|
break;
|
|
10362
|
-
case
|
|
11309
|
+
case 45:
|
|
10363
11310
|
_context2.t1 = null;
|
|
10364
|
-
case
|
|
11311
|
+
case 46:
|
|
10365
11312
|
checkoutResponse = _context2.t1;
|
|
10366
11313
|
hash = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat2 = _checkoutResponse$dat.attributes) == null ? void 0 : _checkoutResponse$dat2.hash) || '';
|
|
10367
11314
|
total = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat3 = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat4 = _checkoutResponse$dat3.attributes) == null ? void 0 : _checkoutResponse$dat4.total) || '';
|
|
10368
|
-
case
|
|
11315
|
+
case 49:
|
|
10369
11316
|
onAddToCartSuccess({
|
|
10370
11317
|
skip_billing_page: skipBillingPage,
|
|
10371
11318
|
event_id: String(eventId),
|
|
@@ -10376,12 +11323,12 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
10376
11323
|
cart: pageConfigsDataResponse.data.attributes.cart,
|
|
10377
11324
|
currencySymbol: event == null ? void 0 : event.currency.symbol
|
|
10378
11325
|
});
|
|
10379
|
-
case
|
|
10380
|
-
_context2.next =
|
|
11326
|
+
case 50:
|
|
11327
|
+
_context2.next = 56;
|
|
10381
11328
|
break;
|
|
10382
|
-
case
|
|
10383
|
-
_context2.prev =
|
|
10384
|
-
_context2.t2 = _context2["catch"](
|
|
11329
|
+
case 52:
|
|
11330
|
+
_context2.prev = 52;
|
|
11331
|
+
_context2.t2 = _context2["catch"](14);
|
|
10385
11332
|
errorResponse = _get(_context2.t2, 'response', {});
|
|
10386
11333
|
if (errorResponse != null && (_errorResponse$data = errorResponse.data) != null && (_errorResponse$data$d = _errorResponse$data.data) != null && _errorResponse$data$d.hasUnverifiedOrder) {
|
|
10387
11334
|
setPendingVerificationMessage(errorResponse == null ? void 0 : (_errorResponse$data2 = errorResponse.data) == null ? void 0 : _errorResponse$data2.message);
|
|
@@ -10398,25 +11345,25 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
10398
11345
|
setError(message);
|
|
10399
11346
|
}
|
|
10400
11347
|
}
|
|
10401
|
-
case
|
|
10402
|
-
_context2.prev =
|
|
11348
|
+
case 56:
|
|
11349
|
+
_context2.prev = 56;
|
|
10403
11350
|
setHandleBookIsLoading(false);
|
|
10404
|
-
return _context2.finish(
|
|
10405
|
-
case
|
|
11351
|
+
return _context2.finish(56);
|
|
11352
|
+
case 59:
|
|
10406
11353
|
case "end":
|
|
10407
11354
|
return _context2.stop();
|
|
10408
11355
|
}
|
|
10409
|
-
}, _callee2, null, [[
|
|
11356
|
+
}, _callee2, null, [[14, 52, 56, 59]]);
|
|
10410
11357
|
}));
|
|
10411
11358
|
return function handleBook() {
|
|
10412
|
-
return
|
|
11359
|
+
return _ref5.apply(this, arguments);
|
|
10413
11360
|
};
|
|
10414
11361
|
}();
|
|
10415
11362
|
var updateTickets = function updateTickets(isUpdatingCode, type) {
|
|
10416
11363
|
getTicketsApi(isUpdatingCode, type);
|
|
10417
11364
|
};
|
|
10418
11365
|
var fetchUserData = /*#__PURE__*/function () {
|
|
10419
|
-
var
|
|
11366
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
10420
11367
|
var userDataResponse, profileData, profileDataObj;
|
|
10421
11368
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
10422
11369
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -10435,7 +11382,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
10435
11382
|
}, _callee3);
|
|
10436
11383
|
}));
|
|
10437
11384
|
return function fetchUserData() {
|
|
10438
|
-
return
|
|
11385
|
+
return _ref6.apply(this, arguments);
|
|
10439
11386
|
};
|
|
10440
11387
|
}();
|
|
10441
11388
|
var isTicketOnSale = event != null && event.isTimeSlotEvent ? true : _some(tickets, function (item) {
|
|
@@ -12270,7 +13217,9 @@ var LoginForm = function LoginForm(_ref) {
|
|
|
12270
13217
|
_ref$showSignUpButton = _ref.showSignUpButton,
|
|
12271
13218
|
showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton,
|
|
12272
13219
|
_ref$showPoweredByIma = _ref.showPoweredByImage,
|
|
12273
|
-
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma
|
|
13220
|
+
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma,
|
|
13221
|
+
_ref$registerUrl = _ref.registerUrl,
|
|
13222
|
+
registerUrl = _ref$registerUrl === void 0 ? 'https://www.ticketfairy.com/register' : _ref$registerUrl;
|
|
12274
13223
|
var _useState = useState(''),
|
|
12275
13224
|
error = _useState[0],
|
|
12276
13225
|
setError = _useState[1];
|
|
@@ -12391,9 +13340,16 @@ var LoginForm = function LoginForm(_ref) {
|
|
|
12391
13340
|
onClick: onForgotPasswordButtonClick
|
|
12392
13341
|
}, "Forgot password?")), showSignUpButton && React.createElement("div", {
|
|
12393
13342
|
className: "forgot-password"
|
|
12394
|
-
}, React.createElement("span", {
|
|
13343
|
+
}, onSignupButtonClick !== _identity ? React.createElement("span", {
|
|
12395
13344
|
"aria-hidden": "true",
|
|
12396
|
-
onClick: onSignupButtonClick
|
|
13345
|
+
onClick: onSignupButtonClick,
|
|
13346
|
+
style: {
|
|
13347
|
+
cursor: 'pointer'
|
|
13348
|
+
}
|
|
13349
|
+
}, "Sign up") : React.createElement("a", {
|
|
13350
|
+
href: registerUrl,
|
|
13351
|
+
target: "_blank",
|
|
13352
|
+
rel: "noopener noreferrer"
|
|
12397
13353
|
}, "Sign up")), showPoweredByImage ? React.createElement(PoweredBy, null) : null));
|
|
12398
13354
|
}));
|
|
12399
13355
|
};
|