tf-checkout-react 1.0.80 → 1.0.84

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.
@@ -27,6 +27,7 @@ export interface IBillingInfoPage {
27
27
  onAuthorizeError?: (e: AxiosError) => void;
28
28
  onLogin?: () => void;
29
29
  onLoginSuccess?: () => void;
30
+ onErrorClose?: () => void;
30
31
  initialValues?: FormikValues;
31
32
  buttonName?: string;
32
33
  theme?: 'light' | 'dark';
@@ -38,4 +39,4 @@ export interface IBillingInfoPage {
38
39
  checkbox?: CSSProperties;
39
40
  };
40
41
  }
41
- export declare const BillingInfoContainer: ({ data, ticketHoldersFields, initialValues, buttonName, handleSubmit, theme, onRegisterSuccess, onRegisterError, onSubmitError, onGetCartSuccess, onGetCartError, onGetCountriesSuccess, onGetCountriesError, onGetStatesSuccess, onGetStatesError, onGetProfileDataSuccess, onGetProfileDataError, onAuthorizeSuccess, onAuthorizeError, onLogin, onLoginSuccess, isLoggedIn: pIsLoggedIn, accountInfoTitle, hideLogo, themeOptions }: IBillingInfoPage) => JSX.Element;
42
+ export declare const BillingInfoContainer: ({ data, ticketHoldersFields, initialValues, buttonName, handleSubmit, theme, onRegisterSuccess, onRegisterError, onSubmitError, onGetCartSuccess, onGetCartError, onGetCountriesSuccess, onGetCountriesError, onGetStatesSuccess, onGetStatesError, onGetProfileDataSuccess, onGetProfileDataError, onAuthorizeSuccess, onAuthorizeError, onLogin, onLoginSuccess, isLoggedIn: pIsLoggedIn, accountInfoTitle, hideLogo, themeOptions, onErrorClose }: IBillingInfoPage) => JSX.Element;
@@ -27,6 +27,7 @@ export interface IGetTickets {
27
27
  checkbox?: CSSProperties;
28
28
  };
29
29
  isAccessCodeEnabled?: boolean;
30
+ hideSessionButtons?: boolean;
30
31
  }
31
32
  export interface ITicket {
32
33
  id: string | number;
@@ -35,5 +36,5 @@ export interface ITicket {
35
36
  export interface ISelectedTickets {
36
37
  [key: string]: string | number;
37
38
  }
38
- export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, }: IGetTickets) => JSX.Element;
39
+ export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons }: IGetTickets) => JSX.Element;
39
40
  export {};
@@ -12,6 +12,7 @@ var _identity = _interopDefault(require('lodash/identity'));
12
12
  var _map = _interopDefault(require('lodash/map'));
13
13
  var _get = _interopDefault(require('lodash/get'));
14
14
  var _includes = _interopDefault(require('lodash/includes'));
15
+ var _isEqual = _interopDefault(require('lodash/isEqual'));
15
16
  var axios = _interopDefault(require('axios'));
16
17
  var _forEach = _interopDefault(require('lodash/forEach'));
17
18
  var material = require('@mui/material');
@@ -1006,7 +1007,7 @@ var downloadPDF = function downloadPDF(pdfUrl) {
1006
1007
  }
