tf-checkout-react 1.2.28 → 1.2.30

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.
@@ -13,9 +13,9 @@ import _map from 'lodash-es/map';
13
13
  import { nanoid } from 'nanoid';
14
14
  import React, { Component, useCallback, useEffect, useState, memo, useRef, Fragment } from 'react';
15
15
  import _forEach from 'lodash-es/forEach';
16
- import DatePicker from '@mui/lab/DatePicker';
17
- import AdapterMoment from '@mui/lab/AdapterMoment';
18
- import LocalizationProvider from '@mui/lab/LocalizationProvider';
16
+ import { DatePicker } from '@mui/x-date-pickers';
17
+ import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
18
+ import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
19
19
  import TextField from '@mui/material/TextField';
20
20
  import { useTheme } from '@mui/styles';
21
21
  import FormGroup from '@mui/material/FormGroup';
@@ -937,7 +937,7 @@ var getQueryVariable = function getQueryVariable(variable) {
937
937
  var pair = vars[i].split('=');
938
938
 
939
939
  if (pair[0] === variable) {
940
- return pair[1];
940
+ return decodeURIComponent(pair[1]);
941
941
  }
942
942
  }
943
943
  }
@@ -1605,6 +1605,12 @@ var compactStyles = {
1605
1605
  '& .MuiPickersDay-root': {
1606
1606
  width: DATE_SIZE,
1607
1607
  height: DATE_SIZE
1608
+ },
1609
+ '& .MuiPickersArrowSwitcher-spacer': {
1610
+ width: 0
1611
+ },
1612
+ '& [role="presentation"] .PrivatePickersFadeTransitionGroup-root': {
1613
+ marginRight: -1
1608
1614
  }
1609
1615
  };
1610
1616
  var compactStyleTheme = /*#__PURE__*/createTheme({
@@ -1654,7 +1660,7 @@ var DatePickerField = function DatePickerField(_ref) {
1654
1660
  })));
1655
1661
  };
1656
1662
 
