tf-checkout-react 1.4.24 → 1.4.25
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/auth.d.ts +5 -0
- package/dist/api/cart.d.ts +2 -0
- package/dist/api/checkout.d.ts +1 -0
- package/dist/api/common.d.ts +10 -0
- package/dist/api/index.d.ts +10 -31
- package/dist/api/interceptors.d.ts +1 -0
- package/dist/api/orders.d.ts +2 -0
- package/dist/api/payment.d.ts +5 -0
- package/dist/api/publicRequest.d.ts +10 -0
- package/dist/api/resale.d.ts +5 -0
- package/dist/components/billing-info-container/utils.d.ts +0 -28
- package/dist/components/common/CheckboxField.d.ts +1 -1
- package/dist/components/confirmationContainer/index.d.ts +7 -2
- package/dist/components/loginForm/index.d.ts +6 -22
- package/dist/components/loginModal/index.d.ts +0 -28
- package/dist/components/seatMapContainer/addToCart.d.ts +2 -2
- package/dist/components/seatMapContainer/utils.d.ts +1 -9
- package/dist/components/stripePayment/index.d.ts +1 -1
- package/dist/components/ticketsContainer/index.d.ts +2 -2
- package/dist/components/waitingList/index.d.ts +1 -1
- package/dist/tf-checkout-react.cjs.development.js +1076 -694
- 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 +1076 -694
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/types/order-data.d.ts +5 -5
- package/dist/utils/auth.d.ts +5 -5
- package/dist/utils/setConfigs.d.ts +0 -12
- package/package.json +1 -1
- package/src/api/auth.ts +44 -0
- package/src/api/cart.ts +28 -0
- package/src/api/checkout.ts +30 -0
- package/src/api/common.ts +129 -0
- package/src/api/guestTicketDelegation.ts +1 -1
- package/src/api/index.ts +40 -346
- package/src/api/interceptors.ts +104 -0
- package/src/api/orders.ts +30 -0
- package/src/api/payment.ts +77 -0
- package/src/api/publicRequest.ts +40 -0
- package/src/api/resale.ts +28 -0
- package/src/components/addonsContainer/adapters/index.tsx +2 -4
- package/src/components/addonsContainer/index.tsx +23 -57
- package/src/components/billing-info-container/index.tsx +144 -214
- package/src/components/billing-info-container/utils.ts +9 -59
- package/src/components/common/CheckboxField.tsx +3 -4
- package/src/components/common/CustomField.tsx +1 -5
- package/src/components/common/NativeSelectFeild/index.tsx +1 -5
- package/src/components/common/SelectField/index.tsx +1 -3
- package/src/components/confirmationContainer/index.tsx +20 -13
- package/src/components/idVerificationContainer/index.tsx +7 -19
- package/src/components/loginForm/index.tsx +28 -41
- package/src/components/loginModal/index.tsx +18 -46
- package/src/components/myTicketsContainer/index.tsx +1 -1
- package/src/components/orderDetailsContainer/index.tsx +3 -3
- package/src/components/paymentContainer/index.tsx +23 -16
- package/src/components/registerForm/index.tsx +3 -6
- package/src/components/registerModal/index.tsx +4 -14
- package/src/components/rsvpContainer/index.tsx +18 -18
- package/src/components/seatMapContainer/addToCart.ts +9 -12
- package/src/components/seatMapContainer/utils.ts +3 -8
- package/src/components/signupModal/index.tsx +9 -30
- package/src/components/stripePayment/index.tsx +1 -1
- package/src/components/ticketResale/index.tsx +7 -6
- package/src/components/ticketsContainer/TicketsSection.tsx +11 -33
- package/src/components/ticketsContainer/index.tsx +32 -56
- package/src/components/waitingList/index.tsx +18 -30
- package/src/types/api/auth.d.ts +20 -12
- package/src/types/api/axiosResponse.d.ts +6 -0
- package/src/types/api/cart.d.ts +65 -0
- package/src/types/api/checkout.d.ts +41 -0
- package/src/types/api/common.d.ts +117 -0
- package/src/types/api/orders.d.ts +100 -0
- package/src/types/api/payment.d.ts +168 -0
- package/src/types/api/ticketResale.d.ts +13 -0
- package/src/types/order-data.ts +5 -5
- package/src/utils/auth.ts +3 -3
- package/src/utils/setConfigs.ts +2 -25
- package/src/types/auth.d.ts +0 -15
|
@@ -455,26 +455,35 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
455
455
|
return target;
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
var
|
|
458
|
+
var headers = {
|
|
459
459
|
Accept: 'application/vnd.api+json',
|
|
460
460
|
'Content-Type': 'application/vnd.api+json'
|
|
461
461
|
};
|
|
462
|
-
var
|
|
462
|
+
var isWindowDefined = typeof window !== 'undefined';
|
|
463
|
+
var authGuestToken = isWindowDefined ? /*#__PURE__*/localStorage.getItem('auth_guest_token') : '';
|
|
464
|
+
if (isWindowDefined && authGuestToken) {
|
|
465
|
+
headers['Authorization-Guest'] = authGuestToken;
|
|
466
|
+
}
|
|
463
467
|
var publicRequest = /*#__PURE__*/axios.create({
|
|
464
|
-
baseURL:
|
|
465
|
-
headers:
|
|
468
|
+
baseURL: 'https://www.ticketfairy.com/api',
|
|
469
|
+
headers: headers
|
|
466
470
|
});
|
|
467
|
-
|
|
468
|
-
|
|
471
|
+
publicRequest.setBaseUrl = function (baseUrl) {
|
|
472
|
+
return publicRequest.defaults.baseURL = baseUrl + '/api';
|
|
473
|
+
};
|
|
474
|
+
publicRequest.setGuestToken = function (guestToken) {
|
|
475
|
+
return publicRequest.defaults.headers.common['Authorization-Guest'] = guestToken;
|
|
476
|
+
};
|
|
477
|
+
publicRequest.setAccessToken = function (token) {
|
|
478
|
+
return publicRequest.defaults.headers.common.Authorization = token;
|
|
469
479
|
};
|
|
480
|
+
|
|
481
|
+
var CONFIGS = {};
|
|
470
482
|
var setConfigs = function setConfigs(configs) {
|
|
471
483
|
_forEach(configs, function (value, key) {
|
|
472
484
|
CONFIGS[key] = value;
|
|
473
485
|
});
|
|
474
486
|
publicRequest.setBaseUrl(CONFIGS.BASE_URL);
|
|
475
|
-
if (CONFIGS.X_SOURCE_ORIGIN) {
|
|
476
|
-
setXSourceOrigin(CONFIGS.X_SOURCE_ORIGIN);
|
|
477
|
-
}
|
|
478
487
|
};
|
|
479
488
|
|
|
480
489
|
var getQueryVariable = function getQueryVariable(variable) {
|
|
@@ -734,11 +743,11 @@ var setLoggedUserData = function setLoggedUserData(data) {
|
|
|
734
743
|
email: data.email,
|
|
735
744
|
confirmEmail: data.email,
|
|
736
745
|
city: (data == null ? void 0 : data.city) || '',
|
|
737
|
-
country: (data == null ? void 0 : data.countryId) ||
|
|
746
|
+
country: (data == null ? void 0 : data.countryId) || '',
|
|
738
747
|
phone: (data == null ? void 0 : data.phone) || '',
|
|
739
748
|
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
740
749
|
state: (data == null ? void 0 : data.stateId) || '',
|
|
741
|
-
zip: (data == null ? void 0 : data.
|
|
750
|
+
zip: (data == null ? void 0 : data.zipCode) || ''
|
|
742
751
|
};
|
|
743
752
|
};
|
|
744
753
|
|
|
@@ -751,114 +760,31 @@ var isJson = function isJson(value) {
|
|
|
751
760
|
return true;
|
|
752
761
|
};
|
|
753
762
|
|
|
754
|
-
var getCustomerExistsData = /*#__PURE__*/function () {
|
|
755
|
-
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessHash) {
|
|
756
|
-
var response;
|
|
757
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
758
|
-
while (1) switch (_context.prev = _context.next) {
|
|
759
|
-
case 0:
|
|
760
|
-
_context.next = 2;
|
|
761
|
-
return publicRequest.get("/v1/delegation-access/" + accessHash + "/customer-exists");
|
|
762
|
-
case 2:
|
|
763
|
-
response = _context.sent;
|
|
764
|
-
return _context.abrupt("return", response.data);
|
|
765
|
-
case 4:
|
|
766
|
-
case "end":
|
|
767
|
-
return _context.stop();
|
|
768
|
-
}
|
|
769
|
-
}, _callee);
|
|
770
|
-
}));
|
|
771
|
-
return function getCustomerExistsData(_x) {
|
|
772
|
-
return _ref.apply(this, arguments);
|
|
773
|
-
};
|
|
774
|
-
}();
|
|
775
|
-
var getDelegationTickets = function getDelegationTickets(accessHash) {
|
|
776
|
-
var res = publicRequest.get("v1/delegation-access/" + accessHash + "/consumer-page-info");
|
|
777
|
-
return res;
|
|
778
|
-
};
|
|
779
|
-
var issueTicket = /*#__PURE__*/function () {
|
|
780
|
-
var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(accessHash, data) {
|
|
781
|
-
var response;
|
|
782
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
783
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
784
|
-
case 0:
|
|
785
|
-
_context2.next = 2;
|
|
786
|
-
return publicRequest.post("v1/delegation-access/" + accessHash + "/issue-ticket", {
|
|
787
|
-
data: {
|
|
788
|
-
attributes: data
|
|
789
|
-
}
|
|
790
|
-
});
|
|
791
|
-
case 2:
|
|
792
|
-
response = _context2.sent;
|
|
793
|
-
return _context2.abrupt("return", response.data);
|
|
794
|
-
case 4:
|
|
795
|
-
case "end":
|
|
796
|
-
return _context2.stop();
|
|
797
|
-
}
|
|
798
|
-
}, _callee2);
|
|
799
|
-
}));
|
|
800
|
-
return function issueTicket(_x2, _x3) {
|
|
801
|
-
return _ref2.apply(this, arguments);
|
|
802
|
-
};
|
|
803
|
-
}();
|
|
804
|
-
|
|
805
|
-
var isWindowDefined = typeof window !== 'undefined';
|
|
806
|
-
var isDocumentDefined = typeof document !== 'undefined';
|
|
807
|
-
if (isWindowDefined && localStorage.getItem('auth_guest_token')) {
|
|
808
|
-
ttfHeaders['Authorization-Guest'] = /*#__PURE__*/localStorage.getItem('auth_guest_token');
|
|
809
|
-
}
|
|
810
|
-
publicRequest.interceptors.response.use(function (response) {
|
|
811
|
-
var authGuestToken = _get(response, 'headers.authorization-guest');
|
|
812
|
-
if (isWindowDefined && authGuestToken) {
|
|
813
|
-
window.localStorage.setItem('auth_guest_token', authGuestToken);
|
|
814
|
-
publicRequest.setGuestToken(authGuestToken);
|
|
815
|
-
}
|
|
816
|
-
return response;
|
|
817
|
-
}, function (error) {
|
|
818
|
-
var _error$response;
|
|
819
|
-
if ((error == null ? void 0 : (_error$response = error.response) == null ? void 0 : _error$response.status) === 401) {
|
|
820
|
-
if (isWindowDefined) {
|
|
821
|
-
var _error$response2, _error$response2$data;
|
|
822
|
-
window.localStorage.removeItem('user_data');
|
|
823
|
-
window.localStorage.removeItem('access_token');
|
|
824
|
-
var errorType = error == null ? void 0 : (_error$response2 = error.response) == null ? void 0 : (_error$response2$data = _error$response2.data) == null ? void 0 : _error$response2$data.error;
|
|
825
|
-
if (errorType === 'invalid_token') {
|
|
826
|
-
window.location.href = '/';
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
var authGuestToken = _get(error, 'response.headers.authorization-guest');
|
|
831
|
-
if (isWindowDefined && authGuestToken) {
|
|
832
|
-
window.localStorage.setItem('auth_guest_token', authGuestToken);
|
|
833
|
-
publicRequest.setGuestToken(authGuestToken);
|
|
834
|
-
}
|
|
835
|
-
return Promise.reject(error);
|
|
836
|
-
});
|
|
837
763
|
publicRequest.interceptors.request.use(function (config) {
|
|
838
764
|
var _document$cookie;
|
|
839
|
-
var
|
|
840
|
-
var
|
|
841
|
-
var accessToken = isWindowDefined ? window.localStorage.getItem('access_token') : null;
|
|
765
|
+
var userData = isBrowser ? window.localStorage.getItem('user_data') : null;
|
|
766
|
+
var accessToken = isBrowser ? window.localStorage.getItem('access_token') : null;
|
|
842
767
|
if (userData && accessToken) {
|
|
843
768
|
var updatedHeaders = _extends({}, config.headers, {
|
|
844
769
|
Authorization: "Bearer " + accessToken
|
|
845
770
|
});
|
|
846
771
|
config.headers = updatedHeaders;
|
|
847
772
|
}
|
|
773
|
+
var guestToken = isBrowser ? window.localStorage.getItem('auth_guest_token') : null;
|
|
848
774
|
if (guestToken) {
|
|
849
|
-
publicRequest.setGuestToken(guestToken);
|
|
850
775
|
var _updatedHeaders = _extends({}, config.headers, {
|
|
851
776
|
'Authorization-Guest': guestToken
|
|
852
777
|
});
|
|
853
778
|
config.headers = _updatedHeaders;
|
|
854
779
|
}
|
|
855
|
-
|
|
780
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
781
|
+
if (xtfCookie) {
|
|
856
782
|
var _updatedHeaders2 = _extends({}, config.headers, {
|
|
857
|
-
'X-TF-ECOMMERCE':
|
|
783
|
+
'X-TF-ECOMMERCE': xtfCookie
|
|
858
784
|
});
|
|
859
785
|
config.headers = _updatedHeaders2;
|
|
860
786
|
}
|
|
861
|
-
var additionalCookiesHeaderValue = (_document$cookie = document.cookie) != null ? _document$cookie : '';
|
|
787
|
+
var additionalCookiesHeaderValue = isBrowser ? (_document$cookie = document.cookie) != null ? _document$cookie : '' : '';
|
|
862
788
|
if (additionalCookiesHeaderValue !== '') {
|
|
863
789
|
var _updatedHeaders3 = _extends({}, config.headers, {
|
|
864
790
|
'Additional-Cookies': additionalCookiesHeaderValue
|
|
@@ -877,6 +803,11 @@ publicRequest.interceptors.request.use(function (config) {
|
|
|
877
803
|
return config;
|
|
878
804
|
});
|
|
879
805
|
publicRequest.interceptors.response.use(function (response) {
|
|
806
|
+
var authGuestToken = _get(response, 'headers.authorization-guest', '');
|
|
807
|
+
if (isBrowser && authGuestToken) {
|
|
808
|
+
window.localStorage.setItem('auth_guest_token', authGuestToken);
|
|
809
|
+
publicRequest.setGuestToken(authGuestToken);
|
|
810
|
+
}
|
|
880
811
|
var xtfCookie = _get(response, 'headers.x-tf-ecommerce');
|
|
881
812
|
var url = _get(response, 'config.url');
|
|
882
813
|
var method = _get(response, 'config.method');
|
|
@@ -884,231 +815,35 @@ publicRequest.interceptors.response.use(function (response) {
|
|
|
884
815
|
setCustomCookie('X-TF-ECOMMERCE', xtfCookie);
|
|
885
816
|
}
|
|
886
817
|
return response;
|
|
887
|
-
})
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
var guestHeaderResponseValue = _get(response, 'headers.authorization-guest');
|
|
899
|
-
var guestHeaderExistingValue = _get(response, 'config.headers[Authorization-Guest]');
|
|
900
|
-
var guestHeader = guestHeaderResponseValue || guestHeaderExistingValue;
|
|
901
|
-
if (guestHeader) {
|
|
902
|
-
if (isWindowDefined) {
|
|
903
|
-
window.localStorage.setItem('auth_guest_token', guestHeader);
|
|
904
|
-
publicRequest.setGuestToken(guestHeader);
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
};
|
|
908
|
-
var handleSetAccessToken = function handleSetAccessToken(token) {
|
|
909
|
-
if (token) {
|
|
910
|
-
if (isWindowDefined) {
|
|
911
|
-
window.localStorage.setItem('access_token', token);
|
|
912
|
-
publicRequest.setAccessToken(token);
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
};
|
|
916
|
-
function getEvent(id, pk) {
|
|
917
|
-
var referralValue = '';
|
|
918
|
-
if (isWindowDefined) {
|
|
919
|
-
var params = new URL("" + window.location);
|
|
920
|
-
var referralId = params.searchParams.get('ttf_r') || '';
|
|
921
|
-
var referral_key = window.localStorage.getItem('referral_key');
|
|
922
|
-
var referralIdlocal = '';
|
|
923
|
-
if (referral_key) {
|
|
924
|
-
referralIdlocal = referral_key.split('.')[1];
|
|
925
|
-
}
|
|
926
|
-
referralValue = referralId || referralIdlocal;
|
|
927
|
-
}
|
|
928
|
-
var response = publicRequest.get("v1/event/" + id, {
|
|
929
|
-
params: {
|
|
930
|
-
pk: pk
|
|
931
|
-
},
|
|
932
|
-
headers: _extends({}, ttfHeaders, {
|
|
933
|
-
'Referer-Url': isDocumentDefined ? document.referrer : '',
|
|
934
|
-
'Referrer-Id': isWindowDefined ? referralValue : ''
|
|
935
|
-
})
|
|
936
|
-
})["catch"](function (error) {
|
|
937
|
-
throw error;
|
|
938
|
-
});
|
|
939
|
-
return response;
|
|
940
|
-
}
|
|
941
|
-
function getTickets(id, promoCode, pk) {
|
|
942
|
-
var invitationHash = getQueryVariable('invitation-hash');
|
|
943
|
-
var params = {
|
|
944
|
-
pk: pk
|
|
945
|
-
};
|
|
946
|
-
if (invitationHash) {
|
|
947
|
-
params['invitation-hash'] = invitationHash;
|
|
948
|
-
}
|
|
949
|
-
var response = publicRequest.get("v1/event/" + id + "/tickets", {
|
|
950
|
-
params: params,
|
|
951
|
-
headers: promoCode ? _extends({}, ttfHeaders, {
|
|
952
|
-
'Promotion-Event': String(id),
|
|
953
|
-
'Promotion-Code': promoCode
|
|
954
|
-
}) : _extends({}, ttfHeaders)
|
|
955
|
-
})["catch"](function (error) {
|
|
956
|
-
throw error;
|
|
957
|
-
});
|
|
958
|
-
return response;
|
|
959
|
-
}
|
|
960
|
-
var addToCart = function addToCart(id, data) {
|
|
961
|
-
var res = publicRequest.post("v1/event/" + id + "/add-to-cart/", {
|
|
962
|
-
data: data
|
|
963
|
-
}, {
|
|
964
|
-
headers: {
|
|
965
|
-
'Referer-Url': isDocumentDefined ? document.referrer : ''
|
|
818
|
+
}, function (error) {
|
|
819
|
+
var _error$response;
|
|
820
|
+
if ((error == null ? void 0 : (_error$response = error.response) == null ? void 0 : _error$response.status) === 401) {
|
|
821
|
+
if (isBrowser) {
|
|
822
|
+
var _error$response2, _error$response2$data;
|
|
823
|
+
window.localStorage.removeItem('user_data');
|
|
824
|
+
window.localStorage.removeItem('access_token');
|
|
825
|
+
var errorType = error == null ? void 0 : (_error$response2 = error.response) == null ? void 0 : (_error$response2$data = _error$response2.data) == null ? void 0 : _error$response2$data.error;
|
|
826
|
+
if (errorType === 'invalid_token') {
|
|
827
|
+
window.location.href = '/';
|
|
828
|
+
}
|
|
966
829
|
}
|
|
967
|
-
});
|
|
968
|
-
return res;
|
|
969
|
-
};
|
|
970
|
-
var getCart = function getCart() {
|
|
971
|
-
var res = publicRequest.get("v1/cart/");
|
|
972
|
-
return res;
|
|
973
|
-
};
|
|
974
|
-
var postOnCheckout = function postOnCheckout(data, accessToken, freeTicket) {
|
|
975
|
-
if (freeTicket === void 0) {
|
|
976
|
-
freeTicket = false;
|
|
977
830
|
}
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
delete data.attributes.street_address;
|
|
831
|
+
var authGuestToken = _get(error, 'response.headers.authorization-guest');
|
|
832
|
+
if (isBrowser && authGuestToken) {
|
|
833
|
+
window.localStorage.setItem('auth_guest_token', authGuestToken);
|
|
834
|
+
publicRequest.setGuestToken(authGuestToken);
|
|
983
835
|
}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
})
|
|
990
|
-
});
|
|
991
|
-
return res;
|
|
992
|
-
};
|
|
993
|
-
var authorize = function authorize(data) {
|
|
994
|
-
return publicRequest.post("/auth?clientId=" + (CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf'), data);
|
|
995
|
-
};
|
|
996
|
-
var register = function register(data) {
|
|
997
|
-
return publicRequest.post('v1/oauth/register-rn', data);
|
|
998
|
-
};
|
|
999
|
-
var getPaymentData = function getPaymentData(hash) {
|
|
1000
|
-
var response = publicRequest.get("v1/order/" + hash + "/review/", {
|
|
1001
|
-
headers: {
|
|
1002
|
-
'Referer-Url': isDocumentDefined ? document.referrer : ''
|
|
1003
|
-
}
|
|
1004
|
-
})["catch"](function (error) {
|
|
1005
|
-
throw error;
|
|
1006
|
-
});
|
|
1007
|
-
return response;
|
|
1008
|
-
};
|
|
1009
|
-
var handlePaymentSuccess = function handlePaymentSuccess(orderHash) {
|
|
1010
|
-
var res = publicRequest.post("v1/order/" + orderHash + "/success", undefined, {
|
|
1011
|
-
headers: {
|
|
1012
|
-
'Referer-Url': isDocumentDefined ? document.referrer : ''
|
|
1013
|
-
}
|
|
1014
|
-
})["catch"](function (error) {
|
|
1015
|
-
throw error;
|
|
1016
|
-
});
|
|
1017
|
-
return res;
|
|
1018
|
-
};
|
|
1019
|
-
var createPaymentPlan = function createPaymentPlan(orderHash, stripePaymentMethodId) {
|
|
1020
|
-
var res = publicRequest.post("v1/order/" + orderHash + "/payment_plan/create", {
|
|
1021
|
-
stripe_payment_method_id: stripePaymentMethodId
|
|
1022
|
-
}, {
|
|
1023
|
-
headers: {
|
|
1024
|
-
'Referer-Url': isDocumentDefined ? document.referrer : ''
|
|
1025
|
-
}
|
|
1026
|
-
})["catch"](function (error) {
|
|
1027
|
-
throw error;
|
|
1028
|
-
});
|
|
1029
|
-
return res;
|
|
1030
|
-
};
|
|
1031
|
-
var handleFreeSuccess = function handleFreeSuccess(orderHash) {
|
|
1032
|
-
var res = publicRequest.post("v1/order/" + orderHash + "/complete_free_registration", undefined, {
|
|
1033
|
-
headers: {
|
|
1034
|
-
'Referer-Url': isDocumentDefined ? document.referrer : ''
|
|
1035
|
-
}
|
|
1036
|
-
})["catch"](function (error) {
|
|
1037
|
-
throw error;
|
|
1038
|
-
});
|
|
1039
|
-
return res;
|
|
1040
|
-
};
|
|
1041
|
-
var getProfileData = function getProfileData(accessToken) {
|
|
1042
|
-
return publicRequest.get('/customer/profile/', {
|
|
1043
|
-
headers: _extends({}, ttfHeaders, {
|
|
1044
|
-
Authorization: "Bearer " + accessToken
|
|
1045
|
-
})
|
|
1046
|
-
})["catch"](function (e) {
|
|
1047
|
-
return e;
|
|
1048
|
-
});
|
|
1049
|
-
};
|
|
1050
|
-
var getCountries = function getCountries() {
|
|
1051
|
-
return publicRequest.get('/countries/list');
|
|
1052
|
-
};
|
|
1053
|
-
var getConfirmationData = function getConfirmationData(orderHash) {
|
|
1054
|
-
return publicRequest.get("v1/order/" + orderHash + "/payment/complete");
|
|
1055
|
-
};
|
|
1056
|
-
var getStates = function getStates(countryId) {
|
|
1057
|
-
return publicRequest.get("/countries/" + countryId + "/states/");
|
|
1058
|
-
};
|
|
1059
|
-
var getOrders = function getOrders(page, limit, eventSlug) {
|
|
1060
|
-
return publicRequest.get("v1/account/orders/?page=" + page + "&limit=" + limit + "&filter[event]=" + eventSlug + "&" + (CONFIGS.BRAND_SLUG ? "filter[brand]=" + CONFIGS.BRAND_SLUG + "&filter[subbrands]=true" : ''));
|
|
1061
|
-
};
|
|
1062
|
-
var getOrderDetails = function getOrderDetails(orderId) {
|
|
1063
|
-
return publicRequest.get("v1/account/order/" + orderId);
|
|
1064
|
-
};
|
|
1065
|
-
var addToWaitingList = function addToWaitingList(id, data) {
|
|
1066
|
-
return publicRequest.post("v1/event/" + id + "/add_to_waiting_list", data);
|
|
1067
|
-
};
|
|
1068
|
-
var getConditions = function getConditions(eventId) {
|
|
1069
|
-
return publicRequest.get("v1/event/" + eventId + "/conditions");
|
|
1070
|
-
};
|
|
1071
|
-
// resale
|
|
1072
|
-
var resaleTicket = function resaleTicket(data, hash) {
|
|
1073
|
-
return publicRequest.post("v1/ticket/" + hash + "/sell", data);
|
|
1074
|
-
};
|
|
1075
|
-
var removeFromResale = function removeFromResale(hash) {
|
|
1076
|
-
return publicRequest["delete"]("v1/ticket/" + hash + "/sell");
|
|
1077
|
-
};
|
|
1078
|
-
var postReferralVisits = function postReferralVisits(eventId, referralId) {
|
|
1079
|
-
return publicRequest.post("v1/event/" + eventId + "/referrer/", {
|
|
1080
|
-
referrer: "" + referralId
|
|
1081
|
-
});
|
|
1082
|
-
};
|
|
1083
|
-
var logout = function logout() {
|
|
1084
|
-
return publicRequest["delete"]('/auth');
|
|
1085
|
-
};
|
|
1086
|
-
// forgot password
|
|
1087
|
-
var forgotPassword = function forgotPassword(email) {
|
|
1088
|
-
return publicRequest.post("/auth/restore-password", {
|
|
1089
|
-
email: email
|
|
1090
|
-
});
|
|
1091
|
-
};
|
|
1092
|
-
var resetPassword = function resetPassword(data) {
|
|
1093
|
-
return publicRequest.post("/auth/reset-password", data);
|
|
1094
|
-
};
|
|
1095
|
-
var processTicket = function processTicket(hash) {
|
|
1096
|
-
return publicRequest.post("v1/ticket/" + hash + "/process/");
|
|
1097
|
-
};
|
|
1098
|
-
var declineInvitation = function declineInvitation(hash) {
|
|
1099
|
-
return publicRequest.post("v1/ticket/" + hash + "/decline");
|
|
1100
|
-
};
|
|
1101
|
-
var sendRSVPInfo = function sendRSVPInfo(eventId, data) {
|
|
1102
|
-
return publicRequest.post("v1/event/" + eventId + "/send-rsvp-info", data);
|
|
1103
|
-
};
|
|
1104
|
-
var validatePhoneNumber = /*#__PURE__*/function () {
|
|
1105
|
-
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(phone) {
|
|
836
|
+
return Promise.reject(error);
|
|
837
|
+
});
|
|
838
|
+
|
|
839
|
+
var authorize = /*#__PURE__*/function () {
|
|
840
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
|
|
1106
841
|
var response;
|
|
1107
842
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1108
843
|
while (1) switch (_context.prev = _context.next) {
|
|
1109
844
|
case 0:
|
|
1110
845
|
_context.next = 2;
|
|
1111
|
-
return publicRequest.
|
|
846
|
+
return publicRequest.post("/auth?clientId=" + (CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf'), data);
|
|
1112
847
|
case 2:
|
|
1113
848
|
response = _context.sent;
|
|
1114
849
|
return _context.abrupt("return", response.data);
|
|
@@ -1118,101 +853,804 @@ var validatePhoneNumber = /*#__PURE__*/function () {
|
|
|
1118
853
|
}
|
|
1119
854
|
}, _callee);
|
|
1120
855
|
}));
|
|
1121
|
-
return function
|
|
856
|
+
return function authorize(_x) {
|
|
1122
857
|
return _ref.apply(this, arguments);
|
|
1123
858
|
};
|
|
1124
859
|
}();
|
|
1125
|
-
var
|
|
1126
|
-
var
|
|
1127
|
-
var
|
|
1128
|
-
return _regeneratorRuntime().wrap(function
|
|
1129
|
-
while (1) switch (
|
|
860
|
+
var register = /*#__PURE__*/function () {
|
|
861
|
+
var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(data) {
|
|
862
|
+
var response;
|
|
863
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
864
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
1130
865
|
case 0:
|
|
1131
|
-
|
|
1132
|
-
return publicRequest.
|
|
866
|
+
_context3.next = 2;
|
|
867
|
+
return publicRequest.post('v1/oauth/register-rn', data);
|
|
1133
868
|
case 2:
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
case
|
|
869
|
+
response = _context3.sent;
|
|
870
|
+
return _context3.abrupt("return", response.data);
|
|
871
|
+
case 4:
|
|
872
|
+
case "end":
|
|
873
|
+
return _context3.stop();
|
|
874
|
+
}
|
|
875
|
+
}, _callee3);
|
|
876
|
+
}));
|
|
877
|
+
return function register(_x3) {
|
|
878
|
+
return _ref3.apply(this, arguments);
|
|
879
|
+
};
|
|
880
|
+
}();
|
|
881
|
+
var getProfileData = /*#__PURE__*/function () {
|
|
882
|
+
var _ref4 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(accessToken) {
|
|
883
|
+
var response;
|
|
884
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
885
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
886
|
+
case 0:
|
|
887
|
+
_context4.next = 2;
|
|
888
|
+
return publicRequest.get('/customer/profile/', {
|
|
889
|
+
headers: _extends({}, publicRequest.defaults.headers.common, {
|
|
890
|
+
Authorization: "Bearer " + accessToken
|
|
891
|
+
})
|
|
892
|
+
});
|
|
893
|
+
case 2:
|
|
894
|
+
response = _context4.sent;
|
|
895
|
+
return _context4.abrupt("return", response.data);
|
|
896
|
+
case 4:
|
|
897
|
+
case "end":
|
|
898
|
+
return _context4.stop();
|
|
899
|
+
}
|
|
900
|
+
}, _callee4);
|
|
901
|
+
}));
|
|
902
|
+
return function getProfileData(_x4) {
|
|
903
|
+
return _ref4.apply(this, arguments);
|
|
904
|
+
};
|
|
905
|
+
}();
|
|
906
|
+
var logout = /*#__PURE__*/function () {
|
|
907
|
+
var _ref5 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
908
|
+
var response;
|
|
909
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
910
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
911
|
+
case 0:
|
|
912
|
+
_context5.next = 2;
|
|
913
|
+
return publicRequest["delete"]('/auth');
|
|
914
|
+
case 2:
|
|
915
|
+
response = _context5.sent;
|
|
916
|
+
return _context5.abrupt("return", response.data);
|
|
917
|
+
case 4:
|
|
918
|
+
case "end":
|
|
919
|
+
return _context5.stop();
|
|
920
|
+
}
|
|
921
|
+
}, _callee5);
|
|
922
|
+
}));
|
|
923
|
+
return function logout() {
|
|
924
|
+
return _ref5.apply(this, arguments);
|
|
925
|
+
};
|
|
926
|
+
}();
|
|
927
|
+
|
|
928
|
+
var getOrders = /*#__PURE__*/function () {
|
|
929
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(page, limit, eventSlug) {
|
|
930
|
+
var response;
|
|
931
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
932
|
+
while (1) switch (_context.prev = _context.next) {
|
|
933
|
+
case 0:
|
|
934
|
+
_context.next = 2;
|
|
935
|
+
return publicRequest.get("v1/account/orders/?page=" + page + "&limit=" + limit + "&filter[event]=" + (eventSlug || CONFIGS.EVENT_SLUG) + "&filter[brand]=" + (CONFIGS.BRAND_SLUG ? "filter[brand]=" + CONFIGS.BRAND_SLUG + "&filter[subbrands]=true" : ''));
|
|
936
|
+
case 2:
|
|
937
|
+
response = _context.sent;
|
|
938
|
+
return _context.abrupt("return", response.data);
|
|
939
|
+
case 4:
|
|
940
|
+
case "end":
|
|
941
|
+
return _context.stop();
|
|
942
|
+
}
|
|
943
|
+
}, _callee);
|
|
944
|
+
}));
|
|
945
|
+
return function getOrders(_x, _x2, _x3) {
|
|
946
|
+
return _ref.apply(this, arguments);
|
|
947
|
+
};
|
|
948
|
+
}();
|
|
949
|
+
var getOrderDetails = /*#__PURE__*/function () {
|
|
950
|
+
var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(orderId) {
|
|
951
|
+
var response;
|
|
952
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
953
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
954
|
+
case 0:
|
|
955
|
+
_context2.next = 2;
|
|
956
|
+
return publicRequest.get("v1/account/order/" + orderId);
|
|
957
|
+
case 2:
|
|
958
|
+
response = _context2.sent;
|
|
959
|
+
return _context2.abrupt("return", response.data);
|
|
960
|
+
case 4:
|
|
961
|
+
case "end":
|
|
962
|
+
return _context2.stop();
|
|
963
|
+
}
|
|
964
|
+
}, _callee2);
|
|
965
|
+
}));
|
|
966
|
+
return function getOrderDetails(_x4) {
|
|
967
|
+
return _ref2.apply(this, arguments);
|
|
968
|
+
};
|
|
969
|
+
}();
|
|
970
|
+
|
|
971
|
+
var addToCart = /*#__PURE__*/function () {
|
|
972
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id, data) {
|
|
973
|
+
var response;
|
|
974
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
975
|
+
while (1) switch (_context.prev = _context.next) {
|
|
976
|
+
case 0:
|
|
977
|
+
_context.next = 2;
|
|
978
|
+
return publicRequest.post("v1/event/" + id + "/add-to-cart/", {
|
|
979
|
+
data: data
|
|
980
|
+
}, {
|
|
981
|
+
headers: _extends({}, publicRequest.defaults.headers.common, {
|
|
982
|
+
'Referer-Url': isBrowser ? document.referrer : ''
|
|
983
|
+
})
|
|
984
|
+
});
|
|
985
|
+
case 2:
|
|
986
|
+
response = _context.sent;
|
|
987
|
+
return _context.abrupt("return", response.data);
|
|
988
|
+
case 4:
|
|
989
|
+
case "end":
|
|
990
|
+
return _context.stop();
|
|
991
|
+
}
|
|
992
|
+
}, _callee);
|
|
993
|
+
}));
|
|
994
|
+
return function addToCart(_x, _x2) {
|
|
995
|
+
return _ref.apply(this, arguments);
|
|
996
|
+
};
|
|
997
|
+
}();
|
|
998
|
+
var getCart = /*#__PURE__*/function () {
|
|
999
|
+
var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
1000
|
+
var response;
|
|
1001
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1002
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1003
|
+
case 0:
|
|
1004
|
+
_context2.next = 2;
|
|
1005
|
+
return publicRequest.get("v1/cart");
|
|
1006
|
+
case 2:
|
|
1007
|
+
response = _context2.sent;
|
|
1008
|
+
return _context2.abrupt("return", response.data);
|
|
1009
|
+
case 4:
|
|
1010
|
+
case "end":
|
|
1011
|
+
return _context2.stop();
|
|
1012
|
+
}
|
|
1013
|
+
}, _callee2);
|
|
1014
|
+
}));
|
|
1015
|
+
return function getCart() {
|
|
1016
|
+
return _ref2.apply(this, arguments);
|
|
1017
|
+
};
|
|
1018
|
+
}();
|
|
1019
|
+
|
|
1020
|
+
var postOnCheckout = /*#__PURE__*/function () {
|
|
1021
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, accessToken, freeTicket) {
|
|
1022
|
+
var response;
|
|
1023
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1024
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1025
|
+
case 0:
|
|
1026
|
+
if (freeTicket === void 0) {
|
|
1027
|
+
freeTicket = false;
|
|
1028
|
+
}
|
|
1029
|
+
if (freeTicket) {
|
|
1030
|
+
delete data.attributes.city;
|
|
1031
|
+
delete data.attributes.country;
|
|
1032
|
+
delete data.attributes.state;
|
|
1033
|
+
delete data.attributes.street_address;
|
|
1034
|
+
}
|
|
1035
|
+
_context.next = 4;
|
|
1036
|
+
return publicRequest.post("v1/on-checkout", {
|
|
1037
|
+
data: data
|
|
1038
|
+
}, {
|
|
1039
|
+
headers: _extends({}, publicRequest.defaults.headers.common, {
|
|
1040
|
+
Authorization: "Bearer " + accessToken
|
|
1041
|
+
})
|
|
1042
|
+
});
|
|
1043
|
+
case 4:
|
|
1044
|
+
response = _context.sent;
|
|
1045
|
+
return _context.abrupt("return", response.data);
|
|
1046
|
+
case 6:
|
|
1047
|
+
case "end":
|
|
1048
|
+
return _context.stop();
|
|
1049
|
+
}
|
|
1050
|
+
}, _callee);
|
|
1051
|
+
}));
|
|
1052
|
+
return function postOnCheckout(_x, _x2, _x3) {
|
|
1053
|
+
return _ref.apply(this, arguments);
|
|
1054
|
+
};
|
|
1055
|
+
}();
|
|
1056
|
+
|
|
1057
|
+
var getEvent = /*#__PURE__*/function () {
|
|
1058
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id, pk) {
|
|
1059
|
+
var referralValue, params, referralId, referral_key, _split, referralIdlocal, response;
|
|
1060
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1061
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1062
|
+
case 0:
|
|
1063
|
+
referralValue = '';
|
|
1064
|
+
if (isBrowser) {
|
|
1065
|
+
params = new URL("" + window.location);
|
|
1066
|
+
referralId = params.searchParams.get('ttf_r') || '';
|
|
1067
|
+
referral_key = window.localStorage.getItem('referral_key');
|
|
1068
|
+
_split = (referral_key || '').split('.'), referralIdlocal = _split[1];
|
|
1069
|
+
referralValue = referralId || referralIdlocal;
|
|
1070
|
+
}
|
|
1071
|
+
_context.next = 4;
|
|
1072
|
+
return publicRequest.get("v1/event/" + id, {
|
|
1073
|
+
params: {
|
|
1074
|
+
pk: pk
|
|
1075
|
+
},
|
|
1076
|
+
headers: _extends({}, publicRequest.defaults.headers.common, {
|
|
1077
|
+
'Referer-Url': isBrowser ? document.referrer : '',
|
|
1078
|
+
'Referrer-Id': isBrowser ? referralValue : ''
|
|
1079
|
+
})
|
|
1080
|
+
});
|
|
1081
|
+
case 4:
|
|
1082
|
+
response = _context.sent;
|
|
1083
|
+
return _context.abrupt("return", response.data);
|
|
1084
|
+
case 6:
|
|
1085
|
+
case "end":
|
|
1086
|
+
return _context.stop();
|
|
1087
|
+
}
|
|
1088
|
+
}, _callee);
|
|
1089
|
+
}));
|
|
1090
|
+
return function getEvent(_x, _x2) {
|
|
1091
|
+
return _ref.apply(this, arguments);
|
|
1092
|
+
};
|
|
1093
|
+
}();
|
|
1094
|
+
var getTickets = /*#__PURE__*/function () {
|
|
1095
|
+
var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(eventId, promoCode, pk) {
|
|
1096
|
+
var invitationHash, params, headers, response, tickets, ticketsArr, adaptedResponse;
|
|
1097
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1098
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1099
|
+
case 0:
|
|
1100
|
+
invitationHash = getQueryVariable('invitation-hash');
|
|
1101
|
+
params = {
|
|
1102
|
+
pk: pk
|
|
1103
|
+
};
|
|
1104
|
+
if (invitationHash) {
|
|
1105
|
+
params['invitation-hash'] = invitationHash;
|
|
1106
|
+
}
|
|
1107
|
+
headers = publicRequest.defaults.headers.common;
|
|
1108
|
+
if (promoCode) {
|
|
1109
|
+
headers['Promotion-Event'] = String(eventId);
|
|
1110
|
+
headers['Promotion-Code'] = promoCode;
|
|
1111
|
+
}
|
|
1112
|
+
_context2.next = 7;
|
|
1113
|
+
return publicRequest.get("v1/event/" + eventId + "/tickets/", {
|
|
1114
|
+
params: params,
|
|
1115
|
+
headers: headers
|
|
1116
|
+
});
|
|
1117
|
+
case 7:
|
|
1118
|
+
response = _context2.sent;
|
|
1119
|
+
tickets = response.data.data.attributes.tickets;
|
|
1120
|
+
ticketsArr = [];
|
|
1121
|
+
_forEach(tickets, function (item) {
|
|
1122
|
+
ticketsArr.push(item);
|
|
1123
|
+
});
|
|
1124
|
+
adaptedResponse = _extends({}, response, {
|
|
1125
|
+
data: _extends({}, response.data, {
|
|
1126
|
+
data: _extends({}, response.data.data, {
|
|
1127
|
+
attributes: _extends({}, response.data.data.attributes, {
|
|
1128
|
+
tickets: ticketsArr
|
|
1129
|
+
})
|
|
1130
|
+
})
|
|
1131
|
+
})
|
|
1132
|
+
});
|
|
1133
|
+
return _context2.abrupt("return", adaptedResponse.data);
|
|
1134
|
+
case 13:
|
|
1135
|
+
case "end":
|
|
1136
|
+
return _context2.stop();
|
|
1137
|
+
}
|
|
1138
|
+
}, _callee2);
|
|
1139
|
+
}));
|
|
1140
|
+
return function getTickets(_x3, _x4, _x5) {
|
|
1141
|
+
return _ref2.apply(this, arguments);
|
|
1142
|
+
};
|
|
1143
|
+
}();
|
|
1144
|
+
var getCountries = /*#__PURE__*/function () {
|
|
1145
|
+
var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
1146
|
+
var response;
|
|
1147
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1148
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
1149
|
+
case 0:
|
|
1150
|
+
_context3.next = 2;
|
|
1151
|
+
return publicRequest.get('/countries/list');
|
|
1152
|
+
case 2:
|
|
1153
|
+
response = _context3.sent;
|
|
1154
|
+
return _context3.abrupt("return", response.data);
|
|
1155
|
+
case 4:
|
|
1156
|
+
case "end":
|
|
1157
|
+
return _context3.stop();
|
|
1158
|
+
}
|
|
1159
|
+
}, _callee3);
|
|
1160
|
+
}));
|
|
1161
|
+
return function getCountries() {
|
|
1162
|
+
return _ref3.apply(this, arguments);
|
|
1163
|
+
};
|
|
1164
|
+
}();
|
|
1165
|
+
var getStates = /*#__PURE__*/function () {
|
|
1166
|
+
var _ref4 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(countryId) {
|
|
1167
|
+
var response;
|
|
1168
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
1169
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
1170
|
+
case 0:
|
|
1171
|
+
_context4.next = 2;
|
|
1172
|
+
return publicRequest.get("/countries/" + countryId + "/states/");
|
|
1173
|
+
case 2:
|
|
1174
|
+
response = _context4.sent;
|
|
1175
|
+
return _context4.abrupt("return", response.data);
|
|
1176
|
+
case 4:
|
|
1177
|
+
case "end":
|
|
1178
|
+
return _context4.stop();
|
|
1179
|
+
}
|
|
1180
|
+
}, _callee4);
|
|
1181
|
+
}));
|
|
1182
|
+
return function getStates(_x6) {
|
|
1183
|
+
return _ref4.apply(this, arguments);
|
|
1184
|
+
};
|
|
1185
|
+
}();
|
|
1186
|
+
var sendRSVPInfo = /*#__PURE__*/function () {
|
|
1187
|
+
var _ref5 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(eventId, data) {
|
|
1188
|
+
var response;
|
|
1189
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
1190
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
1191
|
+
case 0:
|
|
1192
|
+
_context5.next = 2;
|
|
1193
|
+
return publicRequest.post("v1/event/" + eventId + "/send-rsvp-info", data);
|
|
1194
|
+
case 2:
|
|
1195
|
+
response = _context5.sent;
|
|
1196
|
+
return _context5.abrupt("return", response.data);
|
|
1197
|
+
case 4:
|
|
1198
|
+
case "end":
|
|
1199
|
+
return _context5.stop();
|
|
1200
|
+
}
|
|
1201
|
+
}, _callee5);
|
|
1202
|
+
}));
|
|
1203
|
+
return function sendRSVPInfo(_x7, _x8) {
|
|
1204
|
+
return _ref5.apply(this, arguments);
|
|
1205
|
+
};
|
|
1206
|
+
}();
|
|
1207
|
+
var addToWaitingList = /*#__PURE__*/function () {
|
|
1208
|
+
var _ref6 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(id, data) {
|
|
1209
|
+
var response;
|
|
1210
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
1211
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
1212
|
+
case 0:
|
|
1213
|
+
_context6.next = 2;
|
|
1214
|
+
return publicRequest.post("v1/event/" + id + "/add_to_waiting_list", {
|
|
1215
|
+
data: data
|
|
1216
|
+
});
|
|
1217
|
+
case 2:
|
|
1218
|
+
response = _context6.sent;
|
|
1219
|
+
return _context6.abrupt("return", response.data);
|
|
1220
|
+
case 4:
|
|
1221
|
+
case "end":
|
|
1222
|
+
return _context6.stop();
|
|
1223
|
+
}
|
|
1224
|
+
}, _callee6);
|
|
1225
|
+
}));
|
|
1226
|
+
return function addToWaitingList(_x9, _x10) {
|
|
1227
|
+
return _ref6.apply(this, arguments);
|
|
1228
|
+
};
|
|
1229
|
+
}();
|
|
1230
|
+
var postReferralVisits = /*#__PURE__*/function () {
|
|
1231
|
+
var _ref7 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(eventId, referralId) {
|
|
1232
|
+
var response;
|
|
1233
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
1234
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
1235
|
+
case 0:
|
|
1236
|
+
_context7.next = 2;
|
|
1237
|
+
return publicRequest.post("v1/event/" + eventId + "/referrer/", {
|
|
1238
|
+
referrer: "" + referralId
|
|
1239
|
+
});
|
|
1240
|
+
case 2:
|
|
1241
|
+
response = _context7.sent;
|
|
1242
|
+
return _context7.abrupt("return", response.data);
|
|
1243
|
+
case 4:
|
|
1244
|
+
case "end":
|
|
1245
|
+
return _context7.stop();
|
|
1246
|
+
}
|
|
1247
|
+
}, _callee7);
|
|
1248
|
+
}));
|
|
1249
|
+
return function postReferralVisits(_x11, _x12) {
|
|
1250
|
+
return _ref7.apply(this, arguments);
|
|
1251
|
+
};
|
|
1252
|
+
}();
|
|
1253
|
+
var validatePhoneNumber = /*#__PURE__*/function () {
|
|
1254
|
+
var _ref8 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(phone) {
|
|
1255
|
+
var response;
|
|
1256
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
1257
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
1258
|
+
case 0:
|
|
1259
|
+
_context8.next = 2;
|
|
1260
|
+
return publicRequest.get("/v1/account/validate_phone?phone=" + phone);
|
|
1261
|
+
case 2:
|
|
1262
|
+
response = _context8.sent;
|
|
1263
|
+
return _context8.abrupt("return", response.data);
|
|
1264
|
+
case 4:
|
|
1265
|
+
case "end":
|
|
1266
|
+
return _context8.stop();
|
|
1267
|
+
}
|
|
1268
|
+
}, _callee8);
|
|
1269
|
+
}));
|
|
1270
|
+
return function validatePhoneNumber(_x13) {
|
|
1271
|
+
return _ref8.apply(this, arguments);
|
|
1272
|
+
};
|
|
1273
|
+
}();
|
|
1274
|
+
|
|
1275
|
+
var getPaymentData = /*#__PURE__*/function () {
|
|
1276
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(hash) {
|
|
1277
|
+
var response;
|
|
1278
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1279
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1280
|
+
case 0:
|
|
1281
|
+
_context.next = 2;
|
|
1282
|
+
return publicRequest.get("v1/order/" + hash + "/review", {
|
|
1283
|
+
headers: {
|
|
1284
|
+
'Referer-Url': isBrowser ? document.referrer : ''
|
|
1285
|
+
}
|
|
1286
|
+
});
|
|
1287
|
+
case 2:
|
|
1288
|
+
response = _context.sent;
|
|
1289
|
+
return _context.abrupt("return", response.data);
|
|
1290
|
+
case 4:
|
|
1291
|
+
case "end":
|
|
1292
|
+
return _context.stop();
|
|
1293
|
+
}
|
|
1294
|
+
}, _callee);
|
|
1295
|
+
}));
|
|
1296
|
+
return function getPaymentData(_x) {
|
|
1297
|
+
return _ref.apply(this, arguments);
|
|
1298
|
+
};
|
|
1299
|
+
}();
|
|
1300
|
+
var handlePaymentSuccess = /*#__PURE__*/function () {
|
|
1301
|
+
var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(orderHash) {
|
|
1302
|
+
var response;
|
|
1303
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1304
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1305
|
+
case 0:
|
|
1306
|
+
_context2.next = 2;
|
|
1307
|
+
return publicRequest.post("v1/order/" + orderHash + "/success", undefined, {
|
|
1308
|
+
headers: _extends({}, publicRequest.defaults.headers.common, {
|
|
1309
|
+
'Referer-Url': isBrowser ? document.referrer : ''
|
|
1310
|
+
})
|
|
1311
|
+
});
|
|
1312
|
+
case 2:
|
|
1313
|
+
response = _context2.sent;
|
|
1314
|
+
return _context2.abrupt("return", response.data);
|
|
1315
|
+
case 4:
|
|
1316
|
+
case "end":
|
|
1317
|
+
return _context2.stop();
|
|
1318
|
+
}
|
|
1319
|
+
}, _callee2);
|
|
1320
|
+
}));
|
|
1321
|
+
return function handlePaymentSuccess(_x2) {
|
|
1322
|
+
return _ref2.apply(this, arguments);
|
|
1323
|
+
};
|
|
1324
|
+
}();
|
|
1325
|
+
var handleFreeSuccess = /*#__PURE__*/function () {
|
|
1326
|
+
var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(orderHash) {
|
|
1327
|
+
var response;
|
|
1328
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1329
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
1330
|
+
case 0:
|
|
1331
|
+
_context3.next = 2;
|
|
1332
|
+
return publicRequest.post("v1/order/" + orderHash + "/complete_free_registration", undefined, {
|
|
1333
|
+
headers: {
|
|
1334
|
+
'Referer-Url': isBrowser ? document.referrer : ''
|
|
1335
|
+
}
|
|
1336
|
+
});
|
|
1337
|
+
case 2:
|
|
1338
|
+
response = _context3.sent;
|
|
1339
|
+
return _context3.abrupt("return", response.data);
|
|
1340
|
+
case 4:
|
|
1341
|
+
case "end":
|
|
1342
|
+
return _context3.stop();
|
|
1343
|
+
}
|
|
1344
|
+
}, _callee3);
|
|
1345
|
+
}));
|
|
1346
|
+
return function handleFreeSuccess(_x3) {
|
|
1347
|
+
return _ref3.apply(this, arguments);
|
|
1348
|
+
};
|
|
1349
|
+
}();
|
|
1350
|
+
var getConfirmationData = /*#__PURE__*/function () {
|
|
1351
|
+
var _ref4 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(orderHash) {
|
|
1352
|
+
var response;
|
|
1353
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
1354
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
1355
|
+
case 0:
|
|
1356
|
+
_context4.next = 2;
|
|
1357
|
+
return publicRequest.get("v1/order/" + orderHash + "/payment/complete");
|
|
1358
|
+
case 2:
|
|
1359
|
+
response = _context4.sent;
|
|
1360
|
+
return _context4.abrupt("return", response.data);
|
|
1361
|
+
case 4:
|
|
1362
|
+
case "end":
|
|
1363
|
+
return _context4.stop();
|
|
1364
|
+
}
|
|
1365
|
+
}, _callee4);
|
|
1366
|
+
}));
|
|
1367
|
+
return function getConfirmationData(_x4) {
|
|
1368
|
+
return _ref4.apply(this, arguments);
|
|
1369
|
+
};
|
|
1370
|
+
}();
|
|
1371
|
+
var getConditions = /*#__PURE__*/function () {
|
|
1372
|
+
var _ref5 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(eventId) {
|
|
1373
|
+
var response, adaptedData, returnData;
|
|
1374
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
1375
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
1376
|
+
case 0:
|
|
1377
|
+
_context5.next = 2;
|
|
1378
|
+
return publicRequest.get("v1/event/" + eventId + "/conditions");
|
|
1379
|
+
case 2:
|
|
1380
|
+
response = _context5.sent;
|
|
1381
|
+
adaptedData = _map(response.data.data.attributes, function (item) {
|
|
1382
|
+
return {
|
|
1383
|
+
id: nanoid.nanoid(),
|
|
1384
|
+
text: item,
|
|
1385
|
+
checked: false
|
|
1386
|
+
};
|
|
1387
|
+
});
|
|
1388
|
+
returnData = _extends({}, response, {
|
|
1389
|
+
data: _extends({}, response.data, {
|
|
1390
|
+
data: _extends({}, response.data.data, {
|
|
1391
|
+
attributes: adaptedData
|
|
1392
|
+
})
|
|
1393
|
+
})
|
|
1394
|
+
});
|
|
1395
|
+
return _context5.abrupt("return", returnData.data);
|
|
1396
|
+
case 6:
|
|
1397
|
+
case "end":
|
|
1398
|
+
return _context5.stop();
|
|
1399
|
+
}
|
|
1400
|
+
}, _callee5);
|
|
1401
|
+
}));
|
|
1402
|
+
return function getConditions(_x5) {
|
|
1403
|
+
return _ref5.apply(this, arguments);
|
|
1404
|
+
};
|
|
1405
|
+
}();
|
|
1406
|
+
|
|
1407
|
+
var resaleTicket = /*#__PURE__*/function () {
|
|
1408
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, hash) {
|
|
1409
|
+
var response;
|
|
1410
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1411
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1412
|
+
case 0:
|
|
1413
|
+
_context.next = 2;
|
|
1414
|
+
return publicRequest.post("v1/ticket/" + hash + "/sell", data);
|
|
1415
|
+
case 2:
|
|
1416
|
+
response = _context.sent;
|
|
1417
|
+
return _context.abrupt("return", response.data);
|
|
1418
|
+
case 4:
|
|
1419
|
+
case "end":
|
|
1420
|
+
return _context.stop();
|
|
1421
|
+
}
|
|
1422
|
+
}, _callee);
|
|
1423
|
+
}));
|
|
1424
|
+
return function resaleTicket(_x, _x2) {
|
|
1425
|
+
return _ref.apply(this, arguments);
|
|
1426
|
+
};
|
|
1427
|
+
}();
|
|
1428
|
+
var removeFromResale = /*#__PURE__*/function () {
|
|
1429
|
+
var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(hash) {
|
|
1430
|
+
var response;
|
|
1431
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1432
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1433
|
+
case 0:
|
|
1434
|
+
_context2.next = 2;
|
|
1435
|
+
return publicRequest["delete"]("v1/ticket/" + hash + "/sell");
|
|
1436
|
+
case 2:
|
|
1437
|
+
response = _context2.sent;
|
|
1438
|
+
return _context2.abrupt("return", response.data);
|
|
1439
|
+
case 4:
|
|
1440
|
+
case "end":
|
|
1441
|
+
return _context2.stop();
|
|
1442
|
+
}
|
|
1443
|
+
}, _callee2);
|
|
1444
|
+
}));
|
|
1445
|
+
return function removeFromResale(_x3) {
|
|
1446
|
+
return _ref2.apply(this, arguments);
|
|
1447
|
+
};
|
|
1448
|
+
}();
|
|
1449
|
+
var processTicket = function processTicket(hash) {
|
|
1450
|
+
return publicRequest.post("v1/ticket/" + hash + "/process-invitation");
|
|
1451
|
+
};
|
|
1452
|
+
var declineInvitation = function declineInvitation(hash) {
|
|
1453
|
+
return publicRequest.post("v1/ticket/" + hash + "/decline-invitation");
|
|
1454
|
+
};
|
|
1455
|
+
|
|
1456
|
+
var getCustomerExistsData = /*#__PURE__*/function () {
|
|
1457
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessHash) {
|
|
1458
|
+
var response;
|
|
1459
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1460
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1461
|
+
case 0:
|
|
1462
|
+
_context.next = 2;
|
|
1463
|
+
return publicRequest.get("/v1/delegation-access/" + accessHash + "/customer-exists");
|
|
1464
|
+
case 2:
|
|
1465
|
+
response = _context.sent;
|
|
1466
|
+
return _context.abrupt("return", response.data);
|
|
1467
|
+
case 4:
|
|
1468
|
+
case "end":
|
|
1469
|
+
return _context.stop();
|
|
1470
|
+
}
|
|
1471
|
+
}, _callee);
|
|
1472
|
+
}));
|
|
1473
|
+
return function getCustomerExistsData(_x) {
|
|
1474
|
+
return _ref.apply(this, arguments);
|
|
1475
|
+
};
|
|
1476
|
+
}();
|
|
1477
|
+
var getDelegationTickets = function getDelegationTickets(accessHash) {
|
|
1478
|
+
var res = publicRequest.get("v1/delegation-access/" + accessHash + "/consumer-page-info");
|
|
1479
|
+
return res;
|
|
1480
|
+
};
|
|
1481
|
+
var issueTicket = /*#__PURE__*/function () {
|
|
1482
|
+
var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(accessHash, data) {
|
|
1483
|
+
var response;
|
|
1484
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1485
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1486
|
+
case 0:
|
|
1487
|
+
_context2.next = 2;
|
|
1488
|
+
return publicRequest.post("v1/delegation-access/" + accessHash + "/issue-ticket", {
|
|
1489
|
+
data: {
|
|
1490
|
+
attributes: data
|
|
1491
|
+
}
|
|
1492
|
+
});
|
|
1493
|
+
case 2:
|
|
1494
|
+
response = _context2.sent;
|
|
1495
|
+
return _context2.abrupt("return", response.data);
|
|
1496
|
+
case 4:
|
|
1497
|
+
case "end":
|
|
1498
|
+
return _context2.stop();
|
|
1499
|
+
}
|
|
1500
|
+
}, _callee2);
|
|
1501
|
+
}));
|
|
1502
|
+
return function issueTicket(_x2, _x3) {
|
|
1503
|
+
return _ref2.apply(this, arguments);
|
|
1504
|
+
};
|
|
1505
|
+
}();
|
|
1506
|
+
|
|
1507
|
+
var setCustomHeader = function setCustomHeader(response) {
|
|
1508
|
+
var guestHeaderResponseValue = _get(response, 'headers.authorization-guest');
|
|
1509
|
+
var guestHeaderExistingValue = _get(response, 'config.headers[Authorization-Guest]');
|
|
1510
|
+
var guestHeader = guestHeaderResponseValue || guestHeaderExistingValue;
|
|
1511
|
+
if (guestHeader) {
|
|
1512
|
+
if (isBrowser) {
|
|
1513
|
+
window.localStorage.setItem('auth_guest_token', guestHeader);
|
|
1514
|
+
publicRequest.setGuestToken(guestHeader);
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
};
|
|
1518
|
+
var handleSetAccessToken = function handleSetAccessToken(token) {
|
|
1519
|
+
if (token) {
|
|
1520
|
+
if (isBrowser) {
|
|
1521
|
+
window.localStorage.setItem('access_token', token);
|
|
1522
|
+
publicRequest.setAccessToken(token);
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
};
|
|
1526
|
+
var createPaymentPlan = function createPaymentPlan(orderHash, stripePaymentMethodId) {
|
|
1527
|
+
var res = publicRequest.post("v1/order/" + orderHash + "/payment_plan/create", {
|
|
1528
|
+
stripe_payment_method_id: stripePaymentMethodId
|
|
1529
|
+
}, {
|
|
1530
|
+
headers: {
|
|
1531
|
+
'Referer-Url': isBrowser ? document.referrer : ''
|
|
1532
|
+
}
|
|
1533
|
+
})["catch"](function (error) {
|
|
1534
|
+
throw error;
|
|
1535
|
+
});
|
|
1536
|
+
return res;
|
|
1537
|
+
};
|
|
1538
|
+
// forgot password
|
|
1539
|
+
var forgotPassword = function forgotPassword(email) {
|
|
1540
|
+
return publicRequest.post("/auth/restore-password", {
|
|
1541
|
+
email: email
|
|
1542
|
+
});
|
|
1543
|
+
};
|
|
1544
|
+
var resetPassword = function resetPassword(data) {
|
|
1545
|
+
return publicRequest.post("/auth/reset-password", data);
|
|
1546
|
+
};
|
|
1547
|
+
var getAddons = /*#__PURE__*/function () {
|
|
1548
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(eventId) {
|
|
1549
|
+
var result, addons;
|
|
1550
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1551
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1552
|
+
case 0:
|
|
1553
|
+
_context.next = 2;
|
|
1554
|
+
return publicRequest.get("/v1/event/" + eventId + "/add-ons");
|
|
1555
|
+
case 2:
|
|
1556
|
+
result = _context.sent;
|
|
1557
|
+
addons = _get(result, 'data.data.attributes', []);
|
|
1558
|
+
return _context.abrupt("return", addons);
|
|
1559
|
+
case 5:
|
|
1560
|
+
case "end":
|
|
1561
|
+
return _context.stop();
|
|
1562
|
+
}
|
|
1563
|
+
}, _callee);
|
|
1564
|
+
}));
|
|
1565
|
+
return function getAddons(_x) {
|
|
1566
|
+
return _ref.apply(this, arguments);
|
|
1567
|
+
};
|
|
1568
|
+
}();
|
|
1569
|
+
var getCheckoutPageConfigs = /*#__PURE__*/function () {
|
|
1570
|
+
var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
1571
|
+
var response;
|
|
1572
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1573
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1574
|
+
case 0:
|
|
1575
|
+
_context2.next = 2;
|
|
1576
|
+
return publicRequest.get("v1/checkout-configs");
|
|
1577
|
+
case 2:
|
|
1578
|
+
response = _context2.sent;
|
|
1579
|
+
return _context2.abrupt("return", response.data);
|
|
1580
|
+
case 4:
|
|
1138
1581
|
case "end":
|
|
1139
1582
|
return _context2.stop();
|
|
1140
1583
|
}
|
|
1141
1584
|
}, _callee2);
|
|
1142
1585
|
}));
|
|
1143
|
-
return function
|
|
1586
|
+
return function getCheckoutPageConfigs() {
|
|
1144
1587
|
return _ref2.apply(this, arguments);
|
|
1145
1588
|
};
|
|
1146
1589
|
}();
|
|
1147
|
-
var
|
|
1148
|
-
var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
1149
|
-
var response;
|
|
1590
|
+
var getSeatMapData = /*#__PURE__*/function () {
|
|
1591
|
+
var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(eventId) {
|
|
1592
|
+
var reservedSeatsHash, params, response;
|
|
1150
1593
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1151
1594
|
while (1) switch (_context3.prev = _context3.next) {
|
|
1152
1595
|
case 0:
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1596
|
+
localStorage.setItem('tierId', '');
|
|
1597
|
+
reservedSeatsHash = getQueryVariable('reserved_seats_hash');
|
|
1598
|
+
params = {};
|
|
1599
|
+
if (reservedSeatsHash) {
|
|
1600
|
+
params.reserved_seats_hash = reservedSeatsHash;
|
|
1601
|
+
}
|
|
1602
|
+
_context3.next = 6;
|
|
1603
|
+
return publicRequest.get("v1/event/" + eventId + "/seat-map-data", {
|
|
1604
|
+
params: params
|
|
1605
|
+
});
|
|
1606
|
+
case 6:
|
|
1156
1607
|
response = _context3.sent;
|
|
1157
1608
|
return _context3.abrupt("return", response.data);
|
|
1158
|
-
case
|
|
1609
|
+
case 8:
|
|
1159
1610
|
case "end":
|
|
1160
1611
|
return _context3.stop();
|
|
1161
1612
|
}
|
|
1162
1613
|
}, _callee3);
|
|
1163
1614
|
}));
|
|
1164
|
-
return function
|
|
1615
|
+
return function getSeatMapData(_x2) {
|
|
1165
1616
|
return _ref3.apply(this, arguments);
|
|
1166
1617
|
};
|
|
1167
1618
|
}();
|
|
1168
|
-
|
|
1169
|
-
// const makeId = (length = 20) => {
|
|
1170
|
-
// let result = ''
|
|
1171
|
-
// const characters =
|
|
1172
|
-
// 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
|
1173
|
-
// const charactersLength = characters.length
|
|
1174
|
-
// for (let i = 0; i < length; i++) {
|
|
1175
|
-
// result += characters.charAt(Math.floor(Math.random() * charactersLength))
|
|
1176
|
-
// }
|
|
1177
|
-
// return result
|
|
1178
|
-
// }
|
|
1179
|
-
var getSeatMapData = /*#__PURE__*/function () {
|
|
1619
|
+
var getSeatMapStatuses = /*#__PURE__*/function () {
|
|
1180
1620
|
var _ref4 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(eventId) {
|
|
1181
|
-
var
|
|
1621
|
+
var response;
|
|
1182
1622
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
1183
1623
|
while (1) switch (_context4.prev = _context4.next) {
|
|
1184
1624
|
case 0:
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
if (reservedSeatsHash) {
|
|
1189
|
-
params.reserved_seats_hash = reservedSeatsHash;
|
|
1190
|
-
}
|
|
1191
|
-
_context4.next = 6;
|
|
1192
|
-
return publicRequest.get("v1/event/" + eventId + "/seat-map-data", {
|
|
1193
|
-
params: params
|
|
1194
|
-
});
|
|
1195
|
-
case 6:
|
|
1625
|
+
_context4.next = 2;
|
|
1626
|
+
return publicRequest.get("v1/event/" + eventId + "/seats/status");
|
|
1627
|
+
case 2:
|
|
1196
1628
|
response = _context4.sent;
|
|
1197
1629
|
return _context4.abrupt("return", response.data);
|
|
1198
|
-
case
|
|
1630
|
+
case 4:
|
|
1199
1631
|
case "end":
|
|
1200
1632
|
return _context4.stop();
|
|
1201
1633
|
}
|
|
1202
1634
|
}, _callee4);
|
|
1203
1635
|
}));
|
|
1204
|
-
return function
|
|
1636
|
+
return function getSeatMapStatuses(_x3) {
|
|
1205
1637
|
return _ref4.apply(this, arguments);
|
|
1206
1638
|
};
|
|
1207
1639
|
}();
|
|
1208
|
-
var
|
|
1209
|
-
var _ref5 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(eventId) {
|
|
1640
|
+
var reserveSeat = /*#__PURE__*/function () {
|
|
1641
|
+
var _ref5 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(eventId, tierId, seatId) {
|
|
1210
1642
|
var response;
|
|
1211
1643
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
1212
1644
|
while (1) switch (_context5.prev = _context5.next) {
|
|
1213
1645
|
case 0:
|
|
1214
1646
|
_context5.next = 2;
|
|
1215
|
-
return publicRequest.
|
|
1647
|
+
return publicRequest.post("v1/event/" + eventId + "/seats/reserve", {
|
|
1648
|
+
data: {
|
|
1649
|
+
tierId: tierId,
|
|
1650
|
+
seatId: seatId,
|
|
1651
|
+
ttl: 10
|
|
1652
|
+
}
|
|
1653
|
+
});
|
|
1216
1654
|
case 2:
|
|
1217
1655
|
response = _context5.sent;
|
|
1218
1656
|
return _context5.abrupt("return", response.data);
|
|
@@ -1222,22 +1660,21 @@ var getSeatMapStatuses = /*#__PURE__*/function () {
|
|
|
1222
1660
|
}
|
|
1223
1661
|
}, _callee5);
|
|
1224
1662
|
}));
|
|
1225
|
-
return function
|
|
1663
|
+
return function reserveSeat(_x4, _x5, _x6) {
|
|
1226
1664
|
return _ref5.apply(this, arguments);
|
|
1227
1665
|
};
|
|
1228
1666
|
}();
|
|
1229
|
-
var
|
|
1230
|
-
var _ref6 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(eventId, tierId,
|
|
1667
|
+
var removeSeatReserve = /*#__PURE__*/function () {
|
|
1668
|
+
var _ref6 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(eventId, tierId, seatIds) {
|
|
1231
1669
|
var response;
|
|
1232
1670
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
1233
1671
|
while (1) switch (_context6.prev = _context6.next) {
|
|
1234
1672
|
case 0:
|
|
1235
1673
|
_context6.next = 2;
|
|
1236
|
-
return publicRequest
|
|
1674
|
+
return publicRequest["delete"]("v1/event/" + eventId + "/seats/delete-reserved", {
|
|
1237
1675
|
data: {
|
|
1238
1676
|
tierId: tierId,
|
|
1239
|
-
|
|
1240
|
-
ttl: 10
|
|
1677
|
+
seatIds: seatIds
|
|
1241
1678
|
}
|
|
1242
1679
|
});
|
|
1243
1680
|
case 2:
|
|
@@ -1249,23 +1686,30 @@ var reserveSeat = /*#__PURE__*/function () {
|
|
|
1249
1686
|
}
|
|
1250
1687
|
}, _callee6);
|
|
1251
1688
|
}));
|
|
1252
|
-
return function
|
|
1689
|
+
return function removeSeatReserve(_x7, _x8, _x9) {
|
|
1253
1690
|
return _ref6.apply(this, arguments);
|
|
1254
1691
|
};
|
|
1255
1692
|
}();
|
|
1256
|
-
|
|
1257
|
-
|
|
1693
|
+
// seat map <--end-->
|
|
1694
|
+
function getPixelScript(id, pageOptions) {
|
|
1695
|
+
var response = publicRequest.get("v1/event/" + id + "/track", {
|
|
1696
|
+
params: {
|
|
1697
|
+
page_url: pageOptions.pageUrl,
|
|
1698
|
+
page: pageOptions.page,
|
|
1699
|
+
order_hash: pageOptions.orderHash
|
|
1700
|
+
}
|
|
1701
|
+
});
|
|
1702
|
+
return response;
|
|
1703
|
+
}
|
|
1704
|
+
// ID Verification
|
|
1705
|
+
var getNetverifyUrl = /*#__PURE__*/function () {
|
|
1706
|
+
var _ref7 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
1258
1707
|
var response;
|
|
1259
1708
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
1260
1709
|
while (1) switch (_context7.prev = _context7.next) {
|
|
1261
1710
|
case 0:
|
|
1262
1711
|
_context7.next = 2;
|
|
1263
|
-
return publicRequest
|
|
1264
|
-
data: {
|
|
1265
|
-
tierId: tierId,
|
|
1266
|
-
seatIds: seatIds
|
|
1267
|
-
}
|
|
1268
|
-
});
|
|
1712
|
+
return publicRequest.get('v1/authenticate/verify');
|
|
1269
1713
|
case 2:
|
|
1270
1714
|
response = _context7.sent;
|
|
1271
1715
|
return _context7.abrupt("return", response.data);
|
|
@@ -1275,30 +1719,18 @@ var removeSeatReserve = /*#__PURE__*/function () {
|
|
|
1275
1719
|
}
|
|
1276
1720
|
}, _callee7);
|
|
1277
1721
|
}));
|
|
1278
|
-
return function
|
|
1722
|
+
return function getNetverifyUrl() {
|
|
1279
1723
|
return _ref7.apply(this, arguments);
|
|
1280
1724
|
};
|
|
1281
1725
|
}();
|
|
1282
|
-
|
|
1283
|
-
function getPixelScript(id, pageOptions) {
|
|
1284
|
-
var response = publicRequest.get("v1/event/" + id + "/track", {
|
|
1285
|
-
params: {
|
|
1286
|
-
page_url: pageOptions.pageUrl,
|
|
1287
|
-
page: pageOptions.page,
|
|
1288
|
-
order_hash: pageOptions.orderHash
|
|
1289
|
-
}
|
|
1290
|
-
});
|
|
1291
|
-
return response;
|
|
1292
|
-
}
|
|
1293
|
-
// ID Verification
|
|
1294
|
-
var getNetverifyUrl = /*#__PURE__*/function () {
|
|
1726
|
+
var checkVerificationStatus = /*#__PURE__*/function () {
|
|
1295
1727
|
var _ref8 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
1296
1728
|
var response;
|
|
1297
1729
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
1298
1730
|
while (1) switch (_context8.prev = _context8.next) {
|
|
1299
1731
|
case 0:
|
|
1300
1732
|
_context8.next = 2;
|
|
1301
|
-
return publicRequest.get('v1/authenticate/
|
|
1733
|
+
return publicRequest.get('v1/authenticate/get-verification-info');
|
|
1302
1734
|
case 2:
|
|
1303
1735
|
response = _context8.sent;
|
|
1304
1736
|
return _context8.abrupt("return", response.data);
|
|
@@ -1308,18 +1740,26 @@ var getNetverifyUrl = /*#__PURE__*/function () {
|
|
|
1308
1740
|
}
|
|
1309
1741
|
}, _callee8);
|
|
1310
1742
|
}));
|
|
1311
|
-
return function
|
|
1743
|
+
return function checkVerificationStatus() {
|
|
1312
1744
|
return _ref8.apply(this, arguments);
|
|
1313
1745
|
};
|
|
1314
1746
|
}();
|
|
1315
|
-
var
|
|
1747
|
+
var updateVerificationStatus = /*#__PURE__*/function () {
|
|
1316
1748
|
var _ref9 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
1317
1749
|
var response;
|
|
1318
1750
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
1319
1751
|
while (1) switch (_context9.prev = _context9.next) {
|
|
1320
1752
|
case 0:
|
|
1321
1753
|
_context9.next = 2;
|
|
1322
|
-
return publicRequest.
|
|
1754
|
+
return publicRequest.patch('v1/authenticate/verify', {
|
|
1755
|
+
data: {
|
|
1756
|
+
attributes: {
|
|
1757
|
+
verification: {
|
|
1758
|
+
verificationStatus: 'PENDING'
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
});
|
|
1323
1763
|
case 2:
|
|
1324
1764
|
response = _context9.sent;
|
|
1325
1765
|
return _context9.abrupt("return", response.data);
|
|
@@ -1329,26 +1769,18 @@ var checkVerificationStatus = /*#__PURE__*/function () {
|
|
|
1329
1769
|
}
|
|
1330
1770
|
}, _callee9);
|
|
1331
1771
|
}));
|
|
1332
|
-
return function
|
|
1772
|
+
return function updateVerificationStatus() {
|
|
1333
1773
|
return _ref9.apply(this, arguments);
|
|
1334
1774
|
};
|
|
1335
1775
|
}();
|
|
1336
|
-
var
|
|
1337
|
-
var _ref10 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
1776
|
+
var checkCustomerOrder = /*#__PURE__*/function () {
|
|
1777
|
+
var _ref10 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(orderHash) {
|
|
1338
1778
|
var response;
|
|
1339
1779
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
1340
1780
|
while (1) switch (_context10.prev = _context10.next) {
|
|
1341
1781
|
case 0:
|
|
1342
1782
|
_context10.next = 2;
|
|
1343
|
-
return publicRequest.
|
|
1344
|
-
data: {
|
|
1345
|
-
attributes: {
|
|
1346
|
-
verification: {
|
|
1347
|
-
verificationStatus: 'PENDING'
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
});
|
|
1783
|
+
return publicRequest.get("v1/order/" + orderHash + "/verify-customer-order");
|
|
1352
1784
|
case 2:
|
|
1353
1785
|
response = _context10.sent;
|
|
1354
1786
|
return _context10.abrupt("return", response.data);
|
|
@@ -1358,52 +1790,31 @@ var updateVerificationStatus = /*#__PURE__*/function () {
|
|
|
1358
1790
|
}
|
|
1359
1791
|
}, _callee10);
|
|
1360
1792
|
}));
|
|
1361
|
-
return function
|
|
1793
|
+
return function checkCustomerOrder(_x10) {
|
|
1362
1794
|
return _ref10.apply(this, arguments);
|
|
1363
1795
|
};
|
|
1364
1796
|
}();
|
|
1365
|
-
var
|
|
1366
|
-
var _ref11 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(
|
|
1797
|
+
var refreshSeatReservation = /*#__PURE__*/function () {
|
|
1798
|
+
var _ref11 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(eventId) {
|
|
1367
1799
|
var response;
|
|
1368
1800
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
1369
1801
|
while (1) switch (_context11.prev = _context11.next) {
|
|
1370
1802
|
case 0:
|
|
1371
1803
|
_context11.next = 2;
|
|
1372
|
-
return publicRequest.
|
|
1804
|
+
return publicRequest.patch("event/" + eventId + "/reservation/refresh/");
|
|
1373
1805
|
case 2:
|
|
1374
1806
|
response = _context11.sent;
|
|
1375
|
-
return _context11.abrupt("return", response
|
|
1807
|
+
return _context11.abrupt("return", response);
|
|
1376
1808
|
case 4:
|
|
1377
1809
|
case "end":
|
|
1378
1810
|
return _context11.stop();
|
|
1379
1811
|
}
|
|
1380
1812
|
}, _callee11);
|
|
1381
1813
|
}));
|
|
1382
|
-
return function
|
|
1814
|
+
return function refreshSeatReservation(_x11) {
|
|
1383
1815
|
return _ref11.apply(this, arguments);
|
|
1384
1816
|
};
|
|
1385
1817
|
}();
|
|
1386
|
-
var refreshSeatReservation = /*#__PURE__*/function () {
|
|
1387
|
-
var _ref12 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(eventId) {
|
|
1388
|
-
var response;
|
|
1389
|
-
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
1390
|
-
while (1) switch (_context12.prev = _context12.next) {
|
|
1391
|
-
case 0:
|
|
1392
|
-
_context12.next = 2;
|
|
1393
|
-
return publicRequest.patch("event/" + eventId + "/reservation/refresh/");
|
|
1394
|
-
case 2:
|
|
1395
|
-
response = _context12.sent;
|
|
1396
|
-
return _context12.abrupt("return", response);
|
|
1397
|
-
case 4:
|
|
1398
|
-
case "end":
|
|
1399
|
-
return _context12.stop();
|
|
1400
|
-
}
|
|
1401
|
-
}, _callee12);
|
|
1402
|
-
}));
|
|
1403
|
-
return function refreshSeatReservation(_x12) {
|
|
1404
|
-
return _ref12.apply(this, arguments);
|
|
1405
|
-
};
|
|
1406
|
-
}();
|
|
1407
1818
|
|
|
1408
1819
|
function appendScriptsToHeader(code) {
|
|
1409
1820
|
if (isBrowser && code) {
|
|
@@ -1881,21 +2292,6 @@ var style$2 = {
|
|
|
1881
2292
|
border: '1px solid white',
|
|
1882
2293
|
outline: 'none'
|
|
1883
2294
|
};
|
|
1884
|
-
var setLoggedUserData$1 = function setLoggedUserData(data) {
|
|
1885
|
-
return {
|
|
1886
|
-
id: data.id,
|
|
1887
|
-
first_name: data.firstName,
|
|
1888
|
-
last_name: data.lastName,
|
|
1889
|
-
email: data.email,
|
|
1890
|
-
confirmEmail: data.email,
|
|
1891
|
-
city: (data == null ? void 0 : data.city) || '',
|
|
1892
|
-
country: (data == null ? void 0 : data.countryId) || (data == null ? void 0 : data.country) || '',
|
|
1893
|
-
phone: (data == null ? void 0 : data.phone) || '',
|
|
1894
|
-
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
1895
|
-
state: (data == null ? void 0 : data.stateId) || '',
|
|
1896
|
-
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
1897
|
-
};
|
|
1898
|
-
};
|
|
1899
2295
|
var LoginModal = function LoginModal(_ref) {
|
|
1900
2296
|
var onClose = _ref.onClose,
|
|
1901
2297
|
onLogin = _ref.onLogin,
|
|
@@ -1968,9 +2364,9 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1968
2364
|
}
|
|
1969
2365
|
return _context.abrupt("return");
|
|
1970
2366
|
case 17:
|
|
1971
|
-
profileSpecifiedData =
|
|
1972
|
-
profileDataObj = setLoggedUserData
|
|
1973
|
-
if (
|
|
2367
|
+
profileSpecifiedData = profileResponse.data;
|
|
2368
|
+
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
2369
|
+
if (isBrowser) {
|
|
1974
2370
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
1975
2371
|
event = new window.CustomEvent('tf-login');
|
|
1976
2372
|
window.document.dispatchEvent(event);
|
|
@@ -2004,10 +2400,10 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
2004
2400
|
}, React__default.createElement("div", {
|
|
2005
2401
|
className: "modal-title"
|
|
2006
2402
|
}, "Login"), React__default.createElement("div", {
|
|
2007
|
-
className:
|
|
2403
|
+
className: "login-logo-container"
|
|
2008
2404
|
}, React__default.createElement("img", {
|
|
2009
2405
|
className: "login-logo-tff",
|
|
2010
|
-
src: logo ||
|
|
2406
|
+
src: logo || 'https://www.ticketfairy.com/resources/images/logo-ttf-black.svg',
|
|
2011
2407
|
alt: "logo"
|
|
2012
2408
|
})), React__default.createElement("div", {
|
|
2013
2409
|
className: "server_auth__error"
|
|
@@ -2117,8 +2513,8 @@ var SignupModal = function SignupModal(_ref) {
|
|
|
2117
2513
|
return register(formData);
|
|
2118
2514
|
case 12:
|
|
2119
2515
|
res = _context.sent;
|
|
2120
|
-
access_token_register = _get(res, 'data.
|
|
2121
|
-
refreshToken = _get(res, 'data.
|
|
2516
|
+
access_token_register = _get(res, 'data.attributes.access_token');
|
|
2517
|
+
refreshToken = _get(res, 'data.attributes.refresh_token');
|
|
2122
2518
|
handleSetAccessToken(access_token_register);
|
|
2123
2519
|
tokens = {
|
|
2124
2520
|
accessToken: access_token_register,
|
|
@@ -2296,7 +2692,7 @@ var TimerWidget = function TimerWidget(_ref) {
|
|
|
2296
2692
|
};
|
|
2297
2693
|
var TimerWidget$1 = /*#__PURE__*/React.memo(TimerWidget);
|
|
2298
2694
|
|
|
2299
|
-
var _excluded = ["label", "field", "selectOptions", "theme", "setFieldValue", "disableDropdown", "setPhoneValidationIsLoading", "defaultCountry", "required", "uniqueId", "dateFormat", "datePlaceholder"];
|
|
2695
|
+
var _excluded = ["label", "field", "selectOptions", "theme", "setFieldValue", "disableDropdown", "setPhoneValidationIsLoading", "defaultCountry", "required", "uniqueId", "dateFormat", "datePlaceholder", "isCountryCodeEditable"];
|
|
2300
2696
|
var CheckboxField = function CheckboxField(_ref) {
|
|
2301
2697
|
var _rest$form, _field$name, _rest$form2, _field$name2;
|
|
2302
2698
|
var label = _ref.label,
|
|
@@ -2311,7 +2707,7 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
2311
2707
|
componentsProps: {
|
|
2312
2708
|
typography: customTheme == null ? void 0 : customTheme.checkbox
|
|
2313
2709
|
}
|
|
2314
|
-
})),
|
|
2710
|
+
})), rest != null && (_rest$form2 = rest.form) != null && _rest$form2.errors && rest.form.errors[(_field$name2 = field == null ? void 0 : field.name) != null ? _field$name2 : ''] ? React__default.createElement(material.FormHelperText, null, "Required") : null);
|
|
2315
2711
|
};
|
|
2316
2712
|
|
|
2317
2713
|
var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
@@ -2745,21 +3141,6 @@ var createRegisterFormData = function createRegisterFormData(values, checkoutBod
|
|
|
2745
3141
|
});
|
|
2746
3142
|
return bodyFormData;
|
|
2747
3143
|
};
|
|
2748
|
-
var setLoggedUserData$2 = function setLoggedUserData(data) {
|
|
2749
|
-
return {
|
|
2750
|
-
id: data.id,
|
|
2751
|
-
first_name: data.firstName,
|
|
2752
|
-
last_name: data.lastName,
|
|
2753
|
-
email: data.email,
|
|
2754
|
-
confirmEmail: data.email,
|
|
2755
|
-
city: (data == null ? void 0 : data.city) || '',
|
|
2756
|
-
country: (data == null ? void 0 : data.countryId) || (data == null ? void 0 : data.country) || '',
|
|
2757
|
-
phone: (data == null ? void 0 : data.phone) || '',
|
|
2758
|
-
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
2759
|
-
state: (data == null ? void 0 : data.stateId) || '',
|
|
2760
|
-
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
2761
|
-
};
|
|
2762
|
-
};
|
|
2763
3144
|
var createCheckoutDataBody = function createCheckoutDataBody(ticketsQuantity, values, logedInValues, includeDob) {
|
|
2764
3145
|
if (values === void 0) {
|
|
2765
3146
|
values = {};
|
|
@@ -2922,7 +3303,7 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2922
3303
|
return getStates(values.country);
|
|
2923
3304
|
case 3:
|
|
2924
3305
|
res = _context.sent;
|
|
2925
|
-
mappedStates = _map(
|
|
3306
|
+
mappedStates = _map(res.data, function (item, key) {
|
|
2926
3307
|
return {
|
|
2927
3308
|
label: item,
|
|
2928
3309
|
value: key
|
|
@@ -2957,11 +3338,11 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2957
3338
|
}();
|
|
2958
3339
|
shouldFetchCountries && fetchStates();
|
|
2959
3340
|
}, [values.country, setStates, setFieldValue]);
|
|
2960
|
-
var userDataEncoded =
|
|
3341
|
+
var userDataEncoded = isBrowser ? window.localStorage.getItem('user_data') : '';
|
|
2961
3342
|
React.useEffect(function () {
|
|
2962
3343
|
// set user data from local storage
|
|
2963
3344
|
var getStoredUserData = function getStoredUserData() {
|
|
2964
|
-
if (
|
|
3345
|
+
if (isBrowser) {
|
|
2965
3346
|
if (userDataEncoded) {
|
|
2966
3347
|
try {
|
|
2967
3348
|
var parsedData = JSON.parse(userDataEncoded);
|
|
@@ -3092,9 +3473,8 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3092
3473
|
isNewUser = _useState4[0],
|
|
3093
3474
|
setIsNewUser = _useState4[1];
|
|
3094
3475
|
var themeMui = styles.createTheme(themeOptions);
|
|
3095
|
-
var isWindowDefined = typeof window !== 'undefined';
|
|
3096
3476
|
React.useEffect(function () {
|
|
3097
|
-
if (
|
|
3477
|
+
if (isBrowser) {
|
|
3098
3478
|
var _extraData = window.localStorage.getItem('extraData');
|
|
3099
3479
|
if (_extraData) {
|
|
3100
3480
|
setExtraData(JSON.parse(_extraData));
|
|
@@ -3109,10 +3489,10 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3109
3489
|
})["catch"](function () {
|
|
3110
3490
|
setIsConfigLoading(false);
|
|
3111
3491
|
});
|
|
3112
|
-
}, [
|
|
3113
|
-
var defaultCountry =
|
|
3114
|
-
var userData =
|
|
3115
|
-
var access_token =
|
|
3492
|
+
}, [isBrowser]);
|
|
3493
|
+
var defaultCountry = isBrowser ? window.localStorage.getItem('eventCountry') : '';
|
|
3494
|
+
var userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
3495
|
+
var access_token = isBrowser && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
3116
3496
|
var _useState5 = React.useState(assingUniqueIds(data)),
|
|
3117
3497
|
dataWithUniqueIds = _useState5[0],
|
|
3118
3498
|
setDataWithUniqueIds = _useState5[1];
|
|
@@ -3257,7 +3637,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3257
3637
|
case 3:
|
|
3258
3638
|
res = _context2.sent;
|
|
3259
3639
|
setCustomHeader(res);
|
|
3260
|
-
setCountries(
|
|
3640
|
+
setCountries(res.data);
|
|
3261
3641
|
setIsCountriesLoading(false);
|
|
3262
3642
|
onGetCountriesSuccess(res.data);
|
|
3263
3643
|
_context2.next = 14;
|
|
@@ -3296,7 +3676,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3296
3676
|
case 4:
|
|
3297
3677
|
res = _context3.sent;
|
|
3298
3678
|
setCustomHeader(res);
|
|
3299
|
-
cartInfo =
|
|
3679
|
+
cartInfo = res.data.attributes;
|
|
3300
3680
|
setCartInfo(cartInfo);
|
|
3301
3681
|
_cartInfo$cart = cartInfo.cart, cart = _cartInfo$cart === void 0 ? [] : _cartInfo$cart;
|
|
3302
3682
|
setTicketsQuantity(new Array(getQuantity(cart)).fill(null).map(function () {
|
|
@@ -3333,7 +3713,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3333
3713
|
while (1) switch (_context4.prev = _context4.next) {
|
|
3334
3714
|
case 0:
|
|
3335
3715
|
_context4.prev = 0;
|
|
3336
|
-
if (!(
|
|
3716
|
+
if (!(isBrowser && token || isLoggedIn)) {
|
|
3337
3717
|
_context4.next = 10;
|
|
3338
3718
|
break;
|
|
3339
3719
|
}
|
|
@@ -3341,8 +3721,8 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3341
3721
|
return getProfileData(token);
|
|
3342
3722
|
case 4:
|
|
3343
3723
|
userDataResponse = _context4.sent;
|
|
3344
|
-
profileSpecifiedData = _get(userDataResponse, 'data
|
|
3345
|
-
profileDataObj = setLoggedUserData
|
|
3724
|
+
profileSpecifiedData = _get(userDataResponse, 'data');
|
|
3725
|
+
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
3346
3726
|
setUserValues(_extends({}, profileDataObj, {
|
|
3347
3727
|
firstName: profileDataObj.first_name,
|
|
3348
3728
|
lastName: profileDataObj.last_name
|
|
@@ -3375,7 +3755,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3375
3755
|
React.useEffect(function () {
|
|
3376
3756
|
var collectPaymentData = /*#__PURE__*/function () {
|
|
3377
3757
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
3378
|
-
var checkoutBody,
|
|
3758
|
+
var checkoutBody, checkoutResponse, _e$response, _e$response$data, _e$response$data$data, _e$response2, _e$response2$data;
|
|
3379
3759
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
3380
3760
|
while (1) switch (_context5.prev = _context5.next) {
|
|
3381
3761
|
case 0:
|
|
@@ -3386,15 +3766,15 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3386
3766
|
setLoading(true);
|
|
3387
3767
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity.length, userData);
|
|
3388
3768
|
_context5.prev = 3;
|
|
3389
|
-
if (
|
|
3769
|
+
if (isBrowser) {
|
|
3390
3770
|
addAddOnsInAttributes(checkoutBody);
|
|
3391
3771
|
}
|
|
3392
3772
|
_context5.next = 7;
|
|
3393
3773
|
return postOnCheckout(checkoutBody, access_token, flagFreeTicket);
|
|
3394
3774
|
case 7:
|
|
3395
|
-
|
|
3775
|
+
checkoutResponse = _context5.sent;
|
|
3396
3776
|
removeReferralKey();
|
|
3397
|
-
onSkipBillingPage(
|
|
3777
|
+
onSkipBillingPage(checkoutResponse.data.attributes);
|
|
3398
3778
|
setLoading(false);
|
|
3399
3779
|
_context5.next = 17;
|
|
3400
3780
|
break;
|
|
@@ -3443,7 +3823,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3443
3823
|
var removeReferralKey = function removeReferralKey() {
|
|
3444
3824
|
localStorage.removeItem('referral_key');
|
|
3445
3825
|
};
|
|
3446
|
-
if (loading || enableTimer && !expirationTime &&
|
|
3826
|
+
if (loading || enableTimer && !expirationTime && isBrowser) {
|
|
3447
3827
|
if (expirationTime === 0) {
|
|
3448
3828
|
// Redirect to homepage (countdown finished and browser reloaded case)
|
|
3449
3829
|
window.location.href = '/';
|
|
@@ -3452,7 +3832,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3452
3832
|
var selectedCountry = _find(countries, function (item) {
|
|
3453
3833
|
return item.code.toLowerCase() === defaultCountry;
|
|
3454
3834
|
}) || {};
|
|
3455
|
-
var initialCountry = selectedCountry.id || _get(userData, '
|
|
3835
|
+
var initialCountry = selectedCountry.id || _get(userData, 'countryId', '') || '1';
|
|
3456
3836
|
var pageUrl = isBrowser ? window.location.href.split('?')[0] : '';
|
|
3457
3837
|
usePixel(eventId || '', {
|
|
3458
3838
|
page: 'billing',
|
|
@@ -3478,31 +3858,31 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3478
3858
|
}), !isCountriesLoading && !isConfigLoading && React__default.createElement(formik.Formik, {
|
|
3479
3859
|
initialValues: getInitialValues(dataWithUniqueIds, _extends({
|
|
3480
3860
|
country: initialCountry,
|
|
3481
|
-
state: _get(userData, '
|
|
3861
|
+
state: _get(userData, 'stateId', '') || '1',
|
|
3482
3862
|
brand_opt_in: optedInFieldValue,
|
|
3483
3863
|
ttf_opt_in: ttfOptIn,
|
|
3484
3864
|
data_capture: {
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3865
|
+
instagram: _get(extraData, 'data_capture.instagram', ''),
|
|
3866
|
+
company: _get(extraData, 'data_capture.company', ''),
|
|
3867
|
+
businessCategory: _get(extraData, 'data_capture.businessCategory', ''),
|
|
3868
|
+
jobTitle: _get(extraData, 'data_capture.jobTitle', '')
|
|
3489
3869
|
}
|
|
3490
3870
|
}, initialValues), userValues),
|
|
3491
3871
|
enableReinitialize: false,
|
|
3492
3872
|
onSubmit: function () {
|
|
3493
3873
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(values, formikHelpers) {
|
|
3494
|
-
var _checkoutBody,
|
|
3874
|
+
var _checkoutBody, _checkoutResponse, updatedUserData, _profileSpecifiedData, _profileDataObj, checkoutBodyForRegistration, bodyFormData, resRegister, _xtfCookie, accessToken, refreshToken, userProfile, _e$response3, _e$response3$data, _e$response3$data$dat, _e$response4, _e$response4$data, _e$response5, _e$response5$data, _error, profileData, profileSpecifiedData, profileDataObj, checkoutBody, checkoutResponse, _e$response6, _e$response6$data, _e$response6$data$dat, _e$response7, _e$response7$data, _e$response8, _e$response9, _e$response9$data, _e$response10, event;
|
|
3495
3875
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
3496
3876
|
while (1) switch (_context6.prev = _context6.next) {
|
|
3497
3877
|
case 0:
|
|
3498
3878
|
_context6.prev = 0;
|
|
3499
|
-
if (
|
|
3879
|
+
if (isBrowser) {
|
|
3500
3880
|
window.localStorage.setItem('extraData', JSON.stringify({
|
|
3501
3881
|
data_capture: {
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3882
|
+
instagram: _get(values, 'data_capture.instagram', ''),
|
|
3883
|
+
company: _get(values, 'data_capture.company', ''),
|
|
3884
|
+
businessCategory: _get(values, 'data_capture.businessCategory', ''),
|
|
3885
|
+
jobTitle: _get(values, 'data_capture.jobTitle', '')
|
|
3506
3886
|
}
|
|
3507
3887
|
}));
|
|
3508
3888
|
}
|
|
@@ -3511,16 +3891,16 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3511
3891
|
break;
|
|
3512
3892
|
}
|
|
3513
3893
|
_checkoutBody = collectCheckoutBody(values, userData);
|
|
3514
|
-
if (
|
|
3894
|
+
if (isBrowser) {
|
|
3515
3895
|
addAddOnsInAttributes(_checkoutBody);
|
|
3516
3896
|
}
|
|
3517
3897
|
_context6.next = 7;
|
|
3518
3898
|
return postOnCheckout(_checkoutBody, access_token, flagFreeTicket);
|
|
3519
3899
|
case 7:
|
|
3520
|
-
|
|
3900
|
+
_checkoutResponse = _context6.sent;
|
|
3521
3901
|
removeReferralKey();
|
|
3522
3902
|
// After checkout is successful recover updated profile and store it on local storage if needed
|
|
3523
|
-
if (!
|
|
3903
|
+
if (!isBrowser) {
|
|
3524
3904
|
_context6.next = 16;
|
|
3525
3905
|
break;
|
|
3526
3906
|
}
|
|
@@ -3528,11 +3908,11 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3528
3908
|
return getProfileData(access_token);
|
|
3529
3909
|
case 12:
|
|
3530
3910
|
updatedUserData = _context6.sent;
|
|
3531
|
-
_profileSpecifiedData = _get(updatedUserData, 'data
|
|
3532
|
-
_profileDataObj = setLoggedUserData
|
|
3911
|
+
_profileSpecifiedData = _get(updatedUserData, 'data');
|
|
3912
|
+
_profileDataObj = setLoggedUserData(_profileSpecifiedData);
|
|
3533
3913
|
window.localStorage.setItem('user_data', JSON.stringify(_profileDataObj));
|
|
3534
3914
|
case 16:
|
|
3535
|
-
handleSubmit(values, formikHelpers, eventId,
|
|
3915
|
+
handleSubmit(values, formikHelpers, eventId, _checkoutResponse);
|
|
3536
3916
|
return _context6.abrupt("return");
|
|
3537
3917
|
case 18:
|
|
3538
3918
|
checkoutBodyForRegistration = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
@@ -3548,9 +3928,9 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3548
3928
|
case 24:
|
|
3549
3929
|
resRegister = _context6.sent;
|
|
3550
3930
|
_xtfCookie = _get(resRegister, 'headers.x-tf-ecommerce');
|
|
3551
|
-
accessToken = _get(resRegister, 'data.
|
|
3552
|
-
refreshToken = _get(resRegister, 'data.
|
|
3553
|
-
userProfile = _get(resRegister, 'data.
|
|
3931
|
+
accessToken = _get(resRegister, 'data.attributes.access_token');
|
|
3932
|
+
refreshToken = _get(resRegister, 'data.attributes.refresh_token');
|
|
3933
|
+
userProfile = _get(resRegister, 'data.attributes.user_profile');
|
|
3554
3934
|
setIsNewUser(true);
|
|
3555
3935
|
onRegisterSuccess({
|
|
3556
3936
|
xtfCookie: _xtfCookie,
|
|
@@ -3591,21 +3971,21 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3591
3971
|
return getProfileData();
|
|
3592
3972
|
case 40:
|
|
3593
3973
|
profileData = _context6.sent;
|
|
3594
|
-
profileSpecifiedData = _get(profileData, 'data
|
|
3595
|
-
profileDataObj = setLoggedUserData
|
|
3596
|
-
if (
|
|
3974
|
+
profileSpecifiedData = _get(profileData, 'data');
|
|
3975
|
+
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
3976
|
+
if (isBrowser) {
|
|
3597
3977
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
3598
3978
|
}
|
|
3599
3979
|
checkoutBody = collectCheckoutBody(values, profileDataObj);
|
|
3600
|
-
if (
|
|
3980
|
+
if (isBrowser) {
|
|
3601
3981
|
addAddOnsInAttributes(checkoutBody);
|
|
3602
3982
|
}
|
|
3603
3983
|
_context6.next = 48;
|
|
3604
3984
|
return postOnCheckout(checkoutBody, undefined, flagFreeTicket);
|
|
3605
3985
|
case 48:
|
|
3606
|
-
|
|
3986
|
+
checkoutResponse = _context6.sent;
|
|
3607
3987
|
removeReferralKey();
|
|
3608
|
-
handleSubmit(values, formikHelpers, eventId,
|
|
3988
|
+
handleSubmit(values, formikHelpers, eventId, checkoutResponse);
|
|
3609
3989
|
_context6.next = 57;
|
|
3610
3990
|
break;
|
|
3611
3991
|
case 53:
|
|
@@ -3616,7 +3996,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
3616
3996
|
setPendingVerificationMessage((_e$response7 = _context6.t1.response) == null ? void 0 : (_e$response7$data = _e$response7.data) == null ? void 0 : _e$response7$data.message);
|
|
3617
3997
|
} else if (axios.isAxiosError(_context6.t1)) {
|
|
3618
3998
|
if (((_e$response8 = _context6.t1.response) == null ? void 0 : _e$response8.status) === 401 || ((_e$response9 = _context6.t1.response) == null ? void 0 : (_e$response9$data = _e$response9.data) == null ? void 0 : _e$response9$data.error) === 'invalid_token') {
|
|
3619
|
-
if (
|
|
3999
|
+
if (isBrowser) {
|
|
3620
4000
|
window.localStorage.removeItem('user_data');
|
|
3621
4001
|
window.localStorage.removeItem('access_token');
|
|
3622
4002
|
setUserExpired(true);
|
|
@@ -4321,7 +4701,7 @@ var initialReviewValues = {
|
|
|
4321
4701
|
payment_method: {
|
|
4322
4702
|
stripe_client_secret: '',
|
|
4323
4703
|
stripe_payment_plan_enabled: false,
|
|
4324
|
-
stripe_payment_plan_configuration:
|
|
4704
|
+
stripe_payment_plan_configuration: {}
|
|
4325
4705
|
},
|
|
4326
4706
|
billing_info: {}
|
|
4327
4707
|
};
|
|
@@ -4411,7 +4791,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4411
4791
|
var _paymentPlanConfig = paymentMethod.stripe_payment_plan_configuration || initialPaymentPlanConfiguration;
|
|
4412
4792
|
setPaymentPlanConfig(_paymentPlanConfig);
|
|
4413
4793
|
setPaymentPlanUseSavedCard(!!((_paymentPlanConfig$sa = _paymentPlanConfig.saved_card) != null && _paymentPlanConfig$sa.stripe_payment_method_id));
|
|
4414
|
-
if (
|
|
4794
|
+
if (isBrowser) {
|
|
4415
4795
|
var _reviewData$order_det;
|
|
4416
4796
|
var sessionData = window.localStorage.getItem('paymentConfiguration');
|
|
4417
4797
|
var session = sessionData ? JSON.parse(sessionData) : {};
|
|
@@ -4428,7 +4808,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4428
4808
|
}, [showPaymentPlanSection, paymentPlanUseSavedCard]);
|
|
4429
4809
|
React.useEffect(function () {
|
|
4430
4810
|
_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4431
|
-
var
|
|
4811
|
+
var paymentDataResponse, _paymentDataResponse$, _cart$2, attributes, cart, order_details, _order_details$ticket, ticket, orderDataArray, _orderData;
|
|
4432
4812
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4433
4813
|
while (1) switch (_context.prev = _context.next) {
|
|
4434
4814
|
case 0:
|
|
@@ -4436,9 +4816,9 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4436
4816
|
_context.next = 3;
|
|
4437
4817
|
return getPaymentData(hash);
|
|
4438
4818
|
case 3:
|
|
4439
|
-
|
|
4440
|
-
if (
|
|
4441
|
-
attributes =
|
|
4819
|
+
paymentDataResponse = _context.sent;
|
|
4820
|
+
if (paymentDataResponse.success) {
|
|
4821
|
+
attributes = paymentDataResponse == null ? void 0 : (_paymentDataResponse$ = paymentDataResponse.data) == null ? void 0 : _paymentDataResponse$.attributes;
|
|
4442
4822
|
setReviewData(attributes);
|
|
4443
4823
|
cart = attributes.cart, order_details = attributes.order_details;
|
|
4444
4824
|
_order_details$ticket = order_details.tickets, ticket = _order_details$ticket[0];
|
|
@@ -4463,13 +4843,13 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4463
4843
|
currency: order_details == null ? void 0 : order_details.currency,
|
|
4464
4844
|
add_ons: (order_details == null ? void 0 : order_details.add_ons) || [],
|
|
4465
4845
|
pay_now: (order_details == null ? void 0 : order_details.pay_now) || '',
|
|
4466
|
-
guest_count: (order_details == null ? void 0 : order_details.guest_count) ||
|
|
4846
|
+
guest_count: (order_details == null ? void 0 : order_details.guest_count) || '',
|
|
4467
4847
|
debt: (order_details == null ? void 0 : order_details.debt) || null,
|
|
4468
4848
|
tableTypes: orderDataArray
|
|
4469
4849
|
};
|
|
4470
4850
|
setOrderData(_orderData);
|
|
4471
4851
|
setCurrency(order_details == null ? void 0 : order_details.currency);
|
|
4472
|
-
onGetPaymentDataSuccess(
|
|
4852
|
+
onGetPaymentDataSuccess(paymentDataResponse.data);
|
|
4473
4853
|
}
|
|
4474
4854
|
_context.next = 11;
|
|
4475
4855
|
break;
|
|
@@ -4494,27 +4874,28 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4494
4874
|
// fetch conditions data
|
|
4495
4875
|
var fetchConditions = /*#__PURE__*/function () {
|
|
4496
4876
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
4497
|
-
var
|
|
4877
|
+
var conditionsResponse, conditionsInfo;
|
|
4498
4878
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
4499
4879
|
while (1) switch (_context2.prev = _context2.next) {
|
|
4500
4880
|
case 0:
|
|
4501
4881
|
if (!eventId) {
|
|
4502
|
-
_context2.next =
|
|
4882
|
+
_context2.next = 7;
|
|
4503
4883
|
break;
|
|
4504
4884
|
}
|
|
4505
4885
|
_context2.next = 3;
|
|
4506
4886
|
return getConditions(eventId);
|
|
4507
4887
|
case 3:
|
|
4508
|
-
|
|
4509
|
-
conditionsInfo =
|
|
4888
|
+
conditionsResponse = _context2.sent;
|
|
4889
|
+
conditionsInfo = conditionsResponse.data.attributes;
|
|
4890
|
+
console.log('🚀 ~ file: index.tsx:258 ~ fetchConditions ~ conditionsInfo:', conditionsResponse);
|
|
4510
4891
|
setConditions(conditionsInfo ? conditionsInfo.map(function (item) {
|
|
4511
4892
|
return {
|
|
4512
4893
|
id: nanoid.nanoid(),
|
|
4513
|
-
text: item,
|
|
4894
|
+
text: item.text,
|
|
4514
4895
|
checked: false
|
|
4515
4896
|
};
|
|
4516
4897
|
}) : []);
|
|
4517
|
-
case
|
|
4898
|
+
case 7:
|
|
4518
4899
|
case "end":
|
|
4519
4900
|
return _context2.stop();
|
|
4520
4901
|
}
|
|
@@ -4531,7 +4912,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4531
4912
|
// 3. redirect to confirmation page
|
|
4532
4913
|
var handlePaymentMiddleWare = /*#__PURE__*/function () {
|
|
4533
4914
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(error, data) {
|
|
4534
|
-
var order_hash, paymentSuccessResponse,
|
|
4915
|
+
var order_hash, paymentSuccessResponse, _window;
|
|
4535
4916
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
4536
4917
|
while (1) switch (_context3.prev = _context3.next) {
|
|
4537
4918
|
case 0:
|
|
@@ -4578,8 +4959,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4578
4959
|
localStorage.removeItem("reservationStart-" + eventId);
|
|
4579
4960
|
localStorage.removeItem('ownReservations');
|
|
4580
4961
|
localStorage.removeItem('tierId');
|
|
4581
|
-
|
|
4582
|
-
if (isWindowDefined) {
|
|
4962
|
+
if (isBrowser) {
|
|
4583
4963
|
(_window = window) == null ? void 0 : _window.dataLayer.push({
|
|
4584
4964
|
event: 'Purchase',
|
|
4585
4965
|
orderValue: orderData.total,
|
|
@@ -4615,7 +4995,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4615
4995
|
return showPaymentForm;
|
|
4616
4996
|
};
|
|
4617
4997
|
var updateSessionInformation = function updateSessionInformation() {
|
|
4618
|
-
if (
|
|
4998
|
+
if (isBrowser && !!(orderData != null && orderData.id)) {
|
|
4619
4999
|
window.localStorage.setItem('paymentConfiguration', JSON.stringify({
|
|
4620
5000
|
paymentPlanUseSavedCard: paymentPlanUseSavedCard,
|
|
4621
5001
|
showPaymentPlanSection: showPaymentPlanSection,
|
|
@@ -4732,7 +5112,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4732
5112
|
className: "order_info_title"
|
|
4733
5113
|
}, label), React__default.createElement("div", {
|
|
4734
5114
|
className: className + " order_info_text"
|
|
4735
|
-
}, typeof value === 'string' ? normalizer(value, currency) : _map(value, function (item) {
|
|
5115
|
+
}, typeof value === 'string' || typeof value === 'number' ? normalizer(value, currency) : _map(value, function (item) {
|
|
4736
5116
|
return React__default.createElement("div", {
|
|
4737
5117
|
key: item.id,
|
|
4738
5118
|
className: "add-on-container"
|
|
@@ -4746,7 +5126,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4746
5126
|
className: "payment_toggle"
|
|
4747
5127
|
}, React__default.createElement(CheckboxField, {
|
|
4748
5128
|
label: React__default.createElement("span", {
|
|
4749
|
-
className:
|
|
5129
|
+
className: "payment_plan_toggle_label"
|
|
4750
5130
|
}, "Click to checkout using Payment Plan"),
|
|
4751
5131
|
required: true,
|
|
4752
5132
|
onChange: function onChange(_) {
|
|
@@ -5002,7 +5382,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
5002
5382
|
var eventId = (data == null ? void 0 : data.product_id) || '';
|
|
5003
5383
|
React.useEffect(function () {
|
|
5004
5384
|
_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
5005
|
-
var _data$product_price,
|
|
5385
|
+
var _data$product_price, confirmationDataResponse, _data;
|
|
5006
5386
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5007
5387
|
while (1) switch (_context.prev = _context.next) {
|
|
5008
5388
|
case 0:
|
|
@@ -5014,20 +5394,19 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
5014
5394
|
_context.next = 4;
|
|
5015
5395
|
return getConfirmationData(hash);
|
|
5016
5396
|
case 4:
|
|
5017
|
-
|
|
5018
|
-
_data =
|
|
5019
|
-
_data.personal_share_sales = _data.personal_share_sales.map(function (
|
|
5397
|
+
confirmationDataResponse = _context.sent;
|
|
5398
|
+
_data = confirmationDataResponse.data.attributes;
|
|
5399
|
+
_data.personal_share_sales = _data.personal_share_sales.map(function (salesItem) {
|
|
5020
5400
|
var salesData = {
|
|
5021
|
-
label: "If your friends buy " +
|
|
5401
|
+
label: "If your friends buy " + salesItem.sales + " tickets",
|
|
5022
5402
|
price: ''
|
|
5023
5403
|
};
|
|
5024
|
-
if (
|
|
5404
|
+
if (salesItem.price === 0) {
|
|
5025
5405
|
salesData.subLabel = 'Your ticket becomes';
|
|
5026
5406
|
salesData.price = 'FREE!';
|
|
5027
5407
|
} else {
|
|
5028
|
-
var _d$price;
|
|
5029
5408
|
salesData.subLabel = 'Your ticket goes down to';
|
|
5030
|
-
salesData.price = _data.currency.symbol + (
|
|
5409
|
+
salesData.price = _data.currency.symbol + Number(salesItem.price).toFixed(2);
|
|
5031
5410
|
}
|
|
5032
5411
|
return salesData;
|
|
5033
5412
|
});
|
|
@@ -5036,7 +5415,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
5036
5415
|
price: _data.currency.symbol + ((_data$product_price = _data.product_price) == null ? void 0 : _data$product_price.toFixed(2))
|
|
5037
5416
|
});
|
|
5038
5417
|
setData(_data);
|
|
5039
|
-
onGetConfirmationDataSuccess(
|
|
5418
|
+
onGetConfirmationDataSuccess(confirmationDataResponse.data.attributes);
|
|
5040
5419
|
_context.next = 15;
|
|
5041
5420
|
break;
|
|
5042
5421
|
case 12:
|
|
@@ -5049,7 +5428,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
5049
5428
|
}
|
|
5050
5429
|
}, _callee, null, [[1, 12]]);
|
|
5051
5430
|
}))();
|
|
5052
|
-
}, []);
|
|
5431
|
+
}, [hash]);
|
|
5053
5432
|
var _useState2 = React.useState(false),
|
|
5054
5433
|
showCopyModal = _useState2[0],
|
|
5055
5434
|
setShowCopyModal = _useState2[1];
|
|
@@ -5373,8 +5752,7 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
5373
5752
|
eventId = _ref.eventId,
|
|
5374
5753
|
_ref$defaultMaxQuanti = _ref.defaultMaxQuantity,
|
|
5375
5754
|
defaultMaxQuantity = _ref$defaultMaxQuanti === void 0 ? 10 : _ref$defaultMaxQuanti;
|
|
5376
|
-
var
|
|
5377
|
-
var userData = isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
5755
|
+
var userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
5378
5756
|
var _useState = React.useState(false),
|
|
5379
5757
|
showSuccessMessage = _useState[0],
|
|
5380
5758
|
setShowSuccessMessage = _useState[1];
|
|
@@ -5390,39 +5768,33 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
5390
5768
|
var showTicketsField = Boolean(ticketTypesList.length);
|
|
5391
5769
|
var handleSubmit = /*#__PURE__*/function () {
|
|
5392
5770
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
|
|
5393
|
-
var
|
|
5771
|
+
var response;
|
|
5394
5772
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5395
5773
|
while (1) switch (_context.prev = _context.next) {
|
|
5396
5774
|
case 0:
|
|
5397
5775
|
_context.prev = 0;
|
|
5398
5776
|
setLoading(true);
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
_context.next = 5;
|
|
5405
|
-
return addToWaitingList(eventId, requestData);
|
|
5406
|
-
case 5:
|
|
5407
|
-
_yield$addToWaitingLi = _context.sent;
|
|
5408
|
-
data = _yield$addToWaitingLi.data;
|
|
5409
|
-
if (data.success) {
|
|
5777
|
+
_context.next = 4;
|
|
5778
|
+
return addToWaitingList(eventId, values);
|
|
5779
|
+
case 4:
|
|
5780
|
+
response = _context.sent;
|
|
5781
|
+
if (response.success) {
|
|
5410
5782
|
setShowSuccessMessage(true);
|
|
5411
5783
|
}
|
|
5412
|
-
_context.next =
|
|
5784
|
+
_context.next = 10;
|
|
5413
5785
|
break;
|
|
5786
|
+
case 8:
|
|
5787
|
+
_context.prev = 8;
|
|
5788
|
+
_context.t0 = _context["catch"](0);
|
|
5414
5789
|
case 10:
|
|
5415
5790
|
_context.prev = 10;
|
|
5416
|
-
_context.t0 = _context["catch"](0);
|
|
5417
|
-
case 12:
|
|
5418
|
-
_context.prev = 12;
|
|
5419
5791
|
setLoading(false);
|
|
5420
|
-
return _context.finish(
|
|
5421
|
-
case
|
|
5792
|
+
return _context.finish(10);
|
|
5793
|
+
case 13:
|
|
5422
5794
|
case "end":
|
|
5423
5795
|
return _context.stop();
|
|
5424
5796
|
}
|
|
5425
|
-
}, _callee, null, [[0,
|
|
5797
|
+
}, _callee, null, [[0, 8, 10, 13]]);
|
|
5426
5798
|
}));
|
|
5427
5799
|
return function handleSubmit(_x) {
|
|
5428
5800
|
return _ref2.apply(this, arguments);
|
|
@@ -5929,7 +6301,6 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5929
6301
|
var _useState = React.useState({}),
|
|
5930
6302
|
selectedTickets = _useState[0],
|
|
5931
6303
|
setSelectedTickets = _useState[1];
|
|
5932
|
-
var isWindowDefined = typeof window !== 'undefined';
|
|
5933
6304
|
var _useState2 = React.useState(Boolean(getCookieByName(X_TF_ECOMMERCE))),
|
|
5934
6305
|
isLogged = _useState2[0],
|
|
5935
6306
|
setIsLogged = _useState2[1];
|
|
@@ -6031,7 +6402,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6031
6402
|
return logout();
|
|
6032
6403
|
case 3:
|
|
6033
6404
|
onLogoutSuccess();
|
|
6034
|
-
if (
|
|
6405
|
+
if (isBrowser) {
|
|
6035
6406
|
window.localStorage.removeItem('access_token');
|
|
6036
6407
|
window.localStorage.removeItem('user_data');
|
|
6037
6408
|
setIsLogged(false);
|
|
@@ -6073,7 +6444,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6073
6444
|
}
|
|
6074
6445
|
function _getTicketsApi() {
|
|
6075
6446
|
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(isUpdateingCode, type) {
|
|
6076
|
-
var previewKey, response, eventResponse, attributes, _event2;
|
|
6447
|
+
var previewKey, response, eventResponse, _response$data, attributes, _event2;
|
|
6077
6448
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
6078
6449
|
while (1) switch (_context4.prev = _context4.next) {
|
|
6079
6450
|
case 0:
|
|
@@ -6088,21 +6459,21 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6088
6459
|
return getEvent(eventId, previewKey);
|
|
6089
6460
|
case 8:
|
|
6090
6461
|
eventResponse = _context4.sent;
|
|
6091
|
-
if (response.
|
|
6092
|
-
attributes =
|
|
6462
|
+
if (response.success) {
|
|
6463
|
+
attributes = response == null ? void 0 : (_response$data = response.data) == null ? void 0 : _response$data.attributes;
|
|
6093
6464
|
type === 'promo' && setCodeIsApplied(attributes.ValidPromoCode);
|
|
6094
6465
|
type === 'promo' && setCodeIsInvalid(!attributes.ValidPromoCode);
|
|
6095
|
-
setTickets(
|
|
6466
|
+
setTickets(attributes.tickets);
|
|
6096
6467
|
setShowWaitingList(attributes.showWaitingList);
|
|
6097
6468
|
onGetTicketsSuccess(response.data);
|
|
6098
6469
|
setCode('');
|
|
6099
6470
|
setShowAccessCodeSection(attributes.is_access_code);
|
|
6100
6471
|
setShowPromoCodeSection(attributes.isPromotionsEnabled);
|
|
6101
6472
|
}
|
|
6102
|
-
if (eventResponse.
|
|
6103
|
-
_event2 =
|
|
6473
|
+
if (eventResponse.success) {
|
|
6474
|
+
_event2 = eventResponse.data.attributes;
|
|
6104
6475
|
setEvent(_event2);
|
|
6105
|
-
if (_event2.country &&
|
|
6476
|
+
if (_event2.country && isBrowser) {
|
|
6106
6477
|
window.localStorage.setItem('eventCountry', _event2.country);
|
|
6107
6478
|
}
|
|
6108
6479
|
}
|
|
@@ -6141,7 +6512,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6141
6512
|
});
|
|
6142
6513
|
};
|
|
6143
6514
|
var handleOrdersClick = function handleOrdersClick() {
|
|
6144
|
-
if (
|
|
6515
|
+
if (isBrowser) {
|
|
6145
6516
|
window.location.href = ordersPath != null ? ordersPath : '/orders';
|
|
6146
6517
|
}
|
|
6147
6518
|
};
|
|
@@ -6151,7 +6522,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6151
6522
|
var handleBook = /*#__PURE__*/function () {
|
|
6152
6523
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
6153
6524
|
var _product_options, _product_options2, _ticket_types;
|
|
6154
|
-
var ticket, optionName, ticketId, isTableType, productCartQuantity, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$name, _pageConfigsData$age_, _pageConfigsData$phon, _pageConfigsData$hide, _pageConfigsData$has_, _pageConfigsData$free, _pageConfigsData$coll, _pageConfigsData$coll2, pageConfigsData, skipBillingPage, nameIsRequired, ageIsRequired, phoneIsRequired, hidePhoneField, hasAddOn, freeTicket, collectOptionalWalletAddress, collectMandatoryWalletAddress, hash, total,
|
|
6525
|
+
var ticket, optionName, ticketId, isTableType, productCartQuantity, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$name, _pageConfigsData$age_, _pageConfigsData$phon, _pageConfigsData$hide, _pageConfigsData$has_, _pageConfigsData$free, _pageConfigsData$coll, _pageConfigsData$coll2, pageConfigsData, skipBillingPage, nameIsRequired, ageIsRequired, phoneIsRequired, hidePhoneField, hasAddOn, freeTicket, collectOptionalWalletAddress, collectMandatoryWalletAddress, hash, total, _checkoutResponse$dat, _checkoutResponse$dat2, _checkoutResponse$dat3, _checkoutResponse$dat4, userData, access_token, checkoutBody, checkoutResponse, _e$response, _e$response$data, _e$response$data$data, _e$response2, _e$response2$data, message, _isInvalidLinkError, _isNotInvitedError;
|
|
6155
6526
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
6156
6527
|
while (1) switch (_context2.prev = _context2.next) {
|
|
6157
6528
|
case 0:
|
|
@@ -6195,13 +6566,13 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6195
6566
|
_context2.t0 = {
|
|
6196
6567
|
status: 200,
|
|
6197
6568
|
data: {
|
|
6198
|
-
attributes: _get(result, 'data.
|
|
6569
|
+
attributes: _get(result, 'data.attributes')
|
|
6199
6570
|
}
|
|
6200
6571
|
};
|
|
6201
6572
|
case 19:
|
|
6202
6573
|
pageConfigsDataResponse = _context2.t0;
|
|
6203
6574
|
if (!(result.status === 200 && pageConfigsDataResponse.status === 200)) {
|
|
6204
|
-
_context2.next =
|
|
6575
|
+
_context2.next = 49;
|
|
6205
6576
|
break;
|
|
6206
6577
|
}
|
|
6207
6578
|
pageConfigsData = _get(pageConfigsDataResponse, 'data.attributes') || {};
|
|
@@ -6216,33 +6587,32 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6216
6587
|
collectMandatoryWalletAddress = (_pageConfigsData$coll2 = pageConfigsData.collect_mandatory_wallet_address) != null ? _pageConfigsData$coll2 : false;
|
|
6217
6588
|
hash = '';
|
|
6218
6589
|
total = '';
|
|
6219
|
-
|
|
6220
|
-
_isWindowDefined && window.localStorage.removeItem('add_ons');
|
|
6590
|
+
isBrowser && window.localStorage.removeItem('add_ons');
|
|
6221
6591
|
if (!(skipBillingPage && !hasAddOn)) {
|
|
6222
|
-
_context2.next =
|
|
6592
|
+
_context2.next = 48;
|
|
6223
6593
|
break;
|
|
6224
6594
|
}
|
|
6225
6595
|
// Get user data for checkout data
|
|
6226
|
-
userData =
|
|
6227
|
-
access_token =
|
|
6596
|
+
userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
6597
|
+
access_token = isBrowser && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
6228
6598
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
6229
6599
|
if (!enableBillingInfoAutoCreate) {
|
|
6230
|
-
_context2.next =
|
|
6600
|
+
_context2.next = 44;
|
|
6231
6601
|
break;
|
|
6232
6602
|
}
|
|
6233
|
-
_context2.next =
|
|
6603
|
+
_context2.next = 41;
|
|
6234
6604
|
return postOnCheckout(checkoutBody, access_token, freeTicket);
|
|
6235
|
-
case
|
|
6605
|
+
case 41:
|
|
6236
6606
|
_context2.t1 = _context2.sent;
|
|
6237
|
-
_context2.next =
|
|
6607
|
+
_context2.next = 45;
|
|
6238
6608
|
break;
|
|
6239
|
-
case
|
|
6609
|
+
case 44:
|
|
6240
6610
|
_context2.t1 = null;
|
|
6241
|
-
case
|
|
6242
|
-
|
|
6243
|
-
hash =
|
|
6244
|
-
total =
|
|
6245
|
-
case
|
|
6611
|
+
case 45:
|
|
6612
|
+
checkoutResponse = _context2.t1;
|
|
6613
|
+
hash = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat2 = _checkoutResponse$dat.attributes) == null ? void 0 : _checkoutResponse$dat2.hash) || '';
|
|
6614
|
+
total = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat3 = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat4 = _checkoutResponse$dat3.attributes) == null ? void 0 : _checkoutResponse$dat4.total) || '';
|
|
6615
|
+
case 48:
|
|
6246
6616
|
onAddToCartSuccess({
|
|
6247
6617
|
skip_billing_page: skipBillingPage,
|
|
6248
6618
|
names_required: nameIsRequired,
|
|
@@ -6257,11 +6627,11 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6257
6627
|
total: total,
|
|
6258
6628
|
hasAddOn: hasAddOn
|
|
6259
6629
|
});
|
|
6260
|
-
case
|
|
6261
|
-
_context2.next =
|
|
6630
|
+
case 49:
|
|
6631
|
+
_context2.next = 54;
|
|
6262
6632
|
break;
|
|
6263
|
-
case
|
|
6264
|
-
_context2.prev =
|
|
6633
|
+
case 51:
|
|
6634
|
+
_context2.prev = 51;
|
|
6265
6635
|
_context2.t2 = _context2["catch"](8);
|
|
6266
6636
|
if ((_e$response = _context2.t2.response) != null && (_e$response$data = _e$response.data) != null && (_e$response$data$data = _e$response$data.data) != null && _e$response$data$data.hasUnverifiedOrder) {
|
|
6267
6637
|
setPendingVerificationMessage((_e$response2 = _context2.t2.response) == null ? void 0 : (_e$response2$data = _e$response2.data) == null ? void 0 : _e$response2$data.message);
|
|
@@ -6278,15 +6648,15 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6278
6648
|
setError(message);
|
|
6279
6649
|
}
|
|
6280
6650
|
}
|
|
6281
|
-
case
|
|
6282
|
-
_context2.prev =
|
|
6651
|
+
case 54:
|
|
6652
|
+
_context2.prev = 54;
|
|
6283
6653
|
setHandleBookIsLoading(false);
|
|
6284
|
-
return _context2.finish(
|
|
6285
|
-
case
|
|
6654
|
+
return _context2.finish(54);
|
|
6655
|
+
case 57:
|
|
6286
6656
|
case "end":
|
|
6287
6657
|
return _context2.stop();
|
|
6288
6658
|
}
|
|
6289
|
-
}, _callee2, null, [[8,
|
|
6659
|
+
}, _callee2, null, [[8, 51, 54, 57]]);
|
|
6290
6660
|
}));
|
|
6291
6661
|
return function handleBook() {
|
|
6292
6662
|
return _ref4.apply(this, arguments);
|
|
@@ -6306,7 +6676,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6306
6676
|
return getProfileData();
|
|
6307
6677
|
case 3:
|
|
6308
6678
|
userDataResponse = _context3.sent;
|
|
6309
|
-
profileData = _get(userDataResponse, 'data
|
|
6679
|
+
profileData = _get(userDataResponse, 'data');
|
|
6310
6680
|
profileDataObj = setLoggedUserData(profileData);
|
|
6311
6681
|
return _context3.abrupt("return", profileDataObj);
|
|
6312
6682
|
case 9:
|
|
@@ -6694,7 +7064,7 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
6694
7064
|
case 4:
|
|
6695
7065
|
response = _context.sent;
|
|
6696
7066
|
onGetOrdersSuccess(response);
|
|
6697
|
-
_data = _get(response, 'data.
|
|
7067
|
+
_data = _get(response, 'data.attributes');
|
|
6698
7068
|
_data.page -= 1;
|
|
6699
7069
|
setData(_data);
|
|
6700
7070
|
_context.next = 15;
|
|
@@ -7228,7 +7598,7 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
7228
7598
|
case 5:
|
|
7229
7599
|
response = _context.sent;
|
|
7230
7600
|
onGetOrdersSuccess(response);
|
|
7231
|
-
_data = _get(response, 'data.
|
|
7601
|
+
_data = _get(response, 'data.attributes');
|
|
7232
7602
|
setData(_data);
|
|
7233
7603
|
_context.next = 14;
|
|
7234
7604
|
break;
|
|
@@ -7287,7 +7657,7 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
7287
7657
|
case 16:
|
|
7288
7658
|
response = _context2.sent;
|
|
7289
7659
|
onGetOrdersSuccess(response);
|
|
7290
|
-
_data2 = _get(response, 'data.
|
|
7660
|
+
_data2 = _get(response, 'data.attributes');
|
|
7291
7661
|
updatedData = _extends({}, _data2);
|
|
7292
7662
|
updatedData == null ? void 0 : (_updatedData$tickets = updatedData.tickets) == null ? void 0 : _updatedData$tickets.forEach(function (ticket) {
|
|
7293
7663
|
if (ticket.hash === activeTicket.hash) {
|
|
@@ -7348,7 +7718,7 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
7348
7718
|
case 8:
|
|
7349
7719
|
response = _context3.sent;
|
|
7350
7720
|
onGetOrdersSuccess(response);
|
|
7351
|
-
_data3 = _get(response, 'data.
|
|
7721
|
+
_data3 = _get(response, 'data.attributes');
|
|
7352
7722
|
updatedData = _extends({}, _data3);
|
|
7353
7723
|
updatedData == null ? void 0 : (_updatedData$tickets2 = updatedData.tickets) == null ? void 0 : _updatedData$tickets2.forEach(function (ticket) {
|
|
7354
7724
|
if (ticket.hash === activeTicket.hash) {
|
|
@@ -7673,7 +8043,7 @@ var TicketResaleContainer = function TicketResaleContainer(_ref) {
|
|
|
7673
8043
|
return processTicket(hash);
|
|
7674
8044
|
case 22:
|
|
7675
8045
|
_response = _context.sent;
|
|
7676
|
-
data = _get(_response, 'data.
|
|
8046
|
+
data = _get(_response, 'data.attributes');
|
|
7677
8047
|
age_required = _get(data, 'age_required', false);
|
|
7678
8048
|
names_required = _get(data, 'names_required', false);
|
|
7679
8049
|
event_id = _get(data, 'event_id');
|
|
@@ -7745,7 +8115,7 @@ var addonsWithGroupsAdapter = function addonsWithGroupsAdapter(data) {
|
|
|
7745
8115
|
return adaptedAddons;
|
|
7746
8116
|
};
|
|
7747
8117
|
var cartAdapter = function cartAdapter(cart) {
|
|
7748
|
-
var cartData = _get(cart, 'data.
|
|
8118
|
+
var cartData = _get(cart, 'data.attributes', []);
|
|
7749
8119
|
var expiresAt = cartData.expiresAt,
|
|
7750
8120
|
carts_arr = cartData.cart;
|
|
7751
8121
|
var _ref = carts_arr[0] || {},
|
|
@@ -8124,7 +8494,7 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
8124
8494
|
};
|
|
8125
8495
|
var handleConfirm = /*#__PURE__*/function () {
|
|
8126
8496
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(values, skipAddonPage) {
|
|
8127
|
-
var _pageConfigsData$skip, _pageConfigsData$name, _pageConfigsData$age_, _pageConfigsData$phon, _pageConfigsData$has_, _pageConfigsData$free, _pageConfigsData$coll, _pageConfigsData$coll2, pageConfigsDataResponse, pageConfigsData,
|
|
8497
|
+
var _pageConfigsData$skip, _pageConfigsData$name, _pageConfigsData$age_, _pageConfigsData$phon, _pageConfigsData$has_, _pageConfigsData$free, _pageConfigsData$coll, _pageConfigsData$coll2, pageConfigsDataResponse, pageConfigsData, skipBillingPage, nameIsRequired, ageIsRequired, phoneIsRequired, hasAddOn, freeTicket, collectOptionalWalletAddress, collectMandatoryWalletAddress, ticketsQuantity, userData, checkoutBody, _checkoutResponse$dat, _checkoutResponse$dat2, _checkoutResponse$dat3, _checkoutResponse$dat4, checkoutResponse, hash, total, _error$response, _error$response$data, _error$response$data$, _error$response2, _error$response2$data;
|
|
8128
8498
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
8129
8499
|
while (1) switch (_context2.prev = _context2.next) {
|
|
8130
8500
|
case 0:
|
|
@@ -8134,7 +8504,6 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
8134
8504
|
case 3:
|
|
8135
8505
|
pageConfigsDataResponse = _context2.sent;
|
|
8136
8506
|
pageConfigsData = _get(pageConfigsDataResponse, 'data.attributes') || {};
|
|
8137
|
-
isWindowDefined = typeof window !== 'undefined';
|
|
8138
8507
|
skipBillingPage = (_pageConfigsData$skip = pageConfigsData.skip_billing_page) != null ? _pageConfigsData$skip : false;
|
|
8139
8508
|
nameIsRequired = (_pageConfigsData$name = pageConfigsData.names_required) != null ? _pageConfigsData$name : false;
|
|
8140
8509
|
ageIsRequired = (_pageConfigsData$age_ = pageConfigsData.age_required) != null ? _pageConfigsData$age_ : false;
|
|
@@ -8144,26 +8513,26 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
8144
8513
|
collectOptionalWalletAddress = (_pageConfigsData$coll = pageConfigsData.collect_optional_wallet_address) != null ? _pageConfigsData$coll : false;
|
|
8145
8514
|
collectMandatoryWalletAddress = (_pageConfigsData$coll2 = pageConfigsData.collect_mandatory_wallet_address) != null ? _pageConfigsData$coll2 : false;
|
|
8146
8515
|
if (!(skipBillingPage && enableBillingInfoAutoCreate)) {
|
|
8147
|
-
_context2.next =
|
|
8516
|
+
_context2.next = 34;
|
|
8148
8517
|
break;
|
|
8149
8518
|
}
|
|
8150
8519
|
ticketsQuantity = window.localStorage.getItem('quantity');
|
|
8151
8520
|
userData = JSON.parse(window.localStorage.getItem('user_data') || '{}');
|
|
8152
8521
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(Number(ticketsQuantity) || 0, userData);
|
|
8153
|
-
_context2.prev =
|
|
8154
|
-
_context2.next =
|
|
8522
|
+
_context2.prev = 17;
|
|
8523
|
+
_context2.next = 20;
|
|
8155
8524
|
return postOnCheckout(_extends({}, checkoutBody, {
|
|
8156
8525
|
attributes: _extends({}, checkoutBody.attributes, !skipAddonPage && {
|
|
8157
8526
|
add_ons: values
|
|
8158
8527
|
})
|
|
8159
8528
|
}));
|
|
8160
|
-
case
|
|
8529
|
+
case 20:
|
|
8161
8530
|
checkoutResponse = _context2.sent;
|
|
8162
|
-
hash =
|
|
8163
|
-
total =
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
onPostCheckoutSuccess(checkoutResponse == null ? void 0 : checkoutResponse.data);
|
|
8531
|
+
hash = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat2 = _checkoutResponse$dat.attributes) == null ? void 0 : _checkoutResponse$dat2.hash) || '';
|
|
8532
|
+
total = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat3 = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat4 = _checkoutResponse$dat3.attributes) == null ? void 0 : _checkoutResponse$dat4.total) || '';
|
|
8533
|
+
isBrowser && window.localStorage.removeItem('quantity');
|
|
8534
|
+
isBrowser && window.localStorage.removeItem('add_ons');
|
|
8535
|
+
onPostCheckoutSuccess(checkoutResponse == null ? void 0 : checkoutResponse.data.attributes);
|
|
8167
8536
|
onConfirmSelectionSuccess({
|
|
8168
8537
|
skip_billing_page: skipBillingPage,
|
|
8169
8538
|
names_required: nameIsRequired,
|
|
@@ -8177,22 +8546,22 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
8177
8546
|
collect_optional_wallet_address: collectOptionalWalletAddress,
|
|
8178
8547
|
collect_mandatory_wallet_address: collectMandatoryWalletAddress
|
|
8179
8548
|
});
|
|
8180
|
-
_context2.next =
|
|
8549
|
+
_context2.next = 32;
|
|
8181
8550
|
break;
|
|
8182
|
-
case
|
|
8183
|
-
_context2.prev =
|
|
8184
|
-
_context2.t0 = _context2["catch"](
|
|
8551
|
+
case 29:
|
|
8552
|
+
_context2.prev = 29;
|
|
8553
|
+
_context2.t0 = _context2["catch"](17);
|
|
8185
8554
|
if ((_error$response = _context2.t0.response) != null && (_error$response$data = _error$response.data) != null && (_error$response$data$ = _error$response$data.data) != null && _error$response$data$.hasUnverifiedOrder) {
|
|
8186
8555
|
setPendingVerificationMessage((_error$response2 = _context2.t0.response) == null ? void 0 : (_error$response2$data = _error$response2.data) == null ? void 0 : _error$response2$data.message);
|
|
8187
8556
|
} else {
|
|
8188
8557
|
onPostCheckoutError(_context2.t0);
|
|
8189
8558
|
onConfirmSelectionError(_context2.t0);
|
|
8190
8559
|
}
|
|
8191
|
-
case
|
|
8192
|
-
_context2.next =
|
|
8560
|
+
case 32:
|
|
8561
|
+
_context2.next = 35;
|
|
8193
8562
|
break;
|
|
8194
|
-
case
|
|
8195
|
-
if (
|
|
8563
|
+
case 34:
|
|
8564
|
+
if (isBrowser) {
|
|
8196
8565
|
if (!skipAddonPage) {
|
|
8197
8566
|
window.localStorage.setItem('add_ons', JSON.stringify(values));
|
|
8198
8567
|
}
|
|
@@ -8210,18 +8579,18 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
8210
8579
|
message: 'Window is not defined'
|
|
8211
8580
|
});
|
|
8212
8581
|
}
|
|
8213
|
-
case
|
|
8214
|
-
_context2.next =
|
|
8582
|
+
case 35:
|
|
8583
|
+
_context2.next = 40;
|
|
8215
8584
|
break;
|
|
8216
|
-
case
|
|
8217
|
-
_context2.prev =
|
|
8585
|
+
case 37:
|
|
8586
|
+
_context2.prev = 37;
|
|
8218
8587
|
_context2.t1 = _context2["catch"](0);
|
|
8219
8588
|
onConfirmSelectionError(_context2.t1);
|
|
8220
|
-
case
|
|
8589
|
+
case 40:
|
|
8221
8590
|
case "end":
|
|
8222
8591
|
return _context2.stop();
|
|
8223
8592
|
}
|
|
8224
|
-
}, _callee2, null, [[0,
|
|
8593
|
+
}, _callee2, null, [[0, 37], [17, 29]]);
|
|
8225
8594
|
}));
|
|
8226
8595
|
return function handleConfirm(_x, _x2) {
|
|
8227
8596
|
return _ref3.apply(this, arguments);
|
|
@@ -8337,7 +8706,22 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
8337
8706
|
}));
|
|
8338
8707
|
};
|
|
8339
8708
|
|
|
8340
|
-
|
|
8709
|
+
// interface IUserData {
|
|
8710
|
+
// id: string;
|
|
8711
|
+
// firstName: string;
|
|
8712
|
+
// lastName: string;
|
|
8713
|
+
// email: string;
|
|
8714
|
+
// city?: string;
|
|
8715
|
+
// country?: string;
|
|
8716
|
+
// countryId?: string;
|
|
8717
|
+
// phone?: string;
|
|
8718
|
+
// streetAddress?: string;
|
|
8719
|
+
// state?: string;
|
|
8720
|
+
// zip?: string;
|
|
8721
|
+
// zipCode?: string;
|
|
8722
|
+
// stateId?: string;
|
|
8723
|
+
// }
|
|
8724
|
+
var setLoggedUserData$1 = function setLoggedUserData(data) {
|
|
8341
8725
|
return {
|
|
8342
8726
|
id: data.id,
|
|
8343
8727
|
first_name: data.firstName,
|
|
@@ -8345,11 +8729,11 @@ var setLoggedUserData$3 = function setLoggedUserData(data) {
|
|
|
8345
8729
|
email: data.email,
|
|
8346
8730
|
confirmEmail: data.email,
|
|
8347
8731
|
city: (data == null ? void 0 : data.city) || '',
|
|
8348
|
-
country: (data == null ? void 0 : data.countryId) ||
|
|
8732
|
+
country: (data == null ? void 0 : data.countryId) || '',
|
|
8349
8733
|
phone: (data == null ? void 0 : data.phone) || '',
|
|
8350
8734
|
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
8351
8735
|
state: (data == null ? void 0 : data.stateId) || '',
|
|
8352
|
-
zip: (data == null ? void 0 : data.
|
|
8736
|
+
zip: (data == null ? void 0 : data.zipCode) || ''
|
|
8353
8737
|
};
|
|
8354
8738
|
};
|
|
8355
8739
|
var LoginForm = function LoginForm(_ref) {
|
|
@@ -8378,7 +8762,7 @@ var LoginForm = function LoginForm(_ref) {
|
|
|
8378
8762
|
error = _useState[0],
|
|
8379
8763
|
setError = _useState[1];
|
|
8380
8764
|
return React__default.createElement("div", {
|
|
8381
|
-
className:
|
|
8765
|
+
className: "login-modal"
|
|
8382
8766
|
}, React__default.createElement(formik.Formik, {
|
|
8383
8767
|
initialValues: {
|
|
8384
8768
|
email: '',
|
|
@@ -8406,7 +8790,7 @@ var LoginForm = function LoginForm(_ref) {
|
|
|
8406
8790
|
return getProfileData();
|
|
8407
8791
|
case 10:
|
|
8408
8792
|
profileResponse = _context.sent;
|
|
8409
|
-
onGetProfileDataSuccess(_get(profileResponse, 'data
|
|
8793
|
+
onGetProfileDataSuccess(_get(profileResponse, 'data'));
|
|
8410
8794
|
_context.next = 18;
|
|
8411
8795
|
break;
|
|
8412
8796
|
case 14:
|
|
@@ -8417,14 +8801,14 @@ var LoginForm = function LoginForm(_ref) {
|
|
|
8417
8801
|
}
|
|
8418
8802
|
return _context.abrupt("return");
|
|
8419
8803
|
case 18:
|
|
8420
|
-
profileSpecifiedData = _get(profileResponse, 'data
|
|
8421
|
-
profileDataObj = setLoggedUserData$
|
|
8804
|
+
profileSpecifiedData = _get(profileResponse, 'data');
|
|
8805
|
+
profileDataObj = setLoggedUserData$1(profileSpecifiedData);
|
|
8422
8806
|
if (typeof window !== 'undefined') {
|
|
8423
8807
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
8424
8808
|
event = new window.CustomEvent('tf-login');
|
|
8425
8809
|
window.document.dispatchEvent(event);
|
|
8426
8810
|
}
|
|
8427
|
-
onLoginSuccess(_get(authRes, 'data
|
|
8811
|
+
onLoginSuccess(_get(authRes, 'data'));
|
|
8428
8812
|
_context.next = 27;
|
|
8429
8813
|
break;
|
|
8430
8814
|
case 24:
|
|
@@ -8779,7 +9163,7 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
8779
9163
|
return getCountries();
|
|
8780
9164
|
case 3:
|
|
8781
9165
|
res = _context.sent;
|
|
8782
|
-
setCountries(_map(
|
|
9166
|
+
setCountries(_map(res.data, function (item) {
|
|
8783
9167
|
return {
|
|
8784
9168
|
label: item.name,
|
|
8785
9169
|
value: item.id
|
|
@@ -8819,7 +9203,7 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
8819
9203
|
return getStates(fetchCountryId);
|
|
8820
9204
|
case 4:
|
|
8821
9205
|
res = _context2.sent;
|
|
8822
|
-
_states = _get(res, 'data
|
|
9206
|
+
_states = _get(res, 'data', []);
|
|
8823
9207
|
mappedStates = collectStates(_states);
|
|
8824
9208
|
setStates(mappedStates);
|
|
8825
9209
|
onGetStatesSuccess(res.data);
|
|
@@ -8871,7 +9255,7 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
8871
9255
|
return getProfileData();
|
|
8872
9256
|
case 20:
|
|
8873
9257
|
profileRes = _context3.sent;
|
|
8874
|
-
window.localStorage.setItem('user_data', JSON.stringify(_get(profileRes, 'data
|
|
9258
|
+
window.localStorage.setItem('user_data', JSON.stringify(_get(profileRes, 'data')));
|
|
8875
9259
|
onRegisterAccountSuccess(profileRes);
|
|
8876
9260
|
_context3.next = 28;
|
|
8877
9261
|
break;
|
|
@@ -9407,53 +9791,52 @@ var useOnline = function useOnline(handler) {
|
|
|
9407
9791
|
|
|
9408
9792
|
var addToCartFunc = /*#__PURE__*/function () {
|
|
9409
9793
|
var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
9410
|
-
var eventId, data, ticketQuantity, _ref$enableBillingInf, enableBillingInfoAutoCreate,
|
|
9794
|
+
var eventId, data, ticketQuantity, _ref$enableBillingInf, enableBillingInfoAutoCreate, result, pageConfigsDataResponse, pageConfigsData, _pageConfigsData$skip, skipBillingPage, _pageConfigsData$name, nameIsRequired, _pageConfigsData$age_, ageIsRequired, _pageConfigsData$phon, phoneIsRequired, _pageConfigsData$hide, hidePhoneField, _pageConfigsData$has_, hasAddOn, _pageConfigsData$free, freeTicket, _pageConfigsData$coll, collectOptionalWalletAddress, _pageConfigsData$coll2, collectMandatoryWalletAddress, hash, total, _checkoutResponse$dat, _checkoutResponse$dat2, _checkoutResponse$dat3, _checkoutResponse$dat4, userData, checkoutBody, checkoutResponse;
|
|
9411
9795
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9412
9796
|
while (1) switch (_context.prev = _context.next) {
|
|
9413
9797
|
case 0:
|
|
9414
9798
|
eventId = _ref.eventId, data = _ref.data, ticketQuantity = _ref.ticketQuantity, _ref$enableBillingInf = _ref.enableBillingInfoAutoCreate, enableBillingInfoAutoCreate = _ref$enableBillingInf === void 0 ? true : _ref$enableBillingInf;
|
|
9415
|
-
|
|
9416
|
-
_context.next = 4;
|
|
9799
|
+
_context.next = 3;
|
|
9417
9800
|
return addToCart(eventId, data);
|
|
9418
|
-
case
|
|
9801
|
+
case 3:
|
|
9419
9802
|
result = _context.sent;
|
|
9420
|
-
_context.next =
|
|
9803
|
+
_context.next = 6;
|
|
9421
9804
|
return getCheckoutPageConfigs();
|
|
9422
|
-
case
|
|
9805
|
+
case 6:
|
|
9423
9806
|
pageConfigsDataResponse = _context.sent;
|
|
9424
9807
|
if (!(result.status === 200 && pageConfigsDataResponse.status === 200)) {
|
|
9425
|
-
_context.next =
|
|
9808
|
+
_context.next = 27;
|
|
9426
9809
|
break;
|
|
9427
9810
|
}
|
|
9428
9811
|
pageConfigsData = _get(pageConfigsDataResponse, 'data.attributes') || {};
|
|
9429
9812
|
_pageConfigsData$skip = pageConfigsData.skip_billing_page, skipBillingPage = _pageConfigsData$skip === void 0 ? false : _pageConfigsData$skip, _pageConfigsData$name = pageConfigsData.names_required, nameIsRequired = _pageConfigsData$name === void 0 ? false : _pageConfigsData$name, _pageConfigsData$age_ = pageConfigsData.age_required, ageIsRequired = _pageConfigsData$age_ === void 0 ? false : _pageConfigsData$age_, _pageConfigsData$phon = pageConfigsData.phone_required, phoneIsRequired = _pageConfigsData$phon === void 0 ? false : _pageConfigsData$phon, _pageConfigsData$hide = pageConfigsData.hide_phone_field, hidePhoneField = _pageConfigsData$hide === void 0 ? false : _pageConfigsData$hide, _pageConfigsData$has_ = pageConfigsData.has_add_on, hasAddOn = _pageConfigsData$has_ === void 0 ? false : _pageConfigsData$has_, _pageConfigsData$free = pageConfigsData.free_ticket, freeTicket = _pageConfigsData$free === void 0 ? false : _pageConfigsData$free, _pageConfigsData$coll = pageConfigsData.collect_optional_wallet_address, collectOptionalWalletAddress = _pageConfigsData$coll === void 0 ? false : _pageConfigsData$coll, _pageConfigsData$coll2 = pageConfigsData.collect_mandatory_wallet_address, collectMandatoryWalletAddress = _pageConfigsData$coll2 === void 0 ? false : _pageConfigsData$coll2;
|
|
9430
9813
|
hash = '';
|
|
9431
9814
|
total = '';
|
|
9432
|
-
|
|
9815
|
+
isBrowser && window.localStorage.removeItem('add_ons');
|
|
9433
9816
|
if (!(skipBillingPage && !hasAddOn)) {
|
|
9434
|
-
_context.next =
|
|
9817
|
+
_context.next = 26;
|
|
9435
9818
|
break;
|
|
9436
9819
|
}
|
|
9437
9820
|
// Get user data for checkout data
|
|
9438
|
-
userData =
|
|
9821
|
+
userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
9439
9822
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
9440
9823
|
if (!enableBillingInfoAutoCreate) {
|
|
9441
|
-
_context.next =
|
|
9824
|
+
_context.next = 22;
|
|
9442
9825
|
break;
|
|
9443
9826
|
}
|
|
9444
|
-
_context.next =
|
|
9827
|
+
_context.next = 19;
|
|
9445
9828
|
return postOnCheckout(checkoutBody, undefined, freeTicket);
|
|
9446
|
-
case
|
|
9829
|
+
case 19:
|
|
9447
9830
|
_context.t0 = _context.sent;
|
|
9448
|
-
_context.next =
|
|
9831
|
+
_context.next = 23;
|
|
9449
9832
|
break;
|
|
9450
|
-
case
|
|
9833
|
+
case 22:
|
|
9451
9834
|
_context.t0 = null;
|
|
9452
|
-
case
|
|
9453
|
-
|
|
9454
|
-
hash =
|
|
9455
|
-
total =
|
|
9456
|
-
case
|
|
9835
|
+
case 23:
|
|
9836
|
+
checkoutResponse = _context.t0;
|
|
9837
|
+
hash = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat2 = _checkoutResponse$dat.attributes) == null ? void 0 : _checkoutResponse$dat2.hash) || '';
|
|
9838
|
+
total = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat3 = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat4 = _checkoutResponse$dat3.attributes) == null ? void 0 : _checkoutResponse$dat4.total) || '';
|
|
9839
|
+
case 26:
|
|
9457
9840
|
return _context.abrupt("return", {
|
|
9458
9841
|
skip_billing_page: skipBillingPage,
|
|
9459
9842
|
names_required: nameIsRequired,
|
|
@@ -9468,9 +9851,9 @@ var addToCartFunc = /*#__PURE__*/function () {
|
|
|
9468
9851
|
total: total,
|
|
9469
9852
|
hasAddOn: hasAddOn
|
|
9470
9853
|
});
|
|
9471
|
-
case
|
|
9854
|
+
case 27:
|
|
9472
9855
|
return _context.abrupt("return", null);
|
|
9473
|
-
case
|
|
9856
|
+
case 28:
|
|
9474
9857
|
case "end":
|
|
9475
9858
|
return _context.stop();
|
|
9476
9859
|
}
|
|
@@ -10583,9 +10966,8 @@ var IDVerification = function IDVerification(props) {
|
|
|
10583
10966
|
};
|
|
10584
10967
|
};
|
|
10585
10968
|
React.useEffect(function () {
|
|
10586
|
-
var isWindowDefined = typeof window !== 'undefined';
|
|
10587
10969
|
var orderHash = getQueryVariable('order_hash');
|
|
10588
|
-
if (
|
|
10970
|
+
if (isBrowser) {
|
|
10589
10971
|
var checkoutData = JSON.parse(window.localStorage.getItem('checkoutData') || '{}');
|
|
10590
10972
|
if (_isEmpty(checkoutData) && orderHash) {
|
|
10591
10973
|
window.localStorage.setItem('checkoutData', JSON.stringify({
|
|
@@ -10681,7 +11063,7 @@ var RsvpContainer = function RsvpContainer(_ref) {
|
|
|
10681
11063
|
var _ref$showSection = _ref.showSection,
|
|
10682
11064
|
showSection = _ref$showSection === void 0 ? false : _ref$showSection,
|
|
10683
11065
|
eventId = _ref.eventId;
|
|
10684
|
-
var userDataEncoded =
|
|
11066
|
+
var userDataEncoded = isBrowser ? window.localStorage.getItem('user_data') : '';
|
|
10685
11067
|
var parsedData = JSON.parse(userDataEncoded || '{}');
|
|
10686
11068
|
var _useState = React.useState(false),
|
|
10687
11069
|
loading = _useState[0],
|
|
@@ -10700,7 +11082,7 @@ var RsvpContainer = function RsvpContainer(_ref) {
|
|
|
10700
11082
|
};
|
|
10701
11083
|
var handleSubmit = /*#__PURE__*/function () {
|
|
10702
11084
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
|
|
10703
|
-
var requestData,
|
|
11085
|
+
var requestData, response, _error$response$data;
|
|
10704
11086
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10705
11087
|
while (1) switch (_context.prev = _context.next) {
|
|
10706
11088
|
case 0:
|
|
@@ -10714,16 +11096,15 @@ var RsvpContainer = function RsvpContainer(_ref) {
|
|
|
10714
11096
|
_context.next = 5;
|
|
10715
11097
|
return sendRSVPInfo(eventId, requestData);
|
|
10716
11098
|
case 5:
|
|
10717
|
-
|
|
10718
|
-
data = _yield$sendRSVPInfo.data;
|
|
11099
|
+
response = _context.sent;
|
|
10719
11100
|
setModal({
|
|
10720
11101
|
isOpen: true,
|
|
10721
|
-
text:
|
|
11102
|
+
text: response.message
|
|
10722
11103
|
});
|
|
10723
|
-
_context.next =
|
|
11104
|
+
_context.next = 12;
|
|
10724
11105
|
break;
|
|
10725
|
-
case
|
|
10726
|
-
_context.prev =
|
|
11106
|
+
case 9:
|
|
11107
|
+
_context.prev = 9;
|
|
10727
11108
|
_context.t0 = _context["catch"](0);
|
|
10728
11109
|
if (_context.t0.response.status === 403) {
|
|
10729
11110
|
setModal({
|
|
@@ -10731,15 +11112,15 @@ var RsvpContainer = function RsvpContainer(_ref) {
|
|
|
10731
11112
|
text: (_error$response$data = _context.t0.response.data) == null ? void 0 : _error$response$data.message
|
|
10732
11113
|
});
|
|
10733
11114
|
}
|
|
10734
|
-
case
|
|
10735
|
-
_context.prev =
|
|
11115
|
+
case 12:
|
|
11116
|
+
_context.prev = 12;
|
|
10736
11117
|
setLoading(false);
|
|
10737
|
-
return _context.finish(
|
|
10738
|
-
case
|
|
11118
|
+
return _context.finish(12);
|
|
11119
|
+
case 15:
|
|
10739
11120
|
case "end":
|
|
10740
11121
|
return _context.stop();
|
|
10741
11122
|
}
|
|
10742
|
-
}, _callee, null, [[0,
|
|
11123
|
+
}, _callee, null, [[0, 9, 12, 15]]);
|
|
10743
11124
|
}));
|
|
10744
11125
|
return function handleSubmit(_x) {
|
|
10745
11126
|
return _ref2.apply(this, arguments);
|
|
@@ -10764,6 +11145,7 @@ var RsvpContainer = function RsvpContainer(_ref) {
|
|
|
10764
11145
|
}, modal.text), React__default.createElement("div", {
|
|
10765
11146
|
className: "rsvp-modal-button"
|
|
10766
11147
|
}, React__default.createElement("button", {
|
|
11148
|
+
type: "button",
|
|
10767
11149
|
onClick: handleModalClose
|
|
10768
11150
|
}, "OK"))))), React__default.createElement("div", {
|
|
10769
11151
|
className: "rsvp-container"
|