tf-checkout-react 1.3.12 → 1.3.14
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/components/ticketsContainer/index.d.ts +1 -0
- package/dist/tf-checkout-react.cjs.development.js +185 -163
- 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 +185 -163
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/billing-info-container/index.tsx +76 -41
- package/src/components/ticketsContainer/index.tsx +4 -1
- package/src/env.ts +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/common/dist/PhoneNumberField.js +0 -96
|
@@ -2784,7 +2784,7 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2784
2784
|
React.useEffect(function () {
|
|
2785
2785
|
var fetchStates = /*#__PURE__*/function () {
|
|
2786
2786
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
2787
|
-
var res, mappedStates, _mappedStates$find,
|
|
2787
|
+
var res, mappedStates, _mappedStates$find, _ref3, _mappedStates$, stateExists;
|
|
2788
2788
|
|
|
2789
2789
|
return runtime_1.wrap(function _callee$(_context) {
|
|
2790
2790
|
while (1) {
|
|
@@ -2808,7 +2808,7 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2808
2808
|
stateExists = (_mappedStates$find = mappedStates.find(function (state) {
|
|
2809
2809
|
return state.value === values.state;
|
|
2810
2810
|
})) == null ? void 0 : _mappedStates$find.value;
|
|
2811
|
-
setFieldValue('state', stateExists != null ? stateExists : (_mappedStates$
|
|
2811
|
+
setFieldValue('state', (_ref3 = stateExists != null ? stateExists : (_mappedStates$ = mappedStates[0]) == null ? void 0 : _mappedStates$.value) != null ? _ref3 : '');
|
|
2812
2812
|
prevCountry.current = values.country;
|
|
2813
2813
|
}
|
|
2814
2814
|
|
|
@@ -2877,137 +2877,141 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2877
2877
|
return null;
|
|
2878
2878
|
};
|
|
2879
2879
|
|
|
2880
|
-
var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (
|
|
2881
|
-
var
|
|
2882
|
-
data =
|
|
2883
|
-
|
|
2884
|
-
ticketHoldersFields =
|
|
2880
|
+
var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
2881
|
+
var _ref4$data = _ref4.data,
|
|
2882
|
+
data = _ref4$data === void 0 ? [] : _ref4$data,
|
|
2883
|
+
_ref4$ticketHoldersFi = _ref4.ticketHoldersFields,
|
|
2884
|
+
ticketHoldersFields = _ref4$ticketHoldersFi === void 0 ? {
|
|
2885
2885
|
id: 1,
|
|
2886
2886
|
fields: []
|
|
2887
|
-
} :
|
|
2888
|
-
|
|
2889
|
-
initialValues =
|
|
2890
|
-
|
|
2891
|
-
buttonName =
|
|
2892
|
-
|
|
2893
|
-
handleSubmit =
|
|
2894
|
-
|
|
2895
|
-
theme =
|
|
2896
|
-
|
|
2897
|
-
onRegisterSuccess =
|
|
2898
|
-
|
|
2899
|
-
onRegisterError =
|
|
2900
|
-
|
|
2901
|
-
onSubmitError =
|
|
2902
|
-
|
|
2903
|
-
onGetCartSuccess =
|
|
2904
|
-
|
|
2905
|
-
onGetCartError =
|
|
2906
|
-
|
|
2907
|
-
onGetCountriesSuccess =
|
|
2908
|
-
|
|
2909
|
-
onGetCountriesError =
|
|
2910
|
-
|
|
2911
|
-
onGetStatesSuccess =
|
|
2912
|
-
|
|
2913
|
-
onGetStatesError =
|
|
2914
|
-
|
|
2915
|
-
_onGetProfileDataSuccess =
|
|
2916
|
-
|
|
2917
|
-
onGetProfileDataError =
|
|
2918
|
-
|
|
2919
|
-
onAuthorizeSuccess =
|
|
2920
|
-
|
|
2921
|
-
onAuthorizeError =
|
|
2922
|
-
onLogin =
|
|
2923
|
-
|
|
2924
|
-
onLoginSuccess =
|
|
2925
|
-
|
|
2926
|
-
pIsLoggedIn =
|
|
2927
|
-
|
|
2928
|
-
accountInfoTitle =
|
|
2929
|
-
hideLogo =
|
|
2930
|
-
themeOptions =
|
|
2931
|
-
|
|
2932
|
-
onErrorClose =
|
|
2933
|
-
|
|
2934
|
-
hideErrorsAlertSection =
|
|
2935
|
-
|
|
2936
|
-
onSkipBillingPage =
|
|
2937
|
-
|
|
2938
|
-
skipPage =
|
|
2939
|
-
|
|
2940
|
-
canSkipHolderNames =
|
|
2941
|
-
|
|
2942
|
-
onForgotPasswordSuccess =
|
|
2943
|
-
|
|
2944
|
-
onForgotPasswordError =
|
|
2945
|
-
|
|
2946
|
-
shouldFetchCountries =
|
|
2947
|
-
|
|
2948
|
-
onCountdownFinish =
|
|
2949
|
-
|
|
2950
|
-
enableTimer =
|
|
2951
|
-
logo =
|
|
2952
|
-
|
|
2953
|
-
showForgotPasswordButton =
|
|
2954
|
-
|
|
2955
|
-
showSignUpButton =
|
|
2956
|
-
|
|
2957
|
-
brandOptIn =
|
|
2887
|
+
} : _ref4$ticketHoldersFi,
|
|
2888
|
+
_ref4$initialValues = _ref4.initialValues,
|
|
2889
|
+
initialValues = _ref4$initialValues === void 0 ? {} : _ref4$initialValues,
|
|
2890
|
+
_ref4$buttonName = _ref4.buttonName,
|
|
2891
|
+
buttonName = _ref4$buttonName === void 0 ? 'Submit' : _ref4$buttonName,
|
|
2892
|
+
_ref4$handleSubmit = _ref4.handleSubmit,
|
|
2893
|
+
handleSubmit = _ref4$handleSubmit === void 0 ? _identity : _ref4$handleSubmit,
|
|
2894
|
+
_ref4$theme = _ref4.theme,
|
|
2895
|
+
theme = _ref4$theme === void 0 ? 'light' : _ref4$theme,
|
|
2896
|
+
_ref4$onRegisterSucce = _ref4.onRegisterSuccess,
|
|
2897
|
+
onRegisterSuccess = _ref4$onRegisterSucce === void 0 ? _identity : _ref4$onRegisterSucce,
|
|
2898
|
+
_ref4$onRegisterError = _ref4.onRegisterError,
|
|
2899
|
+
onRegisterError = _ref4$onRegisterError === void 0 ? _identity : _ref4$onRegisterError,
|
|
2900
|
+
_ref4$onSubmitError = _ref4.onSubmitError,
|
|
2901
|
+
onSubmitError = _ref4$onSubmitError === void 0 ? _identity : _ref4$onSubmitError,
|
|
2902
|
+
_ref4$onGetCartSucces = _ref4.onGetCartSuccess,
|
|
2903
|
+
onGetCartSuccess = _ref4$onGetCartSucces === void 0 ? _identity : _ref4$onGetCartSucces,
|
|
2904
|
+
_ref4$onGetCartError = _ref4.onGetCartError,
|
|
2905
|
+
onGetCartError = _ref4$onGetCartError === void 0 ? _identity : _ref4$onGetCartError,
|
|
2906
|
+
_ref4$onGetCountriesS = _ref4.onGetCountriesSuccess,
|
|
2907
|
+
onGetCountriesSuccess = _ref4$onGetCountriesS === void 0 ? _identity : _ref4$onGetCountriesS,
|
|
2908
|
+
_ref4$onGetCountriesE = _ref4.onGetCountriesError,
|
|
2909
|
+
onGetCountriesError = _ref4$onGetCountriesE === void 0 ? _identity : _ref4$onGetCountriesE,
|
|
2910
|
+
_ref4$onGetStatesSucc = _ref4.onGetStatesSuccess,
|
|
2911
|
+
onGetStatesSuccess = _ref4$onGetStatesSucc === void 0 ? _identity : _ref4$onGetStatesSucc,
|
|
2912
|
+
_ref4$onGetStatesErro = _ref4.onGetStatesError,
|
|
2913
|
+
onGetStatesError = _ref4$onGetStatesErro === void 0 ? _identity : _ref4$onGetStatesErro,
|
|
2914
|
+
_ref4$onGetProfileDat = _ref4.onGetProfileDataSuccess,
|
|
2915
|
+
_onGetProfileDataSuccess = _ref4$onGetProfileDat === void 0 ? _identity : _ref4$onGetProfileDat,
|
|
2916
|
+
_ref4$onGetProfileDat2 = _ref4.onGetProfileDataError,
|
|
2917
|
+
onGetProfileDataError = _ref4$onGetProfileDat2 === void 0 ? _identity : _ref4$onGetProfileDat2,
|
|
2918
|
+
_ref4$onAuthorizeSucc = _ref4.onAuthorizeSuccess,
|
|
2919
|
+
onAuthorizeSuccess = _ref4$onAuthorizeSucc === void 0 ? _identity : _ref4$onAuthorizeSucc,
|
|
2920
|
+
_ref4$onAuthorizeErro = _ref4.onAuthorizeError,
|
|
2921
|
+
onAuthorizeError = _ref4$onAuthorizeErro === void 0 ? _identity : _ref4$onAuthorizeErro,
|
|
2922
|
+
onLogin = _ref4.onLogin,
|
|
2923
|
+
_ref4$onLoginSuccess = _ref4.onLoginSuccess,
|
|
2924
|
+
onLoginSuccess = _ref4$onLoginSuccess === void 0 ? _identity : _ref4$onLoginSuccess,
|
|
2925
|
+
_ref4$isLoggedIn = _ref4.isLoggedIn,
|
|
2926
|
+
pIsLoggedIn = _ref4$isLoggedIn === void 0 ? false : _ref4$isLoggedIn,
|
|
2927
|
+
_ref4$accountInfoTitl = _ref4.accountInfoTitle,
|
|
2928
|
+
accountInfoTitle = _ref4$accountInfoTitl === void 0 ? '' : _ref4$accountInfoTitl,
|
|
2929
|
+
hideLogo = _ref4.hideLogo,
|
|
2930
|
+
themeOptions = _ref4.themeOptions,
|
|
2931
|
+
_ref4$onErrorClose = _ref4.onErrorClose,
|
|
2932
|
+
onErrorClose = _ref4$onErrorClose === void 0 ? _identity : _ref4$onErrorClose,
|
|
2933
|
+
_ref4$hideErrorsAlert = _ref4.hideErrorsAlertSection,
|
|
2934
|
+
hideErrorsAlertSection = _ref4$hideErrorsAlert === void 0 ? false : _ref4$hideErrorsAlert,
|
|
2935
|
+
_ref4$onSkipBillingPa = _ref4.onSkipBillingPage,
|
|
2936
|
+
onSkipBillingPage = _ref4$onSkipBillingPa === void 0 ? _identity : _ref4$onSkipBillingPa,
|
|
2937
|
+
_ref4$skipPage = _ref4.skipPage,
|
|
2938
|
+
skipPage = _ref4$skipPage === void 0 ? false : _ref4$skipPage,
|
|
2939
|
+
_ref4$canSkipHolderNa = _ref4.canSkipHolderNames,
|
|
2940
|
+
canSkipHolderNames = _ref4$canSkipHolderNa === void 0 ? false : _ref4$canSkipHolderNa,
|
|
2941
|
+
_ref4$onForgotPasswor = _ref4.onForgotPasswordSuccess,
|
|
2942
|
+
onForgotPasswordSuccess = _ref4$onForgotPasswor === void 0 ? _identity : _ref4$onForgotPasswor,
|
|
2943
|
+
_ref4$onForgotPasswor2 = _ref4.onForgotPasswordError,
|
|
2944
|
+
onForgotPasswordError = _ref4$onForgotPasswor2 === void 0 ? _identity : _ref4$onForgotPasswor2,
|
|
2945
|
+
_ref4$shouldFetchCoun = _ref4.shouldFetchCountries,
|
|
2946
|
+
shouldFetchCountries = _ref4$shouldFetchCoun === void 0 ? true : _ref4$shouldFetchCoun,
|
|
2947
|
+
_ref4$onCountdownFini = _ref4.onCountdownFinish,
|
|
2948
|
+
onCountdownFinish = _ref4$onCountdownFini === void 0 ? _identity : _ref4$onCountdownFini,
|
|
2949
|
+
_ref4$enableTimer = _ref4.enableTimer,
|
|
2950
|
+
enableTimer = _ref4$enableTimer === void 0 ? false : _ref4$enableTimer,
|
|
2951
|
+
logo = _ref4.logo,
|
|
2952
|
+
_ref4$showForgotPassw = _ref4.showForgotPasswordButton,
|
|
2953
|
+
showForgotPasswordButton = _ref4$showForgotPassw === void 0 ? false : _ref4$showForgotPassw,
|
|
2954
|
+
_ref4$showSignUpButto = _ref4.showSignUpButton,
|
|
2955
|
+
showSignUpButton = _ref4$showSignUpButto === void 0 ? false : _ref4$showSignUpButto,
|
|
2956
|
+
_ref4$brandOptIn = _ref4.brandOptIn,
|
|
2957
|
+
brandOptIn = _ref4$brandOptIn === void 0 ? false : _ref4$brandOptIn;
|
|
2958
|
+
|
|
2959
|
+
var _useState = React.useState(false),
|
|
2960
|
+
isNewUser = _useState[0],
|
|
2961
|
+
setIsNewUser = _useState[1];
|
|
2958
2962
|
|
|
2959
2963
|
var themeMui = styles.createTheme(themeOptions);
|
|
2960
2964
|
var isWindowDefined = typeof window !== 'undefined';
|
|
2961
2965
|
var userData = isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
2962
2966
|
var access_token = isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
2963
2967
|
|
|
2964
|
-
var
|
|
2965
|
-
dataWithUniqueIds =
|
|
2966
|
-
setDataWithUniqueIds =
|
|
2968
|
+
var _useState2 = React.useState(assingUniqueIds(data)),
|
|
2969
|
+
dataWithUniqueIds = _useState2[0],
|
|
2970
|
+
setDataWithUniqueIds = _useState2[1];
|
|
2967
2971
|
|
|
2968
2972
|
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
2969
2973
|
|
|
2970
|
-
var
|
|
2971
|
-
isLoggedIn =
|
|
2972
|
-
setIsLoggedIn =
|
|
2973
|
-
|
|
2974
|
-
var _useState3 = React.useState({}),
|
|
2975
|
-
cartInfoData = _useState3[0],
|
|
2976
|
-
setCartInfo = _useState3[1];
|
|
2974
|
+
var _useState3 = React.useState(!!(pIsLoggedIn || xtfCookie)),
|
|
2975
|
+
isLoggedIn = _useState3[0],
|
|
2976
|
+
setIsLoggedIn = _useState3[1];
|
|
2977
2977
|
|
|
2978
|
-
var _useState4 = React.useState(
|
|
2979
|
-
|
|
2980
|
-
|
|
2978
|
+
var _useState4 = React.useState({}),
|
|
2979
|
+
cartInfoData = _useState4[0],
|
|
2980
|
+
setCartInfo = _useState4[1];
|
|
2981
2981
|
|
|
2982
2982
|
var _useState5 = React.useState([]),
|
|
2983
|
-
|
|
2984
|
-
|
|
2983
|
+
countries = _useState5[0],
|
|
2984
|
+
setCountries = _useState5[1];
|
|
2985
2985
|
|
|
2986
|
-
var _useState6 = React.useState(
|
|
2987
|
-
|
|
2988
|
-
|
|
2986
|
+
var _useState6 = React.useState([]),
|
|
2987
|
+
states = _useState6[0],
|
|
2988
|
+
setStates = _useState6[1];
|
|
2989
2989
|
|
|
2990
2990
|
var _useState7 = React.useState(false),
|
|
2991
|
-
|
|
2992
|
-
|
|
2991
|
+
showModalLogin = _useState7[0],
|
|
2992
|
+
setShowModalLogin = _useState7[1];
|
|
2993
2993
|
|
|
2994
2994
|
var _useState8 = React.useState(false),
|
|
2995
|
-
|
|
2996
|
-
|
|
2995
|
+
alreadyHasUser = _useState8[0],
|
|
2996
|
+
setAlreadyHasUser = _useState8[1];
|
|
2997
2997
|
|
|
2998
2998
|
var _useState9 = React.useState(false),
|
|
2999
|
-
|
|
3000
|
-
|
|
2999
|
+
userExpired = _useState9[0],
|
|
3000
|
+
setUserExpired = _useState9[1];
|
|
3001
3001
|
|
|
3002
3002
|
var _useState10 = React.useState(false),
|
|
3003
|
-
|
|
3004
|
-
|
|
3003
|
+
showModalSignup = _useState10[0],
|
|
3004
|
+
setShowModalSignup = _useState10[1];
|
|
3005
|
+
|
|
3006
|
+
var _useState11 = React.useState(false),
|
|
3007
|
+
showModalForgotPassword = _useState11[0],
|
|
3008
|
+
setShowModalForgotPassword = _useState11[1];
|
|
3005
3009
|
|
|
3006
|
-
var
|
|
3007
|
-
ticketsQuantity =
|
|
3008
|
-
setTicketsQuantity =
|
|
3010
|
+
var _useState12 = React.useState([]),
|
|
3011
|
+
ticketsQuantity = _useState12[0],
|
|
3012
|
+
setTicketsQuantity = _useState12[1];
|
|
3009
3013
|
|
|
3010
|
-
var
|
|
3014
|
+
var _useState13 = React.useState({
|
|
3011
3015
|
firstName: '',
|
|
3012
3016
|
lastName: '',
|
|
3013
3017
|
email: '',
|
|
@@ -3022,20 +3026,20 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3022
3026
|
state: '',
|
|
3023
3027
|
zip: ''
|
|
3024
3028
|
}),
|
|
3025
|
-
userValues =
|
|
3026
|
-
setUserValues =
|
|
3029
|
+
userValues = _useState13[0],
|
|
3030
|
+
setUserValues = _useState13[1];
|
|
3027
3031
|
|
|
3028
|
-
var
|
|
3029
|
-
loading =
|
|
3030
|
-
setLoading =
|
|
3032
|
+
var _useState14 = React.useState(true),
|
|
3033
|
+
loading = _useState14[0],
|
|
3034
|
+
setLoading = _useState14[1];
|
|
3031
3035
|
|
|
3032
|
-
var
|
|
3033
|
-
error =
|
|
3034
|
-
setError =
|
|
3036
|
+
var _useState15 = React.useState(null),
|
|
3037
|
+
error = _useState15[0],
|
|
3038
|
+
setError = _useState15[1];
|
|
3035
3039
|
|
|
3036
|
-
var
|
|
3037
|
-
phoneValidationIsLoading =
|
|
3038
|
-
setPhoneValidationIsLoading =
|
|
3040
|
+
var _useState16 = React.useState(false),
|
|
3041
|
+
phoneValidationIsLoading = _useState16[0],
|
|
3042
|
+
setPhoneValidationIsLoading = _useState16[1];
|
|
3039
3043
|
|
|
3040
3044
|
var emailLogged = _get(userData, 'email', '') || _get(userValues, 'email', '');
|
|
3041
3045
|
|
|
@@ -3054,6 +3058,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3054
3058
|
var expirationTime = _get(cartInfoData, 'expiresAt');
|
|
3055
3059
|
|
|
3056
3060
|
var flagRequirePhone = getQueryVariable('phone_required') === 'true';
|
|
3061
|
+
var flagFreeTicket = getQueryVariable('free_ticket') === 'true';
|
|
3057
3062
|
var hidePhoneField = getQueryVariable('hide_phone_field') === 'true'; // Get prevProps
|
|
3058
3063
|
|
|
3059
3064
|
var prevData = React.useRef(data);
|
|
@@ -3098,7 +3103,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3098
3103
|
React.useEffect(function () {
|
|
3099
3104
|
// fetch countries data
|
|
3100
3105
|
var fetchCountries = /*#__PURE__*/function () {
|
|
3101
|
-
var
|
|
3106
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
3102
3107
|
var res;
|
|
3103
3108
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
3104
3109
|
while (1) {
|
|
@@ -3138,7 +3143,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3138
3143
|
}));
|
|
3139
3144
|
|
|
3140
3145
|
return function fetchCountries() {
|
|
3141
|
-
return
|
|
3146
|
+
return _ref5.apply(this, arguments);
|
|
3142
3147
|
};
|
|
3143
3148
|
}();
|
|
3144
3149
|
|
|
@@ -3147,7 +3152,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3147
3152
|
}, []); // fetch cart data
|
|
3148
3153
|
|
|
3149
3154
|
var fetchCart = /*#__PURE__*/function () {
|
|
3150
|
-
var
|
|
3155
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
|
|
3151
3156
|
var res, cartInfo, _cartInfo$cart, cart;
|
|
3152
3157
|
|
|
3153
3158
|
return runtime_1.wrap(function _callee3$(_context3) {
|
|
@@ -3188,13 +3193,13 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3188
3193
|
}));
|
|
3189
3194
|
|
|
3190
3195
|
return function fetchCart() {
|
|
3191
|
-
return
|
|
3196
|
+
return _ref6.apply(this, arguments);
|
|
3192
3197
|
};
|
|
3193
3198
|
}(); // fetch user data
|
|
3194
3199
|
|
|
3195
3200
|
|
|
3196
3201
|
var fetchUserData = /*#__PURE__*/function () {
|
|
3197
|
-
var
|
|
3202
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(token) {
|
|
3198
3203
|
var userDataResponse, profileSpecifiedData, profileDataObj;
|
|
3199
3204
|
return runtime_1.wrap(function _callee4$(_context4) {
|
|
3200
3205
|
while (1) {
|
|
@@ -3243,7 +3248,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3243
3248
|
}));
|
|
3244
3249
|
|
|
3245
3250
|
return function fetchUserData(_x) {
|
|
3246
|
-
return
|
|
3251
|
+
return _ref7.apply(this, arguments);
|
|
3247
3252
|
};
|
|
3248
3253
|
}();
|
|
3249
3254
|
|
|
@@ -3253,13 +3258,13 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3253
3258
|
}, [access_token, isLoggedIn]);
|
|
3254
3259
|
React.useEffect(function () {
|
|
3255
3260
|
var collectPaymentData = /*#__PURE__*/function () {
|
|
3256
|
-
var
|
|
3261
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
|
|
3257
3262
|
var checkoutBody, res;
|
|
3258
3263
|
return runtime_1.wrap(function _callee5$(_context5) {
|
|
3259
3264
|
while (1) {
|
|
3260
3265
|
switch (_context5.prev = _context5.next) {
|
|
3261
3266
|
case 0:
|
|
3262
|
-
if (!(skipPage && !_isEmpty(ticketsQuantity) && !showDOB && !loading)) {
|
|
3267
|
+
if (!(skipPage && !_isEmpty(ticketsQuantity) && !showDOB && !loading && !isNewUser)) {
|
|
3263
3268
|
_context5.next = 18;
|
|
3264
3269
|
break;
|
|
3265
3270
|
}
|
|
@@ -3304,7 +3309,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3304
3309
|
}));
|
|
3305
3310
|
|
|
3306
3311
|
return function collectPaymentData() {
|
|
3307
|
-
return
|
|
3312
|
+
return _ref8.apply(this, arguments);
|
|
3308
3313
|
};
|
|
3309
3314
|
}();
|
|
3310
3315
|
|
|
@@ -3428,17 +3433,18 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3428
3433
|
accessToken = _get(resRegister, 'data.data.attributes.access_token');
|
|
3429
3434
|
refreshToken = _get(resRegister, 'data.data.attributes.refresh_token');
|
|
3430
3435
|
userProfile = _get(resRegister, 'data.data.attributes.user_profile');
|
|
3436
|
+
setIsNewUser(true);
|
|
3431
3437
|
onRegisterSuccess({
|
|
3432
3438
|
xtfCookie: _xtfCookie,
|
|
3433
3439
|
accessToken: accessToken,
|
|
3434
3440
|
refreshToken: refreshToken,
|
|
3435
3441
|
userProfile: userProfile
|
|
3436
3442
|
});
|
|
3437
|
-
_context6.next =
|
|
3443
|
+
_context6.next = 37;
|
|
3438
3444
|
break;
|
|
3439
3445
|
|
|
3440
|
-
case
|
|
3441
|
-
_context6.prev =
|
|
3446
|
+
case 32:
|
|
3447
|
+
_context6.prev = 32;
|
|
3442
3448
|
_context6.t0 = _context6["catch"](19);
|
|
3443
3449
|
setLoading(false);
|
|
3444
3450
|
|
|
@@ -3469,11 +3475,11 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3469
3475
|
|
|
3470
3476
|
return _context6.abrupt("return");
|
|
3471
3477
|
|
|
3472
|
-
case
|
|
3473
|
-
_context6.next =
|
|
3478
|
+
case 37:
|
|
3479
|
+
_context6.next = 39;
|
|
3474
3480
|
return getProfileData();
|
|
3475
3481
|
|
|
3476
|
-
case
|
|
3482
|
+
case 39:
|
|
3477
3483
|
profileData = _context6.sent;
|
|
3478
3484
|
profileSpecifiedData = _get(profileData, 'data.data');
|
|
3479
3485
|
profileDataObj = setLoggedUserData$1(profileSpecifiedData);
|
|
@@ -3488,18 +3494,18 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3488
3494
|
addAddOnsInAttributes(checkoutBody);
|
|
3489
3495
|
}
|
|
3490
3496
|
|
|
3491
|
-
_context6.next =
|
|
3497
|
+
_context6.next = 47;
|
|
3492
3498
|
return postOnCheckout(checkoutBody);
|
|
3493
3499
|
|
|
3494
|
-
case
|
|
3500
|
+
case 47:
|
|
3495
3501
|
res = _context6.sent;
|
|
3496
3502
|
removeReferralKey();
|
|
3497
3503
|
handleSubmit(values, formikHelpers, eventId, res);
|
|
3498
|
-
_context6.next =
|
|
3504
|
+
_context6.next = 56;
|
|
3499
3505
|
break;
|
|
3500
3506
|
|
|
3501
|
-
case
|
|
3502
|
-
_context6.prev =
|
|
3507
|
+
case 52:
|
|
3508
|
+
_context6.prev = 52;
|
|
3503
3509
|
_context6.t1 = _context6["catch"](0);
|
|
3504
3510
|
setLoading(false);
|
|
3505
3511
|
|
|
@@ -3526,17 +3532,17 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3526
3532
|
onSubmitError(_context6.t1);
|
|
3527
3533
|
}
|
|
3528
3534
|
|
|
3529
|
-
case
|
|
3530
|
-
_context6.prev =
|
|
3535
|
+
case 56:
|
|
3536
|
+
_context6.prev = 56;
|
|
3531
3537
|
setLoading(false);
|
|
3532
|
-
return _context6.finish(
|
|
3538
|
+
return _context6.finish(56);
|
|
3533
3539
|
|
|
3534
|
-
case
|
|
3540
|
+
case 59:
|
|
3535
3541
|
case "end":
|
|
3536
3542
|
return _context6.stop();
|
|
3537
3543
|
}
|
|
3538
3544
|
}
|
|
3539
|
-
}, _callee6, null, [[0,
|
|
3545
|
+
}, _callee6, null, [[0, 52, 56, 59], [19, 32]]);
|
|
3540
3546
|
}));
|
|
3541
3547
|
|
|
3542
3548
|
function onSubmit(_x2, _x3) {
|
|
@@ -3622,6 +3628,20 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
|
|
|
3622
3628
|
}
|
|
3623
3629
|
}
|
|
3624
3630
|
|
|
3631
|
+
if (el.name === 'zip') {
|
|
3632
|
+
if (flagFreeTicket) {
|
|
3633
|
+
el.required = false;
|
|
3634
|
+
return false;
|
|
3635
|
+
}
|
|
3636
|
+
}
|
|
3637
|
+
|
|
3638
|
+
if (el.name === 'street_address') {
|
|
3639
|
+
if (flagFreeTicket) {
|
|
3640
|
+
el.required = false;
|
|
3641
|
+
return false;
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3644
|
+
|
|
3625
3645
|
return true;
|
|
3626
3646
|
}), function (element) {
|
|
3627
3647
|
return ['password', 'confirmPassword', 'password-info'].includes(element.name) && isLoggedIn ? null : React__default.createElement(React__default.Fragment, {
|
|
@@ -5654,7 +5674,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5654
5674
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
5655
5675
|
var _product_options, _product_options2, _ticket_types;
|
|
5656
5676
|
|
|
5657
|
-
var ticket, optionName, ticketId, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$name, _pageConfigsData$age_, _pageConfigsData$phon, _pageConfigsData$hide, _pageConfigsData$has_, pageConfigsData, skipBillingPage, nameIsRequired, ageIsRequired, phoneIsRequired, hidePhoneField, hasAddOn, hash, total, _isWindowDefined, userData, access_token, checkoutBody, checkoutResult;
|
|
5677
|
+
var ticket, optionName, ticketId, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$name, _pageConfigsData$age_, _pageConfigsData$phon, _pageConfigsData$hide, _pageConfigsData$has_, _pageConfigsData$free, pageConfigsData, skipBillingPage, nameIsRequired, ageIsRequired, phoneIsRequired, hidePhoneField, hasAddOn, freeTicket, hash, total, _isWindowDefined, userData, access_token, checkoutBody, checkoutResult;
|
|
5658
5678
|
|
|
5659
5679
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
5660
5680
|
while (1) {
|
|
@@ -5711,7 +5731,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5711
5731
|
pageConfigsDataResponse = _context2.t0;
|
|
5712
5732
|
|
|
5713
5733
|
if (!(result.status === 200 && pageConfigsDataResponse.status === 200)) {
|
|
5714
|
-
_context2.next =
|
|
5734
|
+
_context2.next = 46;
|
|
5715
5735
|
break;
|
|
5716
5736
|
}
|
|
5717
5737
|
|
|
@@ -5722,13 +5742,14 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5722
5742
|
phoneIsRequired = (_pageConfigsData$phon = pageConfigsData.phone_required) != null ? _pageConfigsData$phon : false;
|
|
5723
5743
|
hidePhoneField = (_pageConfigsData$hide = pageConfigsData.hide_phone_field) != null ? _pageConfigsData$hide : false;
|
|
5724
5744
|
hasAddOn = (_pageConfigsData$has_ = pageConfigsData.has_add_on) != null ? _pageConfigsData$has_ : false;
|
|
5745
|
+
freeTicket = (_pageConfigsData$free = pageConfigsData.free_ticket) != null ? _pageConfigsData$free : false;
|
|
5725
5746
|
hash = '';
|
|
5726
5747
|
total = '';
|
|
5727
5748
|
_isWindowDefined = typeof window !== 'undefined';
|
|
5728
5749
|
_isWindowDefined && window.localStorage.removeItem('add_ons');
|
|
5729
5750
|
|
|
5730
5751
|
if (!(skipBillingPage && !hasAddOn)) {
|
|
5731
|
-
_context2.next =
|
|
5752
|
+
_context2.next = 45;
|
|
5732
5753
|
break;
|
|
5733
5754
|
}
|
|
5734
5755
|
|
|
@@ -5738,45 +5759,46 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5738
5759
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
5739
5760
|
|
|
5740
5761
|
if (!enableBillingInfoAutoCreate) {
|
|
5741
|
-
_context2.next =
|
|
5762
|
+
_context2.next = 41;
|
|
5742
5763
|
break;
|
|
5743
5764
|
}
|
|
5744
5765
|
|
|
5745
|
-
_context2.next =
|
|
5766
|
+
_context2.next = 38;
|
|
5746
5767
|
return postOnCheckout(checkoutBody, access_token);
|
|
5747
5768
|
|
|
5748
|
-
case
|
|
5769
|
+
case 38:
|
|
5749
5770
|
_context2.t1 = _context2.sent;
|
|
5750
|
-
_context2.next =
|
|
5771
|
+
_context2.next = 42;
|
|
5751
5772
|
break;
|
|
5752
5773
|
|
|
5753
|
-
case
|
|
5774
|
+
case 41:
|
|
5754
5775
|
_context2.t1 = null;
|
|
5755
5776
|
|
|
5756
|
-
case
|
|
5777
|
+
case 42:
|
|
5757
5778
|
checkoutResult = _context2.t1;
|
|
5758
5779
|
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
5759
5780
|
total = _get(checkoutResult, 'data.data.attributes.total');
|
|
5760
5781
|
|
|
5761
|
-
case
|
|
5782
|
+
case 45:
|
|
5762
5783
|
onAddToCartSuccess({
|
|
5763
5784
|
skip_billing_page: skipBillingPage,
|
|
5764
5785
|
names_required: nameIsRequired,
|
|
5765
5786
|
phone_required: phoneIsRequired,
|
|
5766
5787
|
age_required: ageIsRequired,
|
|
5767
5788
|
hide_phone_field: hidePhoneField,
|
|
5789
|
+
free_ticket: freeTicket,
|
|
5768
5790
|
event_id: String(eventId),
|
|
5769
5791
|
hash: hash,
|
|
5770
5792
|
total: total,
|
|
5771
5793
|
hasAddOn: hasAddOn
|
|
5772
5794
|
});
|
|
5773
5795
|
|
|
5774
|
-
case
|
|
5775
|
-
_context2.next =
|
|
5796
|
+
case 46:
|
|
5797
|
+
_context2.next = 51;
|
|
5776
5798
|
break;
|
|
5777
5799
|
|
|
5778
|
-
case
|
|
5779
|
-
_context2.prev =
|
|
5800
|
+
case 48:
|
|
5801
|
+
_context2.prev = 48;
|
|
5780
5802
|
_context2.t2 = _context2["catch"](6);
|
|
5781
5803
|
|
|
5782
5804
|
if (axios.isAxiosError(_context2.t2)) {
|
|
@@ -5784,17 +5806,17 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5784
5806
|
setError(_get(_context2.t2, 'response.data.message'));
|
|
5785
5807
|
}
|
|
5786
5808
|
|
|
5787
|
-
case
|
|
5788
|
-
_context2.prev =
|
|
5809
|
+
case 51:
|
|
5810
|
+
_context2.prev = 51;
|
|
5789
5811
|
setHandleBookIsLoading(false);
|
|
5790
|
-
return _context2.finish(
|
|
5812
|
+
return _context2.finish(51);
|
|
5791
5813
|
|
|
5792
|
-
case
|
|
5814
|
+
case 54:
|
|
5793
5815
|
case "end":
|
|
5794
5816
|
return _context2.stop();
|
|
5795
5817
|
}
|
|
5796
5818
|
}
|
|
5797
|
-
}, _callee2, null, [[6,
|
|
5819
|
+
}, _callee2, null, [[6, 48, 51, 54]]);
|
|
5798
5820
|
}));
|
|
5799
5821
|
|
|
5800
5822
|
return function handleBook() {
|