1657
- var _excluded = ["label", "field", "selectOptions", "theme", "setFieldValue", "disableDropdown"];
1663
+ var _excluded = ["label", "field", "selectOptions", "theme", "setFieldValue", "disableDropdown", "setPhoneValidationIsLoading"];
1658
1664
  var CheckboxField = function CheckboxField(_ref) {
1659
1665
  var _rest$form, _field$name, _rest$form2, _field$name2;
1660
1666
 
@@ -1762,8 +1768,8 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
1762
1768
  defaultCountry: "us",
1763
1769
  disableDropdown: disableDropdown,
1764
1770
  label: label,
1765
- error: !!error && isTouched,
1766
- helperText: isTouched && error,
1771
+ error: !!error && (isTouched || fill),
1772
+ helperText: (isTouched || fill) && error,
1767
1773
  fullWidth: true,
1768
1774
  autoFormat: false,
1769
1775
  disableAreaCodes: true
@@ -2846,7 +2852,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref3) {
2846
2852
  var userData = isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
2847
2853
  var access_token = isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
2848
2854
 
2849
- var _useState = useState(data),
2855
+ var _useState = useState(assingUniqueIds(data)),
2850
2856
  dataWithUniqueIds = _useState[0],
2851
2857
  setDataWithUniqueIds = _useState[1];
2852
2858
 
@@ -6074,7 +6080,6 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
6074
6080
  holder_name = ticket.holder_name,
6075
6081
  event_name = ticket.event_name,
6076
6082
  currency = ticket.currency,
6077
- resale_fee_amount = ticket.resale_fee_amount,
6078
6083
  retain_amount_on_sale = ticket.retain_amount_on_sale,
6079
6084
  ticket_type_is_active = ticket.ticket_type_is_active;
6080
6085
  return React.createElement(Modal$1, {
@@ -6155,7 +6160,7 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
6155
6160
  type: "radio",
6156
6161
  value: "anyone",
6157
6162
  component: RadioField
6158
- })), React.createElement("div", null, React.createElement("h4", null, "Terms of Resale"), React.createElement("p", null, "I confirm that I want to sell this ticket and that, if someone chooses to buy it, I will no longer own it or have the right to ask for it back."), React.createElement("p", null, "I also understand that, if no one chooses to buy it, it remains my property, is valid for entry to ", React.createElement("strong", null, event_name), " and I will not receive any refund."), React.createElement("p", null, "If my ticket is sold, the original card I used to buy my ticket will be refunded with the original amount paid, minus a small handling fee of ", React.createElement("strong", null, (currency != null ? currency : '') + " " + (retain_amount_on_sale != null ? retain_amount_on_sale : '0')), ", and that any existing refunds due to me for referring sales for this event are no longer valid."), React.createElement("p", null, "In order to receive the refund, I agree to pay a fee of ", React.createElement("strong", null, (currency != null ? currency : '') + " " + (resale_fee_amount != null ? resale_fee_amount : '0')), "."), React.createElement(Field, {
6163
+ })), React.createElement("div", null, React.createElement("h4", null, "Terms of Resale"), React.createElement("p", null, "I confirm that I want to sell this ticket and that, if someone chooses to buy it, I will no longer own it or have the right to ask for it back."), React.createElement("p", null, "I also understand that, if no one chooses to buy it, it remains my property, is valid for entry to ", React.createElement("strong", null, event_name), " and I will not receive any refund."), React.createElement("p", null, "If my ticket is sold, the original card I used to buy my ticket will be refunded with the original amount paid, minus a small handling fee of ", React.createElement("strong", null, (currency != null ? currency : '') + " " + (retain_amount_on_sale != null ? retain_amount_on_sale : '0')), ", and that any existing refunds due to me for referring sales for this event are no longer valid."), React.createElement(Field, {
6159
6164
  name: 'confirm',
6160
6165
  label: 'I agree',
6161
6166
  type: 'checkbox',
@@ -6189,10 +6194,18 @@ var TicketsTable = function TicketsTable(_ref) {
6189
6194
  pdfError = _useState[0],
6190
6195
  setPdfError = _useState[1];
6191
6196
 
6197
+ var _useState2 = useState({
6198
+ hash: '',
6199
+ loading: false
6200
+ }),
6201
+ pdfDownload = _useState2[0],
6202
+ setPdfDownload = _useState2[1];
6203
+
6192
6204
  var getRow = function getRow(ticket) {
6193
6205
  return _map(columns, function (column, columnIndex) {
6194
6206
  if (column.key === 'download') {
6195
- if (ticket.pdf_link && ticket.status === 'Sold') return null;
6207
+ var ticketIsDownloading = pdfDownload.loading && pdfDownload.hash === ticket.hash;
6208
+ if (!ticket.pdf_link || ticket.status === 'Sold' || ticket.is_on_sale) return null;
6196
6209
  return React.createElement(TableCell, {
6197
6210
  key: columnIndex
6198
6211
  }, Boolean(icon) && React.createElement("img", {
@@ -6208,34 +6221,54 @@ var TicketsTable = function TicketsTable(_ref) {
6208
6221
  while (1) {
6209
6222
  switch (_context.prev = _context.next) {
6210
6223
  case 0:
6211
- _context.prev = 0;
6212
- _context.next = 3;
6224
+ if (!ticketIsDownloading) {
6225
+ _context.next = 2;
6226
+ break;
6227
+ }
6228
+
6229
+ return _context.abrupt("return");
6230
+
6231
+ case 2:
6232
+ setPdfDownload({
6233
+ hash: ticket.hash,
6234
+ loading: true
6235
+ });
6236
+ _context.prev = 3;
6237
+ _context.next = 6;
6213
6238
  return downloadPDF(ticket.pdf_link);
6214
6239
 
6215
- case 3:
6240
+ case 6:
6216
6241
  pdfDownloadError = _context.sent;
6217
6242
 
6218
6243
  if (pdfDownloadError) {
6219
6244
  setPdfError(pdfDownloadError == null ? void 0 : pdfDownloadError.message);
6220
6245
  }
6221
6246
 
6222
- _context.next = 10;
6247
+ _context.next = 13;
6223
6248
  break;
6224
6249
 
6225
- case 7:
6226
- _context.prev = 7;
6227
- _context.t0 = _context["catch"](0);
6250
+ case 10:
6251
+ _context.prev = 10;
6252
+ _context.t0 = _context["catch"](3);
6228
6253
 
6229
6254
  if (_context.t0 && typeof _context.t0 === 'string') {
6230
6255
  setPdfError(_context.t0);
6231
6256
  }
6232
6257
 
6233
- case 10:
6258
+ case 13:
6259
+ _context.prev = 13;
6260
+ setPdfDownload({
6261
+ hash: '',
6262
+ loading: false
6263
+ });
6264
+ return _context.finish(13);
6265
+
6266
+ case 16:
6234
6267
  case "end":
6235
6268
  return _context.stop();
6236
6269
  }
6237
6270
  }
6238
- }, _callee, null, [[0, 7]]);
6271
+ }, _callee, null, [[3, 10, 13, 16]]);
6239
6272
  }));
6240
6273
 
6241
6274
  function onClick() {
@@ -6244,7 +6277,9 @@ var TicketsTable = function TicketsTable(_ref) {
6244
6277
 
6245
6278
  return onClick;
6246
6279
  }()
6247
- }, "Download"));
6280
+ }, ticketIsDownloading ? React.createElement(CircularProgress, {
6281
+ size: "22px"
6282
+ }) : 'Download'));
6248
6283
  }
6249
6284
 
6250
6285
  if (column.key === 'sell_ticket') {