tf-checkout-react 1.6.6-beta.31 → 1.6.6-beta.32

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.
@@ -6368,6 +6368,10 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
6368
6368
  }, [isBrowser]);
6369
6369
  var defaultCountry = isBrowser ? window.localStorage.getItem('eventCountry') : '';
6370
6370
  var userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '{}') : {};
6371
+ var additionalConfigs = isBrowser && window.localStorage.getItem('checkoutAdditionalConfigs') ? JSON.parse(window.localStorage.getItem('checkoutAdditionalConfigs') || '{"resale": false, "resaleWithAddons": false}') : {
6372
+ resale: false,
6373
+ resaleWithAddons: false
6374
+ };
6371
6375
  var _useState5 = React.useState(assingUniqueIds(data)),
6372
6376
  dataWithUniqueIds = _useState5[0],
6373
6377
  setDataWithUniqueIds = _useState5[1];
@@ -6664,7 +6668,8 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
6664
6668
  _context5.next = 5;
6665
6669
  return updateCheckout({
6666
6670
  attributes: {
6667
- event_id: eventId
6671
+ event_id: eventId,
6672
+ is_from_resale: additionalConfigs == null ? void 0 : additionalConfigs.resale
6668
6673
  }
6669
6674
  });
6670
6675
  case 5:
@@ -6699,7 +6704,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
6699
6704
  while (1) switch (_context6.prev = _context6.next) {
6700
6705
  case 0:
6701
6706
  if (!(skipPage && !_isEmpty(ticketsQuantity) && !showDOB && !loading && !isNewUser)) {
6702
- _context6.next = 19;
6707
+ _context6.next = 20;
6703
6708
  break;
6704
6709
  }
6705
6710
  setLoading(true);
@@ -6713,27 +6718,28 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
6713
6718
  case 7:
6714
6719
  checkoutResponse = _context6.sent;
6715
6720
  removeReferralKey();
6721
+ removeAdditionalConfigs();
6716
6722
  onSkipBillingPage(checkoutResponse.data.attributes);
6717
6723
  setLoading(false);
6718
- _context6.next = 17;
6724
+ _context6.next = 18;
6719
6725
  break;
6720
- case 13:
6721
- _context6.prev = 13;
6726
+ case 14:
6727
+ _context6.prev = 14;
6722
6728
  _context6.t0 = _context6["catch"](3);
6723
6729
  onSubmitError(_context6.t0);
6724
6730
  if (_get(_context6.t0, 'response.data.data.hasUnverifiedOrder')) {
6725
6731
  setPendingVerificationMessage(_get(_context6.t0, 'response.data.message'));
6726
6732
  }
6727
- case 17:
6728
- _context6.next = 20;
6733
+ case 18:
6734
+ _context6.next = 21;
6729
6735
  break;
6730
- case 19:
6731
- setLoading(false);
6732
6736
  case 20:
6737
+ setLoading(false);
6738
+ case 21:
6733
6739
  case "end":
6734
6740
  return _context6.stop();
6735
6741
  }
6736
- }, _callee6, null, [[3, 13]]);
6742
+ }, _callee6, null, [[3, 14]]);
6737
6743
  }));
