tf-checkout-react 1.0.106 → 1.1.0
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 +40 -28
- package/dist/components/account-settings/index.d.ts +3 -0
- package/dist/components/billing-info-container/index.d.ts +8 -5
- package/dist/components/common/PhoneNumberField.d.ts +9 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/confirmationContainer/index.d.ts +2 -1
- package/dist/components/countdown/index.d.ts +2 -1
- package/dist/components/forgotPasswordModal/index.d.ts +11 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/loginModal/index.d.ts +35 -2
- package/dist/components/myTicketsContainer/index.d.ts +2 -1
- package/dist/components/myTicketsContainer/tableConfig.d.ts +1 -1
- package/dist/components/orderDetailsContainer/index.d.ts +6 -1
- package/dist/components/orderDetailsContainer/ticketsTable.d.ts +2 -1
- package/dist/components/paymentContainer/index.d.ts +2 -1
- package/dist/components/resetPasswordContainer/index.d.ts +10 -0
- package/dist/components/signupModal/index.d.ts +14 -0
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +3 -2
- package/dist/components/ticketsContainer/TicketsSection.d.ts +1 -2
- package/dist/components/ticketsContainer/index.d.ts +4 -1
- package/dist/index.d.ts +2 -0
- package/dist/tf-checkout-react.cjs.development.js +1274 -629
- 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 +1272 -629
- 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 +12 -1
- package/src/api/index.ts +61 -24
- 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 +121 -77
- package/src/components/billing-info-container/style.css +1 -1
- package/src/components/billing-info-container/utils.ts +11 -3
- package/src/components/common/PhoneNumberField.tsx +68 -0
- package/src/components/common/SnackbarAlert.tsx +1 -1
- package/src/components/common/dist/PhoneNumberField.js +96 -0
- package/src/components/common/index.tsx +1 -0
- package/src/components/confirmationContainer/index.tsx +19 -9
- package/src/components/countdown/index.tsx +3 -1
- package/src/components/forgotPasswordModal/index.tsx +107 -0
- package/src/components/forgotPasswordModal/style.css +47 -0
- package/src/components/index.ts +1 -0
- package/src/components/loginModal/index.tsx +72 -71
- package/src/components/myTicketsContainer/index.tsx +99 -95
- package/src/components/myTicketsContainer/style.css +2 -2
- package/src/components/myTicketsContainer/tableConfig.tsx +3 -6
- package/src/components/orderDetailsContainer/index.tsx +75 -21
- package/src/components/orderDetailsContainer/style.css +3 -3
- package/src/components/orderDetailsContainer/ticketsTable.tsx +130 -83
- package/src/components/paymentContainer/index.tsx +114 -49
- package/src/components/registerModal/index.tsx +3 -10
- package/src/components/resetPasswordContainer/index.tsx +96 -0
- package/src/components/resetPasswordContainer/style.css +36 -0
- package/src/components/signupModal/index.tsx +195 -0
- package/src/components/signupModal/style.css +58 -0
- package/src/components/stripePayment/index.tsx +14 -12
- package/src/components/stripePayment/style.css +3 -3
- package/src/components/ticketResaleModal/index.tsx +12 -14
- package/src/components/ticketsContainer/PromoCodeSection.tsx +8 -7
- package/src/components/ticketsContainer/TicketRow.tsx +12 -6
- package/src/components/ticketsContainer/TicketsSection.tsx +0 -3
- package/src/components/ticketsContainer/index.tsx +92 -50
- package/src/env.ts +3 -3
- package/src/index.ts +3 -1
- package/src/utils/cookies.ts +42 -0
- package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +16 -4
- package/src/utils/downloadPDF.tsx +28 -6
- package/src/utils/getDomain.ts +15 -0
- package/src/utils/index.ts +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { Component, useState, memo, useRef,
|
|
1
|
+
import React, { Component, useState, useCallback, useEffect, memo, useRef, 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,19 +9,21 @@ 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, Snackbar, Alert,
|
|
13
|
-
import Modal from '@mui/material/Modal';
|
|
12
|
+
import { TextField, Modal as Modal$1, Box as Box$1, CircularProgress, FormControl, FormHelperText, InputLabel, Snackbar, Alert, createTheme as createTheme$1 } from '@mui/material';
|
|
14
13
|
import Box from '@mui/material/Box';
|
|
14
|
+
import Modal from '@mui/material/Modal';
|
|
15
|
+
import TextField$1 from '@mui/material/TextField';
|
|
16
|
+
import { useTheme } from '@mui/styles';
|
|
17
|
+
import { object, string, ref, boolean } from 'yup';
|
|
15
18
|
import _flatMapDeep from 'lodash-es/flatMapDeep';
|
|
16
19
|
import _isArray from 'lodash-es/isArray';
|
|
17
20
|
import { nanoid } from 'nanoid';
|
|
18
21
|
import FormGroup from '@mui/material/FormGroup';
|
|
19
22
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
20
23
|
import Checkbox from '@mui/material/Checkbox';
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import CircularProgress from '@mui/material/CircularProgress';
|
|
24
|
+
import 'material-ui-phone-number';
|
|
25
|
+
import _debounce from 'lodash-es/debounce';
|
|
26
|
+
import CircularProgress$1 from '@mui/material/CircularProgress';
|
|
25
27
|
import Select from '@mui/material/Select';
|
|
26
28
|
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
27
29
|
import Backdrop from '@mui/material/Backdrop';
|
|
@@ -45,17 +47,16 @@ import FormControl$1 from '@mui/material/FormControl';
|
|
|
45
47
|
import MenuItem from '@mui/material/MenuItem';
|
|
46
48
|
import moment from 'moment-timezone';
|
|
47
49
|
import { ThemeProvider as ThemeProvider$1 } from '@mui/private-theming';
|
|
50
|
+
import Autocomplete from '@mui/material/Autocomplete';
|
|
51
|
+
import Paper from '@mui/material/Paper';
|
|
48
52
|
import Table from '@mui/material/Table';
|
|
49
53
|
import TableBody from '@mui/material/TableBody';
|
|
50
54
|
import TableCell from '@mui/material/TableCell';
|
|
51
55
|
import TableContainer from '@mui/material/TableContainer';
|
|
52
56
|
import TableHead from '@mui/material/TableHead';
|
|
53
|
-
import TableRow from '@mui/material/TableRow';
|
|
54
|
-
import Paper from '@mui/material/Paper';
|
|
55
57
|
import TablePagination from '@mui/material/TablePagination';
|
|
56
|
-
import
|
|
58
|
+
import TableRow from '@mui/material/TableRow';
|
|
57
59
|
import _has from 'lodash-es/has';
|
|
58
|
-
import { object, string, ref, boolean } from 'yup';
|
|
59
60
|
import Radio from '@mui/material/Radio';
|
|
60
61
|
|
|
61
62
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -998,14 +999,87 @@ var ErrorFocusInternal = /*#__PURE__*/function (_Component) {
|
|
|
998
999
|
|
|
999
1000
|
var ErrorFocus = /*#__PURE__*/connect(ErrorFocusInternal);
|
|
1000
1001
|
|
|
1002
|
+
function getDomain(url, subdomain) {
|
|
1003
|
+
var updatedUrl = url.replace(/(https?:\/\/)?(www.)?/i, '');
|
|
1004
|
+
|
|
1005
|
+
if (!subdomain) {
|
|
1006
|
+
updatedUrl = updatedUrl.split('.');
|
|
1007
|
+
updatedUrl = updatedUrl.slice(updatedUrl.length - 2).join('.');
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
if (updatedUrl.indexOf('/') !== -1) {
|
|
1011
|
+
return updatedUrl.split('/')[0];
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
return updatedUrl;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
function setCustomCookie(name, value, days) {
|
|
1018
|
+
if (days === void 0) {
|
|
1019
|
+
days = 5;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
var expires = '';
|
|
1023
|
+
|
|
1024
|
+
if (days) {
|
|
1025
|
+
var date = new Date();
|
|
1026
|
+
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
1027
|
+
expires = '; expires=' + date.toUTCString();
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
if (typeof window !== 'undefined') {
|
|
1031
|
+
var domain = getDomain(window.location.hostname);
|
|
1032
|
+
document.cookie = name + '=' + (value || '') + expires + '; path=/' + ("; domain=" + domain);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
function getCookieByName(cname) {
|
|
1036
|
+
if (typeof window === 'undefined') return '';
|
|
1037
|
+
var name = cname + '=';
|
|
1038
|
+
var ca = document.cookie.split(';');
|
|
1039
|
+
|
|
1040
|
+
for (var i = 0; i < ca.length; i++) {
|
|
1041
|
+
var c = ca[i];
|
|
1042
|
+
|
|
1043
|
+
while (c.charAt(0) == ' ') {
|
|
1044
|
+
c = c.substring(1);
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
if (c.indexOf(name) == 0) {
|
|
1048
|
+
return c.substring(name.length, c.length);
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
return '';
|
|
1053
|
+
}
|
|
1054
|
+
function deleteCookieByName(name) {
|
|
1055
|
+
if (typeof window !== 'undefined') {
|
|
1056
|
+
var domain = getDomain(window.location.hostname);
|
|
1057
|
+
document.cookie = name + '=; Path=/' + ("; domain=" + domain) + '; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1001
1061
|
var downloadPDF = function downloadPDF(pdfUrl) {
|
|
1002
1062
|
if (typeof window === 'undefined') return;
|
|
1063
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
1003
1064
|
var accessToken = localStorage.getItem('access_token');
|
|
1004
|
-
if (!accessToken) return;
|
|
1005
|
-
|
|
1006
|
-
|
|
1065
|
+
if (!accessToken && !xtfCookie) return;
|
|
1066
|
+
var headers = {};
|
|
1067
|
+
|
|
1068
|
+
if (accessToken) {
|
|
1069
|
+
headers = {
|
|
1007
1070
|
Authorization: "Bearer " + accessToken
|
|
1008
|
-
}
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
if (xtfCookie) {
|
|
1075
|
+
headers = {
|
|
1076
|
+
'X-TF-ECOMMERCE': xtfCookie
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
return fetch(pdfUrl, {
|
|
1081
|
+
headers: headers,
|
|
1082
|
+
credentials: 'include'
|
|
1009
1083
|
}).then( /*#__PURE__*/function () {
|
|
1010
1084
|
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(response) {
|
|
1011
1085
|
var blobValue, fileNameHeader, fileName;
|
|
@@ -1018,7 +1092,7 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1018
1092
|
|
|
1019
1093
|
case 2:
|
|
1020
1094
|
blobValue = _context.sent;
|
|
1021
|
-
fileNameHeader = response.headers.get(
|
|
1095
|
+
fileNameHeader = response.headers.get('content-disposition') || '';
|
|
1022
1096
|
fileName = fileNameHeader.split('"')[1];
|
|
1023
1097
|
return _context.abrupt("return", {
|
|
1024
1098
|
blobValue: blobValue,
|
|
@@ -1039,7 +1113,11 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1039
1113
|
}()).then(function (_ref2) {
|
|
1040
1114
|
var blobValue = _ref2.blobValue,
|
|
1041
1115
|
fileName = _ref2.fileName;
|
|
1042
|
-
|
|
1116
|
+
|
|
1117
|
+
if (!fileName) {
|
|
1118
|
+
throw Error('Something went wrong.');
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1043
1121
|
var file = new Blob([blobValue], {
|
|
1044
1122
|
type: 'application/pdf'
|
|
1045
1123
|
});
|
|
@@ -1050,21 +1128,27 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1050
1128
|
document.body.appendChild(link);
|
|
1051
1129
|
link.click();
|
|
1052
1130
|
document.body.removeChild(link);
|
|
1131
|
+
})["catch"](function (error) {
|
|
1132
|
+
return error;
|
|
1053
1133
|
});
|
|
1054
1134
|
};
|
|
1055
1135
|
|
|
1056
|
-
var createCheckoutDataBodyWithDefaultHolder = function createCheckoutDataBodyWithDefaultHolder(ticketsQuantity, logedInValues, includeDob) {
|
|
1136
|
+
var createCheckoutDataBodyWithDefaultHolder = function createCheckoutDataBodyWithDefaultHolder(ticketsQuantity, logedInValues, includeDob, userCredentials) {
|
|
1057
1137
|
if (includeDob === void 0) {
|
|
1058
1138
|
includeDob = false;
|
|
1059
1139
|
}
|
|
1060
1140
|
|
|
1141
|
+
if (userCredentials === void 0) {
|
|
1142
|
+
userCredentials = {};
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1061
1145
|
var ticket_holders = [];
|
|
1062
|
-
var first_name = _get(logedInValues, 'firstName') || _get(logedInValues, 'first_name') || '';
|
|
1063
|
-
var last_name = _get(logedInValues, 'lastName', '') || _get(
|
|
1146
|
+
var first_name = _get(logedInValues, 'firstName') || _get(logedInValues, 'first_name') || _get(userCredentials, 'firstNameLogged') || '';
|
|
1147
|
+
var last_name = _get(logedInValues, 'lastName') || _get(logedInValues, 'last_name') || _get(userCredentials, 'lastNameLogged') || '';
|
|
1064
1148
|
|
|
1065
1149
|
var phone = _get(logedInValues, 'phone', '');
|
|
1066
1150
|
|
|
1067
|
-
var email = _get(logedInValues, 'email', '');
|
|
1151
|
+
var email = _get(logedInValues, 'email') || _get(userCredentials, 'emailLogged') || '';
|
|
1068
1152
|
|
|
1069
1153
|
for (var i = 0; i <= ticketsQuantity - 1; i++) {
|
|
1070
1154
|
var individualHolder = i ? {
|
|
@@ -1173,20 +1257,41 @@ publicRequest.interceptors.request.use(function (config) {
|
|
|
1173
1257
|
config.headers = _updatedHeaders;
|
|
1174
1258
|
}
|
|
1175
1259
|
|
|
1176
|
-
if (
|
|
1260
|
+
if (getCookieByName('X-TF-ECOMMERCE')) {
|
|
1177
1261
|
var _updatedHeaders2 = _extends({}, config.headers, {
|
|
1178
|
-
'X-
|
|
1262
|
+
'X-TF-ECOMMERCE': getCookieByName('X-TF-ECOMMERCE')
|
|
1179
1263
|
});
|
|
1180
1264
|
|
|
1181
1265
|
config.headers = _updatedHeaders2;
|
|
1182
1266
|
}
|
|
1183
1267
|
|
|
1268
|
+
if (CONFIGS.X_SOURCE_ORIGIN) {
|
|
1269
|
+
var _updatedHeaders3 = _extends({}, config.headers, {
|
|
1270
|
+
'X-Source-Origin': CONFIGS.X_SOURCE_ORIGIN
|
|
1271
|
+
});
|
|
1272
|
+
|
|
1273
|
+
config.headers = _updatedHeaders3;
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1184
1276
|
if (CONFIGS.BASE_URL) {
|
|
1185
1277
|
config.baseURL = CONFIGS.BASE_URL + '/api';
|
|
1186
1278
|
}
|
|
1187
1279
|
|
|
1188
1280
|
return config;
|
|
1189
1281
|
});
|
|
1282
|
+
publicRequest.interceptors.response.use(function (response) {
|
|
1283
|
+
var xtfCookie = _get(response, 'headers.x-tf-ecommerce');
|
|
1284
|
+
|
|
1285
|
+
var url = _get(response, 'config.url');
|
|
1286
|
+
|
|
1287
|
+
var method = _get(response, 'config.method');
|
|
1288
|
+
|
|
1289
|
+
if (xtfCookie && !(url === '/auth' && method === 'delete')) {
|
|
1290
|
+
setCustomCookie('X-TF-ECOMMERCE', xtfCookie);
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
return response;
|
|
1294
|
+
});
|
|
1190
1295
|
|
|
1191
1296
|
publicRequest.setGuestToken = function (token) {
|
|
1192
1297
|
return publicRequest.defaults.headers.common['Authorization-Guest'] = token;
|
|
@@ -1265,14 +1370,11 @@ var postOnCheckout = function postOnCheckout(data, accessToken) {
|
|
|
1265
1370
|
return res;
|
|
1266
1371
|
};
|
|
1267
1372
|
var authorize = function authorize(data) {
|
|
1268
|
-
return publicRequest.post("
|
|
1373
|
+
return publicRequest.post("/auth?clientId=" + (CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf'), data);
|
|
1269
1374
|
};
|
|
1270
1375
|
var register = function register(data) {
|
|
1271
1376
|
return publicRequest.post('v1/oauth/register-rn', data);
|
|
1272
1377
|
};
|
|
1273
|
-
var getAccessToken = function getAccessToken(data) {
|
|
1274
|
-
return publicRequest.post('v1/oauth/access_token', data);
|
|
1275
|
-
};
|
|
1276
1378
|
var getPaymentData = function getPaymentData(hash) {
|
|
1277
1379
|
var response = publicRequest.get("v1/order/" + hash + "/review/")["catch"](function (error) {
|
|
1278
1380
|
throw error;
|
|
@@ -1333,6 +1435,18 @@ var postReferralVisits = function postReferralVisits(eventId, referralId) {
|
|
|
1333
1435
|
referrer: "" + referralId
|
|
1334
1436
|
});
|
|
1335
1437
|
};
|
|
1438
|
+
var logout = function logout() {
|
|
1439
|
+
return publicRequest["delete"]('/auth');
|
|
1440
|
+
}; // forgot password
|
|
1441
|
+
|
|
1442
|
+
var forgotPassword = function forgotPassword(email) {
|
|
1443
|
+
return publicRequest.post("/auth/restore-password", {
|
|
1444
|
+
email: email
|
|
1445
|
+
});
|
|
1446
|
+
};
|
|
1447
|
+
var resetPassword = function resetPassword(data) {
|
|
1448
|
+
return publicRequest.post("/auth/reset-password", data);
|
|
1449
|
+
};
|
|
1336
1450
|
var processTicket = function processTicket(hash) {
|
|
1337
1451
|
return publicRequest.post("v1/ticket/" + hash + "/process/");
|
|
1338
1452
|
};
|
|
@@ -1342,6 +1456,32 @@ var declineInvitation = function declineInvitation(hash) {
|
|
|
1342
1456
|
var sendRSVPInfo = function sendRSVPInfo(eventId, data) {
|
|
1343
1457
|
return publicRequest.post("v1/event/" + eventId + "/send-rsvp-info", data);
|
|
1344
1458
|
};
|
|
1459
|
+
var validatePhoneNumber = /*#__PURE__*/function () {
|
|
1460
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(phone) {
|
|
1461
|
+
var response;
|
|
1462
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1463
|
+
while (1) {
|
|
1464
|
+
switch (_context.prev = _context.next) {
|
|
1465
|
+
case 0:
|
|
1466
|
+
_context.next = 2;
|
|
1467
|
+
return publicRequest.get("/v1/account/validate_phone?phone=" + phone);
|
|
1468
|
+
|
|
1469
|
+
case 2:
|
|
1470
|
+
response = _context.sent;
|
|
1471
|
+
return _context.abrupt("return", response.data);
|
|
1472
|
+
|
|
1473
|
+
case 4:
|
|
1474
|
+
case "end":
|
|
1475
|
+
return _context.stop();
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
}, _callee);
|
|
1479
|
+
}));
|
|
1480
|
+
|
|
1481
|
+
return function validatePhoneNumber(_x) {
|
|
1482
|
+
return _ref.apply(this, arguments);
|
|
1483
|
+
};
|
|
1484
|
+
}();
|
|
1345
1485
|
|
|
1346
1486
|
var style = {
|
|
1347
1487
|
position: 'absolute',
|
|
@@ -1353,6 +1493,21 @@ var style = {
|
|
|
1353
1493
|
border: '1px solid white',
|
|
1354
1494
|
outline: 'none'
|
|
1355
1495
|
};
|
|
1496
|
+
var setLoggedUserData = function setLoggedUserData(data) {
|
|
1497
|
+
return {
|
|
1498
|
+
id: data.id,
|
|
1499
|
+
first_name: data.firstName,
|
|
1500
|
+
last_name: data.lastName,
|
|
1501
|
+
email: data.email,
|
|
1502
|
+
confirmEmail: data.email,
|
|
1503
|
+
city: (data == null ? void 0 : data.city) || '',
|
|
1504
|
+
country: (data == null ? void 0 : data.countryId) || (data == null ? void 0 : data.country) || '',
|
|
1505
|
+
phone: (data == null ? void 0 : data.phone) || '',
|
|
1506
|
+
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
1507
|
+
state: (data == null ? void 0 : data.stateId) || '',
|
|
1508
|
+
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
1509
|
+
};
|
|
1510
|
+
};
|
|
1356
1511
|
var LoginModal = function LoginModal(_ref) {
|
|
1357
1512
|
var onClose = _ref.onClose,
|
|
1358
1513
|
onLogin = _ref.onLogin,
|
|
@@ -1360,27 +1515,26 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1360
1515
|
alreadyHasUser = _ref$alreadyHasUser === void 0 ? false : _ref$alreadyHasUser,
|
|
1361
1516
|
_ref$userExpired = _ref.userExpired,
|
|
1362
1517
|
userExpired = _ref$userExpired === void 0 ? false : _ref$userExpired,
|
|
1363
|
-
_ref$onAuthorizeSucce = _ref.onAuthorizeSuccess,
|
|
1364
|
-
onAuthorizeSuccess = _ref$onAuthorizeSucce === void 0 ? function () {} : _ref$onAuthorizeSucce,
|
|
1365
|
-
_ref$onAuthorizeError = _ref.onAuthorizeError,
|
|
1366
|
-
onAuthorizeError = _ref$onAuthorizeError === void 0 ? function () {} : _ref$onAuthorizeError,
|
|
1367
1518
|
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
1368
|
-
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ?
|
|
1519
|
+
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? _identity : _ref$onGetProfileData,
|
|
1369
1520
|
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
1370
|
-
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ?
|
|
1521
|
+
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? _identity : _ref$onGetProfileData2,
|
|
1522
|
+
_ref$onForgotPassword = _ref.onForgotPassword,
|
|
1523
|
+
onForgotPassword = _ref$onForgotPassword === void 0 ? _identity : _ref$onForgotPassword,
|
|
1524
|
+
_ref$onSignup = _ref.onSignup,
|
|
1525
|
+
onSignup = _ref$onSignup === void 0 ? _identity : _ref$onSignup,
|
|
1371
1526
|
_ref$modalClassname = _ref.modalClassname,
|
|
1372
|
-
modalClassname = _ref$modalClassname === void 0 ? '' : _ref$modalClassname
|
|
1527
|
+
modalClassname = _ref$modalClassname === void 0 ? '' : _ref$modalClassname,
|
|
1528
|
+
logo = _ref.logo,
|
|
1529
|
+
_ref$showForgotPasswo = _ref.showForgotPasswordButton,
|
|
1530
|
+
showForgotPasswordButton = _ref$showForgotPasswo === void 0 ? false : _ref$showForgotPasswo,
|
|
1531
|
+
_ref$showSignUpButton = _ref.showSignUpButton,
|
|
1532
|
+
showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton;
|
|
1373
1533
|
|
|
1374
1534
|
var _useState = useState(''),
|
|
1375
1535
|
error = _useState[0],
|
|
1376
1536
|
setError = _useState[1];
|
|
1377
1537
|
|
|
1378
|
-
var handleForgotPassword = function handleForgotPassword() {
|
|
1379
|
-
if (typeof window !== 'undefined') {
|
|
1380
|
-
window.open(CONFIGS.BASE_URL + "/password-restore/");
|
|
1381
|
-
}
|
|
1382
|
-
};
|
|
1383
|
-
|
|
1384
1538
|
return React.createElement(Modal, {
|
|
1385
1539
|
open: true,
|
|
1386
1540
|
onClose: onClose,
|
|
@@ -1396,7 +1550,7 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1396
1550
|
},
|
|
1397
1551
|
onSubmit: function () {
|
|
1398
1552
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1399
|
-
var email, password,
|
|
1553
|
+
var email, password, body, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
|
|
1400
1554
|
|
|
1401
1555
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1402
1556
|
while (1) {
|
|
@@ -1404,102 +1558,66 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1404
1558
|
case 0:
|
|
1405
1559
|
email = _ref2.email, password = _ref2.password;
|
|
1406
1560
|
_context.prev = 1;
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
case 7:
|
|
1414
|
-
resAutorize = _context.sent;
|
|
1415
|
-
bodyFormDataToken = new FormData();
|
|
1416
|
-
bodyFormDataToken.append('code', resAutorize.data.data.code);
|
|
1417
|
-
bodyFormDataToken.append('scope', 'profile');
|
|
1418
|
-
bodyFormDataToken.append('grant_type', 'authorization_code');
|
|
1419
|
-
bodyFormDataToken.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
1420
|
-
bodyFormDataToken.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
1421
|
-
resAccessToken = null;
|
|
1422
|
-
_context.prev = 15;
|
|
1423
|
-
_context.next = 18;
|
|
1424
|
-
return getAccessToken(bodyFormDataToken);
|
|
1425
|
-
|
|
1426
|
-
case 18:
|
|
1427
|
-
resAccessToken = _context.sent;
|
|
1428
|
-
onAuthorizeSuccess(resAccessToken.data);
|
|
1429
|
-
_context.next = 26;
|
|
1430
|
-
break;
|
|
1431
|
-
|
|
1432
|
-
case 22:
|
|
1433
|
-
_context.prev = 22;
|
|
1434
|
-
_context.t0 = _context["catch"](15);
|
|
1435
|
-
|
|
1436
|
-
if (axios.isAxiosError(_context.t0)) {
|
|
1437
|
-
onAuthorizeError(_context.t0);
|
|
1438
|
-
}
|
|
1439
|
-
|
|
1440
|
-
return _context.abrupt("return");
|
|
1561
|
+
body = {
|
|
1562
|
+
email: email,
|
|
1563
|
+
password: password
|
|
1564
|
+
};
|
|
1565
|
+
_context.next = 5;
|
|
1566
|
+
return authorize(body);
|
|
1441
1567
|
|
|
1442
|
-
case
|
|
1443
|
-
accessToken = _get(resAccessToken, 'data.access_token');
|
|
1444
|
-
handleSetAccessToken(accessToken);
|
|
1568
|
+
case 5:
|
|
1445
1569
|
profileResponse = null;
|
|
1446
|
-
_context.prev =
|
|
1447
|
-
_context.next =
|
|
1448
|
-
return getProfileData(
|
|
1570
|
+
_context.prev = 6;
|
|
1571
|
+
_context.next = 9;
|
|
1572
|
+
return getProfileData();
|
|
1449
1573
|
|
|
1450
|
-
case
|
|
1574
|
+
case 9:
|
|
1451
1575
|
profileResponse = _context.sent;
|
|
1452
1576
|
onGetProfileDataSuccess(profileResponse.data);
|
|
1453
|
-
_context.next =
|
|
1577
|
+
_context.next = 17;
|
|
1454
1578
|
break;
|
|
1455
1579
|
|
|
1456
|
-
case
|
|
1457
|
-
_context.prev =
|
|
1458
|
-
_context.
|
|
1580
|
+
case 13:
|
|
1581
|
+
_context.prev = 13;
|
|
1582
|
+
_context.t0 = _context["catch"](6);
|
|
1459
1583
|
|
|
1460
|
-
if (axios.isAxiosError(_context.
|
|
1461
|
-
onGetProfileDataError(_context.
|
|
1584
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
1585
|
+
onGetProfileDataError(_context.t0);
|
|
1462
1586
|
}
|
|
1463
1587
|
|
|
1464
1588
|
return _context.abrupt("return");
|
|
1465
1589
|
|
|
1466
|
-
case
|
|
1590
|
+
case 17:
|
|
1467
1591
|
profileSpecifiedData = _get(profileResponse, 'data.data');
|
|
1468
|
-
profileDataObj =
|
|
1469
|
-
id: profileSpecifiedData.id,
|
|
1470
|
-
first_name: profileSpecifiedData.firstName,
|
|
1471
|
-
last_name: profileSpecifiedData.lastName,
|
|
1472
|
-
email: profileSpecifiedData.email
|
|
1473
|
-
};
|
|
1592
|
+
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
1474
1593
|
|
|
1475
1594
|
if (typeof window !== 'undefined') {
|
|
1476
1595
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
1477
|
-
window.localStorage.setItem('access_token', accessToken);
|
|
1478
1596
|
event = new window.CustomEvent('tf-login');
|
|
1479
1597
|
window.document.dispatchEvent(event);
|
|
1480
1598
|
}
|
|
1481
1599
|
|
|
1482
1600
|
onLogin();
|
|
1483
|
-
_context.next =
|
|
1601
|
+
_context.next = 26;
|
|
1484
1602
|
break;
|
|
1485
1603
|
|
|
1486
|
-
case
|
|
1487
|
-
_context.prev =
|
|
1488
|
-
_context.
|
|
1604
|
+
case 23:
|
|
1605
|
+
_context.prev = 23;
|
|
1606
|
+
_context.t1 = _context["catch"](1);
|
|
1489
1607
|
|
|
1490
|
-
if (axios.isAxiosError(_context.
|
|
1491
|
-
_error = (_context.
|
|
1608
|
+
if (axios.isAxiosError(_context.t1)) {
|
|
1609
|
+
_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';
|
|
1492
1610
|
setError(_error);
|
|
1493
|
-
} else if (_context.
|
|
1494
|
-
setError((_context.
|
|
1611
|
+
} else if (_context.t1 instanceof Error) {
|
|
1612
|
+
setError((_context.t1 == null ? void 0 : _context.t1.message) || 'Error');
|
|
1495
1613
|
}
|
|
1496
1614
|
|
|
1497
|
-
case
|
|
1615
|
+
case 26:
|
|
1498
1616
|
case "end":
|
|
1499
1617
|
return _context.stop();
|
|
1500
1618
|
}
|
|
1501
1619
|
}
|
|
1502
|
-
}, _callee, null, [[1,
|
|
1620
|
+
}, _callee, null, [[1, 23], [6, 13]]);
|
|
1503
1621
|
}));
|
|
1504
1622
|
|
|
1505
1623
|
function onSubmit(_x) {
|
|
@@ -1513,11 +1631,13 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1513
1631
|
onSubmit: props.handleSubmit
|
|
1514
1632
|
}, React.createElement("div", {
|
|
1515
1633
|
className: "modal-title"
|
|
1516
|
-
}, "Login"), React.createElement("
|
|
1634
|
+
}, "Login"), React.createElement("div", {
|
|
1635
|
+
className: 'login-logo-container'
|
|
1636
|
+
}, React.createElement("img", {
|
|
1517
1637
|
className: "login-logo-tff",
|
|
1518
|
-
src: "https://www.ticketfairy.com/resources/images/logo-ttf-black.svg",
|
|
1519
|
-
alt: ""
|
|
1520
|
-
}), React.createElement("div", {
|
|
1638
|
+
src: logo || "https://www.ticketfairy.com/resources/images/logo-ttf-black.svg",
|
|
1639
|
+
alt: "logo"
|
|
1640
|
+
})), React.createElement("div", {
|
|
1521
1641
|
className: "server_auth__error"
|
|
1522
1642
|
}, error), alreadyHasUser && React.createElement("p", {
|
|
1523
1643
|
className: "info-text-for-login"
|
|
@@ -1559,204 +1679,372 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1559
1679
|
className: "login-action-button"
|
|
1560
1680
|
}, React.createElement("button", {
|
|
1561
1681
|
type: "submit"
|
|
1562
|
-
}, "Login")), React.createElement("div", {
|
|
1563
|
-
className:
|
|
1682
|
+
}, "Login")), showForgotPasswordButton && React.createElement("div", {
|
|
1683
|
+
className: "forgot-password"
|
|
1564
1684
|
}, React.createElement("span", {
|
|
1565
|
-
|
|
1566
|
-
|
|
1685
|
+
"aria-hidden": "true",
|
|
1686
|
+
onClick: onForgotPassword
|
|
1687
|
+
}, "Forgot password?")), showSignUpButton && React.createElement("div", {
|
|
1688
|
+
className: "forgot-password"
|
|
1689
|
+
}, React.createElement("span", {
|
|
1690
|
+
"aria-hidden": "true",
|
|
1691
|
+
onClick: onSignup
|
|
1692
|
+
}, "Sign up"))));
|
|
1567
1693
|
}))));
|
|
1568
1694
|
};
|
|
1569
1695
|
|
|
1570
|
-
var
|
|
1571
|
-
var
|
|
1572
|
-
_ref$
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
}
|
|
1589
|
-
}, React.createElement(Formik, {
|
|
1590
|
-
initialValues: {
|
|
1591
|
-
firstName: '',
|
|
1592
|
-
lastName: '',
|
|
1593
|
-
email: '',
|
|
1594
|
-
password: '',
|
|
1595
|
-
confirmPassword: ''
|
|
1596
|
-
},
|
|
1597
|
-
onSubmit: function () {
|
|
1598
|
-
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1599
|
-
var firstName, lastName, email, password, confirmPassword, bodyFormData, resRegister, access_token, profileResponse, profileSpecifiedData, profileDataObj;
|
|
1600
|
-
return runtime_1.wrap(function _callee$(_context) {
|
|
1601
|
-
while (1) {
|
|
1602
|
-
switch (_context.prev = _context.next) {
|
|
1603
|
-
case 0:
|
|
1604
|
-
firstName = _ref2.firstName, lastName = _ref2.lastName, email = _ref2.email, password = _ref2.password, confirmPassword = _ref2.confirmPassword;
|
|
1605
|
-
bodyFormData = new FormData();
|
|
1606
|
-
bodyFormData.append('first_name', firstName);
|
|
1607
|
-
bodyFormData.append('last_name', lastName);
|
|
1608
|
-
bodyFormData.append('email', email);
|
|
1609
|
-
bodyFormData.append('password', password);
|
|
1610
|
-
bodyFormData.append('password_confirmation', confirmPassword);
|
|
1611
|
-
bodyFormData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
1612
|
-
bodyFormData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
1613
|
-
_context.next = 11;
|
|
1614
|
-
return register(bodyFormData);
|
|
1696
|
+
var CustomField = function CustomField(_ref) {
|
|
1697
|
+
var label = _ref.label,
|
|
1698
|
+
_ref$type = _ref.type,
|
|
1699
|
+
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1700
|
+
field = _ref.field,
|
|
1701
|
+
_ref$selectOptions = _ref.selectOptions,
|
|
1702
|
+
selectOptions = _ref$selectOptions === void 0 ? [] : _ref$selectOptions,
|
|
1703
|
+
_ref$form = _ref.form,
|
|
1704
|
+
touched = _ref$form.touched,
|
|
1705
|
+
errors = _ref$form.errors,
|
|
1706
|
+
submitCount = _ref$form.submitCount,
|
|
1707
|
+
theme = _ref.theme,
|
|
1708
|
+
_ref$inputProps = _ref.inputProps,
|
|
1709
|
+
pInputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
|
|
1710
|
+
_ref$InputProps = _ref.InputProps,
|
|
1711
|
+
InputProps = _ref$InputProps === void 0 ? {} : _ref$InputProps,
|
|
1712
|
+
inputRef = _ref.inputRef;
|
|
1713
|
+
var isSelectField = type === 'select';
|
|
1615
1714
|
|
|
1616
|
-
|
|
1617
|
-
resRegister = _context.sent;
|
|
1618
|
-
access_token = _get(resRegister, 'data.data.attributes.access_token');
|
|
1619
|
-
handleSetAccessToken(access_token);
|
|
1620
|
-
profileResponse = null;
|
|
1621
|
-
_context.prev = 15;
|
|
1622
|
-
_context.next = 18;
|
|
1623
|
-
return getProfileData(access_token);
|
|
1715
|
+
var error = _get(errors, field.name);
|
|
1624
1716
|
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1717
|
+
var isTouched = Boolean(_get(touched, field.name)) || _includes(field.name, 'holder') && !!error && !!submitCount;
|
|
1718
|
+
var customTheme = useTheme();
|
|
1719
|
+
var inputProps = {
|
|
1720
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
1721
|
+
};
|
|
1722
|
+
return React.createElement(TextField$1, Object.assign({
|
|
1723
|
+
id: field.name,
|
|
1724
|
+
label: label,
|
|
1725
|
+
type: type,
|
|
1726
|
+
select: isSelectField,
|
|
1727
|
+
fullWidth: true,
|
|
1728
|
+
error: !!error && isTouched,
|
|
1729
|
+
helperText: isTouched && error,
|
|
1730
|
+
SelectProps: {
|
|
1731
|
+
"native": true,
|
|
1732
|
+
className: theme,
|
|
1733
|
+
MenuProps: {
|
|
1734
|
+
className: theme
|
|
1735
|
+
}
|
|
1736
|
+
},
|
|
1737
|
+
InputLabelProps: {
|
|
1738
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
1739
|
+
},
|
|
1740
|
+
InputProps: InputProps,
|
|
1741
|
+
inputProps: _extends({}, inputProps, pInputProps),
|
|
1742
|
+
inputRef: inputRef
|
|
1743
|
+
}, field), isSelectField ? _map(selectOptions, function (option) {
|
|
1744
|
+
return React.createElement("option", {
|
|
1745
|
+
key: option.value,
|
|
1746
|
+
value: option.value,
|
|
1747
|
+
disabled: option.disabled
|
|
1748
|
+
}, option.label);
|
|
1749
|
+
}) : null);
|
|
1750
|
+
};
|
|
1630
1751
|
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1752
|
+
var style$1 = {
|
|
1753
|
+
position: 'absolute',
|
|
1754
|
+
top: '50%',
|
|
1755
|
+
left: '50%',
|
|
1756
|
+
transform: 'translate(-50%, -50%)',
|
|
1757
|
+
minWidth: 480,
|
|
1758
|
+
backgroundColor: '#fff',
|
|
1759
|
+
border: '1px solid white',
|
|
1760
|
+
outline: 'none',
|
|
1761
|
+
padding: '14px'
|
|
1762
|
+
};
|
|
1763
|
+
var SignupSchema = /*#__PURE__*/object().shape({
|
|
1764
|
+
firstName: /*#__PURE__*/string().required('Required'),
|
|
1765
|
+
lastName: /*#__PURE__*/string().required('Required'),
|
|
1766
|
+
email: /*#__PURE__*/string().email('Invalid email').required('Required'),
|
|
1767
|
+
password: /*#__PURE__*/string().min(6, 'Password must have 5+ characters').required('Required'),
|
|
1768
|
+
confirmPassword: /*#__PURE__*/string().required('Required').oneOf([/*#__PURE__*/ref('password'), null], 'Passwords must match')
|
|
1769
|
+
});
|
|
1770
|
+
var SignupModal = function SignupModal(_ref) {
|
|
1771
|
+
var _ref$onClose = _ref.onClose,
|
|
1772
|
+
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
1773
|
+
_ref$onLogin = _ref.onLogin,
|
|
1774
|
+
onLogin = _ref$onLogin === void 0 ? function () {} : _ref$onLogin,
|
|
1775
|
+
_ref$onRegisterSucces = _ref.onRegisterSuccess,
|
|
1776
|
+
onRegisterSuccess = _ref$onRegisterSucces === void 0 ? function () {} : _ref$onRegisterSucces,
|
|
1777
|
+
_ref$onRegisterError = _ref.onRegisterError,
|
|
1778
|
+
onRegisterError = _ref$onRegisterError === void 0 ? function () {} : _ref$onRegisterError;
|
|
1636
1779
|
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
id: profileSpecifiedData.id,
|
|
1641
|
-
first_name: profileSpecifiedData.firstName,
|
|
1642
|
-
last_name: profileSpecifiedData.lastName,
|
|
1643
|
-
email: profileSpecifiedData.email
|
|
1644
|
-
};
|
|
1780
|
+
var _useState = useState(false),
|
|
1781
|
+
loading = _useState[0],
|
|
1782
|
+
setLoading = _useState[1];
|
|
1645
1783
|
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1784
|
+
var onSignup = /*#__PURE__*/function () {
|
|
1785
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(values) {
|
|
1786
|
+
var formData, res, access_token_register, refreshToken, tokens;
|
|
1787
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1788
|
+
while (1) {
|
|
1789
|
+
switch (_context.prev = _context.next) {
|
|
1790
|
+
case 0:
|
|
1791
|
+
_context.prev = 0;
|
|
1792
|
+
setLoading(true);
|
|
1793
|
+
formData = new FormData();
|
|
1794
|
+
formData.set('first_name', values.firstName);
|
|
1795
|
+
formData.set('last_name', values.lastName);
|
|
1796
|
+
formData.set('email', values.email);
|
|
1797
|
+
formData.set('password', values.password);
|
|
1798
|
+
formData.set('password_confirmation', values.confirmPassword);
|
|
1799
|
+
formData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
1800
|
+
formData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
1801
|
+
_context.next = 12;
|
|
1802
|
+
return register(formData);
|
|
1650
1803
|
|
|
1651
|
-
|
|
1804
|
+
case 12:
|
|
1805
|
+
res = _context.sent;
|
|
1806
|
+
access_token_register = _get(res, 'data.data.attributes.access_token');
|
|
1807
|
+
refreshToken = _get(res, 'data.data.attributes.refresh_token');
|
|
1808
|
+
handleSetAccessToken(access_token_register);
|
|
1809
|
+
tokens = {
|
|
1810
|
+
accessToken: access_token_register,
|
|
1811
|
+
refreshToken: refreshToken
|
|
1812
|
+
};
|
|
1813
|
+
onRegisterSuccess(tokens);
|
|
1814
|
+
onClose();
|
|
1815
|
+
_context.next = 24;
|
|
1816
|
+
break;
|
|
1652
1817
|
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
}
|
|
1657
|
-
}
|
|
1658
|
-
}, _callee, null, [[15, 22]]);
|
|
1659
|
-
}));
|
|
1818
|
+
case 21:
|
|
1819
|
+
_context.prev = 21;
|
|
1820
|
+
_context.t0 = _context["catch"](0);
|
|
1660
1821
|
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1822
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
1823
|
+
onRegisterError(_context.t0, values.email);
|
|
1824
|
+
}
|
|
1664
1825
|
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1826
|
+
case 24:
|
|
1827
|
+
_context.prev = 24;
|
|
1828
|
+
setLoading(false);
|
|
1829
|
+
return _context.finish(24);
|
|
1830
|
+
|
|
1831
|
+
case 27:
|
|
1832
|
+
case "end":
|
|
1833
|
+
return _context.stop();
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
}, _callee, null, [[0, 21, 24, 27]]);
|
|
1837
|
+
}));
|
|
1838
|
+
|
|
1839
|
+
return function onSignup(_x) {
|
|
1840
|
+
return _ref2.apply(this, arguments);
|
|
1841
|
+
};
|
|
1842
|
+
}();
|
|
1843
|
+
|
|
1844
|
+
var _onClose = loading ? function () {} : onClose;
|
|
1845
|
+
|
|
1846
|
+
return React.createElement(Modal$1, {
|
|
1847
|
+
open: true,
|
|
1848
|
+
onClose: _onClose,
|
|
1849
|
+
"aria-labelledby": "modal-modal-title",
|
|
1850
|
+
"aria-describedby": "modal-modal-description",
|
|
1851
|
+
className: "signup-modal"
|
|
1852
|
+
}, React.createElement(Box$1, {
|
|
1853
|
+
style: style$1
|
|
1854
|
+
}, React.createElement("div", null, React.createElement(Formik, {
|
|
1855
|
+
initialValues: {
|
|
1856
|
+
firstName: '',
|
|
1857
|
+
lastName: '',
|
|
1858
|
+
email: '',
|
|
1859
|
+
password: '',
|
|
1860
|
+
confirmPassword: ''
|
|
1861
|
+
},
|
|
1862
|
+
validationSchema: SignupSchema,
|
|
1863
|
+
onSubmit: onSignup
|
|
1864
|
+
}, function (_ref3) {
|
|
1865
|
+
var isValid = _ref3.isValid,
|
|
1866
|
+
dirty = _ref3.dirty,
|
|
1867
|
+
handleSubmit = _ref3.handleSubmit;
|
|
1668
1868
|
return React.createElement(Form, {
|
|
1669
|
-
onSubmit:
|
|
1869
|
+
onSubmit: handleSubmit
|
|
1670
1870
|
}, React.createElement("div", {
|
|
1671
|
-
className: "
|
|
1672
|
-
}, React.createElement("div",
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
className: "register-container__twoFields"
|
|
1871
|
+
className: "signup-container"
|
|
1872
|
+
}, React.createElement("div", {
|
|
1873
|
+
className: "title"
|
|
1874
|
+
}, "Create an Account"), React.createElement("div", {
|
|
1875
|
+
className: "signup-container__twoFields"
|
|
1677
1876
|
}, React.createElement("div", {
|
|
1678
1877
|
className: "is-half"
|
|
1679
1878
|
}, React.createElement(Field, {
|
|
1680
|
-
name:
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
var field = _ref3.field,
|
|
1684
|
-
meta = _ref3.meta;
|
|
1685
|
-
return React.createElement(TextField, Object.assign({
|
|
1686
|
-
label: 'First Name',
|
|
1687
|
-
type: 'text',
|
|
1688
|
-
fullWidth: true,
|
|
1689
|
-
error: !!meta.error && meta.touched,
|
|
1690
|
-
helperText: meta.touched && meta.error
|
|
1691
|
-
}, field));
|
|
1879
|
+
name: "firstName",
|
|
1880
|
+
label: "First Name",
|
|
1881
|
+
component: CustomField
|
|
1692
1882
|
})), React.createElement("div", {
|
|
1693
1883
|
className: "is-half"
|
|
1694
1884
|
}, React.createElement(Field, {
|
|
1695
|
-
name:
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
var field = _ref4.field,
|
|
1699
|
-
meta = _ref4.meta;
|
|
1700
|
-
return React.createElement(TextField, Object.assign({
|
|
1701
|
-
label: 'Last Name',
|
|
1702
|
-
type: 'text',
|
|
1703
|
-
fullWidth: true,
|
|
1704
|
-
error: !!meta.error && meta.touched,
|
|
1705
|
-
helperText: meta.touched && meta.error
|
|
1706
|
-
}, field));
|
|
1885
|
+
name: "lastName",
|
|
1886
|
+
label: "Last Name",
|
|
1887
|
+
component: CustomField
|
|
1707
1888
|
}))), React.createElement("div", {
|
|
1708
|
-
className: "
|
|
1889
|
+
className: "signup-container__singleField"
|
|
1709
1890
|
}, React.createElement("div", {
|
|
1710
1891
|
className: ""
|
|
1711
1892
|
}, React.createElement(Field, {
|
|
1712
|
-
name:
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
var field = _ref5.field,
|
|
1716
|
-
meta = _ref5.meta;
|
|
1717
|
-
return React.createElement(TextField, Object.assign({
|
|
1718
|
-
label: 'Email',
|
|
1719
|
-
type: 'email',
|
|
1720
|
-
fullWidth: true,
|
|
1721
|
-
error: !!meta.error && meta.touched,
|
|
1722
|
-
helperText: meta.touched && meta.error
|
|
1723
|
-
}, field));
|
|
1893
|
+
name: "email",
|
|
1894
|
+
label: "Email",
|
|
1895
|
+
component: CustomField
|
|
1724
1896
|
}))), React.createElement("div", {
|
|
1725
|
-
className: "
|
|
1897
|
+
className: "signup-container__twoFields"
|
|
1726
1898
|
}, React.createElement("div", {
|
|
1727
1899
|
className: "is-half"
|
|
1728
1900
|
}, React.createElement(Field, {
|
|
1729
|
-
name:
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
meta = _ref6.meta;
|
|
1734
|
-
return React.createElement(TextField, Object.assign({
|
|
1735
|
-
label: 'Password',
|
|
1736
|
-
type: 'password',
|
|
1737
|
-
fullWidth: true,
|
|
1738
|
-
error: !!meta.error && meta.touched,
|
|
1739
|
-
helperText: meta.touched && meta.error
|
|
1740
|
-
}, field));
|
|
1901
|
+
name: "password",
|
|
1902
|
+
label: "Password",
|
|
1903
|
+
type: "password",
|
|
1904
|
+
component: CustomField
|
|
1741
1905
|
})), React.createElement("div", {
|
|
1742
1906
|
className: "is-half"
|
|
1743
1907
|
}, React.createElement(Field, {
|
|
1744
|
-
name:
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1908
|
+
name: "confirmPassword",
|
|
1909
|
+
label: "Confirm Password",
|
|
1910
|
+
type: "password",
|
|
1911
|
+
component: CustomField
|
|
1912
|
+
})))), React.createElement("div", {
|
|
1913
|
+
className: "signup-action-button"
|
|
1914
|
+
}, React.createElement("button", {
|
|
1915
|
+
type: "submit",
|
|
1916
|
+
disabled: !(isValid && dirty)
|
|
1917
|
+
}, loading ? React.createElement(CircularProgress, {
|
|
1918
|
+
size: "22px"
|
|
1919
|
+
}) : 'Submit')), React.createElement("div", {
|
|
1920
|
+
className: "login"
|
|
1921
|
+
}, React.createElement("span", {
|
|
1922
|
+
onClick: onLogin
|
|
1923
|
+
}, "Login")));
|
|
1924
|
+
}))));
|
|
1925
|
+
};
|
|
1926
|
+
|
|
1927
|
+
var style$2 = {
|
|
1928
|
+
position: 'absolute',
|
|
1929
|
+
top: '50%',
|
|
1930
|
+
left: '50%',
|
|
1931
|
+
transform: 'translate(-50%, -50%)',
|
|
1932
|
+
minWidth: 480,
|
|
1933
|
+
backgroundColor: '#fff',
|
|
1934
|
+
border: '1px solid white',
|
|
1935
|
+
outline: 'none',
|
|
1936
|
+
padding: '14px'
|
|
1937
|
+
};
|
|
1938
|
+
var Schema = /*#__PURE__*/object().shape({
|
|
1939
|
+
email: /*#__PURE__*/string().email('Invalid email').required('Required')
|
|
1940
|
+
});
|
|
1941
|
+
var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
1942
|
+
var _ref$onClose = _ref.onClose,
|
|
1943
|
+
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
1944
|
+
_ref$onLogin = _ref.onLogin,
|
|
1945
|
+
onLogin = _ref$onLogin === void 0 ? function () {} : _ref$onLogin,
|
|
1946
|
+
_ref$onForgotPassword = _ref.onForgotPasswordSuccess,
|
|
1947
|
+
onForgotPasswordSuccess = _ref$onForgotPassword === void 0 ? function () {} : _ref$onForgotPassword,
|
|
1948
|
+
_ref$onForgotPassword2 = _ref.onForgotPasswordError,
|
|
1949
|
+
onForgotPasswordError = _ref$onForgotPassword2 === void 0 ? function () {} : _ref$onForgotPassword2;
|
|
1950
|
+
|
|
1951
|
+
var _useState = useState(false),
|
|
1952
|
+
loading = _useState[0],
|
|
1953
|
+
setLoading = _useState[1];
|
|
1954
|
+
|
|
1955
|
+
var onForgotPassword = /*#__PURE__*/function () {
|
|
1956
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1957
|
+
var email, _yield$forgotPassword, data;
|
|
1958
|
+
|
|
1959
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1960
|
+
while (1) {
|
|
1961
|
+
switch (_context.prev = _context.next) {
|
|
1962
|
+
case 0:
|
|
1963
|
+
email = _ref2.email;
|
|
1964
|
+
_context.prev = 1;
|
|
1965
|
+
setLoading(true);
|
|
1966
|
+
_context.next = 5;
|
|
1967
|
+
return forgotPassword(email);
|
|
1968
|
+
|
|
1969
|
+
case 5:
|
|
1970
|
+
_yield$forgotPassword = _context.sent;
|
|
1971
|
+
data = _yield$forgotPassword.data;
|
|
1972
|
+
onForgotPasswordSuccess(data);
|
|
1973
|
+
onClose();
|
|
1974
|
+
_context.next = 14;
|
|
1975
|
+
break;
|
|
1976
|
+
|
|
1977
|
+
case 11:
|
|
1978
|
+
_context.prev = 11;
|
|
1979
|
+
_context.t0 = _context["catch"](1);
|
|
1980
|
+
|
|
1981
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
1982
|
+
onForgotPasswordError(_context.t0);
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
case 14:
|
|
1986
|
+
_context.prev = 14;
|
|
1987
|
+
setLoading(false);
|
|
1988
|
+
return _context.finish(14);
|
|
1989
|
+
|
|
1990
|
+
case 17:
|
|
1991
|
+
case "end":
|
|
1992
|
+
return _context.stop();
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
}, _callee, null, [[1, 11, 14, 17]]);
|
|
1996
|
+
}));
|
|
1997
|
+
|
|
1998
|
+
return function onForgotPassword(_x) {
|
|
1999
|
+
return _ref3.apply(this, arguments);
|
|
2000
|
+
};
|
|
2001
|
+
}();
|
|
2002
|
+
|
|
2003
|
+
var _onClose = loading ? function () {} : onClose;
|
|
2004
|
+
|
|
2005
|
+
return React.createElement(Modal$1, {
|
|
2006
|
+
open: true,
|
|
2007
|
+
onClose: _onClose,
|
|
2008
|
+
"aria-labelledby": "modal-modal-title",
|
|
2009
|
+
"aria-describedby": "modal-modal-description",
|
|
2010
|
+
className: "forgot-password-modal"
|
|
2011
|
+
}, React.createElement(Box$1, {
|
|
2012
|
+
style: style$2
|
|
2013
|
+
}, React.createElement("div", null, React.createElement(Formik, {
|
|
2014
|
+
initialValues: {
|
|
2015
|
+
email: ''
|
|
2016
|
+
},
|
|
2017
|
+
validationSchema: Schema,
|
|
2018
|
+
onSubmit: onForgotPassword
|
|
2019
|
+
}, function (_ref4) {
|
|
2020
|
+
var isValid = _ref4.isValid,
|
|
2021
|
+
dirty = _ref4.dirty,
|
|
2022
|
+
handleSubmit = _ref4.handleSubmit;
|
|
2023
|
+
return React.createElement(Form, {
|
|
2024
|
+
onSubmit: handleSubmit
|
|
2025
|
+
}, React.createElement("div", {
|
|
2026
|
+
className: "forgot-password-container"
|
|
2027
|
+
}, React.createElement("div", {
|
|
2028
|
+
className: "title"
|
|
2029
|
+
}, "Password Reset"), React.createElement("div", {
|
|
2030
|
+
className: "forgot-password-container__singleField"
|
|
2031
|
+
}, React.createElement(Field, {
|
|
2032
|
+
name: "email",
|
|
2033
|
+
label: "Email",
|
|
2034
|
+
component: CustomField
|
|
2035
|
+
}))), React.createElement("div", {
|
|
2036
|
+
className: "forgot-password-action-button"
|
|
2037
|
+
}, React.createElement("button", {
|
|
2038
|
+
type: "submit",
|
|
2039
|
+
disabled: !(isValid && dirty)
|
|
2040
|
+
}, loading ? React.createElement(CircularProgress, {
|
|
2041
|
+
size: "22px"
|
|
2042
|
+
}) : 'Submit')), React.createElement("div", {
|
|
2043
|
+
className: "login"
|
|
2044
|
+
}, React.createElement("span", {
|
|
2045
|
+
onClick: onLogin
|
|
2046
|
+
}, "Back to Log In")));
|
|
2047
|
+
}))));
|
|
1760
2048
|
};
|
|
1761
2049
|
|
|
1762
2050
|
var _excluded = ["firstName", "lastName", "holderAge", "confirmEmail", "confirmPassword"];
|
|
@@ -1817,7 +2105,7 @@ var createRegisterFormData = function createRegisterFormData(values, checkoutBod
|
|
|
1817
2105
|
|
|
1818
2106
|
return bodyFormData;
|
|
1819
2107
|
};
|
|
1820
|
-
var setLoggedUserData = function setLoggedUserData(data) {
|
|
2108
|
+
var setLoggedUserData$1 = function setLoggedUserData(data) {
|
|
1821
2109
|
return {
|
|
1822
2110
|
id: data.id,
|
|
1823
2111
|
first_name: data.firstName,
|
|
@@ -1871,10 +2159,10 @@ var createCheckoutDataBody = function createCheckoutDataBody(ticketsQuantity, va
|
|
|
1871
2159
|
});
|
|
1872
2160
|
ticket_holders = filteredHolders.map(function (item, index) {
|
|
1873
2161
|
return {
|
|
1874
|
-
first_name: item["holderFirstName-" + index] || '',
|
|
1875
|
-
last_name: item["holderLastName-" + index] || '',
|
|
2162
|
+
first_name: !index ? item["holderFirstName-" + index] || logedInValues.firstNameLogged || '' : item["holderFirstName-" + index] || '',
|
|
2163
|
+
last_name: !index ? item["holderLastName-" + index] || logedInValues.lastNameLogged || '' : item["holderLastName-" + index] || '',
|
|
1876
2164
|
phone: item["holderPhone-" + index] || '',
|
|
1877
|
-
email: item["holderEmail-" + index] || ''
|
|
2165
|
+
email: !index ? item["holderEmail-" + index] || logedInValues.emailLogged || '' : item["holderEmail-" + index] || ''
|
|
1878
2166
|
};
|
|
1879
2167
|
});
|
|
1880
2168
|
var filteredRestValue = {};
|
|
@@ -1925,6 +2213,14 @@ var getValidateFunctions = function getValidateFunctions(element, states, values
|
|
|
1925
2213
|
validationFunctions.push(isSameEmail);
|
|
1926
2214
|
}
|
|
1927
2215
|
|
|
2216
|
+
if (element.name === 'confirmPassword') {
|
|
2217
|
+
var isSame = function isSame(confirmPassword) {
|
|
2218
|
+
return values.password !== confirmPassword ? 'Password confirmation does not match' : null;
|
|
2219
|
+
};
|
|
2220
|
+
|
|
2221
|
+
validationFunctions.push(isSame);
|
|
2222
|
+
}
|
|
2223
|
+
|
|
1928
2224
|
return combineValidators.apply(void 0, validationFunctions);
|
|
1929
2225
|
};
|
|
1930
2226
|
var assingUniqueIds = function assingUniqueIds(data) {
|
|
@@ -1965,62 +2261,6 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
1965
2261
|
})), !!(rest != null && (_rest$form2 = rest.form) != null && _rest$form2.errors && rest.form.errors[(_field$name2 = field == null ? void 0 : field.name) != null ? _field$name2 : ""]) ? React.createElement(FormHelperText, null, "Required") : null);
|
|
1966
2262
|
};
|
|
1967
2263
|
|
|
1968
|
-
var CustomField = function CustomField(_ref) {
|
|
1969
|
-
var label = _ref.label,
|
|
1970
|
-
_ref$type = _ref.type,
|
|
1971
|
-
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1972
|
-
field = _ref.field,
|
|
1973
|
-
_ref$selectOptions = _ref.selectOptions,
|
|
1974
|
-
selectOptions = _ref$selectOptions === void 0 ? [] : _ref$selectOptions,
|
|
1975
|
-
_ref$form = _ref.form,
|
|
1976
|
-
touched = _ref$form.touched,
|
|
1977
|
-
errors = _ref$form.errors,
|
|
1978
|
-
submitCount = _ref$form.submitCount,
|
|
1979
|
-
theme = _ref.theme,
|
|
1980
|
-
_ref$inputProps = _ref.inputProps,
|
|
1981
|
-
pInputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
|
|
1982
|
-
_ref$InputProps = _ref.InputProps,
|
|
1983
|
-
InputProps = _ref$InputProps === void 0 ? {} : _ref$InputProps,
|
|
1984
|
-
inputRef = _ref.inputRef;
|
|
1985
|
-
var isSelectField = type === 'select';
|
|
1986
|
-
|
|
1987
|
-
var error = _get(errors, field.name);
|
|
1988
|
-
|
|
1989
|
-
var isTouched = Boolean(_get(touched, field.name)) || _includes(field.name, 'holder') && !!error && !!submitCount;
|
|
1990
|
-
var customTheme = useTheme();
|
|
1991
|
-
var inputProps = {
|
|
1992
|
-
sx: customTheme == null ? void 0 : customTheme.input
|
|
1993
|
-
};
|
|
1994
|
-
return React.createElement(TextField$1, Object.assign({
|
|
1995
|
-
id: field.name,
|
|
1996
|
-
label: label,
|
|
1997
|
-
type: type,
|
|
1998
|
-
select: isSelectField,
|
|
1999
|
-
fullWidth: true,
|
|
2000
|
-
error: !!error && isTouched,
|
|
2001
|
-
helperText: isTouched && error,
|
|
2002
|
-
SelectProps: {
|
|
2003
|
-
"native": true,
|
|
2004
|
-
className: theme,
|
|
2005
|
-
MenuProps: {
|
|
2006
|
-
className: theme
|
|
2007
|
-
}
|
|
2008
|
-
},
|
|
2009
|
-
InputLabelProps: {
|
|
2010
|
-
sx: customTheme == null ? void 0 : customTheme.input
|
|
2011
|
-
},
|
|
2012
|
-
InputProps: InputProps,
|
|
2013
|
-
inputProps: _extends({}, inputProps, pInputProps),
|
|
2014
|
-
inputRef: inputRef
|
|
2015
|
-
}, field), isSelectField ? _map(selectOptions, function (option) {
|
|
2016
|
-
return React.createElement("option", {
|
|
2017
|
-
key: option.value,
|
|
2018
|
-
value: option.value,
|
|
2019
|
-
disabled: option.disabled
|
|
2020
|
-
}, option.label);
|
|
2021
|
-
}) : null);
|
|
2022
|
-
};
|
|
2023
|
-
|
|
2024
2264
|
var currencyNormalizerCreator = function currencyNormalizerCreator(value, currency) {
|
|
2025
2265
|
return !value ? '' : "" + getCurrencySymbolByCurrency(currency) + value;
|
|
2026
2266
|
};
|
|
@@ -2087,56 +2327,86 @@ var getCurrencySymbolByCurrency = function getCurrencySymbolByCurrency(currency)
|
|
|
2087
2327
|
return 'US$';
|
|
2088
2328
|
}
|
|
2089
2329
|
};
|
|
2090
|
-
var removePlusSign = function removePlusSign(string) {
|
|
2091
|
-
if (string === void 0) {
|
|
2092
|
-
string = '';
|
|
2093
|
-
}
|
|
2094
|
-
|
|
2095
|
-
return string.replace('+', '');
|
|
2096
|
-
};
|
|
2097
2330
|
|
|
2098
|
-
var
|
|
2099
|
-
var FormikPhoneNumberField = function FormikPhoneNumberField(_ref) {
|
|
2331
|
+
var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
2100
2332
|
var label = _ref.label,
|
|
2333
|
+
_ref$type = _ref.type,
|
|
2334
|
+
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
2101
2335
|
field = _ref.field,
|
|
2102
2336
|
_ref$form = _ref.form,
|
|
2103
|
-
touched = _ref$form.touched,
|
|
2104
2337
|
errors = _ref$form.errors,
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
2338
|
+
setFieldError = _ref$form.setFieldError,
|
|
2339
|
+
setStatus = _ref$form.setStatus;
|
|
2108
2340
|
|
|
2109
|
-
var error = _get(errors, field.name);
|
|
2341
|
+
var error = _get(errors, field.name); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2110
2342
|
|
|
2111
|
-
|
|
2112
|
-
var
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2343
|
+
|
|
2344
|
+
var debounceCb = useCallback(_debounce(function (cb) {
|
|
2345
|
+
return void cb();
|
|
2346
|
+
}, 1000), []);
|
|
2347
|
+
useEffect(function () {
|
|
2348
|
+
if (field.value) {
|
|
2349
|
+
var _setStatus;
|
|
2350
|
+
|
|
2351
|
+
setStatus((_setStatus = {}, _setStatus[field.name] = true, _setStatus));
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
debounceCb( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
2355
|
+
var message, _setStatus2;
|
|
2356
|
+
|
|
2357
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
2358
|
+
while (1) {
|
|
2359
|
+
switch (_context.prev = _context.next) {
|
|
2360
|
+
case 0:
|
|
2361
|
+
_context.prev = 0;
|
|
2362
|
+
|
|
2363
|
+
if (!field.value) {
|
|
2364
|
+
_context.next = 4;
|
|
2365
|
+
break;
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
_context.next = 4;
|
|
2369
|
+
return validatePhoneNumber(field.value);
|
|
2370
|
+
|
|
2371
|
+
case 4:
|
|
2372
|
+
setFieldError(field.name, '');
|
|
2373
|
+
_context.next = 11;
|
|
2374
|
+
break;
|
|
2375
|
+
|
|
2376
|
+
case 7:
|
|
2377
|
+
_context.prev = 7;
|
|
2378
|
+
_context.t0 = _context["catch"](0);
|
|
2379
|
+
message = _get(_context.t0, 'response.data.message', 'Invalid phone number');
|
|
2380
|
+
setFieldError(field.name, message);
|
|
2381
|
+
|
|
2382
|
+
case 11:
|
|
2383
|
+
_context.prev = 11;
|
|
2384
|
+
setStatus((_setStatus2 = {}, _setStatus2[field.name] = false, _setStatus2));
|
|
2385
|
+
return _context.finish(11);
|
|
2386
|
+
|
|
2387
|
+
case 14:
|
|
2388
|
+
case "end":
|
|
2389
|
+
return _context.stop();
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
}, _callee, null, [[0, 7, 11, 14]]);
|
|
2393
|
+
}))); // eslint-disable-next-line
|
|
2394
|
+
}, [field.value]);
|
|
2395
|
+
return React.createElement(TextField$1, Object.assign({}, field, {
|
|
2396
|
+
id: field.name,
|
|
2122
2397
|
label: label,
|
|
2123
|
-
|
|
2124
|
-
helperText: isTouched && error,
|
|
2398
|
+
type: type,
|
|
2125
2399
|
fullWidth: true,
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
sx: customTheme == null ? void 0 : customTheme.input
|
|
2131
|
-
},
|
|
2132
|
-
autoFormat: false
|
|
2133
|
-
}, rest));
|
|
2400
|
+
error: !!error,
|
|
2401
|
+
helperText: error,
|
|
2402
|
+
value: field.value || ''
|
|
2403
|
+
}));
|
|
2134
2404
|
};
|
|
2135
2405
|
|
|
2136
2406
|
function Loader() {
|
|
2137
2407
|
return React.createElement("div", {
|
|
2138
2408
|
className: "loader-container"
|
|
2139
|
-
}, React.createElement(CircularProgress, null));
|
|
2409
|
+
}, React.createElement(CircularProgress$1, null));
|
|
2140
2410
|
}
|
|
2141
2411
|
|
|
2142
2412
|
var SelectField = function SelectField(_ref) {
|
|
@@ -2399,7 +2669,8 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2399
2669
|
setValues = _ref.setValues,
|
|
2400
2670
|
setUserValues = _ref.setUserValues,
|
|
2401
2671
|
onGetStatesSuccess = _ref.onGetStatesSuccess,
|
|
2402
|
-
onGetStatesError = _ref.onGetStatesError
|
|
2672
|
+
onGetStatesError = _ref.onGetStatesError,
|
|
2673
|
+
shouldFetchCountries = _ref.shouldFetchCountries;
|
|
2403
2674
|
var prevCountry = useRef(values.country);
|
|
2404
2675
|
useEffect(function () {
|
|
2405
2676
|
var fetchStates = /*#__PURE__*/function () {
|
|
@@ -2454,7 +2725,7 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2454
2725
|
};
|
|
2455
2726
|
}();
|
|
2456
2727
|
|
|
2457
|
-
fetchStates();
|
|
2728
|
+
shouldFetchCountries && fetchStates();
|
|
2458
2729
|
}, [values.country, setStates, setFieldValue]);
|
|
2459
2730
|
var userDataEncoded = typeof window !== 'undefined' ? window.localStorage.getItem('user_data') : '';
|
|
2460
2731
|
useEffect(function () {
|
|
@@ -2465,8 +2736,8 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2465
2736
|
try {
|
|
2466
2737
|
var parsedData = JSON.parse(userDataEncoded);
|
|
2467
2738
|
var mappedValues = {
|
|
2468
|
-
firstName: (parsedData == null ? void 0 : parsedData.first_name) || '',
|
|
2469
|
-
lastName: (parsedData == null ? void 0 : parsedData.last_name) || '',
|
|
2739
|
+
firstName: (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
|
|
2740
|
+
lastName: (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
|
|
2470
2741
|
email: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
2471
2742
|
phone: (parsedData == null ? void 0 : parsedData.phone) || '',
|
|
2472
2743
|
confirmEmail: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
@@ -2474,15 +2745,15 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2474
2745
|
street_address: (parsedData == null ? void 0 : parsedData.street_address) || '',
|
|
2475
2746
|
country: (parsedData == null ? void 0 : parsedData.country) || '1',
|
|
2476
2747
|
zip: (parsedData == null ? void 0 : parsedData.zip) || '',
|
|
2477
|
-
brand_opt_in: (parsedData == null ? void 0 : parsedData.brand_opt_in) ||
|
|
2748
|
+
brand_opt_in: (parsedData == null ? void 0 : parsedData.brand_opt_in) || false,
|
|
2478
2749
|
city: (parsedData == null ? void 0 : parsedData.city) || '',
|
|
2479
2750
|
confirmPassword: '',
|
|
2480
2751
|
password: '',
|
|
2481
|
-
'holderFirstName-0': (parsedData == null ? void 0 : parsedData.first_name) || '',
|
|
2482
|
-
'holderLastName-0': (parsedData == null ? void 0 : parsedData.last_name) || '',
|
|
2752
|
+
'holderFirstName-0': (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
|
|
2753
|
+
'holderLastName-0': (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
|
|
2483
2754
|
'holderEmail-0': (parsedData == null ? void 0 : parsedData.email) || ''
|
|
2484
2755
|
};
|
|
2485
|
-
setValues(mappedValues);
|
|
2756
|
+
setValues(_extends({}, values, mappedValues));
|
|
2486
2757
|
setUserValues(mappedValues);
|
|
2487
2758
|
} catch (e) {}
|
|
2488
2759
|
}
|
|
@@ -2555,10 +2826,21 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2555
2826
|
skipPage = _ref3$skipPage === void 0 ? false : _ref3$skipPage,
|
|
2556
2827
|
_ref3$canSkipHolderNa = _ref3.canSkipHolderNames,
|
|
2557
2828
|
canSkipHolderNames = _ref3$canSkipHolderNa === void 0 ? false : _ref3$canSkipHolderNa,
|
|
2829
|
+
_ref3$onForgotPasswor = _ref3.onForgotPasswordSuccess,
|
|
2830
|
+
onForgotPasswordSuccess = _ref3$onForgotPasswor === void 0 ? function () {} : _ref3$onForgotPasswor,
|
|
2831
|
+
_ref3$onForgotPasswor2 = _ref3.onForgotPasswordError,
|
|
2832
|
+
onForgotPasswordError = _ref3$onForgotPasswor2 === void 0 ? function () {} : _ref3$onForgotPasswor2,
|
|
2833
|
+
_ref3$shouldFetchCoun = _ref3.shouldFetchCountries,
|
|
2834
|
+
shouldFetchCountries = _ref3$shouldFetchCoun === void 0 ? true : _ref3$shouldFetchCoun,
|
|
2558
2835
|
_ref3$onCountdownFini = _ref3.onCountdownFinish,
|
|
2559
2836
|
onCountdownFinish = _ref3$onCountdownFini === void 0 ? function () {} : _ref3$onCountdownFini,
|
|
2560
2837
|
_ref3$enableTimer = _ref3.enableTimer,
|
|
2561
|
-
enableTimer = _ref3$enableTimer === void 0 ? false : _ref3$enableTimer
|
|
2838
|
+
enableTimer = _ref3$enableTimer === void 0 ? false : _ref3$enableTimer,
|
|
2839
|
+
logo = _ref3.logo,
|
|
2840
|
+
_ref3$showForgotPassw = _ref3.showForgotPasswordButton,
|
|
2841
|
+
showForgotPasswordButton = _ref3$showForgotPassw === void 0 ? false : _ref3$showForgotPassw,
|
|
2842
|
+
_ref3$showSignUpButto = _ref3.showSignUpButton,
|
|
2843
|
+
showSignUpButton = _ref3$showSignUpButto === void 0 ? false : _ref3$showSignUpButto;
|
|
2562
2844
|
|
|
2563
2845
|
var themeMui = createTheme(themeOptions);
|
|
2564
2846
|
var isWindowDefined = typeof window !== 'undefined';
|
|
@@ -2569,7 +2851,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2569
2851
|
dataWithUniqueIds = _useState[0],
|
|
2570
2852
|
setDataWithUniqueIds = _useState[1];
|
|
2571
2853
|
|
|
2572
|
-
var
|
|
2854
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
2855
|
+
|
|
2856
|
+
var _useState2 = useState(!!(pIsLoggedIn || xtfCookie)),
|
|
2573
2857
|
isLoggedIn = _useState2[0],
|
|
2574
2858
|
setIsLoggedIn = _useState2[1];
|
|
2575
2859
|
|
|
@@ -2598,14 +2882,18 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2598
2882
|
setUserExpired = _useState8[1];
|
|
2599
2883
|
|
|
2600
2884
|
var _useState9 = useState(false),
|
|
2601
|
-
|
|
2602
|
-
|
|
2885
|
+
showModalSignup = _useState9[0],
|
|
2886
|
+
setShowModalSignup = _useState9[1];
|
|
2603
2887
|
|
|
2604
|
-
var _useState10 = useState(
|
|
2605
|
-
|
|
2606
|
-
|
|
2888
|
+
var _useState10 = useState(false),
|
|
2889
|
+
showModalForgotPassword = _useState10[0],
|
|
2890
|
+
setShowModalForgotPassword = _useState10[1];
|
|
2607
2891
|
|
|
2608
|
-
var _useState11 = useState(
|
|
2892
|
+
var _useState11 = useState([]),
|
|
2893
|
+
ticketsQuantity = _useState11[0],
|
|
2894
|
+
setTicketsQuantity = _useState11[1];
|
|
2895
|
+
|
|
2896
|
+
var _useState12 = useState({
|
|
2609
2897
|
firstName: '',
|
|
2610
2898
|
lastName: '',
|
|
2611
2899
|
email: '',
|
|
@@ -2620,16 +2908,16 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2620
2908
|
state: '',
|
|
2621
2909
|
zip: ''
|
|
2622
2910
|
}),
|
|
2623
|
-
userValues =
|
|
2624
|
-
setUserValues =
|
|
2911
|
+
userValues = _useState12[0],
|
|
2912
|
+
setUserValues = _useState12[1];
|
|
2625
2913
|
|
|
2626
|
-
var
|
|
2627
|
-
loading =
|
|
2628
|
-
setLoading =
|
|
2914
|
+
var _useState13 = useState(true),
|
|
2915
|
+
loading = _useState13[0],
|
|
2916
|
+
setLoading = _useState13[1];
|
|
2629
2917
|
|
|
2630
|
-
var
|
|
2631
|
-
error =
|
|
2632
|
-
setError =
|
|
2918
|
+
var _useState14 = useState(null),
|
|
2919
|
+
error = _useState14[0],
|
|
2920
|
+
setError = _useState14[1];
|
|
2633
2921
|
|
|
2634
2922
|
var emailLogged = _get(userData, 'email', '') || _get(userValues, 'email', '');
|
|
2635
2923
|
|
|
@@ -2679,10 +2967,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2679
2967
|
};
|
|
2680
2968
|
|
|
2681
2969
|
useEffect(function () {
|
|
2682
|
-
if (
|
|
2683
|
-
setIsLoggedIn(
|
|
2970
|
+
if (pIsLoggedIn !== isLoggedIn || xtfCookie) {
|
|
2971
|
+
setIsLoggedIn(!!(pIsLoggedIn || xtfCookie));
|
|
2684
2972
|
}
|
|
2685
|
-
}, [pIsLoggedIn, isLoggedIn,
|
|
2973
|
+
}, [pIsLoggedIn, isLoggedIn, xtfCookie]); //just once
|
|
2686
2974
|
|
|
2687
2975
|
useEffect(function () {
|
|
2688
2976
|
// fetch countries data
|
|
@@ -2731,7 +3019,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2731
3019
|
};
|
|
2732
3020
|
}();
|
|
2733
3021
|
|
|
2734
|
-
fetchCountries();
|
|
3022
|
+
shouldFetchCountries && fetchCountries();
|
|
2735
3023
|
fetchCart();
|
|
2736
3024
|
}, []); // fetch cart data
|
|
2737
3025
|
|
|
@@ -2791,7 +3079,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2791
3079
|
case 0:
|
|
2792
3080
|
_context4.prev = 0;
|
|
2793
3081
|
|
|
2794
|
-
if (!(isWindowDefined && token)) {
|
|
3082
|
+
if (!(isWindowDefined && token || isLoggedIn)) {
|
|
2795
3083
|
_context4.next = 10;
|
|
2796
3084
|
break;
|
|
2797
3085
|
}
|
|
@@ -2802,7 +3090,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2802
3090
|
case 4:
|
|
2803
3091
|
userDataResponse = _context4.sent;
|
|
2804
3092
|
profileSpecifiedData = _get(userDataResponse, 'data.data');
|
|
2805
|
-
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
3093
|
+
profileDataObj = setLoggedUserData$1(profileSpecifiedData);
|
|
2806
3094
|
setUserValues(_extends({}, profileDataObj, {
|
|
2807
3095
|
firstName: profileDataObj.first_name,
|
|
2808
3096
|
lastName: profileDataObj.last_name
|
|
@@ -2838,7 +3126,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2838
3126
|
|
|
2839
3127
|
useEffect(function () {
|
|
2840
3128
|
fetchUserData(access_token);
|
|
2841
|
-
}, [access_token]);
|
|
3129
|
+
}, [access_token, isLoggedIn]);
|
|
2842
3130
|
useEffect(function () {
|
|
2843
3131
|
var collectPaymentData = /*#__PURE__*/function () {
|
|
2844
3132
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
|
|
@@ -2894,16 +3182,20 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2894
3182
|
collectPaymentData();
|
|
2895
3183
|
}, [skipPage, ticketsQuantity]);
|
|
2896
3184
|
|
|
2897
|
-
var collectCheckoutBody = function collectCheckoutBody(values) {
|
|
3185
|
+
var collectCheckoutBody = function collectCheckoutBody(values, profileData) {
|
|
2898
3186
|
var checkoutBody = {}; // Auto collect ticket holders name when it was skipped optionally
|
|
2899
3187
|
|
|
2900
3188
|
if (showDOB && !showTicketHolders && canSkipHolderNames) {
|
|
2901
|
-
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity.length, values, true
|
|
2902
|
-
} else {
|
|
2903
|
-
checkoutBody = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
3189
|
+
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity.length, values, true, {
|
|
2904
3190
|
emailLogged: emailLogged,
|
|
2905
3191
|
firstNameLogged: firstNameLogged,
|
|
2906
3192
|
lastNameLogged: lastNameLogged
|
|
3193
|
+
});
|
|
3194
|
+
} else {
|
|
3195
|
+
checkoutBody = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
3196
|
+
emailLogged: emailLogged || profileData.email,
|
|
3197
|
+
firstNameLogged: firstNameLogged || profileData.first_name || profileData.firstName,
|
|
3198
|
+
lastNameLogged: lastNameLogged || profileData.last_name || profileData.lastName
|
|
2907
3199
|
}, showDOB);
|
|
2908
3200
|
}
|
|
2909
3201
|
|
|
@@ -2912,28 +3204,27 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2912
3204
|
|
|
2913
3205
|
var removeReferralKey = function removeReferralKey() {
|
|
2914
3206
|
localStorage.removeItem('referral_key');
|
|
2915
|
-
};
|
|
2916
|
-
|
|
3207
|
+
};
|
|
2917
3208
|
|
|
2918
3209
|
if (loading || enableTimer && !expirationTime && typeof window !== 'undefined') {
|
|
2919
3210
|
if (expirationTime === 0) {
|
|
2920
3211
|
// Redirect to homepage (countdown finished and browser reloaded case)
|
|
2921
3212
|
window.location.href = '/';
|
|
2922
3213
|
}
|
|
2923
|
-
|
|
2924
|
-
return React.createElement(Backdrop, {
|
|
2925
|
-
sx: {
|
|
2926
|
-
color: '#fff'
|
|
2927
|
-
},
|
|
2928
|
-
open: true
|
|
2929
|
-
}, React.createElement(CircularProgress$1, {
|
|
2930
|
-
color: "inherit"
|
|
2931
|
-
}));
|
|
2932
3214
|
}
|
|
2933
3215
|
|
|
2934
3216
|
return React.createElement(ThemeProvider, {
|
|
2935
3217
|
theme: themeMui
|
|
2936
|
-
},
|
|
3218
|
+
}, loading && React.createElement(Backdrop, {
|
|
3219
|
+
sx: {
|
|
3220
|
+
color: '#fff',
|
|
3221
|
+
backgroundColor: '#000000bd',
|
|
3222
|
+
zIndex: 1205
|
|
3223
|
+
},
|
|
3224
|
+
open: true
|
|
3225
|
+
}, React.createElement(CircularProgress, {
|
|
3226
|
+
color: "inherit"
|
|
3227
|
+
})), !!expirationTime && enableTimer && React.createElement(TimerWidget$1, {
|
|
2937
3228
|
expires_at: expirationTime,
|
|
2938
3229
|
onCountdownFinish: onCountdownFinish
|
|
2939
3230
|
}), React.createElement(Formik, {
|
|
@@ -2943,10 +3234,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2943
3234
|
brand_opt_in: optedInFieldValue,
|
|
2944
3235
|
ttf_opt_in: ttfOptIn
|
|
2945
3236
|
}), userValues),
|
|
2946
|
-
enableReinitialize:
|
|
3237
|
+
enableReinitialize: false,
|
|
2947
3238
|
onSubmit: function () {
|
|
2948
3239
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(values, formikHelpers) {
|
|
2949
|
-
var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, checkoutBodyForRegistration, bodyFormData,
|
|
3240
|
+
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;
|
|
2950
3241
|
|
|
2951
3242
|
return runtime_1.wrap(function _callee6$(_context6) {
|
|
2952
3243
|
while (1) {
|
|
@@ -2970,14 +3261,14 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2970
3261
|
case 5:
|
|
2971
3262
|
updatedUserData = _context6.sent;
|
|
2972
3263
|
_profileSpecifiedData = _get(updatedUserData, 'data.data');
|
|
2973
|
-
_profileDataObj = setLoggedUserData(_profileSpecifiedData);
|
|
3264
|
+
_profileDataObj = setLoggedUserData$1(_profileSpecifiedData);
|
|
2974
3265
|
|
|
2975
3266
|
if (isWindowDefined) {
|
|
2976
3267
|
window.localStorage.setItem('user_data', JSON.stringify(_profileDataObj));
|
|
2977
3268
|
}
|
|
2978
3269
|
|
|
2979
3270
|
case 9:
|
|
2980
|
-
_checkoutBody = collectCheckoutBody(values);
|
|
3271
|
+
_checkoutBody = collectCheckoutBody(values, userData);
|
|
2981
3272
|
_context6.next = 12;
|
|
2982
3273
|
return postOnCheckout(_checkoutBody, access_token);
|
|
2983
3274
|
|
|
@@ -2994,27 +3285,30 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2994
3285
|
lastNameLogged: lastNameLogged
|
|
2995
3286
|
}, showDOB);
|
|
2996
3287
|
bodyFormData = createRegisterFormData(values, checkoutBodyForRegistration);
|
|
2997
|
-
|
|
2998
|
-
|
|
3288
|
+
_context6.prev = 18;
|
|
3289
|
+
setLoading(true);
|
|
2999
3290
|
_context6.next = 22;
|
|
3000
3291
|
return register(bodyFormData);
|
|
3001
3292
|
|
|
3002
3293
|
case 22:
|
|
3003
3294
|
resRegister = _context6.sent;
|
|
3004
|
-
|
|
3295
|
+
_xtfCookie = _get(resRegister, 'headers.x-tf-ecommerce');
|
|
3296
|
+
accessToken = _get(resRegister, 'data.data.attributes.access_token');
|
|
3005
3297
|
refreshToken = _get(resRegister, 'data.data.attributes.refresh_token');
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3298
|
+
userProfile = _get(resRegister, 'data.data.attributes.user_profile');
|
|
3299
|
+
onRegisterSuccess({
|
|
3300
|
+
xtfCookie: _xtfCookie,
|
|
3301
|
+
accessToken: accessToken,
|
|
3302
|
+
refreshToken: refreshToken,
|
|
3303
|
+
userProfile: userProfile
|
|
3304
|
+
});
|
|
3305
|
+
_context6.next = 35;
|
|
3013
3306
|
break;
|
|
3014
3307
|
|
|
3015
3308
|
case 30:
|
|
3016
3309
|
_context6.prev = 30;
|
|
3017
|
-
_context6.t0 = _context6["catch"](
|
|
3310
|
+
_context6.t0 = _context6["catch"](18);
|
|
3311
|
+
setLoading(false);
|
|
3018
3312
|
|
|
3019
3313
|
if (axios.isAxiosError(_context6.t0)) {
|
|
3020
3314
|
_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;
|
|
@@ -3043,33 +3337,34 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3043
3337
|
|
|
3044
3338
|
return _context6.abrupt("return");
|
|
3045
3339
|
|
|
3046
|
-
case
|
|
3047
|
-
_context6.next =
|
|
3048
|
-
return getProfileData(
|
|
3340
|
+
case 35:
|
|
3341
|
+
_context6.next = 37;
|
|
3342
|
+
return getProfileData();
|
|
3049
3343
|
|
|
3050
|
-
case
|
|
3344
|
+
case 37:
|
|
3051
3345
|
profileData = _context6.sent;
|
|
3052
3346
|
profileSpecifiedData = _get(profileData, 'data.data');
|
|
3053
|
-
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
3347
|
+
profileDataObj = setLoggedUserData$1(profileSpecifiedData);
|
|
3054
3348
|
|
|
3055
3349
|
if (isWindowDefined) {
|
|
3056
3350
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
3057
3351
|
}
|
|
3058
3352
|
|
|
3059
|
-
checkoutBody = collectCheckoutBody(values);
|
|
3060
|
-
_context6.next =
|
|
3061
|
-
return postOnCheckout(checkoutBody
|
|
3353
|
+
checkoutBody = collectCheckoutBody(values, profileDataObj);
|
|
3354
|
+
_context6.next = 44;
|
|
3355
|
+
return postOnCheckout(checkoutBody);
|
|
3062
3356
|
|
|
3063
|
-
case
|
|
3357
|
+
case 44:
|
|
3064
3358
|
res = _context6.sent;
|
|
3065
3359
|
removeReferralKey();
|
|
3066
3360
|
handleSubmit(values, formikHelpers, eventId, res);
|
|
3067
|
-
_context6.next =
|
|
3361
|
+
_context6.next = 53;
|
|
3068
3362
|
break;
|
|
3069
3363
|
|
|
3070
|
-
case
|
|
3071
|
-
_context6.prev =
|
|
3364
|
+
case 49:
|
|
3365
|
+
_context6.prev = 49;
|
|
3072
3366
|
_context6.t1 = _context6["catch"](0);
|
|
3367
|
+
setLoading(false);
|
|
3073
3368
|
|
|
3074
3369
|
if (axios.isAxiosError(_context6.t1)) {
|
|
3075
3370
|
if (((_e$response2 = _context6.t1.response) == null ? void 0 : _e$response2.data.error) === 'invalid_token') {
|
|
@@ -3088,12 +3383,17 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3088
3383
|
onSubmitError(_context6.t1);
|
|
3089
3384
|
}
|
|
3090
3385
|
|
|
3091
|
-
case
|
|
3386
|
+
case 53:
|
|
3387
|
+
_context6.prev = 53;
|
|
3388
|
+
setLoading(false);
|
|
3389
|
+
return _context6.finish(53);
|
|
3390
|
+
|
|
3391
|
+
case 56:
|
|
3092
3392
|
case "end":
|
|
3093
3393
|
return _context6.stop();
|
|
3094
3394
|
}
|
|
3095
3395
|
}
|
|
3096
|
-
}, _callee6, null, [[0,
|
|
3396
|
+
}, _callee6, null, [[0, 49, 53, 56], [18, 30]]);
|
|
3097
3397
|
}));
|
|
3098
3398
|
|
|
3099
3399
|
function onSubmit(_x2, _x3) {
|
|
@@ -3112,7 +3412,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3112
3412
|
setValues: props.setValues,
|
|
3113
3413
|
setUserValues: setUserValues,
|
|
3114
3414
|
onGetStatesSuccess: onGetStatesSuccess,
|
|
3115
|
-
onGetStatesError: onGetStatesError
|
|
3415
|
+
onGetStatesError: onGetStatesError,
|
|
3416
|
+
shouldFetchCountries: shouldFetchCountries
|
|
3116
3417
|
}), React.createElement("div", {
|
|
3117
3418
|
className: "billing-info-container " + theme
|
|
3118
3419
|
}, React.createElement(SnackbarAlert, {
|
|
@@ -3125,8 +3426,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3125
3426
|
}
|
|
3126
3427
|
}), !isLoggedIn && React.createElement("div", {
|
|
3127
3428
|
className: "account-actions-block"
|
|
3128
|
-
}, React.createElement("div",
|
|
3129
|
-
className: "
|
|
3429
|
+
}, React.createElement("div", {
|
|
3430
|
+
className: "action-item"
|
|
3431
|
+
}, React.createElement("div", null, accountInfoTitle), React.createElement("div", null, "Login & skip ahead:")), React.createElement("div", {
|
|
3432
|
+
className: "action-item login-block"
|
|
3130
3433
|
}, React.createElement("button", {
|
|
3131
3434
|
className: "login-register-button",
|
|
3132
3435
|
type: "button",
|
|
@@ -3184,7 +3487,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3184
3487
|
validate: getValidateFunctions(element, states, props.values),
|
|
3185
3488
|
setFieldValue: props.setFieldValue,
|
|
3186
3489
|
onBlur: props.handleBlur,
|
|
3187
|
-
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ?
|
|
3490
|
+
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ? PhoneNumberField : element.type === 'date' ? DatePickerField : CustomField,
|
|
3188
3491
|
selectOptions: element.name === 'country' ? countries : element.name === 'state' ? states : [],
|
|
3189
3492
|
theme: theme
|
|
3190
3493
|
})));
|
|
@@ -3192,7 +3495,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3192
3495
|
}));
|
|
3193
3496
|
}), !_isEmpty(ticketHoldersFields.fields) && React.createElement("div", {
|
|
3194
3497
|
className: "ticket-holders-fields"
|
|
3195
|
-
}, React.createElement("
|
|
3498
|
+
}, React.createElement("h2", null, ticketHoldersFields.label), _map(ticketsQuantity, function (_item, index) {
|
|
3196
3499
|
return React.createElement("div", {
|
|
3197
3500
|
key: _item
|
|
3198
3501
|
}, React.createElement("h5", null, "Ticket ", index + 1), _map(ticketHoldersFields.fields, function (group) {
|
|
@@ -3223,10 +3526,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3223
3526
|
variant: "contained",
|
|
3224
3527
|
className: "login-register-button",
|
|
3225
3528
|
disabled: props.isSubmitting
|
|
3226
|
-
}, props.isSubmitting ? React.createElement(CircularProgress
|
|
3529
|
+
}, props.isSubmitting ? React.createElement(CircularProgress, {
|
|
3227
3530
|
size: 26
|
|
3228
3531
|
}) : buttonName))));
|
|
3229
3532
|
}), showModalLogin && React.createElement(LoginModal, {
|
|
3533
|
+
logo: logo,
|
|
3230
3534
|
onClose: function onClose() {
|
|
3231
3535
|
setShowModalLogin(false);
|
|
3232
3536
|
},
|
|
@@ -3244,20 +3548,37 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3244
3548
|
|
|
3245
3549
|
_onGetProfileDataSuccess(data);
|
|
3246
3550
|
},
|
|
3247
|
-
onGetProfileDataError: onGetProfileDataError
|
|
3248
|
-
|
|
3551
|
+
onGetProfileDataError: onGetProfileDataError,
|
|
3552
|
+
showSignUpButton: showSignUpButton,
|
|
3553
|
+
showForgotPasswordButton: showForgotPasswordButton,
|
|
3554
|
+
onForgotPassword: function onForgotPassword() {
|
|
3555
|
+
setShowModalLogin(false);
|
|
3556
|
+
setShowModalForgotPassword(true);
|
|
3557
|
+
},
|
|
3558
|
+
onSignup: function onSignup() {
|
|
3559
|
+
setShowModalLogin(false);
|
|
3560
|
+
setShowModalSignup(true);
|
|
3561
|
+
}
|
|
3562
|
+
}), showModalSignup && React.createElement(SignupModal, {
|
|
3249
3563
|
onClose: function onClose() {
|
|
3250
|
-
|
|
3564
|
+
setShowModalSignup(false);
|
|
3251
3565
|
},
|
|
3252
|
-
|
|
3253
|
-
|
|
3566
|
+
onLogin: function onLogin() {
|
|
3567
|
+
setShowModalSignup(false);
|
|
3568
|
+
setShowModalLogin(true);
|
|
3254
3569
|
},
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3570
|
+
onRegisterSuccess: onRegisterSuccess,
|
|
3571
|
+
onRegisterError: onRegisterError
|
|
3572
|
+
}), showModalForgotPassword && React.createElement(ForgotPasswordModal, {
|
|
3573
|
+
onClose: function onClose() {
|
|
3574
|
+
setShowModalForgotPassword(false);
|
|
3575
|
+
},
|
|
3576
|
+
onLogin: function onLogin() {
|
|
3577
|
+
setShowModalForgotPassword(false);
|
|
3578
|
+
setShowModalLogin(true);
|
|
3259
3579
|
},
|
|
3260
|
-
|
|
3580
|
+
onForgotPasswordSuccess: onForgotPasswordSuccess,
|
|
3581
|
+
onForgotPasswordError: onForgotPasswordError
|
|
3261
3582
|
}));
|
|
3262
3583
|
};
|
|
3263
3584
|
|
|
@@ -3476,7 +3797,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3476
3797
|
onSubmit: handleSubmit
|
|
3477
3798
|
}, React.createElement("div", {
|
|
3478
3799
|
className: "card_form_inner"
|
|
3479
|
-
}, React.createElement("
|
|
3800
|
+
}, React.createElement("div", {
|
|
3480
3801
|
className: "card_number_element"
|
|
3481
3802
|
}, React.createElement("span", {
|
|
3482
3803
|
className: "card_label_text"
|
|
@@ -3486,19 +3807,21 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3486
3807
|
onChange: _identity,
|
|
3487
3808
|
onBlur: _identity,
|
|
3488
3809
|
onFocus: _identity
|
|
3489
|
-
})), React.createElement("
|
|
3810
|
+
})), React.createElement("div", {
|
|
3811
|
+
className: "elements"
|
|
3812
|
+
}, React.createElement("div", {
|
|
3490
3813
|
className: "expiration_element"
|
|
3491
3814
|
}, React.createElement("span", {
|
|
3492
3815
|
className: "card_label_text"
|
|
3493
3816
|
}, "Expiration date"), React.createElement(CardExpiryElement, {
|
|
3494
3817
|
options: _extends({}, options, stripeCardOptions)
|
|
3495
|
-
})), React.createElement("
|
|
3818
|
+
})), React.createElement("div", {
|
|
3496
3819
|
className: "cvc_element"
|
|
3497
3820
|
}, React.createElement("span", {
|
|
3498
3821
|
className: "card_label_text"
|
|
3499
3822
|
}, "CVC"), React.createElement(CardCvcElement, {
|
|
3500
3823
|
options: _extends({}, options, stripeCardOptions)
|
|
3501
|
-
})), !disableZipSection && React.createElement("
|
|
3824
|
+
}))), !disableZipSection && React.createElement("div", {
|
|
3502
3825
|
className: "zip_element"
|
|
3503
3826
|
}, React.createElement("p", {
|
|
3504
3827
|
className: "card_label_text"
|
|
@@ -3525,7 +3848,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3525
3848
|
}, React.createElement("button", {
|
|
3526
3849
|
disabled: buttonIsDiabled,
|
|
3527
3850
|
type: "submit"
|
|
3528
|
-
}, isLoading ? React.createElement(CircularProgress, {
|
|
3851
|
+
}, isLoading ? React.createElement(CircularProgress$1, {
|
|
3529
3852
|
size: 26
|
|
3530
3853
|
}) : "Pay " + getCurrencySymbolByCurrency(currency) + total))));
|
|
3531
3854
|
};
|
|
@@ -3588,7 +3911,9 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3588
3911
|
_ref$onCountdownFinis = _ref.onCountdownFinish,
|
|
3589
3912
|
onCountdownFinish = _ref$onCountdownFinis === void 0 ? function () {} : _ref$onCountdownFinis,
|
|
3590
3913
|
_ref$enableTimer = _ref.enableTimer,
|
|
3591
|
-
enableTimer = _ref$enableTimer === void 0 ? false : _ref$enableTimer
|
|
3914
|
+
enableTimer = _ref$enableTimer === void 0 ? false : _ref$enableTimer,
|
|
3915
|
+
_ref$enablePaymentPla = _ref.enablePaymentPlan,
|
|
3916
|
+
enablePaymentPlan = _ref$enablePaymentPla === void 0 ? false : _ref$enablePaymentPla;
|
|
3592
3917
|
|
|
3593
3918
|
var _useState = useState(initialReviewValues),
|
|
3594
3919
|
reviewData = _useState[0],
|
|
@@ -3603,16 +3928,20 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3603
3928
|
setError = _useState3[1];
|
|
3604
3929
|
|
|
3605
3930
|
var _useState4 = useState(false),
|
|
3606
|
-
|
|
3607
|
-
|
|
3931
|
+
showPaymentPlanSection = _useState4[0],
|
|
3932
|
+
setShowPaymentPlanSection = _useState4[1];
|
|
3933
|
+
|
|
3934
|
+
var _useState5 = useState(false),
|
|
3935
|
+
paymentIsLoading = _useState5[0],
|
|
3936
|
+
setPaymentIsLoading = _useState5[1];
|
|
3608
3937
|
|
|
3609
|
-
var
|
|
3610
|
-
paymentDataIsLoading =
|
|
3611
|
-
setPaymentDataIsLoading =
|
|
3938
|
+
var _useState6 = useState(true),
|
|
3939
|
+
paymentDataIsLoading = _useState6[0],
|
|
3940
|
+
setPaymentDataIsLoading = _useState6[1];
|
|
3612
3941
|
|
|
3613
|
-
var
|
|
3614
|
-
conditions =
|
|
3615
|
-
setConditions =
|
|
3942
|
+
var _useState7 = useState([]),
|
|
3943
|
+
conditions = _useState7[0],
|
|
3944
|
+
setConditions = _useState7[1];
|
|
3616
3945
|
|
|
3617
3946
|
var showFormTitle = Boolean(formTitle);
|
|
3618
3947
|
var showErrorText = Boolean(errorText);
|
|
@@ -3739,7 +4068,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3739
4068
|
case 3:
|
|
3740
4069
|
order_hash = reviewData.order_details.order_hash;
|
|
3741
4070
|
|
|
3742
|
-
if (!(total ===
|
|
4071
|
+
if (!(total === '0.00')) {
|
|
3743
4072
|
_context3.next = 10;
|
|
3744
4073
|
break;
|
|
3745
4074
|
}
|
|
@@ -3824,11 +4153,33 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3824
4153
|
}, label), React.createElement("div", {
|
|
3825
4154
|
className: className + " order_info_text"
|
|
3826
4155
|
}, normalizer(orderData[id], orderData.currency)));
|
|
3827
|
-
})),
|
|
4156
|
+
})), enablePaymentPlan && React.createElement("div", {
|
|
4157
|
+
className: "payment_toggle"
|
|
4158
|
+
}, React.createElement("label", {
|
|
4159
|
+
htmlFor: "togBtn",
|
|
4160
|
+
className: "switch"
|
|
4161
|
+
}, React.createElement("input", {
|
|
4162
|
+
type: "checkbox",
|
|
4163
|
+
id: "togBtn",
|
|
4164
|
+
disabled: true,
|
|
4165
|
+
onChange: function onChange() {
|
|
4166
|
+
return setShowPaymentPlanSection(!showPaymentPlanSection);
|
|
4167
|
+
}
|
|
4168
|
+
}), React.createElement("div", {
|
|
4169
|
+
className: "slider round"
|
|
4170
|
+
}), React.createElement("span", {
|
|
4171
|
+
className: "tog_text"
|
|
4172
|
+
}, "Click to checkout using Payment Plan"))), showPaymentPlanSection && React.createElement("div", {
|
|
4173
|
+
className: "payment_plan"
|
|
4174
|
+
}, React.createElement("h2", null, "PAYMENT PLAN"), React.createElement("div", {
|
|
4175
|
+
className: "plan_block"
|
|
4176
|
+
}, 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", {
|
|
4177
|
+
className: "payment_note"
|
|
4178
|
+
}, "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", {
|
|
3828
4179
|
className: "payment_info"
|
|
3829
4180
|
}, React.createElement("div", {
|
|
3830
4181
|
className: "payment_info_label"
|
|
3831
|
-
}, "
|
|
4182
|
+
}, "ORDER CONFIRMATION"), showErrorText && React.createElement("p", {
|
|
3832
4183
|
className: "payment_info__error"
|
|
3833
4184
|
}, errorText), React.createElement("div", null, React.createElement(Elements, {
|
|
3834
4185
|
stripe: getStripePromise(reviewData),
|
|
@@ -3856,9 +4207,9 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3856
4207
|
setPaymentIsLoading(true);
|
|
3857
4208
|
handlePaymentMiddleWare(null);
|
|
3858
4209
|
}
|
|
3859
|
-
}, paymentIsLoading ? React.createElement(CircularProgress, {
|
|
4210
|
+
}, paymentIsLoading ? React.createElement(CircularProgress$1, {
|
|
3860
4211
|
size: 26
|
|
3861
|
-
}) :
|
|
4212
|
+
}) : 'Complete Registration')))));
|
|
3862
4213
|
};
|
|
3863
4214
|
|
|
3864
4215
|
var config = {
|
|
@@ -4022,7 +4373,9 @@ var SocialButtons = function SocialButtons(_ref2) {
|
|
|
4022
4373
|
};
|
|
4023
4374
|
|
|
4024
4375
|
var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
4025
|
-
var
|
|
4376
|
+
var _ref$hasCopyIcon = _ref.hasCopyIcon,
|
|
4377
|
+
hasCopyIcon = _ref$hasCopyIcon === void 0 ? true : _ref$hasCopyIcon,
|
|
4378
|
+
isReferralEnabled = _ref.isReferralEnabled,
|
|
4026
4379
|
showDefaultShareButtons = _ref.showDefaultShareButtons,
|
|
4027
4380
|
_ref$messengerAppId = _ref.messengerAppId,
|
|
4028
4381
|
messengerAppId = _ref$messengerAppId === void 0 ? '' : _ref$messengerAppId,
|
|
@@ -4121,7 +4474,16 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4121
4474
|
|
|
4122
4475
|
return React.createElement("div", {
|
|
4123
4476
|
className: "confirmation-page"
|
|
4124
|
-
}, data && React.createElement(React.Fragment, null, React.createElement("
|
|
4477
|
+
}, data && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
4478
|
+
className: 'header-container'
|
|
4479
|
+
}, React.createElement("div", {
|
|
4480
|
+
className: 'header-product-image'
|
|
4481
|
+
}, React.createElement("img", {
|
|
4482
|
+
className: 'product-image',
|
|
4483
|
+
src: data.product_image
|
|
4484
|
+
})), React.createElement("div", {
|
|
4485
|
+
className: "header-product-text"
|
|
4486
|
+
}, React.createElement("p", {
|
|
4125
4487
|
className: "title"
|
|
4126
4488
|
}, "Your Tickets are Confirmed!"), React.createElement("div", {
|
|
4127
4489
|
className: "share-message-section"
|
|
@@ -4129,7 +4491,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4129
4491
|
className: "main"
|
|
4130
4492
|
}, "Your tickets have been emailed to you"), React.createElement("span", {
|
|
4131
4493
|
className: "helper"
|
|
4132
|
-
}, "Please bring them with you to the event")), data.disable_referral === false && isReferralEnabled && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
4494
|
+
}, "Please bring them with you to the event")))), data.disable_referral === false && isReferralEnabled && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
4133
4495
|
className: "referral_text_image_section"
|
|
4134
4496
|
}, React.createElement("div", {
|
|
4135
4497
|
className: "referral_text_section"
|
|
@@ -4146,6 +4508,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4146
4508
|
}, " Invite friends "), "and we'll refund up to", React.createElement("span", {
|
|
4147
4509
|
className: "strong-text"
|
|
4148
4510
|
}, " 100% "), "of your ticket money, if they buy tickets as well!")), React.createElement("img", {
|
|
4511
|
+
className: 'body-product-image',
|
|
4149
4512
|
src: data.product_image,
|
|
4150
4513
|
alt: "No Data"
|
|
4151
4514
|
})), React.createElement("div", {
|
|
@@ -4175,10 +4538,12 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4175
4538
|
navigator.clipboard.writeText(_get(inputRef, 'current.value'));
|
|
4176
4539
|
onLinkCopied();
|
|
4177
4540
|
}
|
|
4178
|
-
}, React.createElement("img", {
|
|
4541
|
+
}, hasCopyIcon ? React.createElement("img", {
|
|
4179
4542
|
src: "https://img.icons8.com/office/50/000000/copy.png",
|
|
4180
4543
|
alt: "copy"
|
|
4181
|
-
})
|
|
4544
|
+
}) : React.createElement("span", {
|
|
4545
|
+
className: 'copy-icon'
|
|
4546
|
+
}, "Copy")))), (showDefaultShareButtons || !!shareButtons.length) && React.createElement(SocialButtons, {
|
|
4182
4547
|
showDefaultShareButtons: showDefaultShareButtons,
|
|
4183
4548
|
name: data.product_name,
|
|
4184
4549
|
appId: messengerAppId,
|
|
@@ -4239,7 +4604,7 @@ var TicketRow = function TicketRow(_ref) {
|
|
|
4239
4604
|
var isSalesClosed = !ticketTier.salesStarted || ticketTier.salesEnded;
|
|
4240
4605
|
var options = getTicketSelectOptions(ticketTier.maxQuantity, ticketTier.minQuantity, ticketTier.multiplier);
|
|
4241
4606
|
var ticketsClosedMessage = !ticketTier.salesStarted ? 'Sales not started' : 'Sales Ended';
|
|
4242
|
-
var onSaleContent =
|
|
4607
|
+
var onSaleContent = React.createElement("div", {
|
|
4243
4608
|
className: "get-tickets"
|
|
4244
4609
|
}, React.createElement(Box, {
|
|
4245
4610
|
className: "get-tickets__selectbox"
|
|
@@ -4269,17 +4634,17 @@ var TicketRow = function TicketRow(_ref) {
|
|
|
4269
4634
|
value: option.value
|
|
4270
4635
|
}, option.value);
|
|
4271
4636
|
})))));
|
|
4272
|
-
var returnValue = '';
|
|
4637
|
+
var returnValue = ''; // ticketTier.soldOut === false --> means that ticket is in the stock
|
|
4273
4638
|
|
|
4274
|
-
|
|
4275
|
-
returnValue = soldOutMessage;
|
|
4276
|
-
}
|
|
4639
|
+
var isSoldOut = ticketTier.sold_out || !ticketTier.displayTicket || ticketTier.soldOut || ticketTier.soldOut === false;
|
|
4277
4640
|
|
|
4278
|
-
if (
|
|
4641
|
+
if (isSoldOut) {
|
|
4642
|
+
returnValue = soldOutMessage;
|
|
4643
|
+
} else if (isSalesClosed) {
|
|
4644
|
+
returnValue = ticketsClosedMessage;
|
|
4645
|
+
} else if (ticketTier.displayTicket && ticketTier.maxQuantity) {
|
|
4279
4646
|
returnValue = onSaleContent;
|
|
4280
|
-
}
|
|
4281
|
-
|
|
4282
|
-
if (_get(prevTicketTier, 'in_stock')) {
|
|
4647
|
+
} else if (_get(prevTicketTier, 'in_stock')) {
|
|
4283
4648
|
returnValue = 'SOON';
|
|
4284
4649
|
}
|
|
4285
4650
|
|
|
@@ -4290,7 +4655,6 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
4290
4655
|
var ticketsList = _ref.ticketsList,
|
|
4291
4656
|
selectedTickets = _ref.selectedTickets,
|
|
4292
4657
|
handleTicketSelect = _ref.handleTicketSelect,
|
|
4293
|
-
codeIsApplied = _ref.codeIsApplied,
|
|
4294
4658
|
sortBySoldOut = _ref.sortBySoldOut,
|
|
4295
4659
|
ticketsHeaderComponent = _ref.ticketsHeaderComponent,
|
|
4296
4660
|
hideTicketsHeader = _ref.hideTicketsHeader;
|
|
@@ -4305,7 +4669,7 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
4305
4669
|
|
|
4306
4670
|
var ticketIsDiscounted = false;
|
|
4307
4671
|
|
|
4308
|
-
if (ticket.oldPrice &&
|
|
4672
|
+
if (ticket.oldPrice && !isSoldOut && ticket.oldPrice !== ticket.price) {
|
|
4309
4673
|
ticketIsDiscounted = true;
|
|
4310
4674
|
}
|
|
4311
4675
|
|
|
@@ -4497,7 +4861,7 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
4497
4861
|
type: "submit",
|
|
4498
4862
|
variant: "contained",
|
|
4499
4863
|
className: "waiting-list-button"
|
|
4500
|
-
}, loading ? React.createElement(CircularProgress, {
|
|
4864
|
+
}, loading ? React.createElement(CircularProgress$1, {
|
|
4501
4865
|
size: "22px"
|
|
4502
4866
|
}) : 'ADD TO WAITING LIST')))));
|
|
4503
4867
|
};
|
|
@@ -4508,7 +4872,8 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4508
4872
|
showPromoInput = _ref.showPromoInput,
|
|
4509
4873
|
setCode = _ref.setCode,
|
|
4510
4874
|
setShowPromoInput = _ref.setShowPromoInput,
|
|
4511
|
-
updateTickets = _ref.updateTickets
|
|
4875
|
+
updateTickets = _ref.updateTickets,
|
|
4876
|
+
setCodeIsApplied = _ref.setCodeIsApplied;
|
|
4512
4877
|
var isPromoCodeHasValue = !!code.trim();
|
|
4513
4878
|
|
|
4514
4879
|
var renderInputField = function renderInputField() {
|
|
@@ -4527,7 +4892,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4527
4892
|
onKeyPress: function onKeyPress(event) {
|
|
4528
4893
|
if (event.key === 'Enter' && isPromoCodeHasValue) {
|
|
4529
4894
|
setShowPromoInput(false);
|
|
4530
|
-
updateTickets(true);
|
|
4895
|
+
updateTickets(true, 'promo');
|
|
4531
4896
|
}
|
|
4532
4897
|
}
|
|
4533
4898
|
}), React.createElement(Button$1, {
|
|
@@ -4535,7 +4900,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4535
4900
|
onClick: function onClick() {
|
|
4536
4901
|
if (isPromoCodeHasValue) {
|
|
4537
4902
|
setShowPromoInput(false);
|
|
4538
|
-
updateTickets(true);
|
|
4903
|
+
updateTickets(true, 'promo');
|
|
4539
4904
|
}
|
|
4540
4905
|
}
|
|
4541
4906
|
}, "APPLY"));
|
|
@@ -4554,6 +4919,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4554
4919
|
className: "promo-code-button",
|
|
4555
4920
|
placeholder: "Promo Codes",
|
|
4556
4921
|
onClick: function onClick() {
|
|
4922
|
+
setCodeIsApplied(false);
|
|
4557
4923
|
setShowPromoInput(true);
|
|
4558
4924
|
}
|
|
4559
4925
|
}, "Got a promo code? Click here"), showPromoInput && renderInputField());
|
|
@@ -4603,6 +4969,8 @@ function Countdown(_ref) {
|
|
|
4603
4969
|
title = _ref$title === void 0 ? '' : _ref$title,
|
|
4604
4970
|
_ref$message = _ref.message,
|
|
4605
4971
|
message = _ref$message === void 0 ? '' : _ref$message,
|
|
4972
|
+
_ref$showMessage = _ref.showMessage,
|
|
4973
|
+
showMessage = _ref$showMessage === void 0 ? false : _ref$showMessage,
|
|
4606
4974
|
_ref$disableLeadingZe = _ref.disableLeadingZero,
|
|
4607
4975
|
disableLeadingZero = _ref$disableLeadingZe === void 0 ? false : _ref$disableLeadingZe,
|
|
4608
4976
|
_ref$callback = _ref.callback,
|
|
@@ -4672,7 +5040,7 @@ function Countdown(_ref) {
|
|
|
4672
5040
|
className: "countdown " + (!isLoggedIn ? 'countdown-on-bottom' : '')
|
|
4673
5041
|
}, React.createElement("div", null, React.createElement("p", {
|
|
4674
5042
|
className: 'title'
|
|
4675
|
-
}, title), React.createElement("p", null, duration)), React.createElement("p", {
|
|
5043
|
+
}, title), React.createElement("p", null, duration)), showMessage && React.createElement("p", {
|
|
4676
5044
|
className: 'message'
|
|
4677
5045
|
}, message)));
|
|
4678
5046
|
}
|
|
@@ -4732,6 +5100,10 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4732
5100
|
onGetTicketsSuccess = _ref$onGetTicketsSucc === void 0 ? function () {} : _ref$onGetTicketsSucc,
|
|
4733
5101
|
_ref$onGetTicketsErro = _ref.onGetTicketsError,
|
|
4734
5102
|
onGetTicketsError = _ref$onGetTicketsErro === void 0 ? function () {} : _ref$onGetTicketsErro,
|
|
5103
|
+
_ref$onLogoutSuccess = _ref.onLogoutSuccess,
|
|
5104
|
+
onLogoutSuccess = _ref$onLogoutSuccess === void 0 ? function () {} : _ref$onLogoutSuccess,
|
|
5105
|
+
_ref$onLogoutError = _ref.onLogoutError,
|
|
5106
|
+
onLogoutError = _ref$onLogoutError === void 0 ? function () {} : _ref$onLogoutError,
|
|
4735
5107
|
_ref$theme = _ref.theme,
|
|
4736
5108
|
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
4737
5109
|
_ref$queryPromoCode = _ref.queryPromoCode,
|
|
@@ -4745,6 +5117,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4745
5117
|
hideSessionButtons = _ref$hideSessionButto === void 0 ? false : _ref$hideSessionButto,
|
|
4746
5118
|
_ref$hideWaitingList = _ref.hideWaitingList,
|
|
4747
5119
|
hideWaitingList = _ref$hideWaitingList === void 0 ? false : _ref$hideWaitingList,
|
|
5120
|
+
_ref$enableBillingInf = _ref.enableBillingInfoAutoCreate,
|
|
5121
|
+
enableBillingInfoAutoCreate = _ref$enableBillingInf === void 0 ? true : _ref$enableBillingInf,
|
|
4748
5122
|
_ref$isButtonScrollab = _ref.isButtonScrollable,
|
|
4749
5123
|
isButtonScrollable = _ref$isButtonScrollab === void 0 ? false : _ref$isButtonScrollab,
|
|
4750
5124
|
_ref$sortBySoldOut = _ref.sortBySoldOut,
|
|
@@ -4763,8 +5137,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4763
5137
|
setSelectedTickets = _useState[1];
|
|
4764
5138
|
|
|
4765
5139
|
var isWindowDefined = typeof window !== 'undefined';
|
|
5140
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
4766
5141
|
|
|
4767
|
-
var _useState2 = useState(isWindowDefined ? !!window.localStorage.getItem('access_token') : false),
|
|
5142
|
+
var _useState2 = useState((isWindowDefined ? !!window.localStorage.getItem('access_token') : false) || !!xtfCookie),
|
|
4768
5143
|
isLogged = _useState2[0],
|
|
4769
5144
|
setIsLogged = _useState2[1];
|
|
4770
5145
|
|
|
@@ -4835,17 +5210,50 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4835
5210
|
!!eventId && getTicketsApi();
|
|
4836
5211
|
}, [eventId]);
|
|
4837
5212
|
|
|
4838
|
-
var handleLogout = function
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
5213
|
+
var handleLogout = /*#__PURE__*/function () {
|
|
5214
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
5215
|
+
var _event;
|
|
5216
|
+
|
|
5217
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
5218
|
+
while (1) {
|
|
5219
|
+
switch (_context.prev = _context.next) {
|
|
5220
|
+
case 0:
|
|
5221
|
+
_context.prev = 0;
|
|
5222
|
+
_context.next = 3;
|
|
5223
|
+
return logout();
|
|
4843
5224
|
|
|
4844
|
-
|
|
5225
|
+
case 3:
|
|
5226
|
+
onLogoutSuccess();
|
|
5227
|
+
|
|
5228
|
+
if (isWindowDefined) {
|
|
5229
|
+
window.localStorage.removeItem('access_token');
|
|
5230
|
+
window.localStorage.removeItem('user_data');
|
|
5231
|
+
setIsLogged(false);
|
|
5232
|
+
_event = new window.CustomEvent('tf-logout');
|
|
5233
|
+
deleteCookieByName('X-TF-ECOMMERCE');
|
|
5234
|
+
window.document.dispatchEvent(_event);
|
|
5235
|
+
}
|
|
4845
5236
|
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
5237
|
+
_context.next = 10;
|
|
5238
|
+
break;
|
|
5239
|
+
|
|
5240
|
+
case 7:
|
|
5241
|
+
_context.prev = 7;
|
|
5242
|
+
_context.t0 = _context["catch"](0);
|
|
5243
|
+
onLogoutError(_context.t0);
|
|
5244
|
+
|
|
5245
|
+
case 10:
|
|
5246
|
+
case "end":
|
|
5247
|
+
return _context.stop();
|
|
5248
|
+
}
|
|
5249
|
+
}
|
|
5250
|
+
}, _callee, null, [[0, 7]]);
|
|
5251
|
+
}));
|
|
5252
|
+
|
|
5253
|
+
return function handleLogout() {
|
|
5254
|
+
return _ref2.apply(this, arguments);
|
|
5255
|
+
};
|
|
5256
|
+
}();
|
|
4849
5257
|
|
|
4850
5258
|
useEffect(function () {
|
|
4851
5259
|
try {
|
|
@@ -4854,7 +5262,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4854
5262
|
|
|
4855
5263
|
if (userData.country === '') {
|
|
4856
5264
|
handleLogout();
|
|
4857
|
-
window.open(
|
|
5265
|
+
window.open('https://www.ticketfairy.com/account/change_information?need_country=true');
|
|
4858
5266
|
}
|
|
4859
5267
|
}
|
|
4860
5268
|
} catch (e) {}
|
|
@@ -4877,34 +5285,34 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4877
5285
|
}
|
|
4878
5286
|
};
|
|
4879
5287
|
|
|
4880
|
-
function getTicketsApi(_x) {
|
|
5288
|
+
function getTicketsApi(_x, _x2) {
|
|
4881
5289
|
return _getTicketsApi.apply(this, arguments);
|
|
4882
5290
|
}
|
|
4883
5291
|
|
|
4884
5292
|
function _getTicketsApi() {
|
|
4885
|
-
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5293
|
+
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(isUpdateingCode, type) {
|
|
4886
5294
|
var response, eventResponse, attributes, _event2;
|
|
4887
5295
|
|
|
4888
|
-
return runtime_1.wrap(function
|
|
5296
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
4889
5297
|
while (1) {
|
|
4890
|
-
switch (
|
|
5298
|
+
switch (_context3.prev = _context3.next) {
|
|
4891
5299
|
case 0:
|
|
4892
|
-
|
|
5300
|
+
_context3.prev = 0;
|
|
4893
5301
|
isUpdateingCode ? setCodeIsLoading(true) : setIsLoading(true);
|
|
4894
|
-
|
|
5302
|
+
_context3.next = 4;
|
|
4895
5303
|
return getTickets(eventId, code);
|
|
4896
5304
|
|
|
4897
5305
|
case 4:
|
|
4898
|
-
response =
|
|
4899
|
-
|
|
5306
|
+
response = _context3.sent;
|
|
5307
|
+
_context3.next = 7;
|
|
4900
5308
|
return getEvent(eventId);
|
|
4901
5309
|
|
|
4902
5310
|
case 7:
|
|
4903
|
-
eventResponse =
|
|
5311
|
+
eventResponse = _context3.sent;
|
|
4904
5312
|
|
|
4905
5313
|
if (response.data.success) {
|
|
4906
5314
|
attributes = _get(response, 'data.data.attributes');
|
|
4907
|
-
setCodeIsApplied(attributes.ValidPromoCode);
|
|
5315
|
+
type === 'promo' && setCodeIsApplied(attributes.ValidPromoCode);
|
|
4908
5316
|
setTickets(_get(attributes, 'tickets'));
|
|
4909
5317
|
setShowWaitingList(attributes.showWaitingList);
|
|
4910
5318
|
onGetTicketsSuccess(response.data);
|
|
@@ -4918,42 +5326,42 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4918
5326
|
setEvent(_event2);
|
|
4919
5327
|
}
|
|
4920
5328
|
|
|
4921
|
-
|
|
5329
|
+
_context3.next = 15;
|
|
4922
5330
|
break;
|
|
4923
5331
|
|
|
4924
5332
|
case 12:
|
|
4925
|
-
|
|
4926
|
-
|
|
5333
|
+
_context3.prev = 12;
|
|
5334
|
+
_context3.t0 = _context3["catch"](0);
|
|
4927
5335
|
|
|
4928
|
-
if (axios.isAxiosError(
|
|
4929
|
-
onGetTicketsError(
|
|
5336
|
+
if (axios.isAxiosError(_context3.t0)) {
|
|
5337
|
+
onGetTicketsError(_context3.t0);
|
|
4930
5338
|
}
|
|
4931
5339
|
|
|
4932
5340
|
case 15:
|
|
4933
|
-
|
|
5341
|
+
_context3.prev = 15;
|
|
4934
5342
|
setIsLoading(false);
|
|
4935
5343
|
setCodeIsLoading(false);
|
|
4936
|
-
return
|
|
5344
|
+
return _context3.finish(15);
|
|
4937
5345
|
|
|
4938
5346
|
case 19:
|
|
4939
5347
|
case "end":
|
|
4940
|
-
return
|
|
5348
|
+
return _context3.stop();
|
|
4941
5349
|
}
|
|
4942
5350
|
}
|
|
4943
|
-
},
|
|
5351
|
+
}, _callee3, null, [[0, 12, 15, 19]]);
|
|
4944
5352
|
}));
|
|
4945
5353
|
return _getTicketsApi.apply(this, arguments);
|
|
4946
5354
|
}
|
|
4947
5355
|
|
|
4948
5356
|
var handleTicketSelect = function handleTicketSelect(key, value) {
|
|
4949
5357
|
setSelectedTickets(function (prevState) {
|
|
4950
|
-
var
|
|
5358
|
+
var _ref3;
|
|
4951
5359
|
|
|
4952
5360
|
if (Object.keys(prevState)[0] !== key && !value) {
|
|
4953
5361
|
return prevState;
|
|
4954
5362
|
}
|
|
4955
5363
|
|
|
4956
|
-
return
|
|
5364
|
+
return _ref3 = {}, _ref3[key] = value, _ref3;
|
|
4957
5365
|
});
|
|
4958
5366
|
};
|
|
4959
5367
|
|
|
@@ -4964,14 +5372,14 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4964
5372
|
};
|
|
4965
5373
|
|
|
4966
5374
|
var handleBook = /*#__PURE__*/function () {
|
|
4967
|
-
var
|
|
5375
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
4968
5376
|
var _product_options, _product_options2, _ticket_types;
|
|
4969
5377
|
|
|
4970
5378
|
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;
|
|
4971
5379
|
|
|
4972
|
-
return runtime_1.wrap(function
|
|
5380
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
4973
5381
|
while (1) {
|
|
4974
|
-
switch (
|
|
5382
|
+
switch (_context2.prev = _context2.next) {
|
|
4975
5383
|
case 0:
|
|
4976
5384
|
setHandleBookIsLoading(true);
|
|
4977
5385
|
ticket = _find(tickets, function (item) {
|
|
@@ -4992,15 +5400,15 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4992
5400
|
}, _ticket_types)
|
|
4993
5401
|
}
|
|
4994
5402
|
};
|
|
4995
|
-
|
|
4996
|
-
|
|
5403
|
+
_context2.prev = 6;
|
|
5404
|
+
_context2.next = 9;
|
|
4997
5405
|
return addToCart(eventId, data);
|
|
4998
5406
|
|
|
4999
5407
|
case 9:
|
|
5000
|
-
result =
|
|
5408
|
+
result = _context2.sent;
|
|
5001
5409
|
|
|
5002
5410
|
if (!(result.status === 200)) {
|
|
5003
|
-
|
|
5411
|
+
_context2.next = 33;
|
|
5004
5412
|
break;
|
|
5005
5413
|
}
|
|
5006
5414
|
|
|
@@ -5012,7 +5420,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5012
5420
|
total = '';
|
|
5013
5421
|
|
|
5014
5422
|
if (!skipBillingPage) {
|
|
5015
|
-
|
|
5423
|
+
_context2.next = 32;
|
|
5016
5424
|
break;
|
|
5017
5425
|
}
|
|
5018
5426
|
|
|
@@ -5021,15 +5429,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5021
5429
|
userData = _isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
5022
5430
|
access_token = _isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
5023
5431
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
5024
|
-
|
|
5432
|
+
|
|
5433
|
+
if (!enableBillingInfoAutoCreate) {
|
|
5434
|
+
_context2.next = 28;
|
|
5435
|
+
break;
|
|
5436
|
+
}
|
|
5437
|
+
|
|
5438
|
+
_context2.next = 25;
|
|
5025
5439
|
return postOnCheckout(checkoutBody, access_token);
|
|
5026
5440
|
|
|
5027
|
-
case
|
|
5028
|
-
|
|
5441
|
+
case 25:
|
|
5442
|
+
_context2.t0 = _context2.sent;
|
|
5443
|
+
_context2.next = 29;
|
|
5444
|
+
break;
|
|
5445
|
+
|
|
5446
|
+
case 28:
|
|
5447
|
+
_context2.t0 = null;
|
|
5448
|
+
|
|
5449
|
+
case 29:
|
|
5450
|
+
checkoutResult = _context2.t0;
|
|
5029
5451
|
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
5030
5452
|
total = _get(checkoutResult, 'data.data.attributes.total');
|
|
5031
5453
|
|
|
5032
|
-
case
|
|
5454
|
+
case 32:
|
|
5033
5455
|
onAddToCartSuccess({
|
|
5034
5456
|
skip_billing_page: skipBillingPage,
|
|
5035
5457
|
names_required: nameIsRequired,
|
|
@@ -5040,44 +5462,46 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5040
5462
|
total: total
|
|
5041
5463
|
});
|
|
5042
5464
|
|
|
5043
|
-
case
|
|
5044
|
-
|
|
5465
|
+
case 33:
|
|
5466
|
+
_context2.next = 38;
|
|
5045
5467
|
break;
|
|
5046
5468
|
|
|
5047
|
-
case
|
|
5048
|
-
|
|
5049
|
-
|
|
5469
|
+
case 35:
|
|
5470
|
+
_context2.prev = 35;
|
|
5471
|
+
_context2.t1 = _context2["catch"](6);
|
|
5050
5472
|
|
|
5051
|
-
if (axios.isAxiosError(
|
|
5052
|
-
onAddToCartError(
|
|
5473
|
+
if (axios.isAxiosError(_context2.t1)) {
|
|
5474
|
+
onAddToCartError(_context2.t1);
|
|
5053
5475
|
}
|
|
5054
5476
|
|
|
5055
|
-
case
|
|
5056
|
-
|
|
5477
|
+
case 38:
|
|
5478
|
+
_context2.prev = 38;
|
|
5057
5479
|
setHandleBookIsLoading(false);
|
|
5058
|
-
return
|
|
5480
|
+
return _context2.finish(38);
|
|
5059
5481
|
|
|
5060
|
-
case
|
|
5482
|
+
case 41:
|
|
5061
5483
|
case "end":
|
|
5062
|
-
return
|
|
5484
|
+
return _context2.stop();
|
|
5063
5485
|
}
|
|
5064
5486
|
}
|
|
5065
|
-
},
|
|
5487
|
+
}, _callee2, null, [[6, 35, 38, 41]]);
|
|
5066
5488
|
}));
|
|
5067
5489
|
|
|
5068
5490
|
return function handleBook() {
|
|
5069
|
-
return
|
|
5491
|
+
return _ref4.apply(this, arguments);
|
|
5070
5492
|
};
|
|
5071
5493
|
}();
|
|
5072
5494
|
|
|
5073
|
-
var updateTickets = function updateTickets(isUpdateingCode) {
|
|
5074
|
-
getTicketsApi(isUpdateingCode);
|
|
5495
|
+
var updateTickets = function updateTickets(isUpdateingCode, type) {
|
|
5496
|
+
getTicketsApi(isUpdateingCode, type);
|
|
5075
5497
|
};
|
|
5076
5498
|
|
|
5077
5499
|
var isTicketOnSale = _some(tickets, function (item) {
|
|
5078
5500
|
return item.salesStarted && !item.salesEnded && !item.soldOut;
|
|
5079
5501
|
});
|
|
5080
5502
|
|
|
5503
|
+
var eventHasTickets = !_isEmpty(tickets);
|
|
5504
|
+
var isSalesClosed = event == null ? void 0 : event.salesEnded;
|
|
5081
5505
|
var themeMui = createTheme$1(themeOptions);
|
|
5082
5506
|
useEffect(function () {
|
|
5083
5507
|
isWindowDefined && window.document.addEventListener('custom-logout', handleLogout);
|
|
@@ -5122,34 +5546,35 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5122
5546
|
style: contentStyle
|
|
5123
5547
|
}, isLoading ? React.createElement(Loader, null) : React.createElement("div", {
|
|
5124
5548
|
ref: ticketsContainerRef
|
|
5125
|
-
}, React.createElement(TicketsSection, {
|
|
5549
|
+
}, !isSalesClosed && React.createElement(TicketsSection, {
|
|
5126
5550
|
ticketsList: tickets,
|
|
5127
5551
|
selectedTickets: selectedTickets,
|
|
5128
5552
|
handleTicketSelect: handleTicketSelect,
|
|
5129
|
-
codeIsApplied: codeIsApplied,
|
|
5130
5553
|
sortBySoldOut: sortBySoldOut,
|
|
5131
5554
|
ticketsHeaderComponent: ticketsHeaderComponent,
|
|
5132
5555
|
hideTicketsHeader: hideTicketsHeader || _isEmpty(tickets)
|
|
5133
|
-
}), externalUrl ? null :
|
|
5556
|
+
}), externalUrl ? null : isSalesClosed ? React.createElement("p", {
|
|
5134
5557
|
className: "event-closed-message " + (!isLoggedIn ? 'event-closed-on-bottom' : '')
|
|
5135
5558
|
}, "Sales for this event are closed.") : eventSaleIsNotStarted ? React.createElement(Countdown, {
|
|
5136
5559
|
startDate: event.salesStart,
|
|
5137
5560
|
timezone: event.timezone,
|
|
5138
5561
|
title: "Sales start in:",
|
|
5139
5562
|
message: "No tickets are currently available for this event.",
|
|
5563
|
+
showMessage: !eventHasTickets,
|
|
5140
5564
|
callback: updateTickets,
|
|
5141
5565
|
disableLeadingZero: disableCountdownLeadingZero,
|
|
5142
5566
|
isLoggedIn: isLoggedIn
|
|
5143
5567
|
}) : null, showWaitingList && event.salesStarted && !hideWaitingList && React.createElement(WaitingList, {
|
|
5144
5568
|
tickets: tickets,
|
|
5145
5569
|
eventId: eventId
|
|
5146
|
-
}), codeIsLoading ? React.createElement(Loader, null) : showAccessCodeSection ? React.createElement(AccessCodeSection, {
|
|
5570
|
+
}), codeIsLoading ? React.createElement(Loader, null) : isSalesClosed ? null : showAccessCodeSection ? React.createElement(AccessCodeSection, {
|
|
5147
5571
|
code: code,
|
|
5148
5572
|
setCode: setCode,
|
|
5149
5573
|
updateTickets: updateTickets
|
|
5150
5574
|
}) : showPromoCodeSection ? React.createElement(PromoCodeSection, {
|
|
5151
5575
|
code: code,
|
|
5152
5576
|
codeIsApplied: codeIsApplied,
|
|
5577
|
+
setCodeIsApplied: setCodeIsApplied,
|
|
5153
5578
|
showPromoInput: showPromoInput,
|
|
5154
5579
|
setShowPromoInput: setShowPromoInput,
|
|
5155
5580
|
setCode: setCode,
|
|
@@ -5195,10 +5620,8 @@ var tableConfig = function tableConfig(key) {
|
|
|
5195
5620
|
switch (key) {
|
|
5196
5621
|
default:
|
|
5197
5622
|
config = {
|
|
5198
|
-
header: [
|
|
5623
|
+
header: [],
|
|
5199
5624
|
body: [function (row) {
|
|
5200
|
-
return row.id;
|
|
5201
|
-
}, function (row) {
|
|
5202
5625
|
return row.date;
|
|
5203
5626
|
}, function (row) {
|
|
5204
5627
|
return React.createElement(EventInfoItem, {
|
|
@@ -5245,13 +5668,14 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5245
5668
|
var _data$orders;
|
|
5246
5669
|
|
|
5247
5670
|
var _ref$handleDetailsInf = _ref.handleDetailsInfo,
|
|
5248
|
-
handleDetailsInfo = _ref$handleDetailsInf === void 0 ?
|
|
5671
|
+
handleDetailsInfo = _ref$handleDetailsInf === void 0 ? _identity : _ref$handleDetailsInf,
|
|
5249
5672
|
_ref$onGetOrdersSucce = _ref.onGetOrdersSuccess,
|
|
5250
|
-
onGetOrdersSuccess = _ref$onGetOrdersSucce === void 0 ?
|
|
5673
|
+
onGetOrdersSuccess = _ref$onGetOrdersSucce === void 0 ? _identity : _ref$onGetOrdersSucce,
|
|
5251
5674
|
_ref$onGetOrdersError = _ref.onGetOrdersError,
|
|
5252
|
-
onGetOrdersError = _ref$onGetOrdersError === void 0 ?
|
|
5675
|
+
onGetOrdersError = _ref$onGetOrdersError === void 0 ? _identity : _ref$onGetOrdersError,
|
|
5253
5676
|
_ref$theme = _ref.theme,
|
|
5254
|
-
theme = _ref$theme === void 0 ? 'dark' : _ref$theme
|
|
5677
|
+
theme = _ref$theme === void 0 ? 'dark' : _ref$theme,
|
|
5678
|
+
logo = _ref.logo;
|
|
5255
5679
|
|
|
5256
5680
|
var _useState = useState(null),
|
|
5257
5681
|
data = _useState[0],
|
|
@@ -5361,24 +5785,20 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5361
5785
|
|
|
5362
5786
|
return React.createElement("div", {
|
|
5363
5787
|
className: "my-ticket " + theme
|
|
5364
|
-
},
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
}, React.createElement("img", {
|
|
5379
|
-
src: theme === 'dark' ? 'https://www.ticketfairy.com/resources/images/logo-ttf.svg' : 'https://www.ticketfairy.com/resources/images/logo-ttf-black.svg',
|
|
5380
|
-
alt: "nodata"
|
|
5381
|
-
})))) : null, data && React.createElement(React.Fragment, null, React.createElement(Autocomplete, {
|
|
5788
|
+
}, React.createElement(React.Fragment, null, showModalLogin || !isLogged && React.createElement(LoginModal, {
|
|
5789
|
+
onClose: function onClose() {
|
|
5790
|
+
setShowModalLogin(false);
|
|
5791
|
+
},
|
|
5792
|
+
onLogin: function onLogin() {
|
|
5793
|
+
setShowModalLogin(false);
|
|
5794
|
+
setUserExpired(false);
|
|
5795
|
+
setIsLogged(true);
|
|
5796
|
+
},
|
|
5797
|
+
userExpired: userExpired,
|
|
5798
|
+
logo: logo
|
|
5799
|
+
})), data && React.createElement(React.Fragment, null, React.createElement("h2", null, "My Ticket Orders"), React.createElement("div", {
|
|
5800
|
+
className: "order_event"
|
|
5801
|
+
}, React.createElement(Autocomplete, {
|
|
5382
5802
|
disablePortal: true,
|
|
5383
5803
|
id: "combo-box-demo",
|
|
5384
5804
|
getOptionLabel: function getOptionLabel(option) {
|
|
@@ -5394,7 +5814,12 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5394
5814
|
label: "Events"
|
|
5395
5815
|
}));
|
|
5396
5816
|
}
|
|
5397
|
-
}), React.createElement(
|
|
5817
|
+
}), React.createElement("button", {
|
|
5818
|
+
type: "button",
|
|
5819
|
+
className: "clear"
|
|
5820
|
+
}, "CLEAR")), loading ? React.createElement("div", {
|
|
5821
|
+
className: "loading"
|
|
5822
|
+
}, React.createElement(CircularProgress$1, null)) : React.createElement(React.Fragment, null, React.createElement(TableContainer, {
|
|
5398
5823
|
component: Paper,
|
|
5399
5824
|
className: "my-ticket-table"
|
|
5400
5825
|
}, React.createElement(Table, {
|
|
@@ -5417,7 +5842,7 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5417
5842
|
page: data.page,
|
|
5418
5843
|
onPageChange: handleChangePage,
|
|
5419
5844
|
onRowsPerPageChange: handleChangeRowsPerPage
|
|
5420
|
-
})), React.createElement(React.Fragment, null, showModalLogin && React.createElement(LoginModal, {
|
|
5845
|
+
}))), React.createElement(React.Fragment, null, showModalLogin && React.createElement(LoginModal, {
|
|
5421
5846
|
onClose: function onClose() {
|
|
5422
5847
|
setShowModalLogin(false);
|
|
5423
5848
|
},
|
|
@@ -5434,29 +5859,94 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
5434
5859
|
var _ref$tickets = _ref.tickets,
|
|
5435
5860
|
tickets = _ref$tickets === void 0 ? [] : _ref$tickets,
|
|
5436
5861
|
_ref$handleSellTicket = _ref.handleSellTicket,
|
|
5437
|
-
handleSellTicket = _ref$handleSellTicket === void 0 ?
|
|
5862
|
+
handleSellTicket = _ref$handleSellTicket === void 0 ? _identity : _ref$handleSellTicket,
|
|
5438
5863
|
_ref$handleRemoveFrom = _ref.handleRemoveFromResale,
|
|
5439
|
-
handleRemoveFromResale = _ref$handleRemoveFrom === void 0 ?
|
|
5864
|
+
handleRemoveFromResale = _ref$handleRemoveFrom === void 0 ? _identity : _ref$handleRemoveFrom,
|
|
5865
|
+
_ref$icon = _ref.icon,
|
|
5866
|
+
icon = _ref$icon === void 0 ? '' : _ref$icon;
|
|
5867
|
+
|
|
5868
|
+
var _useState = useState(null),
|
|
5869
|
+
pdfError = _useState[0],
|
|
5870
|
+
setPdfError = _useState[1];
|
|
5871
|
+
|
|
5440
5872
|
return React.createElement("div", {
|
|
5441
5873
|
className: "tickets-box"
|
|
5442
|
-
}, React.createElement(
|
|
5874
|
+
}, React.createElement(SnackbarAlert, {
|
|
5875
|
+
type: "error",
|
|
5876
|
+
isOpen: !!pdfError,
|
|
5877
|
+
message: pdfError || '',
|
|
5878
|
+
onClose: function onClose() {
|
|
5879
|
+
return setPdfError(null);
|
|
5880
|
+
}
|
|
5881
|
+
}), React.createElement("h4", {
|
|
5443
5882
|
className: "sub-title"
|
|
5444
5883
|
}, "Your Tickets"), React.createElement(TableContainer, {
|
|
5445
5884
|
component: Paper
|
|
5446
5885
|
}, React.createElement(Table, {
|
|
5447
5886
|
"aria-label": "collapsible table"
|
|
5448
|
-
}, React.createElement(TableHead, null, React.createElement(TableRow, null, React.createElement(TableCell, null
|
|
5887
|
+
}, 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) {
|
|
5449
5888
|
var _ticket$add_ons;
|
|
5450
5889
|
|
|
5451
5890
|
return React.createElement(Fragment, {
|
|
5452
5891
|
key: index
|
|
5453
|
-
}, React.createElement(TableRow, null, React.createElement(TableCell, null,
|
|
5892
|
+
}, React.createElement(TableRow, null, React.createElement(TableCell, null, React.createElement("div", {
|
|
5893
|
+
className: "cell-block"
|
|
5894
|
+
}, React.createElement("span", null, "Ticket ID"), React.createElement("span", null, ticket.hash))), React.createElement(TableCell, null, React.createElement("div", {
|
|
5895
|
+
className: "cell-block"
|
|
5896
|
+
}, React.createElement("span", null, "Ticket Type"), React.createElement("span", null, ticket.ticket_type))), React.createElement(TableCell, null, React.createElement("div", {
|
|
5897
|
+
className: "cell-block"
|
|
5898
|
+
}, React.createElement("span", null, "Ticket Holder"), React.createElement("span", null, ticket.holder_name))), React.createElement(TableCell, null, React.createElement("div", {
|
|
5899
|
+
className: "cell-block"
|
|
5900
|
+
}, React.createElement("span", null, "Status"), React.createElement("span", null, ticket.status))), ticket.pdf_link && ticket.status !== "Sold" ? React.createElement(TableCell, null, Boolean(icon) && React.createElement("img", {
|
|
5901
|
+
src: icon,
|
|
5902
|
+
alt: "nodata"
|
|
5903
|
+
}), React.createElement("span", {
|
|
5454
5904
|
"aria-hidden": true,
|
|
5455
5905
|
className: "action-button",
|
|
5456
|
-
onClick: function
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5906
|
+
onClick: function () {
|
|
5907
|
+
var _onClick = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
5908
|
+
var pdfDownloadError;
|
|
5909
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
5910
|
+
while (1) {
|
|
5911
|
+
switch (_context.prev = _context.next) {
|
|
5912
|
+
case 0:
|
|
5913
|
+
_context.prev = 0;
|
|
5914
|
+
_context.next = 3;
|
|
5915
|
+
return downloadPDF(ticket.pdf_link);
|
|
5916
|
+
|
|
5917
|
+
case 3:
|
|
5918
|
+
pdfDownloadError = _context.sent;
|
|
5919
|
+
|
|
5920
|
+
if (pdfDownloadError) {
|
|
5921
|
+
setPdfError(pdfDownloadError == null ? void 0 : pdfDownloadError.message);
|
|
5922
|
+
}
|
|
5923
|
+
|
|
5924
|
+
_context.next = 10;
|
|
5925
|
+
break;
|
|
5926
|
+
|
|
5927
|
+
case 7:
|
|
5928
|
+
_context.prev = 7;
|
|
5929
|
+
_context.t0 = _context["catch"](0);
|
|
5930
|
+
|
|
5931
|
+
if (_context.t0 && typeof _context.t0 === 'string') {
|
|
5932
|
+
setPdfError(_context.t0);
|
|
5933
|
+
}
|
|
5934
|
+
|
|
5935
|
+
case 10:
|
|
5936
|
+
case "end":
|
|
5937
|
+
return _context.stop();
|
|
5938
|
+
}
|
|
5939
|
+
}
|
|
5940
|
+
}, _callee, null, [[0, 7]]);
|
|
5941
|
+
}));
|
|
5942
|
+
|
|
5943
|
+
function onClick() {
|
|
5944
|
+
return _onClick.apply(this, arguments);
|
|
5945
|
+
}
|
|
5946
|
+
|
|
5947
|
+
return onClick;
|
|
5948
|
+
}()
|
|
5949
|
+
}, "Download")) : null, React.createElement(TableCell, null, ticket.is_sellable && React.createElement("span", {
|
|
5460
5950
|
"aria-hidden": true,
|
|
5461
5951
|
className: "action-button",
|
|
5462
5952
|
onClick: function onClick() {
|
|
@@ -5480,11 +5970,11 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
5480
5970
|
})))));
|
|
5481
5971
|
};
|
|
5482
5972
|
|
|
5483
|
-
var _excluded$
|
|
5973
|
+
var _excluded$2 = ["label", "field", "theme"];
|
|
5484
5974
|
var RadioField = function RadioField(_ref) {
|
|
5485
5975
|
var label = _ref.label,
|
|
5486
5976
|
field = _ref.field,
|
|
5487
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5977
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
5488
5978
|
|
|
5489
5979
|
var customTheme = useTheme();
|
|
5490
5980
|
return React.createElement(FormGroup, null, React.createElement(FormControlLabel, {
|
|
@@ -5496,7 +5986,7 @@ var RadioField = function RadioField(_ref) {
|
|
|
5496
5986
|
}));
|
|
5497
5987
|
};
|
|
5498
5988
|
|
|
5499
|
-
var style$
|
|
5989
|
+
var style$3 = {
|
|
5500
5990
|
position: 'absolute',
|
|
5501
5991
|
top: '50%',
|
|
5502
5992
|
left: '50%',
|
|
@@ -5565,7 +6055,7 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
|
|
|
5565
6055
|
"aria-describedby": "modal-modal-description",
|
|
5566
6056
|
className: 'resale-modal'
|
|
5567
6057
|
}, React.createElement(Box, {
|
|
5568
|
-
style: style$
|
|
6058
|
+
style: style$3
|
|
5569
6059
|
}, React.createElement("h3", null, "Sell Ticket"), React.createElement("div", null, React.createElement("h3", null, "Ticket Details"), React.createElement("div", null, React.createElement("h4", null, "Event"), React.createElement("p", null, event_name)), React.createElement("div", null, React.createElement("h4", null, "Ticket Holder"), React.createElement("p", null, holder_name)), React.createElement("div", null, React.createElement("h4", null, "Ticket ID"), React.createElement("p", null, hash))), React.createElement("div", null, React.createElement("h3", null, "Sell to Whom"), React.createElement(Formik, {
|
|
5570
6060
|
initialValues: initialValues,
|
|
5571
6061
|
validationSchema: schema,
|
|
@@ -5631,12 +6121,12 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
|
|
|
5631
6121
|
type: 'text',
|
|
5632
6122
|
component: CustomField
|
|
5633
6123
|
}))))), ticket_type_is_active && React.createElement("div", null, React.createElement(Field, {
|
|
5634
|
-
name:
|
|
5635
|
-
label:
|
|
5636
|
-
type:
|
|
5637
|
-
value:
|
|
6124
|
+
name: "to",
|
|
6125
|
+
label: "I will sell my ticket to anyone who wants to buy it",
|
|
6126
|
+
type: "radio",
|
|
6127
|
+
value: "anyone",
|
|
5638
6128
|
component: RadioField
|
|
5639
|
-
})), 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, {
|
|
6129
|
+
})), 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, {
|
|
5640
6130
|
name: 'confirm',
|
|
5641
6131
|
label: 'I agree',
|
|
5642
6132
|
type: 'checkbox',
|
|
@@ -5650,7 +6140,7 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
|
|
|
5650
6140
|
}))));
|
|
5651
6141
|
};
|
|
5652
6142
|
|
|
5653
|
-
var style$
|
|
6143
|
+
var style$4 = {
|
|
5654
6144
|
position: 'absolute',
|
|
5655
6145
|
top: '50%',
|
|
5656
6146
|
left: '50%',
|
|
@@ -5678,7 +6168,7 @@ var ConfirmModal = function ConfirmModal(_ref) {
|
|
|
5678
6168
|
"aria-describedby": "modal-modal-description",
|
|
5679
6169
|
className: 'confirm-modal'
|
|
5680
6170
|
}, React.createElement(Box, {
|
|
5681
|
-
style: style$
|
|
6171
|
+
style: style$4
|
|
5682
6172
|
}, React.createElement("p", null, message), React.createElement("div", {
|
|
5683
6173
|
className: 'footer'
|
|
5684
6174
|
}, React.createElement(Button, {
|
|
@@ -5696,10 +6186,15 @@ var getTotal = function getTotal(data) {
|
|
|
5696
6186
|
var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
5697
6187
|
var _data$items, _data$items$ticket_ty, _data$items2, _data$items2$add_ons;
|
|
5698
6188
|
|
|
5699
|
-
var _ref$
|
|
6189
|
+
var _ref$columns = _ref.columns,
|
|
6190
|
+
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
6191
|
+
_ref$onGetOrdersSucce = _ref.onGetOrdersSuccess,
|
|
5700
6192
|
onGetOrdersSuccess = _ref$onGetOrdersSucce === void 0 ? function () {} : _ref$onGetOrdersSucce,
|
|
5701
6193
|
_ref$onGetOrdersError = _ref.onGetOrdersError,
|
|
5702
|
-
onGetOrdersError = _ref$onGetOrdersError === void 0 ? function () {} : _ref$onGetOrdersError
|
|
6194
|
+
onGetOrdersError = _ref$onGetOrdersError === void 0 ? function () {} : _ref$onGetOrdersError,
|
|
6195
|
+
onReturnButtonClick = _ref.onReturnButtonClick,
|
|
6196
|
+
_ref$personalLinkIcon = _ref.personalLinkIcon,
|
|
6197
|
+
personalLinkIcon = _ref$personalLinkIcon === void 0 ? '' : _ref$personalLinkIcon;
|
|
5703
6198
|
|
|
5704
6199
|
var _useState = useState({}),
|
|
5705
6200
|
data = _useState[0],
|
|
@@ -5900,27 +6395,59 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5900
6395
|
};
|
|
5901
6396
|
}();
|
|
5902
6397
|
|
|
6398
|
+
var orderSummery = "ID " + data.id + ", placed";
|
|
6399
|
+
|
|
6400
|
+
if (data.date) {
|
|
6401
|
+
orderSummery += " " + data.date;
|
|
6402
|
+
}
|
|
6403
|
+
|
|
5903
6404
|
return React.createElement("div", {
|
|
5904
6405
|
className: "order-details"
|
|
5905
6406
|
}, loading ? React.createElement("div", {
|
|
5906
6407
|
className: "loading"
|
|
5907
|
-
}, React.createElement(CircularProgress, null)) : React.createElement(React.Fragment, null, React.createElement("h1", {
|
|
6408
|
+
}, React.createElement(CircularProgress$1, null)) : React.createElement(React.Fragment, null, React.createElement("h1", {
|
|
5908
6409
|
className: "layout-title"
|
|
5909
6410
|
}, "Order Details"), React.createElement("div", {
|
|
5910
6411
|
className: "order-summary-box"
|
|
5911
|
-
}, React.createElement("
|
|
6412
|
+
}, React.createElement("div", {
|
|
6413
|
+
className: "summary-block"
|
|
6414
|
+
}, React.createElement("div", {
|
|
6415
|
+
className: "summary-item"
|
|
6416
|
+
}, React.createElement("h6", {
|
|
5912
6417
|
className: "sub-title"
|
|
5913
|
-
}, "Order Summary"), React.createElement("div", {
|
|
6418
|
+
}, "Order Summary"), React.createElement("p", null, orderSummery)), React.createElement("div", {
|
|
6419
|
+
className: "summary-item"
|
|
6420
|
+
}, React.createElement("div", {
|
|
6421
|
+
className: "return-button-container"
|
|
6422
|
+
}, React.createElement("button", {
|
|
6423
|
+
type: "button",
|
|
6424
|
+
className: "return-button",
|
|
6425
|
+
onClick: function onClick() {
|
|
6426
|
+
if (typeof window !== 'undefined') {
|
|
6427
|
+
window.location.assign('/orders');
|
|
6428
|
+
}
|
|
6429
|
+
}
|
|
6430
|
+
}, "Back to Orders")))), React.createElement("div", {
|
|
5914
6431
|
className: "personal-link"
|
|
5915
|
-
}, React.createElement("
|
|
6432
|
+
}, React.createElement("div", {
|
|
6433
|
+
className: "link-item"
|
|
6434
|
+
}, React.createElement("span", null, "Personal Share Link: "), React.createElement("a", {
|
|
5916
6435
|
href: data == null ? void 0 : data.personal_share_link,
|
|
5917
6436
|
target: "_blank",
|
|
5918
6437
|
rel: "noreferrer"
|
|
5919
|
-
},
|
|
6438
|
+
}, Boolean(personalLinkIcon) && React.createElement("img", {
|
|
6439
|
+
src: personalLinkIcon,
|
|
6440
|
+
alt: "Icon"
|
|
6441
|
+
}), data == null ? void 0 : data.personal_share_link)), React.createElement("div", {
|
|
6442
|
+
className: "link-item"
|
|
6443
|
+
}, React.createElement("p", null, "So far, you\u2019ve referred " + data.sales_referred + " tickets"))), React.createElement(TableContainer, {
|
|
5920
6444
|
component: Paper
|
|
5921
6445
|
}, React.createElement(Table, {
|
|
6446
|
+
className: "tt-type",
|
|
5922
6447
|
"aria-label": "collapsible table"
|
|
5923
|
-
}, React.createElement(TableHead, null, React.createElement(TableRow, null,
|
|
6448
|
+
}, React.createElement(TableHead, null, React.createElement(TableRow, null, _map(columns, function (item) {
|
|
6449
|
+
return React.createElement(TableCell, null, item.label || '');
|
|
6450
|
+
}))), 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) {
|
|
5924
6451
|
return React.createElement(TableRow, {
|
|
5925
6452
|
key: index
|
|
5926
6453
|
}, 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));
|
|
@@ -5940,7 +6467,9 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5940
6467
|
type: "button",
|
|
5941
6468
|
className: "return-button",
|
|
5942
6469
|
onClick: function onClick() {
|
|
5943
|
-
if (
|
|
6470
|
+
if (onReturnButtonClick) {
|
|
6471
|
+
onReturnButtonClick(data);
|
|
6472
|
+
} else if (typeof window !== 'undefined') {
|
|
5944
6473
|
window.location.assign('/orders');
|
|
5945
6474
|
}
|
|
5946
6475
|
}
|
|
@@ -5955,6 +6484,120 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5955
6484
|
}));
|
|
5956
6485
|
};
|
|
5957
6486
|
|
|
6487
|
+
var Schema$1 = /*#__PURE__*/object().shape({
|
|
6488
|
+
password: /*#__PURE__*/string().min(6, 'Password must have 5+ characters').required('Required'),
|
|
6489
|
+
password_confirmation: /*#__PURE__*/string().required('Required').oneOf([/*#__PURE__*/ref('password'), null], 'Passwords must match')
|
|
6490
|
+
});
|
|
6491
|
+
var ResetPasswordContainer = function ResetPasswordContainer(_ref) {
|
|
6492
|
+
var _ref$token = _ref.token,
|
|
6493
|
+
tokenProps = _ref$token === void 0 ? '' : _ref$token,
|
|
6494
|
+
_ref$onResetPasswordS = _ref.onResetPasswordSuccess,
|
|
6495
|
+
onResetPasswordSuccess = _ref$onResetPasswordS === void 0 ? function () {} : _ref$onResetPasswordS,
|
|
6496
|
+
_ref$onResetPasswordE = _ref.onResetPasswordError,
|
|
6497
|
+
onResetPasswordError = _ref$onResetPasswordE === void 0 ? function () {} : _ref$onResetPasswordE;
|
|
6498
|
+
|
|
6499
|
+
var _useState = useState(false),
|
|
6500
|
+
loading = _useState[0],
|
|
6501
|
+
setLoading = _useState[1];
|
|
6502
|
+
|
|
6503
|
+
return React.createElement("div", {
|
|
6504
|
+
className: "reset-password"
|
|
6505
|
+
}, React.createElement("div", {
|
|
6506
|
+
className: "title"
|
|
6507
|
+
}, "Change Password"), React.createElement(Formik, {
|
|
6508
|
+
initialValues: {
|
|
6509
|
+
password: '',
|
|
6510
|
+
password_confirmation: ''
|
|
6511
|
+
},
|
|
6512
|
+
validationSchema: Schema$1,
|
|
6513
|
+
onSubmit: function () {
|
|
6514
|
+
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(values) {
|
|
6515
|
+
var token, params, payload, res;
|
|
6516
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
6517
|
+
while (1) {
|
|
6518
|
+
switch (_context.prev = _context.next) {
|
|
6519
|
+
case 0:
|
|
6520
|
+
_context.prev = 0;
|
|
6521
|
+
setLoading(true);
|
|
6522
|
+
|
|
6523
|
+
if (tokenProps) {
|
|
6524
|
+
token = tokenProps;
|
|
6525
|
+
} else {
|
|
6526
|
+
if (typeof window !== 'undefined') {
|
|
6527
|
+
params = new URL("" + window.location).searchParams;
|
|
6528
|
+
token = params.get('token');
|
|
6529
|
+
}
|
|
6530
|
+
}
|
|
6531
|
+
|
|
6532
|
+
payload = _extends({
|
|
6533
|
+
token: token
|
|
6534
|
+
}, values);
|
|
6535
|
+
_context.next = 6;
|
|
6536
|
+
return resetPassword(payload);
|
|
6537
|
+
|
|
6538
|
+
case 6:
|
|
6539
|
+
res = _context.sent;
|
|
6540
|
+
onResetPasswordSuccess(res);
|
|
6541
|
+
_context.next = 13;
|
|
6542
|
+
break;
|
|
6543
|
+
|
|
6544
|
+
case 10:
|
|
6545
|
+
_context.prev = 10;
|
|
6546
|
+
_context.t0 = _context["catch"](0);
|
|
6547
|
+
|
|
6548
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
6549
|
+
onResetPasswordError(_context.t0);
|
|
6550
|
+
}
|
|
6551
|
+
|
|
6552
|
+
case 13:
|
|
6553
|
+
_context.prev = 13;
|
|
6554
|
+
setLoading(false);
|
|
6555
|
+
return _context.finish(13);
|
|
6556
|
+
|
|
6557
|
+
case 16:
|
|
6558
|
+
case "end":
|
|
6559
|
+
return _context.stop();
|
|
6560
|
+
}
|
|
6561
|
+
}
|
|
6562
|
+
}, _callee, null, [[0, 10, 13, 16]]);
|
|
6563
|
+
}));
|
|
6564
|
+
|
|
6565
|
+
function onSubmit(_x) {
|
|
6566
|
+
return _onSubmit.apply(this, arguments);
|
|
6567
|
+
}
|
|
6568
|
+
|
|
6569
|
+
return onSubmit;
|
|
6570
|
+
}()
|
|
6571
|
+
}, function (_ref2) {
|
|
6572
|
+
var isValid = _ref2.isValid,
|
|
6573
|
+
dirty = _ref2.dirty;
|
|
6574
|
+
return React.createElement(Form, null, React.createElement("div", {
|
|
6575
|
+
className: "body"
|
|
6576
|
+
}, React.createElement("div", {
|
|
6577
|
+
className: "field-item"
|
|
6578
|
+
}, React.createElement(Field, {
|
|
6579
|
+
name: "password",
|
|
6580
|
+
label: "New Password",
|
|
6581
|
+
type: "password",
|
|
6582
|
+
component: CustomField
|
|
6583
|
+
})), React.createElement("div", {
|
|
6584
|
+
className: "field-item"
|
|
6585
|
+
}, React.createElement(Field, {
|
|
6586
|
+
name: "password_confirmation",
|
|
6587
|
+
label: "Confirm Password",
|
|
6588
|
+
type: "password",
|
|
6589
|
+
component: CustomField
|
|
6590
|
+
}))), React.createElement("div", {
|
|
6591
|
+
className: "action-button"
|
|
6592
|
+
}, React.createElement("button", {
|
|
6593
|
+
type: "submit",
|
|
6594
|
+
disabled: !(isValid && dirty)
|
|
6595
|
+
}, loading ? React.createElement(CircularProgress, {
|
|
6596
|
+
size: "22px"
|
|
6597
|
+
}) : 'Submit')));
|
|
6598
|
+
}));
|
|
6599
|
+
};
|
|
6600
|
+
|
|
5958
6601
|
var TicketResaleContainer = function TicketResaleContainer(_ref) {
|
|
5959
6602
|
var _ref$onProcessTicketS = _ref.onProcessTicketSuccess,
|
|
5960
6603
|
onProcessTicketSuccess = _ref$onProcessTicketS === void 0 ? function () {} : _ref$onProcessTicketS,
|
|
@@ -6066,7 +6709,7 @@ var TicketResaleContainer = function TicketResaleContainer(_ref) {
|
|
|
6066
6709
|
}, React.createElement("h3", null, successMessage ? successMessage : error)));
|
|
6067
6710
|
};
|
|
6068
6711
|
|
|
6069
|
-
var style$
|
|
6712
|
+
var style$5 = {
|
|
6070
6713
|
position: 'absolute',
|
|
6071
6714
|
top: '10%',
|
|
6072
6715
|
left: '50%',
|
|
@@ -6090,7 +6733,7 @@ var RedirectModal = function RedirectModal(_ref) {
|
|
|
6090
6733
|
"aria-describedby": "modal-modal-description",
|
|
6091
6734
|
className: "redirect-modal"
|
|
6092
6735
|
}, React.createElement(Box, {
|
|
6093
|
-
style: style$
|
|
6736
|
+
style: style$5
|
|
6094
6737
|
}, React.createElement("p", null, message), React.createElement("div", {
|
|
6095
6738
|
className: "footer"
|
|
6096
6739
|
}, React.createElement("button", {
|
|
@@ -6098,7 +6741,7 @@ var RedirectModal = function RedirectModal(_ref) {
|
|
|
6098
6741
|
}, "OK"))));
|
|
6099
6742
|
};
|
|
6100
6743
|
|
|
6101
|
-
var style$
|
|
6744
|
+
var style$6 = {
|
|
6102
6745
|
position: 'absolute',
|
|
6103
6746
|
top: '50%',
|
|
6104
6747
|
left: '50%',
|
|
@@ -6204,7 +6847,7 @@ var RsvpContainer = function RsvpContainer(_ref) {
|
|
|
6204
6847
|
"aria-describedby": "modal-modal-description",
|
|
6205
6848
|
className: "rsvp-modal"
|
|
6206
6849
|
}, React.createElement(Box, {
|
|
6207
|
-
style: style$
|
|
6850
|
+
style: style$6,
|
|
6208
6851
|
className: "rsvp-modal-box"
|
|
6209
6852
|
}, React.createElement("div", {
|
|
6210
6853
|
className: "rsvp-modal-container"
|
|
@@ -6245,5 +6888,5 @@ var RsvpContainer = function RsvpContainer(_ref) {
|
|
|
6245
6888
|
}, "RSVP"))))))));
|
|
6246
6889
|
};
|
|
6247
6890
|
|
|
6248
|
-
export { BillingInfoContainer, ConfirmationContainer, LoginModal, MyTicketsContainer, OrderDetailsContainer, PaymentContainer, RedirectModal, RsvpContainer, TicketResaleContainer, TicketsContainer, createFixedFloatNormalizer, currencyNormalizerCreator, setConfigs };
|
|
6891
|
+
export { BillingInfoContainer, ConfirmationContainer, ForgotPasswordModal, LoginModal, MyTicketsContainer, OrderDetailsContainer, PaymentContainer, RedirectModal, ResetPasswordContainer, RsvpContainer, TicketResaleContainer, TicketsContainer, createFixedFloatNormalizer, currencyNormalizerCreator, setConfigs };
|
|
6249
6892
|
//# sourceMappingURL=tf-checkout-react.esm.js.map
|