tf-checkout-react 1.0.71 → 1.0.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.d.ts +1 -0
- package/dist/components/billing-info-container/index.d.ts +4 -2
- package/dist/components/common/CheckboxField.d.ts +1 -1
- package/dist/components/common/FormikPhoneNumberField.d.ts +1 -1
- package/dist/components/confirmationContainer/index.d.ts +2 -1
- package/dist/components/paymentContainer/index.d.ts +2 -1
- package/dist/components/stripePayment/index.d.ts +2 -1
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +12 -0
- package/dist/components/ticketsContainer/index.d.ts +2 -1
- package/dist/components/waitingList/index.d.ts +2 -1
- package/dist/env.d.ts +2 -2
- package/dist/images/done.svg +3 -0
- package/dist/tf-checkout-react.cjs.development.js +192 -122
- 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 +197 -127
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/dist/utils/setConfigs.d.ts +2 -1
- package/package.json +2 -2
- package/src/api/index.ts +6 -18
- package/src/assets/images/done.svg +3 -0
- package/src/components/billing-info-container/index.tsx +36 -21
- package/src/components/common/CheckboxField.tsx +1 -0
- package/src/components/common/FormikPhoneNumberField.tsx +1 -0
- package/src/components/confirmationContainer/index.tsx +59 -43
- package/src/components/paymentContainer/index.tsx +86 -45
- package/src/components/stripePayment/index.tsx +23 -15
- package/src/components/ticketsContainer/PromoCodeSection.tsx +82 -0
- package/src/components/ticketsContainer/index.tsx +51 -79
- package/src/components/ticketsContainer/style.css +6 -4
- package/src/components/waitingList/index.tsx +7 -4
- package/src/env.ts +4 -4
- package/src/utils/setConfigs.ts +7 -2
|
@@ -28,10 +28,10 @@ var Select = _interopDefault(require('@mui/material/Select'));
|
|
|
28
28
|
var MuiPhoneNumber = _interopDefault(require('material-ui-phone-number'));
|
|
29
29
|
var styles = require('@mui/material/styles');
|
|
30
30
|
var Container = _interopDefault(require('@mui/material/Container'));
|
|
31
|
+
var CircularProgress = _interopDefault(require('@mui/material/CircularProgress'));
|
|
31
32
|
var Alert = _interopDefault(require('@mui/material/Alert'));
|
|
32
33
|
var reactStripeJs = require('@stripe/react-stripe-js');
|
|
33
34
|
var stripeJs = require('@stripe/stripe-js');
|
|
34
|
-
var CircularProgress = _interopDefault(require('@mui/material/CircularProgress'));
|
|
35
35
|
var reactShare = require('react-share');
|
|
36
36
|
var _some = _interopDefault(require('lodash/some'));
|
|
37
37
|
var _find = _interopDefault(require('lodash/find'));
|
|
@@ -43,6 +43,7 @@ var _has = _interopDefault(require('lodash/has'));
|
|
|
43
43
|
var FormControl = _interopDefault(require('@mui/material/FormControl'));
|
|
44
44
|
var MenuItem = _interopDefault(require('@mui/material/MenuItem'));
|
|
45
45
|
var Button$1 = _interopDefault(require('@mui/material/Button'));
|
|
46
|
+
var SVG = _interopDefault(require('react-inlinesvg'));
|
|
46
47
|
var Table = _interopDefault(require('@mui/material/Table'));
|
|
47
48
|
var TableBody = _interopDefault(require('@mui/material/TableBody'));
|
|
48
49
|
var TableCell = _interopDefault(require('@mui/material/TableCell'));
|
|
@@ -931,6 +932,10 @@ var setConfigs = function setConfigs(configs) {
|
|
|
931
932
|
});
|
|
932
933
|
|
|
933
934
|
publicRequest.setBaseUrl(CONFIGS.BASE_URL);
|
|
935
|
+
|
|
936
|
+
if (CONFIGS.X_SOURCE_ORIGIN) {
|
|
937
|
+
setXSourceOrigin(CONFIGS.X_SOURCE_ORIGIN);
|
|
938
|
+
}
|
|
934
939
|
};
|
|
935
940
|
|
|
936
941
|
var getQueryVariable = function getQueryVariable(variable) {
|
|
@@ -990,8 +995,6 @@ var ErrorFocusInternal = /*#__PURE__*/function (_Component) {
|
|
|
990
995
|
var ErrorFocus = /*#__PURE__*/formik.connect(ErrorFocusInternal);
|
|
991
996
|
|
|
992
997
|
var isWindowDefined = typeof window !== 'undefined';
|
|
993
|
-
var discardedOrigins = ['http://localhost', 'gtsb.io', 'gatsbyjs.io', 'https://www.houseofx.nyc', 'https://tickets-staging.houseofx.nyc'];
|
|
994
|
-
var origin = isWindowDefined && window.location.origin;
|
|
995
998
|
var ttfHeaders = {
|
|
996
999
|
Accept: 'application/vnd.api+json',
|
|
997
1000
|
'Content-Type': 'application/vnd.api+json'
|
|
@@ -1001,12 +1004,6 @@ if (isWindowDefined && localStorage.getItem('auth_guest_token')) {
|
|
|
1001
1004
|
ttfHeaders['Authorization-Guest'] = /*#__PURE__*/localStorage.getItem('auth_guest_token');
|
|
1002
1005
|
}
|
|
1003
1006
|
|
|
1004
|
-
if (isWindowDefined && !discardedOrigins.some(function (el) {
|
|
1005
|
-
return origin && origin.includes(el);
|
|
1006
|
-
})) {
|
|
1007
|
-
ttfHeaders['X-Source-Origin'] = 'houseofx.nyc';
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
1007
|
var publicRequest = /*#__PURE__*/axios.create({
|
|
1011
1008
|
baseURL: CONFIGS.BASE_URL || "https://www.ticketfairy.com/api",
|
|
1012
1009
|
headers: ttfHeaders
|
|
@@ -1049,11 +1046,9 @@ publicRequest.interceptors.request.use(function (config) {
|
|
|
1049
1046
|
config.headers = _updatedHeaders;
|
|
1050
1047
|
}
|
|
1051
1048
|
|
|
1052
|
-
if (
|
|
1053
|
-
return origin && origin.includes(el);
|
|
1054
|
-
})) {
|
|
1049
|
+
if (CONFIGS.X_SOURCE_ORIGIN) {
|
|
1055
1050
|
var _updatedHeaders2 = _extends({}, config.headers, {
|
|
1056
|
-
'X-Source-Origin':
|
|
1051
|
+
'X-Source-Origin': CONFIGS.X_SOURCE_ORIGIN
|
|
1057
1052
|
});
|
|
1058
1053
|
|
|
1059
1054
|
config.headers = _updatedHeaders2;
|
|
@@ -1078,6 +1073,9 @@ publicRequest.setAccessToken = function (token) {
|
|
|
1078
1073
|
return publicRequest.defaults.headers.common.Authorization = token;
|
|
1079
1074
|
};
|
|
1080
1075
|
|
|
1076
|
+
var setXSourceOrigin = function setXSourceOrigin(sourceOrigin) {
|
|
1077
|
+
ttfHeaders['X-Source-Origin'] = sourceOrigin;
|
|
1078
|
+
};
|
|
1081
1079
|
var setCustomHeader = function setCustomHeader(response) {
|
|
1082
1080
|
var guestHeaderResponseValue = _get(response, 'headers.authorization-guest');
|
|
1083
1081
|
|
|
@@ -1810,7 +1808,7 @@ var CustomField = function CustomField(_ref) {
|
|
|
1810
1808
|
}) : null);
|
|
1811
1809
|
};
|
|
1812
1810
|
|
|
1813
|
-
var _excluded$1 = ["label", "field", "selectOptions", "theme"];
|
|
1811
|
+
var _excluded$1 = ["label", "field", "selectOptions", "theme", "setFieldValue"];
|
|
1814
1812
|
var CheckboxField = function CheckboxField(_ref) {
|
|
1815
1813
|
var label = _ref.label,
|
|
1816
1814
|
field = _ref.field,
|
|
@@ -1942,7 +1940,7 @@ var removePlusSign = function removePlusSign(string) {
|
|
|
1942
1940
|
return string.replace('+', '');
|
|
1943
1941
|
};
|
|
1944
1942
|
|
|
1945
|
-
var _excluded$2 = ["label", "field", "form", "setFieldValue"];
|
|
1943
|
+
var _excluded$2 = ["label", "field", "form", "setFieldValue", "selectOptions"];
|
|
1946
1944
|
var FormikPhoneNumberField = function FormikPhoneNumberField(_ref) {
|
|
1947
1945
|
var label = _ref.label,
|
|
1948
1946
|
field = _ref.field,
|
|
@@ -1971,22 +1969,6 @@ var FormikPhoneNumberField = function FormikPhoneNumberField(_ref) {
|
|
|
1971
1969
|
}, rest));
|
|
1972
1970
|
};
|
|
1973
1971
|
|
|
1974
|
-
var getImage = function getImage(name) {
|
|
1975
|
-
if (name === void 0) {
|
|
1976
|
-
name = '';
|
|
1977
|
-
}
|
|
1978
|
-
|
|
1979
|
-
var image = '';
|
|
1980
|
-
|
|
1981
|
-
if (!name.trim().length) {
|
|
1982
|
-
return image;
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
|
-
return image;
|
|
1986
|
-
};
|
|
1987
|
-
|
|
1988
|
-
var TTFLOGO = /*#__PURE__*/getImage('logo-ttf.png');
|
|
1989
|
-
|
|
1990
1972
|
var LogicRunner = function LogicRunner(_ref) {
|
|
1991
1973
|
var values = _ref.values,
|
|
1992
1974
|
setStates = _ref.setStates,
|
|
@@ -2125,13 +2107,15 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2125
2107
|
onAuthorizeSuccess = _ref3$onAuthorizeSucc === void 0 ? function () {} : _ref3$onAuthorizeSucc,
|
|
2126
2108
|
_ref3$onAuthorizeErro = _ref3.onAuthorizeError,
|
|
2127
2109
|
onAuthorizeError = _ref3$onAuthorizeErro === void 0 ? function () {} : _ref3$onAuthorizeErro,
|
|
2128
|
-
|
|
2129
|
-
onLogin = _ref3$onLogin === void 0 ? function () {} : _ref3$onLogin,
|
|
2110
|
+
onLogin = _ref3.onLogin,
|
|
2130
2111
|
_ref3$onLoginSuccess = _ref3.onLoginSuccess,
|
|
2131
2112
|
onLoginSuccess = _ref3$onLoginSuccess === void 0 ? function () {} : _ref3$onLoginSuccess,
|
|
2132
2113
|
_ref3$isLoggedIn = _ref3.isLoggedIn,
|
|
2133
2114
|
pIsLoggedIn = _ref3$isLoggedIn === void 0 ? false : _ref3$isLoggedIn,
|
|
2134
|
-
|
|
2115
|
+
_ref3$accountInfoTitl = _ref3.accountInfoTitle,
|
|
2116
|
+
accountInfoTitle = _ref3$accountInfoTitl === void 0 ? '' : _ref3$accountInfoTitl,
|
|
2117
|
+
fontFamily = _ref3.fontFamily,
|
|
2118
|
+
hideLogo = _ref3.hideLogo;
|
|
2135
2119
|
var themeMui = styles.createTheme({
|
|
2136
2120
|
typography: {
|
|
2137
2121
|
allVariants: {
|
|
@@ -2234,9 +2218,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2234
2218
|
setIsLoggedIn(false);
|
|
2235
2219
|
}, []);
|
|
2236
2220
|
React.useEffect(function () {
|
|
2237
|
-
isWindowDefined && window.document.addEventListener(
|
|
2221
|
+
isWindowDefined && window.document.addEventListener('auth_error', handleAuthErrors);
|
|
2238
2222
|
return function () {
|
|
2239
|
-
isWindowDefined && window.document.removeEventListener(
|
|
2223
|
+
isWindowDefined && window.document.removeEventListener('auth_error', handleAuthErrors);
|
|
2240
2224
|
};
|
|
2241
2225
|
}, [handleAuthErrors]);
|
|
2242
2226
|
React.useEffect(function () {
|
|
@@ -2493,12 +2477,13 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2493
2477
|
formikHelpers.setFieldError('confirmPassword', error.password);
|
|
2494
2478
|
}
|
|
2495
2479
|
|
|
2496
|
-
if (error != null && error.email) {
|
|
2480
|
+
if (error != null && error.email && !onLogin) {
|
|
2481
|
+
// False will stand for outside controll
|
|
2497
2482
|
setAlreadyHasUser(true);
|
|
2498
2483
|
setShowModalLogin(true);
|
|
2499
2484
|
}
|
|
2500
2485
|
|
|
2501
|
-
onRegisterError(_context5.t0);
|
|
2486
|
+
onRegisterError(_context5.t0, values.email);
|
|
2502
2487
|
}
|
|
2503
2488
|
|
|
2504
2489
|
return _context5.abrupt("return");
|
|
@@ -2576,19 +2561,23 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2576
2561
|
className: "billing-info-container " + theme
|
|
2577
2562
|
}, !isLoggedIn && React__default.createElement("div", {
|
|
2578
2563
|
className: "account-actions-block"
|
|
2579
|
-
}, React__default.createElement("div", null,
|
|
2564
|
+
}, React__default.createElement("div", null, accountInfoTitle), React__default.createElement("div", null, "Login & skip ahead:"), React__default.createElement("div", {
|
|
2580
2565
|
className: "login-block"
|
|
2581
2566
|
}, React__default.createElement("button", {
|
|
2582
2567
|
className: "login-register-button",
|
|
2583
2568
|
type: "button",
|
|
2584
2569
|
onClick: function onClick() {
|
|
2585
|
-
|
|
2586
|
-
|
|
2570
|
+
// If outside login needed to skip package login functionallity
|
|
2571
|
+
if (onLogin) {
|
|
2572
|
+
onLogin();
|
|
2573
|
+
} else {
|
|
2574
|
+
setShowModalLogin(true);
|
|
2575
|
+
}
|
|
2587
2576
|
}
|
|
2588
|
-
}, "Login"), React__default.createElement("div", {
|
|
2577
|
+
}, "Login"), !hideLogo && React__default.createElement("div", {
|
|
2589
2578
|
className: "logo-image-container"
|
|
2590
2579
|
}, React__default.createElement("img", {
|
|
2591
|
-
src:
|
|
2580
|
+
src: theme === 'dark' ? 'https://www.ticketfairy.com/resources/images/logo-ttf.svg' : 'https://www.ticketfairy.com/resources/images/logo-ttf-black.svg',
|
|
2592
2581
|
alt: "nodata"
|
|
2593
2582
|
})))), _map(dataWithUniqueIds, function (item) {
|
|
2594
2583
|
var label = item.label,
|
|
@@ -2735,7 +2724,8 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2735
2724
|
_ref$handleSetLoading = _ref.handleSetLoading,
|
|
2736
2725
|
handleSetLoading = _ref$handleSetLoading === void 0 ? function () {} : _ref$handleSetLoading,
|
|
2737
2726
|
_ref$conditions = _ref.conditions,
|
|
2738
|
-
conditions = _ref$conditions === void 0 ? [] : _ref$conditions
|
|
2727
|
+
conditions = _ref$conditions === void 0 ? [] : _ref$conditions,
|
|
2728
|
+
disableZipSection = _ref.disableZipSection;
|
|
2739
2729
|
var stripe = reactStripeJs.useStripe();
|
|
2740
2730
|
var elements = reactStripeJs.useElements();
|
|
2741
2731
|
|
|
@@ -2767,7 +2757,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2767
2757
|
_context.prev = 1;
|
|
2768
2758
|
event.preventDefault();
|
|
2769
2759
|
|
|
2770
|
-
if (postalCode) {
|
|
2760
|
+
if (!(!postalCode && !disableZipSection)) {
|
|
2771
2761
|
_context.next = 7;
|
|
2772
2762
|
break;
|
|
2773
2763
|
}
|
|
@@ -2792,10 +2782,14 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2792
2782
|
address = {
|
|
2793
2783
|
city: billing_info.city,
|
|
2794
2784
|
line1: billing_info.street_address,
|
|
2795
|
-
state: billing_info.state
|
|
2796
|
-
postal_code: postalCode
|
|
2785
|
+
state: billing_info.state
|
|
2797
2786
|
};
|
|
2798
|
-
|
|
2787
|
+
|
|
2788
|
+
if (!disableZipSection) {
|
|
2789
|
+
address.postal_code = postalCode;
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
_context.next = 15;
|
|
2799
2793
|
return stripe.createPaymentMethod({
|
|
2800
2794
|
type: 'card',
|
|
2801
2795
|
card: card || {
|
|
@@ -2806,11 +2800,11 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2806
2800
|
}
|
|
2807
2801
|
});
|
|
2808
2802
|
|
|
2809
|
-
case
|
|
2803
|
+
case 15:
|
|
2810
2804
|
paymentMethodReq = _context.sent;
|
|
2811
2805
|
|
|
2812
2806
|
if (!paymentMethodReq.error) {
|
|
2813
|
-
_context.next =
|
|
2807
|
+
_context.next = 20;
|
|
2814
2808
|
break;
|
|
2815
2809
|
}
|
|
2816
2810
|
|
|
@@ -2818,18 +2812,18 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2818
2812
|
handleSetLoading(false);
|
|
2819
2813
|
return _context.abrupt("return");
|
|
2820
2814
|
|
|
2821
|
-
case
|
|
2822
|
-
_context.next =
|
|
2815
|
+
case 20:
|
|
2816
|
+
_context.next = 22;
|
|
2823
2817
|
return stripe.confirmCardPayment(stripe_client_secret, {
|
|
2824
2818
|
payment_method: paymentMethodReq.paymentMethod.id
|
|
2825
2819
|
});
|
|
2826
2820
|
|
|
2827
|
-
case
|
|
2821
|
+
case 22:
|
|
2828
2822
|
_yield$stripe$confirm = _context.sent;
|
|
2829
2823
|
_error = _yield$stripe$confirm.error;
|
|
2830
2824
|
|
|
2831
2825
|
if (!_error) {
|
|
2832
|
-
_context.next =
|
|
2826
|
+
_context.next = 28;
|
|
2833
2827
|
break;
|
|
2834
2828
|
}
|
|
2835
2829
|
|
|
@@ -2837,22 +2831,22 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2837
2831
|
handleSetLoading(false);
|
|
2838
2832
|
return _context.abrupt("return");
|
|
2839
2833
|
|
|
2840
|
-
case
|
|
2834
|
+
case 28:
|
|
2841
2835
|
onSubmit(null);
|
|
2842
|
-
_context.next =
|
|
2836
|
+
_context.next = 34;
|
|
2843
2837
|
break;
|
|
2844
2838
|
|
|
2845
|
-
case
|
|
2846
|
-
_context.prev =
|
|
2839
|
+
case 31:
|
|
2840
|
+
_context.prev = 31;
|
|
2847
2841
|
_context.t0 = _context["catch"](1);
|
|
2848
2842
|
onSubmit(_context.t0);
|
|
2849
2843
|
|
|
2850
|
-
case
|
|
2844
|
+
case 34:
|
|
2851
2845
|
case "end":
|
|
2852
2846
|
return _context.stop();
|
|
2853
2847
|
}
|
|
2854
2848
|
}
|
|
2855
|
-
}, _callee, null, [[1,
|
|
2849
|
+
}, _callee, null, [[1, 31]]);
|
|
2856
2850
|
}));
|
|
2857
2851
|
|
|
2858
2852
|
return function handleSubmit(_x) {
|
|
@@ -2913,7 +2907,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2913
2907
|
}, React__default.createElement("span", {
|
|
2914
2908
|
className: "card_label_text"
|
|
2915
2909
|
}, "Card number"), React__default.createElement(reactStripeJs.CardNumberElement, {
|
|
2916
|
-
options: _extends({}, options, stripeCardOptions),
|
|
2910
|
+
options: _extends({}, options.style, stripeCardOptions),
|
|
2917
2911
|
onReady: _identity,
|
|
2918
2912
|
onChange: _identity,
|
|
2919
2913
|
onBlur: _identity,
|
|
@@ -2923,14 +2917,14 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2923
2917
|
}, React__default.createElement("span", {
|
|
2924
2918
|
className: "card_label_text"
|
|
2925
2919
|
}, "Expiration date"), React__default.createElement(reactStripeJs.CardExpiryElement, {
|
|
2926
|
-
options: _extends({}, options, stripeCardOptions)
|
|
2920
|
+
options: _extends({}, options.style, stripeCardOptions)
|
|
2927
2921
|
})), React__default.createElement("label", {
|
|
2928
2922
|
className: "cvc_element"
|
|
2929
2923
|
}, React__default.createElement("span", {
|
|
2930
2924
|
className: "card_label_text"
|
|
2931
2925
|
}, "CVC"), React__default.createElement(reactStripeJs.CardCvcElement, {
|
|
2932
|
-
options: _extends({}, options, stripeCardOptions)
|
|
2933
|
-
})), React__default.createElement("label", {
|
|
2926
|
+
options: _extends({}, options.style, stripeCardOptions)
|
|
2927
|
+
})), !disableZipSection && React__default.createElement("label", {
|
|
2934
2928
|
className: "zip_element"
|
|
2935
2929
|
}, React__default.createElement("p", {
|
|
2936
2930
|
className: "card_label_text"
|
|
@@ -2960,8 +2954,28 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2960
2954
|
}, isLoading ? React__default.createElement(CircularProgress, null) : "Pay " + getCurrencySymbolByCurrency(currency) + total))));
|
|
2961
2955
|
};
|
|
2962
2956
|
|
|
2963
|
-
var publishableKey = CONFIGS.STRIPE_PUBLISHABLE_KEY || '
|
|
2964
|
-
|
|
2957
|
+
var publishableKey = CONFIGS.STRIPE_PUBLISHABLE_KEY || '';
|
|
2958
|
+
|
|
2959
|
+
var getStripePromise = function getStripePromise(reviewData) {
|
|
2960
|
+
var stripePublishableKey = _get(reviewData, 'payment_method.stripe_publishable_key') || publishableKey;
|
|
2961
|
+
|
|
2962
|
+
var stripeAccount = _get(reviewData, 'payment_method.stripe_connected_account');
|
|
2963
|
+
|
|
2964
|
+
var options = {};
|
|
2965
|
+
|
|
2966
|
+
if (stripeAccount) {
|
|
2967
|
+
options.stripeAccount = stripeAccount;
|
|
2968
|
+
}
|
|
2969
|
+
|
|
2970
|
+
return stripeJs.loadStripe(stripePublishableKey, options);
|
|
2971
|
+
};
|
|
2972
|
+
|
|
2973
|
+
function Loader() {
|
|
2974
|
+
return React__default.createElement("div", {
|
|
2975
|
+
className: "loader-container"
|
|
2976
|
+
}, React__default.createElement(CircularProgress, null));
|
|
2977
|
+
}
|
|
2978
|
+
|
|
2965
2979
|
var initialOrderValues = {
|
|
2966
2980
|
product_name: '',
|
|
2967
2981
|
ticketType: '',
|
|
@@ -2997,6 +3011,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
2997
3011
|
onPaymentError = _ref$onPaymentError === void 0 ? function () {} : _ref$onPaymentError,
|
|
2998
3012
|
_ref$stripeCardOption = _ref.stripeCardOptions,
|
|
2999
3013
|
stripeCardOptions = _ref$stripeCardOption === void 0 ? {} : _ref$stripeCardOption,
|
|
3014
|
+
_ref$disableZipSectio = _ref.disableZipSection,
|
|
3015
|
+
disableZipSection = _ref$disableZipSectio === void 0 ? false : _ref$disableZipSectio,
|
|
3000
3016
|
fontFamily = _ref.fontFamily;
|
|
3001
3017
|
|
|
3002
3018
|
var _useState = React.useState(initialReviewValues),
|
|
@@ -3015,9 +3031,13 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3015
3031
|
paymentIsLoading = _useState4[0],
|
|
3016
3032
|
setPaymentIsLoading = _useState4[1];
|
|
3017
3033
|
|
|
3018
|
-
var _useState5 = React.useState(
|
|
3019
|
-
|
|
3020
|
-
|
|
3034
|
+
var _useState5 = React.useState(true),
|
|
3035
|
+
paymentDataIsLoading = _useState5[0],
|
|
3036
|
+
setPaymentDataIsLoading = _useState5[1];
|
|
3037
|
+
|
|
3038
|
+
var _useState6 = React.useState([]),
|
|
3039
|
+
conditions = _useState6[0],
|
|
3040
|
+
setConditions = _useState6[1];
|
|
3021
3041
|
|
|
3022
3042
|
var showFormTitle = Boolean(formTitle);
|
|
3023
3043
|
var showErrorText = Boolean(errorText);
|
|
@@ -3066,11 +3086,16 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3066
3086
|
onGetPaymentDataError(_context.t0.response);
|
|
3067
3087
|
|
|
3068
3088
|
case 11:
|
|
3089
|
+
_context.prev = 11;
|
|
3090
|
+
setPaymentDataIsLoading(false);
|
|
3091
|
+
return _context.finish(11);
|
|
3092
|
+
|
|
3093
|
+
case 14:
|
|
3069
3094
|
case "end":
|
|
3070
3095
|
return _context.stop();
|
|
3071
3096
|
}
|
|
3072
3097
|
}
|
|
3073
|
-
}, _callee, null, [[0, 7]]);
|
|
3098
|
+
}, _callee, null, [[0, 7, 11, 14]]);
|
|
3074
3099
|
}))();
|
|
3075
3100
|
}, [checkoutData]); //just once
|
|
3076
3101
|
|
|
@@ -3187,7 +3212,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3187
3212
|
severity: "error",
|
|
3188
3213
|
onClose: onErrorClose,
|
|
3189
3214
|
variant: "filled"
|
|
3190
|
-
}, error), React__default.createElement(Container, {
|
|
3215
|
+
}, error), paymentDataIsLoading && React__default.createElement(Loader, null), !paymentDataIsLoading && React__default.createElement(Container, {
|
|
3191
3216
|
maxWidth: "md"
|
|
3192
3217
|
}, showFormTitle && React__default.createElement("h1", null, formTitle), React__default.createElement("div", {
|
|
3193
3218
|
className: "order_info_text"
|
|
@@ -3215,9 +3240,9 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3215
3240
|
}, "Please provide your payment information"), showErrorText && React__default.createElement("p", {
|
|
3216
3241
|
className: "payment_info__error"
|
|
3217
3242
|
}, errorText), React__default.createElement("div", null, React__default.createElement(reactStripeJs.Elements, {
|
|
3218
|
-
stripe:
|
|
3243
|
+
stripe: getStripePromise(reviewData)
|
|
3219
3244
|
}, React__default.createElement(CheckoutForm, {
|
|
3220
|
-
stripe_client_secret: reviewData
|
|
3245
|
+
stripe_client_secret: _get(reviewData, 'payment_method.stripe_client_secret'),
|
|
3221
3246
|
total: orderData.total,
|
|
3222
3247
|
onSubmit: handlePaymentMiddleWare,
|
|
3223
3248
|
error: error,
|
|
@@ -3228,7 +3253,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3228
3253
|
return setPaymentIsLoading(value);
|
|
3229
3254
|
},
|
|
3230
3255
|
conditions: conditions,
|
|
3231
|
-
stripeCardOptions: stripeCardOptions
|
|
3256
|
+
stripeCardOptions: stripeCardOptions,
|
|
3257
|
+
disableZipSection: disableZipSection
|
|
3232
3258
|
})))))));
|
|
3233
3259
|
};
|
|
3234
3260
|
|
|
@@ -3402,7 +3428,8 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
3402
3428
|
_ref$onGetConfirmatio = _ref.onGetConfirmationDataSuccess,
|
|
3403
3429
|
onGetConfirmationDataSuccess = _ref$onGetConfirmatio === void 0 ? function () {} : _ref$onGetConfirmatio,
|
|
3404
3430
|
_ref$onGetConfirmatio2 = _ref.onGetConfirmationDataError,
|
|
3405
|
-
onGetConfirmationDataError = _ref$onGetConfirmatio2 === void 0 ? function () {} : _ref$onGetConfirmatio2
|
|
3431
|
+
onGetConfirmationDataError = _ref$onGetConfirmatio2 === void 0 ? function () {} : _ref$onGetConfirmatio2,
|
|
3432
|
+
orderHash = _ref.orderHash;
|
|
3406
3433
|
var inputRef = React.useRef(null);
|
|
3407
3434
|
|
|
3408
3435
|
var _useState = React.useState(null),
|
|
@@ -3418,15 +3445,17 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
3418
3445
|
while (1) {
|
|
3419
3446
|
switch (_context.prev = _context.next) {
|
|
3420
3447
|
case 0:
|
|
3421
|
-
dataEncoded = typeof window !== 'undefined' && window.localStorage.getItem('checkoutData');
|
|
3448
|
+
dataEncoded = typeof window !== 'undefined' && window.localStorage.getItem('checkoutData') || '';
|
|
3449
|
+
dataDecoded = dataEncoded ? JSON.parse(dataEncoded) : {
|
|
3450
|
+
hash: orderHash
|
|
3451
|
+
};
|
|
3452
|
+
hash = dataDecoded.hash;
|
|
3422
3453
|
|
|
3423
|
-
if (!
|
|
3454
|
+
if (!hash) {
|
|
3424
3455
|
_context.next = 18;
|
|
3425
3456
|
break;
|
|
3426
3457
|
}
|
|
3427
3458
|
|
|
3428
|
-
dataDecoded = JSON.parse(dataEncoded);
|
|
3429
|
-
hash = dataDecoded.hash;
|
|
3430
3459
|
_context.prev = 4;
|
|
3431
3460
|
_context.next = 7;
|
|
3432
3461
|
return getConfirmationData(hash);
|
|
@@ -3536,13 +3565,13 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
3536
3565
|
value: data.personal_share_link,
|
|
3537
3566
|
onChange: onChangeShareLink
|
|
3538
3567
|
}), React__default.createElement("div", {
|
|
3539
|
-
className:
|
|
3568
|
+
className: "share-by-link-copy-icon",
|
|
3540
3569
|
onClick: function onClick() {
|
|
3541
3570
|
return navigator.clipboard.writeText(_get(inputRef, 'current.value'));
|
|
3542
3571
|
}
|
|
3543
3572
|
}, React__default.createElement("img", {
|
|
3544
3573
|
src: "https://img.icons8.com/office/50/000000/copy.png",
|
|
3545
|
-
alt:
|
|
3574
|
+
alt: "copy"
|
|
3546
3575
|
})))), (showDefaultShareButtons || !!shareButtons.length) && React__default.createElement(SocialButtons, {
|
|
3547
3576
|
showDefaultShareButtons: showDefaultShareButtons,
|
|
3548
3577
|
name: data.product_name,
|
|
@@ -3556,7 +3585,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
3556
3585
|
}, "How much cheaper?"), _map(data.personal_share_sales, function (pricing, index) {
|
|
3557
3586
|
return React__default.createElement("div", {
|
|
3558
3587
|
key: index,
|
|
3559
|
-
className:
|
|
3588
|
+
className: "pricing-section_wrapper"
|
|
3560
3589
|
}, React__default.createElement("div", {
|
|
3561
3590
|
className: "pricing-section_label"
|
|
3562
3591
|
}, pricing.label, pricing.subLabel && React__default.createElement("div", {
|
|
@@ -3719,7 +3748,8 @@ var generateQuantity = function generateQuantity(n) {
|
|
|
3719
3748
|
var WaitingList = function WaitingList(_ref) {
|
|
3720
3749
|
var _ref$tickets = _ref.tickets,
|
|
3721
3750
|
tickets = _ref$tickets === void 0 ? {} : _ref$tickets,
|
|
3722
|
-
eventId = _ref.eventId
|
|
3751
|
+
eventId = _ref.eventId,
|
|
3752
|
+
isPromotionsEnabled = _ref.isPromotionsEnabled;
|
|
3723
3753
|
|
|
3724
3754
|
var _useState = React.useState(false),
|
|
3725
3755
|
showSuccessMessage = _useState[0],
|
|
@@ -3794,7 +3824,7 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
3794
3824
|
className: "success-message"
|
|
3795
3825
|
}, React__default.createElement("p", {
|
|
3796
3826
|
className: "added-success-message"
|
|
3797
|
-
}, "You've been added to the waiting list!"), React__default.createElement("p", null, "You'll be notified if tickets become available.")) : React__default.createElement(React__default.Fragment, null, React__default.createElement("p", {
|
|
3827
|
+
}, "You've been added to the waiting list!"), React__default.createElement("p", null, "You'll be notified if tickets become available.")) : React__default.createElement(React__default.Fragment, null, !isPromotionsEnabled && React__default.createElement("p", {
|
|
3798
3828
|
className: "no-tickets-text"
|
|
3799
3829
|
}, "No tickets are currently available for this event."), React__default.createElement("h2", null, "WAITING LIST"), React__default.createElement(formik.Formik, {
|
|
3800
3830
|
initialValues: {
|
|
@@ -3867,7 +3897,66 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
3867
3897
|
}) : 'ADD TO WAITING LIST')))));
|
|
3868
3898
|
};
|
|
3869
3899
|
|
|
3870
|
-
function
|
|
3900
|
+
var getImage = function getImage(name) {
|
|
3901
|
+
if (name === void 0) {
|
|
3902
|
+
name = '';
|
|
3903
|
+
}
|
|
3904
|
+
|
|
3905
|
+
var image = '';
|
|
3906
|
+
|
|
3907
|
+
if (!name.trim().length) {
|
|
3908
|
+
return image;
|
|
3909
|
+
}
|
|
3910
|
+
|
|
3911
|
+
return image;
|
|
3912
|
+
};
|
|
3913
|
+
|
|
3914
|
+
var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
3915
|
+
var promoCode = _ref.promoCode,
|
|
3916
|
+
promoCodeIsApplied = _ref.promoCodeIsApplied,
|
|
3917
|
+
showPromoInput = _ref.showPromoInput,
|
|
3918
|
+
isPromotionsEnabled = _ref.isPromotionsEnabled,
|
|
3919
|
+
isAllTicketsSoldOut = _ref.isAllTicketsSoldOut,
|
|
3920
|
+
setPromoCode = _ref.setPromoCode,
|
|
3921
|
+
setPromoCodeUpdated = _ref.setPromoCodeUpdated,
|
|
3922
|
+
setShowPromoInput = _ref.setShowPromoInput;
|
|
3923
|
+
return React__default.createElement("div", null, promoCodeIsApplied ? React__default.createElement("div", {
|
|
3924
|
+
className: "alert-info"
|
|
3925
|
+
}, React__default.createElement(SVG, {
|
|
3926
|
+
src: getImage('done.svg'),
|
|
3927
|
+
preProcessor: function preProcessor(code) {
|
|
3928
|
+
return code.replace(/fill=".*?"/g, 'fill="currentColor"');
|
|
3929
|
+
}
|
|
3930
|
+
}), React__default.createElement("p", null, "PROMO CODE APPLIED SUCCESSFULLY")) : null, showPromoInput && React__default.createElement("div", {
|
|
3931
|
+
className: "promo-code-block"
|
|
3932
|
+
}, React__default.createElement("input", {
|
|
3933
|
+
placeholder: "Promo Code",
|
|
3934
|
+
onChange: function onChange(e) {
|
|
3935
|
+
setPromoCode(e.target.value);
|
|
3936
|
+
},
|
|
3937
|
+
onKeyPress: function onKeyPress(event) {
|
|
3938
|
+
if (event.key === 'Enter') {
|
|
3939
|
+
setPromoCodeUpdated(promoCode);
|
|
3940
|
+
}
|
|
3941
|
+
}
|
|
3942
|
+
}), React__default.createElement(Button, {
|
|
3943
|
+
className: "promo-apply-button",
|
|
3944
|
+
placeholder: "Promo Code",
|
|
3945
|
+
onClick: function onClick() {
|
|
3946
|
+
setPromoCodeUpdated(promoCode);
|
|
3947
|
+
}
|
|
3948
|
+
}, "Apply")), isPromotionsEnabled && !showPromoInput && isAllTicketsSoldOut && React__default.createElement("p", {
|
|
3949
|
+
className: "promo-code-text"
|
|
3950
|
+
}, "Access code needed"), isPromotionsEnabled && !showPromoInput ? React__default.createElement(Button, {
|
|
3951
|
+
className: "promo-code-button",
|
|
3952
|
+
placeholder: "Promo Codes",
|
|
3953
|
+
onClick: function onClick() {
|
|
3954
|
+
setShowPromoInput(true);
|
|
3955
|
+
}
|
|
3956
|
+
}, "Got a promo code? Click here") : null);
|
|
3957
|
+
};
|
|
3958
|
+
|
|
3959
|
+
function Loader$1() {
|
|
3871
3960
|
return React__default.createElement("div", {
|
|
3872
3961
|
className: "loader-container"
|
|
3873
3962
|
}, React__default.createElement(CircularProgress, null));
|
|
@@ -3888,7 +3977,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3888
3977
|
_ref$theme = _ref.theme,
|
|
3889
3978
|
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
3890
3979
|
_ref$queryPromoCode = _ref.queryPromoCode,
|
|
3891
|
-
queryPromoCode = _ref$queryPromoCode === void 0 ? '' : _ref$queryPromoCode
|
|
3980
|
+
queryPromoCode = _ref$queryPromoCode === void 0 ? '' : _ref$queryPromoCode,
|
|
3981
|
+
_ref$isPromotionsEnab = _ref.isPromotionsEnabled,
|
|
3982
|
+
isPromotionsEnabled = _ref$isPromotionsEnab === void 0 ? true : _ref$isPromotionsEnab;
|
|
3892
3983
|
|
|
3893
3984
|
var _useState = React.useState({}),
|
|
3894
3985
|
selectedTickets = _useState[0],
|
|
@@ -4091,50 +4182,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4091
4182
|
return React__default.createElement("div", {
|
|
4092
4183
|
className: "get-tickets-page " + theme,
|
|
4093
4184
|
style: contentStyle
|
|
4094
|
-
}, isLoading ? React__default.createElement(Loader, null) : React__default.createElement(
|
|
4095
|
-
tickets: tickets,
|
|
4096
|
-
eventId: eventId
|
|
4097
|
-
}) : React__default.createElement("div", null, React__default.createElement(TicketsSection, {
|
|
4185
|
+
}, isLoading ? React__default.createElement(Loader$1, null) : React__default.createElement("div", null, React__default.createElement(TicketsSection, {
|
|
4098
4186
|
ticketsList: tickets,
|
|
4099
4187
|
selectedTickets: selectedTickets,
|
|
4100
4188
|
handleTicketSelect: handleTicketSelect,
|
|
4101
4189
|
promoCodeIsApplied: promoCodeIsApplied
|
|
4102
|
-
}),
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
}, React__default.createElement(
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
}
|
|
4116
|
-
}), React__default.createElement(Button, {
|
|
4117
|
-
className: "promo-apply-button",
|
|
4118
|
-
placeholder: "Promo Code",
|
|
4119
|
-
onClick: function onClick() {
|
|
4120
|
-
setPromoCodeUpdated(promoCode);
|
|
4121
|
-
}
|
|
4122
|
-
}, "Apply")), !showPromoInput && !isAllTicketsSoldOut ? React__default.createElement(Button, {
|
|
4123
|
-
className: "promo-code-button",
|
|
4124
|
-
placeholder: "Promo Codes",
|
|
4125
|
-
onClick: function onClick() {
|
|
4126
|
-
setShowPromoInput(true);
|
|
4127
|
-
}
|
|
4128
|
-
}, "Got a promo code? Click here") : null, React__default.createElement("div", {
|
|
4129
|
-
className: "test v1.0.19",
|
|
4130
|
-
style: {
|
|
4131
|
-
display: 'none'
|
|
4132
|
-
}
|
|
4190
|
+
}), showWaitingList && React__default.createElement(WaitingList, {
|
|
4191
|
+
tickets: tickets,
|
|
4192
|
+
eventId: eventId,
|
|
4193
|
+
isPromotionsEnabled: isPromotionsEnabled
|
|
4194
|
+
}), React__default.createElement(PromoCodeSection, {
|
|
4195
|
+
promoCode: promoCode,
|
|
4196
|
+
promoCodeIsApplied: promoCodeIsApplied,
|
|
4197
|
+
showPromoInput: showPromoInput,
|
|
4198
|
+
setPromoCode: setPromoCode,
|
|
4199
|
+
setPromoCodeUpdated: setPromoCodeUpdated,
|
|
4200
|
+
setShowPromoInput: setShowPromoInput,
|
|
4201
|
+
isPromotionsEnabled: isPromotionsEnabled,
|
|
4202
|
+
isAllTicketsSoldOut: isAllTicketsSoldOut
|
|
4133
4203
|
}), !isAllTicketsSoldOut && React__default.createElement(Button, {
|
|
4134
4204
|
"aria-hidden": true,
|
|
4135
4205
|
className: "book-button " + (handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0 ? 'disabled' : ''),
|
|
4136
4206
|
onClick: !handleBookIsLoading && !_isEmpty(selectedTickets) && Object.values(selectedTickets)[0] > 0 ? handleBook : function () {}
|
|
4137
|
-
}, getTicketsLabel || 'GET TICKETS')))
|
|
4207
|
+
}, getTicketsLabel || 'GET TICKETS')));
|
|
4138
4208
|
};
|
|
4139
4209
|
|
|
4140
4210
|
var EventInfoItem = function EventInfoItem(_ref) {
|