tf-checkout-react-native 1.0.39 → 1.0.42

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/lib/index.js CHANGED
@@ -107,14 +107,17 @@ var index_exports = {};
107
107
  __export(index_exports, {
108
108
  BillingCore: () => BillingCore_default,
109
109
  BillingInfo: () => Billing_default,
110
+ CONFIGS: () => CONFIGS,
110
111
  CartTimer: () => CartTimer_default,
111
112
  Checkout: () => Checkout_default,
112
113
  CheckoutCore: () => CheckoutCore_default,
113
114
  CheckoutForm: () => CheckoutForm,
114
115
  CheckoutProvider: () => CheckoutProvider,
115
116
  CheckoutV2: () => CheckoutController,
117
+ DEFAULT_FEES_STYLE: () => DEFAULT_FEES_STYLE,
116
118
  Dropdown: () => Dropdown_default,
117
119
  DropdownMaterial: () => DropdownMaterial_default,
120
+ FEES_STYLES: () => FEES_STYLES,
118
121
  Loading: () => Loading_default,
119
122
  LoggedIn: () => LoggedIn_default,
120
123
  Login: () => Login_default,
@@ -134,13 +137,48 @@ __export(index_exports, {
134
137
  TicketsCore: () => TicketsCore_default,
135
138
  WaitingList: () => WaitingList_default,
136
139
  WaitingListCore: () => WaitingListCore_default,
140
+ X_TF_ECOMMERCE: () => X_TF_ECOMMERCE,
141
+ addToCart: () => addToCart2,
142
+ addToWaitingList: () => addToWaitingList2,
143
+ authorize: () => authorize2,
144
+ checkEmailExists: () => checkEmailExists,
137
145
  default: () => index_default,
138
146
  deleteAllData: () => deleteAllData,
147
+ deleteCookieByName: () => deleteCookieByName,
139
148
  deleteUserData: () => deleteUserData,
140
- formatCurrency: () => formatCurrency,
141
- isValidEmail: () => isValidEmail,
149
+ getCart: () => getCart,
150
+ getConditions: () => getConditions,
151
+ getConfirmationData: () => getConfirmationData,
152
+ getCookieByName: () => getCookieByName,
153
+ getCountries: () => getCountries,
154
+ getDomain: () => getDomain,
155
+ getEvent: () => getEvent,
156
+ getOrderDetails: () => getOrderDetails,
157
+ getOrders: () => getOrders,
158
+ getPaymentData: () => getPaymentData,
159
+ getProfileData: () => getProfileData,
160
+ getQueryVariable: () => getQueryVariable,
161
+ getStates: () => getStates,
162
+ getTickets: () => getTickets,
163
+ getTimeSlotsByDate: () => getTimeSlotsByDate,
164
+ handleFreeSuccess: () => handleFreeSuccess,
165
+ handlePaymentSuccess: () => handlePaymentSuccess,
166
+ isBrowser: () => isBrowser,
167
+ logout: () => logout,
168
+ logoutUser: () => logoutUser,
169
+ postOnCheckout: () => postOnCheckout,
170
+ postReferralVisits: () => postReferralVisits,
171
+ publicRequest: () => publicRequest,
142
172
  refreshAccessToken: () => refreshAccessToken,
173
+ register: () => register,
174
+ sendRSVPInfo: () => sendRSVPInfo,
175
+ setAxiosHeader: () => setAxiosHeader,
176
+ setBaseUrl: () => setBaseUrl,
143
177
  setConfig: () => setConfig,
178
+ setConfigs: () => setConfigs,
179
+ setCustomCookie: () => setCustomCookie,
180
+ setLoggedUserData: () => setLoggedUserData,
181
+ updateCheckout: () => updateCheckout,
144
182
  useAddToCart: () => useAddToCart,
145
183
  useAddons: () => useAddons,
146
184
  useCart: () => useCart,
@@ -155,7 +193,8 @@ __export(index_exports, {
155
193
  useStates: () => useStates,
156
194
  useTickets: () => useTickets,
157
195
  useUpdateCheckout: () => useUpdateCheckout,
158
- useUserProfile: () => useUserProfile
196
+ useUserProfile: () => useUserProfile,
197
+ validatePhoneNumber: () => validatePhoneNumber2
159
198
  });
160
199
  module.exports = __toCommonJS(index_exports);
161
200
 
@@ -3488,7 +3527,7 @@ var fetchTickets = async ({
3488
3527
  };
3489
3528
  }
3490
3529
  const eventId = Config.EVENT_ID.toString();
3491
- const headers = {
3530
+ const headers2 = {
3492
3531
  "Promotion-Event": eventId,
3493
3532
  "Promotion-Code": promoCode,
3494
3533
  "Referrer-Id": referredId
@@ -3496,21 +3535,21 @@ var fetchTickets = async ({
3496
3535
  let responseError;
3497
3536
  let response;
3498
3537
  if (!referredId) {
3499
- delete headers["Referrer-Id"];
3538
+ delete headers2["Referrer-Id"];
3500
3539
  }
3501
3540
  if (!promoCode) {
3502
- delete headers["Promotion-Code"];
3541
+ delete headers2["Promotion-Code"];
3503
3542
  }
3504
3543
  if (!promoCode && !referredId) {
3505
- delete headers["Promotion-Event"];
3544
+ delete headers2["Promotion-Event"];
3506
3545
  }
3507
- if (promoCode && referredId && headers["Referrer-Id"]) {
3508
- delete headers["Referrer-Id"];
3546
+ if (promoCode && referredId && headers2["Referrer-Id"]) {
3547
+ delete headers2["Referrer-Id"];
3509
3548
  }
3510
3549
  try {
3511
3550
  response = await Client.get(`v1/event/${eventId}/tickets/`, {
3512
3551
  //@ts-ignore
3513
- headers
3552
+ headers: headers2
3514
3553
  });
3515
3554
  } catch (error) {
3516
3555
  const axiosError = error;
@@ -6032,8 +6071,8 @@ var WaitingList_default = WaitingList;
6032
6071
  // src/containers/billingInfo/Billing.tsx
6033
6072
  var import_every = __toESM(require("lodash/every"));
6034
6073
  var import_find3 = __toESM(require("lodash/find"));
6035
- var import_forEach3 = __toESM(require("lodash/forEach"));
6036
- var import_map3 = __toESM(require("lodash/map"));
6074
+ var import_forEach4 = __toESM(require("lodash/forEach"));
6075
+ var import_map4 = __toESM(require("lodash/map"));
6037
6076
  var import_react37 = __toESM(require("react"));
6038
6077
  var import_react_native62 = require("react-native");
6039
6078
  var import_react_native_device_country = __toESM(require("react-native-device-country"));
@@ -9423,43 +9462,512 @@ var countryCodes = [
9423
9462
  ];
9424
9463
 
9425
9464
  // ../tf-checkout-shared/dist/index.mjs
9426
- var isValidEmail = (email) => {
9427
- const emailRegex2 = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
9428
- return emailRegex2.test(email);
9465
+ var import_axios2 = __toESM(require("axios"), 1);
9466
+ var import_get2 = __toESM(require("lodash/get"), 1);
9467
+ var import_forEach3 = __toESM(require("lodash/forEach"), 1);
9468
+ var import_map3 = __toESM(require("lodash/map"), 1);
9469
+
9470
+ // ../../node_modules/.pnpm/nanoid@3.3.11/node_modules/nanoid/non-secure/index.js
9471
+ var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
9472
+ var nanoid = (size = 21) => {
9473
+ let id = "";
9474
+ let i = size | 0;
9475
+ while (i--) {
9476
+ id += urlAlphabet[Math.random() * 64 | 0];
9477
+ }
9478
+ return id;
9429
9479
  };
9430
- var formatCurrency = (amount, currency = "USD") => {
9431
- return new Intl.NumberFormat("en-US", {
9432
- style: "currency",
9433
- currency
9434
- }).format(amount);
9480
+
9481
+ // ../tf-checkout-shared/dist/index.mjs
9482
+ function getDomain(url, subdomain, publicSuffix) {
9483
+ let updatedUrl = url.replace(/(https?:\/\/)?(www.)?/i, "");
9484
+ if (!subdomain) {
9485
+ if (publicSuffix) {
9486
+ const updatedPublicSuffix = publicSuffix.startsWith(".") ? publicSuffix : "." + publicSuffix;
9487
+ updatedUrl = url.replace(updatedPublicSuffix, "").split(".");
9488
+ updatedUrl = updatedUrl.length > 0 ? updatedUrl[updatedUrl.length - 1] : "";
9489
+ updatedUrl += updatedPublicSuffix;
9490
+ } else {
9491
+ updatedUrl = updatedUrl.split(".");
9492
+ updatedUrl = updatedUrl.slice(updatedUrl.length - 2).join(".");
9493
+ }
9494
+ }
9495
+ if (updatedUrl.indexOf("/") !== -1) {
9496
+ return updatedUrl.split("/")[0];
9497
+ }
9498
+ return updatedUrl;
9499
+ }
9500
+ var generalDomain;
9501
+ function setCustomCookie(name, value, days = 5) {
9502
+ let expires = "";
9503
+ if (days) {
9504
+ const date2 = /* @__PURE__ */ new Date();
9505
+ date2.setTime(date2.getTime() + days * 24 * 60 * 60 * 1e3);
9506
+ expires = "; expires=" + date2.toUTCString();
9507
+ }
9508
+ if (typeof window === "undefined") {
9509
+ return;
9510
+ }
9511
+ const { hostname } = window.location;
9512
+ if (generalDomain && generalDomain.endsWith(getDomain(hostname))) {
9513
+ document.cookie = name + "=" + (value || "") + expires + `; path=/;domain=${generalDomain}`;
9514
+ return;
9515
+ }
9516
+ let previousDomain = void 0;
9517
+ let domain = void 0;
9518
+ do {
9519
+ previousDomain = domain;
9520
+ domain = getDomain(hostname, void 0, previousDomain);
9521
+ document.cookie = name + "=" + (value || "") + expires + `; path=/;domain=${domain}`;
9522
+ } while (getCookieByName(name) === "" && hostname !== domain);
9523
+ generalDomain = domain;
9524
+ }
9525
+ function getCookieByName(cname) {
9526
+ if (typeof window === "undefined") return "";
9527
+ const name = cname + "=";
9528
+ const ca = document.cookie.split(";");
9529
+ for (let i = 0; i < ca.length; i++) {
9530
+ let c = ca[i];
9531
+ while (c.charAt(0) === " ") {
9532
+ c = c.substring(1);
9533
+ }
9534
+ if (c.indexOf(name) === 0) {
9535
+ return c.substring(name.length, c.length);
9536
+ }
9537
+ }
9538
+ return "";
9539
+ }
9540
+ function deleteCookieByName(name) {
9541
+ if (getCookieByName(name) === "") {
9542
+ return;
9543
+ }
9544
+ if (typeof window === "undefined") {
9545
+ return;
9546
+ }
9547
+ const { hostname } = window.location;
9548
+ if (generalDomain && generalDomain.endsWith(getDomain(hostname))) {
9549
+ document.cookie = name + `=; Path=/;domain=${generalDomain}; Expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
9550
+ return;
9551
+ }
9552
+ let previousDomain = void 0;
9553
+ let domain = void 0;
9554
+ do {
9555
+ previousDomain = domain;
9556
+ domain = getDomain(hostname, void 0, previousDomain);
9557
+ document.cookie = name + `=; Path=/;domain=${domain}; Expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
9558
+ } while (getCookieByName(name) !== "" && hostname !== domain);
9559
+ generalDomain = domain;
9560
+ }
9561
+ var headers = {
9562
+ Accept: "application/vnd.api+json",
9563
+ "Content-Type": "application/vnd.api+json"
9564
+ };
9565
+ var isWindowDefined = typeof window !== "undefined";
9566
+ var authGuestToken = isWindowDefined ? localStorage.getItem("auth_guest_token") : "";
9567
+ if (isWindowDefined && authGuestToken) {
9568
+ headers["Authorization-Guest"] = authGuestToken;
9569
+ }
9570
+ var setAxiosHeader = (key, value) => {
9571
+ headers[key] = `${value}`;
9435
9572
  };
9436
- var priceWithCurrency = (value = "", currency = "US$") => {
9437
- const num = parseFloat(value);
9438
- const safe = Number.isFinite(num) ? num : 0;
9439
- const formatted = safe.toLocaleString("en-US", {
9440
- minimumFractionDigits: 2,
9441
- maximumFractionDigits: 2
9573
+ var publicRequest = import_axios2.default.create({
9574
+ baseURL: "https://www.ticketfairy.com/api",
9575
+ headers,
9576
+ withCredentials: true
9577
+ });
9578
+ publicRequest.interceptors.request.use((config) => {
9579
+ if (getCookieByName("X-TF-ECOMMERCE")) {
9580
+ config.headers["X-TF-ECOMMERCE"] = getCookieByName("X-TF-ECOMMERCE");
9581
+ }
9582
+ return config;
9583
+ });
9584
+ publicRequest.setBaseUrl = (baseUrl) => publicRequest.defaults.baseURL = baseUrl + "/api";
9585
+ publicRequest.setGuestToken = (guestToken) => publicRequest.defaults.headers.common["Authorization-Guest"] = guestToken;
9586
+ var setBaseUrl = (baseUrl) => {
9587
+ publicRequest.setBaseUrl(baseUrl);
9588
+ };
9589
+ var X_TF_ECOMMERCE = "X-TF-ECOMMERCE";
9590
+ var FEES_STYLES = { TRADITIONAL: "TRADITIONAL", DISPLAY_BOTH: "DISPLAY_BOTH" };
9591
+ var DEFAULT_FEES_STYLE = FEES_STYLES.TRADITIONAL;
9592
+ var CONFIGS = { FEES_STYLE: DEFAULT_FEES_STYLE };
9593
+ var setConfigs = (configs) => {
9594
+ Object.keys(configs).forEach((key) => {
9595
+ const value = configs[key];
9596
+ if (value !== void 0) {
9597
+ CONFIGS[key] = value;
9598
+ }
9442
9599
  });
9443
- return `${currency} ${formatted}`;
9600
+ publicRequest.setBaseUrl(CONFIGS.BASE_URL);
9444
9601
  };
9445
- var HTTP_HEADERS = {
9446
- // Content type headers
9447
- ACCEPT: "Accept",
9448
- CONTENT_TYPE: "Content-Type",
9449
- // API-specific headers
9450
- AUTHORIZATION_GUEST: "Authorization-Guest",
9451
- X_TF_ECOMMERCE: "X-TF-ECOMMERCE",
9452
- PROMOTION_EVENT: "Promotion-Event",
9453
- PROMOTION_CODE: "Promotion-Code",
9454
- REFERRER_ID: "Referrer-Id"
9602
+ var authorize2 = async (data) => {
9603
+ const response = await publicRequest.post(
9604
+ `/auth?clientId=${CONFIGS.CLIENT_ID || "e9d8f8922797b4621e562255afe90dbf"}`,
9605
+ data
9606
+ );
9607
+ return response.data;
9608
+ };
9609
+ var register = async (data) => {
9610
+ const response = await publicRequest.post("v1/oauth/register-rn", data);
9611
+ return response.data;
9455
9612
  };
9456
- var CONTENT_TYPES = {
9457
- JSON_API: "application/vnd.api+json",
9458
- JSON: "application/json"
9613
+ var getProfileData = async () => {
9614
+ const response = await publicRequest.get("/customer/profile/");
9615
+ return response.data;
9459
9616
  };
9460
- var DEFAULT_HEADERS = {
9461
- [HTTP_HEADERS.ACCEPT]: CONTENT_TYPES.JSON_API,
9462
- [HTTP_HEADERS.CONTENT_TYPE]: CONTENT_TYPES.JSON_API
9617
+ var logout = async () => {
9618
+ const response = await publicRequest.delete("/auth");
9619
+ return response.data;
9620
+ };
9621
+ var checkEmailExists = async (email) => {
9622
+ var _a;
9623
+ try {
9624
+ const formData = new FormData();
9625
+ formData.append("email", email);
9626
+ formData.append("is_checkout_flow", "true");
9627
+ const baseUrl = ((_a = publicRequest.defaults.baseURL) == null ? void 0 : _a.replace("/api", "")) || "";
9628
+ const url = `${baseUrl}/ajax/contact-email`;
9629
+ const response = await publicRequest.post(
9630
+ url,
9631
+ formData,
9632
+ {
9633
+ headers: {
9634
+ "Content-Type": "multipart/form-data"
9635
+ }
9636
+ }
9637
+ );
9638
+ return {
9639
+ exists: response.data.exists === 1,
9640
+ error: response.data.error === 1 ? response.data.message : void 0
9641
+ };
9642
+ } catch (error) {
9643
+ console.error("Error checking email:", error);
9644
+ return {
9645
+ exists: false,
9646
+ error: "Failed to check email"
9647
+ };
9648
+ }
9649
+ };
9650
+ var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
9651
+ var setLoggedUserData = (data) => ({
9652
+ id: data.id,
9653
+ first_name: data.firstName,
9654
+ last_name: data.lastName,
9655
+ email: data.email,
9656
+ confirmEmail: data.email,
9657
+ city: (data == null ? void 0 : data.city) || "",
9658
+ country: (data == null ? void 0 : data.countryId) || "",
9659
+ phone: (data == null ? void 0 : data.phone) || "",
9660
+ street_address: (data == null ? void 0 : data.streetAddress) || "",
9661
+ state: (data == null ? void 0 : data.stateId) || "",
9662
+ zip: (data == null ? void 0 : data.zipCode) || ""
9663
+ });
9664
+ var logoutUser = async ({
9665
+ onLogoutSuccess,
9666
+ onLogoutError,
9667
+ setIsLogged
9668
+ }) => {
9669
+ try {
9670
+ await logout();
9671
+ onLogoutSuccess && onLogoutSuccess();
9672
+ if (isBrowser) {
9673
+ window.localStorage.removeItem("user_data");
9674
+ setIsLogged && setIsLogged(false);
9675
+ const event = new window.CustomEvent("tf-logout");
9676
+ deleteCookieByName("X-TF-ECOMMERCE");
9677
+ window.document.dispatchEvent(event);
9678
+ }
9679
+ } catch (e) {
9680
+ onLogoutError && onLogoutError(e);
9681
+ }
9682
+ };
9683
+ var getQueryVariable = (variable) => {
9684
+ if (typeof window !== "undefined") {
9685
+ const query = window.location.search.substring(1);
9686
+ const vars = query.split("&");
9687
+ for (let i = 0; i < vars.length; i++) {
9688
+ const pair = vars[i].split("=");
9689
+ if (pair[0] === variable) {
9690
+ return decodeURIComponent(pair[1]);
9691
+ }
9692
+ }
9693
+ }
9694
+ return false;
9695
+ };
9696
+ publicRequest.interceptors.request.use((config) => {
9697
+ var _a;
9698
+ const guestToken = isBrowser ? window.localStorage.getItem("auth_guest_token") : null;
9699
+ if (guestToken) {
9700
+ config.headers["Authorization-Guest"] = guestToken;
9701
+ }
9702
+ const xtfCookie = getCookieByName("X-TF-ECOMMERCE");
9703
+ if (xtfCookie) {
9704
+ config.headers["X-TF-ECOMMERCE"] = xtfCookie;
9705
+ }
9706
+ const additionalCookiesHeaderValue = isBrowser ? (_a = document.cookie) != null ? _a : "" : "";
9707
+ if (additionalCookiesHeaderValue !== "") {
9708
+ config.headers["Additional-Cookies"] = additionalCookiesHeaderValue;
9709
+ }
9710
+ if (CONFIGS.X_SOURCE_ORIGIN) {
9711
+ config.headers["X-Source-Origin"] = CONFIGS.X_SOURCE_ORIGIN;
9712
+ }
9713
+ if (CONFIGS.BASE_URL) {
9714
+ config.baseURL = CONFIGS.BASE_URL + "/api";
9715
+ }
9716
+ return config;
9717
+ });
9718
+ publicRequest.interceptors.response.use(
9719
+ (response) => {
9720
+ const authGuestToken2 = (0, import_get2.default)(
9721
+ response,
9722
+ "headers.authorization-guest",
9723
+ ""
9724
+ );
9725
+ if (isBrowser && authGuestToken2) {
9726
+ window.localStorage.setItem("auth_guest_token", authGuestToken2);
9727
+ publicRequest.setGuestToken(authGuestToken2);
9728
+ }
9729
+ const xtfCookie = (0, import_get2.default)(response, "headers.x-tf-ecommerce");
9730
+ const url = (0, import_get2.default)(response, "config.url");
9731
+ const method = (0, import_get2.default)(response, "config.method");
9732
+ if (xtfCookie && !(url === "/auth" && method === "delete")) {
9733
+ setCustomCookie("X-TF-ECOMMERCE", xtfCookie);
9734
+ }
9735
+ return response;
9736
+ },
9737
+ (error) => {
9738
+ var _a;
9739
+ if (((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.status) === 401) {
9740
+ if (isBrowser) {
9741
+ window.localStorage.removeItem("user_data");
9742
+ const errorType = (0, import_get2.default)(error, "response.data.error");
9743
+ if (errorType === "invalid_token") {
9744
+ window.location.href = "/";
9745
+ }
9746
+ }
9747
+ }
9748
+ const authGuestToken2 = (0, import_get2.default)(error, "response.headers.authorization-guest");
9749
+ if (isBrowser && authGuestToken2) {
9750
+ window.localStorage.setItem("auth_guest_token", authGuestToken2);
9751
+ publicRequest.setGuestToken(authGuestToken2);
9752
+ }
9753
+ return Promise.reject(error);
9754
+ }
9755
+ );
9756
+ var addToCart2 = async (id, data) => {
9757
+ const response = await publicRequest.post(
9758
+ `v1/event/${id}/add-to-cart/`,
9759
+ { data },
9760
+ {
9761
+ headers: {
9762
+ ...publicRequest.defaults.headers.common,
9763
+ "Referer-Url": isBrowser ? document.referrer : ""
9764
+ }
9765
+ }
9766
+ );
9767
+ return response.data;
9768
+ };
9769
+ var getCart = async () => {
9770
+ const response = await publicRequest.get(`v1/cart`);
9771
+ return response.data;
9772
+ };
9773
+ var postOnCheckout = async (data, freeTicket = false) => {
9774
+ if (freeTicket) {
9775
+ delete data.attributes.city;
9776
+ delete data.attributes.country;
9777
+ delete data.attributes.state;
9778
+ delete data.attributes.street_address;
9779
+ }
9780
+ const response = await publicRequest.post(`v1/on-checkout`, { data });
9781
+ return response.data;
9782
+ };
9783
+ var updateCheckout = async (data) => {
9784
+ const response = await publicRequest.post(`v1/checkout`, { data });
9785
+ return response.data;
9786
+ };
9787
+ var getEvent = async (id, pk) => {
9788
+ let referralValue = "";
9789
+ let invitationHash;
9790
+ if (isBrowser) {
9791
+ const params = new URL(`${window.location}`);
9792
+ const referralId = params.searchParams.get("ttf_r") || "";
9793
+ const referral_key = window.localStorage.getItem("referral_key");
9794
+ const [, referralIdlocal] = (referral_key || "").split(".");
9795
+ referralValue = referralId || (referralIdlocal != null ? referralIdlocal : "");
9796
+ invitationHash = params.searchParams.get("invitation-hash") || null;
9797
+ }
9798
+ const response = await publicRequest.get(`v1/event/${id}`, {
9799
+ params: { pk, invitationHash },
9800
+ headers: {
9801
+ ...publicRequest.defaults.headers.common,
9802
+ "Referer-Url": isBrowser ? document.referrer : "",
9803
+ "Referrer-Id": isBrowser ? referralValue : ""
9804
+ }
9805
+ });
9806
+ return response.data;
9807
+ };
9808
+ var getTickets = async (eventId, promoCode, pk) => {
9809
+ const invitationHash = getQueryVariable("invitation-hash");
9810
+ const referralId = getQueryVariable("ttf_r");
9811
+ if (referralId) {
9812
+ window.localStorage.setItem("promoter_id", referralId);
9813
+ }
9814
+ const promoterId = window.localStorage.getItem("promoter_id");
9815
+ const params = { pk };
9816
+ if (invitationHash) {
9817
+ params["invitation-hash"] = invitationHash;
9818
+ }
9819
+ const headers2 = publicRequest.defaults.headers.common;
9820
+ if (promoterId) {
9821
+ headers2["Promotion-Event"] = String(eventId);
9822
+ headers2["Referrer-Id"] = isBrowser ? promoterId : "";
9823
+ }
9824
+ if (promoCode) {
9825
+ headers2["Promotion-Event"] = String(eventId);
9826
+ headers2["Promotion-Code"] = promoCode;
9827
+ window.localStorage.removeItem("promoter_id");
9828
+ }
9829
+ const response = await publicRequest.get(`v1/event/${eventId}/tickets/`, {
9830
+ params,
9831
+ headers: headers2
9832
+ });
9833
+ const { tickets } = response.data.data.attributes;
9834
+ const ticketsArr = [];
9835
+ (0, import_forEach3.default)(tickets, (item) => {
9836
+ ticketsArr.push(item);
9837
+ });
9838
+ const adaptedResponse = {
9839
+ ...response,
9840
+ data: {
9841
+ ...response.data,
9842
+ data: {
9843
+ ...response.data.data,
9844
+ attributes: {
9845
+ ...response.data.data.attributes,
9846
+ tickets: ticketsArr
9847
+ }
9848
+ }
9849
+ }
9850
+ };
9851
+ return adaptedResponse.data;
9852
+ };
9853
+ var getTimeSlotsByDate = async (eventId, date2, promoCode, pk) => {
9854
+ const invitationHash = getQueryVariable("invitation-hash");
9855
+ const referralId = getQueryVariable("ttf_r");
9856
+ if (referralId) {
9857
+ window.localStorage.setItem("promoter_id", referralId);
9858
+ }
9859
+ const promoterId = window.localStorage.getItem("promoter_id");
9860
+ const params = { pk };
9861
+ if (invitationHash) {
9862
+ params["invitation-hash"] = invitationHash;
9863
+ }
9864
+ const headers2 = publicRequest.defaults.headers.common;
9865
+ if (promoterId) {
9866
+ headers2["Promotion-Event"] = String(eventId);
9867
+ headers2["Referrer-Id"] = isBrowser ? promoterId : "";
9868
+ }
9869
+ if (promoCode) {
9870
+ headers2["Promotion-Event"] = String(eventId);
9871
+ headers2["Promotion-Code"] = promoCode;
9872
+ window.localStorage.removeItem("promoter_id");
9873
+ }
9874
+ const response = await publicRequest.get(`v1/event/${eventId}/timeslots`, {
9875
+ params: {
9876
+ date: date2,
9877
+ remove_past_slots: true,
9878
+ ...params
9879
+ },
9880
+ headers: headers2
9881
+ });
9882
+ return response.data;
9883
+ };
9884
+ var getCountries = async () => {
9885
+ const response = await publicRequest.get("/countries/list");
9886
+ return response.data;
9887
+ };
9888
+ var getStates = async (countryId) => {
9889
+ const response = await publicRequest.get(`/countries/${countryId}/states/`);
9890
+ return response.data;
9891
+ };
9892
+ var sendRSVPInfo = async (eventId, data) => {
9893
+ const response = await publicRequest.post(`v1/event/${eventId}/send-rsvp-info`, data);
9894
+ return response.data;
9895
+ };
9896
+ var addToWaitingList2 = async (id, data) => {
9897
+ const response = await publicRequest.post(`v1/event/${id}/add_to_waiting_list`, {
9898
+ data
9899
+ });
9900
+ return response.data;
9901
+ };
9902
+ var postReferralVisits = async (eventId, referralId) => {
9903
+ const response = await publicRequest.post(`v1/event/${eventId}/referrer/`, {
9904
+ referrer: `${referralId}`
9905
+ });
9906
+ return response.data;
9907
+ };
9908
+ var validatePhoneNumber2 = async (phone) => {
9909
+ const response = await publicRequest.get(`/v1/account/validate_phone?phone=${phone}`);
9910
+ return response.data;
9911
+ };
9912
+ var getOrders = async (page, limit, eventSlug) => {
9913
+ const slug = eventSlug || CONFIGS.EVENT_SLUG || "";
9914
+ const response = await publicRequest.get(
9915
+ `v1/account/orders/?page=${page}&limit=${limit}&filter[event]=${slug}&${CONFIGS.BRAND_SLUG ? `filter[brand]=${CONFIGS.BRAND_SLUG}&filter[subbrands]=true` : ""}`
9916
+ );
9917
+ return response.data;
9918
+ };
9919
+ var getOrderDetails = async (orderId) => {
9920
+ const response = await publicRequest.get(`v1/account/order/${orderId}`);
9921
+ return response.data;
9922
+ };
9923
+ var getPaymentData = async (hash) => {
9924
+ const response = await publicRequest.get(`v1/order/${hash}/review`, {
9925
+ headers: { "Referer-Url": isBrowser ? document.referrer : "" }
9926
+ });
9927
+ return response.data;
9928
+ };
9929
+ var handlePaymentSuccess = async (orderHash) => {
9930
+ const response = await publicRequest.post(`v1/order/${orderHash}/success`, void 0, {
9931
+ headers: {
9932
+ ...publicRequest.defaults.headers.common,
9933
+ "Referer-Url": isBrowser ? document.referrer : ""
9934
+ }
9935
+ });
9936
+ return response.data;
9937
+ };
9938
+ var handleFreeSuccess = async (orderHash) => {
9939
+ const response = await publicRequest.post(
9940
+ `v1/order/${orderHash}/complete_free_registration`,
9941
+ void 0,
9942
+ { headers: { "Referer-Url": isBrowser ? document.referrer : "" } }
9943
+ );
9944
+ return response.data;
9945
+ };
9946
+ var getConfirmationData = async (orderHash) => {
9947
+ const response = await publicRequest.get(`v1/order/${orderHash}/payment/complete`);
9948
+ return response.data;
9949
+ };
9950
+ var getConditions = async (eventId) => {
9951
+ const response = await publicRequest.get(`v1/event/${eventId}/conditions`);
9952
+ const adaptedData = (0, import_map3.default)(
9953
+ response.data.data.attributes,
9954
+ (item) => ({
9955
+ id: nanoid(),
9956
+ text: item,
9957
+ checked: false
9958
+ })
9959
+ );
9960
+ const returnData = {
9961
+ ...response,
9962
+ data: {
9963
+ ...response.data,
9964
+ data: {
9965
+ ...response.data.data,
9966
+ attributes: adaptedData
9967
+ }
9968
+ }
9969
+ };
9970
+ return returnData.data;
9463
9971
  };
9464
9972
 
9465
9973
  // src/helpers/StringsHelper.ts
@@ -10109,7 +10617,7 @@ var Billing = (0, import_react37.forwardRef)(
10109
10617
  errorsRef.current.privacy = isSubToTicketFairy ? "" : requiredText;
10110
10618
  if (isNameRequired) {
10111
10619
  const ticketHoldersDataCopy = [...data.ticketHolderData];
10112
- (0, import_map3.default)(data.ticketHolderData, (th, index) => {
10620
+ (0, import_map4.default)(data.ticketHolderData, (th, index) => {
10113
10621
  if (isNameRequired) {
10114
10622
  ticketHoldersDataCopy[index].firstNameError = validateEmpty(th.firstName);
10115
10623
  ticketHoldersDataCopy[index].lastNameError = validateEmpty(th.lastName);
@@ -10175,7 +10683,7 @@ var Billing = (0, import_react37.forwardRef)(
10175
10683
  errorsRef.current.privacy = isSubToTicketFairy ? "" : requiredText;
10176
10684
  if (isNameRequired) {
10177
10685
  const ticketHoldersDataCopy = [...data.ticketHolderData];
10178
- (0, import_map3.default)(data.ticketHolderData, (th, index) => {
10686
+ (0, import_map4.default)(data.ticketHolderData, (th, index) => {
10179
10687
  if (isNameRequired) {
10180
10688
  ticketHoldersDataCopy[index].firstNameError = validateEmpty(th.firstName);
10181
10689
  ticketHoldersDataCopy[index].lastNameError = validateEmpty(th.lastName);
@@ -10234,7 +10742,7 @@ var Billing = (0, import_react37.forwardRef)(
10234
10742
  return "";
10235
10743
  }
10236
10744
  return (0, import_every.default)(
10237
- (0, import_map3.default)(
10745
+ (0, import_map4.default)(
10238
10746
  ticketHoldersData,
10239
10747
  (th) => validateEmpty(th.firstName) || validateEmpty(th.lastName)
10240
10748
  ),
@@ -10269,7 +10777,7 @@ var Billing = (0, import_react37.forwardRef)(
10269
10777
  };
10270
10778
  const getRegisterFormData = (data) => {
10271
10779
  const bodyFormData = new FormData();
10272
- (0, import_forEach3.default)(data.attributes, (item, key) => {
10780
+ (0, import_forEach4.default)(data.attributes, (item, key) => {
10273
10781
  bodyFormData.append(key, item);
10274
10782
  });
10275
10783
  return bodyFormData;
@@ -10524,7 +11032,7 @@ var Billing = (0, import_react37.forwardRef)(
10524
11032
  return showAlert(countriesError.message || "Error fetching countries");
10525
11033
  }
10526
11034
  onFetchCountriesSuccess == null ? void 0 : onFetchCountriesSuccess(countriesData);
10527
- const parsedCountries = (0, import_map3.default)(countriesData, (item) => {
11035
+ const parsedCountries = (0, import_map4.default)(countriesData, (item) => {
10528
11036
  return { label: item.name, value: item.id, code: item.code };
10529
11037
  });
10530
11038
  if (usrTkn) {
@@ -10669,7 +11177,7 @@ var Billing = (0, import_react37.forwardRef)(
10669
11177
  }
10670
11178
  }, [countries, countryId]);
10671
11179
  (0, import_react37.useEffect)(() => {
10672
- const getStates = async () => {
11180
+ const getStates2 = async () => {
10673
11181
  if (!selectedCountry) {
10674
11182
  return;
10675
11183
  }
@@ -10684,14 +11192,14 @@ var Billing = (0, import_react37.forwardRef)(
10684
11192
  onFetchStatesError == null ? void 0 : onFetchStatesError(statesError);
10685
11193
  return showAlert((statesError == null ? void 0 : statesError.message) || "Error fetching states");
10686
11194
  }
10687
- const parsedStates = (0, import_map3.default)(statesData, (item, index) => {
11195
+ const parsedStates = (0, import_map4.default)(statesData, (item, index) => {
10688
11196
  return { label: item, value: index };
10689
11197
  });
10690
11198
  onFetchStatesSuccess == null ? void 0 : onFetchStatesSuccess();
10691
11199
  setStates(parsedStates);
10692
11200
  };
10693
11201
  if (selectedCountry && selectedCountry.value !== "-1") {
10694
- getStates();
11202
+ getStates2();
10695
11203
  }
10696
11204
  }, [selectedCountry]);
10697
11205
  (0, import_react37.useEffect)(() => {
@@ -11100,8 +11608,8 @@ var Billing_default = Billing;
11100
11608
  // src/containers/checkout/Checkout.tsx
11101
11609
  var import_stripe_react_native2 = require("@stripe/stripe-react-native");
11102
11610
  var import_every2 = __toESM(require("lodash/every"));
11103
- var import_forEach4 = __toESM(require("lodash/forEach"));
11104
- var import_map6 = __toESM(require("lodash/map"));
11611
+ var import_forEach5 = __toESM(require("lodash/forEach"));
11612
+ var import_map7 = __toESM(require("lodash/map"));
11105
11613
  var import_mapKeys3 = __toESM(require("lodash/mapKeys"));
11106
11614
  var import_react38 = require("react");
11107
11615
  var import_react_native67 = require("react-native");
@@ -11137,7 +11645,7 @@ var orderReviewItems = [
11137
11645
  ];
11138
11646
 
11139
11647
  // src/containers/checkout/components/Conditions.tsx
11140
- var import_map4 = __toESM(require("lodash/map"));
11648
+ var import_map5 = __toESM(require("lodash/map"));
11141
11649
  var import_react_native64 = require("react-native");
11142
11650
 
11143
11651
  // src/containers/checkout/components/styles.ts
@@ -11180,19 +11688,19 @@ var ConditionItem = ({ id, checkboxProps }) => /* @__PURE__ */ (0, import_jsx_ru
11180
11688
  id
11181
11689
  );
11182
11690
  var Conditions = (props) => {
11183
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react_native64.View, { style: ConditionsStyles.rootContainer, children: (0, import_map4.default)(props, ConditionItem) });
11691
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react_native64.View, { style: ConditionsStyles.rootContainer, children: (0, import_map5.default)(props, ConditionItem) });
11184
11692
  };
11185
11693
  var Conditions_default = Conditions;
11186
11694
 
11187
11695
  // src/containers/checkout/components/OrderReview.tsx
11188
- var import_map5 = __toESM(require("lodash/map"));
11696
+ var import_map6 = __toESM(require("lodash/map"));
11189
11697
  var import_react_native65 = require("react-native");
11190
11698
  var import_jsx_runtime47 = require("react/jsx-runtime");
11191
11699
  var OrderItem = ({ title, value, styles: styles3 }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_react_native65.View, { style: [OrderReviewStyles.orderItemContainer, styles3 == null ? void 0 : styles3.container], children: [
11192
11700
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_native65.Text, { style: [OrderReviewStyles.orderItemTitle, styles3 == null ? void 0 : styles3.title], children: title }),
11193
11701
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_native65.Text, { style: [OrderReviewStyles.orderItemValue, styles3 == null ? void 0 : styles3.value], allowFontScaling: true, children: value })
11194
11702
  ] }, `orderReview.${title}`);
11195
- var OrderReview = ({ orderItems, styles: styles3 }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_native65.View, { style: [OrderReviewStyles.rootContainer, styles3 == null ? void 0 : styles3.rootContainer], children: (0, import_map5.default)(orderItems, (item) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11703
+ var OrderReview = ({ orderItems, styles: styles3 }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_native65.View, { style: [OrderReviewStyles.rootContainer, styles3 == null ? void 0 : styles3.rootContainer], children: (0, import_map6.default)(orderItems, (item) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11196
11704
  OrderItem,
11197
11705
  {
11198
11706
  id: item.id,
@@ -11336,7 +11844,7 @@ var Checkout = (0, import_react38.forwardRef)(
11336
11844
  onFetchEventConditionsError == null ? void 0 : onFetchEventConditionsError(conditionsError);
11337
11845
  return showAlert(conditionsError.message || "Error while fetching conditions");
11338
11846
  }
11339
- setConditionsValues((0, import_map6.default)(conditionsData, () => false));
11847
+ setConditionsValues((0, import_map7.default)(conditionsData, () => false));
11340
11848
  setConditionsTexts(conditionsData);
11341
11849
  hideLoading();
11342
11850
  onFetchEventConditionsSuccess == null ? void 0 : onFetchEventConditionsSuccess(conditionsData);
@@ -11362,13 +11870,13 @@ var Checkout = (0, import_react38.forwardRef)(
11362
11870
  setSecondsLeft(orderReviewData.expiresAt);
11363
11871
  const tOrderInfo = [...orderInfo];
11364
11872
  const currency = orderReviewData.reviewData.currency;
11365
- (0, import_forEach4.default)(tOrderInfo, (item) => {
11873
+ (0, import_forEach5.default)(tOrderInfo, (item) => {
11366
11874
  (0, import_mapKeys3.default)(orderReviewData.reviewData, (value, key) => {
11367
11875
  var _a3, _b2;
11368
11876
  if (item.id === key) {
11369
11877
  item.title = (_b2 = (_a3 = texts == null ? void 0 : texts.orderReviewItems) == null ? void 0 : _a3[key]) != null ? _b2 : item.title;
11370
11878
  if (key === "price" || key === "total") {
11371
- item.value = priceWithCurrency(value, currency);
11879
+ item.value = priceWithCurrency2(value, currency);
11372
11880
  } else {
11373
11881
  item.value = value;
11374
11882
  }
@@ -11447,7 +11955,7 @@ var Checkout = (0, import_react38.forwardRef)(
11447
11955
  ticketName: orderDetailsData.items[0].name,
11448
11956
  ticketCost: orderDetailsData.items[0].price,
11449
11957
  numberOfTickets: parseInt(orderDetailsData.items[0].quantity, 10),
11450
- eventUserTickets: (0, import_map6.default)(orderDetailsData.tickets, (ticket) => ({
11958
+ eventUserTickets: (0, import_map7.default)(orderDetailsData.tickets, (ticket) => ({
11451
11959
  hash: ticket.hash,
11452
11960
  ticketType: ticket.ticketType,
11453
11961
  holderEmail: ticket.holderEmail,
@@ -11525,7 +12033,7 @@ var Checkout = (0, import_react38.forwardRef)(
11525
12033
  (_a2 = checkoutCoreRef.current) == null ? void 0 : _a2.stopCartTimer();
11526
12034
  onPaymentSuccess == null ? void 0 : onPaymentSuccess();
11527
12035
  };
11528
- const getConditions = () => (0, import_map6.default)(conditionsTexts, (conditionTxt, index) => {
12036
+ const getConditions2 = () => (0, import_map7.default)(conditionsTexts, (conditionTxt, index) => {
11529
12037
  return {
11530
12038
  id: `condition${index}`,
11531
12039
  fieldType: "checkbox",
@@ -11594,7 +12102,7 @@ var Checkout = (0, import_react38.forwardRef)(
11594
12102
  }
11595
12103
  )
11596
12104
  ] }),
11597
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Conditions_default, { ...getConditions() }),
12105
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Conditions_default, { ...getConditions2() }),
11598
12106
  isPaymentRequired && !isStripeConfigMissing && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
11599
12107
  Button_default,
11600
12108
  {
@@ -11639,14 +12147,14 @@ var Checkout_default = Checkout;
11639
12147
 
11640
12148
  // src/containers/myOrderDetails/MyOrderDetails.tsx
11641
12149
  var import_find4 = __toESM(require("lodash/find"));
11642
- var import_forEach5 = __toESM(require("lodash/forEach"));
12150
+ var import_forEach6 = __toESM(require("lodash/forEach"));
11643
12151
  var import_react39 = require("react");
11644
12152
  var import_react_native75 = require("react-native");
11645
12153
  var import_react_native_fs = require("react-native-fs");
11646
12154
 
11647
12155
  // src/containers/myOrderDetails/MyOrderDetailsView.tsx
11648
12156
  var import_clipboard = __toESM(require("@react-native-clipboard/clipboard"));
11649
- var import_map7 = __toESM(require("lodash/map"));
12157
+ var import_map8 = __toESM(require("lodash/map"));
11650
12158
  var import_react_native74 = require("react-native");
11651
12159
 
11652
12160
  // src/containers/myOrderDetails/components/Notification.tsx
@@ -12012,13 +12520,13 @@ var MyOrderDetailsView = ({
12012
12520
  ] })
12013
12521
  ] });
12014
12522
  };
12015
- const parsedItems = items ? (0, import_map7.default)(items, (item) => {
12523
+ const parsedItems = items ? (0, import_map8.default)(items, (item) => {
12016
12524
  return {
12017
12525
  id: `${item.name}.${item.price}`,
12018
12526
  item
12019
12527
  };
12020
12528
  }) : void 0;
12021
- const parsedTickets = (0, import_map7.default)(tickets, (item) => {
12529
+ const parsedTickets = (0, import_map8.default)(tickets, (item) => {
12022
12530
  return {
12023
12531
  id: `${item.hash}`,
12024
12532
  item
@@ -12223,7 +12731,7 @@ var MyOrderDetails = (0, import_react39.forwardRef)(
12223
12731
  return setDownloadStatus("failed");
12224
12732
  }
12225
12733
  const path = import_react_native75.Platform.OS === "ios" ? `${import_react_native_fs.DocumentDirectoryPath}/${hash}.pdf` : `${import_react_native_fs.DownloadDirectoryPath}/${hash}.pdf`;
12226
- const headers = {
12734
+ const headers2 = {
12227
12735
  Accept: "application/pdf",
12228
12736
  "Content-Type": "application/pdf",
12229
12737
  Authorization: `Bearer ${accessToken}`
@@ -12231,7 +12739,7 @@ var MyOrderDetails = (0, import_react39.forwardRef)(
12231
12739
  const options = {
12232
12740
  fromUrl: pdfLink,
12233
12741
  toFile: path,
12234
- headers
12742
+ headers: headers2
12235
12743
  };
12236
12744
  setDownloadStatus("downloading");
12237
12745
  const response = await (0, import_react_native_fs.downloadFile)(options).promise;
@@ -12256,7 +12764,7 @@ var MyOrderDetails = (0, import_react39.forwardRef)(
12256
12764
  return import_react_native75.Alert.alert("", removeTicketFromResaleError == null ? void 0 : removeTicketFromResaleError.message);
12257
12765
  }
12258
12766
  const updatedOrderInfo = { ...orderInfo };
12259
- (0, import_forEach5.default)(updatedOrderInfo.tickets, (item) => {
12767
+ (0, import_forEach6.default)(updatedOrderInfo.tickets, (item) => {
12260
12768
  if (item.hash === ticket.hash) {
12261
12769
  item.isSellable = true;
12262
12770
  item.isOnSale = false;
@@ -12381,7 +12889,7 @@ var MyOrderDetails = (0, import_react39.forwardRef)(
12381
12889
  var MyOrderDetails_default = MyOrderDetails;
12382
12890
 
12383
12891
  // src/containers/myOrders/MyOrders.tsx
12384
- var import_map8 = __toESM(require("lodash/map"));
12892
+ var import_map9 = __toESM(require("lodash/map"));
12385
12893
  var import_sortBy3 = __toESM(require("lodash/sortBy"));
12386
12894
  var import_uniqBy = __toESM(require("lodash/uniqBy"));
12387
12895
  var import_react41 = require("react");
@@ -12809,7 +13317,7 @@ var MyOrders = (0, import_react41.forwardRef)(
12809
13317
  }
12810
13318
  onFetchMyOrdersSuccess == null ? void 0 : onFetchMyOrdersSuccess(myOrdersData);
12811
13319
  const events = (0, import_sortBy3.default)(
12812
- (0, import_map8.default)(myOrdersData.events, (item) => {
13320
+ (0, import_map9.default)(myOrdersData.events, (item) => {
12813
13321
  return {
12814
13322
  label: item.event_name,
12815
13323
  value: item.url_name
@@ -12820,7 +13328,7 @@ var MyOrders = (0, import_react41.forwardRef)(
12820
13328
  setMyEvents(events);
12821
13329
  return myOrdersData;
12822
13330
  };
12823
- const getOrders = async () => {
13331
+ const getOrders2 = async () => {
12824
13332
  var _a2;
12825
13333
  const fetchedOrders = await getOrdersAsync();
12826
13334
  setMyOrders((_a2 = fetchedOrders == null ? void 0 : fetchedOrders.orders) != null ? _a2 : []);
@@ -12856,7 +13364,7 @@ var MyOrders = (0, import_react41.forwardRef)(
12856
13364
  logger.debug("MyOrders", "refreshAccessToken", {
12857
13365
  message: "Access token refreshed successfully"
12858
13366
  });
12859
- await getOrders();
13367
+ await getOrders2();
12860
13368
  }
12861
13369
  return {
12862
13370
  accessTokenData,
@@ -12865,12 +13373,12 @@ var MyOrders = (0, import_react41.forwardRef)(
12865
13373
  },
12866
13374
  async reloadData() {
12867
13375
  logger.debug("MyOrders", "reloadData");
12868
- await getOrders();
13376
+ await getOrders2();
12869
13377
  }
12870
13378
  }));
12871
13379
  const handleOnRefresh = async () => {
12872
13380
  setIsRefreshing(true);
12873
- await getOrders();
13381
+ await getOrders2();
12874
13382
  setIsRefreshing(false);
12875
13383
  };
12876
13384
  const handleOnLoadingChange = (0, import_react41.useCallback)(
@@ -12932,13 +13440,13 @@ var MyOrders = (0, import_react41.forwardRef)(
12932
13440
  }, [handleOnLoadingChange, isLoading, isGettingEventDetails]);
12933
13441
  (0, import_react41.useEffect)(() => {
12934
13442
  const _fetchMyOrders = async () => {
12935
- await getOrders();
13443
+ await getOrders2();
12936
13444
  };
12937
13445
  _fetchMyOrders();
12938
13446
  }, []);
12939
13447
  (0, import_react41.useEffect)(() => {
12940
13448
  if (selectedEvent.value !== "" || selectedTimeFilter.value !== "") {
12941
- getOrders();
13449
+ getOrders2();
12942
13450
  }
12943
13451
  }, [selectedEvent, selectedTimeFilter]);
12944
13452
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(MyOrdersCore_default, { ref: myOrdersCoreRef, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SessionHandle_default, { ref: sessionHandleRef, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
@@ -13830,7 +14338,7 @@ var ResetPassword = ({
13830
14338
  var ResetPassword_default = ResetPassword;
13831
14339
 
13832
14340
  // src/containers/tickets/Tickets.tsx
13833
- var import_get2 = __toESM(require("lodash/get"));
14341
+ var import_get3 = __toESM(require("lodash/get"));
13834
14342
  var import_isEmpty = __toESM(require("lodash/isEmpty"));
13835
14343
  var import_some = __toESM(require("lodash/some"));
13836
14344
  var import_react46 = require("react");
@@ -13944,7 +14452,7 @@ var TicketListItem2 = ({
13944
14452
  const feesIncluded = ticket.feeIncluded ? feesIncludedText : feesExcludedText;
13945
14453
  const showOldPrice = ticket.price !== ticket.oldPrice;
13946
14454
  const isTicketFree = +ticket.price === 0;
13947
- const ticketPrice = isSoldOut ? soldOutText : isTicketFree ? freeText : priceWithCurrency(ticket.price.toFixed(2).toString(), ticket.priceSymbol);
14455
+ const ticketPrice = isSoldOut ? soldOutText : isTicketFree ? freeText : priceWithCurrency3(ticket.price.toFixed(2).toString(), ticket.priceSymbol);
13948
14456
  const maximumOption = (_a = (0, import_maxBy.default)(dropdownOptions, (o) => o.value)) == null ? void 0 : _a.value;
13949
14457
  let rightContent = /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_jsx_runtime64.Fragment, {});
13950
14458
  if (ticket.soldOut || ticket.sold_out || !ticket.displayTicket) {
@@ -13966,7 +14474,7 @@ var TicketListItem2 = ({
13966
14474
  /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react_native90.Text, { style: [CartListItemStyles.ticketNumber, styles3 == null ? void 0 : styles3.ticketName], numberOfLines: 2, children: ticket.displayName.toUpperCase() || `${ticketText} ${ticketNumber}` }),
13967
14475
  isSoldOut ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react_native90.View, { style: [CartListItemStyles.soldOutContainer, styles3 == null ? void 0 : styles3.soldOutContainer], children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react_native90.Text, { style: [CartListItemStyles.soldOut, styles3 == null ? void 0 : styles3.soldOutText], children: soldOutMessage }) }) : /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
13968
14476
  /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_react_native90.View, { style: styles3 == null ? void 0 : styles3.pricesContainer, children: [
13969
- showOldPrice && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react_native90.Text, { style: [CartListItemStyles.oldPrice, styles3 == null ? void 0 : styles3.oldPrice], children: priceWithCurrency((_b = ticket.oldPrice) == null ? void 0 : _b.toString(), ticket.priceSymbol) }),
14477
+ showOldPrice && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react_native90.Text, { style: [CartListItemStyles.oldPrice, styles3 == null ? void 0 : styles3.oldPrice], children: priceWithCurrency3((_b = ticket.oldPrice) == null ? void 0 : _b.toString(), ticket.priceSymbol) }),
13970
14478
  /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react_native90.Text, { style: [CartListItemStyles.price, styles3 == null ? void 0 : styles3.price], children: ticketPrice })
13971
14479
  ] }),
13972
14480
  /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react_native90.Text, { style: [CartListItemStyles.tax, styles3 == null ? void 0 : styles3.fees], children: feesIncluded.toUpperCase() })
@@ -14272,7 +14780,7 @@ var Tickets = (0, import_react46.forwardRef)(
14272
14780
  logger2.error("Error while fetching initial data", error);
14273
14781
  }
14274
14782
  };
14275
- const getTickets = async (promoCode = "") => {
14783
+ const getTickets2 = async (promoCode = "") => {
14276
14784
  setIsGettingTickets(true);
14277
14785
  isApiErrorRef.current = false;
14278
14786
  const {
@@ -14377,7 +14885,7 @@ var Tickets = (0, import_react46.forwardRef)(
14377
14885
  }
14378
14886
  try {
14379
14887
  logger2.info("Fetching tickets: getTickets()");
14380
- await getTickets();
14888
+ await getTickets2();
14381
14889
  } catch (error) {
14382
14890
  logger2.info("Fetching tickets: getTickets() Error: " + error);
14383
14891
  showAlert(error);
@@ -14393,8 +14901,8 @@ var Tickets = (0, import_react46.forwardRef)(
14393
14901
  const ticketQuantity = typeof selectedTicket.selectedOption.value === "string" ? parseInt(selectedTicket.selectedOption.value, 10) : selectedTicket.selectedOption.value;
14394
14902
  const ticketsOptions = {
14395
14903
  quantity: ticketQuantity,
14396
- optionName: (0, import_get2.default)(selectedTicket, "optionName"),
14397
- ticketId: (0, import_get2.default)(selectedTicket, "id"),
14904
+ optionName: (0, import_get3.default)(selectedTicket, "optionName"),
14905
+ ticketId: (0, import_get3.default)(selectedTicket, "id"),
14398
14906
  price: selectedTicket.price
14399
14907
  };
14400
14908
  setIsBooking(true);
@@ -14461,7 +14969,7 @@ var Tickets = (0, import_react46.forwardRef)(
14461
14969
  performBookTickets();
14462
14970
  };
14463
14971
  const handleOnPressApplyPromoCode = async (code) => {
14464
- await getTickets(code);
14972
+ await getTickets2(code);
14465
14973
  };
14466
14974
  const handleOnSelectTicketOption = (ticket) => {
14467
14975
  setSelectedTicket(ticket);
@@ -14501,7 +15009,7 @@ var Tickets = (0, import_react46.forwardRef)(
14501
15009
  eventErrorCodeRef.current = 0;
14502
15010
  onFetchEventSuccess == null ? void 0 : onFetchEventSuccess(eventData);
14503
15011
  setEvent(eventData);
14504
- getTickets();
15012
+ getTickets2();
14505
15013
  };
14506
15014
  return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TicketsCore_default, { ref: ticketsCoreRef, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SessionHandle_default, { ref: sessionHandleRef, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
14507
15015
  TicketsView_default,
@@ -14548,10 +15056,10 @@ var import_react49 = require("react");
14548
15056
  var import_react_native_background_timer4 = __toESM(require("react-native-background-timer"));
14549
15057
 
14550
15058
  // src/utils/handlers.ts
14551
- var import_axios2 = __toESM(require("axios"));
15059
+ var import_axios3 = __toESM(require("axios"));
14552
15060
  function readableError(error) {
14553
15061
  var _a, _b;
14554
- if (import_axios2.default.isAxiosError(error)) {
15062
+ if (import_axios3.default.isAxiosError(error)) {
14555
15063
  return ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message;
14556
15064
  } else if (error instanceof Error) {
14557
15065
  return error.message;
@@ -14561,7 +15069,7 @@ function readableError(error) {
14561
15069
  }
14562
15070
  function logError(error, context, options) {
14563
15071
  const prefix = context ? `[${context}]` : "[Error]";
14564
- if (import_axios2.default.isAxiosError(error)) {
15072
+ if (import_axios3.default.isAxiosError(error)) {
14565
15073
  console.error(`${prefix}: ${error.message}`);
14566
15074
  if (error.response) {
14567
15075
  console.error(`${prefix} Response:`, {
@@ -15485,11 +15993,11 @@ var useCheckoutFlow = ({
15485
15993
  updatedOrderItems.push({
15486
15994
  id: ticket.ticket_type_id,
15487
15995
  title: ticket.ticket_type_name,
15488
- subtitle: `${ticket.quantity} x ${priceWithCurrency(
15996
+ subtitle: `${ticket.quantity} x ${priceWithCurrency5(
15489
15997
  ticket.price_per_ticket,
15490
15998
  currency
15491
15999
  )}`,
15492
- value: priceWithCurrency(ticket.total_price.toString(), currency)
16000
+ value: priceWithCurrency5(ticket.total_price.toString(), currency)
15493
16001
  });
15494
16002
  });
15495
16003
  }
@@ -15498,11 +16006,11 @@ var useCheckoutFlow = ({
15498
16006
  updatedOrderItems.push({
15499
16007
  id: `addon_${addon.add_on_name}`,
15500
16008
  title: `${addon.add_on_name} (Add-on)`,
15501
- subtitle: `${addon.quantity} x ${priceWithCurrency(
16009
+ subtitle: `${addon.quantity} x ${priceWithCurrency5(
15502
16010
  addon.price_per_add_on,
15503
16011
  currency
15504
16012
  )}`,
15505
- value: priceWithCurrency(addon.total_price.toString(), currency)
16013
+ value: priceWithCurrency5(addon.total_price.toString(), currency)
15506
16014
  });
15507
16015
  });
15508
16016
  }
@@ -15510,13 +16018,13 @@ var useCheckoutFlow = ({
15510
16018
  updatedOrderItems.push({
15511
16019
  id: "tax",
15512
16020
  title: cartPriceBreakdown.goods_tax_name || "Tax",
15513
- value: priceWithCurrency(cartPriceBreakdown.goods_tax.toString(), currency)
16021
+ value: priceWithCurrency5(cartPriceBreakdown.goods_tax.toString(), currency)
15514
16022
  });
15515
16023
  }
15516
16024
  updatedOrderItems.push({
15517
16025
  id: "total",
15518
16026
  title: "Total",
15519
- value: priceWithCurrency(cartPriceBreakdown.total.toString(), currency)
16027
+ value: priceWithCurrency5(cartPriceBreakdown.total.toString(), currency)
15520
16028
  });
15521
16029
  setOrderItems(updatedOrderItems);
15522
16030
  },
@@ -15618,14 +16126,14 @@ var useCheckoutFlow = ({
15618
16126
  items.push({
15619
16127
  id: "price",
15620
16128
  title: "Ticket Price",
15621
- value: priceWithCurrency(cartData.cart[0].price, currency)
16129
+ value: priceWithCurrency5(cartData.cart[0].price, currency)
15622
16130
  });
15623
16131
  }
15624
16132
  const total = ((_m2 = (_l2 = cartData.cart) == null ? void 0 : _l2[0]) == null ? void 0 : _m2.price) || 0;
15625
16133
  items.push({
15626
16134
  id: "total",
15627
16135
  title: "Total",
15628
- value: priceWithCurrency(total, currency)
16136
+ value: priceWithCurrency5(total, currency)
15629
16137
  });
15630
16138
  setOrderItems(items);
15631
16139
  }
@@ -15895,7 +16403,7 @@ var AddonsContainer = ({
15895
16403
  const priceWithFees = addonData.price || 0;
15896
16404
  const addonCurrency = addonData.currency || currency;
15897
16405
  const isAddonFree = Number(priceWithFees) === 0;
15898
- const basePriceFormatted = isAddonFree ? "FREE" : priceWithCurrency((priceWithFees / 100).toString(), addonCurrency);
16406
+ const basePriceFormatted = isAddonFree ? "FREE" : priceWithCurrency6((priceWithFees / 100).toString(), addonCurrency);
15899
16407
  return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_react_native95.View, { style: [customStyles == null ? void 0 : customStyles.addonItem], children: [
15900
16408
  /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_react_native95.View, { style: [customStyles == null ? void 0 : customStyles.addonRow], children: [
15901
16409
  /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_react_native95.View, { style: [customStyles == null ? void 0 : customStyles.addonInfo], children: [
@@ -16055,7 +16563,7 @@ var styles = import_react_native96.StyleSheet.create({
16055
16563
  var Conditions_default2 = Conditions2;
16056
16564
 
16057
16565
  // src/features/checkout-v2/components/OrderReview.tsx
16058
- var import_map9 = __toESM(require("lodash/map"));
16566
+ var import_map10 = __toESM(require("lodash/map"));
16059
16567
  var import_react_native97 = require("react-native");
16060
16568
  var import_jsx_runtime70 = require("react/jsx-runtime");
16061
16569
  var styles2 = import_react_native97.StyleSheet.create({
@@ -16100,7 +16608,7 @@ var OrderItem2 = ({ title, subtitle, value, styles: itemStyles }) => /* @__PURE_
16100
16608
  `orderReview.${title}`
16101
16609
  );
16102
16610
  var OrderReview2 = ({ orderItems, styles: customStyles }) => {
16103
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react_native97.View, { style: [styles2.rootContainer, customStyles == null ? void 0 : customStyles.rootContainer], children: (0, import_map9.default)(orderItems, (item) => {
16611
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react_native97.View, { style: [styles2.rootContainer, customStyles == null ? void 0 : customStyles.rootContainer], children: (0, import_map10.default)(orderItems, (item) => {
16104
16612
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
16105
16613
  return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
16106
16614
  OrderItem2,