tf-checkout-react 1.0.99 → 1.0.100-beta.2
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/README.md +278 -1
- package/dist/api/index.d.ts +31 -26
- package/dist/components/account-settings/index.d.ts +3 -0
- package/dist/components/billing-info-container/index.d.ts +5 -5
- package/dist/components/billing-info-container/utils.d.ts +1 -0
- package/dist/components/common/CustomField.d.ts +1 -1
- package/dist/components/common/DatePickerField.d.ts +14 -0
- package/dist/components/common/RedirectModal.d.ts +7 -0
- package/dist/components/common/SnackbarAlert.d.ts +13 -0
- package/dist/components/confirmationContainer/index.d.ts +2 -1
- package/dist/components/countdown/index.d.ts +4 -1
- package/dist/components/myTicketsContainer/tableConfig.d.ts +0 -1
- package/dist/components/orderDetailsContainer/index.d.ts +5 -1
- package/dist/components/orderDetailsContainer/ticketsTable.d.ts +4 -1
- package/dist/components/paymentContainer/index.d.ts +3 -1
- package/dist/components/rsvpContainer/index.d.ts +7 -0
- package/dist/components/stripePayment/index.d.ts +2 -1
- package/dist/components/ticketResale/index.d.ts +5 -3
- package/dist/components/ticketsContainer/AccessCodeSection.d.ts +7 -0
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +6 -9
- package/dist/components/ticketsContainer/TicketsSection.d.ts +5 -3
- package/dist/components/ticketsContainer/index.d.ts +13 -2
- package/dist/components/timerWidget/index.d.ts +3 -3
- package/dist/env.d.ts +1 -0
- package/dist/images/cross.svg +44 -0
- package/dist/images/done.svg +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/tf-checkout-react.cjs.development.js +1400 -575
- 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 +1409 -586
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/dist/utils/cookies.d.ts +3 -0
- package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +6 -1
- package/dist/utils/downloadPDF.d.ts +1 -1
- package/dist/utils/getDomain.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/package.json +89 -89
- package/src/.DS_Store +0 -0
- package/src/.d.ts +2 -2
- package/src/api/index.ts +313 -278
- package/src/assets/images/cross.svg +44 -0
- package/src/assets/images/done.svg +3 -3
- package/src/components/.DS_Store +0 -0
- package/src/components/account-settings/index.tsx +161 -0
- package/src/components/account-settings/style.css +200 -0
- package/src/components/billing-info-container/index.tsx +821 -777
- package/src/components/billing-info-container/style.css +106 -106
- package/src/components/billing-info-container/utils.ts +233 -223
- package/src/components/common/CheckboxField.tsx +41 -41
- package/src/components/common/CustomField.tsx +87 -84
- package/src/components/common/DatePickerField.tsx +98 -0
- package/src/components/common/FormikPhoneNumberField.tsx +51 -51
- package/src/components/common/Loader.tsx +9 -9
- package/src/components/common/RadioField.tsx +35 -35
- package/src/components/common/RedirectModal.tsx +43 -0
- package/src/components/common/SelectField.tsx +80 -80
- package/src/components/common/SnackbarAlert.tsx +54 -0
- package/src/components/common/dist/PhoneNumberField.js +96 -0
- package/src/components/common/index.tsx +4 -4
- package/src/components/confirmModal/index.tsx +51 -51
- package/src/components/confirmModal/style.css +21 -21
- package/src/components/confirmationContainer/config.ts +72 -72
- package/src/components/confirmationContainer/index.tsx +197 -194
- package/src/components/confirmationContainer/social-buttons.tsx +94 -94
- package/src/components/confirmationContainer/style.css +202 -202
- package/src/components/countdown/index.tsx +100 -89
- package/src/components/countdown/style.css +9 -9
- package/src/components/index.ts +7 -7
- package/src/components/loginModal/index.tsx +171 -209
- package/src/components/loginModal/style.css +71 -71
- package/src/components/myTicketsContainer/index.tsx +201 -137
- package/src/components/myTicketsContainer/row.tsx +41 -41
- package/src/components/myTicketsContainer/style.css +40 -40
- package/src/components/myTicketsContainer/tableConfig.tsx +32 -34
- package/src/components/orderDetailsContainer/index.tsx +289 -249
- package/src/components/orderDetailsContainer/style.css +73 -73
- package/src/components/orderDetailsContainer/ticketsTable.tsx +177 -124
- package/src/components/paymentContainer/index.tsx +352 -284
- package/src/components/registerModal/index.tsx +183 -190
- package/src/components/rsvpContainer/index.tsx +126 -0
- package/src/components/stripePayment/index.tsx +258 -253
- package/src/components/stripePayment/style.css +60 -60
- package/src/components/ticketResale/index.tsx +74 -56
- package/src/components/ticketResaleModal/index.tsx +213 -210
- package/src/components/ticketResaleModal/style.css +28 -28
- package/src/components/ticketsContainer/AccessCodeSection.tsx +50 -0
- package/src/components/ticketsContainer/PromoCodeSection.tsx +89 -99
- package/src/components/ticketsContainer/ReferralLogic.tsx +31 -33
- package/src/components/ticketsContainer/TicketRow.tsx +89 -83
- package/src/components/ticketsContainer/TicketsSection.tsx +87 -81
- package/src/components/ticketsContainer/index.tsx +506 -409
- package/src/components/ticketsContainer/style.css +181 -181
- package/src/components/ticketsContainer/utils.ts +11 -11
- package/src/components/timerWidget/index.tsx +87 -70
- package/src/components/timerWidget/style.css +34 -26
- package/src/components/waitingList/index.tsx +178 -178
- package/src/components/waitingList/style.css +26 -26
- package/src/env.ts +20 -19
- package/src/index.ts +15 -13
- package/src/normalizers/index.ts +45 -45
- package/src/types/billing-info-data.ts +37 -37
- package/src/types/payment-field.ts +7 -7
- package/src/types/referral-promotion.ts +7 -7
- package/src/utils/cookies.ts +42 -0
- package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +71 -59
- package/src/utils/downloadPDF.tsx +52 -30
- package/src/utils/formikErrorFocus.ts +24 -24
- package/src/utils/getDomain.ts +15 -0
- package/src/utils/getImage.ts +14 -14
- package/src/utils/getQueryVariable.ts +13 -13
- package/src/utils/index.ts +7 -5
- package/src/utils/setConfigs.ts +26 -26
- package/src/utils/showZero.tsx +10 -10
- package/src/validators/index.ts +20 -20
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { Component, useState, useRef, useEffect, Fragment } from 'react';
|
|
1
|
+
import React, { Component, useState, memo, useRef, useEffect, Fragment } from 'react';
|
|
2
2
|
import { connect, Formik, Form, Field } from 'formik';
|
|
3
3
|
import Button from '@mui/material/Button';
|
|
4
4
|
import _identity from 'lodash-es/identity';
|
|
@@ -9,7 +9,7 @@ import _isEqual from 'lodash-es/isEqual';
|
|
|
9
9
|
import _isEmpty from 'lodash-es/isEmpty';
|
|
10
10
|
import axios from 'axios';
|
|
11
11
|
import _forEach from 'lodash-es/forEach';
|
|
12
|
-
import { TextField, FormControl, FormHelperText, InputLabel, CircularProgress as CircularProgress$1,
|
|
12
|
+
import { TextField, FormControl, FormHelperText, InputLabel, Snackbar, Alert, CircularProgress as CircularProgress$1, createTheme as createTheme$1 } from '@mui/material';
|
|
13
13
|
import Modal from '@mui/material/Modal';
|
|
14
14
|
import Box from '@mui/material/Box';
|
|
15
15
|
import _flatMapDeep from 'lodash-es/flatMapDeep';
|
|
@@ -23,35 +23,37 @@ import TextField$1 from '@mui/material/TextField';
|
|
|
23
23
|
import MuiPhoneNumber from 'material-ui-phone-number';
|
|
24
24
|
import CircularProgress from '@mui/material/CircularProgress';
|
|
25
25
|
import Select from '@mui/material/Select';
|
|
26
|
-
import {
|
|
26
|
+
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
27
27
|
import Backdrop from '@mui/material/Backdrop';
|
|
28
|
+
import Countdown$1 from 'react-countdown';
|
|
29
|
+
import _isNumber from 'lodash-es/isNumber';
|
|
30
|
+
import SVG from 'react-inlinesvg';
|
|
31
|
+
import DatePicker from '@mui/lab/DatePicker';
|
|
32
|
+
import AdapterMoment from '@mui/lab/AdapterMoment';
|
|
33
|
+
import LocalizationProvider from '@mui/lab/LocalizationProvider';
|
|
28
34
|
import Container from '@mui/material/Container';
|
|
29
35
|
import Alert$1 from '@mui/material/Alert';
|
|
30
36
|
import { useStripe, useElements, CardNumberElement, CardExpiryElement, CardCvcElement, Elements } from '@stripe/react-stripe-js';
|
|
31
37
|
import { loadStripe } from '@stripe/stripe-js';
|
|
32
|
-
import Countdown$1 from 'react-countdown';
|
|
33
|
-
import _isNumber from 'lodash-es/isNumber';
|
|
34
38
|
import { FacebookShareButton, FacebookIcon, FacebookMessengerShareButton, FacebookMessengerIcon, TwitterShareButton, TwitterIcon, LinkedinShareButton, LinkedinIcon, PinterestShareButton, PinterestIcon, VKShareButton, VKIcon, OKShareButton, OKIcon, TelegramShareButton, TelegramIcon, WhatsappShareButton, WhatsappIcon, RedditShareButton, RedditIcon, TumblrShareButton, TumblrIcon, MailruShareButton, MailruIcon, EmailShareButton, EmailIcon, LivejournalShareButton, LivejournalIcon, ViberShareButton, ViberIcon, WorkplaceShareButton, WorkplaceIcon, LineShareButton, LineIcon, PocketShareButton, PocketIcon, InstapaperShareButton, InstapaperIcon, WeiboShareButton, WeiboIcon, HatenaShareButton, HatenaIcon } from 'react-share';
|
|
35
39
|
import _some from 'lodash-es/some';
|
|
36
|
-
import _every from 'lodash-es/every';
|
|
37
40
|
import _find from 'lodash-es/find';
|
|
38
41
|
import Button$1 from 'react-bootstrap/Button';
|
|
39
42
|
import jwt_decode from 'jwt-decode';
|
|
40
43
|
import _sortBy from 'lodash-es/sortBy';
|
|
41
44
|
import FormControl$1 from '@mui/material/FormControl';
|
|
42
45
|
import MenuItem from '@mui/material/MenuItem';
|
|
43
|
-
import SVG from 'react-inlinesvg';
|
|
44
46
|
import moment from 'moment-timezone';
|
|
45
47
|
import { ThemeProvider as ThemeProvider$1 } from '@mui/private-theming';
|
|
46
48
|
import Table from '@mui/material/Table';
|
|
47
49
|
import TableBody from '@mui/material/TableBody';
|
|
48
|
-
import TableCell from '@mui/material/TableCell';
|
|
49
50
|
import TableContainer from '@mui/material/TableContainer';
|
|
50
|
-
import TableHead from '@mui/material/TableHead';
|
|
51
|
-
import TableRow from '@mui/material/TableRow';
|
|
52
51
|
import Paper from '@mui/material/Paper';
|
|
53
52
|
import TablePagination from '@mui/material/TablePagination';
|
|
54
53
|
import Autocomplete from '@mui/material/Autocomplete';
|
|
54
|
+
import TableRow from '@mui/material/TableRow';
|
|
55
|
+
import TableCell from '@mui/material/TableCell';
|
|
56
|
+
import TableHead from '@mui/material/TableHead';
|
|
55
57
|
import _has from 'lodash-es/has';
|
|
56
58
|
import { object, string, ref, boolean } from 'yup';
|
|
57
59
|
import Radio from '@mui/material/Radio';
|
|
@@ -996,14 +998,87 @@ var ErrorFocusInternal = /*#__PURE__*/function (_Component) {
|
|
|
996
998
|
|
|
997
999
|
var ErrorFocus = /*#__PURE__*/connect(ErrorFocusInternal);
|
|
998
1000
|
|
|
1001
|
+
function getDomain(url, subdomain) {
|
|
1002
|
+
var updatedUrl = url.replace(/(https?:\/\/)?(www.)?/i, '');
|
|
1003
|
+
|
|
1004
|
+
if (!subdomain) {
|
|
1005
|
+
updatedUrl = updatedUrl.split('.');
|
|
1006
|
+
updatedUrl = updatedUrl.slice(updatedUrl.length - 2).join('.');
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
if (updatedUrl.indexOf('/') !== -1) {
|
|
1010
|
+
return updatedUrl.split('/')[0];
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
return updatedUrl;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
function setCustomCookie(name, value, days) {
|
|
1017
|
+
if (days === void 0) {
|
|
1018
|
+
days = 5;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
var expires = '';
|
|
1022
|
+
|
|
1023
|
+
if (days) {
|
|
1024
|
+
var date = new Date();
|
|
1025
|
+
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
1026
|
+
expires = '; expires=' + date.toUTCString();
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
if (typeof window !== 'undefined') {
|
|
1030
|
+
var domain = getDomain(window.location.hostname);
|
|
1031
|
+
document.cookie = name + '=' + (value || '') + expires + '; path=/' + ("; domain=" + domain);
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
function getCookieByName(cname) {
|
|
1035
|
+
if (typeof window === 'undefined') return '';
|
|
1036
|
+
var name = cname + '=';
|
|
1037
|
+
var ca = document.cookie.split(';');
|
|
1038
|
+
|
|
1039
|
+
for (var i = 0; i < ca.length; i++) {
|
|
1040
|
+
var c = ca[i];
|
|
1041
|
+
|
|
1042
|
+
while (c.charAt(0) == ' ') {
|
|
1043
|
+
c = c.substring(1);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
if (c.indexOf(name) == 0) {
|
|
1047
|
+
return c.substring(name.length, c.length);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
return '';
|
|
1052
|
+
}
|
|
1053
|
+
function deleteCookieByName(name) {
|
|
1054
|
+
if (typeof window !== 'undefined') {
|
|
1055
|
+
var domain = getDomain(window.location.hostname);
|
|
1056
|
+
document.cookie = name + '=; Path=/' + ("; domain=" + domain) + '; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
|
|
999
1060
|
var downloadPDF = function downloadPDF(pdfUrl) {
|
|
1000
1061
|
if (typeof window === 'undefined') return;
|
|
1062
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
1001
1063
|
var accessToken = localStorage.getItem('access_token');
|
|
1002
|
-
if (!accessToken) return;
|
|
1003
|
-
|
|
1004
|
-
|
|
1064
|
+
if (!accessToken && !xtfCookie) return;
|
|
1065
|
+
var headers = {};
|
|
1066
|
+
|
|
1067
|
+
if (accessToken) {
|
|
1068
|
+
headers = {
|
|
1005
1069
|
Authorization: "Bearer " + accessToken
|
|
1006
|
-
}
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
if (xtfCookie) {
|
|
1074
|
+
headers = {
|
|
1075
|
+
'X-TF-ECOMMERCE': xtfCookie
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
return fetch(pdfUrl, {
|
|
1080
|
+
headers: headers,
|
|
1081
|
+
credentials: 'include'
|
|
1007
1082
|
}).then( /*#__PURE__*/function () {
|
|
1008
1083
|
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(response) {
|
|
1009
1084
|
var blobValue, fileNameHeader, fileName;
|
|
@@ -1016,7 +1091,7 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1016
1091
|
|
|
1017
1092
|
case 2:
|
|
1018
1093
|
blobValue = _context.sent;
|
|
1019
|
-
fileNameHeader = response.headers.get(
|
|
1094
|
+
fileNameHeader = response.headers.get('content-disposition') || '';
|
|
1020
1095
|
fileName = fileNameHeader.split('"')[1];
|
|
1021
1096
|
return _context.abrupt("return", {
|
|
1022
1097
|
blobValue: blobValue,
|
|
@@ -1037,7 +1112,11 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1037
1112
|
}()).then(function (_ref2) {
|
|
1038
1113
|
var blobValue = _ref2.blobValue,
|
|
1039
1114
|
fileName = _ref2.fileName;
|
|
1040
|
-
|
|
1115
|
+
|
|
1116
|
+
if (!fileName) {
|
|
1117
|
+
throw Error('Something went wrong.');
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1041
1120
|
var file = new Blob([blobValue], {
|
|
1042
1121
|
type: 'application/pdf'
|
|
1043
1122
|
});
|
|
@@ -1048,21 +1127,27 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1048
1127
|
document.body.appendChild(link);
|
|
1049
1128
|
link.click();
|
|
1050
1129
|
document.body.removeChild(link);
|
|
1130
|
+
})["catch"](function (error) {
|
|
1131
|
+
return error;
|
|
1051
1132
|
});
|
|
1052
1133
|
};
|
|
1053
1134
|
|
|
1054
|
-
var createCheckoutDataBodyWithDefaultHolder = function createCheckoutDataBodyWithDefaultHolder(ticketsQuantity, logedInValues, includeDob) {
|
|
1135
|
+
var createCheckoutDataBodyWithDefaultHolder = function createCheckoutDataBodyWithDefaultHolder(ticketsQuantity, logedInValues, includeDob, userCredentials) {
|
|
1055
1136
|
if (includeDob === void 0) {
|
|
1056
1137
|
includeDob = false;
|
|
1057
1138
|
}
|
|
1058
1139
|
|
|
1140
|
+
if (userCredentials === void 0) {
|
|
1141
|
+
userCredentials = {};
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1059
1144
|
var ticket_holders = [];
|
|
1060
|
-
var first_name = _get(logedInValues, 'firstName') || _get(logedInValues, 'first_name') || '';
|
|
1061
|
-
var last_name = _get(logedInValues, 'lastName', '') || _get(
|
|
1145
|
+
var first_name = _get(logedInValues, 'firstName') || _get(logedInValues, 'first_name') || _get(userCredentials, 'firstNameLogged') || '';
|
|
1146
|
+
var last_name = _get(logedInValues, 'lastName') || _get(logedInValues, 'last_name') || _get(userCredentials, 'lastNameLogged') || '';
|
|
1062
1147
|
|
|
1063
1148
|
var phone = _get(logedInValues, 'phone', '');
|
|
1064
1149
|
|
|
1065
|
-
var email = _get(logedInValues, 'email', '');
|
|
1150
|
+
var email = _get(logedInValues, 'email') || _get(userCredentials, 'emailLogged') || '';
|
|
1066
1151
|
|
|
1067
1152
|
for (var i = 0; i <= ticketsQuantity - 1; i++) {
|
|
1068
1153
|
var individualHolder = i ? {
|
|
@@ -1114,6 +1199,13 @@ var publicRequest = /*#__PURE__*/axios.create({
|
|
|
1114
1199
|
headers: ttfHeaders
|
|
1115
1200
|
});
|
|
1116
1201
|
publicRequest.interceptors.response.use(function (response) {
|
|
1202
|
+
var authGuestToken = _get(response, 'headers.authorization-guest');
|
|
1203
|
+
|
|
1204
|
+
if (isWindowDefined && authGuestToken) {
|
|
1205
|
+
window.localStorage.setItem('auth_guest_token', authGuestToken);
|
|
1206
|
+
publicRequest.setGuestToken(authGuestToken);
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1117
1209
|
return response;
|
|
1118
1210
|
}, function (error) {
|
|
1119
1211
|
var _error$response;
|
|
@@ -1122,7 +1214,6 @@ publicRequest.interceptors.response.use(function (response) {
|
|
|
1122
1214
|
if (isWindowDefined) {
|
|
1123
1215
|
var _error$response2, _error$response2$data;
|
|
1124
1216
|
|
|
1125
|
-
window.localStorage.removeItem('auth_guest_token');
|
|
1126
1217
|
window.localStorage.removeItem('user_data');
|
|
1127
1218
|
window.localStorage.removeItem('access_token');
|
|
1128
1219
|
var errorType = error == null ? void 0 : (_error$response2 = error.response) == null ? void 0 : (_error$response2$data = _error$response2.data) == null ? void 0 : _error$response2$data.error;
|
|
@@ -1133,6 +1224,13 @@ publicRequest.interceptors.response.use(function (response) {
|
|
|
1133
1224
|
}
|
|
1134
1225
|
}
|
|
1135
1226
|
|
|
1227
|
+
var authGuestToken = _get(error, 'response.headers.authorization-guest');
|
|
1228
|
+
|
|
1229
|
+
if (isWindowDefined && authGuestToken) {
|
|
1230
|
+
window.localStorage.setItem('auth_guest_token', authGuestToken);
|
|
1231
|
+
publicRequest.setGuestToken(authGuestToken);
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1136
1234
|
return Promise.reject(error);
|
|
1137
1235
|
});
|
|
1138
1236
|
publicRequest.interceptors.request.use(function (config) {
|
|
@@ -1158,20 +1256,41 @@ publicRequest.interceptors.request.use(function (config) {
|
|
|
1158
1256
|
config.headers = _updatedHeaders;
|
|
1159
1257
|
}
|
|
1160
1258
|
|
|
1161
|
-
if (
|
|
1259
|
+
if (getCookieByName('X-TF-ECOMMERCE')) {
|
|
1162
1260
|
var _updatedHeaders2 = _extends({}, config.headers, {
|
|
1163
|
-
'X-
|
|
1261
|
+
'X-TF-ECOMMERCE': getCookieByName('X-TF-ECOMMERCE')
|
|
1164
1262
|
});
|
|
1165
1263
|
|
|
1166
1264
|
config.headers = _updatedHeaders2;
|
|
1167
1265
|
}
|
|
1168
1266
|
|
|
1267
|
+
if (CONFIGS.X_SOURCE_ORIGIN) {
|
|
1268
|
+
var _updatedHeaders3 = _extends({}, config.headers, {
|
|
1269
|
+
'X-Source-Origin': CONFIGS.X_SOURCE_ORIGIN
|
|
1270
|
+
});
|
|
1271
|
+
|
|
1272
|
+
config.headers = _updatedHeaders3;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1169
1275
|
if (CONFIGS.BASE_URL) {
|
|
1170
1276
|
config.baseURL = CONFIGS.BASE_URL + '/api';
|
|
1171
1277
|
}
|
|
1172
1278
|
|
|
1173
1279
|
return config;
|
|
1174
1280
|
});
|
|
1281
|
+
publicRequest.interceptors.response.use(function (response) {
|
|
1282
|
+
var xtfCookie = _get(response, 'headers.x-tf-ecommerce');
|
|
1283
|
+
|
|
1284
|
+
var url = _get(response, 'config.url');
|
|
1285
|
+
|
|
1286
|
+
var method = _get(response, 'config.method');
|
|
1287
|
+
|
|
1288
|
+
if (xtfCookie && !(url === '/auth' && method === 'delete')) {
|
|
1289
|
+
setCustomCookie('X-TF-ECOMMERCE', xtfCookie);
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
return response;
|
|
1293
|
+
});
|
|
1175
1294
|
|
|
1176
1295
|
publicRequest.setGuestToken = function (token) {
|
|
1177
1296
|
return publicRequest.defaults.headers.common['Authorization-Guest'] = token;
|
|
@@ -1202,14 +1321,6 @@ var setCustomHeader = function setCustomHeader(response) {
|
|
|
1202
1321
|
}
|
|
1203
1322
|
}
|
|
1204
1323
|
};
|
|
1205
|
-
var handleSetAccessToken = function handleSetAccessToken(token) {
|
|
1206
|
-
if (token) {
|
|
1207
|
-
if (isWindowDefined) {
|
|
1208
|
-
window.localStorage.setItem('access_token', token);
|
|
1209
|
-
publicRequest.setAccessToken(token);
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
};
|
|
1213
1324
|
function getEvent(id) {
|
|
1214
1325
|
var response = publicRequest.get("v1/event/" + id, {
|
|
1215
1326
|
headers: ttfHeaders
|
|
@@ -1250,14 +1361,11 @@ var postOnCheckout = function postOnCheckout(data, accessToken) {
|
|
|
1250
1361
|
return res;
|
|
1251
1362
|
};
|
|
1252
1363
|
var authorize = function authorize(data) {
|
|
1253
|
-
return publicRequest.post("
|
|
1364
|
+
return publicRequest.post("/auth?clientId=" + (CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf'), data);
|
|
1254
1365
|
};
|
|
1255
1366
|
var register = function register(data) {
|
|
1256
1367
|
return publicRequest.post('v1/oauth/register-rn', data);
|
|
1257
1368
|
};
|
|
1258
|
-
var getAccessToken = function getAccessToken(data) {
|
|
1259
|
-
return publicRequest.post('v1/oauth/access_token', data);
|
|
1260
|
-
};
|
|
1261
1369
|
var getPaymentData = function getPaymentData(hash) {
|
|
1262
1370
|
var response = publicRequest.get("v1/order/" + hash + "/review/")["catch"](function (error) {
|
|
1263
1371
|
throw error;
|
|
@@ -1318,8 +1426,17 @@ var postReferralVisits = function postReferralVisits(eventId, referralId) {
|
|
|
1318
1426
|
referrer: "" + referralId
|
|
1319
1427
|
});
|
|
1320
1428
|
};
|
|
1321
|
-
var
|
|
1322
|
-
return publicRequest
|
|
1429
|
+
var logout = function logout() {
|
|
1430
|
+
return publicRequest["delete"]('/auth');
|
|
1431
|
+
};
|
|
1432
|
+
var processTicket = function processTicket(hash) {
|
|
1433
|
+
return publicRequest.post("v1/ticket/" + hash + "/process/");
|
|
1434
|
+
};
|
|
1435
|
+
var declineInvitation = function declineInvitation(hash) {
|
|
1436
|
+
return publicRequest.post("v1/ticket/" + hash + "/decline");
|
|
1437
|
+
};
|
|
1438
|
+
var sendRSVPInfo = function sendRSVPInfo(eventId, data) {
|
|
1439
|
+
return publicRequest.post("v1/event/" + eventId + "/send-rsvp-info", data);
|
|
1323
1440
|
};
|
|
1324
1441
|
|
|
1325
1442
|
var style = {
|
|
@@ -1339,10 +1456,6 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1339
1456
|
alreadyHasUser = _ref$alreadyHasUser === void 0 ? false : _ref$alreadyHasUser,
|
|
1340
1457
|
_ref$userExpired = _ref.userExpired,
|
|
1341
1458
|
userExpired = _ref$userExpired === void 0 ? false : _ref$userExpired,
|
|
1342
|
-
_ref$onAuthorizeSucce = _ref.onAuthorizeSuccess,
|
|
1343
|
-
onAuthorizeSuccess = _ref$onAuthorizeSucce === void 0 ? function () {} : _ref$onAuthorizeSucce,
|
|
1344
|
-
_ref$onAuthorizeError = _ref.onAuthorizeError,
|
|
1345
|
-
onAuthorizeError = _ref$onAuthorizeError === void 0 ? function () {} : _ref$onAuthorizeError,
|
|
1346
1459
|
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
1347
1460
|
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? function () {} : _ref$onGetProfileData,
|
|
1348
1461
|
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
@@ -1375,7 +1488,7 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1375
1488
|
},
|
|
1376
1489
|
onSubmit: function () {
|
|
1377
1490
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1378
|
-
var email, password,
|
|
1491
|
+
var email, password, body, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
|
|
1379
1492
|
|
|
1380
1493
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1381
1494
|
while (1) {
|
|
@@ -1383,66 +1496,36 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1383
1496
|
case 0:
|
|
1384
1497
|
email = _ref2.email, password = _ref2.password;
|
|
1385
1498
|
_context.prev = 1;
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
case 7:
|
|
1393
|
-
resAutorize = _context.sent;
|
|
1394
|
-
bodyFormDataToken = new FormData();
|
|
1395
|
-
bodyFormDataToken.append('code', resAutorize.data.data.code);
|
|
1396
|
-
bodyFormDataToken.append('scope', 'profile');
|
|
1397
|
-
bodyFormDataToken.append('grant_type', 'authorization_code');
|
|
1398
|
-
bodyFormDataToken.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
1399
|
-
bodyFormDataToken.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
1400
|
-
resAccessToken = null;
|
|
1401
|
-
_context.prev = 15;
|
|
1402
|
-
_context.next = 18;
|
|
1403
|
-
return getAccessToken(bodyFormDataToken);
|
|
1404
|
-
|
|
1405
|
-
case 18:
|
|
1406
|
-
resAccessToken = _context.sent;
|
|
1407
|
-
onAuthorizeSuccess(resAccessToken.data);
|
|
1408
|
-
_context.next = 26;
|
|
1409
|
-
break;
|
|
1410
|
-
|
|
1411
|
-
case 22:
|
|
1412
|
-
_context.prev = 22;
|
|
1413
|
-
_context.t0 = _context["catch"](15);
|
|
1414
|
-
|
|
1415
|
-
if (axios.isAxiosError(_context.t0)) {
|
|
1416
|
-
onAuthorizeError(_context.t0);
|
|
1417
|
-
}
|
|
1418
|
-
|
|
1419
|
-
return _context.abrupt("return");
|
|
1499
|
+
body = {
|
|
1500
|
+
email: email,
|
|
1501
|
+
password: password
|
|
1502
|
+
};
|
|
1503
|
+
_context.next = 5;
|
|
1504
|
+
return authorize(body);
|
|
1420
1505
|
|
|
1421
|
-
case
|
|
1422
|
-
accessToken = _get(resAccessToken, 'data.access_token');
|
|
1423
|
-
handleSetAccessToken(accessToken);
|
|
1506
|
+
case 5:
|
|
1424
1507
|
profileResponse = null;
|
|
1425
|
-
_context.prev =
|
|
1426
|
-
_context.next =
|
|
1427
|
-
return getProfileData(
|
|
1508
|
+
_context.prev = 6;
|
|
1509
|
+
_context.next = 9;
|
|
1510
|
+
return getProfileData();
|
|
1428
1511
|
|
|
1429
|
-
case
|
|
1512
|
+
case 9:
|
|
1430
1513
|
profileResponse = _context.sent;
|
|
1431
1514
|
onGetProfileDataSuccess(profileResponse.data);
|
|
1432
|
-
_context.next =
|
|
1515
|
+
_context.next = 17;
|
|
1433
1516
|
break;
|
|
1434
1517
|
|
|
1435
|
-
case
|
|
1436
|
-
_context.prev =
|
|
1437
|
-
_context.
|
|
1518
|
+
case 13:
|
|
1519
|
+
_context.prev = 13;
|
|
1520
|
+
_context.t0 = _context["catch"](6);
|
|
1438
1521
|
|
|
1439
|
-
if (axios.isAxiosError(_context.
|
|
1440
|
-
onGetProfileDataError(_context.
|
|
1522
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
1523
|
+
onGetProfileDataError(_context.t0);
|
|
1441
1524
|
}
|
|
1442
1525
|
|
|
1443
1526
|
return _context.abrupt("return");
|
|
1444
1527
|
|
|
1445
|
-
case
|
|
1528
|
+
case 17:
|
|
1446
1529
|
profileSpecifiedData = _get(profileResponse, 'data.data');
|
|
1447
1530
|
profileDataObj = {
|
|
1448
1531
|
id: profileSpecifiedData.id,
|
|
@@ -1453,32 +1536,31 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1453
1536
|
|
|
1454
1537
|
if (typeof window !== 'undefined') {
|
|
1455
1538
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
1456
|
-
window.localStorage.setItem('access_token', accessToken);
|
|
1457
1539
|
event = new window.CustomEvent('tf-login');
|
|
1458
1540
|
window.document.dispatchEvent(event);
|
|
1459
1541
|
}
|
|
1460
1542
|
|
|
1461
1543
|
onLogin();
|
|
1462
|
-
_context.next =
|
|
1544
|
+
_context.next = 26;
|
|
1463
1545
|
break;
|
|
1464
1546
|
|
|
1465
|
-
case
|
|
1466
|
-
_context.prev =
|
|
1467
|
-
_context.
|
|
1547
|
+
case 23:
|
|
1548
|
+
_context.prev = 23;
|
|
1549
|
+
_context.t1 = _context["catch"](1);
|
|
1468
1550
|
|
|
1469
|
-
if (axios.isAxiosError(_context.
|
|
1470
|
-
_error = (_context.
|
|
1551
|
+
if (axios.isAxiosError(_context.t1)) {
|
|
1552
|
+
_error = (_context.t1 == null ? void 0 : (_e$response = _context.t1.response) == null ? void 0 : (_e$response$data = _e$response.data) == null ? void 0 : _e$response$data.message) || 'Error';
|
|
1471
1553
|
setError(_error);
|
|
1472
|
-
} else if (_context.
|
|
1473
|
-
setError((_context.
|
|
1554
|
+
} else if (_context.t1 instanceof Error) {
|
|
1555
|
+
setError((_context.t1 == null ? void 0 : _context.t1.message) || 'Error');
|
|
1474
1556
|
}
|
|
1475
1557
|
|
|
1476
|
-
case
|
|
1558
|
+
case 26:
|
|
1477
1559
|
case "end":
|
|
1478
1560
|
return _context.stop();
|
|
1479
1561
|
}
|
|
1480
1562
|
}
|
|
1481
|
-
}, _callee, null, [[1,
|
|
1563
|
+
}, _callee, null, [[1, 23], [6, 13]]);
|
|
1482
1564
|
}));
|
|
1483
1565
|
|
|
1484
1566
|
function onSubmit(_x) {
|
|
@@ -1575,7 +1657,7 @@ var RegisterModal = function RegisterModal(_ref) {
|
|
|
1575
1657
|
},
|
|
1576
1658
|
onSubmit: function () {
|
|
1577
1659
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1578
|
-
var firstName, lastName, email, password, confirmPassword, bodyFormData,
|
|
1660
|
+
var firstName, lastName, email, password, confirmPassword, bodyFormData, profileResponse, profileSpecifiedData, profileDataObj;
|
|
1579
1661
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1580
1662
|
while (1) {
|
|
1581
1663
|
switch (_context.prev = _context.next) {
|
|
@@ -1593,27 +1675,24 @@ var RegisterModal = function RegisterModal(_ref) {
|
|
|
1593
1675
|
return register(bodyFormData);
|
|
1594
1676
|
|
|
1595
1677
|
case 11:
|
|
1596
|
-
resRegister = _context.sent;
|
|
1597
|
-
access_token = _get(resRegister, 'data.data.attributes.access_token');
|
|
1598
|
-
handleSetAccessToken(access_token);
|
|
1599
1678
|
profileResponse = null;
|
|
1600
|
-
_context.prev =
|
|
1601
|
-
_context.next =
|
|
1602
|
-
return getProfileData(
|
|
1679
|
+
_context.prev = 12;
|
|
1680
|
+
_context.next = 15;
|
|
1681
|
+
return getProfileData();
|
|
1603
1682
|
|
|
1604
|
-
case
|
|
1683
|
+
case 15:
|
|
1605
1684
|
profileResponse = _context.sent;
|
|
1606
1685
|
onGetProfileDataSuccess(profileResponse.data);
|
|
1607
|
-
_context.next =
|
|
1686
|
+
_context.next = 23;
|
|
1608
1687
|
break;
|
|
1609
1688
|
|
|
1610
|
-
case
|
|
1611
|
-
_context.prev =
|
|
1612
|
-
_context.t0 = _context["catch"](
|
|
1689
|
+
case 19:
|
|
1690
|
+
_context.prev = 19;
|
|
1691
|
+
_context.t0 = _context["catch"](12);
|
|
1613
1692
|
onGetProfileDataError(_context.t0.response);
|
|
1614
1693
|
return _context.abrupt("return");
|
|
1615
1694
|
|
|
1616
|
-
case
|
|
1695
|
+
case 23:
|
|
1617
1696
|
profileSpecifiedData = _get(profileResponse, 'data.data');
|
|
1618
1697
|
profileDataObj = {
|
|
1619
1698
|
id: profileSpecifiedData.id,
|
|
@@ -1623,18 +1702,17 @@ var RegisterModal = function RegisterModal(_ref) {
|
|
|
1623
1702
|
};
|
|
1624
1703
|
|
|
1625
1704
|
if (typeof window !== 'undefined') {
|
|
1626
|
-
window.localStorage.setItem('access_token', access_token);
|
|
1627
1705
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
1628
1706
|
}
|
|
1629
1707
|
|
|
1630
1708
|
onClose();
|
|
1631
1709
|
|
|
1632
|
-
case
|
|
1710
|
+
case 27:
|
|
1633
1711
|
case "end":
|
|
1634
1712
|
return _context.stop();
|
|
1635
1713
|
}
|
|
1636
1714
|
}
|
|
1637
|
-
}, _callee, null, [[
|
|
1715
|
+
}, _callee, null, [[12, 19]]);
|
|
1638
1716
|
}));
|
|
1639
1717
|
|
|
1640
1718
|
function onSubmit(_x) {
|
|
@@ -1788,6 +1866,7 @@ var createRegisterFormData = function createRegisterFormData(values, checkoutBod
|
|
|
1788
1866
|
bodyFormData.append('password_confirmation', values.confirmPassword);
|
|
1789
1867
|
bodyFormData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
1790
1868
|
bodyFormData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
1869
|
+
bodyFormData.append('check_cart_expiration', 'true');
|
|
1791
1870
|
|
|
1792
1871
|
_forEach(checkoutBody.attributes, function (item, key) {
|
|
1793
1872
|
bodyFormData.append(key, item);
|
|
@@ -1803,7 +1882,7 @@ var setLoggedUserData = function setLoggedUserData(data) {
|
|
|
1803
1882
|
email: data.email,
|
|
1804
1883
|
confirmEmail: data.email,
|
|
1805
1884
|
city: (data == null ? void 0 : data.city) || '',
|
|
1806
|
-
country: (data == null ? void 0 : data.country) || '',
|
|
1885
|
+
country: (data == null ? void 0 : data.countryId) || (data == null ? void 0 : data.country) || '',
|
|
1807
1886
|
phone: (data == null ? void 0 : data.phone) || '',
|
|
1808
1887
|
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
1809
1888
|
state: (data == null ? void 0 : data.stateId) || '',
|
|
@@ -1849,10 +1928,10 @@ var createCheckoutDataBody = function createCheckoutDataBody(ticketsQuantity, va
|
|
|
1849
1928
|
});
|
|
1850
1929
|
ticket_holders = filteredHolders.map(function (item, index) {
|
|
1851
1930
|
return {
|
|
1852
|
-
first_name: item["holderFirstName-" + index] || '',
|
|
1853
|
-
last_name: item["holderLastName-" + index] || '',
|
|
1931
|
+
first_name: !index ? item["holderFirstName-" + index] || logedInValues.firstNameLogged || '' : item["holderFirstName-" + index] || '',
|
|
1932
|
+
last_name: !index ? item["holderLastName-" + index] || logedInValues.lastNameLogged || '' : item["holderLastName-" + index] || '',
|
|
1854
1933
|
phone: item["holderPhone-" + index] || '',
|
|
1855
|
-
email: item["holderEmail-" + index] || ''
|
|
1934
|
+
email: !index ? item["holderEmail-" + index] || logedInValues.emailLogged || '' : item["holderEmail-" + index] || ''
|
|
1856
1935
|
};
|
|
1857
1936
|
});
|
|
1858
1937
|
var filteredRestValue = {};
|
|
@@ -1903,6 +1982,14 @@ var getValidateFunctions = function getValidateFunctions(element, states, values
|
|
|
1903
1982
|
validationFunctions.push(isSameEmail);
|
|
1904
1983
|
}
|
|
1905
1984
|
|
|
1985
|
+
if (element.name === 'confirmPassword') {
|
|
1986
|
+
var isSame = function isSame(confirmPassword) {
|
|
1987
|
+
return values.password !== confirmPassword ? 'Password confirmation does not match' : null;
|
|
1988
|
+
};
|
|
1989
|
+
|
|
1990
|
+
validationFunctions.push(isSame);
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1906
1993
|
return combineValidators.apply(void 0, validationFunctions);
|
|
1907
1994
|
};
|
|
1908
1995
|
var assingUniqueIds = function assingUniqueIds(data) {
|
|
@@ -1954,13 +2041,21 @@ var CustomField = function CustomField(_ref) {
|
|
|
1954
2041
|
touched = _ref$form.touched,
|
|
1955
2042
|
errors = _ref$form.errors,
|
|
1956
2043
|
submitCount = _ref$form.submitCount,
|
|
1957
|
-
theme = _ref.theme
|
|
2044
|
+
theme = _ref.theme,
|
|
2045
|
+
_ref$inputProps = _ref.inputProps,
|
|
2046
|
+
pInputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
|
|
2047
|
+
_ref$InputProps = _ref.InputProps,
|
|
2048
|
+
InputProps = _ref$InputProps === void 0 ? {} : _ref$InputProps,
|
|
2049
|
+
inputRef = _ref.inputRef;
|
|
1958
2050
|
var isSelectField = type === 'select';
|
|
1959
2051
|
|
|
1960
2052
|
var error = _get(errors, field.name);
|
|
1961
2053
|
|
|
1962
2054
|
var isTouched = Boolean(_get(touched, field.name)) || _includes(field.name, 'holder') && !!error && !!submitCount;
|
|
1963
2055
|
var customTheme = useTheme();
|
|
2056
|
+
var inputProps = {
|
|
2057
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
2058
|
+
};
|
|
1964
2059
|
return React.createElement(TextField$1, Object.assign({
|
|
1965
2060
|
id: field.name,
|
|
1966
2061
|
label: label,
|
|
@@ -1977,12 +2072,11 @@ var CustomField = function CustomField(_ref) {
|
|
|
1977
2072
|
}
|
|
1978
2073
|
},
|
|
1979
2074
|
InputLabelProps: {
|
|
1980
|
-
sx: customTheme == null ? void 0 : customTheme.input,
|
|
1981
|
-
shrink: field.name === 'holderAge' ? true : undefined
|
|
1982
|
-
},
|
|
1983
|
-
inputProps: {
|
|
1984
2075
|
sx: customTheme == null ? void 0 : customTheme.input
|
|
1985
|
-
}
|
|
2076
|
+
},
|
|
2077
|
+
InputProps: InputProps,
|
|
2078
|
+
inputProps: _extends({}, inputProps, pInputProps),
|
|
2079
|
+
inputRef: inputRef
|
|
1986
2080
|
}, field), isSelectField ? _map(selectOptions, function (option) {
|
|
1987
2081
|
return React.createElement("option", {
|
|
1988
2082
|
key: option.value,
|
|
@@ -2160,6 +2254,209 @@ var SelectField = function SelectField(_ref) {
|
|
|
2160
2254
|
}, error) : null);
|
|
2161
2255
|
};
|
|
2162
2256
|
|
|
2257
|
+
var showZero = function showZero(value) {
|
|
2258
|
+
if (value === void 0) {
|
|
2259
|
+
value = 0;
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2262
|
+
var intNumber = Number(value);
|
|
2263
|
+
return _isNumber(intNumber) ? intNumber >= 0 && intNumber < 10 ? '0' + intNumber : intNumber : null;
|
|
2264
|
+
};
|
|
2265
|
+
|
|
2266
|
+
var getImage = function getImage(name) {
|
|
2267
|
+
if (name === void 0) {
|
|
2268
|
+
name = '';
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
var image = '';
|
|
2272
|
+
|
|
2273
|
+
if (!name.trim().length) {
|
|
2274
|
+
return image;
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
if (process.env.NODE_ENV === 'production') {
|
|
2278
|
+
image = require("./images/" + name);
|
|
2279
|
+
return image["default"];
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
return image;
|
|
2283
|
+
};
|
|
2284
|
+
|
|
2285
|
+
var TimerWidget = function TimerWidget(_ref) {
|
|
2286
|
+
var expires_at = _ref.expires_at,
|
|
2287
|
+
buyLoading = _ref.buyLoading,
|
|
2288
|
+
_ref$onCountdownFinis = _ref.onCountdownFinish,
|
|
2289
|
+
onCountdownFinish = _ref$onCountdownFinis === void 0 ? function () {} : _ref$onCountdownFinis;
|
|
2290
|
+
|
|
2291
|
+
var _useState = useState(true),
|
|
2292
|
+
showTimer = _useState[0],
|
|
2293
|
+
setShowTimer = _useState[1];
|
|
2294
|
+
|
|
2295
|
+
var handleCountdownFinish = function handleCountdownFinish() {
|
|
2296
|
+
setShowTimer(false);
|
|
2297
|
+
|
|
2298
|
+
if (!buyLoading) {
|
|
2299
|
+
onCountdownFinish();
|
|
2300
|
+
}
|
|
2301
|
+
};
|
|
2302
|
+
|
|
2303
|
+
var _renderer = function renderer(_ref2) {
|
|
2304
|
+
var minutes = _ref2.minutes,
|
|
2305
|
+
seconds = _ref2.seconds,
|
|
2306
|
+
completed = _ref2.completed,
|
|
2307
|
+
handleCountdownFinish = _ref2.handleCountdownFinish;
|
|
2308
|
+
|
|
2309
|
+
if (completed) {
|
|
2310
|
+
handleCountdownFinish();
|
|
2311
|
+
return null;
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
return React.createElement("span", null, showZero(minutes), ":", showZero(seconds));
|
|
2315
|
+
};
|
|
2316
|
+
|
|
2317
|
+
var hideTimer = function hideTimer() {
|
|
2318
|
+
var timerRl = document.querySelector('.timer');
|
|
2319
|
+
|
|
2320
|
+
if (timerRl) {
|
|
2321
|
+
timerRl.style.visibility = "hidden";
|
|
2322
|
+
}
|
|
2323
|
+
};
|
|
2324
|
+
|
|
2325
|
+
return showTimer && !!expires_at ? React.createElement("div", {
|
|
2326
|
+
className: "timer"
|
|
2327
|
+
}, React.createElement("div", {
|
|
2328
|
+
className: 'close-icon',
|
|
2329
|
+
onClick: hideTimer
|
|
2330
|
+
}, React.createElement(SVG, {
|
|
2331
|
+
src: getImage('cross.svg'),
|
|
2332
|
+
width: '10',
|
|
2333
|
+
height: '10',
|
|
2334
|
+
fill: '#fff'
|
|
2335
|
+
})), React.createElement("div", {
|
|
2336
|
+
className: "toast-message"
|
|
2337
|
+
}, React.createElement("p", null, "Please complete your purchase before the timer reaches zero."), React.createElement("p", {
|
|
2338
|
+
className: "countdown"
|
|
2339
|
+
}, React.createElement(Countdown$1, {
|
|
2340
|
+
date: Date.now() + expires_at * 1000,
|
|
2341
|
+
renderer: function renderer(props) {
|
|
2342
|
+
return _renderer(_extends({}, props, {
|
|
2343
|
+
handleCountdownFinish: handleCountdownFinish
|
|
2344
|
+
}));
|
|
2345
|
+
}
|
|
2346
|
+
})))) : null;
|
|
2347
|
+
};
|
|
2348
|
+
|
|
2349
|
+
var TimerWidget$1 = /*#__PURE__*/memo(TimerWidget);
|
|
2350
|
+
|
|
2351
|
+
var SnackbarAlert = function SnackbarAlert(_ref) {
|
|
2352
|
+
var isOpen = _ref.isOpen,
|
|
2353
|
+
message = _ref.message,
|
|
2354
|
+
type = _ref.type,
|
|
2355
|
+
position = _ref.position,
|
|
2356
|
+
_ref$autoHideDuration = _ref.autoHideDuration,
|
|
2357
|
+
autoHideDuration = _ref$autoHideDuration === void 0 ? 3000 : _ref$autoHideDuration,
|
|
2358
|
+
variant = _ref.variant,
|
|
2359
|
+
onClose = _ref.onClose;
|
|
2360
|
+
return React.createElement("div", {
|
|
2361
|
+
className: "snackbar-alert-container"
|
|
2362
|
+
}, React.createElement(Snackbar, {
|
|
2363
|
+
autoHideDuration: autoHideDuration,
|
|
2364
|
+
open: isOpen,
|
|
2365
|
+
anchorOrigin: position || {
|
|
2366
|
+
vertical: 'top',
|
|
2367
|
+
horizontal: 'center'
|
|
2368
|
+
},
|
|
2369
|
+
onClose: onClose,
|
|
2370
|
+
classes: {
|
|
2371
|
+
root: 'snackbar-alert-snackbar-root'
|
|
2372
|
+
}
|
|
2373
|
+
}, React.createElement(Alert, {
|
|
2374
|
+
severity: type,
|
|
2375
|
+
onClose: onClose,
|
|
2376
|
+
variant: variant || 'filled',
|
|
2377
|
+
classes: {
|
|
2378
|
+
icon: 'snackbar-alert-icon',
|
|
2379
|
+
root: 'snackbar-alert-alert-root',
|
|
2380
|
+
action: 'snackbar-alert-action',
|
|
2381
|
+
message: 'snackbar-alert-message',
|
|
2382
|
+
filled: 'snackbar-alert-filled'
|
|
2383
|
+
}
|
|
2384
|
+
}, message)));
|
|
2385
|
+
};
|
|
2386
|
+
|
|
2387
|
+
var DATE_SIZE = 32;
|
|
2388
|
+
var compactStyles = {
|
|
2389
|
+
'& > div': {
|
|
2390
|
+
minWidth: 256
|
|
2391
|
+
},
|
|
2392
|
+
'& > div > div, & > div > div > div, & .MuiCalendarPicker-root': {
|
|
2393
|
+
width: 256
|
|
2394
|
+
},
|
|
2395
|
+
'& .MuiTypography-caption': {
|
|
2396
|
+
width: DATE_SIZE,
|
|
2397
|
+
margin: 0
|
|
2398
|
+
},
|
|
2399
|
+
'& .PrivatePickersSlideTransition-root': {
|
|
2400
|
+
minHeight: DATE_SIZE * 6
|
|
2401
|
+
},
|
|
2402
|
+
'& .PrivatePickersSlideTransition-root [role="row"]': {
|
|
2403
|
+
margin: 0
|
|
2404
|
+
},
|
|
2405
|
+
'& .MuiPickersDay-dayWithMargin': {
|
|
2406
|
+
margin: 0
|
|
2407
|
+
},
|
|
2408
|
+
'& .MuiPickersDay-root': {
|
|
2409
|
+
width: DATE_SIZE,
|
|
2410
|
+
height: DATE_SIZE
|
|
2411
|
+
}
|
|
2412
|
+
};
|
|
2413
|
+
var compactStyleTheme = /*#__PURE__*/createTheme({
|
|
2414
|
+
components: {
|
|
2415
|
+
MuiPaper: {
|
|
2416
|
+
defaultProps: {
|
|
2417
|
+
sx: compactStyles
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
});
|
|
2422
|
+
var DatePickerField = function DatePickerField(_ref) {
|
|
2423
|
+
var label = _ref.label,
|
|
2424
|
+
field = _ref.field,
|
|
2425
|
+
form = _ref.form,
|
|
2426
|
+
theme = _ref.theme,
|
|
2427
|
+
_ref$useCompact = _ref.useCompact,
|
|
2428
|
+
useCompact = _ref$useCompact === void 0 ? true : _ref$useCompact;
|
|
2429
|
+
return React.createElement(ThemeProvider, {
|
|
2430
|
+
theme: useCompact ? compactStyleTheme : {}
|
|
2431
|
+
}, React.createElement(LocalizationProvider, {
|
|
2432
|
+
dateAdapter: AdapterMoment
|
|
2433
|
+
}, React.createElement(DatePicker, {
|
|
2434
|
+
value: field.value || '',
|
|
2435
|
+
onChange: function onChange(value) {
|
|
2436
|
+
return form.setFieldValue(field.name, value);
|
|
2437
|
+
},
|
|
2438
|
+
PopperProps: {
|
|
2439
|
+
placement: 'bottom-start'
|
|
2440
|
+
},
|
|
2441
|
+
showDaysOutsideCurrentMonth: true,
|
|
2442
|
+
disableFuture: true,
|
|
2443
|
+
inputFormat: "DD/MM/YYYY",
|
|
2444
|
+
mask: "__/__/____",
|
|
2445
|
+
renderInput: function renderInput(params) {
|
|
2446
|
+
return React.createElement(CustomField, Object.assign({}, params, {
|
|
2447
|
+
inputProps: _extends({}, params.inputProps, {
|
|
2448
|
+
placeholder: 'dd/mm/yyyy'
|
|
2449
|
+
}),
|
|
2450
|
+
theme: theme,
|
|
2451
|
+
field: field,
|
|
2452
|
+
form: form,
|
|
2453
|
+
label: label,
|
|
2454
|
+
type: "tel"
|
|
2455
|
+
}));
|
|
2456
|
+
}
|
|
2457
|
+
})));
|
|
2458
|
+
};
|
|
2459
|
+
|
|
2163
2460
|
var LogicRunner = function LogicRunner(_ref) {
|
|
2164
2461
|
var values = _ref.values,
|
|
2165
2462
|
setStates = _ref.setStates,
|
|
@@ -2167,7 +2464,8 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2167
2464
|
setValues = _ref.setValues,
|
|
2168
2465
|
setUserValues = _ref.setUserValues,
|
|
2169
2466
|
onGetStatesSuccess = _ref.onGetStatesSuccess,
|
|
2170
|
-
onGetStatesError = _ref.onGetStatesError
|
|
2467
|
+
onGetStatesError = _ref.onGetStatesError,
|
|
2468
|
+
shouldFetchCountries = _ref.shouldFetchCountries;
|
|
2171
2469
|
var prevCountry = useRef(values.country);
|
|
2172
2470
|
useEffect(function () {
|
|
2173
2471
|
var fetchStates = /*#__PURE__*/function () {
|
|
@@ -2222,7 +2520,7 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2222
2520
|
};
|
|
2223
2521
|
}();
|
|
2224
2522
|
|
|
2225
|
-
fetchStates();
|
|
2523
|
+
shouldFetchCountries && fetchStates();
|
|
2226
2524
|
}, [values.country, setStates, setFieldValue]);
|
|
2227
2525
|
var userDataEncoded = typeof window !== 'undefined' ? window.localStorage.getItem('user_data') : '';
|
|
2228
2526
|
useEffect(function () {
|
|
@@ -2233,8 +2531,8 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2233
2531
|
try {
|
|
2234
2532
|
var parsedData = JSON.parse(userDataEncoded);
|
|
2235
2533
|
var mappedValues = {
|
|
2236
|
-
firstName: (parsedData == null ? void 0 : parsedData.first_name) || '',
|
|
2237
|
-
lastName: (parsedData == null ? void 0 : parsedData.last_name) || '',
|
|
2534
|
+
firstName: (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
|
|
2535
|
+
lastName: (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
|
|
2238
2536
|
email: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
2239
2537
|
phone: (parsedData == null ? void 0 : parsedData.phone) || '',
|
|
2240
2538
|
confirmEmail: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
@@ -2242,15 +2540,15 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2242
2540
|
street_address: (parsedData == null ? void 0 : parsedData.street_address) || '',
|
|
2243
2541
|
country: (parsedData == null ? void 0 : parsedData.country) || '1',
|
|
2244
2542
|
zip: (parsedData == null ? void 0 : parsedData.zip) || '',
|
|
2245
|
-
brand_opt_in: (parsedData == null ? void 0 : parsedData.brand_opt_in) ||
|
|
2543
|
+
brand_opt_in: (parsedData == null ? void 0 : parsedData.brand_opt_in) || false,
|
|
2246
2544
|
city: (parsedData == null ? void 0 : parsedData.city) || '',
|
|
2247
2545
|
confirmPassword: '',
|
|
2248
2546
|
password: '',
|
|
2249
|
-
'holderFirstName-0': (parsedData == null ? void 0 : parsedData.first_name) || '',
|
|
2250
|
-
'holderLastName-0': (parsedData == null ? void 0 : parsedData.last_name) || '',
|
|
2547
|
+
'holderFirstName-0': (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
|
|
2548
|
+
'holderLastName-0': (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
|
|
2251
2549
|
'holderEmail-0': (parsedData == null ? void 0 : parsedData.email) || ''
|
|
2252
2550
|
};
|
|
2253
|
-
setValues(mappedValues);
|
|
2551
|
+
setValues(_extends({}, values, mappedValues));
|
|
2254
2552
|
setUserValues(mappedValues);
|
|
2255
2553
|
} catch (e) {}
|
|
2256
2554
|
}
|
|
@@ -2322,7 +2620,13 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2322
2620
|
_ref3$skipPage = _ref3.skipPage,
|
|
2323
2621
|
skipPage = _ref3$skipPage === void 0 ? false : _ref3$skipPage,
|
|
2324
2622
|
_ref3$canSkipHolderNa = _ref3.canSkipHolderNames,
|
|
2325
|
-
canSkipHolderNames = _ref3$canSkipHolderNa === void 0 ? false : _ref3$canSkipHolderNa
|
|
2623
|
+
canSkipHolderNames = _ref3$canSkipHolderNa === void 0 ? false : _ref3$canSkipHolderNa,
|
|
2624
|
+
_ref3$shouldFetchCoun = _ref3.shouldFetchCountries,
|
|
2625
|
+
shouldFetchCountries = _ref3$shouldFetchCoun === void 0 ? true : _ref3$shouldFetchCoun,
|
|
2626
|
+
_ref3$onCountdownFini = _ref3.onCountdownFinish,
|
|
2627
|
+
onCountdownFinish = _ref3$onCountdownFini === void 0 ? function () {} : _ref3$onCountdownFini,
|
|
2628
|
+
_ref3$enableTimer = _ref3.enableTimer,
|
|
2629
|
+
enableTimer = _ref3$enableTimer === void 0 ? false : _ref3$enableTimer;
|
|
2326
2630
|
|
|
2327
2631
|
var themeMui = createTheme(themeOptions);
|
|
2328
2632
|
var isWindowDefined = typeof window !== 'undefined';
|
|
@@ -2333,7 +2637,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2333
2637
|
dataWithUniqueIds = _useState[0],
|
|
2334
2638
|
setDataWithUniqueIds = _useState[1];
|
|
2335
2639
|
|
|
2336
|
-
var
|
|
2640
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
2641
|
+
|
|
2642
|
+
var _useState2 = useState(!!(pIsLoggedIn || xtfCookie)),
|
|
2337
2643
|
isLoggedIn = _useState2[0],
|
|
2338
2644
|
setIsLoggedIn = _useState2[1];
|
|
2339
2645
|
|
|
@@ -2411,6 +2717,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2411
2717
|
|
|
2412
2718
|
var hideTtfOptIn = _get(cartInfoData, 'hide_ttf_opt_in', true);
|
|
2413
2719
|
|
|
2720
|
+
var expirationTime = _get(cartInfoData, 'expiresAt');
|
|
2721
|
+
|
|
2414
2722
|
var flagRequirePhone = getQueryVariable('phone_required') === 'true'; // Get prevProps
|
|
2415
2723
|
|
|
2416
2724
|
var prevData = useRef(data);
|
|
@@ -2441,10 +2749,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2441
2749
|
};
|
|
2442
2750
|
|
|
2443
2751
|
useEffect(function () {
|
|
2444
|
-
if (
|
|
2445
|
-
setIsLoggedIn(
|
|
2752
|
+
if (pIsLoggedIn !== isLoggedIn || xtfCookie) {
|
|
2753
|
+
setIsLoggedIn(!!(pIsLoggedIn || xtfCookie));
|
|
2446
2754
|
}
|
|
2447
|
-
}, [pIsLoggedIn, isLoggedIn,
|
|
2755
|
+
}, [pIsLoggedIn, isLoggedIn, xtfCookie]); //just once
|
|
2448
2756
|
|
|
2449
2757
|
useEffect(function () {
|
|
2450
2758
|
// fetch countries data
|
|
@@ -2493,7 +2801,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2493
2801
|
};
|
|
2494
2802
|
}();
|
|
2495
2803
|
|
|
2496
|
-
fetchCountries();
|
|
2804
|
+
shouldFetchCountries && fetchCountries();
|
|
2497
2805
|
fetchCart();
|
|
2498
2806
|
}, []); // fetch cart data
|
|
2499
2807
|
|
|
@@ -2553,7 +2861,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2553
2861
|
case 0:
|
|
2554
2862
|
_context4.prev = 0;
|
|
2555
2863
|
|
|
2556
|
-
if (!(isWindowDefined && token)) {
|
|
2864
|
+
if (!(isWindowDefined && token || isLoggedIn)) {
|
|
2557
2865
|
_context4.next = 10;
|
|
2558
2866
|
break;
|
|
2559
2867
|
}
|
|
@@ -2600,7 +2908,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2600
2908
|
|
|
2601
2909
|
useEffect(function () {
|
|
2602
2910
|
fetchUserData(access_token);
|
|
2603
|
-
}, [access_token]);
|
|
2911
|
+
}, [access_token, isLoggedIn]);
|
|
2604
2912
|
useEffect(function () {
|
|
2605
2913
|
var collectPaymentData = /*#__PURE__*/function () {
|
|
2606
2914
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
|
|
@@ -2610,7 +2918,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2610
2918
|
switch (_context5.prev = _context5.next) {
|
|
2611
2919
|
case 0:
|
|
2612
2920
|
if (!(skipPage && !_isEmpty(ticketsQuantity) && !showDOB)) {
|
|
2613
|
-
_context5.next =
|
|
2921
|
+
_context5.next = 17;
|
|
2614
2922
|
break;
|
|
2615
2923
|
}
|
|
2616
2924
|
|
|
@@ -2622,29 +2930,30 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2622
2930
|
|
|
2623
2931
|
case 6:
|
|
2624
2932
|
res = _context5.sent;
|
|
2933
|
+
removeReferralKey();
|
|
2625
2934
|
onSkipBillingPage(_get(res, 'data.data.attributes'));
|
|
2626
2935
|
setLoading(false);
|
|
2627
|
-
_context5.next =
|
|
2936
|
+
_context5.next = 15;
|
|
2628
2937
|
break;
|
|
2629
2938
|
|
|
2630
|
-
case
|
|
2631
|
-
_context5.prev =
|
|
2939
|
+
case 12:
|
|
2940
|
+
_context5.prev = 12;
|
|
2632
2941
|
_context5.t0 = _context5["catch"](3);
|
|
2633
2942
|
onSubmitError(_context5.t0);
|
|
2634
2943
|
|
|
2635
|
-
case
|
|
2636
|
-
_context5.next =
|
|
2944
|
+
case 15:
|
|
2945
|
+
_context5.next = 18;
|
|
2637
2946
|
break;
|
|
2638
2947
|
|
|
2639
|
-
case
|
|
2948
|
+
case 17:
|
|
2640
2949
|
setLoading(false);
|
|
2641
2950
|
|
|
2642
|
-
case
|
|
2951
|
+
case 18:
|
|
2643
2952
|
case "end":
|
|
2644
2953
|
return _context5.stop();
|
|
2645
2954
|
}
|
|
2646
2955
|
}
|
|
2647
|
-
}, _callee5, null, [[3,
|
|
2956
|
+
}, _callee5, null, [[3, 12]]);
|
|
2648
2957
|
}));
|
|
2649
2958
|
|
|
2650
2959
|
return function collectPaymentData() {
|
|
@@ -2655,47 +2964,62 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2655
2964
|
collectPaymentData();
|
|
2656
2965
|
}, [skipPage, ticketsQuantity]);
|
|
2657
2966
|
|
|
2658
|
-
var collectCheckoutBody = function collectCheckoutBody(values) {
|
|
2967
|
+
var collectCheckoutBody = function collectCheckoutBody(values, profileData) {
|
|
2659
2968
|
var checkoutBody = {}; // Auto collect ticket holders name when it was skipped optionally
|
|
2660
2969
|
|
|
2661
2970
|
if (showDOB && !showTicketHolders && canSkipHolderNames) {
|
|
2662
|
-
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity.length, values, true
|
|
2663
|
-
} else {
|
|
2664
|
-
checkoutBody = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
2971
|
+
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity.length, values, true, {
|
|
2665
2972
|
emailLogged: emailLogged,
|
|
2666
2973
|
firstNameLogged: firstNameLogged,
|
|
2667
2974
|
lastNameLogged: lastNameLogged
|
|
2668
|
-
}
|
|
2975
|
+
});
|
|
2976
|
+
} else {
|
|
2977
|
+
checkoutBody = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
2978
|
+
emailLogged: emailLogged || profileData.email,
|
|
2979
|
+
firstNameLogged: firstNameLogged || profileData.first_name || profileData.firstName,
|
|
2980
|
+
lastNameLogged: lastNameLogged || profileData.last_name || profileData.lastName
|
|
2981
|
+
}, showDOB);
|
|
2669
2982
|
}
|
|
2670
2983
|
|
|
2671
2984
|
return checkoutBody;
|
|
2672
|
-
};
|
|
2985
|
+
};
|
|
2673
2986
|
|
|
2987
|
+
var removeReferralKey = function removeReferralKey() {
|
|
2988
|
+
localStorage.removeItem('referral_key');
|
|
2989
|
+
};
|
|
2674
2990
|
|
|
2675
|
-
if (loading) {
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
open: true
|
|
2681
|
-
}, React.createElement(CircularProgress$1, {
|
|
2682
|
-
color: "inherit"
|
|
2683
|
-
}));
|
|
2991
|
+
if (loading || enableTimer && !expirationTime && typeof window !== 'undefined') {
|
|
2992
|
+
if (expirationTime === 0) {
|
|
2993
|
+
// Redirect to homepage (countdown finished and browser reloaded case)
|
|
2994
|
+
window.location.href = '/';
|
|
2995
|
+
}
|
|
2684
2996
|
}
|
|
2685
2997
|
|
|
2686
2998
|
return React.createElement(ThemeProvider, {
|
|
2687
2999
|
theme: themeMui
|
|
2688
|
-
}, React.createElement(
|
|
3000
|
+
}, loading && React.createElement(Backdrop, {
|
|
3001
|
+
sx: {
|
|
3002
|
+
color: '#fff',
|
|
3003
|
+
backgroundColor: '#000000bd',
|
|
3004
|
+
zIndex: 1205
|
|
3005
|
+
},
|
|
3006
|
+
open: true
|
|
3007
|
+
}, React.createElement(CircularProgress$1, {
|
|
3008
|
+
color: "inherit"
|
|
3009
|
+
})), !!expirationTime && enableTimer && React.createElement(TimerWidget$1, {
|
|
3010
|
+
expires_at: expirationTime,
|
|
3011
|
+
onCountdownFinish: onCountdownFinish
|
|
3012
|
+
}), React.createElement(Formik, {
|
|
2689
3013
|
initialValues: getInitialValues(dataWithUniqueIds, _extends({}, initialValues, {
|
|
2690
3014
|
country: _get(userData, 'country', '') || '1',
|
|
2691
3015
|
state: _get(userData, 'state', '') || '1',
|
|
2692
3016
|
brand_opt_in: optedInFieldValue,
|
|
2693
3017
|
ttf_opt_in: ttfOptIn
|
|
2694
3018
|
}), userValues),
|
|
2695
|
-
enableReinitialize:
|
|
3019
|
+
enableReinitialize: false,
|
|
2696
3020
|
onSubmit: function () {
|
|
2697
3021
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(values, formikHelpers) {
|
|
2698
|
-
var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, checkoutBodyForRegistration, bodyFormData,
|
|
3022
|
+
var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, checkoutBodyForRegistration, bodyFormData, resRegister, _xtfCookie, accessToken, refreshToken, userProfile, _e$response, _e$response$data, _error, profileData, profileSpecifiedData, profileDataObj, checkoutBody, res, _e$response2, _e$response3;
|
|
2699
3023
|
|
|
2700
3024
|
return runtime_1.wrap(function _callee6$(_context6) {
|
|
2701
3025
|
while (1) {
|
|
@@ -2704,7 +3028,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2704
3028
|
_context6.prev = 0;
|
|
2705
3029
|
|
|
2706
3030
|
if (!isLoggedIn) {
|
|
2707
|
-
_context6.next =
|
|
3031
|
+
_context6.next = 16;
|
|
2708
3032
|
break;
|
|
2709
3033
|
}
|
|
2710
3034
|
|
|
@@ -2726,43 +3050,47 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2726
3050
|
}
|
|
2727
3051
|
|
|
2728
3052
|
case 9:
|
|
2729
|
-
_checkoutBody = collectCheckoutBody(values);
|
|
3053
|
+
_checkoutBody = collectCheckoutBody(values, userData);
|
|
2730
3054
|
_context6.next = 12;
|
|
2731
3055
|
return postOnCheckout(_checkoutBody, access_token);
|
|
2732
3056
|
|
|
2733
3057
|
case 12:
|
|
2734
3058
|
_res = _context6.sent;
|
|
3059
|
+
removeReferralKey();
|
|
2735
3060
|
handleSubmit(values, formikHelpers, eventId, _res);
|
|
2736
3061
|
return _context6.abrupt("return");
|
|
2737
3062
|
|
|
2738
|
-
case
|
|
3063
|
+
case 16:
|
|
2739
3064
|
checkoutBodyForRegistration = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
2740
3065
|
emailLogged: emailLogged,
|
|
2741
3066
|
firstNameLogged: firstNameLogged,
|
|
2742
3067
|
lastNameLogged: lastNameLogged
|
|
2743
3068
|
}, showDOB);
|
|
2744
3069
|
bodyFormData = createRegisterFormData(values, checkoutBodyForRegistration);
|
|
2745
|
-
access_token_register = null;
|
|
2746
3070
|
_context6.prev = 18;
|
|
2747
|
-
|
|
3071
|
+
setLoading(true);
|
|
3072
|
+
_context6.next = 22;
|
|
2748
3073
|
return register(bodyFormData);
|
|
2749
3074
|
|
|
2750
|
-
case
|
|
3075
|
+
case 22:
|
|
2751
3076
|
resRegister = _context6.sent;
|
|
2752
|
-
|
|
3077
|
+
_xtfCookie = _get(resRegister, 'headers.x-tf-ecommerce');
|
|
3078
|
+
accessToken = _get(resRegister, 'data.data.attributes.access_token');
|
|
2753
3079
|
refreshToken = _get(resRegister, 'data.data.attributes.refresh_token');
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
3080
|
+
userProfile = _get(resRegister, 'data.data.attributes.user_profile');
|
|
3081
|
+
onRegisterSuccess({
|
|
3082
|
+
xtfCookie: _xtfCookie,
|
|
3083
|
+
accessToken: accessToken,
|
|
3084
|
+
refreshToken: refreshToken,
|
|
3085
|
+
userProfile: userProfile
|
|
3086
|
+
});
|
|
3087
|
+
_context6.next = 35;
|
|
2761
3088
|
break;
|
|
2762
3089
|
|
|
2763
|
-
case
|
|
2764
|
-
_context6.prev =
|
|
3090
|
+
case 30:
|
|
3091
|
+
_context6.prev = 30;
|
|
2765
3092
|
_context6.t0 = _context6["catch"](18);
|
|
3093
|
+
setLoading(false);
|
|
2766
3094
|
|
|
2767
3095
|
if (axios.isAxiosError(_context6.t0)) {
|
|
2768
3096
|
_error = _context6.t0 == null ? void 0 : (_e$response = _context6.t0.response) == null ? void 0 : (_e$response$data = _e$response.data) == null ? void 0 : _e$response$data.message;
|
|
@@ -2782,16 +3110,20 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2782
3110
|
setShowModalLogin(true);
|
|
2783
3111
|
}
|
|
2784
3112
|
|
|
3113
|
+
if (_includes(_error, 'The cart is expired') && !hideErrorsAlertSection) {
|
|
3114
|
+
setError(_error);
|
|
3115
|
+
}
|
|
3116
|
+
|
|
2785
3117
|
onRegisterError(_context6.t0, values.email);
|
|
2786
3118
|
}
|
|
2787
3119
|
|
|
2788
3120
|
return _context6.abrupt("return");
|
|
2789
3121
|
|
|
2790
|
-
case 33:
|
|
2791
|
-
_context6.next = 35;
|
|
2792
|
-
return getProfileData(access_token_register);
|
|
2793
|
-
|
|
2794
3122
|
case 35:
|
|
3123
|
+
_context6.next = 37;
|
|
3124
|
+
return getProfileData();
|
|
3125
|
+
|
|
3126
|
+
case 37:
|
|
2795
3127
|
profileData = _context6.sent;
|
|
2796
3128
|
profileSpecifiedData = _get(profileData, 'data.data');
|
|
2797
3129
|
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
@@ -2800,19 +3132,21 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2800
3132
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
2801
3133
|
}
|
|
2802
3134
|
|
|
2803
|
-
checkoutBody = collectCheckoutBody(values);
|
|
2804
|
-
_context6.next =
|
|
2805
|
-
return postOnCheckout(checkoutBody
|
|
3135
|
+
checkoutBody = collectCheckoutBody(values, profileDataObj);
|
|
3136
|
+
_context6.next = 44;
|
|
3137
|
+
return postOnCheckout(checkoutBody);
|
|
2806
3138
|
|
|
2807
|
-
case
|
|
3139
|
+
case 44:
|
|
2808
3140
|
res = _context6.sent;
|
|
3141
|
+
removeReferralKey();
|
|
2809
3142
|
handleSubmit(values, formikHelpers, eventId, res);
|
|
2810
|
-
_context6.next =
|
|
3143
|
+
_context6.next = 53;
|
|
2811
3144
|
break;
|
|
2812
3145
|
|
|
2813
|
-
case
|
|
2814
|
-
_context6.prev =
|
|
3146
|
+
case 49:
|
|
3147
|
+
_context6.prev = 49;
|
|
2815
3148
|
_context6.t1 = _context6["catch"](0);
|
|
3149
|
+
setLoading(false);
|
|
2816
3150
|
|
|
2817
3151
|
if (axios.isAxiosError(_context6.t1)) {
|
|
2818
3152
|
if (((_e$response2 = _context6.t1.response) == null ? void 0 : _e$response2.data.error) === 'invalid_token') {
|
|
@@ -2824,23 +3158,24 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2824
3158
|
}
|
|
2825
3159
|
}
|
|
2826
3160
|
|
|
2827
|
-
if ((_e$response3 = _context6.t1.response) != null && _e$response3.data.message) {
|
|
2828
|
-
if (typeof document !== undefined) {
|
|
2829
|
-
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
2830
|
-
}
|
|
2831
|
-
|
|
3161
|
+
if ((_e$response3 = _context6.t1.response) != null && _e$response3.data.message && !hideErrorsAlertSection) {
|
|
2832
3162
|
setError(_get(_context6.t1, 'response.data.message'));
|
|
2833
3163
|
}
|
|
2834
3164
|
|
|
2835
3165
|
onSubmitError(_context6.t1);
|
|
2836
3166
|
}
|
|
2837
3167
|
|
|
2838
|
-
case
|
|
3168
|
+
case 53:
|
|
3169
|
+
_context6.prev = 53;
|
|
3170
|
+
setLoading(false);
|
|
3171
|
+
return _context6.finish(53);
|
|
3172
|
+
|
|
3173
|
+
case 56:
|
|
2839
3174
|
case "end":
|
|
2840
3175
|
return _context6.stop();
|
|
2841
3176
|
}
|
|
2842
3177
|
}
|
|
2843
|
-
}, _callee6, null, [[0,
|
|
3178
|
+
}, _callee6, null, [[0, 49, 53, 56], [18, 30]]);
|
|
2844
3179
|
}));
|
|
2845
3180
|
|
|
2846
3181
|
function onSubmit(_x2, _x3) {
|
|
@@ -2859,17 +3194,24 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2859
3194
|
setValues: props.setValues,
|
|
2860
3195
|
setUserValues: setUserValues,
|
|
2861
3196
|
onGetStatesSuccess: onGetStatesSuccess,
|
|
2862
|
-
onGetStatesError: onGetStatesError
|
|
3197
|
+
onGetStatesError: onGetStatesError,
|
|
3198
|
+
shouldFetchCountries: shouldFetchCountries
|
|
2863
3199
|
}), React.createElement("div", {
|
|
2864
3200
|
className: "billing-info-container " + theme
|
|
2865
|
-
},
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
3201
|
+
}, React.createElement(SnackbarAlert, {
|
|
3202
|
+
type: "error",
|
|
3203
|
+
isOpen: !!error,
|
|
3204
|
+
message: error || '',
|
|
3205
|
+
onClose: function onClose() {
|
|
3206
|
+
setError(null);
|
|
3207
|
+
onErrorClose();
|
|
3208
|
+
}
|
|
3209
|
+
}), !isLoggedIn && React.createElement("div", {
|
|
2870
3210
|
className: "account-actions-block"
|
|
2871
|
-
}, React.createElement("div",
|
|
2872
|
-
className: "
|
|
3211
|
+
}, React.createElement("div", {
|
|
3212
|
+
className: "action-item"
|
|
3213
|
+
}, React.createElement("div", null, accountInfoTitle), React.createElement("div", null, "Login & skip ahead:")), React.createElement("div", {
|
|
3214
|
+
className: "action-item login-block"
|
|
2873
3215
|
}, React.createElement("button", {
|
|
2874
3216
|
className: "login-register-button",
|
|
2875
3217
|
type: "button",
|
|
@@ -2927,7 +3269,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2927
3269
|
validate: getValidateFunctions(element, states, props.values),
|
|
2928
3270
|
setFieldValue: props.setFieldValue,
|
|
2929
3271
|
onBlur: props.handleBlur,
|
|
2930
|
-
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ? FormikPhoneNumberField : CustomField,
|
|
3272
|
+
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ? FormikPhoneNumberField : element.type === 'date' ? DatePickerField : CustomField,
|
|
2931
3273
|
selectOptions: element.name === 'country' ? countries : element.name === 'state' ? states : [],
|
|
2932
3274
|
theme: theme
|
|
2933
3275
|
})));
|
|
@@ -2935,7 +3277,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2935
3277
|
}));
|
|
2936
3278
|
}), !_isEmpty(ticketHoldersFields.fields) && React.createElement("div", {
|
|
2937
3279
|
className: "ticket-holders-fields"
|
|
2938
|
-
}, React.createElement("
|
|
3280
|
+
}, React.createElement("h2", null, ticketHoldersFields.label), _map(ticketsQuantity, function (_item, index) {
|
|
2939
3281
|
return React.createElement("div", {
|
|
2940
3282
|
key: _item
|
|
2941
3283
|
}, React.createElement("h5", null, "Ticket ", index + 1), _map(ticketHoldersFields.fields, function (group) {
|
|
@@ -3041,7 +3383,8 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3041
3383
|
handleSetLoading = _ref$handleSetLoading === void 0 ? function () {} : _ref$handleSetLoading,
|
|
3042
3384
|
_ref$conditions = _ref.conditions,
|
|
3043
3385
|
conditions = _ref$conditions === void 0 ? [] : _ref$conditions,
|
|
3044
|
-
disableZipSection = _ref.disableZipSection
|
|
3386
|
+
disableZipSection = _ref.disableZipSection,
|
|
3387
|
+
paymentButtonText = _ref.paymentButtonText;
|
|
3045
3388
|
var stripe = useStripe();
|
|
3046
3389
|
var elements = useElements();
|
|
3047
3390
|
|
|
@@ -3069,7 +3412,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3069
3412
|
while (1) {
|
|
3070
3413
|
switch (_context.prev = _context.next) {
|
|
3071
3414
|
case 0:
|
|
3072
|
-
|
|
3415
|
+
setStripeError(null);
|
|
3073
3416
|
_context.prev = 1;
|
|
3074
3417
|
event.preventDefault();
|
|
3075
3418
|
|
|
@@ -3129,17 +3472,18 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3129
3472
|
return _context.abrupt("return");
|
|
3130
3473
|
|
|
3131
3474
|
case 20:
|
|
3132
|
-
|
|
3475
|
+
handleSetLoading(true);
|
|
3476
|
+
_context.next = 23;
|
|
3133
3477
|
return stripe.confirmCardPayment(stripe_client_secret, {
|
|
3134
3478
|
payment_method: paymentMethodReq.paymentMethod.id
|
|
3135
3479
|
});
|
|
3136
3480
|
|
|
3137
|
-
case
|
|
3481
|
+
case 23:
|
|
3138
3482
|
_yield$stripe$confirm = _context.sent;
|
|
3139
3483
|
_error = _yield$stripe$confirm.error;
|
|
3140
3484
|
|
|
3141
3485
|
if (!_error) {
|
|
3142
|
-
_context.next =
|
|
3486
|
+
_context.next = 29;
|
|
3143
3487
|
break;
|
|
3144
3488
|
}
|
|
3145
3489
|
|
|
@@ -3147,22 +3491,22 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3147
3491
|
handleSetLoading(false);
|
|
3148
3492
|
return _context.abrupt("return");
|
|
3149
3493
|
|
|
3150
|
-
case
|
|
3494
|
+
case 29:
|
|
3151
3495
|
onSubmit(null);
|
|
3152
|
-
_context.next =
|
|
3496
|
+
_context.next = 35;
|
|
3153
3497
|
break;
|
|
3154
3498
|
|
|
3155
|
-
case
|
|
3156
|
-
_context.prev =
|
|
3499
|
+
case 32:
|
|
3500
|
+
_context.prev = 32;
|
|
3157
3501
|
_context.t0 = _context["catch"](1);
|
|
3158
3502
|
onSubmit(_context.t0);
|
|
3159
3503
|
|
|
3160
|
-
case
|
|
3504
|
+
case 35:
|
|
3161
3505
|
case "end":
|
|
3162
3506
|
return _context.stop();
|
|
3163
3507
|
}
|
|
3164
3508
|
}
|
|
3165
|
-
}, _callee, null, [[1,
|
|
3509
|
+
}, _callee, null, [[1, 32]]);
|
|
3166
3510
|
}));
|
|
3167
3511
|
|
|
3168
3512
|
return function handleSubmit(_x) {
|
|
@@ -3218,7 +3562,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3218
3562
|
onSubmit: handleSubmit
|
|
3219
3563
|
}, React.createElement("div", {
|
|
3220
3564
|
className: "card_form_inner"
|
|
3221
|
-
}, React.createElement("
|
|
3565
|
+
}, React.createElement("div", {
|
|
3222
3566
|
className: "card_number_element"
|
|
3223
3567
|
}, React.createElement("span", {
|
|
3224
3568
|
className: "card_label_text"
|
|
@@ -3228,19 +3572,21 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3228
3572
|
onChange: _identity,
|
|
3229
3573
|
onBlur: _identity,
|
|
3230
3574
|
onFocus: _identity
|
|
3231
|
-
})), React.createElement("
|
|
3575
|
+
})), React.createElement("div", {
|
|
3576
|
+
className: "elements"
|
|
3577
|
+
}, React.createElement("div", {
|
|
3232
3578
|
className: "expiration_element"
|
|
3233
3579
|
}, React.createElement("span", {
|
|
3234
3580
|
className: "card_label_text"
|
|
3235
3581
|
}, "Expiration date"), React.createElement(CardExpiryElement, {
|
|
3236
3582
|
options: _extends({}, options, stripeCardOptions)
|
|
3237
|
-
})), React.createElement("
|
|
3583
|
+
})), React.createElement("div", {
|
|
3238
3584
|
className: "cvc_element"
|
|
3239
3585
|
}, React.createElement("span", {
|
|
3240
3586
|
className: "card_label_text"
|
|
3241
3587
|
}, "CVC"), React.createElement(CardCvcElement, {
|
|
3242
3588
|
options: _extends({}, options, stripeCardOptions)
|
|
3243
|
-
})), !disableZipSection && React.createElement("
|
|
3589
|
+
}))), !disableZipSection && React.createElement("div", {
|
|
3244
3590
|
className: "zip_element"
|
|
3245
3591
|
}, React.createElement("p", {
|
|
3246
3592
|
className: "card_label_text"
|
|
@@ -3269,64 +3615,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3269
3615
|
type: "submit"
|
|
3270
3616
|
}, isLoading ? React.createElement(CircularProgress, {
|
|
3271
3617
|
size: 26
|
|
3272
|
-
}) :
|
|
3273
|
-
};
|
|
3274
|
-
|
|
3275
|
-
var showZero = function showZero(value) {
|
|
3276
|
-
if (value === void 0) {
|
|
3277
|
-
value = 0;
|
|
3278
|
-
}
|
|
3279
|
-
|
|
3280
|
-
var intNumber = Number(value);
|
|
3281
|
-
return _isNumber(intNumber) ? intNumber >= 0 && intNumber < 10 ? '0' + intNumber : intNumber : null;
|
|
3282
|
-
};
|
|
3283
|
-
|
|
3284
|
-
var TimerWidget = function TimerWidget(_ref) {
|
|
3285
|
-
var expires_at = _ref.expires_at,
|
|
3286
|
-
buyLoading = _ref.buyLoading,
|
|
3287
|
-
_ref$onCountdownFinis = _ref.onCountdownFinish,
|
|
3288
|
-
onCountdownFinish = _ref$onCountdownFinis === void 0 ? function () {} : _ref$onCountdownFinis;
|
|
3289
|
-
|
|
3290
|
-
var _useState = useState(true),
|
|
3291
|
-
showTimer = _useState[0],
|
|
3292
|
-
setShowTimer = _useState[1];
|
|
3293
|
-
|
|
3294
|
-
var handleCountdownFinish = function handleCountdownFinish() {
|
|
3295
|
-
setShowTimer(false);
|
|
3296
|
-
|
|
3297
|
-
if (!buyLoading) {
|
|
3298
|
-
onCountdownFinish();
|
|
3299
|
-
}
|
|
3300
|
-
};
|
|
3301
|
-
|
|
3302
|
-
var _renderer = function renderer(_ref2) {
|
|
3303
|
-
var minutes = _ref2.minutes,
|
|
3304
|
-
seconds = _ref2.seconds,
|
|
3305
|
-
completed = _ref2.completed,
|
|
3306
|
-
handleCountdownFinish = _ref2.handleCountdownFinish;
|
|
3307
|
-
|
|
3308
|
-
if (completed) {
|
|
3309
|
-
handleCountdownFinish();
|
|
3310
|
-
return null;
|
|
3311
|
-
}
|
|
3312
|
-
|
|
3313
|
-
return React.createElement("span", null, showZero(minutes), ":", showZero(seconds));
|
|
3314
|
-
};
|
|
3315
|
-
|
|
3316
|
-
return showTimer && !!expires_at ? React.createElement("div", {
|
|
3317
|
-
className: "timer"
|
|
3318
|
-
}, React.createElement("div", {
|
|
3319
|
-
className: "toast-message"
|
|
3320
|
-
}, React.createElement("p", null, "Please complete your purchase before the timer reaches zero."), React.createElement("p", {
|
|
3321
|
-
className: "countdown"
|
|
3322
|
-
}, React.createElement(Countdown$1, {
|
|
3323
|
-
date: Date.now() + expires_at * 1000,
|
|
3324
|
-
renderer: function renderer(props) {
|
|
3325
|
-
return _renderer(_extends({}, props, {
|
|
3326
|
-
handleCountdownFinish: handleCountdownFinish
|
|
3327
|
-
}));
|
|
3328
|
-
}
|
|
3329
|
-
})))) : null;
|
|
3618
|
+
}) : (paymentButtonText ? paymentButtonText : 'Pay') + " " + getCurrencySymbolByCurrency(currency) + total))));
|
|
3330
3619
|
};
|
|
3331
3620
|
|
|
3332
3621
|
var publishableKey = CONFIGS.STRIPE_PUBLISHABLE_KEY || '';
|
|
@@ -3387,7 +3676,10 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3387
3676
|
_ref$onCountdownFinis = _ref.onCountdownFinish,
|
|
3388
3677
|
onCountdownFinish = _ref$onCountdownFinis === void 0 ? function () {} : _ref$onCountdownFinis,
|
|
3389
3678
|
_ref$enableTimer = _ref.enableTimer,
|
|
3390
|
-
enableTimer = _ref$enableTimer === void 0 ? false : _ref$enableTimer
|
|
3679
|
+
enableTimer = _ref$enableTimer === void 0 ? false : _ref$enableTimer,
|
|
3680
|
+
_ref$enablePaymentPla = _ref.enablePaymentPlan,
|
|
3681
|
+
enablePaymentPlan = _ref$enablePaymentPla === void 0 ? false : _ref$enablePaymentPla,
|
|
3682
|
+
paymentButtonText = _ref.paymentButtonText;
|
|
3391
3683
|
|
|
3392
3684
|
var _useState = useState(initialReviewValues),
|
|
3393
3685
|
reviewData = _useState[0],
|
|
@@ -3402,16 +3694,20 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3402
3694
|
setError = _useState3[1];
|
|
3403
3695
|
|
|
3404
3696
|
var _useState4 = useState(false),
|
|
3405
|
-
|
|
3406
|
-
|
|
3697
|
+
showPaymentPlanSection = _useState4[0],
|
|
3698
|
+
setShowPaymentPlanSection = _useState4[1];
|
|
3699
|
+
|
|
3700
|
+
var _useState5 = useState(false),
|
|
3701
|
+
paymentIsLoading = _useState5[0],
|
|
3702
|
+
setPaymentIsLoading = _useState5[1];
|
|
3407
3703
|
|
|
3408
|
-
var
|
|
3409
|
-
paymentDataIsLoading =
|
|
3410
|
-
setPaymentDataIsLoading =
|
|
3704
|
+
var _useState6 = useState(true),
|
|
3705
|
+
paymentDataIsLoading = _useState6[0],
|
|
3706
|
+
setPaymentDataIsLoading = _useState6[1];
|
|
3411
3707
|
|
|
3412
|
-
var
|
|
3413
|
-
conditions =
|
|
3414
|
-
setConditions =
|
|
3708
|
+
var _useState7 = useState([]),
|
|
3709
|
+
conditions = _useState7[0],
|
|
3710
|
+
setConditions = _useState7[1];
|
|
3415
3711
|
|
|
3416
3712
|
var showFormTitle = Boolean(formTitle);
|
|
3417
3713
|
var showErrorText = Boolean(errorText);
|
|
@@ -3529,37 +3825,36 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3529
3825
|
_context3.prev = 0;
|
|
3530
3826
|
|
|
3531
3827
|
if (!error) {
|
|
3532
|
-
_context3.next =
|
|
3828
|
+
_context3.next = 3;
|
|
3533
3829
|
break;
|
|
3534
3830
|
}
|
|
3535
3831
|
|
|
3536
|
-
setPaymentIsLoading(false);
|
|
3537
3832
|
throw error;
|
|
3538
3833
|
|
|
3539
|
-
case
|
|
3834
|
+
case 3:
|
|
3540
3835
|
order_hash = reviewData.order_details.order_hash;
|
|
3541
3836
|
|
|
3542
|
-
if (!(total ===
|
|
3543
|
-
_context3.next =
|
|
3837
|
+
if (!(total === '0.00')) {
|
|
3838
|
+
_context3.next = 10;
|
|
3544
3839
|
break;
|
|
3545
3840
|
}
|
|
3546
3841
|
|
|
3547
|
-
_context3.next =
|
|
3842
|
+
_context3.next = 7;
|
|
3548
3843
|
return handleFreeSuccess(order_hash);
|
|
3549
3844
|
|
|
3550
|
-
case
|
|
3845
|
+
case 7:
|
|
3551
3846
|
_context3.t0 = _context3.sent;
|
|
3552
|
-
_context3.next =
|
|
3847
|
+
_context3.next = 13;
|
|
3553
3848
|
break;
|
|
3554
3849
|
|
|
3555
|
-
case
|
|
3556
|
-
_context3.next =
|
|
3850
|
+
case 10:
|
|
3851
|
+
_context3.next = 12;
|
|
3557
3852
|
return handlePaymentSuccess(order_hash);
|
|
3558
3853
|
|
|
3559
|
-
case
|
|
3854
|
+
case 12:
|
|
3560
3855
|
_context3.t0 = _context3.sent;
|
|
3561
3856
|
|
|
3562
|
-
case
|
|
3857
|
+
case 13:
|
|
3563
3858
|
paymentSuccessResponse = _context3.t0;
|
|
3564
3859
|
|
|
3565
3860
|
if (paymentSuccessResponse.status === 200) {
|
|
@@ -3570,10 +3865,11 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3570
3865
|
_context3.next = 22;
|
|
3571
3866
|
break;
|
|
3572
3867
|
|
|
3573
|
-
case
|
|
3574
|
-
_context3.prev =
|
|
3868
|
+
case 17:
|
|
3869
|
+
_context3.prev = 17;
|
|
3575
3870
|
_context3.t1 = _context3["catch"](0);
|
|
3576
3871
|
setError(_get(_context3.t1, 'response.data.message'));
|
|
3872
|
+
setPaymentIsLoading(false);
|
|
3577
3873
|
onPaymentError(_context3.t1.response);
|
|
3578
3874
|
|
|
3579
3875
|
case 22:
|
|
@@ -3581,7 +3877,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3581
3877
|
return _context3.stop();
|
|
3582
3878
|
}
|
|
3583
3879
|
}
|
|
3584
|
-
}, _callee3, null, [[0,
|
|
3880
|
+
}, _callee3, null, [[0, 17]]);
|
|
3585
3881
|
}));
|
|
3586
3882
|
|
|
3587
3883
|
return function handlePaymentMiddleWare(_x) {
|
|
@@ -3594,7 +3890,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3594
3890
|
theme: themeMui
|
|
3595
3891
|
}, React.createElement("div", {
|
|
3596
3892
|
className: "payment_page"
|
|
3597
|
-
},
|
|
3893
|
+
}, enableTimer && React.createElement(TimerWidget$1, {
|
|
3598
3894
|
expires_at: _get(reviewData, 'expires_at', 0),
|
|
3599
3895
|
buyLoading: paymentIsLoading,
|
|
3600
3896
|
onCountdownFinish: onCountdownFinish
|
|
@@ -3623,11 +3919,33 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3623
3919
|
}, label), React.createElement("div", {
|
|
3624
3920
|
className: className + " order_info_text"
|
|
3625
3921
|
}, normalizer(orderData[id], orderData.currency)));
|
|
3626
|
-
})),
|
|
3922
|
+
})), enablePaymentPlan && React.createElement("div", {
|
|
3923
|
+
className: "payment_toggle"
|
|
3924
|
+
}, React.createElement("label", {
|
|
3925
|
+
htmlFor: "togBtn",
|
|
3926
|
+
className: "switch"
|
|
3927
|
+
}, React.createElement("input", {
|
|
3928
|
+
type: "checkbox",
|
|
3929
|
+
id: "togBtn",
|
|
3930
|
+
disabled: true,
|
|
3931
|
+
onChange: function onChange() {
|
|
3932
|
+
return setShowPaymentPlanSection(!showPaymentPlanSection);
|
|
3933
|
+
}
|
|
3934
|
+
}), React.createElement("div", {
|
|
3935
|
+
className: "slider round"
|
|
3936
|
+
}), React.createElement("span", {
|
|
3937
|
+
className: "tog_text"
|
|
3938
|
+
}, "Click to checkout using Payment Plan"))), showPaymentPlanSection && React.createElement("div", {
|
|
3939
|
+
className: "payment_plan"
|
|
3940
|
+
}, React.createElement("h2", null, "PAYMENT PLAN"), React.createElement("div", {
|
|
3941
|
+
className: "plan_block"
|
|
3942
|
+
}, React.createElement("h3", null, "Mbrand Payment Plan Terms"), React.createElement("p", null, "By clicking on the \u201CConfirm Payment Plan\u201D button, you are starting your payment plan of 2 payments of $115.00, which will be drawn from your account every 2 weeks, with the first payment taken later today."), React.createElement("p", null, "This includes a non-refundable admin fee of $3.00 per payment."), React.createElement("p", {
|
|
3943
|
+
className: "payment_note"
|
|
3944
|
+
}, "NOTE: If today\u2019s payment fails, your payment plan will not activate, and your tickets will not be issued until you complete your final payment."), React.createElement("p", null, "If you do not complete your payements, your order will be canceled. Your first payment of $115.00, plus the non-refundable admin fee of $3.00 will not be refunded."), React.createElement("p", null, "Your payment will proceed with the card ending in **** 4242."))), total !== '0.00' ? React.createElement("div", {
|
|
3627
3945
|
className: "payment_info"
|
|
3628
3946
|
}, React.createElement("div", {
|
|
3629
3947
|
className: "payment_info_label"
|
|
3630
|
-
}, "
|
|
3948
|
+
}, "ORDER CONFIRMATION"), showErrorText && React.createElement("p", {
|
|
3631
3949
|
className: "payment_info__error"
|
|
3632
3950
|
}, errorText), React.createElement("div", null, React.createElement(Elements, {
|
|
3633
3951
|
stripe: getStripePromise(reviewData),
|
|
@@ -3645,18 +3963,20 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3645
3963
|
},
|
|
3646
3964
|
conditions: conditions,
|
|
3647
3965
|
stripeCardOptions: stripeCardOptions,
|
|
3648
|
-
disableZipSection: disableZipSection
|
|
3966
|
+
disableZipSection: disableZipSection,
|
|
3967
|
+
paymentButtonText: paymentButtonText
|
|
3649
3968
|
})))) : React.createElement("div", {
|
|
3650
3969
|
className: "payment_button " + (paymentIsLoading ? 'disabled-payment-button' : '')
|
|
3651
3970
|
}, React.createElement("button", {
|
|
3652
3971
|
disabled: paymentIsLoading,
|
|
3653
3972
|
type: "button",
|
|
3654
3973
|
onClick: function onClick() {
|
|
3974
|
+
setPaymentIsLoading(true);
|
|
3655
3975
|
handlePaymentMiddleWare(null);
|
|
3656
3976
|
}
|
|
3657
3977
|
}, paymentIsLoading ? React.createElement(CircularProgress, {
|
|
3658
3978
|
size: 26
|
|
3659
|
-
}) :
|
|
3979
|
+
}) : 'Complete Registration')))));
|
|
3660
3980
|
};
|
|
3661
3981
|
|
|
3662
3982
|
var config = {
|
|
@@ -3830,7 +4150,9 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
3830
4150
|
onGetConfirmationDataSuccess = _ref$onGetConfirmatio === void 0 ? function () {} : _ref$onGetConfirmatio,
|
|
3831
4151
|
_ref$onGetConfirmatio2 = _ref.onGetConfirmationDataError,
|
|
3832
4152
|
onGetConfirmationDataError = _ref$onGetConfirmatio2 === void 0 ? function () {} : _ref$onGetConfirmatio2,
|
|
3833
|
-
orderHash = _ref.orderHash
|
|
4153
|
+
orderHash = _ref.orderHash,
|
|
4154
|
+
_ref$onLinkCopied = _ref.onLinkCopied,
|
|
4155
|
+
onLinkCopied = _ref$onLinkCopied === void 0 ? function () {} : _ref$onLinkCopied;
|
|
3834
4156
|
var inputRef = useRef(null);
|
|
3835
4157
|
|
|
3836
4158
|
var _useState = useState(null),
|
|
@@ -3968,7 +4290,8 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
3968
4290
|
}), React.createElement("div", {
|
|
3969
4291
|
className: "share-by-link-copy-icon",
|
|
3970
4292
|
onClick: function onClick() {
|
|
3971
|
-
|
|
4293
|
+
navigator.clipboard.writeText(_get(inputRef, 'current.value'));
|
|
4294
|
+
onLinkCopied();
|
|
3972
4295
|
}
|
|
3973
4296
|
}, React.createElement("img", {
|
|
3974
4297
|
src: "https://img.icons8.com/office/50/000000/copy.png",
|
|
@@ -4034,7 +4357,7 @@ var TicketRow = function TicketRow(_ref) {
|
|
|
4034
4357
|
var isSalesClosed = !ticketTier.salesStarted || ticketTier.salesEnded;
|
|
4035
4358
|
var options = getTicketSelectOptions(ticketTier.maxQuantity, ticketTier.minQuantity, ticketTier.multiplier);
|
|
4036
4359
|
var ticketsClosedMessage = !ticketTier.salesStarted ? 'Sales not started' : 'Sales Ended';
|
|
4037
|
-
var onSaleContent =
|
|
4360
|
+
var onSaleContent = React.createElement("div", {
|
|
4038
4361
|
className: "get-tickets"
|
|
4039
4362
|
}, React.createElement(Box, {
|
|
4040
4363
|
className: "get-tickets__selectbox"
|
|
@@ -4064,17 +4387,17 @@ var TicketRow = function TicketRow(_ref) {
|
|
|
4064
4387
|
value: option.value
|
|
4065
4388
|
}, option.value);
|
|
4066
4389
|
})))));
|
|
4067
|
-
var returnValue = '';
|
|
4390
|
+
var returnValue = ''; // ticketTier.soldOut === false --> means that ticket is in the stock
|
|
4068
4391
|
|
|
4069
|
-
|
|
4070
|
-
returnValue = soldOutMessage;
|
|
4071
|
-
}
|
|
4392
|
+
var isSoldOut = ticketTier.sold_out || !ticketTier.displayTicket || ticketTier.soldOut || ticketTier.soldOut === false;
|
|
4072
4393
|
|
|
4073
|
-
if (
|
|
4394
|
+
if (isSoldOut) {
|
|
4395
|
+
returnValue = soldOutMessage;
|
|
4396
|
+
} else if (isSalesClosed) {
|
|
4397
|
+
returnValue = ticketsClosedMessage;
|
|
4398
|
+
} else if (ticketTier.displayTicket && ticketTier.maxQuantity) {
|
|
4074
4399
|
returnValue = onSaleContent;
|
|
4075
|
-
}
|
|
4076
|
-
|
|
4077
|
-
if (_get(prevTicketTier, 'in_stock')) {
|
|
4400
|
+
} else if (_get(prevTicketTier, 'in_stock')) {
|
|
4078
4401
|
returnValue = 'SOON';
|
|
4079
4402
|
}
|
|
4080
4403
|
|
|
@@ -4085,11 +4408,11 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
4085
4408
|
var ticketsList = _ref.ticketsList,
|
|
4086
4409
|
selectedTickets = _ref.selectedTickets,
|
|
4087
4410
|
handleTicketSelect = _ref.handleTicketSelect,
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
return React.createElement(React.Fragment, null, sortedTicketsList.map(function (ticket, i, arr) {
|
|
4411
|
+
sortBySoldOut = _ref.sortBySoldOut,
|
|
4412
|
+
ticketsHeaderComponent = _ref.ticketsHeaderComponent,
|
|
4413
|
+
hideTicketsHeader = _ref.hideTicketsHeader;
|
|
4414
|
+
var sortedTicketsList = sortBySoldOut ? _sortBy(_sortBy(ticketsList, 'sortOrder'), 'soldOut') : _sortBy(ticketsList, 'sortOrder');
|
|
4415
|
+
return React.createElement(React.Fragment, null, !hideTicketsHeader && ticketsHeaderComponent, sortedTicketsList.map(function (ticket, i, arr) {
|
|
4093
4416
|
var isSoldOut = ticket.sold_out || !ticket.displayTicket || ticket.soldOut;
|
|
4094
4417
|
|
|
4095
4418
|
var ticketSelect = function ticketSelect(event) {
|
|
@@ -4099,12 +4422,12 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
4099
4422
|
|
|
4100
4423
|
var ticketIsDiscounted = false;
|
|
4101
4424
|
|
|
4102
|
-
if (ticket.oldPrice &&
|
|
4425
|
+
if (ticket.oldPrice && !isSoldOut && ticket.oldPrice !== ticket.price) {
|
|
4103
4426
|
ticketIsDiscounted = true;
|
|
4104
4427
|
}
|
|
4105
4428
|
|
|
4106
|
-
var ticketIsFree =
|
|
4107
|
-
var ticketPrice = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : "$ " + (+ticket.
|
|
4429
|
+
var ticketIsFree = +ticket.price === 0;
|
|
4430
|
+
var ticketPrice = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : "$ " + (+ticket.price).toFixed(2);
|
|
4108
4431
|
return React.createElement("div", {
|
|
4109
4432
|
key: ticket.id || ticket.name,
|
|
4110
4433
|
className: "event-detail__tier " + (isSoldOut ? 'disabled' : '')
|
|
@@ -4296,36 +4619,15 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
4296
4619
|
}) : 'ADD TO WAITING LIST')))));
|
|
4297
4620
|
};
|
|
4298
4621
|
|
|
4299
|
-
var getImage = function getImage(name) {
|
|
4300
|
-
if (name === void 0) {
|
|
4301
|
-
name = '';
|
|
4302
|
-
}
|
|
4303
|
-
|
|
4304
|
-
var image = '';
|
|
4305
|
-
|
|
4306
|
-
if (!name.trim().length) {
|
|
4307
|
-
return image;
|
|
4308
|
-
}
|
|
4309
|
-
|
|
4310
|
-
if (process.env.NODE_ENV === 'production') {
|
|
4311
|
-
image = require("./images/" + name);
|
|
4312
|
-
return image["default"];
|
|
4313
|
-
}
|
|
4314
|
-
|
|
4315
|
-
return image;
|
|
4316
|
-
};
|
|
4317
|
-
|
|
4318
4622
|
var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
4319
|
-
var
|
|
4320
|
-
|
|
4623
|
+
var code = _ref.code,
|
|
4624
|
+
codeIsApplied = _ref.codeIsApplied,
|
|
4321
4625
|
showPromoInput = _ref.showPromoInput,
|
|
4322
|
-
|
|
4323
|
-
setPromoCode = _ref.setPromoCode,
|
|
4324
|
-
setPromoCodeUpdated = _ref.setPromoCodeUpdated,
|
|
4626
|
+
setCode = _ref.setCode,
|
|
4325
4627
|
setShowPromoInput = _ref.setShowPromoInput,
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
var isPromoCodeHasValue = !!
|
|
4628
|
+
updateTickets = _ref.updateTickets,
|
|
4629
|
+
setCodeIsApplied = _ref.setCodeIsApplied;
|
|
4630
|
+
var isPromoCodeHasValue = !!code.trim();
|
|
4329
4631
|
|
|
4330
4632
|
var renderInputField = function renderInputField() {
|
|
4331
4633
|
return React.createElement("div", {
|
|
@@ -4334,30 +4636,30 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4334
4636
|
className: "promo-code-block"
|
|
4335
4637
|
}, React.createElement("p", {
|
|
4336
4638
|
className: "promo-code-text"
|
|
4337
|
-
},
|
|
4639
|
+
}, "Promo code")), React.createElement("input", {
|
|
4338
4640
|
className: "promo-code-input",
|
|
4339
4641
|
placeholder: "",
|
|
4340
4642
|
onChange: function onChange(e) {
|
|
4341
|
-
|
|
4643
|
+
setCode(e.target.value);
|
|
4342
4644
|
},
|
|
4343
4645
|
onKeyPress: function onKeyPress(event) {
|
|
4344
4646
|
if (event.key === 'Enter' && isPromoCodeHasValue) {
|
|
4345
|
-
setPromoCodeUpdated(promoCode);
|
|
4346
4647
|
setShowPromoInput(false);
|
|
4648
|
+
updateTickets(true, 'promo');
|
|
4347
4649
|
}
|
|
4348
4650
|
}
|
|
4349
4651
|
}), React.createElement(Button$1, {
|
|
4350
4652
|
className: "promo-submit-button",
|
|
4351
4653
|
onClick: function onClick() {
|
|
4352
4654
|
if (isPromoCodeHasValue) {
|
|
4353
|
-
setPromoCodeUpdated(promoCode);
|
|
4354
4655
|
setShowPromoInput(false);
|
|
4656
|
+
updateTickets(true, 'promo');
|
|
4355
4657
|
}
|
|
4356
4658
|
}
|
|
4357
|
-
},
|
|
4659
|
+
}, "APPLY"));
|
|
4358
4660
|
};
|
|
4359
4661
|
|
|
4360
|
-
return
|
|
4662
|
+
return React.createElement("div", null, codeIsApplied ? React.createElement("div", {
|
|
4361
4663
|
className: "alert-info"
|
|
4362
4664
|
}, React.createElement(SVG, {
|
|
4363
4665
|
src: getImage('done.svg'),
|
|
@@ -4366,13 +4668,46 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4366
4668
|
}
|
|
4367
4669
|
}), React.createElement("p", {
|
|
4368
4670
|
className: "promo-code-success"
|
|
4369
|
-
}, "PROMO CODE APPLIED SUCCESSFULLY")) : null,
|
|
4671
|
+
}, "PROMO CODE APPLIED SUCCESSFULLY")) : null, !showPromoInput && React.createElement(Button$1, {
|
|
4370
4672
|
className: "promo-code-button",
|
|
4371
4673
|
placeholder: "Promo Codes",
|
|
4372
4674
|
onClick: function onClick() {
|
|
4675
|
+
setCodeIsApplied(false);
|
|
4373
4676
|
setShowPromoInput(true);
|
|
4374
4677
|
}
|
|
4375
|
-
}, "Got a promo code? Click here")
|
|
4678
|
+
}, "Got a promo code? Click here"), showPromoInput && renderInputField());
|
|
4679
|
+
};
|
|
4680
|
+
|
|
4681
|
+
var AccessCodeSection = function AccessCodeSection(_ref) {
|
|
4682
|
+
var code = _ref.code,
|
|
4683
|
+
setCode = _ref.setCode,
|
|
4684
|
+
updateTickets = _ref.updateTickets;
|
|
4685
|
+
var isAccessCodeHasValue = !!code.trim();
|
|
4686
|
+
return React.createElement("div", {
|
|
4687
|
+
className: "access-code-block"
|
|
4688
|
+
}, React.createElement("div", {
|
|
4689
|
+
className: "access-code-block"
|
|
4690
|
+
}, React.createElement("p", {
|
|
4691
|
+
className: "access-code-text"
|
|
4692
|
+
}, "Access code required")), React.createElement("input", {
|
|
4693
|
+
className: "access-code-input",
|
|
4694
|
+
placeholder: "",
|
|
4695
|
+
onChange: function onChange(e) {
|
|
4696
|
+
setCode(e.target.value);
|
|
4697
|
+
},
|
|
4698
|
+
onKeyPress: function onKeyPress(event) {
|
|
4699
|
+
if (event.key === 'Enter' && isAccessCodeHasValue) {
|
|
4700
|
+
updateTickets(true);
|
|
4701
|
+
}
|
|
4702
|
+
}
|
|
4703
|
+
}), React.createElement(Button$1, {
|
|
4704
|
+
className: "access-submit-button",
|
|
4705
|
+
onClick: function onClick() {
|
|
4706
|
+
if (isAccessCodeHasValue) {
|
|
4707
|
+
updateTickets(true);
|
|
4708
|
+
}
|
|
4709
|
+
}
|
|
4710
|
+
}, "ENTER"));
|
|
4376
4711
|
};
|
|
4377
4712
|
|
|
4378
4713
|
var isTimeExpired = function isTimeExpired(startDate, timezone) {
|
|
@@ -4387,8 +4722,13 @@ function Countdown(_ref) {
|
|
|
4387
4722
|
title = _ref$title === void 0 ? '' : _ref$title,
|
|
4388
4723
|
_ref$message = _ref.message,
|
|
4389
4724
|
message = _ref$message === void 0 ? '' : _ref$message,
|
|
4725
|
+
_ref$showMessage = _ref.showMessage,
|
|
4726
|
+
showMessage = _ref$showMessage === void 0 ? false : _ref$showMessage,
|
|
4727
|
+
_ref$disableLeadingZe = _ref.disableLeadingZero,
|
|
4728
|
+
disableLeadingZero = _ref$disableLeadingZe === void 0 ? false : _ref$disableLeadingZe,
|
|
4390
4729
|
_ref$callback = _ref.callback,
|
|
4391
|
-
callback = _ref$callback === void 0 ? function () {} : _ref$callback
|
|
4730
|
+
callback = _ref$callback === void 0 ? function () {} : _ref$callback,
|
|
4731
|
+
isLoggedIn = _ref.isLoggedIn;
|
|
4392
4732
|
|
|
4393
4733
|
var _useState = useState(''),
|
|
4394
4734
|
duration = _useState[0],
|
|
@@ -4410,6 +4750,7 @@ function Countdown(_ref) {
|
|
|
4410
4750
|
clearInterval(timer);
|
|
4411
4751
|
setTimeExpired(true);
|
|
4412
4752
|
callback();
|
|
4753
|
+
return;
|
|
4413
4754
|
}
|
|
4414
4755
|
|
|
4415
4756
|
var currentDate = moment.tz(moment(), timezone).format('YYYY-MM-DD HH:mm:ss');
|
|
@@ -4427,7 +4768,11 @@ function Countdown(_ref) {
|
|
|
4427
4768
|
|
|
4428
4769
|
for (var date in dateArr) {
|
|
4429
4770
|
var unit = dateArr[date] === 1 ? date : date + 's';
|
|
4430
|
-
var val =
|
|
4771
|
+
var val = dateArr[date];
|
|
4772
|
+
|
|
4773
|
+
if (!disableLeadingZero && String(dateArr[date]).length === 1) {
|
|
4774
|
+
val = '0' + dateArr[date];
|
|
4775
|
+
}
|
|
4431
4776
|
|
|
4432
4777
|
if (timeLeft) {
|
|
4433
4778
|
timeLeft += ", " + val + " " + unit;
|
|
@@ -4445,10 +4790,10 @@ function Countdown(_ref) {
|
|
|
4445
4790
|
};
|
|
4446
4791
|
}, [timeExpired]);
|
|
4447
4792
|
return React.createElement(React.Fragment, null, !timeExpired && duration && React.createElement("div", {
|
|
4448
|
-
className: 'countdown'
|
|
4793
|
+
className: "countdown " + (!isLoggedIn ? 'countdown-on-bottom' : '')
|
|
4449
4794
|
}, React.createElement("div", null, React.createElement("p", {
|
|
4450
4795
|
className: 'title'
|
|
4451
|
-
}, title), React.createElement("p", null, duration)), React.createElement("p", {
|
|
4796
|
+
}, title), React.createElement("p", null, duration)), showMessage && React.createElement("p", {
|
|
4452
4797
|
className: 'message'
|
|
4453
4798
|
}, message)));
|
|
4454
4799
|
}
|
|
@@ -4460,7 +4805,8 @@ var ReferralLogic = function ReferralLogic(props) {
|
|
|
4460
4805
|
if (isWindowDefined) {
|
|
4461
4806
|
var params = new URL("" + window.location).searchParams;
|
|
4462
4807
|
var referralId = params.get('ttf_r') || '';
|
|
4463
|
-
var
|
|
4808
|
+
var referralValue = [eventId, '.', referralId].join('');
|
|
4809
|
+
var isAlreadyCounted = localStorage.getItem('referral_key') === referralValue;
|
|
4464
4810
|
|
|
4465
4811
|
if (referralId && eventId && !isAlreadyCounted) {
|
|
4466
4812
|
_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
@@ -4473,7 +4819,7 @@ var ReferralLogic = function ReferralLogic(props) {
|
|
|
4473
4819
|
return postReferralVisits("" + eventId, referralId);
|
|
4474
4820
|
|
|
4475
4821
|
case 3:
|
|
4476
|
-
localStorage.setItem('referral_key',
|
|
4822
|
+
localStorage.setItem('referral_key', referralValue);
|
|
4477
4823
|
_context.next = 8;
|
|
4478
4824
|
break;
|
|
4479
4825
|
|
|
@@ -4507,6 +4853,10 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4507
4853
|
onGetTicketsSuccess = _ref$onGetTicketsSucc === void 0 ? function () {} : _ref$onGetTicketsSucc,
|
|
4508
4854
|
_ref$onGetTicketsErro = _ref.onGetTicketsError,
|
|
4509
4855
|
onGetTicketsError = _ref$onGetTicketsErro === void 0 ? function () {} : _ref$onGetTicketsErro,
|
|
4856
|
+
_ref$onLogoutSuccess = _ref.onLogoutSuccess,
|
|
4857
|
+
onLogoutSuccess = _ref$onLogoutSuccess === void 0 ? function () {} : _ref$onLogoutSuccess,
|
|
4858
|
+
_ref$onLogoutError = _ref.onLogoutError,
|
|
4859
|
+
onLogoutError = _ref$onLogoutError === void 0 ? function () {} : _ref$onLogoutError,
|
|
4510
4860
|
_ref$theme = _ref.theme,
|
|
4511
4861
|
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
4512
4862
|
_ref$queryPromoCode = _ref.queryPromoCode,
|
|
@@ -4519,62 +4869,82 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4519
4869
|
_ref$hideSessionButto = _ref.hideSessionButtons,
|
|
4520
4870
|
hideSessionButtons = _ref$hideSessionButto === void 0 ? false : _ref$hideSessionButto,
|
|
4521
4871
|
_ref$hideWaitingList = _ref.hideWaitingList,
|
|
4522
|
-
hideWaitingList = _ref$hideWaitingList === void 0 ? false : _ref$hideWaitingList
|
|
4872
|
+
hideWaitingList = _ref$hideWaitingList === void 0 ? false : _ref$hideWaitingList,
|
|
4873
|
+
_ref$enableBillingInf = _ref.enableBillingInfoAutoCreate,
|
|
4874
|
+
enableBillingInfoAutoCreate = _ref$enableBillingInf === void 0 ? true : _ref$enableBillingInf,
|
|
4875
|
+
_ref$isButtonScrollab = _ref.isButtonScrollable,
|
|
4876
|
+
isButtonScrollable = _ref$isButtonScrollab === void 0 ? false : _ref$isButtonScrollab,
|
|
4877
|
+
_ref$sortBySoldOut = _ref.sortBySoldOut,
|
|
4878
|
+
sortBySoldOut = _ref$sortBySoldOut === void 0 ? false : _ref$sortBySoldOut,
|
|
4879
|
+
_ref$disableCountdown = _ref.disableCountdownLeadingZero,
|
|
4880
|
+
disableCountdownLeadingZero = _ref$disableCountdown === void 0 ? false : _ref$disableCountdown,
|
|
4881
|
+
_ref$isLoggedIn = _ref.isLoggedIn,
|
|
4882
|
+
isLoggedIn = _ref$isLoggedIn === void 0 ? false : _ref$isLoggedIn,
|
|
4883
|
+
ActionsSectionComponent = _ref.actionsSectionComponent,
|
|
4884
|
+
ticketsHeaderComponent = _ref.ticketsHeaderComponent,
|
|
4885
|
+
_ref$hideTicketsHeade = _ref.hideTicketsHeader,
|
|
4886
|
+
hideTicketsHeader = _ref$hideTicketsHeade === void 0 ? false : _ref$hideTicketsHeade;
|
|
4523
4887
|
|
|
4524
4888
|
var _useState = useState({}),
|
|
4525
4889
|
selectedTickets = _useState[0],
|
|
4526
4890
|
setSelectedTickets = _useState[1];
|
|
4527
4891
|
|
|
4528
4892
|
var isWindowDefined = typeof window !== 'undefined';
|
|
4893
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
4529
4894
|
|
|
4530
|
-
var _useState2 = useState(isWindowDefined ? !!window.localStorage.getItem('access_token') : false),
|
|
4895
|
+
var _useState2 = useState((isWindowDefined ? !!window.localStorage.getItem('access_token') : false) || !!xtfCookie),
|
|
4531
4896
|
isLogged = _useState2[0],
|
|
4532
4897
|
setIsLogged = _useState2[1];
|
|
4533
4898
|
|
|
4534
|
-
var
|
|
4535
|
-
showLoginModal =
|
|
4536
|
-
setShowLoginModal =
|
|
4537
|
-
|
|
4538
|
-
var _useState3 = useState([]),
|
|
4539
|
-
tickets = _useState3[0],
|
|
4540
|
-
setTickets = _useState3[1];
|
|
4899
|
+
var _useState3 = useState(false),
|
|
4900
|
+
showLoginModal = _useState3[0],
|
|
4901
|
+
setShowLoginModal = _useState3[1];
|
|
4541
4902
|
|
|
4542
|
-
var _useState4 = useState(
|
|
4543
|
-
|
|
4544
|
-
|
|
4903
|
+
var _useState4 = useState([]),
|
|
4904
|
+
tickets = _useState4[0],
|
|
4905
|
+
setTickets = _useState4[1];
|
|
4545
4906
|
|
|
4546
|
-
var _useState5 = useState(
|
|
4547
|
-
|
|
4548
|
-
|
|
4907
|
+
var _useState5 = useState(null),
|
|
4908
|
+
event = _useState5[0],
|
|
4909
|
+
setEvent = _useState5[1];
|
|
4549
4910
|
|
|
4550
4911
|
var _useState6 = useState(false),
|
|
4551
|
-
|
|
4552
|
-
|
|
4912
|
+
showWaitingList = _useState6[0],
|
|
4913
|
+
setShowWaitingList = _useState6[1];
|
|
4553
4914
|
|
|
4554
|
-
var _useState7 = useState(
|
|
4555
|
-
|
|
4556
|
-
|
|
4915
|
+
var _useState7 = useState(true),
|
|
4916
|
+
isLoading = _useState7[0],
|
|
4917
|
+
setIsLoading = _useState7[1];
|
|
4557
4918
|
|
|
4558
4919
|
var _useState8 = useState(false),
|
|
4559
|
-
|
|
4560
|
-
|
|
4920
|
+
codeIsLoading = _useState8[0],
|
|
4921
|
+
setCodeIsLoading = _useState8[1];
|
|
4561
4922
|
|
|
4562
|
-
var _useState9 = useState(
|
|
4563
|
-
|
|
4564
|
-
|
|
4923
|
+
var _useState9 = useState(false),
|
|
4924
|
+
handleBookIsLoading = _useState9[0],
|
|
4925
|
+
setHandleBookIsLoading = _useState9[1];
|
|
4565
4926
|
|
|
4566
4927
|
var _useState10 = useState(getQueryVariable('r') || queryPromoCode),
|
|
4567
|
-
|
|
4568
|
-
|
|
4928
|
+
code = _useState10[0],
|
|
4929
|
+
setCode = _useState10[1];
|
|
4569
4930
|
|
|
4570
4931
|
var _useState11 = useState(false),
|
|
4571
4932
|
showPromoInput = _useState11[0],
|
|
4572
4933
|
setShowPromoInput = _useState11[1];
|
|
4573
4934
|
|
|
4574
4935
|
var _useState12 = useState(false),
|
|
4575
|
-
|
|
4576
|
-
|
|
4936
|
+
codeIsApplied = _useState12[0],
|
|
4937
|
+
setCodeIsApplied = _useState12[1];
|
|
4577
4938
|
|
|
4939
|
+
var _useState13 = useState(isAccessCodeEnabled),
|
|
4940
|
+
showAccessCodeSection = _useState13[0],
|
|
4941
|
+
setShowAccessCodeSection = _useState13[1];
|
|
4942
|
+
|
|
4943
|
+
var _useState14 = useState(isPromotionsEnabled),
|
|
4944
|
+
showPromoCodeSection = _useState14[0],
|
|
4945
|
+
setShowPromoCodeSection = _useState14[1];
|
|
4946
|
+
|
|
4947
|
+
var ticketsContainerRef = useRef(null);
|
|
4578
4948
|
useEffect(function () {
|
|
4579
4949
|
if (typeof window !== 'undefined') {
|
|
4580
4950
|
var access_token = window.localStorage.getItem('access_token');
|
|
@@ -4590,20 +4960,66 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4590
4960
|
}
|
|
4591
4961
|
}, []);
|
|
4592
4962
|
useEffect(function () {
|
|
4593
|
-
!!eventId && getTicketsApi(
|
|
4594
|
-
}, [eventId
|
|
4963
|
+
!!eventId && getTicketsApi();
|
|
4964
|
+
}, [eventId]);
|
|
4595
4965
|
|
|
4596
|
-
var handleLogout = function
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
window.localStorage.removeItem('user_data');
|
|
4600
|
-
setIsLogged(false);
|
|
4966
|
+
var handleLogout = /*#__PURE__*/function () {
|
|
4967
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
4968
|
+
var _event;
|
|
4601
4969
|
|
|
4602
|
-
|
|
4970
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
4971
|
+
while (1) {
|
|
4972
|
+
switch (_context.prev = _context.next) {
|
|
4973
|
+
case 0:
|
|
4974
|
+
_context.prev = 0;
|
|
4975
|
+
_context.next = 3;
|
|
4976
|
+
return logout();
|
|
4603
4977
|
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4978
|
+
case 3:
|
|
4979
|
+
onLogoutSuccess();
|
|
4980
|
+
|
|
4981
|
+
if (isWindowDefined) {
|
|
4982
|
+
window.localStorage.removeItem('access_token');
|
|
4983
|
+
window.localStorage.removeItem('user_data');
|
|
4984
|
+
setIsLogged(false);
|
|
4985
|
+
_event = new window.CustomEvent('tf-logout');
|
|
4986
|
+
deleteCookieByName('X-TF-ECOMMERCE');
|
|
4987
|
+
window.document.dispatchEvent(_event);
|
|
4988
|
+
}
|
|
4989
|
+
|
|
4990
|
+
_context.next = 10;
|
|
4991
|
+
break;
|
|
4992
|
+
|
|
4993
|
+
case 7:
|
|
4994
|
+
_context.prev = 7;
|
|
4995
|
+
_context.t0 = _context["catch"](0);
|
|
4996
|
+
onLogoutError(_context.t0);
|
|
4997
|
+
|
|
4998
|
+
case 10:
|
|
4999
|
+
case "end":
|
|
5000
|
+
return _context.stop();
|
|
5001
|
+
}
|
|
5002
|
+
}
|
|
5003
|
+
}, _callee, null, [[0, 7]]);
|
|
5004
|
+
}));
|
|
5005
|
+
|
|
5006
|
+
return function handleLogout() {
|
|
5007
|
+
return _ref2.apply(this, arguments);
|
|
5008
|
+
};
|
|
5009
|
+
}();
|
|
5010
|
+
|
|
5011
|
+
useEffect(function () {
|
|
5012
|
+
try {
|
|
5013
|
+
if (typeof window !== 'undefined') {
|
|
5014
|
+
var userData = window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '{}') : {};
|
|
5015
|
+
|
|
5016
|
+
if (userData.country === '') {
|
|
5017
|
+
handleLogout();
|
|
5018
|
+
window.open('https://www.ticketfairy.com/account/change_information?need_country=true');
|
|
5019
|
+
}
|
|
5020
|
+
}
|
|
5021
|
+
} catch (e) {}
|
|
5022
|
+
}, []);
|
|
4607
5023
|
|
|
4608
5024
|
var handleExternalLogin = function handleExternalLogin() {
|
|
4609
5025
|
setIsLogged(true);
|
|
@@ -4622,40 +5038,40 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4622
5038
|
}
|
|
4623
5039
|
};
|
|
4624
5040
|
|
|
4625
|
-
function getTicketsApi(_x) {
|
|
5041
|
+
function getTicketsApi(_x, _x2) {
|
|
4626
5042
|
return _getTicketsApi.apply(this, arguments);
|
|
4627
5043
|
}
|
|
4628
5044
|
|
|
4629
5045
|
function _getTicketsApi() {
|
|
4630
|
-
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5046
|
+
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(isUpdateingCode, type) {
|
|
4631
5047
|
var response, eventResponse, attributes, _event2;
|
|
4632
5048
|
|
|
4633
|
-
return runtime_1.wrap(function
|
|
5049
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
4634
5050
|
while (1) {
|
|
4635
|
-
switch (
|
|
5051
|
+
switch (_context3.prev = _context3.next) {
|
|
4636
5052
|
case 0:
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
return getTickets(eventId, promoCodeUpdated);
|
|
5053
|
+
_context3.prev = 0;
|
|
5054
|
+
isUpdateingCode ? setCodeIsLoading(true) : setIsLoading(true);
|
|
5055
|
+
_context3.next = 4;
|
|
5056
|
+
return getTickets(eventId, code);
|
|
4642
5057
|
|
|
4643
|
-
case
|
|
4644
|
-
response =
|
|
4645
|
-
|
|
5058
|
+
case 4:
|
|
5059
|
+
response = _context3.sent;
|
|
5060
|
+
_context3.next = 7;
|
|
4646
5061
|
return getEvent(eventId);
|
|
4647
5062
|
|
|
4648
|
-
case
|
|
4649
|
-
eventResponse =
|
|
5063
|
+
case 7:
|
|
5064
|
+
eventResponse = _context3.sent;
|
|
4650
5065
|
|
|
4651
5066
|
if (response.data.success) {
|
|
4652
|
-
setCustomHeader(response);
|
|
4653
5067
|
attributes = _get(response, 'data.data.attributes');
|
|
4654
|
-
|
|
5068
|
+
type === 'promo' && setCodeIsApplied(attributes.ValidPromoCode);
|
|
4655
5069
|
setTickets(_get(attributes, 'tickets'));
|
|
4656
5070
|
setShowWaitingList(attributes.showWaitingList);
|
|
4657
5071
|
onGetTicketsSuccess(response.data);
|
|
4658
|
-
|
|
5072
|
+
setCode('');
|
|
5073
|
+
setShowAccessCodeSection(attributes.is_access_code);
|
|
5074
|
+
setShowPromoCodeSection(attributes.isPromotionsEnabled);
|
|
4659
5075
|
}
|
|
4660
5076
|
|
|
4661
5077
|
if (eventResponse.data.success) {
|
|
@@ -4663,42 +5079,42 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4663
5079
|
setEvent(_event2);
|
|
4664
5080
|
}
|
|
4665
5081
|
|
|
4666
|
-
|
|
5082
|
+
_context3.next = 15;
|
|
4667
5083
|
break;
|
|
4668
5084
|
|
|
4669
|
-
case
|
|
4670
|
-
|
|
4671
|
-
|
|
5085
|
+
case 12:
|
|
5086
|
+
_context3.prev = 12;
|
|
5087
|
+
_context3.t0 = _context3["catch"](0);
|
|
4672
5088
|
|
|
4673
|
-
if (axios.isAxiosError(
|
|
4674
|
-
onGetTicketsError(
|
|
5089
|
+
if (axios.isAxiosError(_context3.t0)) {
|
|
5090
|
+
onGetTicketsError(_context3.t0);
|
|
4675
5091
|
}
|
|
4676
5092
|
|
|
4677
|
-
case
|
|
4678
|
-
|
|
5093
|
+
case 15:
|
|
5094
|
+
_context3.prev = 15;
|
|
4679
5095
|
setIsLoading(false);
|
|
4680
|
-
|
|
4681
|
-
return
|
|
5096
|
+
setCodeIsLoading(false);
|
|
5097
|
+
return _context3.finish(15);
|
|
4682
5098
|
|
|
4683
|
-
case
|
|
5099
|
+
case 19:
|
|
4684
5100
|
case "end":
|
|
4685
|
-
return
|
|
5101
|
+
return _context3.stop();
|
|
4686
5102
|
}
|
|
4687
5103
|
}
|
|
4688
|
-
},
|
|
5104
|
+
}, _callee3, null, [[0, 12, 15, 19]]);
|
|
4689
5105
|
}));
|
|
4690
5106
|
return _getTicketsApi.apply(this, arguments);
|
|
4691
5107
|
}
|
|
4692
5108
|
|
|
4693
5109
|
var handleTicketSelect = function handleTicketSelect(key, value) {
|
|
4694
5110
|
setSelectedTickets(function (prevState) {
|
|
4695
|
-
var
|
|
5111
|
+
var _ref3;
|
|
4696
5112
|
|
|
4697
5113
|
if (Object.keys(prevState)[0] !== key && !value) {
|
|
4698
5114
|
return prevState;
|
|
4699
5115
|
}
|
|
4700
5116
|
|
|
4701
|
-
return
|
|
5117
|
+
return _ref3 = {}, _ref3[key] = value, _ref3;
|
|
4702
5118
|
});
|
|
4703
5119
|
};
|
|
4704
5120
|
|
|
@@ -4709,14 +5125,14 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4709
5125
|
};
|
|
4710
5126
|
|
|
4711
5127
|
var handleBook = /*#__PURE__*/function () {
|
|
4712
|
-
var
|
|
5128
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
4713
5129
|
var _product_options, _product_options2, _ticket_types;
|
|
4714
5130
|
|
|
4715
|
-
var ticket, optionName, ticketId, ticketQuantity, data, result, _result$data$data$att, _result$data, _result$data$data, _result$data$data$att2, _result$data$data$att3, _result$data2, _result$data2$data, _result$data2$data$at, _result$data$data$att4, _result$data3, _result$data3$data, _result$data3$data$at, _result$data$data$att5, _result$data4, _result$data4$data, _result$data4$data$at, skipBillingPage, nameIsRequired, ageIsRequired, phoneIsRequired, hash, _isWindowDefined, userData, access_token, checkoutBody, checkoutResult;
|
|
5131
|
+
var ticket, optionName, ticketId, ticketQuantity, data, result, _result$data$data$att, _result$data, _result$data$data, _result$data$data$att2, _result$data$data$att3, _result$data2, _result$data2$data, _result$data2$data$at, _result$data$data$att4, _result$data3, _result$data3$data, _result$data3$data$at, _result$data$data$att5, _result$data4, _result$data4$data, _result$data4$data$at, skipBillingPage, nameIsRequired, ageIsRequired, phoneIsRequired, hash, total, _isWindowDefined, userData, access_token, checkoutBody, checkoutResult;
|
|
4716
5132
|
|
|
4717
|
-
return runtime_1.wrap(function
|
|
5133
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
4718
5134
|
while (1) {
|
|
4719
|
-
switch (
|
|
5135
|
+
switch (_context2.prev = _context2.next) {
|
|
4720
5136
|
case 0:
|
|
4721
5137
|
setHandleBookIsLoading(true);
|
|
4722
5138
|
ticket = _find(tickets, function (item) {
|
|
@@ -4737,27 +5153,27 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4737
5153
|
}, _ticket_types)
|
|
4738
5154
|
}
|
|
4739
5155
|
};
|
|
4740
|
-
|
|
4741
|
-
|
|
5156
|
+
_context2.prev = 6;
|
|
5157
|
+
_context2.next = 9;
|
|
4742
5158
|
return addToCart(eventId, data);
|
|
4743
5159
|
|
|
4744
5160
|
case 9:
|
|
4745
|
-
result =
|
|
5161
|
+
result = _context2.sent;
|
|
4746
5162
|
|
|
4747
5163
|
if (!(result.status === 200)) {
|
|
4748
|
-
|
|
5164
|
+
_context2.next = 33;
|
|
4749
5165
|
break;
|
|
4750
5166
|
}
|
|
4751
5167
|
|
|
4752
|
-
setCustomHeader(result);
|
|
4753
5168
|
skipBillingPage = (_result$data$data$att = result == null ? void 0 : (_result$data = result.data) == null ? void 0 : (_result$data$data = _result$data.data) == null ? void 0 : (_result$data$data$att2 = _result$data$data.attributes) == null ? void 0 : _result$data$data$att2.skip_billing_page) != null ? _result$data$data$att : false;
|
|
4754
5169
|
nameIsRequired = (_result$data$data$att3 = result == null ? void 0 : (_result$data2 = result.data) == null ? void 0 : (_result$data2$data = _result$data2.data) == null ? void 0 : (_result$data2$data$at = _result$data2$data.attributes) == null ? void 0 : _result$data2$data$at.names_required) != null ? _result$data$data$att3 : false;
|
|
4755
5170
|
ageIsRequired = (_result$data$data$att4 = result == null ? void 0 : (_result$data3 = result.data) == null ? void 0 : (_result$data3$data = _result$data3.data) == null ? void 0 : (_result$data3$data$at = _result$data3$data.attributes) == null ? void 0 : _result$data3$data$at.age_required) != null ? _result$data$data$att4 : false;
|
|
4756
5171
|
phoneIsRequired = (_result$data$data$att5 = result == null ? void 0 : (_result$data4 = result.data) == null ? void 0 : (_result$data4$data = _result$data4.data) == null ? void 0 : (_result$data4$data$at = _result$data4$data.attributes) == null ? void 0 : _result$data4$data$at.phone_required) != null ? _result$data$data$att5 : false;
|
|
4757
5172
|
hash = '';
|
|
5173
|
+
total = '';
|
|
4758
5174
|
|
|
4759
5175
|
if (!skipBillingPage) {
|
|
4760
|
-
|
|
5176
|
+
_context2.next = 32;
|
|
4761
5177
|
break;
|
|
4762
5178
|
}
|
|
4763
5179
|
|
|
@@ -4766,65 +5182,79 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4766
5182
|
userData = _isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
4767
5183
|
access_token = _isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
4768
5184
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
4769
|
-
|
|
5185
|
+
|
|
5186
|
+
if (!enableBillingInfoAutoCreate) {
|
|
5187
|
+
_context2.next = 28;
|
|
5188
|
+
break;
|
|
5189
|
+
}
|
|
5190
|
+
|
|
5191
|
+
_context2.next = 25;
|
|
4770
5192
|
return postOnCheckout(checkoutBody, access_token);
|
|
4771
5193
|
|
|
4772
|
-
case
|
|
4773
|
-
|
|
4774
|
-
|
|
5194
|
+
case 25:
|
|
5195
|
+
_context2.t0 = _context2.sent;
|
|
5196
|
+
_context2.next = 29;
|
|
5197
|
+
break;
|
|
4775
5198
|
|
|
4776
|
-
case
|
|
5199
|
+
case 28:
|
|
5200
|
+
_context2.t0 = null;
|
|
5201
|
+
|
|
5202
|
+
case 29:
|
|
5203
|
+
checkoutResult = _context2.t0;
|
|
5204
|
+
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
5205
|
+
total = _get(checkoutResult, 'data.data.attributes.total');
|
|
5206
|
+
|
|
5207
|
+
case 32:
|
|
4777
5208
|
onAddToCartSuccess({
|
|
4778
5209
|
skip_billing_page: skipBillingPage,
|
|
4779
5210
|
names_required: nameIsRequired,
|
|
4780
5211
|
phone_required: phoneIsRequired,
|
|
4781
5212
|
age_required: ageIsRequired,
|
|
4782
5213
|
event_id: String(eventId),
|
|
4783
|
-
hash: hash
|
|
5214
|
+
hash: hash,
|
|
5215
|
+
total: total
|
|
4784
5216
|
});
|
|
4785
5217
|
|
|
4786
|
-
case
|
|
4787
|
-
|
|
5218
|
+
case 33:
|
|
5219
|
+
_context2.next = 38;
|
|
4788
5220
|
break;
|
|
4789
5221
|
|
|
4790
|
-
case
|
|
4791
|
-
|
|
4792
|
-
|
|
5222
|
+
case 35:
|
|
5223
|
+
_context2.prev = 35;
|
|
5224
|
+
_context2.t1 = _context2["catch"](6);
|
|
4793
5225
|
|
|
4794
|
-
if (axios.isAxiosError(
|
|
4795
|
-
onAddToCartError(
|
|
5226
|
+
if (axios.isAxiosError(_context2.t1)) {
|
|
5227
|
+
onAddToCartError(_context2.t1);
|
|
4796
5228
|
}
|
|
4797
5229
|
|
|
4798
|
-
case
|
|
4799
|
-
|
|
5230
|
+
case 38:
|
|
5231
|
+
_context2.prev = 38;
|
|
4800
5232
|
setHandleBookIsLoading(false);
|
|
4801
|
-
return
|
|
5233
|
+
return _context2.finish(38);
|
|
4802
5234
|
|
|
4803
|
-
case
|
|
5235
|
+
case 41:
|
|
4804
5236
|
case "end":
|
|
4805
|
-
return
|
|
5237
|
+
return _context2.stop();
|
|
4806
5238
|
}
|
|
4807
5239
|
}
|
|
4808
|
-
},
|
|
5240
|
+
}, _callee2, null, [[6, 35, 38, 41]]);
|
|
4809
5241
|
}));
|
|
4810
5242
|
|
|
4811
5243
|
return function handleBook() {
|
|
4812
|
-
return
|
|
5244
|
+
return _ref4.apply(this, arguments);
|
|
4813
5245
|
};
|
|
4814
5246
|
}();
|
|
4815
5247
|
|
|
4816
|
-
var updateTickets = function updateTickets() {
|
|
4817
|
-
getTicketsApi();
|
|
5248
|
+
var updateTickets = function updateTickets(isUpdateingCode, type) {
|
|
5249
|
+
getTicketsApi(isUpdateingCode, type);
|
|
4818
5250
|
};
|
|
4819
5251
|
|
|
4820
|
-
var isAllTicketsSoldOut = _every(tickets, function (item) {
|
|
4821
|
-
return item.sold_out || item.soldOut;
|
|
4822
|
-
});
|
|
4823
|
-
|
|
4824
5252
|
var isTicketOnSale = _some(tickets, function (item) {
|
|
4825
5253
|
return item.salesStarted && !item.salesEnded && !item.soldOut;
|
|
4826
5254
|
});
|
|
4827
5255
|
|
|
5256
|
+
var eventHasTickets = !_isEmpty(tickets);
|
|
5257
|
+
var isSalesClosed = event == null ? void 0 : event.salesEnded;
|
|
4828
5258
|
var themeMui = createTheme$1(themeOptions);
|
|
4829
5259
|
useEffect(function () {
|
|
4830
5260
|
isWindowDefined && window.document.addEventListener('custom-logout', handleLogout);
|
|
@@ -4838,44 +5268,74 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4838
5268
|
isWindowDefined && window.document.removeEventListener('custom-login', handleExternalLogin);
|
|
4839
5269
|
};
|
|
4840
5270
|
}, []);
|
|
5271
|
+
|
|
5272
|
+
var handleGetTicketClick = function handleGetTicketClick() {
|
|
5273
|
+
if (!handleBookIsLoading && !_isEmpty(selectedTickets) && Object.values(selectedTickets)[0] > 0) {
|
|
5274
|
+
handleBook();
|
|
5275
|
+
} else {
|
|
5276
|
+
if (isButtonScrollable && ticketsContainerRef && ticketsContainerRef.current) {
|
|
5277
|
+
ticketsContainerRef.current.scrollIntoView({
|
|
5278
|
+
behavior: 'smooth',
|
|
5279
|
+
block: 'center',
|
|
5280
|
+
inline: 'nearest'
|
|
5281
|
+
});
|
|
5282
|
+
}
|
|
5283
|
+
}
|
|
5284
|
+
};
|
|
5285
|
+
|
|
5286
|
+
var bookButtonIsDisabled = handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0;
|
|
5287
|
+
var wrappedActionsSectionComponent = React.isValidElement(ActionsSectionComponent) ? React.cloneElement(ActionsSectionComponent, {
|
|
5288
|
+
handleGetTicketClick: handleGetTicketClick,
|
|
5289
|
+
isTicketOnSale: isTicketOnSale
|
|
5290
|
+
}) : null;
|
|
5291
|
+
var externalUrl = event == null ? void 0 : event.redirectUrl;
|
|
5292
|
+
var eventSaleIsNotStarted = !(event != null && event.salesStarted) && (event == null ? void 0 : event.salesStart);
|
|
4841
5293
|
return React.createElement(ThemeProvider$1, {
|
|
4842
5294
|
theme: themeMui
|
|
4843
|
-
}, React.createElement(ReferralLogic, {
|
|
5295
|
+
}, !isLoading && React.createElement(ReferralLogic, {
|
|
4844
5296
|
eventId: eventId
|
|
4845
5297
|
}), React.createElement("div", {
|
|
4846
5298
|
className: "get-tickets-page " + theme,
|
|
4847
5299
|
style: contentStyle
|
|
4848
|
-
}, isLoading ? React.createElement(Loader, null) : React.createElement("div",
|
|
5300
|
+
}, isLoading ? React.createElement(Loader, null) : React.createElement("div", {
|
|
5301
|
+
ref: ticketsContainerRef
|
|
5302
|
+
}, !isSalesClosed && React.createElement(TicketsSection, {
|
|
4849
5303
|
ticketsList: tickets,
|
|
4850
5304
|
selectedTickets: selectedTickets,
|
|
4851
5305
|
handleTicketSelect: handleTicketSelect,
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
},
|
|
5306
|
+
sortBySoldOut: sortBySoldOut,
|
|
5307
|
+
ticketsHeaderComponent: ticketsHeaderComponent,
|
|
5308
|
+
hideTicketsHeader: hideTicketsHeader || _isEmpty(tickets)
|
|
5309
|
+
}), externalUrl ? null : isSalesClosed ? React.createElement("p", {
|
|
5310
|
+
className: "event-closed-message " + (!isLoggedIn ? 'event-closed-on-bottom' : '')
|
|
5311
|
+
}, "Sales for this event are closed.") : eventSaleIsNotStarted ? React.createElement(Countdown, {
|
|
4856
5312
|
startDate: event.salesStart,
|
|
4857
5313
|
timezone: event.timezone,
|
|
4858
5314
|
title: "Sales start in:",
|
|
4859
5315
|
message: "No tickets are currently available for this event.",
|
|
4860
|
-
|
|
5316
|
+
showMessage: !eventHasTickets,
|
|
5317
|
+
callback: updateTickets,
|
|
5318
|
+
disableLeadingZero: disableCountdownLeadingZero,
|
|
5319
|
+
isLoggedIn: isLoggedIn
|
|
4861
5320
|
}) : null, showWaitingList && event.salesStarted && !hideWaitingList && React.createElement(WaitingList, {
|
|
4862
5321
|
tickets: tickets,
|
|
4863
5322
|
eventId: eventId
|
|
4864
|
-
}), React.createElement(
|
|
4865
|
-
|
|
4866
|
-
|
|
5323
|
+
}), codeIsLoading ? React.createElement(Loader, null) : isSalesClosed ? null : showAccessCodeSection ? React.createElement(AccessCodeSection, {
|
|
5324
|
+
code: code,
|
|
5325
|
+
setCode: setCode,
|
|
5326
|
+
updateTickets: updateTickets
|
|
5327
|
+
}) : showPromoCodeSection ? React.createElement(PromoCodeSection, {
|
|
5328
|
+
code: code,
|
|
5329
|
+
codeIsApplied: codeIsApplied,
|
|
5330
|
+
setCodeIsApplied: setCodeIsApplied,
|
|
4867
5331
|
showPromoInput: showPromoInput,
|
|
4868
|
-
setPromoCode: setPromoCode,
|
|
4869
|
-
setPromoCodeUpdated: setPromoCodeUpdated,
|
|
4870
5332
|
setShowPromoInput: setShowPromoInput,
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
isPromoLoading: isPromoLoading
|
|
4875
|
-
}), (isTicketOnSale || !(event != null && event.salesEnded)) && React.createElement(Button$1, {
|
|
5333
|
+
setCode: setCode,
|
|
5334
|
+
updateTickets: updateTickets
|
|
5335
|
+
}) : null, wrappedActionsSectionComponent, !wrappedActionsSectionComponent && !eventSaleIsNotStarted && isTicketOnSale && !(event != null && event.salesEnded) && !externalUrl && React.createElement(Button$1, {
|
|
4876
5336
|
"aria-hidden": true,
|
|
4877
|
-
className: "book-button " + (
|
|
4878
|
-
onClick:
|
|
5337
|
+
className: "book-button \n " + (bookButtonIsDisabled ? 'disabled' : '') + " \n " + (isButtonScrollable ? 'is-scrollable' : '') + "\n " + (!isLoggedIn ? 'on-bottom' : '') + "\n ",
|
|
5338
|
+
onClick: handleGetTicketClick
|
|
4879
5339
|
}, getTicketsLabel || 'GET TICKETS'), isLogged && !hideSessionButtons ? React.createElement("div", {
|
|
4880
5340
|
className: "session-wrapper"
|
|
4881
5341
|
}, React.createElement("span", {
|
|
@@ -4913,10 +5373,7 @@ var tableConfig = function tableConfig(key) {
|
|
|
4913
5373
|
switch (key) {
|
|
4914
5374
|
default:
|
|
4915
5375
|
config = {
|
|
4916
|
-
header: ['Order No.', 'Date', 'Event', 'Total'],
|
|
4917
5376
|
body: [function (row) {
|
|
4918
|
-
return row.id;
|
|
4919
|
-
}, function (row) {
|
|
4920
5377
|
return row.date;
|
|
4921
5378
|
}, function (row) {
|
|
4922
5379
|
return React.createElement(EventInfoItem, {
|
|
@@ -4985,16 +5442,30 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
4985
5442
|
|
|
4986
5443
|
var _useState4 = useState(''),
|
|
4987
5444
|
filter = _useState4[0],
|
|
4988
|
-
setFilter = _useState4[1];
|
|
5445
|
+
setFilter = _useState4[1];
|
|
5446
|
+
|
|
5447
|
+
var isWindowDefined = typeof window !== 'undefined';
|
|
5448
|
+
|
|
5449
|
+
var _useState5 = useState(isWindowDefined ? !!window.localStorage.getItem('access_token') : false),
|
|
5450
|
+
isLogged = _useState5[0],
|
|
5451
|
+
setIsLogged = _useState5[1];
|
|
5452
|
+
|
|
5453
|
+
var _useState6 = useState(false),
|
|
5454
|
+
showModalLogin = _useState6[0],
|
|
5455
|
+
setShowModalLogin = _useState6[1];
|
|
5456
|
+
|
|
5457
|
+
var _useState7 = useState(false),
|
|
5458
|
+
userExpired = _useState7[0],
|
|
5459
|
+
setUserExpired = _useState7[1]; //just once
|
|
4989
5460
|
|
|
4990
5461
|
|
|
4991
5462
|
useEffect(function () {
|
|
4992
5463
|
fetchData(1, limit, filter);
|
|
4993
|
-
}, []);
|
|
5464
|
+
}, [isLogged]);
|
|
4994
5465
|
|
|
4995
5466
|
var fetchData = /*#__PURE__*/function () {
|
|
4996
5467
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(page, limit, filter) {
|
|
4997
|
-
var response, _data;
|
|
5468
|
+
var response, _data, _error$response;
|
|
4998
5469
|
|
|
4999
5470
|
return runtime_1.wrap(function _callee$(_context) {
|
|
5000
5471
|
while (1) {
|
|
@@ -5011,25 +5482,37 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5011
5482
|
_data = _get(response, 'data.data.attributes');
|
|
5012
5483
|
_data.page -= 1;
|
|
5013
5484
|
setData(_data);
|
|
5014
|
-
_context.next =
|
|
5485
|
+
_context.next = 15;
|
|
5015
5486
|
break;
|
|
5016
5487
|
|
|
5017
5488
|
case 11:
|
|
5018
5489
|
_context.prev = 11;
|
|
5019
5490
|
_context.t0 = _context["catch"](0);
|
|
5491
|
+
|
|
5492
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
5493
|
+
if (((_error$response = _context.t0.response) == null ? void 0 : _error$response.data.error) === 'invalid_token') {
|
|
5494
|
+
if (isWindowDefined) {
|
|
5495
|
+
window.localStorage.removeItem('user_data');
|
|
5496
|
+
window.localStorage.removeItem('access_token');
|
|
5497
|
+
setUserExpired(true);
|
|
5498
|
+
setShowModalLogin(true);
|
|
5499
|
+
}
|
|
5500
|
+
}
|
|
5501
|
+
}
|
|
5502
|
+
|
|
5020
5503
|
onGetOrdersError(_context.t0);
|
|
5021
5504
|
|
|
5022
|
-
case
|
|
5023
|
-
_context.prev =
|
|
5505
|
+
case 15:
|
|
5506
|
+
_context.prev = 15;
|
|
5024
5507
|
setLoading(false);
|
|
5025
|
-
return _context.finish(
|
|
5508
|
+
return _context.finish(15);
|
|
5026
5509
|
|
|
5027
|
-
case
|
|
5510
|
+
case 18:
|
|
5028
5511
|
case "end":
|
|
5029
5512
|
return _context.stop();
|
|
5030
5513
|
}
|
|
5031
5514
|
}
|
|
5032
|
-
}, _callee, null, [[0, 11,
|
|
5515
|
+
}, _callee, null, [[0, 11, 15, 18]]);
|
|
5033
5516
|
}));
|
|
5034
5517
|
|
|
5035
5518
|
return function fetchData(_x, _x2, _x3) {
|
|
@@ -5055,7 +5538,24 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5055
5538
|
className: "my-ticket " + theme
|
|
5056
5539
|
}, loading && React.createElement("div", {
|
|
5057
5540
|
className: "loading"
|
|
5058
|
-
}, React.createElement(CircularProgress, null)),
|
|
5541
|
+
}, React.createElement(CircularProgress, null)), !isLogged ? React.createElement("div", {
|
|
5542
|
+
className: "account-actions-block"
|
|
5543
|
+
}, React.createElement("div", {
|
|
5544
|
+
className: "login-block"
|
|
5545
|
+
}, React.createElement("button", {
|
|
5546
|
+
className: "login-register-button",
|
|
5547
|
+
type: "button",
|
|
5548
|
+
onClick: function onClick() {
|
|
5549
|
+
setShowModalLogin(true);
|
|
5550
|
+
}
|
|
5551
|
+
}, "Login"), React.createElement("div", {
|
|
5552
|
+
className: "logo-image-container"
|
|
5553
|
+
}, React.createElement("img", {
|
|
5554
|
+
src: theme === 'dark' ? 'https://www.ticketfairy.com/resources/images/logo-ttf.svg' : 'https://www.ticketfairy.com/resources/images/logo-ttf-black.svg',
|
|
5555
|
+
alt: "nodata"
|
|
5556
|
+
})))) : null, data && React.createElement(React.Fragment, null, React.createElement("h2", null, "My Ticket Orders"), React.createElement("div", {
|
|
5557
|
+
className: "order_event"
|
|
5558
|
+
}, React.createElement(Autocomplete, {
|
|
5059
5559
|
disablePortal: true,
|
|
5060
5560
|
id: "combo-box-demo",
|
|
5061
5561
|
getOptionLabel: function getOptionLabel(option) {
|
|
@@ -5071,16 +5571,14 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5071
5571
|
label: "Events"
|
|
5072
5572
|
}));
|
|
5073
5573
|
}
|
|
5074
|
-
}), React.createElement(
|
|
5574
|
+
}), React.createElement("button", {
|
|
5575
|
+
className: "clear"
|
|
5576
|
+
}, "CLEAR")), React.createElement(TableContainer, {
|
|
5075
5577
|
component: Paper,
|
|
5076
5578
|
className: "my-ticket-table"
|
|
5077
5579
|
}, React.createElement(Table, {
|
|
5078
5580
|
"aria-label": "collapsible table"
|
|
5079
|
-
}, React.createElement(
|
|
5080
|
-
return React.createElement(TableCell, {
|
|
5081
|
-
key: index
|
|
5082
|
-
}, column);
|
|
5083
|
-
}), React.createElement(TableCell, null))), React.createElement(TableBody, null, (_data$orders = data.orders) == null ? void 0 : _data$orders.map(function (row) {
|
|
5581
|
+
}, React.createElement(TableBody, null, (_data$orders = data.orders) == null ? void 0 : _data$orders.map(function (row) {
|
|
5084
5582
|
return React.createElement(Row, {
|
|
5085
5583
|
key: row.id,
|
|
5086
5584
|
row: row,
|
|
@@ -5094,6 +5592,16 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5094
5592
|
page: data.page,
|
|
5095
5593
|
onPageChange: handleChangePage,
|
|
5096
5594
|
onRowsPerPageChange: handleChangeRowsPerPage
|
|
5595
|
+
})), React.createElement(React.Fragment, null, showModalLogin && React.createElement(LoginModal, {
|
|
5596
|
+
onClose: function onClose() {
|
|
5597
|
+
setShowModalLogin(false);
|
|
5598
|
+
},
|
|
5599
|
+
onLogin: function onLogin() {
|
|
5600
|
+
setShowModalLogin(false);
|
|
5601
|
+
setUserExpired(false);
|
|
5602
|
+
setIsLogged(true);
|
|
5603
|
+
},
|
|
5604
|
+
userExpired: userExpired
|
|
5097
5605
|
})));
|
|
5098
5606
|
};
|
|
5099
5607
|
|
|
@@ -5103,27 +5611,94 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
5103
5611
|
_ref$handleSellTicket = _ref.handleSellTicket,
|
|
5104
5612
|
handleSellTicket = _ref$handleSellTicket === void 0 ? function () {} : _ref$handleSellTicket,
|
|
5105
5613
|
_ref$handleRemoveFrom = _ref.handleRemoveFromResale,
|
|
5106
|
-
handleRemoveFromResale = _ref$handleRemoveFrom === void 0 ? function () {} : _ref$handleRemoveFrom
|
|
5614
|
+
handleRemoveFromResale = _ref$handleRemoveFrom === void 0 ? function () {} : _ref$handleRemoveFrom,
|
|
5615
|
+
_ref$icon = _ref.icon,
|
|
5616
|
+
icon = _ref$icon === void 0 ? '' : _ref$icon;
|
|
5617
|
+
|
|
5618
|
+
var _useState = useState(null),
|
|
5619
|
+
pdfError = _useState[0],
|
|
5620
|
+
setPdfError = _useState[1];
|
|
5621
|
+
|
|
5107
5622
|
return React.createElement("div", {
|
|
5108
5623
|
className: "tickets-box"
|
|
5109
|
-
}, React.createElement(
|
|
5624
|
+
}, React.createElement(SnackbarAlert, {
|
|
5625
|
+
type: "error",
|
|
5626
|
+
isOpen: !!pdfError,
|
|
5627
|
+
message: pdfError || '',
|
|
5628
|
+
onClose: function onClose() {
|
|
5629
|
+
return setPdfError(null);
|
|
5630
|
+
}
|
|
5631
|
+
}), React.createElement("h4", {
|
|
5110
5632
|
className: "sub-title"
|
|
5111
5633
|
}, "Your Tickets"), React.createElement(TableContainer, {
|
|
5112
5634
|
component: Paper
|
|
5113
5635
|
}, React.createElement(Table, {
|
|
5114
5636
|
"aria-label": "collapsible table"
|
|
5115
|
-
}, React.createElement(TableHead, null, React.createElement(TableRow, null, React.createElement(TableCell, null
|
|
5637
|
+
}, React.createElement(TableHead, null, React.createElement(TableRow, null, React.createElement(TableCell, null), React.createElement(TableCell, null), React.createElement(TableCell, null), React.createElement(TableCell, null), React.createElement(TableCell, null), React.createElement(TableCell, null))), React.createElement(TableBody, null, tickets.map(function (ticket, index) {
|
|
5116
5638
|
var _ticket$add_ons;
|
|
5117
5639
|
|
|
5118
5640
|
return React.createElement(Fragment, {
|
|
5119
5641
|
key: index
|
|
5120
|
-
}, React.createElement(TableRow, null, React.createElement(TableCell, null,
|
|
5642
|
+
}, React.createElement(TableRow, null, React.createElement(TableCell, null, React.createElement("div", {
|
|
5643
|
+
className: "cell-block"
|
|
5644
|
+
}, React.createElement("span", null, "Ticket ID"), React.createElement("span", null, ticket.hash))), React.createElement(TableCell, null, React.createElement("div", {
|
|
5645
|
+
className: "cell-block"
|
|
5646
|
+
}, React.createElement("span", null, "Ticket Type"), React.createElement("span", null, ticket.ticket_type))), React.createElement(TableCell, null, React.createElement("div", {
|
|
5647
|
+
className: "cell-block"
|
|
5648
|
+
}, React.createElement("span", null, "Ticket Holder"), React.createElement("span", null, ticket.holder_name))), React.createElement(TableCell, null, React.createElement("div", {
|
|
5649
|
+
className: "cell-block"
|
|
5650
|
+
}, React.createElement("span", null, "Status"), React.createElement("span", null, ticket.status))), React.createElement(TableCell, null, ticket.status !== 'Sold' && React.createElement("div", {
|
|
5651
|
+
className: "tb-download"
|
|
5652
|
+
}, Boolean(icon) && React.createElement("img", {
|
|
5653
|
+
src: icon,
|
|
5654
|
+
alt: ""
|
|
5655
|
+
}), React.createElement("span", {
|
|
5121
5656
|
"aria-hidden": true,
|
|
5122
5657
|
className: "action-button",
|
|
5123
|
-
onClick: function
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5658
|
+
onClick: function () {
|
|
5659
|
+
var _onClick = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
5660
|
+
var pdfDownloadError;
|
|
5661
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
5662
|
+
while (1) {
|
|
5663
|
+
switch (_context.prev = _context.next) {
|
|
5664
|
+
case 0:
|
|
5665
|
+
_context.prev = 0;
|
|
5666
|
+
_context.next = 3;
|
|
5667
|
+
return downloadPDF(ticket.pdf_link);
|
|
5668
|
+
|
|
5669
|
+
case 3:
|
|
5670
|
+
pdfDownloadError = _context.sent;
|
|
5671
|
+
|
|
5672
|
+
if (pdfDownloadError) {
|
|
5673
|
+
setPdfError(pdfDownloadError == null ? void 0 : pdfDownloadError.message);
|
|
5674
|
+
}
|
|
5675
|
+
|
|
5676
|
+
_context.next = 10;
|
|
5677
|
+
break;
|
|
5678
|
+
|
|
5679
|
+
case 7:
|
|
5680
|
+
_context.prev = 7;
|
|
5681
|
+
_context.t0 = _context["catch"](0);
|
|
5682
|
+
|
|
5683
|
+
if (_context.t0 && typeof _context.t0 === 'string') {
|
|
5684
|
+
setPdfError(_context.t0);
|
|
5685
|
+
}
|
|
5686
|
+
|
|
5687
|
+
case 10:
|
|
5688
|
+
case "end":
|
|
5689
|
+
return _context.stop();
|
|
5690
|
+
}
|
|
5691
|
+
}
|
|
5692
|
+
}, _callee, null, [[0, 7]]);
|
|
5693
|
+
}));
|
|
5694
|
+
|
|
5695
|
+
function onClick() {
|
|
5696
|
+
return _onClick.apply(this, arguments);
|
|
5697
|
+
}
|
|
5698
|
+
|
|
5699
|
+
return onClick;
|
|
5700
|
+
}()
|
|
5701
|
+
}, "Download"))), React.createElement(TableCell, null, ticket.is_sellable && React.createElement("span", {
|
|
5127
5702
|
"aria-hidden": true,
|
|
5128
5703
|
className: "action-button",
|
|
5129
5704
|
onClick: function onClick() {
|
|
@@ -5223,7 +5798,8 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
|
|
|
5223
5798
|
holder_name = ticket.holder_name,
|
|
5224
5799
|
event_name = ticket.event_name,
|
|
5225
5800
|
currency = ticket.currency,
|
|
5226
|
-
resale_fee_amount = ticket.resale_fee_amount
|
|
5801
|
+
resale_fee_amount = ticket.resale_fee_amount,
|
|
5802
|
+
ticket_type_is_active = ticket.ticket_type_is_active;
|
|
5227
5803
|
return React.createElement(Modal, {
|
|
5228
5804
|
open: true,
|
|
5229
5805
|
onClose: onClose,
|
|
@@ -5296,13 +5872,13 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
|
|
|
5296
5872
|
label: 'Confirm Email address',
|
|
5297
5873
|
type: 'text',
|
|
5298
5874
|
component: CustomField
|
|
5299
|
-
}))))), React.createElement("div", null, React.createElement(Field, {
|
|
5300
|
-
name:
|
|
5301
|
-
label:
|
|
5302
|
-
type:
|
|
5303
|
-
value:
|
|
5875
|
+
}))))), ticket_type_is_active && React.createElement("div", null, React.createElement(Field, {
|
|
5876
|
+
name: "to",
|
|
5877
|
+
label: "I will sell my ticket to anyone who wants to buy it",
|
|
5878
|
+
type: "radio",
|
|
5879
|
+
value: "anyone",
|
|
5304
5880
|
component: RadioField
|
|
5305
|
-
})), React.createElement("div", null, React.createElement("h4", null, "Terms of Resale"), React.createElement("p", null, "I confirm that I want to sell this ticket and that, if someone chooses to buy it, I will no longer own it or have the right to ask for it back."), React.createElement("p", null, "I also understand that, if no one chooses to buy it, it remains my property, is valid for entry to ", React.createElement("strong", null, event_name), " and I will not receive any refund."), React.createElement("p", null, "If my ticket is sold, the original card I used to buy my ticket will be refunded with the original amount paid, minus a small handling fee of ", React.createElement("strong", null, currency + resale_fee_amount), ", and that any existing refunds due to me for referring sales for this event are no longer valid."), React.createElement(Field, {
|
|
5881
|
+
})), React.createElement("div", null, React.createElement("h4", null, "Terms of Resale"), React.createElement("p", null, "I confirm that I want to sell this ticket and that, if someone chooses to buy it, I will no longer own it or have the right to ask for it back."), React.createElement("p", null, "I also understand that, if no one chooses to buy it, it remains my property, is valid for entry to ", React.createElement("strong", null, event_name), " and I will not receive any refund."), React.createElement("p", null, "If my ticket is sold, the original card I used to buy my ticket will be refunded with the original amount paid, minus a small handling fee of ", React.createElement("strong", null, (currency || '') + " " + (resale_fee_amount || '')), ", and that any existing refunds due to me for referring sales for this event are no longer valid."), React.createElement(Field, {
|
|
5306
5882
|
name: 'confirm',
|
|
5307
5883
|
label: 'I agree',
|
|
5308
5884
|
type: 'checkbox',
|
|
@@ -5362,10 +5938,14 @@ var getTotal = function getTotal(data) {
|
|
|
5362
5938
|
var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
5363
5939
|
var _data$items, _data$items$ticket_ty, _data$items2, _data$items2$add_ons;
|
|
5364
5940
|
|
|
5365
|
-
var _ref$
|
|
5941
|
+
var _ref$columns = _ref.columns,
|
|
5942
|
+
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
5943
|
+
_ref$onGetOrdersSucce = _ref.onGetOrdersSuccess,
|
|
5366
5944
|
onGetOrdersSuccess = _ref$onGetOrdersSucce === void 0 ? function () {} : _ref$onGetOrdersSucce,
|
|
5367
5945
|
_ref$onGetOrdersError = _ref.onGetOrdersError,
|
|
5368
|
-
onGetOrdersError = _ref$onGetOrdersError === void 0 ? function () {} : _ref$onGetOrdersError
|
|
5946
|
+
onGetOrdersError = _ref$onGetOrdersError === void 0 ? function () {} : _ref$onGetOrdersError,
|
|
5947
|
+
_ref$personalLinkIcon = _ref.personalLinkIcon,
|
|
5948
|
+
personalLinkIcon = _ref$personalLinkIcon === void 0 ? '' : _ref$personalLinkIcon;
|
|
5369
5949
|
|
|
5370
5950
|
var _useState = useState({}),
|
|
5371
5951
|
data = _useState[0],
|
|
@@ -5435,7 +6015,15 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5435
6015
|
}, []);
|
|
5436
6016
|
|
|
5437
6017
|
var handleSellTicket = function handleSellTicket(ticket) {
|
|
5438
|
-
|
|
6018
|
+
var ticketTypesArr = data.items.ticket_types;
|
|
6019
|
+
|
|
6020
|
+
var sellTicketType = _find(ticketTypesArr, function (ticketType) {
|
|
6021
|
+
return ticketType.hash === ticket.ticket_type_hash;
|
|
6022
|
+
});
|
|
6023
|
+
|
|
6024
|
+
setActiveTicket(_extends({}, ticket, {
|
|
6025
|
+
ticket_type_is_active: sellTicketType == null ? void 0 : sellTicketType.active
|
|
6026
|
+
}));
|
|
5439
6027
|
setShowResaleModal(true);
|
|
5440
6028
|
};
|
|
5441
6029
|
|
|
@@ -5558,6 +6146,12 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5558
6146
|
};
|
|
5559
6147
|
}();
|
|
5560
6148
|
|
|
6149
|
+
var orderSummery = "ID " + data.id + ", placed";
|
|
6150
|
+
|
|
6151
|
+
if (data.date) {
|
|
6152
|
+
orderSummery += " " + data.date;
|
|
6153
|
+
}
|
|
6154
|
+
|
|
5561
6155
|
return React.createElement("div", {
|
|
5562
6156
|
className: "order-details"
|
|
5563
6157
|
}, loading ? React.createElement("div", {
|
|
@@ -5566,19 +6160,45 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5566
6160
|
className: "layout-title"
|
|
5567
6161
|
}, "Order Details"), React.createElement("div", {
|
|
5568
6162
|
className: "order-summary-box"
|
|
5569
|
-
}, React.createElement("
|
|
6163
|
+
}, React.createElement("div", {
|
|
6164
|
+
className: "summary-block"
|
|
6165
|
+
}, React.createElement("div", {
|
|
6166
|
+
className: "summary-item"
|
|
6167
|
+
}, React.createElement("h6", {
|
|
5570
6168
|
className: "sub-title"
|
|
5571
|
-
}, "Order Summary"), React.createElement("div", {
|
|
6169
|
+
}, "Order Summary"), React.createElement("p", null, orderSummery)), React.createElement("div", {
|
|
6170
|
+
className: "summary-item"
|
|
6171
|
+
}, React.createElement("div", {
|
|
6172
|
+
className: "return-button-container"
|
|
6173
|
+
}, React.createElement("button", {
|
|
6174
|
+
type: "button",
|
|
6175
|
+
className: "return-button",
|
|
6176
|
+
onClick: function onClick() {
|
|
6177
|
+
if (typeof window !== 'undefined') {
|
|
6178
|
+
window.location.assign('/orders');
|
|
6179
|
+
}
|
|
6180
|
+
}
|
|
6181
|
+
}, "Back to Orders")))), React.createElement("div", {
|
|
5572
6182
|
className: "personal-link"
|
|
5573
|
-
}, React.createElement("
|
|
6183
|
+
}, React.createElement("div", {
|
|
6184
|
+
className: "link-item"
|
|
6185
|
+
}, React.createElement("span", null, "Personal Share Link: "), React.createElement("a", {
|
|
5574
6186
|
href: data == null ? void 0 : data.personal_share_link,
|
|
5575
6187
|
target: "_blank",
|
|
5576
6188
|
rel: "noreferrer"
|
|
5577
|
-
},
|
|
6189
|
+
}, Boolean(personalLinkIcon) && React.createElement("img", {
|
|
6190
|
+
src: personalLinkIcon,
|
|
6191
|
+
alt: "Icon"
|
|
6192
|
+
}), data == null ? void 0 : data.personal_share_link)), React.createElement("div", {
|
|
6193
|
+
className: "link-item"
|
|
6194
|
+
}, React.createElement("p", null, "So far, you\u2019ve referred " + data.sales_referred + " tickets"))), React.createElement(TableContainer, {
|
|
5578
6195
|
component: Paper
|
|
5579
6196
|
}, React.createElement(Table, {
|
|
6197
|
+
className: "tt-type",
|
|
5580
6198
|
"aria-label": "collapsible table"
|
|
5581
|
-
}, React.createElement(TableHead, null, React.createElement(TableRow, null,
|
|
6199
|
+
}, React.createElement(TableHead, null, React.createElement(TableRow, null, _map(columns, function (item) {
|
|
6200
|
+
return React.createElement(TableCell, null, item.label || '');
|
|
6201
|
+
}))), React.createElement(TableBody, null, data == null ? void 0 : (_data$items = data.items) == null ? void 0 : (_data$items$ticket_ty = _data$items.ticket_types) == null ? void 0 : _data$items$ticket_ty.map(function (ticket, index) {
|
|
5582
6202
|
return React.createElement(TableRow, {
|
|
5583
6203
|
key: index
|
|
5584
6204
|
}, React.createElement(TableCell, null, React.createElement("b", null, "Ticket Type: "), ticket.name), React.createElement(TableCell, null, ticket.currency + ticket.price), React.createElement(TableCell, null, ticket.quantity), React.createElement(TableCell, null, ticket.currency + ticket.total));
|
|
@@ -5592,17 +6212,7 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5592
6212
|
tickets: data.tickets,
|
|
5593
6213
|
handleSellTicket: handleSellTicket,
|
|
5594
6214
|
handleRemoveFromResale: handleRemoveFromResale
|
|
5595
|
-
}), React.createElement(
|
|
5596
|
-
className: "return-button-container"
|
|
5597
|
-
}, React.createElement("button", {
|
|
5598
|
-
type: "button",
|
|
5599
|
-
className: "return-button",
|
|
5600
|
-
onClick: function onClick() {
|
|
5601
|
-
if (typeof window !== 'undefined') {
|
|
5602
|
-
window.location.assign('/orders');
|
|
5603
|
-
}
|
|
5604
|
-
}
|
|
5605
|
-
}, "Return to Order History"))), showResaleModal && React.createElement(TicketResaleModal, {
|
|
6215
|
+
})), showResaleModal && React.createElement(TicketResaleModal, {
|
|
5606
6216
|
ticket: activeTicket,
|
|
5607
6217
|
onClose: handleOnClose,
|
|
5608
6218
|
onSubmit: handleOnSubmit
|
|
@@ -5614,81 +6224,294 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5614
6224
|
};
|
|
5615
6225
|
|
|
5616
6226
|
var TicketResaleContainer = function TicketResaleContainer(_ref) {
|
|
5617
|
-
var _ref$
|
|
5618
|
-
|
|
5619
|
-
_ref$
|
|
5620
|
-
|
|
6227
|
+
var _ref$onProcessTicketS = _ref.onProcessTicketSuccess,
|
|
6228
|
+
onProcessTicketSuccess = _ref$onProcessTicketS === void 0 ? function () {} : _ref$onProcessTicketS,
|
|
6229
|
+
_ref$onProcessTicketE = _ref.onProcessTicketError,
|
|
6230
|
+
onProcessTicketError = _ref$onProcessTicketE === void 0 ? function () {} : _ref$onProcessTicketE,
|
|
6231
|
+
_ref$onDeclineTicketP = _ref.onDeclineTicketPurchaseSuccess,
|
|
6232
|
+
onDeclineTicketPurchaseSuccess = _ref$onDeclineTicketP === void 0 ? function () {} : _ref$onDeclineTicketP,
|
|
6233
|
+
_ref$onDeclineTicketP2 = _ref.onDeclineTicketPurchaseError,
|
|
6234
|
+
onDeclineTicketPurchaseError = _ref$onDeclineTicketP2 === void 0 ? function () {} : _ref$onDeclineTicketP2,
|
|
5621
6235
|
orderHash = _ref.orderHash;
|
|
5622
6236
|
var isWindowDefined = typeof window !== 'undefined';
|
|
5623
6237
|
|
|
5624
|
-
var _useState = useState(
|
|
6238
|
+
var _useState = useState(''),
|
|
5625
6239
|
error = _useState[0],
|
|
5626
6240
|
setError = _useState[1];
|
|
5627
6241
|
|
|
6242
|
+
var _useState2 = useState(''),
|
|
6243
|
+
successMessage = _useState2[0],
|
|
6244
|
+
setSuccessMessage = _useState2[1];
|
|
6245
|
+
|
|
5628
6246
|
useEffect(function () {
|
|
5629
6247
|
_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
5630
|
-
var params, hash, response, data, age_required, names_required, event_id, _error$
|
|
6248
|
+
var params, hash, isDeclined, response, _error$response, _error$response$data, _response, data, age_required, names_required, event_id, _error$response2, _error$response2$data;
|
|
5631
6249
|
|
|
5632
6250
|
return runtime_1.wrap(function _callee$(_context) {
|
|
5633
6251
|
while (1) {
|
|
5634
6252
|
switch (_context.prev = _context.next) {
|
|
5635
6253
|
case 0:
|
|
5636
6254
|
if (!isWindowDefined) {
|
|
5637
|
-
_context.next =
|
|
6255
|
+
_context.next = 38;
|
|
5638
6256
|
break;
|
|
5639
6257
|
}
|
|
5640
6258
|
|
|
5641
6259
|
params = new URL("" + window.location).searchParams;
|
|
5642
|
-
hash = params.get('
|
|
6260
|
+
hash = params.get('invitation_hash') || orderHash || null;
|
|
6261
|
+
isDeclined = params.get('decline') || false;
|
|
5643
6262
|
|
|
5644
6263
|
if (!hash) {
|
|
5645
|
-
_context.next =
|
|
6264
|
+
_context.next = 37;
|
|
5646
6265
|
break;
|
|
5647
6266
|
}
|
|
5648
6267
|
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
6268
|
+
if (!isDeclined) {
|
|
6269
|
+
_context.next = 19;
|
|
6270
|
+
break;
|
|
6271
|
+
}
|
|
5652
6272
|
|
|
5653
|
-
|
|
6273
|
+
_context.prev = 6;
|
|
6274
|
+
_context.next = 9;
|
|
6275
|
+
return declineInvitation(hash);
|
|
6276
|
+
|
|
6277
|
+
case 9:
|
|
5654
6278
|
response = _context.sent;
|
|
5655
|
-
|
|
6279
|
+
onDeclineTicketPurchaseSuccess(response);
|
|
6280
|
+
setSuccessMessage("Thanks for letting us know! We'll offer this ticket to someone else!");
|
|
6281
|
+
_context.next = 18;
|
|
6282
|
+
break;
|
|
6283
|
+
|
|
6284
|
+
case 14:
|
|
6285
|
+
_context.prev = 14;
|
|
6286
|
+
_context.t0 = _context["catch"](6);
|
|
6287
|
+
setError(_context.t0 == null ? void 0 : (_error$response = _context.t0.response) == null ? void 0 : (_error$response$data = _error$response.data) == null ? void 0 : _error$response$data.message);
|
|
6288
|
+
onDeclineTicketPurchaseError(_context.t0.response);
|
|
6289
|
+
|
|
6290
|
+
case 18:
|
|
6291
|
+
return _context.abrupt("return");
|
|
6292
|
+
|
|
6293
|
+
case 19:
|
|
6294
|
+
_context.prev = 19;
|
|
6295
|
+
_context.next = 22;
|
|
6296
|
+
return processTicket(hash);
|
|
6297
|
+
|
|
6298
|
+
case 22:
|
|
6299
|
+
_response = _context.sent;
|
|
6300
|
+
data = _get(_response, 'data.data.attributes');
|
|
5656
6301
|
age_required = _get(data, 'age_required', false);
|
|
5657
6302
|
names_required = _get(data, 'names_required', false);
|
|
5658
6303
|
event_id = _get(data, 'event_id');
|
|
5659
|
-
|
|
6304
|
+
onProcessTicketSuccess(_response.data);
|
|
5660
6305
|
window.location.href = "/billing/billing-info/?age_required=" + age_required + "&names_required=" + names_required + "&event_id=" + event_id;
|
|
5661
|
-
_context.next =
|
|
6306
|
+
_context.next = 35;
|
|
5662
6307
|
break;
|
|
5663
6308
|
|
|
5664
|
-
case
|
|
5665
|
-
_context.prev =
|
|
5666
|
-
_context.
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
onCheckTicketStatusError(_context.t0.response);
|
|
6309
|
+
case 31:
|
|
6310
|
+
_context.prev = 31;
|
|
6311
|
+
_context.t1 = _context["catch"](19);
|
|
6312
|
+
setError(_context.t1 == null ? void 0 : (_error$response2 = _context.t1.response) == null ? void 0 : (_error$response2$data = _error$response2.data) == null ? void 0 : _error$response2$data.message);
|
|
6313
|
+
onProcessTicketError(_context.t1.response);
|
|
5670
6314
|
|
|
5671
|
-
case
|
|
5672
|
-
_context.next =
|
|
6315
|
+
case 35:
|
|
6316
|
+
_context.next = 38;
|
|
5673
6317
|
break;
|
|
5674
6318
|
|
|
5675
|
-
case
|
|
6319
|
+
case 37:
|
|
5676
6320
|
window.location.href = '/';
|
|
5677
6321
|
|
|
5678
|
-
case
|
|
6322
|
+
case 38:
|
|
5679
6323
|
case "end":
|
|
5680
6324
|
return _context.stop();
|
|
5681
6325
|
}
|
|
5682
6326
|
}
|
|
5683
|
-
}, _callee, null, [[
|
|
6327
|
+
}, _callee, null, [[6, 14], [19, 31]]);
|
|
5684
6328
|
}))();
|
|
5685
6329
|
}, []);
|
|
5686
6330
|
return React.createElement("div", {
|
|
5687
6331
|
className: "ticket-resale-page"
|
|
5688
6332
|
}, React.createElement("div", {
|
|
5689
|
-
className: "error-block
|
|
5690
|
-
}, React.createElement("h3", null, error)));
|
|
6333
|
+
className: "" + (successMessage ? 'success-block' : 'error-block')
|
|
6334
|
+
}, React.createElement("h3", null, successMessage ? successMessage : error)));
|
|
6335
|
+
};
|
|
6336
|
+
|
|
6337
|
+
var style$3 = {
|
|
6338
|
+
position: 'absolute',
|
|
6339
|
+
top: '10%',
|
|
6340
|
+
left: '50%',
|
|
6341
|
+
transform: 'translate(-50%, -50%)',
|
|
6342
|
+
minWidth: 480,
|
|
6343
|
+
backgroundColor: '#e3e3e3',
|
|
6344
|
+
border: '1px solid white',
|
|
6345
|
+
outline: 'none',
|
|
6346
|
+
padding: '14px',
|
|
6347
|
+
maxHeight: '85vh',
|
|
6348
|
+
overflow: 'auto'
|
|
6349
|
+
};
|
|
6350
|
+
var RedirectModal = function RedirectModal(_ref) {
|
|
6351
|
+
var _ref$message = _ref.message,
|
|
6352
|
+
message = _ref$message === void 0 ? 'Your cart has expired. Please click on "OK" to return to the ticket selection page.' : _ref$message,
|
|
6353
|
+
_ref$onClickOk = _ref.onClickOk,
|
|
6354
|
+
onClickOk = _ref$onClickOk === void 0 ? function () {} : _ref$onClickOk;
|
|
6355
|
+
return React.createElement(Modal, {
|
|
6356
|
+
open: true,
|
|
6357
|
+
"aria-labelledby": "modal-modal-title",
|
|
6358
|
+
"aria-describedby": "modal-modal-description",
|
|
6359
|
+
className: "redirect-modal"
|
|
6360
|
+
}, React.createElement(Box, {
|
|
6361
|
+
style: style$3
|
|
6362
|
+
}, React.createElement("p", null, message), React.createElement("div", {
|
|
6363
|
+
className: "footer"
|
|
6364
|
+
}, React.createElement("button", {
|
|
6365
|
+
onClick: onClickOk
|
|
6366
|
+
}, "OK"))));
|
|
6367
|
+
};
|
|
6368
|
+
|
|
6369
|
+
var style$4 = {
|
|
6370
|
+
position: 'absolute',
|
|
6371
|
+
top: '50%',
|
|
6372
|
+
left: '50%',
|
|
6373
|
+
transform: 'translate(-50%, -50%)',
|
|
6374
|
+
minWidth: 480,
|
|
6375
|
+
backgroundColor: '#e3e3e3',
|
|
6376
|
+
border: '1px solid white',
|
|
6377
|
+
outline: 'none',
|
|
6378
|
+
padding: '14px',
|
|
6379
|
+
maxHeight: '85vh',
|
|
6380
|
+
overflow: 'auto'
|
|
6381
|
+
};
|
|
6382
|
+
var RsvpContainer = function RsvpContainer(_ref) {
|
|
6383
|
+
var _ref$showSection = _ref.showSection,
|
|
6384
|
+
showSection = _ref$showSection === void 0 ? false : _ref$showSection,
|
|
6385
|
+
eventId = _ref.eventId;
|
|
6386
|
+
var userDataEncoded = typeof window !== 'undefined' ? window.localStorage.getItem('user_data') : '';
|
|
6387
|
+
var parsedData = JSON.parse(userDataEncoded || '{}');
|
|
6388
|
+
|
|
6389
|
+
var _useState = useState(false),
|
|
6390
|
+
loading = _useState[0],
|
|
6391
|
+
setLoading = _useState[1];
|
|
6392
|
+
|
|
6393
|
+
var _useState2 = useState({
|
|
6394
|
+
isOpen: false,
|
|
6395
|
+
text: ''
|
|
6396
|
+
}),
|
|
6397
|
+
modal = _useState2[0],
|
|
6398
|
+
setModal = _useState2[1];
|
|
6399
|
+
|
|
6400
|
+
var handleModalClose = function handleModalClose() {
|
|
6401
|
+
setModal({
|
|
6402
|
+
isOpen: false,
|
|
6403
|
+
text: ''
|
|
6404
|
+
});
|
|
6405
|
+
};
|
|
6406
|
+
|
|
6407
|
+
var handleSubmit = /*#__PURE__*/function () {
|
|
6408
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(values) {
|
|
6409
|
+
var requestData, _yield$sendRSVPInfo, data, _error$response$data;
|
|
6410
|
+
|
|
6411
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
6412
|
+
while (1) {
|
|
6413
|
+
switch (_context.prev = _context.next) {
|
|
6414
|
+
case 0:
|
|
6415
|
+
_context.prev = 0;
|
|
6416
|
+
setLoading(true);
|
|
6417
|
+
requestData = {
|
|
6418
|
+
data: {
|
|
6419
|
+
email: values.email
|
|
6420
|
+
}
|
|
6421
|
+
};
|
|
6422
|
+
_context.next = 5;
|
|
6423
|
+
return sendRSVPInfo(eventId, requestData);
|
|
6424
|
+
|
|
6425
|
+
case 5:
|
|
6426
|
+
_yield$sendRSVPInfo = _context.sent;
|
|
6427
|
+
data = _yield$sendRSVPInfo.data;
|
|
6428
|
+
setModal({
|
|
6429
|
+
isOpen: true,
|
|
6430
|
+
text: data.message
|
|
6431
|
+
});
|
|
6432
|
+
_context.next = 13;
|
|
6433
|
+
break;
|
|
6434
|
+
|
|
6435
|
+
case 10:
|
|
6436
|
+
_context.prev = 10;
|
|
6437
|
+
_context.t0 = _context["catch"](0);
|
|
6438
|
+
|
|
6439
|
+
if (_context.t0.response.status === 403) {
|
|
6440
|
+
setModal({
|
|
6441
|
+
isOpen: true,
|
|
6442
|
+
text: (_error$response$data = _context.t0.response.data) == null ? void 0 : _error$response$data.message
|
|
6443
|
+
});
|
|
6444
|
+
}
|
|
6445
|
+
|
|
6446
|
+
case 13:
|
|
6447
|
+
_context.prev = 13;
|
|
6448
|
+
setLoading(false);
|
|
6449
|
+
return _context.finish(13);
|
|
6450
|
+
|
|
6451
|
+
case 16:
|
|
6452
|
+
case "end":
|
|
6453
|
+
return _context.stop();
|
|
6454
|
+
}
|
|
6455
|
+
}
|
|
6456
|
+
}, _callee, null, [[0, 10, 13, 16]]);
|
|
6457
|
+
}));
|
|
6458
|
+
|
|
6459
|
+
return function handleSubmit(_x) {
|
|
6460
|
+
return _ref2.apply(this, arguments);
|
|
6461
|
+
};
|
|
6462
|
+
}();
|
|
6463
|
+
|
|
6464
|
+
if (!showSection) {
|
|
6465
|
+
return null;
|
|
6466
|
+
}
|
|
6467
|
+
|
|
6468
|
+
return React.createElement(React.Fragment, null, React.createElement(Modal, {
|
|
6469
|
+
open: modal.isOpen,
|
|
6470
|
+
onClose: handleModalClose,
|
|
6471
|
+
"aria-labelledby": "modal-modal-title",
|
|
6472
|
+
"aria-describedby": "modal-modal-description",
|
|
6473
|
+
className: "rsvp-modal"
|
|
6474
|
+
}, React.createElement(Box, {
|
|
6475
|
+
style: style$4,
|
|
6476
|
+
className: "rsvp-modal-box"
|
|
6477
|
+
}, React.createElement("div", {
|
|
6478
|
+
className: "rsvp-modal-container"
|
|
6479
|
+
}, React.createElement("div", {
|
|
6480
|
+
className: "rsvp-modal-header"
|
|
6481
|
+
}, modal.text), React.createElement("div", {
|
|
6482
|
+
className: "rsvp-modal-button"
|
|
6483
|
+
}, React.createElement("button", {
|
|
6484
|
+
onClick: handleModalClose
|
|
6485
|
+
}, "OK"))))), React.createElement("div", {
|
|
6486
|
+
className: "rsvp-container"
|
|
6487
|
+
}, loading ? React.createElement(Loader, null) : React.createElement(React.Fragment, null, React.createElement("div", {
|
|
6488
|
+
className: "rsvp-header"
|
|
6489
|
+
}, "RSVP"), React.createElement("div", {
|
|
6490
|
+
className: "rsvp-email-container"
|
|
6491
|
+
}, React.createElement(Formik, {
|
|
6492
|
+
initialValues: {
|
|
6493
|
+
email: (parsedData == null ? void 0 : parsedData.email) || ''
|
|
6494
|
+
},
|
|
6495
|
+
onSubmit: handleSubmit,
|
|
6496
|
+
enableReinitialize: true
|
|
6497
|
+
}, React.createElement(Form, null, React.createElement("div", {
|
|
6498
|
+
className: "rsvp-email-input-container"
|
|
6499
|
+
}, React.createElement(Field, {
|
|
6500
|
+
name: "email",
|
|
6501
|
+
label: "EMAIL ADDRESS",
|
|
6502
|
+
type: "email",
|
|
6503
|
+
validate: combineValidators(function (value) {
|
|
6504
|
+
return requiredValidator(value, 'Please enter your Email');
|
|
6505
|
+
}, function (value) {
|
|
6506
|
+
return emailValidator(value);
|
|
6507
|
+
}),
|
|
6508
|
+
component: CustomField
|
|
6509
|
+
})), React.createElement("div", {
|
|
6510
|
+
className: "rsvp-button-container"
|
|
6511
|
+
}, React.createElement(Button, {
|
|
6512
|
+
type: "submit"
|
|
6513
|
+
}, "RSVP"))))))));
|
|
5691
6514
|
};
|
|
5692
6515
|
|
|
5693
|
-
export { BillingInfoContainer, ConfirmationContainer, LoginModal, MyTicketsContainer, OrderDetailsContainer, PaymentContainer, TicketResaleContainer, TicketsContainer, createFixedFloatNormalizer, currencyNormalizerCreator, setConfigs };
|
|
6516
|
+
export { BillingInfoContainer, ConfirmationContainer, LoginModal, MyTicketsContainer, OrderDetailsContainer, PaymentContainer, RedirectModal, RsvpContainer, TicketResaleContainer, TicketsContainer, createFixedFloatNormalizer, currencyNormalizerCreator, setConfigs };
|
|
5694
6517
|
//# sourceMappingURL=tf-checkout-react.esm.js.map
|