6738
6744
  return function collectPaymentData() {
6739
6745
  return _ref9.apply(this, arguments);
@@ -6800,6 +6806,9 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
6800
6806
  var removeReferralKey = React.useCallback(function () {
6801
6807
  localStorage.removeItem('referral_key');
6802
6808
  }, []);
6809
+ var removeAdditionalConfigs = React.useCallback(function () {
6810
+ localStorage.removeItem('checkoutAdditionalConfigs');
6811
+ }, []);
6803
6812
  var updateCheckoutWithAddOns = React.useCallback( /*#__PURE__*/function () {
6804
6813
  var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(addOns) {
6805
6814
  var mergedAddOns, _checkoutUpdateData, checkoutResponse, checkoutDataObj, errorMessage;
@@ -6830,7 +6839,8 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
6830
6839
  _checkoutUpdateData = {
6831
6840
  attributes: {
6832
6841
  event_id: eventId,
6833
- add_ons: mergedAddOns
6842
+ add_ons: mergedAddOns,
6843
+ is_from_resale: additionalConfigs == null ? void 0 : additionalConfigs.resale
6834
6844
  }
6835
6845
  };
6836
6846
  _context7.next = 9;
@@ -6907,6 +6917,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
6907
6917
  }
6908
6918
  var stripePublishableKey = (reviewData == null ? void 0 : (_reviewData$payment_m = reviewData.payment_method) == null ? void 0 : _reviewData$payment_m.stripe_publishable_key) || (checkoutUpdateData == null ? void 0 : (_checkoutUpdateData$a = checkoutUpdateData.additional_payment_information) == null ? void 0 : (_checkoutUpdateData$a2 = _checkoutUpdateData$a.basic_config) == null ? void 0 : _checkoutUpdateData$a2.apiKey);
6909
6919
  var stripeAccountId = (reviewData == null ? void 0 : (_reviewData$payment_m2 = reviewData.payment_method) == null ? void 0 : _reviewData$payment_m2.stripe_connected_account) || (checkoutUpdateData == null ? void 0 : (_checkoutUpdateData$a3 = checkoutUpdateData.additional_payment_information) == null ? void 0 : (_checkoutUpdateData$a4 = _checkoutUpdateData$a3.basic_config) == null ? void 0 : _checkoutUpdateData$a4.accountId);
6920
+ var addOnsIncludedOnInvitation = additionalConfigs.resale && additionalConfigs.resaleWithAddons;
6910
6921
  return React__default.createElement(styles.ThemeProvider, {
6911
6922
  theme: themeMui
6912
6923
  }, (loading || cardLoading || isCountriesLoading || isConfigLoading) && React__default.createElement(Backdrop, {
@@ -6938,7 +6949,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
6938
6949
  enableReinitialize: false,
6939
6950
  onSubmit: function () {
6940
6951
  var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(values, formikHelpers) {
6941
- var stripePaymentMethod, card, stripePaymentMethodResponse, _stripePaymentMethodR, checkoutBodyForRegistration, bodyFormData, resRegister, _xtfCookie, refreshToken, userProfile, hasUnverifiedOrder, message, profileData, profileSpecifiedData, profileDataObj, userDataObj, checkoutBody, checkoutResponse, checkoutUpdateResponse, paymentResponse, _checkoutResponse$dat, hash, total, paymentDataResponse, _cart$, attributes, order_details, cart, _order_details$ticket, ticket, updatedOrderData, isFreeTickets, paymentMethod, paymentPlanAvailable, confirmationResult, _confirmationResult$e, _hasUnverifiedOrder, _message, _e$response, event;
6952
+ var _checkoutBody$attribu2, _checkoutBody$attribu3, stripePaymentMethod, card, stripePaymentMethodResponse, _stripePaymentMethodR, checkoutBodyForRegistration, bodyFormData, resRegister, _xtfCookie, refreshToken, userProfile, hasUnverifiedOrder, message, profileData, profileSpecifiedData, profileDataObj, userDataObj, checkoutBody, checkoutResponse, checkoutUpdateResponse, paymentResponse, _checkoutResponse$dat, hash, total, paymentDataResponse, _cart$, attributes, order_details, cart, _order_details$ticket, ticket, updatedOrderData, isFreeTickets, paymentMethod, paymentPlanAvailable, confirmationResult, _confirmationResult$e, _hasUnverifiedOrder, _message, _e$response, event;
6942
6953
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
6943
6954
  while (1) switch (_context9.prev = _context9.next) {
6944
6955
  case 0:
@@ -7066,7 +7077,9 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
7066
7077
  _context9.next = 52;
7067
7078
  return updateCheckout({
7068
7079
  attributes: {
7069
- event_id: eventId
7080
+ event_id: eventId,
7081
+ add_ons: (_checkoutBody$attribu2 = checkoutBody == null ? void 0 : (_checkoutBody$attribu3 = checkoutBody.attributes) == null ? void 0 : _checkoutBody$attribu3.add_ons) != null ? _checkoutBody$attribu2 : [],
7082
+ is_from_resale: additionalConfigs == null ? void 0 : additionalConfigs.resale
7070
7083
  }
7071
7084
  });
7072
7085
  case 52:
@@ -7156,11 +7169,12 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
7156
7169
  });
7157
7170
  case 81:
7158
7171
  removeReferralKey();
7172
+ removeAdditionalConfigs();
7159
7173
  handleSubmit(values, formikHelpers, eventId, checkoutResponse, checkoutUpdateResponse, paymentResponse);
7160
- _context9.next = 92;
7174
+ _context9.next = 93;
7161
7175
  break;
7162
- case 85:
7163
- _context9.prev = 85;
7176
+ case 86:
7177
+ _context9.prev = 86;
7164
7178
  _context9.t1 = _context9["catch"](0);
7165
7179
  setLoading(false);
7166
7180
  onSubmitError(_context9.t1);
@@ -7187,15 +7201,15 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
7187
7201
  }
7188
7202
  onSubmitError(_context9.t1);
7189
7203
  }
7190
- case 92:
7191
- _context9.prev = 92;
7204
+ case 93:
7205
+ _context9.prev = 93;
7192
7206
  setLoading(false);
7193
- return _context9.finish(92);
7194
- case 95:
7207
+ return _context9.finish(93);
7208
+ case 96:
7195
7209
  case "end":
7196
7210
  return _context9.stop();
7197
7211
  }
7198
- }, _callee9, null, [[0, 85, 92, 95], [18, 30]]);
7212
+ }, _callee9, null, [[0, 86, 93, 96], [18, 30]]);
7199
7213
  }));
