tf-checkout-react 1.0.75 → 1.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.d.ts +1 -0
- package/dist/components/billing-info-container/index.d.ts +7 -2
- package/dist/components/billing-info-container/utils.d.ts +1 -0
- package/dist/components/common/FormikPhoneNumberField.d.ts +1 -1
- package/dist/components/countdown/index.d.ts +11 -0
- package/dist/components/orderDetailsContainer/ticketsTable.d.ts +13 -1
- package/dist/components/paymentContainer/index.d.ts +9 -2
- package/dist/components/ticketsContainer/index.d.ts +9 -1
- package/dist/components/waitingList/index.d.ts +1 -2
- package/dist/tf-checkout-react.cjs.development.js +505 -177
- 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 +498 -170
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +7 -0
- package/dist/utils/downloadPDF.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/package.json +2 -1
- package/src/api/index.ts +9 -0
- package/src/components/billing-info-container/index.tsx +25 -27
- package/src/components/billing-info-container/utils.ts +2 -1
- package/src/components/common/CheckboxField.tsx +19 -8
- package/src/components/common/CustomField.tsx +7 -0
- package/src/components/common/FormikPhoneNumberField.tsx +11 -1
- package/src/components/common/SelectField.tsx +5 -1
- package/src/components/countdown/index.tsx +89 -0
- package/src/components/countdown/style.css +10 -0
- package/src/components/loginModal/index.tsx +2 -0
- package/src/components/orderDetailsContainer/ticketsTable.tsx +66 -60
- package/src/components/paymentContainer/index.tsx +9 -11
- package/src/components/stripePayment/index.tsx +4 -4
- package/src/components/ticketsContainer/PromoCodeSection.tsx +3 -2
- package/src/components/ticketsContainer/TicketsSection.tsx +10 -6
- package/src/components/ticketsContainer/index.tsx +236 -76
- package/src/components/ticketsContainer/style.css +7 -0
- package/src/components/waitingList/index.tsx +3 -9
- package/src/components/waitingList/style.css +4 -2
- package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +51 -0
- package/src/utils/downloadPDF.tsx +22 -0
- package/src/utils/index.ts +2 -0
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import React, { Component, useState, useCallback, useEffect, useRef, Fragment } from 'react';
|
|
2
2
|
import { connect, Formik, Form, Field } from 'formik';
|
|
3
|
-
import
|
|
3
|
+
import Button from '@mui/material/Button';
|
|
4
4
|
import _identity from 'lodash-es/identity';
|
|
5
5
|
import _map from 'lodash-es/map';
|
|
6
6
|
import _get from 'lodash-es/get';
|
|
7
7
|
import _includes from 'lodash-es/includes';
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
import _forEach from 'lodash-es/forEach';
|
|
10
|
-
import { TextField, FormControl,
|
|
10
|
+
import { TextField, FormControl, FormHelperText, InputLabel, CircularProgress, createTheme as createTheme$1 } from '@mui/material';
|
|
11
11
|
import Modal from '@mui/material/Modal';
|
|
12
12
|
import Box from '@mui/material/Box';
|
|
13
13
|
import _flatMapDeep from 'lodash-es/flatMapDeep';
|
|
14
14
|
import _isArray from 'lodash-es/isArray';
|
|
15
15
|
import { nanoid } from 'nanoid';
|
|
16
16
|
import TextField$1 from '@mui/material/TextField';
|
|
17
|
+
import { useTheme } from '@mui/styles';
|
|
17
18
|
import FormGroup from '@mui/material/FormGroup';
|
|
18
19
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
19
20
|
import Checkbox from '@mui/material/Checkbox';
|
|
@@ -35,8 +36,9 @@ import _sortBy from 'lodash-es/sortBy';
|
|
|
35
36
|
import _has from 'lodash-es/has';
|
|
36
37
|
import FormControl$1 from '@mui/material/FormControl';
|
|
37
38
|
import MenuItem from '@mui/material/MenuItem';
|
|
38
|
-
import Button from '@mui/material/Button';
|
|
39
39
|
import SVG from 'react-inlinesvg';
|
|
40
|
+
import moment from 'moment-timezone';
|
|
41
|
+
import { ThemeProvider as ThemeProvider$1 } from '@mui/private-theming';
|
|
40
42
|
import Table from '@mui/material/Table';
|
|
41
43
|
import TableBody from '@mui/material/TableBody';
|
|
42
44
|
import TableCell from '@mui/material/TableCell';
|
|
@@ -987,6 +989,84 @@ var ErrorFocusInternal = /*#__PURE__*/function (_Component) {
|
|
|
987
989
|
|
|
988
990
|
var ErrorFocus = /*#__PURE__*/connect(ErrorFocusInternal);
|
|
989
991
|
|
|
992
|
+
var downloadPDF = function downloadPDF(pdfUrl) {
|
|
993
|
+
if (typeof window === 'undefined') return;
|
|
994
|
+
var accessToken = localStorage.getItem('access_token');
|
|
995
|
+
if (!accessToken) return;
|
|
996
|
+
fetch(pdfUrl, {
|
|
997
|
+
headers: {
|
|
998
|
+
Authorization: "Bearer " + accessToken
|
|
999
|
+
}
|
|
1000
|
+
}).then( /*#__PURE__*/function () {
|
|
1001
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(response) {
|
|
1002
|
+
var blobValue;
|
|
1003
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1004
|
+
while (1) {
|
|
1005
|
+
switch (_context.prev = _context.next) {
|
|
1006
|
+
case 0:
|
|
1007
|
+
_context.next = 2;
|
|
1008
|
+
return response.blob();
|
|
1009
|
+
|
|
1010
|
+
case 2:
|
|
1011
|
+
blobValue = _context.sent;
|
|
1012
|
+
return _context.abrupt("return", blobValue);
|
|
1013
|
+
|
|
1014
|
+
case 4:
|
|
1015
|
+
case "end":
|
|
1016
|
+
return _context.stop();
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}, _callee);
|
|
1020
|
+
}));
|
|
1021
|
+
|
|
1022
|
+
return function (_x) {
|
|
1023
|
+
return _ref.apply(this, arguments);
|
|
1024
|
+
};
|
|
1025
|
+
}()).then(function (blobValue) {
|
|
1026
|
+
var file = new Blob([blobValue], {
|
|
1027
|
+
type: 'application/pdf'
|
|
1028
|
+
});
|
|
1029
|
+
var fileURL = URL.createObjectURL(file);
|
|
1030
|
+
window.open(fileURL);
|
|
1031
|
+
});
|
|
1032
|
+
};
|
|
1033
|
+
|
|
1034
|
+
var createCheckoutDataBodyWithDefaultHolder = function createCheckoutDataBodyWithDefaultHolder(ticketsQuantity, logedInValues) {
|
|
1035
|
+
var ticket_holders = [];
|
|
1036
|
+
var first_name = _get(logedInValues, 'firstName') || _get(logedInValues, 'first_name') || '';
|
|
1037
|
+
var last_name = _get(logedInValues, 'lastName', '') || _get(logedInValues, 'last_name') || '';
|
|
1038
|
+
|
|
1039
|
+
var phone = _get(logedInValues, 'phone', '');
|
|
1040
|
+
|
|
1041
|
+
var email = _get(logedInValues, 'email', '');
|
|
1042
|
+
|
|
1043
|
+
for (var i = 0; i <= ticketsQuantity - 1; i++) {
|
|
1044
|
+
var individualHolder = i ? {
|
|
1045
|
+
first_name: '',
|
|
1046
|
+
last_name: '',
|
|
1047
|
+
phone: '',
|
|
1048
|
+
email: ''
|
|
1049
|
+
} : {
|
|
1050
|
+
first_name: first_name,
|
|
1051
|
+
last_name: last_name,
|
|
1052
|
+
phone: phone,
|
|
1053
|
+
email: email
|
|
1054
|
+
};
|
|
1055
|
+
ticket_holders.push(individualHolder);
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
var body = {
|
|
1059
|
+
attributes: _extends({}, logedInValues, {
|
|
1060
|
+
email: email,
|
|
1061
|
+
confirm_email: email,
|
|
1062
|
+
first_name: first_name,
|
|
1063
|
+
last_name: last_name,
|
|
1064
|
+
ticket_holders: ticket_holders
|
|
1065
|
+
})
|
|
1066
|
+
};
|
|
1067
|
+
return body;
|
|
1068
|
+
};
|
|
1069
|
+
|
|
990
1070
|
var isWindowDefined = typeof window !== 'undefined';
|
|
991
1071
|
var ttfHeaders = {
|
|
992
1072
|
Accept: 'application/vnd.api+json',
|
|
@@ -1091,6 +1171,14 @@ var handleSetAccessToken = function handleSetAccessToken(token) {
|
|
|
1091
1171
|
}
|
|
1092
1172
|
}
|
|
1093
1173
|
};
|
|
1174
|
+
function getEvent(id) {
|
|
1175
|
+
var response = publicRequest.get("v1/event/" + id, {
|
|
1176
|
+
headers: ttfHeaders
|
|
1177
|
+
})["catch"](function (error) {
|
|
1178
|
+
throw error;
|
|
1179
|
+
});
|
|
1180
|
+
return response;
|
|
1181
|
+
}
|
|
1094
1182
|
function getTickets(id, promoCode) {
|
|
1095
1183
|
var response = publicRequest.get("v1/event/" + id + "/tickets/", {
|
|
1096
1184
|
headers: promoCode ? _extends({}, ttfHeaders, {
|
|
@@ -1226,7 +1314,7 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1226
1314
|
},
|
|
1227
1315
|
onSubmit: function () {
|
|
1228
1316
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1229
|
-
var email, password, bodyFormData, resAutorize, bodyFormDataToken, resAccessToken, accessToken, profileResponse, profileSpecifiedData, profileDataObj, _e$response, _e$response$data, _error;
|
|
1317
|
+
var email, password, bodyFormData, resAutorize, bodyFormDataToken, resAccessToken, accessToken, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
|
|
1230
1318
|
|
|
1231
1319
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1232
1320
|
while (1) {
|
|
@@ -1305,6 +1393,8 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1305
1393
|
if (typeof window !== 'undefined') {
|
|
1306
1394
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
1307
1395
|
window.localStorage.setItem('access_token', accessToken);
|
|
1396
|
+
event = new window.CustomEvent('tf-login');
|
|
1397
|
+
window.document.dispatchEvent(event);
|
|
1308
1398
|
}
|
|
1309
1399
|
|
|
1310
1400
|
onLogin();
|
|
@@ -1651,7 +1741,7 @@ var setLoggedUserData = function setLoggedUserData(data) {
|
|
|
1651
1741
|
country: (data == null ? void 0 : data.country) || '',
|
|
1652
1742
|
phone: (data == null ? void 0 : data.phone) || '',
|
|
1653
1743
|
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
1654
|
-
state: (data == null ? void 0 : data.
|
|
1744
|
+
state: (data == null ? void 0 : data.stateId) || '',
|
|
1655
1745
|
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
1656
1746
|
};
|
|
1657
1747
|
};
|
|
@@ -1777,6 +1867,7 @@ var CustomField = function CustomField(_ref) {
|
|
|
1777
1867
|
var error = _get(errors, field.name);
|
|
1778
1868
|
|
|
1779
1869
|
var isTouched = Boolean(_get(touched, field.name)) || _includes(field.name, 'holder') && !!error && !!submitCount;
|
|
1870
|
+
var customTheme = useTheme();
|
|
1780
1871
|
return React.createElement(TextField$1, Object.assign({
|
|
1781
1872
|
id: field.name,
|
|
1782
1873
|
label: label,
|
|
@@ -1791,6 +1882,12 @@ var CustomField = function CustomField(_ref) {
|
|
|
1791
1882
|
MenuProps: {
|
|
1792
1883
|
className: theme
|
|
1793
1884
|
}
|
|
1885
|
+
},
|
|
1886
|
+
InputLabelProps: {
|
|
1887
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
1888
|
+
},
|
|
1889
|
+
inputProps: {
|
|
1890
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
1794
1891
|
}
|
|
1795
1892
|
}, field), isSelectField ? _map(selectOptions, function (option) {
|
|
1796
1893
|
return React.createElement("option", {
|
|
@@ -1803,14 +1900,22 @@ var CustomField = function CustomField(_ref) {
|
|
|
1803
1900
|
|
|
1804
1901
|
var _excluded$1 = ["label", "field", "selectOptions", "theme", "setFieldValue"];
|
|
1805
1902
|
var CheckboxField = function CheckboxField(_ref) {
|
|
1903
|
+
var _rest$form, _field$name, _rest$form2, _field$name2;
|
|
1904
|
+
|
|
1806
1905
|
var label = _ref.label,
|
|
1807
1906
|
field = _ref.field,
|
|
1808
1907
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
1809
1908
|
|
|
1810
|
-
|
|
1909
|
+
var customTheme = useTheme();
|
|
1910
|
+
return React.createElement(FormControl, {
|
|
1911
|
+
error: !!(rest != null && (_rest$form = rest.form) != null && _rest$form.errors && rest.form.errors[(_field$name = field == null ? void 0 : field.name) != null ? _field$name : ""])
|
|
1912
|
+
}, React.createElement(FormGroup, null, React.createElement(FormControlLabel, {
|
|
1811
1913
|
control: React.createElement(Checkbox, Object.assign({}, field, rest)),
|
|
1812
|
-
label: label
|
|
1813
|
-
|
|
1914
|
+
label: label,
|
|
1915
|
+
componentsProps: {
|
|
1916
|
+
typography: customTheme == null ? void 0 : customTheme.checkbox
|
|
1917
|
+
}
|
|
1918
|
+
})), !!(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);
|
|
1814
1919
|
};
|
|
1815
1920
|
|
|
1816
1921
|
var SelectField = function SelectField(_ref) {
|
|
@@ -1828,9 +1933,11 @@ var SelectField = function SelectField(_ref) {
|
|
|
1828
1933
|
|
|
1829
1934
|
var error = _get(errors, field.name);
|
|
1830
1935
|
|
|
1936
|
+
var customTheme = useTheme();
|
|
1831
1937
|
return React.createElement(FormControl, {
|
|
1832
1938
|
fullWidth: true
|
|
1833
1939
|
}, React.createElement(InputLabel, {
|
|
1940
|
+
style: customTheme == null ? void 0 : customTheme.input,
|
|
1834
1941
|
htmlFor: field.name,
|
|
1835
1942
|
error: !!error && isTouched,
|
|
1836
1943
|
shrink: true
|
|
@@ -1848,7 +1955,9 @@ var SelectField = function SelectField(_ref) {
|
|
|
1848
1955
|
MenuProps: {
|
|
1849
1956
|
className: theme
|
|
1850
1957
|
}
|
|
1851
|
-
}, field
|
|
1958
|
+
}, field, {
|
|
1959
|
+
style: customTheme == null ? void 0 : customTheme.input
|
|
1960
|
+
}), _map(selectOptions, function (option) {
|
|
1852
1961
|
return React.createElement("option", {
|
|
1853
1962
|
key: option.value,
|
|
1854
1963
|
value: option.value,
|
|
@@ -1940,14 +2049,17 @@ var FormikPhoneNumberField = function FormikPhoneNumberField(_ref) {
|
|
|
1940
2049
|
_ref$form = _ref.form,
|
|
1941
2050
|
touched = _ref$form.touched,
|
|
1942
2051
|
errors = _ref$form.errors,
|
|
2052
|
+
initialValues = _ref$form.initialValues,
|
|
1943
2053
|
setFieldValue = _ref.setFieldValue,
|
|
1944
2054
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
1945
2055
|
|
|
1946
2056
|
var error = _get(errors, field.name);
|
|
1947
2057
|
|
|
1948
2058
|
var isTouched = Boolean(_get(touched, field.name));
|
|
2059
|
+
var customTheme = useTheme();
|
|
1949
2060
|
return React.createElement(MuiPhoneNumber, Object.assign({
|
|
1950
2061
|
name: 'phone',
|
|
2062
|
+
value: initialValues.phone,
|
|
1951
2063
|
onChange: function onChange(e) {
|
|
1952
2064
|
return setFieldValue("phone", removePlusSign(e));
|
|
1953
2065
|
},
|
|
@@ -1958,6 +2070,12 @@ var FormikPhoneNumberField = function FormikPhoneNumberField(_ref) {
|
|
|
1958
2070
|
error: !!error && isTouched,
|
|
1959
2071
|
helperText: isTouched && error,
|
|
1960
2072
|
fullWidth: true,
|
|
2073
|
+
InputLabelProps: {
|
|
2074
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
2075
|
+
},
|
|
2076
|
+
InputProps: {
|
|
2077
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
2078
|
+
},
|
|
1961
2079
|
autoFormat: false
|
|
1962
2080
|
}, rest));
|
|
1963
2081
|
};
|
|
@@ -1970,10 +2088,11 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
1970
2088
|
setUserValues = _ref.setUserValues,
|
|
1971
2089
|
onGetStatesSuccess = _ref.onGetStatesSuccess,
|
|
1972
2090
|
onGetStatesError = _ref.onGetStatesError;
|
|
2091
|
+
var prevCountry = useRef(values.country);
|
|
1973
2092
|
useEffect(function () {
|
|
1974
2093
|
var fetchStates = /*#__PURE__*/function () {
|
|
1975
2094
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
1976
|
-
var _mappedStates$0$value, _mappedStates
|
|
2095
|
+
var res, mappedStates, _mappedStates$0$value, _mappedStates$;
|
|
1977
2096
|
|
|
1978
2097
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1979
2098
|
while (1) {
|
|
@@ -1992,7 +2111,12 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
1992
2111
|
};
|
|
1993
2112
|
});
|
|
1994
2113
|
setStates(mappedStates);
|
|
1995
|
-
|
|
2114
|
+
|
|
2115
|
+
if (prevCountry.current !== values.country) {
|
|
2116
|
+
setFieldValue('state', (_mappedStates$0$value = (_mappedStates$ = mappedStates[0]) == null ? void 0 : _mappedStates$.value) != null ? _mappedStates$0$value : '');
|
|
2117
|
+
prevCountry.current = values.country;
|
|
2118
|
+
}
|
|
2119
|
+
|
|
1996
2120
|
onGetStatesSuccess(res.data);
|
|
1997
2121
|
_context.next = 13;
|
|
1998
2122
|
break;
|
|
@@ -2030,13 +2154,13 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2030
2154
|
var parsedData = JSON.parse(userDataEncoded);
|
|
2031
2155
|
var mappedValues = {
|
|
2032
2156
|
firstName: (parsedData == null ? void 0 : parsedData.first_name) || '',
|
|
2033
|
-
lastName: parsedData == null ? void 0 : parsedData.last_name,
|
|
2157
|
+
lastName: (parsedData == null ? void 0 : parsedData.last_name) || '',
|
|
2034
2158
|
email: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
2035
2159
|
phone: (parsedData == null ? void 0 : parsedData.phone) || '',
|
|
2036
2160
|
confirmEmail: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
2037
2161
|
state: (parsedData == null ? void 0 : parsedData.state) || '',
|
|
2038
2162
|
street_address: (parsedData == null ? void 0 : parsedData.street_address) || '',
|
|
2039
|
-
country: (parsedData == null ? void 0 : parsedData.country) || 1,
|
|
2163
|
+
country: (parsedData == null ? void 0 : parsedData.country) || "1",
|
|
2040
2164
|
zip: (parsedData == null ? void 0 : parsedData.zip) || '',
|
|
2041
2165
|
brand_opt_in: (parsedData == null ? void 0 : parsedData.brand_opt_in) || '',
|
|
2042
2166
|
city: (parsedData == null ? void 0 : parsedData.city) || '',
|
|
@@ -2107,15 +2231,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2107
2231
|
pIsLoggedIn = _ref3$isLoggedIn === void 0 ? false : _ref3$isLoggedIn,
|
|
2108
2232
|
_ref3$accountInfoTitl = _ref3.accountInfoTitle,
|
|
2109
2233
|
accountInfoTitle = _ref3$accountInfoTitl === void 0 ? '' : _ref3$accountInfoTitl,
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
var themeMui = createTheme(
|
|
2113
|
-
typography: {
|
|
2114
|
-
allVariants: {
|
|
2115
|
-
fontFamily: fontFamily
|
|
2116
|
-
}
|
|
2117
|
-
}
|
|
2118
|
-
});
|
|
2234
|
+
hideLogo = _ref3.hideLogo,
|
|
2235
|
+
themeOptions = _ref3.themeOptions;
|
|
2236
|
+
var themeMui = createTheme(themeOptions);
|
|
2119
2237
|
var isWindowDefined = typeof window !== 'undefined';
|
|
2120
2238
|
var userData = isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
2121
2239
|
var access_token = isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
@@ -2241,7 +2359,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2241
2359
|
setCountries(_map(_get(res, 'data.data'), function (item, key) {
|
|
2242
2360
|
return {
|
|
2243
2361
|
label: item,
|
|
2244
|
-
value:
|
|
2362
|
+
value: key
|
|
2245
2363
|
};
|
|
2246
2364
|
}));
|
|
2247
2365
|
onGetCountriesSuccess(res.data);
|
|
@@ -2341,7 +2459,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2341
2459
|
userDataResponse = _context4.sent;
|
|
2342
2460
|
profileSpecifiedData = _get(userDataResponse, 'data.data');
|
|
2343
2461
|
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
2344
|
-
setUserValues(profileDataObj
|
|
2462
|
+
setUserValues(_extends({}, profileDataObj, {
|
|
2463
|
+
firstName: profileDataObj.first_name,
|
|
2464
|
+
lastName: profileDataObj.last_name
|
|
2465
|
+
}));
|
|
2345
2466
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
2346
2467
|
onGetProfileDataSuccess(userDataResponse.data);
|
|
2347
2468
|
|
|
@@ -2377,9 +2498,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2377
2498
|
theme: themeMui
|
|
2378
2499
|
}, React.createElement(Formik, {
|
|
2379
2500
|
initialValues: getInitialValues(dataWithUniqueIds, _extends({}, initialValues, {
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
country: 1,
|
|
2501
|
+
country: _get(userData, 'country', '') || "1",
|
|
2502
|
+
state: _get(userData, 'state', '') || "1",
|
|
2383
2503
|
brand_opt_in: optedInFieldValue
|
|
2384
2504
|
}), userValues),
|
|
2385
2505
|
enableReinitialize: true,
|
|
@@ -2643,17 +2763,14 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2643
2763
|
}));
|
|
2644
2764
|
})), React.createElement("div", {
|
|
2645
2765
|
className: "button-container"
|
|
2646
|
-
}, React.createElement(
|
|
2766
|
+
}, React.createElement(Button, {
|
|
2647
2767
|
type: "submit",
|
|
2648
2768
|
variant: "contained",
|
|
2649
2769
|
className: "login-register-button",
|
|
2650
|
-
loadingIndicator: React.createElement(CircularProgress, {
|
|
2651
|
-
color: "inherit",
|
|
2652
|
-
size: 26
|
|
2653
|
-
}),
|
|
2654
|
-
loading: props.isSubmitting,
|
|
2655
2770
|
disabled: props.isSubmitting
|
|
2656
|
-
},
|
|
2771
|
+
}, props.isSubmitting ? React.createElement(CircularProgress, {
|
|
2772
|
+
size: 26
|
|
2773
|
+
}) : buttonName))));
|
|
2657
2774
|
}), showModalLogin && React.createElement(LoginModal, {
|
|
2658
2775
|
onClose: function onClose() {
|
|
2659
2776
|
setShowModalLogin(false);
|
|
@@ -2900,7 +3017,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2900
3017
|
}, React.createElement("span", {
|
|
2901
3018
|
className: "card_label_text"
|
|
2902
3019
|
}, "Card number"), React.createElement(CardNumberElement, {
|
|
2903
|
-
options: _extends({}, options
|
|
3020
|
+
options: _extends({}, options, stripeCardOptions),
|
|
2904
3021
|
onReady: _identity,
|
|
2905
3022
|
onChange: _identity,
|
|
2906
3023
|
onBlur: _identity,
|
|
@@ -2910,13 +3027,13 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2910
3027
|
}, React.createElement("span", {
|
|
2911
3028
|
className: "card_label_text"
|
|
2912
3029
|
}, "Expiration date"), React.createElement(CardExpiryElement, {
|
|
2913
|
-
options: _extends({}, options
|
|
3030
|
+
options: _extends({}, options, stripeCardOptions)
|
|
2914
3031
|
})), React.createElement("label", {
|
|
2915
3032
|
className: "cvc_element"
|
|
2916
3033
|
}, React.createElement("span", {
|
|
2917
3034
|
className: "card_label_text"
|
|
2918
3035
|
}, "CVC"), React.createElement(CardCvcElement, {
|
|
2919
|
-
options: _extends({}, options
|
|
3036
|
+
options: _extends({}, options, stripeCardOptions)
|
|
2920
3037
|
})), !disableZipSection && React.createElement("label", {
|
|
2921
3038
|
className: "zip_element"
|
|
2922
3039
|
}, React.createElement("p", {
|
|
@@ -2944,7 +3061,9 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2944
3061
|
}, React.createElement("button", {
|
|
2945
3062
|
disabled: buttonIsDiabled,
|
|
2946
3063
|
type: "submit"
|
|
2947
|
-
}, isLoading ? React.createElement(CircularProgress$1,
|
|
3064
|
+
}, isLoading ? React.createElement(CircularProgress$1, {
|
|
3065
|
+
size: 26
|
|
3066
|
+
}) : "Pay " + getCurrencySymbolByCurrency(currency) + total))));
|
|
2948
3067
|
};
|
|
2949
3068
|
|
|
2950
3069
|
var publishableKey = CONFIGS.STRIPE_PUBLISHABLE_KEY || '';
|
|
@@ -3006,7 +3125,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3006
3125
|
stripeCardOptions = _ref$stripeCardOption === void 0 ? {} : _ref$stripeCardOption,
|
|
3007
3126
|
_ref$disableZipSectio = _ref.disableZipSection,
|
|
3008
3127
|
disableZipSection = _ref$disableZipSectio === void 0 ? false : _ref$disableZipSectio,
|
|
3009
|
-
|
|
3128
|
+
themeOptions = _ref.themeOptions,
|
|
3129
|
+
elementsOptions = _ref.elementsOptions;
|
|
3010
3130
|
|
|
3011
3131
|
var _useState = useState(initialReviewValues),
|
|
3012
3132
|
reviewData = _useState[0],
|
|
@@ -3190,13 +3310,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3190
3310
|
};
|
|
3191
3311
|
}();
|
|
3192
3312
|
|
|
3193
|
-
var themeMui = createTheme(
|
|
3194
|
-
typography: {
|
|
3195
|
-
allVariants: {
|
|
3196
|
-
fontFamily: fontFamily
|
|
3197
|
-
}
|
|
3198
|
-
}
|
|
3199
|
-
});
|
|
3313
|
+
var themeMui = createTheme(themeOptions);
|
|
3200
3314
|
return React.createElement(ThemeProvider, {
|
|
3201
3315
|
theme: themeMui
|
|
3202
3316
|
}, React.createElement("div", {
|
|
@@ -3233,7 +3347,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3233
3347
|
}, "Please provide your payment information"), showErrorText && React.createElement("p", {
|
|
3234
3348
|
className: "payment_info__error"
|
|
3235
3349
|
}, errorText), React.createElement("div", null, React.createElement(Elements, {
|
|
3236
|
-
stripe: getStripePromise(reviewData)
|
|
3350
|
+
stripe: getStripePromise(reviewData),
|
|
3351
|
+
options: elementsOptions
|
|
3237
3352
|
}, React.createElement(CheckoutForm, {
|
|
3238
3353
|
stripe_client_secret: _get(reviewData, 'payment_method.stripe_client_secret'),
|
|
3239
3354
|
total: orderData.total,
|
|
@@ -3716,12 +3831,14 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
3716
3831
|
style: {
|
|
3717
3832
|
minWidth: 55
|
|
3718
3833
|
}
|
|
3719
|
-
}, React.createElement(TicketRow, {
|
|
3834
|
+
}, ticket.salesStarted ? React.createElement(TicketRow, {
|
|
3720
3835
|
ticketTier: ticket,
|
|
3721
3836
|
prevTicketTier: arr[i - 1],
|
|
3722
3837
|
selectedTickets: selectedTickets,
|
|
3723
3838
|
handleTicketSelect: ticketSelect
|
|
3724
|
-
})
|
|
3839
|
+
}) : React.createElement("p", {
|
|
3840
|
+
className: 'ticket-not-started-message'
|
|
3841
|
+
}, "Sales not started"))));
|
|
3725
3842
|
}));
|
|
3726
3843
|
};
|
|
3727
3844
|
|
|
@@ -3741,8 +3858,7 @@ var generateQuantity = function generateQuantity(n) {
|
|
|
3741
3858
|
var WaitingList = function WaitingList(_ref) {
|
|
3742
3859
|
var _ref$tickets = _ref.tickets,
|
|
3743
3860
|
tickets = _ref$tickets === void 0 ? {} : _ref$tickets,
|
|
3744
|
-
eventId = _ref.eventId
|
|
3745
|
-
isPromotionsEnabled = _ref.isPromotionsEnabled;
|
|
3861
|
+
eventId = _ref.eventId;
|
|
3746
3862
|
|
|
3747
3863
|
var _useState = useState(false),
|
|
3748
3864
|
showSuccessMessage = _useState[0],
|
|
@@ -3817,9 +3933,7 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
3817
3933
|
className: "success-message"
|
|
3818
3934
|
}, React.createElement("p", {
|
|
3819
3935
|
className: "added-success-message"
|
|
3820
|
-
}, "You've been added to the waiting list!"), React.createElement("p", null, "You'll be notified if tickets become available.")) : React.createElement(React.Fragment, null,
|
|
3821
|
-
className: "no-tickets-text"
|
|
3822
|
-
}, "No tickets are currently available for this event."), React.createElement("h2", null, "WAITING LIST"), React.createElement(Formik, {
|
|
3936
|
+
}, "You've been added to the waiting list!"), React.createElement("p", null, "You'll be notified if tickets become available.")) : React.createElement(React.Fragment, null, React.createElement("h2", null, "WAITING LIST"), React.createElement(Formik, {
|
|
3823
3937
|
initialValues: {
|
|
3824
3938
|
ticketTypeId: '',
|
|
3825
3939
|
quantity: '',
|
|
@@ -3925,10 +4039,12 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
3925
4039
|
preProcessor: function preProcessor(code) {
|
|
3926
4040
|
return code.replace(/fill=".*?"/g, 'fill="currentColor"');
|
|
3927
4041
|
}
|
|
3928
|
-
}), React.createElement("p",
|
|
4042
|
+
}), React.createElement("p", {
|
|
4043
|
+
className: "promo-code-success"
|
|
4044
|
+
}, "PROMO CODE APPLIED SUCCESSFULLY")) : null, showPromoInput && React.createElement("div", {
|
|
3929
4045
|
className: "promo-code-block"
|
|
3930
|
-
}, React.createElement("input", {
|
|
3931
|
-
placeholder: "
|
|
4046
|
+
}, React.createElement("label", null, "PROMO CODE"), React.createElement("input", {
|
|
4047
|
+
placeholder: "",
|
|
3932
4048
|
onChange: function onChange(e) {
|
|
3933
4049
|
setPromoCode(e.target.value);
|
|
3934
4050
|
},
|
|
@@ -3954,6 +4070,84 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
3954
4070
|
}, "Got a promo code? Click here") : null);
|
|
3955
4071
|
};
|
|
3956
4072
|
|
|
4073
|
+
var isTimeExpired = function isTimeExpired(startDate, timezone) {
|
|
4074
|
+
return !moment(startDate).isAfter(moment.tz(moment(), timezone).format('YYYY-MM-DD HH:mm:ss'));
|
|
4075
|
+
};
|
|
4076
|
+
|
|
4077
|
+
function Countdown(_ref) {
|
|
4078
|
+
var startDate = _ref.startDate,
|
|
4079
|
+
_ref$timezone = _ref.timezone,
|
|
4080
|
+
timezone = _ref$timezone === void 0 ? moment.tz.guess() : _ref$timezone,
|
|
4081
|
+
_ref$title = _ref.title,
|
|
4082
|
+
title = _ref$title === void 0 ? '' : _ref$title,
|
|
4083
|
+
_ref$message = _ref.message,
|
|
4084
|
+
message = _ref$message === void 0 ? '' : _ref$message,
|
|
4085
|
+
_ref$callback = _ref.callback,
|
|
4086
|
+
callback = _ref$callback === void 0 ? function () {} : _ref$callback;
|
|
4087
|
+
|
|
4088
|
+
var _useState = useState(''),
|
|
4089
|
+
duration = _useState[0],
|
|
4090
|
+
setDuration = _useState[1];
|
|
4091
|
+
|
|
4092
|
+
var _useState2 = useState(false),
|
|
4093
|
+
timeExpired = _useState2[0],
|
|
4094
|
+
setTimeExpired = _useState2[1];
|
|
4095
|
+
|
|
4096
|
+
useEffect(function () {
|
|
4097
|
+
setTimeExpired(isTimeExpired(startDate, timezone));
|
|
4098
|
+
}, []);
|
|
4099
|
+
useEffect(function () {
|
|
4100
|
+
var timer;
|
|
4101
|
+
|
|
4102
|
+
if (!timeExpired) {
|
|
4103
|
+
timer = setInterval(function () {
|
|
4104
|
+
if (isTimeExpired(startDate, timezone)) {
|
|
4105
|
+
clearInterval(timer);
|
|
4106
|
+
setTimeExpired(true);
|
|
4107
|
+
callback();
|
|
4108
|
+
}
|
|
4109
|
+
|
|
4110
|
+
var currentDate = moment.tz(moment(), timezone).format('YYYY-MM-DD HH:mm:ss');
|
|
4111
|
+
var diffTime = moment(startDate).diff(currentDate);
|
|
4112
|
+
var duration = moment.duration(diffTime);
|
|
4113
|
+
var dateArr = {
|
|
4114
|
+
year: duration.years(),
|
|
4115
|
+
month: duration.months(),
|
|
4116
|
+
day: duration.days(),
|
|
4117
|
+
hour: duration.hours(),
|
|
4118
|
+
minute: duration.minutes(),
|
|
4119
|
+
second: duration.seconds()
|
|
4120
|
+
};
|
|
4121
|
+
var timeLeft = '';
|
|
4122
|
+
|
|
4123
|
+
for (var date in dateArr) {
|
|
4124
|
+
var unit = dateArr[date] === 1 ? date : date + 's';
|
|
4125
|
+
var val = String(dateArr[date]).length === 1 ? '0' + dateArr[date] : dateArr[date];
|
|
4126
|
+
|
|
4127
|
+
if (timeLeft) {
|
|
4128
|
+
timeLeft += ", " + val + " " + unit;
|
|
4129
|
+
} else if (dateArr[date]) {
|
|
4130
|
+
timeLeft += val + " " + unit;
|
|
4131
|
+
}
|
|
4132
|
+
}
|
|
4133
|
+
|
|
4134
|
+
setDuration(timeLeft);
|
|
4135
|
+
}, 1000);
|
|
4136
|
+
}
|
|
4137
|
+
|
|
4138
|
+
return function () {
|
|
4139
|
+
clearInterval(timer);
|
|
4140
|
+
};
|
|
4141
|
+
}, [timeExpired]);
|
|
4142
|
+
return React.createElement(React.Fragment, null, !timeExpired && duration && React.createElement("div", {
|
|
4143
|
+
className: 'countdown'
|
|
4144
|
+
}, React.createElement("div", null, React.createElement("p", {
|
|
4145
|
+
className: 'title'
|
|
4146
|
+
}, title), React.createElement("p", null, duration)), React.createElement("p", {
|
|
4147
|
+
className: 'message'
|
|
4148
|
+
}, message)));
|
|
4149
|
+
}
|
|
4150
|
+
|
|
3957
4151
|
function Loader$1() {
|
|
3958
4152
|
return React.createElement("div", {
|
|
3959
4153
|
className: "loader-container"
|
|
@@ -3961,7 +4155,8 @@ function Loader$1() {
|
|
|
3961
4155
|
}
|
|
3962
4156
|
|
|
3963
4157
|
var TicketsContainer = function TicketsContainer(_ref) {
|
|
3964
|
-
var
|
|
4158
|
+
var onLoginSuccess = _ref.onLoginSuccess,
|
|
4159
|
+
getTicketsLabel = _ref.getTicketsLabel,
|
|
3965
4160
|
eventId = _ref.eventId,
|
|
3966
4161
|
onAddToCartSuccess = _ref.onAddToCartSuccess,
|
|
3967
4162
|
_ref$contentStyle = _ref.contentStyle,
|
|
@@ -3977,43 +4172,58 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3977
4172
|
_ref$queryPromoCode = _ref.queryPromoCode,
|
|
3978
4173
|
queryPromoCode = _ref$queryPromoCode === void 0 ? '' : _ref$queryPromoCode,
|
|
3979
4174
|
_ref$isPromotionsEnab = _ref.isPromotionsEnabled,
|
|
3980
|
-
isPromotionsEnabled = _ref$isPromotionsEnab === void 0 ? true : _ref$isPromotionsEnab
|
|
4175
|
+
isPromotionsEnabled = _ref$isPromotionsEnab === void 0 ? true : _ref$isPromotionsEnab,
|
|
4176
|
+
themeOptions = _ref.themeOptions;
|
|
3981
4177
|
|
|
3982
4178
|
var _useState = useState({}),
|
|
3983
4179
|
selectedTickets = _useState[0],
|
|
3984
4180
|
setSelectedTickets = _useState[1];
|
|
3985
4181
|
|
|
3986
|
-
var
|
|
3987
|
-
tickets = _useState2[0],
|
|
3988
|
-
setTickets = _useState2[1];
|
|
4182
|
+
var isWindowDefined = typeof window !== 'undefined';
|
|
3989
4183
|
|
|
3990
|
-
var
|
|
3991
|
-
|
|
3992
|
-
|
|
4184
|
+
var _useState2 = useState(isWindowDefined ? !!window.localStorage.getItem('access_token') : false),
|
|
4185
|
+
isLogged = _useState2[0],
|
|
4186
|
+
setIsLogged = _useState2[1];
|
|
3993
4187
|
|
|
3994
|
-
var
|
|
3995
|
-
|
|
3996
|
-
|
|
4188
|
+
var _React$useState = React.useState(false),
|
|
4189
|
+
showLoginModal = _React$useState[0],
|
|
4190
|
+
setShowLoginModal = _React$useState[1];
|
|
4191
|
+
|
|
4192
|
+
var _useState3 = useState([]),
|
|
4193
|
+
tickets = _useState3[0],
|
|
4194
|
+
setTickets = _useState3[1];
|
|
4195
|
+
|
|
4196
|
+
var _useState4 = useState(null),
|
|
4197
|
+
event = _useState4[0],
|
|
4198
|
+
setEvent = _useState4[1];
|
|
3997
4199
|
|
|
3998
4200
|
var _useState5 = useState(false),
|
|
3999
|
-
|
|
4000
|
-
|
|
4201
|
+
showWaitingList = _useState5[0],
|
|
4202
|
+
setShowWaitingList = _useState5[1];
|
|
4203
|
+
|
|
4204
|
+
var _useState6 = useState(false),
|
|
4205
|
+
isLoading = _useState6[0],
|
|
4206
|
+
setIsLoading = _useState6[1];
|
|
4001
4207
|
|
|
4002
|
-
var
|
|
4003
|
-
|
|
4004
|
-
|
|
4208
|
+
var _useState7 = useState(false),
|
|
4209
|
+
handleBookIsLoading = _useState7[0],
|
|
4210
|
+
setHandleBookIsLoading = _useState7[1];
|
|
4005
4211
|
|
|
4006
|
-
var
|
|
4007
|
-
|
|
4008
|
-
|
|
4212
|
+
var _useState8 = useState(''),
|
|
4213
|
+
promoCode = _useState8[0],
|
|
4214
|
+
setPromoCode = _useState8[1];
|
|
4009
4215
|
|
|
4010
|
-
var
|
|
4011
|
-
|
|
4012
|
-
|
|
4216
|
+
var _useState9 = useState(queryPromoCode),
|
|
4217
|
+
promoCodeUpdated = _useState9[0],
|
|
4218
|
+
setPromoCodeUpdated = _useState9[1];
|
|
4013
4219
|
|
|
4014
|
-
var
|
|
4015
|
-
|
|
4016
|
-
|
|
4220
|
+
var _useState10 = useState(false),
|
|
4221
|
+
showPromoInput = _useState10[0],
|
|
4222
|
+
setShowPromoInput = _useState10[1];
|
|
4223
|
+
|
|
4224
|
+
var _useState11 = useState(false),
|
|
4225
|
+
promoCodeIsApplied = _useState11[0],
|
|
4226
|
+
setPromoCodeIsApplied = _useState11[1];
|
|
4017
4227
|
|
|
4018
4228
|
useEffect(function () {
|
|
4019
4229
|
if (typeof window !== 'undefined') {
|
|
@@ -4030,62 +4240,102 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4030
4240
|
}
|
|
4031
4241
|
}, []);
|
|
4032
4242
|
useEffect(function () {
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
}
|
|
4243
|
+
getTicketsApi();
|
|
4244
|
+
}, [eventId, promoCodeUpdated]);
|
|
4036
4245
|
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
switch (_context.prev = _context.next) {
|
|
4043
|
-
case 0:
|
|
4044
|
-
_context.prev = 0;
|
|
4045
|
-
setIsLoading(true);
|
|
4046
|
-
_context.next = 4;
|
|
4047
|
-
return getTickets(eventId, promoCodeUpdated);
|
|
4048
|
-
|
|
4049
|
-
case 4:
|
|
4050
|
-
response = _context.sent;
|
|
4051
|
-
|
|
4052
|
-
if (response.data.success) {
|
|
4053
|
-
setCustomHeader(response);
|
|
4054
|
-
attributes = _get(response, 'data.data.attributes');
|
|
4055
|
-
setPromoCodeIsApplied(attributes.ValidPromoCode);
|
|
4056
|
-
setTickets(_get(attributes, 'tickets'));
|
|
4057
|
-
setShowWaitingList(attributes.showWaitingList);
|
|
4058
|
-
onGetTicketsSuccess(response.data);
|
|
4059
|
-
}
|
|
4246
|
+
var handleLogout = function handleLogout() {
|
|
4247
|
+
if (isWindowDefined) {
|
|
4248
|
+
window.localStorage.removeItem('access_token');
|
|
4249
|
+
window.localStorage.removeItem('user_data');
|
|
4250
|
+
setIsLogged(false);
|
|
4060
4251
|
|
|
4061
|
-
|
|
4062
|
-
break;
|
|
4252
|
+
var _event = new window.CustomEvent('tf-logout');
|
|
4063
4253
|
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4254
|
+
window.document.dispatchEvent(_event);
|
|
4255
|
+
}
|
|
4256
|
+
};
|
|
4067
4257
|
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4258
|
+
var handleExternalLogin = function handleExternalLogin() {
|
|
4259
|
+
setIsLogged(true);
|
|
4260
|
+
};
|
|
4071
4261
|
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
return _context.finish(11);
|
|
4262
|
+
var handleOnClose = function handleOnClose() {
|
|
4263
|
+
setShowLoginModal(false);
|
|
4264
|
+
};
|
|
4076
4265
|
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
}));
|
|
4084
|
-
return _getTicketsApi.apply(this, arguments);
|
|
4266
|
+
var handleOnLogin = function handleOnLogin() {
|
|
4267
|
+
setShowLoginModal(false);
|
|
4268
|
+
setIsLogged(true);
|
|
4269
|
+
|
|
4270
|
+
if (onLoginSuccess) {
|
|
4271
|
+
onLoginSuccess();
|
|
4085
4272
|
}
|
|
4273
|
+
};
|
|
4086
4274
|
|
|
4087
|
-
|
|
4088
|
-
|
|
4275
|
+
function getTicketsApi() {
|
|
4276
|
+
return _getTicketsApi.apply(this, arguments);
|
|
4277
|
+
}
|
|
4278
|
+
|
|
4279
|
+
function _getTicketsApi() {
|
|
4280
|
+
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
4281
|
+
var response, eventResponse, attributes, _event2;
|
|
4282
|
+
|
|
4283
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
4284
|
+
while (1) {
|
|
4285
|
+
switch (_context2.prev = _context2.next) {
|
|
4286
|
+
case 0:
|
|
4287
|
+
_context2.prev = 0;
|
|
4288
|
+
setIsLoading(true);
|
|
4289
|
+
_context2.next = 4;
|
|
4290
|
+
return getTickets(eventId, promoCodeUpdated);
|
|
4291
|
+
|
|
4292
|
+
case 4:
|
|
4293
|
+
response = _context2.sent;
|
|
4294
|
+
_context2.next = 7;
|
|
4295
|
+
return getEvent(eventId);
|
|
4296
|
+
|
|
4297
|
+
case 7:
|
|
4298
|
+
eventResponse = _context2.sent;
|
|
4299
|
+
|
|
4300
|
+
if (response.data.success) {
|
|
4301
|
+
setCustomHeader(response);
|
|
4302
|
+
attributes = _get(response, 'data.data.attributes');
|
|
4303
|
+
setPromoCodeIsApplied(attributes.ValidPromoCode);
|
|
4304
|
+
setTickets(_get(attributes, 'tickets'));
|
|
4305
|
+
setShowWaitingList(attributes.showWaitingList);
|
|
4306
|
+
onGetTicketsSuccess(response.data);
|
|
4307
|
+
}
|
|
4308
|
+
|
|
4309
|
+
if (eventResponse.data.success) {
|
|
4310
|
+
_event2 = _get(eventResponse, 'data.data.attributes');
|
|
4311
|
+
setEvent(_event2);
|
|
4312
|
+
}
|
|
4313
|
+
|
|
4314
|
+
_context2.next = 15;
|
|
4315
|
+
break;
|
|
4316
|
+
|
|
4317
|
+
case 12:
|
|
4318
|
+
_context2.prev = 12;
|
|
4319
|
+
_context2.t0 = _context2["catch"](0);
|
|
4320
|
+
|
|
4321
|
+
if (axios.isAxiosError(_context2.t0)) {
|
|
4322
|
+
onGetTicketsError(_context2.t0);
|
|
4323
|
+
}
|
|
4324
|
+
|
|
4325
|
+
case 15:
|
|
4326
|
+
_context2.prev = 15;
|
|
4327
|
+
setIsLoading(false);
|
|
4328
|
+
return _context2.finish(15);
|
|
4329
|
+
|
|
4330
|
+
case 18:
|
|
4331
|
+
case "end":
|
|
4332
|
+
return _context2.stop();
|
|
4333
|
+
}
|
|
4334
|
+
}
|
|
4335
|
+
}, _callee2, null, [[0, 12, 15, 18]]);
|
|
4336
|
+
}));
|
|
4337
|
+
return _getTicketsApi.apply(this, arguments);
|
|
4338
|
+
}
|
|
4089
4339
|
|
|
4090
4340
|
var handleTicketSelect = function handleTicketSelect(key, value) {
|
|
4091
4341
|
setSelectedTickets(function (prevState) {
|
|
@@ -4099,15 +4349,21 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4099
4349
|
});
|
|
4100
4350
|
};
|
|
4101
4351
|
|
|
4352
|
+
var handleOrdersClick = function handleOrdersClick() {
|
|
4353
|
+
if (isWindowDefined) {
|
|
4354
|
+
window.location.href = '/orders';
|
|
4355
|
+
}
|
|
4356
|
+
};
|
|
4357
|
+
|
|
4102
4358
|
var handleBook = /*#__PURE__*/function () {
|
|
4103
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4359
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
4104
4360
|
var _product_options, _product_options2, _ticket_types;
|
|
4105
4361
|
|
|
4106
|
-
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;
|
|
4362
|
+
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, skipBillingPage, nameIsRequired, ageIsRequired, hash, _isWindowDefined, userData, access_token, ticketsQuantity, checkoutBody, checkoutResult;
|
|
4107
4363
|
|
|
4108
|
-
return runtime_1.wrap(function
|
|
4364
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
4109
4365
|
while (1) {
|
|
4110
|
-
switch (
|
|
4366
|
+
switch (_context.prev = _context.next) {
|
|
4111
4367
|
case 0:
|
|
4112
4368
|
setHandleBookIsLoading(true);
|
|
4113
4369
|
ticket = _find(tickets, function (item) {
|
|
@@ -4128,45 +4384,74 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4128
4384
|
}, _ticket_types)
|
|
4129
4385
|
}
|
|
4130
4386
|
};
|
|
4131
|
-
|
|
4132
|
-
|
|
4387
|
+
_context.prev = 6;
|
|
4388
|
+
_context.next = 9;
|
|
4133
4389
|
return addToCart(eventId, data);
|
|
4134
4390
|
|
|
4135
4391
|
case 9:
|
|
4136
|
-
result =
|
|
4137
|
-
|
|
4138
|
-
if (result.status === 200) {
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
skip_billing_page: (_result$data$data$att = result == null ? void 0 : (_result$data = result.data) == null ? void 0 : (_result$data$data = _result$data.data) == null ? void 0 : (_result$data$data$att2 = _result$data$data.attributes) == null ? void 0 : _result$data$data$att2.skip_billing_page) != null ? _result$data$data$att : false,
|
|
4142
|
-
names_required: (_result$data$data$att3 = result == null ? void 0 : (_result$data2 = result.data) == null ? void 0 : (_result$data2$data = _result$data2.data) == null ? void 0 : (_result$data2$data$at = _result$data2$data.attributes) == null ? void 0 : _result$data2$data$at.names_required) != null ? _result$data$data$att3 : false,
|
|
4143
|
-
age_required: (_result$data$data$att4 = result == null ? void 0 : (_result$data3 = result.data) == null ? void 0 : (_result$data3$data = _result$data3.data) == null ? void 0 : (_result$data3$data$at = _result$data3$data.attributes) == null ? void 0 : _result$data3$data$at.age_required) != null ? _result$data$data$att4 : false,
|
|
4144
|
-
event_id: String(eventId)
|
|
4145
|
-
});
|
|
4392
|
+
result = _context.sent;
|
|
4393
|
+
|
|
4394
|
+
if (!(result.status === 200)) {
|
|
4395
|
+
_context.next = 27;
|
|
4396
|
+
break;
|
|
4146
4397
|
}
|
|
4147
4398
|
|
|
4148
|
-
|
|
4399
|
+
setCustomHeader(result);
|
|
4400
|
+
skipBillingPage = (_result$data$data$att = result == null ? void 0 : (_result$data = result.data) == null ? void 0 : (_result$data$data = _result$data.data) == null ? void 0 : (_result$data$data$att2 = _result$data$data.attributes) == null ? void 0 : _result$data$data$att2.skip_billing_page) != null ? _result$data$data$att : false;
|
|
4401
|
+
nameIsRequired = (_result$data$data$att3 = result == null ? void 0 : (_result$data2 = result.data) == null ? void 0 : (_result$data2$data = _result$data2.data) == null ? void 0 : (_result$data2$data$at = _result$data2$data.attributes) == null ? void 0 : _result$data2$data$at.names_required) != null ? _result$data$data$att3 : false;
|
|
4402
|
+
ageIsRequired = (_result$data$data$att4 = result == null ? void 0 : (_result$data3 = result.data) == null ? void 0 : (_result$data3$data = _result$data3.data) == null ? void 0 : (_result$data3$data$at = _result$data3$data.attributes) == null ? void 0 : _result$data3$data$at.age_required) != null ? _result$data$data$att4 : false;
|
|
4403
|
+
hash = '';
|
|
4404
|
+
|
|
4405
|
+
if (!skipBillingPage) {
|
|
4406
|
+
_context.next = 26;
|
|
4407
|
+
break;
|
|
4408
|
+
}
|
|
4409
|
+
|
|
4410
|
+
// Get user data for checkout data
|
|
4411
|
+
_isWindowDefined = typeof window !== 'undefined';
|
|
4412
|
+
userData = _isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
4413
|
+
access_token = _isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
4414
|
+
ticketsQuantity = Object.keys(selectedTickets).length;
|
|
4415
|
+
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity, userData);
|
|
4416
|
+
_context.next = 24;
|
|
4417
|
+
return postOnCheckout(checkoutBody, access_token);
|
|
4418
|
+
|
|
4419
|
+
case 24:
|
|
4420
|
+
checkoutResult = _context.sent;
|
|
4421
|
+
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
4422
|
+
|
|
4423
|
+
case 26:
|
|
4424
|
+
onAddToCartSuccess({
|
|
4425
|
+
skip_billing_page: skipBillingPage,
|
|
4426
|
+
names_required: nameIsRequired,
|
|
4427
|
+
age_required: ageIsRequired,
|
|
4428
|
+
event_id: String(eventId),
|
|
4429
|
+
hash: hash
|
|
4430
|
+
});
|
|
4431
|
+
|
|
4432
|
+
case 27:
|
|
4433
|
+
_context.next = 32;
|
|
4149
4434
|
break;
|
|
4150
4435
|
|
|
4151
|
-
case
|
|
4152
|
-
|
|
4153
|
-
|
|
4436
|
+
case 29:
|
|
4437
|
+
_context.prev = 29;
|
|
4438
|
+
_context.t0 = _context["catch"](6);
|
|
4154
4439
|
|
|
4155
|
-
if (axios.isAxiosError(
|
|
4156
|
-
onAddToCartError(
|
|
4440
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
4441
|
+
onAddToCartError(_context.t0);
|
|
4157
4442
|
}
|
|
4158
4443
|
|
|
4159
|
-
case
|
|
4160
|
-
|
|
4444
|
+
case 32:
|
|
4445
|
+
_context.prev = 32;
|
|
4161
4446
|
setHandleBookIsLoading(false);
|
|
4162
|
-
return
|
|
4447
|
+
return _context.finish(32);
|
|
4163
4448
|
|
|
4164
|
-
case
|
|
4449
|
+
case 35:
|
|
4165
4450
|
case "end":
|
|
4166
|
-
return
|
|
4451
|
+
return _context.stop();
|
|
4167
4452
|
}
|
|
4168
4453
|
}
|
|
4169
|
-
},
|
|
4454
|
+
}, _callee, null, [[6, 29, 32, 35]]);
|
|
4170
4455
|
}));
|
|
4171
4456
|
|
|
4172
4457
|
return function handleBook() {
|
|
@@ -4174,10 +4459,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4174
4459
|
};
|
|
4175
4460
|
}();
|
|
4176
4461
|
|
|
4462
|
+
var updateTickets = function updateTickets() {
|
|
4463
|
+
getTicketsApi();
|
|
4464
|
+
};
|
|
4465
|
+
|
|
4177
4466
|
var isAllTicketsSoldOut = !_some(tickets, function (item) {
|
|
4178
4467
|
return !(item.sold_out || item.soldOut);
|
|
4179
4468
|
});
|
|
4180
|
-
|
|
4469
|
+
var themeMui = createTheme$1(themeOptions);
|
|
4470
|
+
useEffect(function () {
|
|
4471
|
+
isWindowDefined && window.document.addEventListener('custom-logout', handleLogout);
|
|
4472
|
+
return function () {
|
|
4473
|
+
isWindowDefined && window.document.removeEventListener('custom-logout', handleLogout);
|
|
4474
|
+
};
|
|
4475
|
+
}, []);
|
|
4476
|
+
useEffect(function () {
|
|
4477
|
+
isWindowDefined && window.document.addEventListener('custom-login', handleExternalLogin);
|
|
4478
|
+
return function () {
|
|
4479
|
+
isWindowDefined && window.document.removeEventListener('custom-login', handleExternalLogin);
|
|
4480
|
+
};
|
|
4481
|
+
}, []);
|
|
4482
|
+
return React.createElement(ThemeProvider$1, {
|
|
4483
|
+
theme: themeMui
|
|
4484
|
+
}, React.createElement("div", {
|
|
4181
4485
|
className: "get-tickets-page " + theme,
|
|
4182
4486
|
style: contentStyle
|
|
4183
4487
|
}, isLoading ? React.createElement(Loader$1, null) : React.createElement("div", null, React.createElement(TicketsSection, {
|
|
@@ -4185,10 +4489,15 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4185
4489
|
selectedTickets: selectedTickets,
|
|
4186
4490
|
handleTicketSelect: handleTicketSelect,
|
|
4187
4491
|
promoCodeIsApplied: promoCodeIsApplied
|
|
4188
|
-
}),
|
|
4492
|
+
}), event != null && event.salesEnded ? React.createElement("p", null, "Sales for this event are closed.") : event != null && event.salesStart ? React.createElement(Countdown, {
|
|
4493
|
+
startDate: event.salesStart,
|
|
4494
|
+
timezone: event.timezone,
|
|
4495
|
+
title: "Sales start in:",
|
|
4496
|
+
message: "No tickets are currently available for this event.",
|
|
4497
|
+
callback: updateTickets
|
|
4498
|
+
}) : null, showWaitingList && event.salesStarted && React.createElement(WaitingList, {
|
|
4189
4499
|
tickets: tickets,
|
|
4190
|
-
eventId: eventId
|
|
4191
|
-
isPromotionsEnabled: isPromotionsEnabled
|
|
4500
|
+
eventId: eventId
|
|
4192
4501
|
}), React.createElement(PromoCodeSection, {
|
|
4193
4502
|
promoCode: promoCode,
|
|
4194
4503
|
promoCodeIsApplied: promoCodeIsApplied,
|
|
@@ -4202,7 +4511,24 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4202
4511
|
"aria-hidden": true,
|
|
4203
4512
|
className: "book-button " + (handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0 ? 'disabled' : ''),
|
|
4204
4513
|
onClick: !handleBookIsLoading && !_isEmpty(selectedTickets) && Object.values(selectedTickets)[0] > 0 ? handleBook : function () {}
|
|
4205
|
-
}, getTicketsLabel || 'GET TICKETS')
|
|
4514
|
+
}, getTicketsLabel || 'GET TICKETS'), isLogged ? React.createElement("div", {
|
|
4515
|
+
className: "session-wrapper"
|
|
4516
|
+
}, React.createElement("span", {
|
|
4517
|
+
className: "session-container"
|
|
4518
|
+
}, React.createElement(Button$1, {
|
|
4519
|
+
variant: "outline-light",
|
|
4520
|
+
className: "session-buttons",
|
|
4521
|
+
onClick: handleOrdersClick
|
|
4522
|
+
}, "My Orders")), React.createElement("span", {
|
|
4523
|
+
className: "session-container"
|
|
4524
|
+
}, React.createElement(Button$1, {
|
|
4525
|
+
variant: "outline-light",
|
|
4526
|
+
className: "session-buttons",
|
|
4527
|
+
onClick: handleLogout
|
|
4528
|
+
}, "Log out"))) : ''), showLoginModal ? React.createElement(LoginModal, {
|
|
4529
|
+
onClose: handleOnClose,
|
|
4530
|
+
onLogin: handleOnLogin
|
|
4531
|
+
}) : null));
|
|
4206
4532
|
};
|
|
4207
4533
|
|
|
4208
4534
|
var EventInfoItem = function EventInfoItem(_ref) {
|
|
@@ -4410,9 +4736,9 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
4410
4736
|
var _ref$tickets = _ref.tickets,
|
|
4411
4737
|
tickets = _ref$tickets === void 0 ? [] : _ref$tickets;
|
|
4412
4738
|
return React.createElement("div", {
|
|
4413
|
-
className:
|
|
4739
|
+
className: "tickets-box"
|
|
4414
4740
|
}, React.createElement("h4", {
|
|
4415
|
-
className:
|
|
4741
|
+
className: "sub-title"
|
|
4416
4742
|
}, "Your Tickets"), React.createElement(TableContainer, {
|
|
4417
4743
|
component: Paper
|
|
4418
4744
|
}, React.createElement(Table, {
|
|
@@ -4422,14 +4748,16 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
4422
4748
|
|
|
4423
4749
|
return React.createElement(Fragment, {
|
|
4424
4750
|
key: index
|
|
4425
|
-
}, React.createElement(TableRow, null, React.createElement(TableCell, null, ticket.hash), React.createElement(TableCell, null, ticket.ticket_type), React.createElement(TableCell, null, ticket.holder_name), React.createElement(TableCell, null, ticket.status), React.createElement(TableCell, null, React.createElement("
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4751
|
+
}, React.createElement(TableRow, null, React.createElement(TableCell, null, ticket.hash), React.createElement(TableCell, null, ticket.ticket_type), React.createElement(TableCell, null, ticket.holder_name), React.createElement(TableCell, null, ticket.status), React.createElement(TableCell, null, React.createElement("span", {
|
|
4752
|
+
"aria-hidden": true,
|
|
4753
|
+
className: "download-button",
|
|
4754
|
+
onClick: function onClick() {
|
|
4755
|
+
return downloadPDF(ticket.pdf_link);
|
|
4756
|
+
}
|
|
4429
4757
|
}, "Download"))), !!((_ticket$add_ons = ticket.add_ons) != null && _ticket$add_ons.length) && React.createElement(TableRow, null, React.createElement(TableCell, {
|
|
4430
4758
|
colSpan: 5
|
|
4431
4759
|
}, React.createElement(Table, {
|
|
4432
|
-
className:
|
|
4760
|
+
className: "ticket-add-on-table"
|
|
4433
4761
|
}, React.createElement(TableHead, null, React.createElement(TableRow, null, React.createElement(TableCell, null, "Add-On"), React.createElement(TableCell, null, "Status"))), React.createElement(TableBody, null, ticket.add_ons.map(function (add_on, index) {
|
|
4434
4762
|
return React.createElement(TableRow, {
|
|
4435
4763
|
key: index
|