tf-checkout-react 1.6.6-beta.19 → 1.6.6-beta.22
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 +61 -40
- package/dist/api/common.d.ts +1 -1
- package/dist/api/preRegistrationComplete.d.ts +1 -1
- package/dist/components/addonsContainer/index.d.ts +1 -1
- package/dist/components/forgotPasswordModal/index.d.ts +2 -1
- package/dist/components/ticketsContainer/TicketsSection.d.ts +2 -2
- package/dist/components/ticketsContainer/TimeSlotsSection.d.ts +2 -3
- package/dist/components/ticketsContainer/index.d.ts +17 -5
- package/dist/tf-checkout-react.cjs.development.js +241 -178
- 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 +241 -178
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/api/common.ts +14 -4
- package/src/api/preRegistrationComplete.ts +1 -1
- package/src/components/addonsContainer/index.tsx +84 -61
- package/src/components/billing-info-container/index.tsx +87 -75
- package/src/components/forgotPasswordModal/index.tsx +31 -13
- package/src/components/preRegistration/PreRegistrationComplete.tsx +119 -119
- package/src/components/preRegistration/PreRegistrationInformations.tsx +3 -3
- package/src/components/ticketsContainer/PromoCodeSection.tsx +34 -28
- package/src/components/ticketsContainer/TicketsSection.tsx +3 -3
- package/src/components/ticketsContainer/TimeSlotsSection.tsx +120 -104
- package/src/components/ticketsContainer/index.tsx +98 -81
- package/src/types/api/common.d.ts +23 -0
- package/src/types/api/preRegistrationComplete.d.ts +2 -2
- package/src/types/pre-registration-complete.d.ts +1 -1
- package/src/utils/cookies.ts +3 -2
|
@@ -567,6 +567,18 @@ var ErrorFocusInternal = /*#__PURE__*/function (_Component) {
|
|
|
567
567
|
}(React.Component);
|
|
568
568
|
var ErrorFocus = /*#__PURE__*/formik.connect(ErrorFocusInternal);
|
|
569
569
|
|
|
570
|
+
function getDomain(url, subdomain) {
|
|
571
|
+
var updatedUrl = url.replace(/(https?:\/\/)?(www.)?/i, '');
|
|
572
|
+
if (!subdomain) {
|
|
573
|
+
updatedUrl = updatedUrl.split('.');
|
|
574
|
+
updatedUrl = updatedUrl.slice(updatedUrl.length - 2).join('.');
|
|
575
|
+
}
|
|
576
|
+
if (updatedUrl.indexOf('/') !== -1) {
|
|
577
|
+
return updatedUrl.split('/')[0];
|
|
578
|
+
}
|
|
579
|
+
return updatedUrl;
|
|
580
|
+
}
|
|
581
|
+
|
|
570
582
|
function setCustomCookie(name, value, days) {
|
|
571
583
|
if (days === void 0) {
|
|
572
584
|
days = 5;
|
|
@@ -578,7 +590,7 @@ function setCustomCookie(name, value, days) {
|
|
|
578
590
|
expires = '; expires=' + date.toUTCString();
|
|
579
591
|
}
|
|
580
592
|
if (typeof window !== 'undefined') {
|
|
581
|
-
var domain = window.location.hostname;
|
|
593
|
+
var domain = getDomain(window.location.hostname);
|
|
582
594
|
document.cookie = name + '=' + (value || '') + expires + ("; path=/; domain=" + domain);
|
|
583
595
|
}
|
|
584
596
|
}
|
|
@@ -599,7 +611,7 @@ function getCookieByName(cname) {
|
|
|
599
611
|
}
|
|
600
612
|
function deleteCookieByName(name) {
|
|
601
613
|
if (typeof window !== 'undefined') {
|
|
602
|
-
var domain = window.location.hostname;
|
|
614
|
+
var domain = getDomain(window.location.hostname);
|
|
603
615
|
document.cookie = name + '=; Path=/' + ("; domain=" + domain) + '; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
|
604
616
|
}
|
|
605
617
|
}
|
|
@@ -1195,7 +1207,7 @@ var postOnCheckout = /*#__PURE__*/function () {
|
|
|
1195
1207
|
|
|
1196
1208
|
var getEvent = /*#__PURE__*/function () {
|
|
1197
1209
|
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id, pk) {
|
|
1198
|
-
var referralValue, params, referralId, referral_key, _split, referralIdlocal, response;
|
|
1210
|
+
var referralValue, invitationHash, params, referralId, referral_key, _split, referralIdlocal, response;
|
|
1199
1211
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1200
1212
|
while (1) switch (_context.prev = _context.next) {
|
|
1201
1213
|
case 0:
|
|
@@ -1206,11 +1218,13 @@ var getEvent = /*#__PURE__*/function () {
|
|
|
1206
1218
|
referral_key = window.localStorage.getItem('referral_key');
|
|
1207
1219
|
_split = (referral_key || '').split('.'), referralIdlocal = _split[1];
|
|
1208
1220
|
referralValue = referralId || (referralIdlocal != null ? referralIdlocal : '');
|
|
1221
|
+
invitationHash = params.searchParams.get('invitation-hash') || null;
|
|
1209
1222
|
}
|
|
1210
1223
|
_context.next = 4;
|
|
1211
1224
|
return publicRequest.get("v1/event/" + id, {
|
|
1212
1225
|
params: {
|
|
1213
|
-
pk: pk
|
|
1226
|
+
pk: pk,
|
|
1227
|
+
invitationHash: invitationHash
|
|
1214
1228
|
},
|
|
1215
1229
|
headers: _extends({}, publicRequest.defaults.headers.common, {
|
|
1216
1230
|
'Referer-Url': isBrowser ? document.referrer : '',
|
|
@@ -1290,14 +1304,19 @@ var getTickets = /*#__PURE__*/function () {
|
|
|
1290
1304
|
return _ref2.apply(this, arguments);
|
|
1291
1305
|
};
|
|
1292
1306
|
}();
|
|
1293
|
-
var
|
|
1294
|
-
var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(eventId) {
|
|
1307
|
+
var getTimeSlotsByDate = /*#__PURE__*/function () {
|
|
1308
|
+
var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(eventId, date) {
|
|
1295
1309
|
var response;
|
|
1296
1310
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1297
1311
|
while (1) switch (_context3.prev = _context3.next) {
|
|
1298
1312
|
case 0:
|
|
1299
1313
|
_context3.next = 2;
|
|
1300
|
-
return publicRequest.get("/event/" + eventId + "/
|
|
1314
|
+
return publicRequest.get("v1/event/" + eventId + "/timeslots", {
|
|
1315
|
+
params: {
|
|
1316
|
+
date: date,
|
|
1317
|
+
remove_past_slots: true
|
|
1318
|
+
}
|
|
1319
|
+
});
|
|
1301
1320
|
case 2:
|
|
1302
1321
|
response = _context3.sent;
|
|
1303
1322
|
return _context3.abrupt("return", response.data);
|
|
@@ -1307,7 +1326,7 @@ var getTimeSlotsData = /*#__PURE__*/function () {
|
|
|
1307
1326
|
}
|
|
1308
1327
|
}, _callee3);
|
|
1309
1328
|
}));
|
|
1310
|
-
return function
|
|
1329
|
+
return function getTimeSlotsByDate(_x6, _x7) {
|
|
1311
1330
|
return _ref3.apply(this, arguments);
|
|
1312
1331
|
};
|
|
1313
1332
|
}();
|
|
@@ -1349,7 +1368,7 @@ var getStates = /*#__PURE__*/function () {
|
|
|
1349
1368
|
}
|
|
1350
1369
|
}, _callee5);
|
|
1351
1370
|
}));
|
|
1352
|
-
return function getStates(
|
|
1371
|
+
return function getStates(_x8) {
|
|
1353
1372
|
return _ref5.apply(this, arguments);
|
|
1354
1373
|
};
|
|
1355
1374
|
}();
|
|
@@ -1370,7 +1389,7 @@ var sendRSVPInfo = /*#__PURE__*/function () {
|
|
|
1370
1389
|
}
|
|
1371
1390
|
}, _callee6);
|
|
1372
1391
|
}));
|
|
1373
|
-
return function sendRSVPInfo(
|
|
1392
|
+
return function sendRSVPInfo(_x9, _x10) {
|
|
1374
1393
|
return _ref6.apply(this, arguments);
|
|
1375
1394
|
};
|
|
1376
1395
|
}();
|
|
@@ -1393,7 +1412,7 @@ var addToWaitingList = /*#__PURE__*/function () {
|
|
|
1393
1412
|
}
|
|
1394
1413
|
}, _callee7);
|
|
1395
1414
|
}));
|
|
1396
|
-
return function addToWaitingList(
|
|
1415
|
+
return function addToWaitingList(_x11, _x12) {
|
|
1397
1416
|
return _ref7.apply(this, arguments);
|
|
1398
1417
|
};
|
|
1399
1418
|
}();
|
|
@@ -1416,7 +1435,7 @@ var postReferralVisits = /*#__PURE__*/function () {
|
|
|
1416
1435
|
}
|
|
1417
1436
|
}, _callee8);
|
|
1418
1437
|
}));
|
|
1419
|
-
return function postReferralVisits(
|
|
1438
|
+
return function postReferralVisits(_x13, _x14) {
|
|
1420
1439
|
return _ref8.apply(this, arguments);
|
|
1421
1440
|
};
|
|
1422
1441
|
}();
|
|
@@ -1437,7 +1456,7 @@ var validatePhoneNumber = /*#__PURE__*/function () {
|
|
|
1437
1456
|
}
|
|
1438
1457
|
}, _callee9);
|
|
1439
1458
|
}));
|
|
1440
|
-
return function validatePhoneNumber(
|
|
1459
|
+
return function validatePhoneNumber(_x15) {
|
|
1441
1460
|
return _ref9.apply(this, arguments);
|
|
1442
1461
|
};
|
|
1443
1462
|
}();
|
|
@@ -3870,8 +3889,8 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
3870
3889
|
}));
|
|
3871
3890
|
}
|
|
3872
3891
|
var params = new URL("" + window.location).searchParams;
|
|
3873
|
-
var addOnIsIncluded = params.get(
|
|
3874
|
-
var isResale = params.get(
|
|
3892
|
+
var addOnIsIncluded = params.get('include_add_on') === 'true';
|
|
3893
|
+
var isResale = params.get('resale') === 'true';
|
|
3875
3894
|
return React__default.createElement(React__default.Fragment, null, !!cartExpirationTime && enableTimer && !samePage && React__default.createElement(TimerWidget$1, {
|
|
3876
3895
|
expires_at: cartExpirationTime,
|
|
3877
3896
|
onCountdownFinish: function onCountdownFinish() {
|
|
@@ -3949,7 +3968,7 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
3949
3968
|
style: {
|
|
3950
3969
|
marginLeft: 8,
|
|
3951
3970
|
cursor: 'pointer',
|
|
3952
|
-
display:
|
|
3971
|
+
display: 'flex'
|
|
3953
3972
|
},
|
|
3954
3973
|
"data-tooltip-id": "tooltip-" + addon.id,
|
|
3955
3974
|
"data-tooltip-content": "View Add-On info"
|
|
@@ -3958,7 +3977,7 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
3958
3977
|
})), React__default.createElement(reactTooltip.Tooltip, {
|
|
3959
3978
|
id: "tooltip-" + addon.id,
|
|
3960
3979
|
place: "top"
|
|
3961
|
-
}, addon.description ||
|
|
3980
|
+
}, addon.description || 'No description available'))), React__default.createElement("div", {
|
|
3962
3981
|
className: classNamePrefix + "_product_price"
|
|
3963
3982
|
}, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL ? addonNormalizedPrice : addOnNormalizedCost, !isAddonFree && CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && React__default.createElement("span", {
|
|
3964
3983
|
className: classNamePrefix + "_product_fee"
|
|
@@ -4080,18 +4099,24 @@ var Schema = /*#__PURE__*/Yup.object().shape({
|
|
|
4080
4099
|
});
|
|
4081
4100
|
var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
4082
4101
|
var _ref$onClose = _ref.onClose,
|
|
4083
|
-
onClose = _ref$onClose === void 0 ?
|
|
4102
|
+
onClose = _ref$onClose === void 0 ? _identity : _ref$onClose,
|
|
4084
4103
|
_ref$onLoginButtonCli = _ref.onLoginButtonClick,
|
|
4085
|
-
onLoginButtonClick = _ref$onLoginButtonCli === void 0 ?
|
|
4104
|
+
onLoginButtonClick = _ref$onLoginButtonCli === void 0 ? _identity : _ref$onLoginButtonCli,
|
|
4086
4105
|
_ref$onForgotPassword = _ref.onForgotPasswordSuccess,
|
|
4087
|
-
onForgotPasswordSuccess = _ref$onForgotPassword === void 0 ?
|
|
4106
|
+
onForgotPasswordSuccess = _ref$onForgotPassword === void 0 ? _identity : _ref$onForgotPassword,
|
|
4088
4107
|
_ref$onForgotPassword2 = _ref.onForgotPasswordError,
|
|
4089
|
-
onForgotPasswordError = _ref$onForgotPassword2 === void 0 ?
|
|
4108
|
+
onForgotPasswordError = _ref$onForgotPassword2 === void 0 ? _identity : _ref$onForgotPassword2,
|
|
4090
4109
|
_ref$showPoweredByIma = _ref.showPoweredByImage,
|
|
4091
|
-
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma
|
|
4110
|
+
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma,
|
|
4111
|
+
_ref$displaySuccessMe = _ref.displaySuccessMessage,
|
|
4112
|
+
displaySuccessMessage = _ref$displaySuccessMe === void 0 ? false : _ref$displaySuccessMe;
|
|
4092
4113
|
var _useState = React.useState(false),
|
|
4093
4114
|
loading = _useState[0],
|
|
4094
4115
|
setLoading = _useState[1];
|
|
4116
|
+
var _useState2 = React.useState(null),
|
|
4117
|
+
successMessage = _useState2[0],
|
|
4118
|
+
setSuccessMessage = _useState2[1];
|
|
4119
|
+
var showSuccess = displaySuccessMessage && successMessage;
|
|
4095
4120
|
var onForgotPassword = /*#__PURE__*/function () {
|
|
4096
4121
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
|
|
4097
4122
|
var email, _yield$forgotPassword, data;
|
|
@@ -4099,41 +4124,50 @@ var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
|
4099
4124
|
while (1) switch (_context.prev = _context.next) {
|
|
4100
4125
|
case 0:
|
|
4101
4126
|
email = _ref2.email;
|
|
4102
|
-
|
|
4127
|
+
if (!showSuccess) {
|
|
4128
|
+
_context.next = 4;
|
|
4129
|
+
break;
|
|
4130
|
+
}
|
|
4131
|
+
onClose();
|
|
4132
|
+
return _context.abrupt("return");
|
|
4133
|
+
case 4:
|
|
4134
|
+
_context.prev = 4;
|
|
4103
4135
|
setLoading(true);
|
|
4104
|
-
_context.next =
|
|
4136
|
+
_context.next = 8;
|
|
4105
4137
|
return forgotPassword(email);
|
|
4106
|
-
case
|
|
4138
|
+
case 8:
|
|
4107
4139
|
_yield$forgotPassword = _context.sent;
|
|
4108
4140
|
data = _yield$forgotPassword.data;
|
|
4109
4141
|
onForgotPasswordSuccess(data);
|
|
4110
4142
|
onClose();
|
|
4111
|
-
|
|
4143
|
+
if (data != null && data.success) {
|
|
4144
|
+
setSuccessMessage(data == null ? void 0 : data.message);
|
|
4145
|
+
}
|
|
4146
|
+
_context.next = 18;
|
|
4112
4147
|
break;
|
|
4113
|
-
case
|
|
4114
|
-
_context.prev =
|
|
4115
|
-
_context.t0 = _context["catch"](
|
|
4148
|
+
case 15:
|
|
4149
|
+
_context.prev = 15;
|
|
4150
|
+
_context.t0 = _context["catch"](4);
|
|
4116
4151
|
if (axios.isAxiosError(_context.t0)) {
|
|
4117
4152
|
onForgotPasswordError(_context.t0);
|
|
4118
4153
|
}
|
|
4119
|
-
case
|
|
4120
|
-
_context.prev =
|
|
4154
|
+
case 18:
|
|
4155
|
+
_context.prev = 18;
|
|
4121
4156
|
setLoading(false);
|
|
4122
|
-
return _context.finish(
|
|
4123
|
-
case
|
|
4157
|
+
return _context.finish(18);
|
|
4158
|
+
case 21:
|
|
4124
4159
|
case "end":
|
|
4125
4160
|
return _context.stop();
|
|
4126
4161
|
}
|
|
4127
|
-
}, _callee, null, [[
|
|
4162
|
+
}, _callee, null, [[4, 15, 18, 21]]);
|
|
4128
4163
|
}));
|
|
4129
4164
|
return function onForgotPassword(_x) {
|
|
4130
4165
|
return _ref3.apply(this, arguments);
|
|
4131
4166
|
};
|
|
4132
4167
|
}();
|
|
4133
|
-
var _onClose = loading ? function () {} : onClose;
|
|
4134
4168
|
return React__default.createElement(material.Modal, {
|
|
4135
4169
|
open: true,
|
|
4136
|
-
onClose:
|
|
4170
|
+
onClose: loading ? _identity : onClose,
|
|
4137
4171
|
"aria-labelledby": "modal-modal-title",
|
|
4138
4172
|
"aria-describedby": "modal-modal-description",
|
|
4139
4173
|
className: "forgot-password-modal"
|
|
@@ -4157,7 +4191,9 @@ var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
|
4157
4191
|
className: "title"
|
|
4158
4192
|
}, "Password Reset"), React__default.createElement("div", {
|
|
4159
4193
|
className: "forgot-password-container__singleField"
|
|
4160
|
-
}, React__default.createElement(
|
|
4194
|
+
}, showSuccess ? React__default.createElement("p", {
|
|
4195
|
+
id: "forgot-password-success-message"
|
|
4196
|
+
}, successMessage) : React__default.createElement(formik.Field, {
|
|
4161
4197
|
name: "email",
|
|
4162
4198
|
label: "Email",
|
|
4163
4199
|
component: CustomField
|
|
@@ -4165,12 +4201,13 @@ var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
|
4165
4201
|
className: "forgot-password-action-button"
|
|
4166
4202
|
}, React__default.createElement("button", {
|
|
4167
4203
|
type: "submit",
|
|
4168
|
-
disabled: !(isValid && dirty)
|
|
4204
|
+
disabled: showSuccess ? false : !(isValid && dirty)
|
|
4169
4205
|
}, loading ? React__default.createElement(material.CircularProgress, {
|
|
4170
4206
|
size: "22px"
|
|
4171
|
-
}) : 'Submit')), React__default.createElement("div", {
|
|
4207
|
+
}) : showSuccess ? 'Close' : 'Submit')), React__default.createElement("div", {
|
|
4172
4208
|
className: "login"
|
|
4173
4209
|
}, React__default.createElement("span", {
|
|
4210
|
+
"aria-hidden": true,
|
|
4174
4211
|
onClick: onLoginButtonClick
|
|
4175
4212
|
}, "Back to Log In")), showPoweredByImage ? React__default.createElement(PoweredBy, null) : null);
|
|
4176
4213
|
}))));
|
|
@@ -5275,7 +5312,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
5275
5312
|
setLoading(false);
|
|
5276
5313
|
_hasUnverifiedOrder = _get(_context6.t1, 'response.data.data.hasUnverifiedOrder');
|
|
5277
5314
|
_message = _get(_context6.t1, 'response.data.message', {});
|
|
5278
|
-
if (_hasUnverifiedOrder && typeof _message ===
|
|
5315
|
+
if (_hasUnverifiedOrder && typeof _message === 'string') {
|
|
5279
5316
|
setPendingVerificationMessage(_message);
|
|
5280
5317
|
} else if (axios.isAxiosError(_context6.t1)) {
|
|
5281
5318
|
if (((_e$response = _context6.t1.response) == null ? void 0 : _e$response.status) === 401 || _get(_context6.t1, 'response.data.error') === 'invalid_token') {
|
|
@@ -5291,7 +5328,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
5291
5328
|
window.document.dispatchEvent(event);
|
|
5292
5329
|
}
|
|
5293
5330
|
}
|
|
5294
|
-
if (_message && !hideErrorsAlertSection && typeof _message ===
|
|
5331
|
+
if (_message && !hideErrorsAlertSection && typeof _message === 'string') {
|
|
5295
5332
|
setError(_message);
|
|
5296
5333
|
}
|
|
5297
5334
|
onSubmitError(_context6.t1);
|
|
@@ -6976,7 +7013,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
6976
7013
|
}, "^ This is based on the most expensive ticket in your order."))))));
|
|
6977
7014
|
};
|
|
6978
7015
|
|
|
6979
|
-
var
|
|
7016
|
+
var getPreRegistrationInfluencers = /*#__PURE__*/function () {
|
|
6980
7017
|
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
|
|
6981
7018
|
var response;
|
|
6982
7019
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -6993,7 +7030,7 @@ var getPreRegistrationInfluancers = /*#__PURE__*/function () {
|
|
|
6993
7030
|
}
|
|
6994
7031
|
}, _callee);
|
|
6995
7032
|
}));
|
|
6996
|
-
return function
|
|
7033
|
+
return function getPreRegistrationInfluencers(_x) {
|
|
6997
7034
|
return _ref.apply(this, arguments);
|
|
6998
7035
|
};
|
|
6999
7036
|
}();
|
|
@@ -7369,6 +7406,7 @@ var DoneSvg = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none
|
|
|
7369
7406
|
var XmarkSvg = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<svg\n xmlns:osb=\"http://www.openswatchbook.org/uri/2009/osb\"\n xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n xmlns:cc=\"http://creativecommons.org/ns#\"\n xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n xmlns:svg=\"http://www.w3.org/2000/svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"\n xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n viewBox=\"0 0 48 48\"\n version=\"1.1\"\n id=\"svg15\"\n sodipodi:docname=\"cross red circle.svg\"\n inkscape:version=\"0.92.3 (2405546, 2018-03-11)\">\n <metadata\n id=\"metadata19\">\n <rdf:RDF>\n <cc:Work\n rdf:about=\"\">\n <dc:format>image/svg+xml</dc:format>\n <dc:type\n rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\" />\n <dc:title />\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <sodipodi:namedview\n pagecolor=\"#ffffff\"\n bordercolor=\"#666666\"\n borderopacity=\"1\"\n objecttolerance=\"10\"\n gridtolerance=\"10\"\n guidetolerance=\"10\"\n inkscape:pageopacity=\"0\"\n inkscape:pageshadow=\"2\"\n inkscape:window-width=\"1920\"\n inkscape:window-height=\"1027\"\n id=\"namedview17\"\n showgrid=\"false\"\n inkscape:zoom=\"4.9166667\"\n inkscape:cx=\"-11.694915\"\n inkscape:cy=\"40.271186\"\n inkscape:window-x=\"-8\"\n inkscape:window-y=\"-8\"\n inkscape:window-maximized=\"1\"\n inkscape:current-layer=\"g13\" />\n <defs\n id=\"defs7\">\n <linearGradient\n id=\"linearGradient828\"\n osb:paint=\"solid\">\n <stop\n style=\"stop-color:#ff0000;stop-opacity:1;\"\n offset=\"0\"\n id=\"stop826\" />\n </linearGradient>\n <linearGradient\n id=\"0\"\n gradientUnits=\"userSpaceOnUse\"\n y1=\"47.37\"\n x2=\"0\"\n y2=\"-1.429\">\n <stop\n stop-color=\"#c52828\"\n id=\"stop2\" />\n <stop\n offset=\"1\"\n stop-color=\"#ff5454\"\n id=\"stop4\" />\n </linearGradient>\n </defs>\n <g\n transform=\"matrix(.99999 0 0 .99999-58.37.882)\"\n enable-background=\"new\"\n id=\"g13\"\n style=\"fill-opacity:1\">\n <circle\n cx=\"82.37\"\n cy=\"23.12\"\n r=\"24\"\n fill=\"url(#0)\"\n id=\"circle9\"\n style=\"fill-opacity:1;fill:#dd3333\" />\n <path\n d=\"m87.77 23.725l5.939-5.939c.377-.372.566-.835.566-1.373 0-.54-.189-.997-.566-1.374l-2.747-2.747c-.377-.372-.835-.564-1.373-.564-.539 0-.997.186-1.374.564l-5.939 5.939-5.939-5.939c-.377-.372-.835-.564-1.374-.564-.539 0-.997.186-1.374.564l-2.748 2.747c-.377.378-.566.835-.566 1.374 0 .54.188.997.566 1.373l5.939 5.939-5.939 5.94c-.377.372-.566.835-.566 1.373 0 .54.188.997.566 1.373l2.748 2.747c.377.378.835.564 1.374.564.539 0 .997-.186 1.374-.564l5.939-5.939 5.94 5.939c.377.378.835.564 1.374.564.539 0 .997-.186 1.373-.564l2.747-2.747c.377-.372.566-.835.566-1.373 0-.54-.188-.997-.566-1.373l-5.939-5.94\"\n fill=\"#fff\"\n fill-opacity=\".842\"\n id=\"path11\"\n style=\"fill-opacity:1;fill:#ffffff\" />\n </g>\n</svg>";
|
|
7370
7407
|
|
|
7371
7408
|
var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
7409
|
+
var _window, _window$localStorage;
|
|
7372
7410
|
var code = _ref.code,
|
|
7373
7411
|
codeIsApplied = _ref.codeIsApplied,
|
|
7374
7412
|
showPromoInput = _ref.showPromoInput,
|
|
@@ -7381,6 +7419,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
7381
7419
|
promoText = _ref.promoText,
|
|
7382
7420
|
showAlertIcons = _ref.showAlertIcons;
|
|
7383
7421
|
var isPromoCodeHasValue = !!code.trim();
|
|
7422
|
+
var appliedPromoCode = (_window = window) == null ? void 0 : (_window$localStorage = _window.localStorage) == null ? void 0 : _window$localStorage.getItem('appliedPromoCode');
|
|
7384
7423
|
var renderInputField = function renderInputField() {
|
|
7385
7424
|
return React__default.createElement("div", {
|
|
7386
7425
|
className: "promo-code-block"
|
|
@@ -7419,7 +7458,11 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
7419
7458
|
}
|
|
7420
7459
|
}), React__default.createElement("p", {
|
|
7421
7460
|
className: "promo-code-success"
|
|
7422
|
-
}, "PROMO CODE APPLIED SUCCESSFULLY")) : null,
|
|
7461
|
+
}, "PROMO CODE APPLIED SUCCESSFULLY")) : null, codeIsApplied ? React__default.createElement("div", {
|
|
7462
|
+
className: "alert-info"
|
|
7463
|
+
}, React__default.createElement("p", {
|
|
7464
|
+
className: "promo-code-success"
|
|
7465
|
+
}, "PROMO CODE: ", appliedPromoCode)) : null, codeIsInvalid ? React__default.createElement("div", {
|
|
7423
7466
|
className: "alert-info fail"
|
|
7424
7467
|
}, showAlertIcons && React__default.createElement(SVG, {
|
|
7425
7468
|
src: XmarkSvg
|
|
@@ -7601,7 +7644,7 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
7601
7644
|
hideTicketsHeader = _ref.hideTicketsHeader,
|
|
7602
7645
|
hideTableTicketsHeader = _ref.hideTableTicketsHeader,
|
|
7603
7646
|
showGroupNameBlock = _ref.showGroupNameBlock,
|
|
7604
|
-
|
|
7647
|
+
currencySymbol = _ref.currencySymbol,
|
|
7605
7648
|
isSeatMapAllowed = _ref.isSeatMapAllowed,
|
|
7606
7649
|
tableTickets = _ref.tableTickets,
|
|
7607
7650
|
_ref$descriptionTrigg = _ref.descriptionTrigger,
|
|
@@ -7611,7 +7654,7 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
7611
7654
|
var showGroup = !!sortedTicketsList.find(function (ticket) {
|
|
7612
7655
|
return ticket.groupName;
|
|
7613
7656
|
});
|
|
7614
|
-
var priceSymbol =
|
|
7657
|
+
var priceSymbol = currencySymbol || symbol;
|
|
7615
7658
|
var _useState = React.useState(null),
|
|
7616
7659
|
visibleDescription = _useState[0],
|
|
7617
7660
|
setVisibleDescription = _useState[1];
|
|
@@ -7782,78 +7825,80 @@ var TimeSlotsSection = function TimeSlotsSection(_ref) {
|
|
|
7782
7825
|
eventId = _ref.eventId,
|
|
7783
7826
|
availableDates = _ref.availableDates,
|
|
7784
7827
|
selectedTickets = _ref.selectedTickets,
|
|
7785
|
-
setSelectedTickets = _ref.setSelectedTickets,
|
|
7786
7828
|
handleTicketSelect = _ref.handleTicketSelect,
|
|
7787
7829
|
sortBySoldOut = _ref.sortBySoldOut,
|
|
7788
7830
|
hideTicketsHeader = _ref.hideTicketsHeader,
|
|
7789
7831
|
ticketsHeaderComponent = _ref.ticketsHeaderComponent,
|
|
7790
7832
|
showGroupNameBlock = _ref.showGroupNameBlock,
|
|
7791
|
-
|
|
7833
|
+
currencySymbol = _ref.currencySymbol,
|
|
7792
7834
|
isSeatMapAllowed = _ref.isSeatMapAllowed;
|
|
7793
7835
|
var _useState = React.useState(null),
|
|
7794
7836
|
selectedDate = _useState[0],
|
|
7795
7837
|
setSelectedDate = _useState[1];
|
|
7796
|
-
var _useState2 = React.useState(
|
|
7797
|
-
|
|
7798
|
-
|
|
7838
|
+
var _useState2 = React.useState({}),
|
|
7839
|
+
timeSlotGroups = _useState2[0],
|
|
7840
|
+
setTimeSlotGroups = _useState2[1];
|
|
7799
7841
|
var _useState3 = React.useState(false),
|
|
7800
7842
|
loading = _useState3[0],
|
|
7801
7843
|
setLoading = _useState3[1];
|
|
7802
7844
|
var handleDateChange = /*#__PURE__*/function () {
|
|
7803
7845
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(date) {
|
|
7804
|
-
var response;
|
|
7846
|
+
var response, groupedTickets;
|
|
7805
7847
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7806
7848
|
while (1) switch (_context.prev = _context.next) {
|
|
7807
7849
|
case 0:
|
|
7808
7850
|
setSelectedDate(date);
|
|
7809
7851
|
if (!date) {
|
|
7810
|
-
_context.next =
|
|
7852
|
+
_context.next = 18;
|
|
7811
7853
|
break;
|
|
7812
7854
|
}
|
|
7813
7855
|
setLoading(true);
|
|
7814
7856
|
_context.prev = 3;
|
|
7815
7857
|
_context.next = 6;
|
|
7816
|
-
return
|
|
7817
|
-
params: {
|
|
7818
|
-
eventId: eventId,
|
|
7819
|
-
date: moment(date).format("YYYY-MM-DD")
|
|
7820
|
-
}
|
|
7821
|
-
});
|
|
7858
|
+
return getTimeSlotsByDate(eventId, moment(date).format('YYYY-MM-DD'));
|
|
7822
7859
|
case 6:
|
|
7823
7860
|
response = _context.sent;
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7861
|
+
groupedTickets = {};
|
|
7862
|
+
_map(response.data.attributes.timeslots, function (timeslots, date) {
|
|
7863
|
+
var dateKeyChunks = date.split('-');
|
|
7864
|
+
var dateKey = [dateKeyChunks[0], dateKeyChunks[1], dateKeyChunks[2]].join('-');
|
|
7865
|
+
_forEach(timeslots, function (ticketList) {
|
|
7866
|
+
if (!groupedTickets[dateKey]) {
|
|
7867
|
+
groupedTickets[dateKey] = [];
|
|
7868
|
+
}
|
|
7869
|
+
groupedTickets[dateKey] = groupedTickets[dateKey].concat(ticketList);
|
|
7870
|
+
});
|
|
7871
|
+
});
|
|
7872
|
+
setTimeSlotGroups(groupedTickets);
|
|
7873
|
+
_context.next = 15;
|
|
7827
7874
|
break;
|
|
7828
|
-
case
|
|
7829
|
-
_context.prev =
|
|
7875
|
+
case 12:
|
|
7876
|
+
_context.prev = 12;
|
|
7830
7877
|
_context.t0 = _context["catch"](3);
|
|
7831
|
-
console.error(
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
case 16:
|
|
7835
|
-
_context.prev = 16;
|
|
7878
|
+
console.error('Error fetching time slots:', _context.t0);
|
|
7879
|
+
case 15:
|
|
7880
|
+
_context.prev = 15;
|
|
7836
7881
|
setLoading(false);
|
|
7837
|
-
return _context.finish(
|
|
7838
|
-
case
|
|
7882
|
+
return _context.finish(15);
|
|
7883
|
+
case 18:
|
|
7839
7884
|
case "end":
|
|
7840
7885
|
return _context.stop();
|
|
7841
7886
|
}
|
|
7842
|
-
}, _callee, null, [[3,
|
|
7887
|
+
}, _callee, null, [[3, 12, 15, 18]]);
|
|
7843
7888
|
}));
|
|
7844
7889
|
return function handleDateChange(_x) {
|
|
7845
7890
|
return _ref2.apply(this, arguments);
|
|
7846
7891
|
};
|
|
7847
7892
|
}();
|
|
7848
7893
|
var isDateDisabled = function isDateDisabled(date) {
|
|
7849
|
-
var formattedDate = moment(date).format(
|
|
7894
|
+
var formattedDate = moment(date).format('YYYY-MM-DD');
|
|
7850
7895
|
return !availableDates.includes(formattedDate);
|
|
7851
7896
|
};
|
|
7852
7897
|
return React__default.createElement(material.Box, {
|
|
7853
7898
|
sx: {
|
|
7854
|
-
display:
|
|
7855
|
-
flexDirection:
|
|
7856
|
-
alignItems:
|
|
7899
|
+
display: 'flex',
|
|
7900
|
+
flexDirection: 'column',
|
|
7901
|
+
alignItems: 'center'
|
|
7857
7902
|
}
|
|
7858
7903
|
}, React__default.createElement(xDatePickers.LocalizationProvider, {
|
|
7859
7904
|
dateAdapter: AdapterMoment.AdapterMoment
|
|
@@ -7878,25 +7923,47 @@ var TimeSlotsSection = function TimeSlotsSection(_ref) {
|
|
|
7878
7923
|
}) : React__default.createElement(material.Box, {
|
|
7879
7924
|
sx: {
|
|
7880
7925
|
marginTop: 2,
|
|
7881
|
-
width:
|
|
7926
|
+
width: '100%',
|
|
7927
|
+
display: 'flex',
|
|
7928
|
+
flexDirection: 'column',
|
|
7929
|
+
gap: 2
|
|
7882
7930
|
}
|
|
7883
|
-
},
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7931
|
+
}, _map(Object.keys(timeSlotGroups).sort(), function (timeKey) {
|
|
7932
|
+
return React__default.createElement("div", {
|
|
7933
|
+
key: timeKey,
|
|
7934
|
+
className: "time-slot-block"
|
|
7935
|
+
}, React__default.createElement("div", {
|
|
7936
|
+
className: "time-slot-date"
|
|
7937
|
+
}, moment(timeKey).format('hh:mm A')), React__default.createElement(TicketsSection, {
|
|
7938
|
+
event: event,
|
|
7939
|
+
ticketsList: timeSlotGroups[timeKey],
|
|
7940
|
+
tableTickets: [],
|
|
7941
|
+
selectedTickets: selectedTickets,
|
|
7942
|
+
handleTicketSelect: handleTicketSelect,
|
|
7943
|
+
sortBySoldOut: sortBySoldOut,
|
|
7944
|
+
ticketsHeaderComponent: ticketsHeaderComponent,
|
|
7945
|
+
tableTicketsHeaderComponent: null,
|
|
7946
|
+
hideTableTicketsHeader: true,
|
|
7947
|
+
hideTicketsHeader: hideTicketsHeader || _isEmpty(timeSlotGroups[timeKey]),
|
|
7948
|
+
showGroupNameBlock: showGroupNameBlock,
|
|
7949
|
+
currencySymbol: currencySymbol,
|
|
7950
|
+
isSeatMapAllowed: isSeatMapAllowed
|
|
7951
|
+
}));
|
|
7897
7952
|
})));
|
|
7898
7953
|
};
|
|
7899
7954
|
|
|
7955
|
+
var checkUserPreregistration = function checkUserPreregistration(preregisteredUsers) {
|
|
7956
|
+
var isWindowDefined = typeof window !== 'undefined';
|
|
7957
|
+
var userDataString = isWindowDefined ? window.localStorage.getItem('user_data') : '';
|
|
7958
|
+
var isPreregisteredUser = false;
|
|
7959
|
+
if (userDataString) {
|
|
7960
|
+
var user = JSON.parse(userDataString);
|
|
7961
|
+
isPreregisteredUser = _some(preregisteredUsers, function (item) {
|
|
7962
|
+
return item.email === (user == null ? void 0 : user.email);
|
|
7963
|
+
});
|
|
7964
|
+
}
|
|
7965
|
+
return isPreregisteredUser;
|
|
7966
|
+
};
|
|
7900
7967
|
var TicketsContainer = function TicketsContainer(_ref) {
|
|
7901
7968
|
var onLoginSuccess = _ref.onLoginSuccess,
|
|
7902
7969
|
getTicketsLabel = _ref.getTicketsLabel,
|
|
@@ -7964,8 +8031,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
7964
8031
|
promoText = _ref.promoText,
|
|
7965
8032
|
_ref$showGroupNameBlo = _ref.showGroupNameBlock,
|
|
7966
8033
|
showGroupNameBlock = _ref$showGroupNameBlo === void 0 ? false : _ref$showGroupNameBlo,
|
|
7967
|
-
_ref$
|
|
7968
|
-
|
|
8034
|
+
_ref$currencySymbol = _ref.currencySymbol,
|
|
8035
|
+
currencySymbol = _ref$currencySymbol === void 0 ? '' : _ref$currencySymbol,
|
|
7969
8036
|
_ref$onReserveButtonC = _ref.onReserveButtonClick,
|
|
7970
8037
|
onReserveButtonClick = _ref$onReserveButtonC === void 0 ? _identity : _ref$onReserveButtonC,
|
|
7971
8038
|
_ref$onPendingVerific = _ref.onPendingVerification,
|
|
@@ -7975,7 +8042,6 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
7975
8042
|
var _useState = React.useState({}),
|
|
7976
8043
|
selectedTickets = _useState[0],
|
|
7977
8044
|
setSelectedTickets = _useState[1];
|
|
7978
|
-
var isWindowDefined = typeof window !== 'undefined';
|
|
7979
8045
|
var _useState2 = React.useState(Boolean(getCookieByName(X_TF_ECOMMERCE))),
|
|
7980
8046
|
isLogged = _useState2[0],
|
|
7981
8047
|
setIsLogged = _useState2[1];
|
|
@@ -8031,14 +8097,14 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8031
8097
|
pendingVerificationMessage = _useState19[0],
|
|
8032
8098
|
setPendingVerificationMessage = _useState19[1];
|
|
8033
8099
|
var _useState20 = React.useState([]),
|
|
8034
|
-
|
|
8035
|
-
|
|
8100
|
+
preregisteredUsers = _useState20[0],
|
|
8101
|
+
setPreregisteredUsers = _useState20[1];
|
|
8036
8102
|
var _useState21 = React.useState(false),
|
|
8037
8103
|
ticketsNotAvailableModalOpen = _useState21[0],
|
|
8038
8104
|
setTicketsNotAvailableModalOpen = _useState21[1];
|
|
8039
|
-
var _useState22 = React.useState(checkUserPreregistration()),
|
|
8040
|
-
|
|
8041
|
-
|
|
8105
|
+
var _useState22 = React.useState(checkUserPreregistration(preregisteredUsers)),
|
|
8106
|
+
isPreregistered = _useState22[0],
|
|
8107
|
+
setIsPreregistered = _useState22[1];
|
|
8042
8108
|
var ticketsContainerRef = React.useRef(null);
|
|
8043
8109
|
var pageUrl = isBrowser ? window.location.href.split('?')[0] : '';
|
|
8044
8110
|
var isTimeSlotEvent = event == null ? void 0 : event.isTimeSlotEvent;
|
|
@@ -8049,10 +8115,10 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8049
8115
|
return setIsLogged(Boolean(value));
|
|
8050
8116
|
});
|
|
8051
8117
|
useLocalStorageListener('user_data', function (user) {
|
|
8052
|
-
var
|
|
8118
|
+
var isPreregisteredUser = _some(preregisteredUsers, function (item) {
|
|
8053
8119
|
return item.email === (user == null ? void 0 : user.email);
|
|
8054
8120
|
});
|
|
8055
|
-
|
|
8121
|
+
setIsPreregistered(isPreregisteredUser);
|
|
8056
8122
|
});
|
|
8057
8123
|
usePixel(eventId, {
|
|
8058
8124
|
pageUrl: pageUrl
|
|
@@ -8063,17 +8129,21 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8063
8129
|
React.useEffect(function () {
|
|
8064
8130
|
if (eventId) {
|
|
8065
8131
|
getTicketsApi();
|
|
8066
|
-
|
|
8132
|
+
fetchPreregisteredData();
|
|
8067
8133
|
}
|
|
8068
8134
|
}, [eventId, isTimeSlotEvent]);
|
|
8069
8135
|
React.useEffect(function () {
|
|
8070
|
-
|
|
8071
|
-
}, [
|
|
8136
|
+
setIsPreregistered(checkUserPreregistration(preregisteredUsers));
|
|
8137
|
+
}, [preregisteredUsers]);
|
|
8072
8138
|
React.useEffect(function () {
|
|
8073
8139
|
if (isLogged) {
|
|
8074
8140
|
fetchUserData().then(function (res) {
|
|
8075
8141
|
window.localStorage.setItem('user_data', JSON.stringify(res));
|
|
8076
|
-
onGetProfileDataSuccess(
|
|
8142
|
+
onGetProfileDataSuccess({
|
|
8143
|
+
data: {
|
|
8144
|
+
attributes: res
|
|
8145
|
+
}
|
|
8146
|
+
});
|
|
8077
8147
|
})["catch"](function (e) {
|
|
8078
8148
|
if (axios.isAxiosError(e)) {
|
|
8079
8149
|
onGetProfileDataError(e);
|
|
@@ -8132,13 +8202,13 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8132
8202
|
return _getTicketsApi.apply(this, arguments);
|
|
8133
8203
|
}
|
|
8134
8204
|
function _getTicketsApi() {
|
|
8135
|
-
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(
|
|
8136
|
-
var previewKey, eventResponse, _event2,
|
|
8205
|
+
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(isUpdatingCode, type) {
|
|
8206
|
+
var previewKey, eventResponse, _event2, _event2$timeslotSetti, _event2$timeslotSetti2, response, _response$data, attributes;
|
|
8137
8207
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
8138
8208
|
while (1) switch (_context4.prev = _context4.next) {
|
|
8139
8209
|
case 0:
|
|
8140
8210
|
_context4.prev = 0;
|
|
8141
|
-
if (
|
|
8211
|
+
if (isUpdatingCode) {
|
|
8142
8212
|
setCodeIsLoading(true);
|
|
8143
8213
|
} else {
|
|
8144
8214
|
setIsLoading(true);
|
|
@@ -8148,30 +8218,26 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8148
8218
|
return getEvent(eventId, previewKey);
|
|
8149
8219
|
case 5:
|
|
8150
8220
|
eventResponse = _context4.sent;
|
|
8151
|
-
if (eventResponse.success) {
|
|
8152
|
-
|
|
8153
|
-
setEvent(_event2);
|
|
8154
|
-
if (_event2.country && isBrowser) {
|
|
8155
|
-
window.localStorage.setItem('eventCountry', _event2.country);
|
|
8156
|
-
}
|
|
8157
|
-
}
|
|
8158
|
-
if (!isTimeSlotEvent) {
|
|
8159
|
-
_context4.next = 14;
|
|
8221
|
+
if (!eventResponse.success) {
|
|
8222
|
+
_context4.next = 13;
|
|
8160
8223
|
break;
|
|
8161
8224
|
}
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
if (
|
|
8168
|
-
|
|
8225
|
+
_event2 = eventResponse.data.attributes;
|
|
8226
|
+
setEvent(_event2);
|
|
8227
|
+
if (_event2.country && isBrowser) {
|
|
8228
|
+
window.localStorage.setItem('eventCountry', _event2.country);
|
|
8229
|
+
}
|
|
8230
|
+
if (!_event2.isTimeSlotEvent) {
|
|
8231
|
+
_context4.next = 13;
|
|
8232
|
+
break;
|
|
8169
8233
|
}
|
|
8234
|
+
// For timeslots we shouldn't fetch all tickets at once
|
|
8235
|
+
setAvailableDates((_event2$timeslotSetti = _event2 == null ? void 0 : (_event2$timeslotSetti2 = _event2.timeslotSettings) == null ? void 0 : _event2$timeslotSetti2.availableDates) != null ? _event2$timeslotSetti : []);
|
|
8170
8236
|
return _context4.abrupt("return");
|
|
8171
|
-
case
|
|
8172
|
-
_context4.next =
|
|
8237
|
+
case 13:
|
|
8238
|
+
_context4.next = 15;
|
|
8173
8239
|
return getTickets(eventId, code, previewKey);
|
|
8174
|
-
case
|
|
8240
|
+
case 15:
|
|
8175
8241
|
response = _context4.sent;
|
|
8176
8242
|
if (response.success) {
|
|
8177
8243
|
attributes = response == null ? void 0 : (_response$data = response.data) == null ? void 0 : _response$data.attributes;
|
|
@@ -8179,50 +8245,58 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8179
8245
|
type === 'promo' && setCodeIsInvalid(!attributes.ValidPromoCode);
|
|
8180
8246
|
setTickets(attributes.tickets);
|
|
8181
8247
|
setShowWaitingList(attributes.showWaitingList);
|
|
8182
|
-
onGetTicketsSuccess(
|
|
8248
|
+
onGetTicketsSuccess({
|
|
8249
|
+
data: {
|
|
8250
|
+
attributes: {
|
|
8251
|
+
tickets: response.data.attributes.tickets
|
|
8252
|
+
}
|
|
8253
|
+
}
|
|
8254
|
+
});
|
|
8183
8255
|
setCode('');
|
|
8256
|
+
window.localStorage.setItem('appliedPromoCode', code);
|
|
8184
8257
|
setShowAccessCodeSection(attributes.is_access_code);
|
|
8185
8258
|
setShowPromoCodeSection(attributes.isPromotionsEnabled);
|
|
8186
8259
|
}
|
|
8187
|
-
_context4.next =
|
|
8260
|
+
_context4.next = 22;
|
|
8188
8261
|
break;
|
|
8189
|
-
case
|
|
8190
|
-
_context4.prev =
|
|
8262
|
+
case 19:
|
|
8263
|
+
_context4.prev = 19;
|
|
8191
8264
|
_context4.t0 = _context4["catch"](0);
|
|
8192
8265
|
if (axios.isAxiosError(_context4.t0)) {
|
|
8193
8266
|
onGetTicketsError(_context4.t0);
|
|
8194
8267
|
setError(_get(_context4.t0, 'response.data.message', ''));
|
|
8268
|
+
window.localStorage.removeItem('appliedPromoCode');
|
|
8195
8269
|
}
|
|
8196
|
-
case
|
|
8197
|
-
_context4.prev =
|
|
8270
|
+
case 22:
|
|
8271
|
+
_context4.prev = 22;
|
|
8198
8272
|
setIsLoading(false);
|
|
8199
8273
|
setCodeIsLoading(false);
|
|
8200
|
-
return _context4.finish(
|
|
8201
|
-
case
|
|
8274
|
+
return _context4.finish(22);
|
|
8275
|
+
case 26:
|
|
8202
8276
|
case "end":
|
|
8203
8277
|
return _context4.stop();
|
|
8204
8278
|
}
|
|
8205
|
-
}, _callee4, null, [[0,
|
|
8279
|
+
}, _callee4, null, [[0, 19, 22, 26]]);
|
|
8206
8280
|
}));
|
|
8207
8281
|
return _getTicketsApi.apply(this, arguments);
|
|
8208
8282
|
}
|
|
8209
|
-
function
|
|
8210
|
-
return
|
|
8283
|
+
function fetchPreregisteredData() {
|
|
8284
|
+
return _fetchPreregisteredData.apply(this, arguments);
|
|
8211
8285
|
}
|
|
8212
|
-
function
|
|
8213
|
-
|
|
8286
|
+
function _fetchPreregisteredData() {
|
|
8287
|
+
_fetchPreregisteredData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
8214
8288
|
var preregistrationData;
|
|
8215
8289
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
8216
8290
|
while (1) switch (_context5.prev = _context5.next) {
|
|
8217
8291
|
case 0:
|
|
8218
8292
|
_context5.prev = 0;
|
|
8219
8293
|
_context5.next = 3;
|
|
8220
|
-
return
|
|
8294
|
+
return getPreRegistrationInfluencers({
|
|
8221
8295
|
eventId: eventId
|
|
8222
8296
|
});
|
|
8223
8297
|
case 3:
|
|
8224
8298
|
preregistrationData = _context5.sent;
|
|
8225
|
-
|
|
8299
|
+
setPreregisteredUsers(preregistrationData.data.attributes.influencers);
|
|
8226
8300
|
_context5.next = 10;
|
|
8227
8301
|
break;
|
|
8228
8302
|
case 7:
|
|
@@ -8237,7 +8311,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8237
8311
|
}
|
|
8238
8312
|
}, _callee5, null, [[0, 7]]);
|
|
8239
8313
|
}));
|
|
8240
|
-
return
|
|
8314
|
+
return _fetchPreregisteredData.apply(this, arguments);
|
|
8241
8315
|
}
|
|
8242
8316
|
var handleTicketSelect = function handleTicketSelect(key, value, isTable) {
|
|
8243
8317
|
if (isTable === void 0) {
|
|
@@ -8252,17 +8326,6 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8252
8326
|
return _ref3 = {}, _ref3[key] = value, _ref3.isTable = isTable, _ref3;
|
|
8253
8327
|
});
|
|
8254
8328
|
};
|
|
8255
|
-
function checkUserPreregistration() {
|
|
8256
|
-
var userDataString = isWindowDefined ? window.localStorage.getItem('user_data') : '';
|
|
8257
|
-
var isPreregistredUser = false;
|
|
8258
|
-
if (userDataString) {
|
|
8259
|
-
var user = JSON.parse(userDataString);
|
|
8260
|
-
isPreregistredUser = _some(preregistereds, function (item) {
|
|
8261
|
-
return item.email === (user == null ? void 0 : user.email);
|
|
8262
|
-
});
|
|
8263
|
-
}
|
|
8264
|
-
return isPreregistredUser;
|
|
8265
|
-
}
|
|
8266
8329
|
var handleOrdersClick = function handleOrdersClick() {
|
|
8267
8330
|
if (isBrowser) {
|
|
8268
8331
|
window.location.href = ordersPath != null ? ordersPath : '/orders';
|
|
@@ -8274,7 +8337,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8274
8337
|
var handleBook = /*#__PURE__*/function () {
|
|
8275
8338
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
8276
8339
|
var _product_options, _product_options2, _ticket_types;
|
|
8277
|
-
var ticket, optionName, ticketId, isTableType, productCartQuantity, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$has_, _pageConfigsData$free, pageConfigsData, skipBillingPage, hasAddOn, freeTicket, hash, total, _checkoutResponse$dat, _checkoutResponse$dat2, _checkoutResponse$dat3, _checkoutResponse$dat4, userData, checkoutBody, checkoutResponse,
|
|
8340
|
+
var ticket, optionName, ticketId, isTableType, productCartQuantity, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$has_, _pageConfigsData$free, pageConfigsData, skipBillingPage, hasAddOn, freeTicket, hash, total, _checkoutResponse$dat, _checkoutResponse$dat2, _checkoutResponse$dat3, _checkoutResponse$dat4, userData, checkoutBody, checkoutResponse, _errorResponse$data, _errorResponse$data$d, errorResponse, _errorResponse$data2, message, _isInvalidLinkError, _isNotInvitedError;
|
|
8278
8341
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
8279
8342
|
while (1) switch (_context2.prev = _context2.next) {
|
|
8280
8343
|
case 0:
|
|
@@ -8367,13 +8430,14 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8367
8430
|
hasAddOn: hasAddOn
|
|
8368
8431
|
});
|
|
8369
8432
|
case 43:
|
|
8370
|
-
_context2.next =
|
|
8433
|
+
_context2.next = 49;
|
|
8371
8434
|
break;
|
|
8372
8435
|
case 45:
|
|
8373
8436
|
_context2.prev = 45;
|
|
8374
8437
|
_context2.t2 = _context2["catch"](8);
|
|
8375
|
-
|
|
8376
|
-
|
|
8438
|
+
errorResponse = _get(_context2.t2, 'response', {});
|
|
8439
|
+
if (errorResponse != null && (_errorResponse$data = errorResponse.data) != null && (_errorResponse$data$d = _errorResponse$data.data) != null && _errorResponse$data$d.hasUnverifiedOrder) {
|
|
8440
|
+
setPendingVerificationMessage(errorResponse == null ? void 0 : (_errorResponse$data2 = errorResponse.data) == null ? void 0 : _errorResponse$data2.message);
|
|
8377
8441
|
} else if (axios.isAxiosError(_context2.t2)) {
|
|
8378
8442
|
onAddToCartError(_context2.t2);
|
|
8379
8443
|
message = _get(_context2.t2, 'response.data.message', '');
|
|
@@ -8387,22 +8451,22 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8387
8451
|
setError(message);
|
|
8388
8452
|
}
|
|
8389
8453
|
}
|
|
8390
|
-
case
|
|
8391
|
-
_context2.prev =
|
|
8454
|
+
case 49:
|
|
8455
|
+
_context2.prev = 49;
|
|
8392
8456
|
setHandleBookIsLoading(false);
|
|
8393
|
-
return _context2.finish(
|
|
8394
|
-
case
|
|
8457
|
+
return _context2.finish(49);
|
|
8458
|
+
case 52:
|
|
8395
8459
|
case "end":
|
|
8396
8460
|
return _context2.stop();
|
|
8397
8461
|
}
|
|
8398
|
-
}, _callee2, null, [[8, 45,
|
|
8462
|
+
}, _callee2, null, [[8, 45, 49, 52]]);
|
|
8399
8463
|
}));
|
|
8400
8464
|
return function handleBook() {
|
|
8401
8465
|
return _ref4.apply(this, arguments);
|
|
8402
8466
|
};
|
|
8403
8467
|
}();
|
|
8404
|
-
var updateTickets = function updateTickets(
|
|
8405
|
-
getTicketsApi(
|
|
8468
|
+
var updateTickets = function updateTickets(isUpdatingCode, type) {
|
|
8469
|
+
getTicketsApi(isUpdatingCode, type);
|
|
8406
8470
|
};
|
|
8407
8471
|
var fetchUserData = /*#__PURE__*/function () {
|
|
8408
8472
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
@@ -8442,7 +8506,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8442
8506
|
};
|
|
8443
8507
|
}, []);
|
|
8444
8508
|
var handleGetTicketClick = function handleGetTicketClick() {
|
|
8445
|
-
if (!handleBookIsLoading && !_isEmpty(selectedTickets) && Object.values(selectedTickets)[0] > 0) {
|
|
8509
|
+
if (!handleBookIsLoading && !_isEmpty(selectedTickets) && Number(Object.values(selectedTickets)[0]) > 0) {
|
|
8446
8510
|
handleBook();
|
|
8447
8511
|
} else {
|
|
8448
8512
|
if (isButtonScrollable && ticketsContainerRef && ticketsContainerRef.current) {
|
|
@@ -8493,10 +8557,10 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8493
8557
|
var tableTickets = _filter(tickets, function (ticket) {
|
|
8494
8558
|
return ticket.isTable;
|
|
8495
8559
|
});
|
|
8496
|
-
var
|
|
8560
|
+
var ordinaryTickets = {};
|
|
8497
8561
|
_forEach(tickets, function (ticket, key) {
|
|
8498
8562
|
if (!ticket.isTable) {
|
|
8499
|
-
|
|
8563
|
+
ordinaryTickets[key] = ticket;
|
|
8500
8564
|
}
|
|
8501
8565
|
});
|
|
8502
8566
|
return React__default.createElement(styles.ThemeProvider, {
|
|
@@ -8542,23 +8606,22 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8542
8606
|
}
|
|
8543
8607
|
}), isLoading ? React__default.createElement(Loader, null) : React__default.createElement("div", {
|
|
8544
8608
|
ref: ticketsContainerRef,
|
|
8545
|
-
className:
|
|
8609
|
+
className: "tickets-section-container"
|
|
8546
8610
|
}, isTimeSlotEvent && React__default.createElement(TimeSlotsSection, {
|
|
8547
8611
|
event: event,
|
|
8548
8612
|
eventId: eventId,
|
|
8549
8613
|
availableDates: availableDates,
|
|
8550
8614
|
selectedTickets: selectedTickets,
|
|
8551
|
-
setSelectedTickets: setSelectedTickets,
|
|
8552
8615
|
handleTicketSelect: handleTicketSelect,
|
|
8553
8616
|
sortBySoldOut: sortBySoldOut,
|
|
8554
8617
|
ticketsHeaderComponent: ticketsHeaderComponent,
|
|
8555
8618
|
hideTicketsHeader: hideTicketsHeader,
|
|
8556
8619
|
showGroupNameBlock: showGroupNameBlock,
|
|
8557
|
-
|
|
8620
|
+
currencySymbol: currencySymbol,
|
|
8558
8621
|
isSeatMapAllowed: isSeatMapAllowed
|
|
8559
8622
|
}), !isSalesClosed && !isTimeSlotEvent && React__default.createElement(TicketsSection, {
|
|
8560
8623
|
event: event,
|
|
8561
|
-
ticketsList:
|
|
8624
|
+
ticketsList: ordinaryTickets,
|
|
8562
8625
|
tableTickets: tableTickets,
|
|
8563
8626
|
selectedTickets: selectedTickets,
|
|
8564
8627
|
handleTicketSelect: handleTicketSelect,
|
|
@@ -8566,9 +8629,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8566
8629
|
ticketsHeaderComponent: ticketsHeaderComponent,
|
|
8567
8630
|
tableTicketsHeaderComponent: tableTicketsHeaderComponent,
|
|
8568
8631
|
hideTableTicketsHeader: hideTableTicketsHeader || _isEmpty(tableTickets),
|
|
8569
|
-
hideTicketsHeader: hideTicketsHeader || _isEmpty(
|
|
8632
|
+
hideTicketsHeader: hideTicketsHeader || _isEmpty(ordinaryTickets),
|
|
8570
8633
|
showGroupNameBlock: showGroupNameBlock,
|
|
8571
|
-
|
|
8634
|
+
currencySymbol: currencySymbol,
|
|
8572
8635
|
isSeatMapAllowed: isSeatMapAllowed
|
|
8573
8636
|
}), externalUrl ? null : isSalesClosed ? React__default.createElement("p", {
|
|
8574
8637
|
className: "event-closed-message " + (!isLoggedIn ? 'event-closed-on-bottom' : '')
|
|
@@ -8582,7 +8645,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8582
8645
|
disableLeadingZero: disableCountdownLeadingZero,
|
|
8583
8646
|
isLoggedIn: isLoggedIn
|
|
8584
8647
|
}) : null, showWaitingList && event.salesStarted && !hideWaitingList && React__default.createElement(WaitingList, {
|
|
8585
|
-
tickets:
|
|
8648
|
+
tickets: ordinaryTickets,
|
|
8586
8649
|
eventId: eventId,
|
|
8587
8650
|
defaultMaxQuantity: event.waitingListMaxQuantity
|
|
8588
8651
|
}), codeIsLoading ? React__default.createElement(Loader, null) : isSalesClosed ? null : showAccessCodeSection ? React__default.createElement(AccessCodeSection, {
|
|
@@ -8604,7 +8667,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8604
8667
|
}) : null, wrappedActionsSectionComponent, canShowGetTicketBtn() && React__default.createElement(Button$1, {
|
|
8605
8668
|
"aria-hidden": true,
|
|
8606
8669
|
className: "book-button \n " + (bookButtonIsDisabled ? 'disabled' : '') + " \n " + (isButtonScrollable ? 'is-scrollable' : '') + "\n " + (!isLoggedIn ? 'on-bottom' : '') + "\n ",
|
|
8607
|
-
onClick: event != null && event.salesStart && event != null && event.presalesStarted && !(event != null && event.presalesEnded) && (!
|
|
8670
|
+
onClick: event != null && event.salesStart && event != null && event.presalesStarted && !(event != null && event.presalesEnded) && (!isPreregistered || !isLogged) ? handleNotAvailableTicketsClick : handleGetTicketClick
|
|
8608
8671
|
}, selectedTickets.isTable ? 'RESERVE TABLES' : getTicketsLabel || 'GET TICKETS'), isSeatMapAllowed && !(event != null && event.salesEnded) && isTicketAvailable && React__default.createElement(Button$1, {
|
|
8609
8672
|
className: "reserve-button",
|
|
8610
8673
|
"aria-hidden": true,
|
|
@@ -13522,7 +13585,7 @@ var PreRegistrationComplete = function PreRegistrationComplete(_ref) {
|
|
|
13522
13585
|
break;
|
|
13523
13586
|
}
|
|
13524
13587
|
_context.next = 12;
|
|
13525
|
-
return
|
|
13588
|
+
return getPreRegistrationInfluencers({
|
|
13526
13589
|
eventId: eventId || pEventId
|
|
13527
13590
|
});
|
|
13528
13591
|
case 12:
|
|
@@ -13682,7 +13745,7 @@ var PreRegistrationInformations = function PreRegistrationInformations(props) {
|
|
|
13682
13745
|
case 0:
|
|
13683
13746
|
_context.prev = 0;
|
|
13684
13747
|
_context.next = 3;
|
|
13685
|
-
return
|
|
13748
|
+
return getPreRegistrationInfluencers({
|
|
13686
13749
|
eventId: eventId
|
|
13687
13750
|
});
|
|
13688
13751
|
case 3:
|