@odynn/awayz-core 0.10.14 → 0.10.15

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.
@@ -1,7 +1,7 @@
1
1
  const o = "USD", a = (r, t) => {
2
2
  var e = new Intl.NumberFormat("en-US", {
3
3
  style: "currency",
4
- currency: t ?? o
4
+ currency: t || o
5
5
  });
6
6
  if (!r) return e.format(0);
7
7
  const n = parseFloat(r.toString());
@@ -9,14 +9,14 @@ const o = "USD", a = (r, t) => {
9
9
  }, m = (r, t) => {
10
10
  var e = new Intl.NumberFormat("en-US", {
11
11
  style: "currency",
12
- currency: t ?? o
12
+ currency: t || o
13
13
  });
14
14
  return e.format(Math.round(r)).toString().split(".")[0];
15
15
  }, i = (r, t, e = 0) => {
16
16
  const n = parseFloat((r == null ? void 0 : r.toString()) || "0");
17
17
  return new Intl.NumberFormat("en-US", {
18
18
  style: "currency",
19
- currency: t ?? o,
19
+ currency: t || o,
20
20
  maximumFractionDigits: e
21
21
  }).format(isNaN(n) ? 0 : n);
22
22
  }, u = (r, t = "en") => 0 .toLocaleString(t, {
@@ -1,7 +1,7 @@
1
1
  import { jsx as r, jsxs as l } from "react/jsx-runtime";
2
2
  import { useQuery as R } from "@tanstack/react-query";
3
3
  import "../../arrayExtensions-DlcBOj5a.js";
4
- import { g as m, a as _, b as N } from "../../cashUtils-DnCt66eB.js";
4
+ import { g as m, a as _, b as N } from "../../cashUtils-CJuInOx4.js";
5
5
  import { E as S } from "../../noRetryInstance-CbNDzU_c.js";
6
6
  import { useMemo as T } from "react";
7
7
  import { a as f } from "../../index-C8p5kinH.js";
@@ -1,5 +1,5 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
- import { c as P } from "../../cashUtils-DnCt66eB.js";
2
+ import { c as P } from "../../cashUtils-CJuInOx4.js";
3
3
  import { e as M, A as m, E as N } from "../../noRetryInstance-CbNDzU_c.js";
4
4
  import { a as i } from "../../keys-BcBfU51M.js";
5
5
  import { useState as f, useCallback as F, useEffect as T } from "react";
@@ -1,7 +1,7 @@
1
- import { useQuery as O } from "@tanstack/react-query";
1
+ import { useQuery as U } from "@tanstack/react-query";
2
2
  import "../arrayExtensions-DlcBOj5a.js";
3
- import { E as r, t as F } from "../noRetryInstance-CbNDzU_c.js";
4
- import { useMemo as N } from "react";
3
+ import { E as N, t as F } from "../noRetryInstance-CbNDzU_c.js";
4
+ import { useMemo as r } from "react";
5
5
  import { FeatureService as e } from "../services/features/featureService.js";
6
6
  const L = [
7
7
  "DEFAULT_CURRENCY_FEATURE",
@@ -22,7 +22,7 @@ const L = [
22
22
  "FLIGHT_BOOKING_OPTIONS_DISPLAY_FEATURE",
23
23
  "THEME_FEATURE",
24
24
  "MULTI_DATE_SEARCH_AMOUNT_FEATURE"
25
- ], S = [
25
+ ], I = [
26
26
  "CURRENCY_FILTER_FEATURE",
27
27
  "FREE_HOTEL_NIGHTS_FEATURE",
28
28
  "SHOW_BOOKABLE_FEATURE",
@@ -49,19 +49,19 @@ const L = [
49
49
  "HIDE_FLIGHT_SEARCH_CONTAINER_FEATURE",
50
50
  "HIDE_HOTEL_SEARCH_CONTAINER_FEATURE",
51
51
  "EXTERNAL_INVENTORY_FEATURE"
52
- ], I = [
52
+ ], S = [
53
53
  "WALLET_PROGRAM_TYPES_FEATURES",
54
54
  "HOTEL_FILTERS_FEATURES",
55
55
  "FLIGHT_FILTERS_FEATURES",
56
56
  "WALLET_FEATURES"
57
57
  ];
58
- var H = /* @__PURE__ */ ((E) => (E.DEFAULT = "default", E.FULL_VCC_PARTIAL_ENABLED = "Full VCC - Partial Enabled", E.FULL_VCC_PARTIAL_DISABLED = "Full VCC - Partial Disabled", E))(H || {}), t = /* @__PURE__ */ ((E) => (E.LIGHT = "light", E.DARK = "dark", E.USER = "user", E))(t || {}), s = /* @__PURE__ */ ((E) => (E.CASH_ONLY = "Cash Only", E.CASH_AND_TRAVEL_PARTNER_POINTS = "Cash And Travel Partner Points", E.CASH_AND_CLIENT_POINTS = "Cash And Client Points", E))(s || {}), a = /* @__PURE__ */ ((E) => (E.RESULT = "result", E.SHEET = "sheet", E))(a || {});
58
+ var H = /* @__PURE__ */ ((E) => (E.DEFAULT = "default", E.FULL_VCC_PARTIAL_ENABLED = "Full VCC - Partial Enabled", E.FULL_VCC_PARTIAL_DISABLED = "Full VCC - Partial Disabled", E))(H || {}), t = /* @__PURE__ */ ((E) => (E.LIGHT = "light", E.DARK = "dark", E.USER = "user", E))(t || {}), s = /* @__PURE__ */ ((E) => (E.CASH_ONLY = "Cash Only", E.CASH_AND_TRAVEL_PARTNER_POINTS = "Cash And Travel Partner Points", E.CASH_AND_CLIENT_POINTS = "Cash And Client Points", E))(s || {});
59
59
  const i = () => {
60
- const { data: E, isSuccess: R } = O({
61
- queryKey: [r.FEATURES, "new"],
60
+ const { data: E, isSuccess: R } = U({
61
+ queryKey: [N.FEATURES, "new"],
62
62
  queryFn: e.getFeatureFlags,
63
63
  staleTime: 1 / 0
64
- }), U = N(
64
+ }), O = r(
65
65
  () => R && E ? (() => {
66
66
  const T = {};
67
67
  return L.forEach((_) => {
@@ -69,12 +69,12 @@ const i = () => {
69
69
  _.toLowerCase()
70
70
  );
71
71
  E[_] !== void 0 && (T[A] = E[_]);
72
- }), S.forEach((_) => {
72
+ }), I.forEach((_) => {
73
73
  const A = F(
74
74
  _.toLowerCase()
75
75
  );
76
76
  E[_] !== void 0 && (T[A] = E[_]);
77
- }), I.forEach((_) => {
77
+ }), S.forEach((_) => {
78
78
  const A = F(
79
79
  _.toLowerCase()
80
80
  );
@@ -86,20 +86,19 @@ const i = () => {
86
86
  if (R && E) {
87
87
  const _ = [
88
88
  ...L,
89
- ...S,
90
- ...I
89
+ ...I,
90
+ ...S
91
91
  ].filter((A) => E[A] === void 0);
92
92
  _.length > 0 && console.error("Missing feature flags:", _);
93
93
  }
94
94
  return {
95
- featureFlags: U,
95
+ featureFlags: O,
96
96
  loaded: R
97
97
  };
98
98
  };
99
99
  export {
100
100
  s as EAmountsDisplayFeature,
101
101
  H as EBookingPaymentMethod,
102
- a as EFlightBookingOptionsDisplayFeature,
103
102
  t as EThemeFeatureFlag,
104
103
  i as useFeatureFlags
105
104
  };
@@ -27,10 +27,6 @@ export declare enum EAmountsDisplayFeature {
27
27
  CASH_AND_TRAVEL_PARTNER_POINTS = "Cash And Travel Partner Points",
28
28
  CASH_AND_CLIENT_POINTS = "Cash And Client Points"
29
29
  }
30
- export declare enum EFlightBookingOptionsDisplayFeature {
31
- RESULT = "result",
32
- SHEET = "sheet"
33
- }
34
30
  export declare const useFeatureFlags: () => {
35
31
  featureFlags: FeatureFlags;
36
32
  loaded: boolean;
package/dist/main.js CHANGED
@@ -1,59 +1,58 @@
1
1
  import { FlightBooking as r } from "./components/Bookings/FlightBooking/FlightBooking.js";
2
2
  import { HotelBooking as a } from "./components/Bookings/HotelBooking/HotelBooking.js";
3
- import { CashValue as i } from "./components/CashValue/CashValue.js";
4
- import { EInvalidAmountDisplayOption as m, EToolTipPosition as s } from "./components/CashValue/CashValueTypes.js";
3
+ import { CashValue as m } from "./components/CashValue/CashValue.js";
4
+ import { EInvalidAmountDisplayOption as i, EToolTipPosition as s } from "./components/CashValue/CashValueTypes.js";
5
5
  import { ClientPointsValue as x } from "./components/ClientPointsValue/ClientPointsValue.js";
6
6
  import { Card as u } from "./components/Wallet/Card/Card.js";
7
7
  import { awayzClient as c } from "./configs/awayzClient.js";
8
8
  import { defaultAwayzConfig as C } from "./configs/defaultAwayzConfig.js";
9
- import { useAwayzContext as F } from "./hooks/useAwayzContext.js";
10
- import { useBookingManagement as w } from "./hooks/useBookingManagement/useBookingManagement.js";
11
- import { useSearchLimit as T } from "./hooks/useSearchLimit.js";
12
- import { ETripStatus as k, useTripManagement as A } from "./hooks/useTripManagement/useTripManagement.js";
9
+ import { useAwayzContext as h } from "./hooks/useAwayzContext.js";
10
+ import { useBookingManagement as F } from "./hooks/useBookingManagement/useBookingManagement.js";
11
+ import { useSearchLimit as d } from "./hooks/useSearchLimit.js";
12
+ import { ETripStatus as B, useTripManagement as k } from "./hooks/useTripManagement/useTripManagement.js";
13
13
  import { useWallet as P } from "./hooks/useWallet/useWallet.js";
14
14
  import { ECancelStatus as z } from "./hooks/useBookingManagement/useBookingManagement.types.js";
15
- import { AwayzProvider as D } from "./providers/AwayzProvider.js";
16
- import { CurrencyService as O } from "./services/currency/CurrencyService.js";
17
- import { c as V, a as H, g as L, i as N } from "./noRetryInstance-CbNDzU_c.js";
15
+ import { AwayzProvider as M } from "./providers/AwayzProvider.js";
16
+ import { CurrencyService as R } from "./services/currency/CurrencyService.js";
17
+ import { c as H, a as L, g as N, i as O } from "./noRetryInstance-CbNDzU_c.js";
18
18
  import { RewardsService as W } from "./services/rewards/RewardsService.js";
19
19
  import { EBookingType as j } from "./services/trips/TripService.types.js";
20
20
  import { EAuthFlow as G } from "./types/EAuthFlow.js";
21
21
  import { convertCashToClientPoints as K } from "./utils/clientPoints.js";
22
22
  import { getCurrency as X } from "./utils/currency.js";
23
- import { EAmountsDisplayFeature as Z, EBookingPaymentMethod as _, EFlightBookingOptionsDisplayFeature as $, EThemeFeatureFlag as oo, useFeatureFlags as eo } from "./hooks/useFeatureFlags.js";
24
- import { getBaseUrl as to } from "./configs/baseUrl.js";
23
+ import { EAmountsDisplayFeature as Z, EBookingPaymentMethod as _, EThemeFeatureFlag as $, useFeatureFlags as ee } from "./hooks/useFeatureFlags.js";
24
+ import { getBaseUrl as re } from "./configs/baseUrl.js";
25
25
  export {
26
- D as AwayzProvider,
26
+ M as AwayzProvider,
27
27
  u as Card,
28
- i as CashValue,
28
+ m as CashValue,
29
29
  x as ClientPointsValue,
30
- O as CurrencyService,
30
+ R as CurrencyService,
31
31
  Z as EAmountsDisplayFeature,
32
32
  G as EAuthFlow,
33
33
  _ as EBookingPaymentMethod,
34
34
  j as EBookingType,
35
35
  z as ECancelStatus,
36
- $ as EFlightBookingOptionsDisplayFeature,
37
- m as EInvalidAmountDisplayOption,
38
- oo as EThemeFeatureFlag,
36
+ i as EInvalidAmountDisplayOption,
37
+ $ as EThemeFeatureFlag,
39
38
  s as EToolTipPosition,
40
- k as ETripStatus,
39
+ B as ETripStatus,
41
40
  r as FlightBooking,
42
41
  a as HotelBooking,
43
42
  W as RewardsService,
44
43
  c as awayzClient,
45
- V as clientInstance,
46
- H as clientNoRetryInstance,
44
+ H as clientInstance,
45
+ L as clientNoRetryInstance,
47
46
  K as convertCashToClientPoints,
48
47
  C as defaultAwayzConfig,
49
- L as gatewayInstance,
50
- to as getBaseUrl,
48
+ N as gatewayInstance,
49
+ re as getBaseUrl,
51
50
  X as getCurrency,
52
- N as instance,
53
- F as useAwayzContext,
54
- w as useBookingManagement,
55
- eo as useFeatureFlags,
56
- T as useSearchLimit,
57
- A as useTripManagement,
51
+ O as instance,
52
+ h as useAwayzContext,
53
+ F as useBookingManagement,
54
+ ee as useFeatureFlags,
55
+ d as useSearchLimit,
56
+ k as useTripManagement,
58
57
  P as useWallet
59
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odynn/awayz-core",
3
- "version": "0.10.14",
3
+ "version": "0.10.15",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"