7200
7214
  function onSubmit(_x3, _x4) {
7201
7215
  return _onSubmit.apply(this, arguments);
@@ -7248,12 +7262,12 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
7248
7262
  }, React__default.createElement("img", {
7249
7263
  src: theme === 'dark' ? 'https://www.ticketfairy.com/resources/images/logo-ttf.svg' : 'https://www.ticketfairy.com/resources/images/logo-ttf-black.svg',
7250
7264
  alt: "nodata"
7251
- })))), isSinglePageCheckout && eventId ? React__default.createElement(SimpleAddonsContainer, Object.assign({}, addonsProps != null ? addonsProps : {}, {
7265
+ })))), isSinglePageCheckout && !addOnsIncludedOnInvitation && eventId ? React__default.createElement(SimpleAddonsContainer, Object.assign({}, addonsProps != null ? addonsProps : {}, {
7252
7266
  eventId: eventId,
7253
7267
  addOnDataWithCustomFields: addOnDataWithCustomFields,
7254
7268
  configs: configs,
7255
7269
  onAddOnSelect: onAddOnSelect
7256
- })) : includeAddons ? React__default.createElement(AddonsContainter, Object.assign({}, addonsProps != null ? addonsProps : {}, {
7270
+ })) : !addOnsIncludedOnInvitation && includeAddons ? React__default.createElement(AddonsContainter, Object.assign({}, addonsProps != null ? addonsProps : {}, {
7257
7271
  addOnDataWithCustomFields: addOnDataWithCustomFields,
7258
7272
  configs: configs,
7259
7273
  onAddOnSelect: onAddOnSelect
@@ -8615,8 +8629,9 @@ var TicketsSection = function TicketsSection(_ref) {
8615
8629
  return React__default.createElement(React__default.Fragment, null, !hideTicketsHeader && ticketsHeaderComponent, sortedTicketsList.map(function (ticket, i, arr) {
8616
8630
  var _arr;
8617
8631
  var ticketPriceWithoutFees = priceSymbol + " " + (+ticket.cost).toFixed(2);
8618
- var ticketPriceWithFees = priceSymbol + " " + (+ticket.price).toFixed(2);
8619
- var ticketOldPrice = priceSymbol + " " + (+ticket.oldPrice).toFixed(2);
8632
+ var ticketPriceWithFees = priceSymbol + " " + (+ticket.basePrice).toFixed(2);
8633
+ var ticketOldPriceWithFees = priceSymbol + " " + (+ticket.oldBasePrice).toFixed(2);
8634
+ var ticketOldPriceWithoutFees = priceSymbol + " " + (+ticket.oldCost).toFixed(2);
8620
8635
  var isSoldOut = ticket.sold_out || !(ticket.displayTicket || ticket.slotGroupId) || ticket.soldOut;
8621
8636
  var ticketSelect = function ticketSelect(event) {
8622
8637
  var value = event.target.value;
@@ -8627,7 +8642,8 @@ var TicketsSection = function TicketsSection(_ref) {
8627
8642
  ticketIsDiscounted = true;
8628
8643
  }
8629
8644
  var ticketIsFree = +ticket.price === 0;
8630
- var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH ? ticketPriceWithoutFees : ticketPriceWithFees;
8645
+ var discountTicketPriceElem = CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketOldPriceWithoutFees : ticketOldPriceWithFees;
8646
+ var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketPriceWithoutFees : ticketPriceWithFees;
8631
8647
  var isNewGroupTicket = (ticket == null ? void 0 : ticket.groupName) !== ((_arr = arr[i - 1]) == null ? void 0 : _arr.groupName);
8632
8648
  return React__default.createElement(React__default.Fragment, {
8633
8649
  key: ticket.id || ticket.name
@@ -8666,7 +8682,7 @@ var TicketsSection = function TicketsSection(_ref) {
8666
8682
  className: "event-detail__tier-price"
8667
8683
  }, ticketIsDiscounted && React__default.createElement("p", {
8668
8684
  className: "old-price"
8669
- }, ticketOldPrice), React__default.createElement("p", {
8685
+ }, discountTicketPriceElem), React__default.createElement("p", {
8670
8686
  className: isSoldOut ? 'sold-out' : ''
8671
8687
  }, ticketPriceElem), !isSoldOut && !ticketIsFree && React__default.createElement("p", {
8672
8688
  className: "fees"
@@ -8691,8 +8707,9 @@ var TicketsSection = function TicketsSection(_ref) {
8691
8707
  }), !hideTableTicketsHeader && tableTicketsHeaderComponent, tableTickets.map(function (ticket, i, arr) {
8692
8708
  var _arr2;
8693
8709
  var ticketPriceWithoutFees = priceSymbol + " " + (+ticket.cost).toFixed(2);
8694
- var ticketPriceWithFees = priceSymbol + " " + (+ticket.price).toFixed(2);
8695
- var ticketOldPrice = priceSymbol + " " + (+ticket.oldPrice).toFixed(2);
8710
+ var ticketPriceWithFees = priceSymbol + " " + (+ticket.basePrice).toFixed(2);
8711
+ var ticketOldPriceWithFees = priceSymbol + " " + (+ticket.oldBasePrice).toFixed(2);
8712
+ var ticketOldPriceWithoutFees = priceSymbol + " " + (+ticket.oldCost).toFixed(2);
8696
8713
  var isSoldOut = ticket.sold_out || !(ticket.displayTicket || ticket.slotGroupId) || ticket.soldOut;
8697
8714
  var ticketSelect = function ticketSelect(event) {
8698
8715
  var value = event.target.value;
@@ -8703,7 +8720,8 @@ var TicketsSection = function TicketsSection(_ref) {
8703
8720
  ticketIsDiscounted = true;
8704
8721
  }
8705
8722
  var ticketIsFree = +ticket.price === 0;
8706
- var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH ? ticketPriceWithoutFees : ticketPriceWithFees;
8723
+ var discountTicketPriceElem = CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketOldPriceWithoutFees : ticketOldPriceWithFees;
8724
+ var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketPriceWithoutFees : ticketPriceWithFees;
8707
8725
  var isNewGroupTicket = (ticket == null ? void 0 : ticket.groupName) !== ((_arr2 = arr[i - 1]) == null ? void 0 : _arr2.groupName);
8708
8726
  return React__default.createElement(React__default.Fragment, {
8709
8727
  key: ticket.id || ticket.name
@@ -8742,7 +8760,7 @@ var TicketsSection = function TicketsSection(_ref) {
8742
8760
  className: "event-detail__tier-price"
8743
8761
  }, ticketIsDiscounted && React__default.createElement("p", {
8744
8762
  className: "old-price"
8745
- }, ticketOldPrice), React__default.createElement("p", {
8763
+ }, discountTicketPriceElem), React__default.createElement("p", {
8746
8764
  className: isSoldOut ? 'sold-out' : ''
8747
8765
  }, ticketPriceElem), !isSoldOut && !ticketIsFree && React__default.createElement("p", {
8748
8766
  className: "fees"
@@ -9306,7 +9324,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
9306
9324
  var handleBook = /*#__PURE__*/function () {
9307
9325
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9308
9326
  var _product_options, _product_options2, _ticket_types;
9309
- var timeSlotTickets, 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;
9327
+ var timeSlotTickets, ticket, optionName, ticketId, 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;
9310
9328
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9311
9329
  while (1) switch (_context2.prev = _context2.next) {
9312
9330
  case 0:
@@ -9321,9 +9339,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
9321
9339
  }) || {};
9322
9340
  optionName = _get(ticket, 'optionName');
9323
9341
  ticketId = _get(ticket, 'id');
9324
- isTableType = _get(ticket, 'isTable', false);
9325
9342
  productCartQuantity = +selectedTickets[ticket.id];
9326
- ticketQuantity = isTableType ? 1 : +selectedTickets[ticket.id];
9343
+ ticketQuantity = +selectedTickets[ticket.id];
9327
9344
  data = {
9328
9345
  attributes: {
9329
9346
  alternative_view_id: null,
@@ -9336,30 +9353,30 @@ var TicketsContainer = function TicketsContainer(_ref) {
9336
9353
  }, _ticket_types)
9337
9354
  }
9338
9355
  };
9339
- _context2.prev = 9;
9356
+ _context2.prev = 8;
9340
9357
  onGetTicketsPress();
9341
- _context2.next = 13;
9358
+ _context2.next = 12;
9342
9359
  return addToCart(eventId, data);
9343
- case 13:
9360
+ case 12:
9344
9361
  result = _context2.sent;
9345
9362
  if (!enableAddOns) {
9346
- _context2.next = 20;
9363
+ _context2.next = 19;
9347
9364
  break;
9348
9365
  }
9349
- _context2.next = 17;
9366
+ _context2.next = 16;
9350
9367
  return getCheckoutPageConfigs();
9351
- case 17:
9368
+ case 16:
9352
9369
  _context2.t0 = _context2.sent;
9353
- _context2.next = 21;
9370
+ _context2.next = 20;
9354
9371
  break;
9355
- case 20:
9372
+ case 19:
9356
9373
  _context2.t0 = {
9357
9374
  status: 200,
9358
9375
  data: {
9359
9376
  attributes: _get(result, 'data.attributes')
9360
9377
  }
9361
9378
  };
9362
- case 21:
9379
+ case 20:
9363
9380
  pageConfigsDataResponse = _context2.t0;
9364
9381
  if (!(pageConfigsDataResponse.status === 200)) {
9365
9382
  _context2.next = 44;
@@ -9372,6 +9389,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
9372
9389
  hash = '';
9373
9390
  total = '';
9374
9391
  isBrowser && window.localStorage.removeItem('add_ons');
9392
+ isBrowser && window.localStorage.removeItem('checkoutAdditionalConfigs');
9375
9393
  if (!(skipBillingPage && !hasAddOn)) {
9376
9394
  _context2.next = 43;
9377
9395
  break;
@@ -9409,7 +9427,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
9409
9427
  break;
9410
9428
  case 46:
9411
9429
  _context2.prev = 46;
9412
- _context2.t2 = _context2["catch"](9);
9430
+ _context2.t2 = _context2["catch"](8);
9413
9431
  errorResponse = _get(_context2.t2, 'response', {});
9414
9432
  if (errorResponse != null && (_errorResponse$data = errorResponse.data) != null && (_errorResponse$data$d = _errorResponse$data.data) != null && _errorResponse$data$d.hasUnverifiedOrder) {
9415
9433
  setPendingVerificationMessage(errorResponse == null ? void 0 : (_errorResponse$data2 = errorResponse.data) == null ? void 0 : _errorResponse$data2.message);
@@ -9434,7 +9452,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
9434
9452
  case "end":
9435
9453
  return _context2.stop();
9436
9454
  }
9437
- }, _callee2, null, [[9, 46, 50, 53]]);
9455
+ }, _callee2, null, [[8, 46, 50, 53]]);
9438
9456
  }));
9439
9457
  return function handleBook() {
9440
9458
  return _ref4.apply(this, arguments);
@@ -11128,69 +11146,76 @@ var TicketResaleContainer = function TicketResaleContainer(_ref) {
11128
11146
  setSuccessMessage = _useState2[1];
11129
11147
  React.useEffect(function () {
11130
11148
  _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
11131
- var params, hash, isDeclined, response, _error$response, _error$response$data, _response, event_id, _error$response2, _error$response2$data;
11149
+ var params, hash, isDeclined, response, _error$response, _error$response$data, _response, event_id, eventHasAddons, invitationIncludesAddons, _error$response2, _error$response2$data;
11132
11150
  return _regeneratorRuntime().wrap(function _callee$(_context) {
11133
11151
  while (1) switch (_context.prev = _context.next) {
11134
11152
  case 0:
11135
11153
  if (!isWindowDefined) {
11136
- _context.next = 35;
11154
+ _context.next = 39;
11137
11155
  break;
11138
11156
  }
11139
11157
  params = new URL("" + window.location).searchParams;
11140
11158
  hash = params.get('invitation_hash') || orderHash || null;
11141
11159
  isDeclined = params.get('decline') || false;
11160
+ window.localStorage.removeItem('checkoutAdditionalConfigs');
11142
11161
  if (!hash) {
11143
- _context.next = 34;
11162
+ _context.next = 38;
11144
11163
  break;
11145
11164
  }
11146
11165
  if (!isDeclined) {
11147
- _context.next = 19;
11166
+ _context.next = 20;
11148
11167
  break;
11149
11168
  }
11150
- _context.prev = 6;
11151
- _context.next = 9;
11169
+ _context.prev = 7;
11170
+ _context.next = 10;
11152
11171
  return declineInvitation(hash);
11153
- case 9:
11172
+ case 10:
11154
11173
  response = _context.sent;
11155
11174
  onDeclineTicketPurchaseSuccess(response);
11156
11175
  setSuccessMessage("Thanks for letting us know! We'll offer this ticket to someone else!");
11157
- _context.next = 18;
11176
+ _context.next = 19;
11158
11177
  break;
11159
- case 14:
11160
- _context.prev = 14;
11161
- _context.t0 = _context["catch"](6);
11178
+ case 15:
11179
+ _context.prev = 15;
11180
+ _context.t0 = _context["catch"](7);
11162
11181
  setError(_context.t0 == null ? void 0 : (_error$response = _context.t0.response) == null ? void 0 : (_error$response$data = _error$response.data) == null ? void 0 : _error$response$data.message);
11163
11182
  onDeclineTicketPurchaseError(_context.t0.response);
11164
- case 18:
11165
- return _context.abrupt("return");
11166
11183
  case 19:
11167
- _context.prev = 19;
11168
- _context.next = 22;
11184
+ return _context.abrupt("return");
11185
+ case 20:
11186
+ _context.prev = 20;
11187
+ _context.next = 23;
11169
11188
  return processTicket(hash);
11170
- case 22:
11189
+ case 23:
11171
11190
  _response = _context.sent;
11172
11191
  event_id = _get(_response.data.data.attributes, 'event_id');
11192
+ eventHasAddons = _get(_response.data.data.attributes, 'has_add_on');
11193
+ invitationIncludesAddons = _get(_response.data.data.attributes, 'include_add_on');
11194
+ window.localStorage.setItem('checkoutAdditionalConfigs', JSON.stringify({
11195
+ resale: true,
11196
+ resaleWithAddons: eventHasAddons && invitationIncludesAddons
11197
+ }));
11173
11198
  onProcessTicketSuccess(_response.data);
11174
11199
  if (defaultRedirection) {
11175
11200
  window.location.href = (billingPath != null ? billingPath : '/billing/billing-info') + "?event_id=" + event_id;
11176
11201
  }
11177
- _context.next = 32;
11202
+ _context.next = 36;
11178
11203
  break;
11179
- case 28:
11180
- _context.prev = 28;
11181
- _context.t1 = _context["catch"](19);
11204
+ case 32:
11205
+ _context.prev = 32;
11206
+ _context.t1 = _context["catch"](20);
11182
11207
  setError(_context.t1 == null ? void 0 : (_error$response2 = _context.t1.response) == null ? void 0 : (_error$response2$data = _error$response2.data) == null ? void 0 : _error$response2$data.message);
11183
11208
  onProcessTicketError(_context.t1.response);
11184
- case 32:
11185
- _context.next = 35;
11209
+ case 36:
11210
+ _context.next = 39;
11186
11211
  break;
11187
- case 34:
11212
+ case 38:
11188
11213
  window.location.href = '/';
11189
- case 35:
11214
+ case 39:
11190
11215
  case "end":
11191
11216
  return _context.stop();
11192
11217
  }
11193
- }, _callee, null, [[6, 14], [19, 28]]);
11218
+ }, _callee, null, [[7, 15], [20, 32]]);
11194
11219
  }))();
11195
11220
  }, []);
11196
11221
  return React__default.createElement("div", {