1007
1008
  }).then( /*#__PURE__*/function () {
1008
1009
  var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(response) {
1009
- var blobValue;
1010
+ var blobValue, fileNameHeader, fileName;
1010
1011
  return runtime_1.wrap(function _callee$(_context) {
1011
1012
  while (1) {
1012
1013
  switch (_context.prev = _context.next) {
@@ -1016,9 +1017,14 @@ var downloadPDF = function downloadPDF(pdfUrl) {
1016
1017
 
1017
1018
  case 2:
1018
1019
  blobValue = _context.sent;
1019
- return _context.abrupt("return", blobValue);
1020
+ fileNameHeader = response.headers.get("content-disposition") || '';
1021
+ fileName = fileNameHeader.split('"')[1];
1022
+ return _context.abrupt("return", {
1023
+ blobValue: blobValue,
1024
+ fileName: fileName
1025
+ });
1020
1026
 
1021
- case 4:
1027
+ case 6:
1022
1028
  case "end":
1023
1029
  return _context.stop();
1024
1030
  }
@@ -1029,12 +1035,20 @@ var downloadPDF = function downloadPDF(pdfUrl) {
1029
1035
  return function (_x) {
1030
1036
  return _ref.apply(this, arguments);
1031
1037
  };
1032
- }()).then(function (blobValue) {
1038
+ }()).then(function (_ref2) {
1039
+ var blobValue = _ref2.blobValue,
1040
+ fileName = _ref2.fileName;
1041
+ if (!fileName) return;
1033
1042
  var file = new Blob([blobValue], {
1034
1043
  type: 'application/pdf'
1035
1044
  });
1036
1045
  var fileURL = URL.createObjectURL(file);
1037
- window.open(fileURL);
1046
+ var link = document.createElement('a');
1047
+ link.href = fileURL;
1048
+ link.setAttribute('download', fileName);
1049
+ document.body.appendChild(link);
1050
+ link.click();
1051
+ document.body.removeChild(link);
1038
1052
  });
1039
1053
  };
1040
1054
 
@@ -1244,8 +1258,14 @@ var getProfileData = function getProfileData(accessToken) {
1244
1258
  Authorization: "Bearer " + accessToken
1245
1259
  })
1246
1260
  })["catch"](function (e) {
1261
+ var _e$response, _e$response$data;
1262
+
1263
+ var errorType = e == null ? void 0 : (_e$response = e.response) == null ? void 0 : (_e$response$data = _e$response.data) == null ? void 0 : _e$response$data.error;
1264
+
1247
1265
  if (isWindowDefined) {
1248
- var event = new window.CustomEvent('auth_error', e);
1266
+ var event = new window.CustomEvent('auth_error', {
1267
+ detail: errorType
1268
+ });
1249
1269
  window.document.dispatchEvent(event);
1250
1270
  }
1251
1271
 
@@ -2224,7 +2244,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2224
2244
  _ref3$onGetStatesErro = _ref3.onGetStatesError,
2225
2245
  onGetStatesError = _ref3$onGetStatesErro === void 0 ? function () {} : _ref3$onGetStatesErro,
2226
2246
  _ref3$onGetProfileDat = _ref3.onGetProfileDataSuccess,
2227
- onGetProfileDataSuccess = _ref3$onGetProfileDat === void 0 ? function () {} : _ref3$onGetProfileDat,
2247
+ _onGetProfileDataSuccess = _ref3$onGetProfileDat === void 0 ? function () {} : _ref3$onGetProfileDat,
2228
2248
  _ref3$onGetProfileDat2 = _ref3.onGetProfileDataError,
2229
2249
  onGetProfileDataError = _ref3$onGetProfileDat2 === void 0 ? function () {} : _ref3$onGetProfileDat2,
2230
2250
  _ref3$onAuthorizeSucc = _ref3.onAuthorizeSuccess,
@@ -2239,7 +2259,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2239
2259
  _ref3$accountInfoTitl = _ref3.accountInfoTitle,
2240
2260
  accountInfoTitle = _ref3$accountInfoTitl === void 0 ? '' : _ref3$accountInfoTitl,
2241
2261
  hideLogo = _ref3.hideLogo,
2242
- themeOptions = _ref3.themeOptions;
2262
+ themeOptions = _ref3.themeOptions,
2263
+ _ref3$onErrorClose = _ref3.onErrorClose,
2264
+ onErrorClose = _ref3$onErrorClose === void 0 ? function () {} : _ref3$onErrorClose;
2265
+
2243
2266
  var themeMui = styles$1.createTheme(themeOptions);
2244
2267
  var isWindowDefined = typeof window !== 'undefined';
2245
2268
  var userData = isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
@@ -2303,6 +2326,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2303
2326
  userValues = _useState11[0],
2304
2327
  setUserValues = _useState11[1];
2305
2328
 
2329
+ var _useState12 = React.useState(null),
2330
+ error = _useState12[0],
2331
+ setError = _useState12[1];
2332
+
2306
2333
  var emailLogged = _get(userData, 'email', '') || _get(userValues, 'email', '');
2307
2334
 
2308
2335
  var firstNameLogged = _get(userData, 'first_name', '') || _get(userValues, 'first_name', '');
@@ -2314,11 +2341,25 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2314
2341
 
2315
2342
  var optedInFieldValue = _get(cartInfoData, 'optedIn', false);
2316
2343
 
2317
- var hideTtfOptIn = _get(cartInfoData, 'hide_ttf_opt_in', true);
2344
+ var ttfOptIn = _get(cartInfoData, 'ttfOptIn', false);
2318
2345
 
2319
- if (!_get(dataWithUniqueIds, '[0].uniqueId')) {
2320
- setDataWithUniqueIds(assingUniqueIds(data));
2321
- }
2346
+ var hideTtfOptIn = _get(cartInfoData, 'hide_ttf_opt_in', true); // Get prevProps
2347
+
2348
+
2349
+ var prevData = React.useRef(data);
2350
+ React.useEffect(function () {
2351
+ var hasUniqueId = _get(dataWithUniqueIds, '[0].uniqueId');
2352
+
2353
+ var isEqualData = _isEqual(prevData.current, data);
2354
+
2355
+ if (!hasUniqueId || !isEqualData) {
2356
+ setDataWithUniqueIds(assingUniqueIds(data));
2357
+
2358
+ if (!isEqualData) {
2359
+ prevData.current = data;
2360
+ }
2361
+ }
2362
+ }, [dataWithUniqueIds, data]);
2322
2363
 
2323
2364
  var getQuantity = function getQuantity(cart) {
2324
2365
  if (cart === void 0) {
@@ -2332,8 +2373,12 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2332
2373
  return qty;
2333
2374
  };
2334
2375
 
2335
- var handleAuthErrors = React.useCallback(function () {
2376
+ var handleAuthErrors = React.useCallback(function (e) {
2336
2377
  setIsLoggedIn(false);
2378
+
2379
+ if (isWindowDefined && (e == null ? void 0 : e.detail) === 'invalid_token') {
2380
+ window.location.href = '/';
2381
+ }
2337
2382
  }, []);
2338
2383
  React.useEffect(function () {
2339
2384
  isWindowDefined && window.document.addEventListener('auth_error', handleAuthErrors);
@@ -2471,7 +2516,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2471
2516
  lastName: profileDataObj.last_name
2472
2517
  }));
2473
2518
  window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
2474
- onGetProfileDataSuccess(userDataResponse.data);
2519
+
2520
+ _onGetProfileDataSuccess(userDataResponse.data);
2475
2521
 
2476
2522
  case 10:
2477
2523
  _context4.next = 15;
@@ -2507,12 +2553,13 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2507
2553
  initialValues: getInitialValues(dataWithUniqueIds, _extends({}, initialValues, {
2508
2554
  country: _get(userData, 'country', '') || "1",
2509
2555
  state: _get(userData, 'state', '') || "1",
2510
- brand_opt_in: optedInFieldValue
2556
+ brand_opt_in: optedInFieldValue,
2557
+ ttf_opt_in: ttfOptIn
2511
2558
  }), userValues),
2512
2559
  enableReinitialize: true,
2513
2560
  onSubmit: function () {
2514
2561
  var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(values, formikHelpers) {
2515
- var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, checkoutBodyForRegistration, bodyFormData, access_token_register, resRegister, refreshToken, tokens, _e$response, _e$response$data, error, profileData, profileSpecifiedData, profileDataObj, checkoutBody, res, _e$response2;
2562
+ var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, checkoutBodyForRegistration, bodyFormData, access_token_register, resRegister, refreshToken, tokens, _e$response, _e$response$data, _error, profileData, profileSpecifiedData, profileDataObj, checkoutBody, res, _e$response2, _e$response3;
2516
2563
 
2517
2564
  return runtime_1.wrap(function _callee5$(_context5) {
2518
2565
  while (1) {
@@ -2521,7 +2568,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2521
2568
  _context5.prev = 0;
2522
2569
 
2523
2570
  if (!isLoggedIn) {
2524
- _context5.next = 15;
2571
+ _context5.next = 17;
2525
2572
  break;
2526
2573
  }
2527
2574
 
@@ -2553,10 +2600,14 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2553
2600
 
2554
2601
  case 12:
2555
2602
  _res = _context5.sent;
2603
+ _context5.next = 15;
2604
+ return getPaymentData(_res.data.data.attributes.hash);
2605
+
2606
+ case 15:
2556
2607
  handleSubmit(values, formikHelpers, eventId, _res);
2557
2608
  return _context5.abrupt("return");
2558
2609
 
2559
- case 15:
2610
+ case 17:
2560
2611
  checkoutBodyForRegistration = createCheckoutDataBody(ticketsQuantity.length, values, {
2561
2612
  emailLogged: emailLogged,
2562
2613
  firstNameLogged: firstNameLogged,
@@ -2564,11 +2615,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2564
2615
  }, showDOB);
2565
2616
  bodyFormData = createRegisterFormData(values, checkoutBodyForRegistration);
2566
2617
  access_token_register = null;
2567
- _context5.prev = 18;
2568
- _context5.next = 21;
2618
+ _context5.prev = 20;
2619
+ _context5.next = 23;
2569
2620
  return register(bodyFormData);
2570
2621
 
2571
- case 21:
2622
+ case 23:
2572
2623
  resRegister = _context5.sent;
2573
2624
  access_token_register = _get(resRegister, 'data.data.attributes.access_token');
2574
2625
  refreshToken = _get(resRegister, 'data.data.attributes.refresh_token');
@@ -2578,26 +2629,26 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2578
2629
  refreshToken: refreshToken
2579
2630
  };
2580
2631
  onRegisterSuccess(tokens);
2581
- _context5.next = 33;
2632
+ _context5.next = 35;
2582
2633
  break;
2583
2634
 
2584
- case 29:
2585
- _context5.prev = 29;
2586
- _context5.t0 = _context5["catch"](18);
2635
+ case 31:
2636
+ _context5.prev = 31;
2637
+ _context5.t0 = _context5["catch"](20);
2587
2638
 
2588
2639
  if (axios.isAxiosError(_context5.t0)) {
2589
- error = _context5.t0 == null ? void 0 : (_e$response = _context5.t0.response) == null ? void 0 : (_e$response$data = _e$response.data) == null ? void 0 : _e$response$data.message;
2640
+ _error = _context5.t0 == null ? void 0 : (_e$response = _context5.t0.response) == null ? void 0 : (_e$response$data = _e$response.data) == null ? void 0 : _e$response$data.message;
2590
2641
 
2591
- if (_includes(error, 'You must be aged')) {
2592
- formikHelpers.setFieldError('holderAge', error);
2642
+ if (_includes(_error, 'You must be aged')) {
2643
+ formikHelpers.setFieldError('holderAge', _error);
2593
2644
  }
2594
2645
 
2595
- if (error != null && error.password) {
2596
- formikHelpers.setFieldError('password', error.password);
2597
- formikHelpers.setFieldError('confirmPassword', error.password);
2646
+ if (_error != null && _error.password) {
2647
+ formikHelpers.setFieldError('password', _error.password);
2648
+ formikHelpers.setFieldError('confirmPassword', _error.password);
2598
2649
  }
2599
2650
 
2600
- if (error != null && error.email && !onLogin) {
2651
+ if (_error != null && _error.email && !onLogin) {
2601
2652
  // False will stand for outside controll
2602
2653
  setAlreadyHasUser(true);
2603
2654
  setShowModalLogin(true);
@@ -2608,11 +2659,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2608
2659
 
2609
2660
  return _context5.abrupt("return");
2610
2661
 
2611
- case 33:
2612
- _context5.next = 35;
2662
+ case 35:
2663
+ _context5.next = 37;
2613
2664
  return getProfileData(access_token_register);
2614
2665
 
2615
- case 35:
2666
+ case 37:
2616
2667
  profileData = _context5.sent;
2617
2668
  profileSpecifiedData = _get(profileData, 'data.data');
2618
2669
  profileDataObj = setLoggedUserData(profileSpecifiedData);
@@ -2626,17 +2677,21 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2626
2677
  firstNameLogged: firstNameLogged,
2627
2678
  lastNameLogged: lastNameLogged
2628
2679
  }, showDOB);
2629
- _context5.next = 42;
2680
+ _context5.next = 44;
2630
2681
  return postOnCheckout(checkoutBody, access_token_register);
2631
2682
 
2632
- case 42:
2683
+ case 44:
2633
2684
  res = _context5.sent;
2685
+ _context5.next = 47;
2686
+ return getPaymentData(res.data.data.attributes.hash);
2687
+
2688
+ case 47:
2634
2689
  handleSubmit(values, formikHelpers, eventId, res);
2635
- _context5.next = 49;
2690
+ _context5.next = 53;
2636
2691
  break;
2637
2692
 
2638
- case 46:
2639
- _context5.prev = 46;
2693
+ case 50:
2694
+ _context5.prev = 50;
2640
2695
  _context5.t1 = _context5["catch"](0);
2641
2696
 
2642
2697
  if (axios.isAxiosError(_context5.t1)) {
@@ -2649,15 +2704,23 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2649
2704
  }
2650
2705
  }
2651
2706
 
2707
+ if ((_e$response3 = _context5.t1.response) != null && _e$response3.data.message) {
2708
+ if (typeof document !== undefined) {
2709
+ document.body.scrollTop = document.documentElement.scrollTop = 0;
2710
+ }
2711
+
2712
+ setError(_get(_context5.t1, 'response.data.message'));
2713
+ }
2714
+
2652
2715
  onSubmitError(_context5.t1);
2653
2716
  }
2654
2717
 
2655
- case 49:
2718
+ case 53:
2656
2719
  case "end":
2657
2720
  return _context5.stop();
2658
2721
  }
2659
2722
  }
2660
- }, _callee5, null, [[0, 46], [18, 29]]);
2723
+ }, _callee5, null, [[0, 50], [20, 31]]);
2661
2724
  }));
2662
2725
 
2663
2726
  function onSubmit(_x2, _x3) {
@@ -2679,7 +2742,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2679
2742
  onGetStatesError: onGetStatesError
2680
2743
  }), React__default.createElement("div", {
2681
2744
  className: "billing-info-container " + theme
2682
- }, !isLoggedIn && React__default.createElement("div", {
2745
+ }, error && React__default.createElement(material.Alert, {
2746
+ severity: "error",
2747
+ onClose: onErrorClose,
2748
+ variant: "filled"
2749
+ }, error), !isLoggedIn && React__default.createElement("div", {
2683
2750
  className: "account-actions-block"
2684
2751
  }, React__default.createElement("div", null, accountInfoTitle), React__default.createElement("div", null, "Login & skip ahead:"), React__default.createElement("div", {
2685
2752
  className: "login-block"
@@ -2751,13 +2818,13 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2751
2818
  var groupClassname = group.groupClassname,
2752
2819
  groupItems = group.groupItems;
2753
2820
  return React__default.createElement("div", {
2754
- key: group.uniqueId
2821
+ key: group.id
2755
2822
  }, React__default.createElement("div", {
2756
2823
  className: groupClassname
2757
2824
  }, _map(groupItems, function (element) {
2758
2825
  return React__default.createElement("div", {
2759
2826
  className: element.className,
2760
- key: element.uniqueId
2827
+ key: element.name
2761
2828
  }, React__default.createElement(formik.Field, {
2762
2829
  name: element.name + "-" + index,
2763
2830
  label: element.label,
@@ -2791,7 +2858,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2791
2858
  userExpired: userExpired,
2792
2859
  onAuthorizeSuccess: onAuthorizeSuccess,
2793
2860
  onAuthorizeError: onAuthorizeError,
2794
- onGetProfileDataSuccess: onGetProfileDataSuccess,
2861
+ onGetProfileDataSuccess: function onGetProfileDataSuccess(data) {
2862
+ fetchCart();
2863
+
2864
+ _onGetProfileDataSuccess(data);
2865
+ },
2795
2866
  onGetProfileDataError: onGetProfileDataError
2796
2867
  }), showModalRegister && React__default.createElement(RegisterModal, {
2797
2868
  onClose: function onClose() {
@@ -2800,7 +2871,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2800
2871
  onRegister: function onRegister() {
2801
2872
  setShowModalRegister(false);
2802
2873
  },
2803
- onGetProfileDataSuccess: onGetProfileDataSuccess,
2874
+ onGetProfileDataSuccess: function onGetProfileDataSuccess(data) {
2875
+ fetchCart();
2876
+
2877
+ _onGetProfileDataSuccess(data);
2878
+ },
2804
2879
  onGetProfileDataError: onGetProfileDataError
2805
2880
  }));
2806
2881
  };
@@ -4034,6 +4109,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
4034
4109
  setPromoCodeUpdated = _ref.setPromoCodeUpdated,
4035
4110
  setShowPromoInput = _ref.setShowPromoInput,
4036
4111
  isAccessCodeEnabled = _ref.isAccessCodeEnabled;
4112
+ var isPromoCodeHasValue = !!promoCode.trim();
4037
4113
 
4038
4114
  var renderInputField = function renderInputField() {
4039
4115
  return React__default.createElement("div", {
@@ -4049,14 +4125,18 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
4049
4125
  setPromoCode(e.target.value);
4050
4126
  },
4051
4127
  onKeyPress: function onKeyPress(event) {
4052
- if (event.key === 'Enter') {
4128
+ if (event.key === 'Enter' && isPromoCodeHasValue) {
4053
4129
  setPromoCodeUpdated(promoCode);
4130
+ setShowPromoInput(false);
4054
4131
  }
4055
4132
  }
4056
4133
  }), React__default.createElement(Button$1, {
4057
4134
  className: "promo-submit-button",
4058
4135
  onClick: function onClick() {
4059
- setPromoCodeUpdated(promoCode);
4136
+ if (isPromoCodeHasValue) {
4137
+ setPromoCodeUpdated(promoCode);
4138
+ setShowPromoInput(false);
4139
+ }
4060
4140
  }
4061
4141
  }, isAccessCodeEnabled ? 'ENTER' : 'APPLY'));
4062
4142
  };
@@ -4070,7 +4150,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
4070
4150
  }
4071
4151
  }), React__default.createElement("p", {
4072
4152
  className: "promo-code-success"
4073
- }, "PROMO CODE APPLIED SUCCESSFULLY")) : null, showPromoInput && !promoCodeIsApplied && renderInputField(), isPromotionsEnabled && !showPromoInput && !isAccessCodeEnabled ? React__default.createElement(Button$1, {
4153
+ }, "PROMO CODE APPLIED SUCCESSFULLY")) : null, showPromoInput && renderInputField(), isPromotionsEnabled && !showPromoInput && !isAccessCodeEnabled ? React__default.createElement(Button$1, {
4074
4154
  className: "promo-code-button",
4075
4155
  placeholder: "Promo Codes",
4076
4156
  onClick: function onClick() {
@@ -4184,7 +4264,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
4184
4264
  isPromotionsEnabled = _ref$isPromotionsEnab === void 0 ? true : _ref$isPromotionsEnab,
4185
4265
  themeOptions = _ref.themeOptions,
4186
4266
  _ref$isAccessCodeEnab = _ref.isAccessCodeEnabled,
4187
- isAccessCodeEnabled = _ref$isAccessCodeEnab === void 0 ? false : _ref$isAccessCodeEnab;
4267
+ isAccessCodeEnabled = _ref$isAccessCodeEnab === void 0 ? false : _ref$isAccessCodeEnab,
4268
+ _ref$hideSessionButto = _ref.hideSessionButtons,
4269
+ hideSessionButtons = _ref$hideSessionButto === void 0 ? false : _ref$hideSessionButto;
4188
4270
 
4189
4271
  var _useState = React.useState({}),
4190
4272
  selectedTickets = _useState[0],
@@ -4315,6 +4397,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
4315
4397
  setTickets(_get(attributes, 'tickets'));
4316
4398
  setShowWaitingList(attributes.showWaitingList);
4317
4399
  onGetTicketsSuccess(response.data);
4400
+ setPromoCode('');
4318
4401
  }
4319
4402
 
4320
4403
  if (eventResponse.data.success) {
@@ -4523,7 +4606,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
4523
4606
  "aria-hidden": true,
4524
4607
  className: "book-button " + (handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0 ? 'disabled' : ''),
4525
4608
  onClick: !handleBookIsLoading && !_isEmpty(selectedTickets) && Object.values(selectedTickets)[0] > 0 ? handleBook : function () {}
4526
- }, getTicketsLabel || 'GET TICKETS'), isLogged ? React__default.createElement("div", {
4609
+ }, getTicketsLabel || 'GET TICKETS'), isLogged && !hideSessionButtons ? React__default.createElement("div", {
4527
4610
  className: "session-wrapper"
4528
4611
  }, React__default.createElement("span", {
4529
4612
  className: "session-container"