@odynn/awayz-flights 0.9.7 → 0.9.9

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.
Files changed (36) hide show
  1. package/dist/BookingOption-V-FzaupW.js +196 -0
  2. package/dist/FlightItinerary-C4KPpVcF.js +94 -0
  3. package/dist/assets/FlightItinerary.css +1 -1
  4. package/dist/assets/FlightItineraryDropdown.css +1 -0
  5. package/dist/assets/MiniFlightItinerary.css +1 -0
  6. package/dist/assets/_styles.css +1 -1
  7. package/dist/assets/_styles2.css +1 -1
  8. package/dist/components/BookingOption/BookingOption.js +3 -4
  9. package/dist/components/Dialog/Dialog.js +1 -1
  10. package/dist/components/FlightItinerary/FlightItinerary.js +3 -4
  11. package/dist/components/FlightItineraryDropdown/FlightItineraryDropdown.js +22 -30
  12. package/dist/components/FlightResult/FlightResult.js +173 -183
  13. package/dist/components/HorizontalScroller/HorizontalScroller.js +3 -3
  14. package/dist/components/MiniFlightItinerary/MiniFlightItinerary.js +89 -7
  15. package/dist/components/index.js +5 -5
  16. package/dist/constants/endpoints.js +1 -1
  17. package/dist/enums-tLvxh02p.js +4 -0
  18. package/dist/hooks/index.js +3 -3
  19. package/dist/hooks/useFlightSearch/useFlightSearch.js +420 -11
  20. package/dist/{index-D8ljJLcr.js → index-9LVJi5JO.js} +7 -7
  21. package/dist/index-Kopwbl-x.js +19 -0
  22. package/dist/lib/components/FlightItinerary/FlightItinerary.d.ts +1 -6
  23. package/dist/lib/components/FlightItineraryDropdown/FlightItineraryDropdown.d.ts +2 -4
  24. package/dist/lib/constants/endpoints.d.ts +2 -1
  25. package/dist/lib/services/flights/FlightsService.d.ts +1 -0
  26. package/dist/main.js +35 -34
  27. package/dist/services/flights/FlightsService.js +37 -28
  28. package/dist/utils/flightUtils.js +39 -40
  29. package/package.json +1 -1
  30. package/dist/BookingOption-BTupJyHW.js +0 -192
  31. package/dist/FlightItinerary-BYXRMQUD.js +0 -262
  32. package/dist/MiniFlightItinerary-D2tFssaK.js +0 -106
  33. package/dist/assets/_styles5.css +0 -1
  34. package/dist/index-Gj4bRuCQ.js +0 -15
  35. package/dist/index-nI16-czT.js +0 -4
  36. package/dist/useFlightSearch-Dxoeykpk.js +0 -420
@@ -1,101 +1,100 @@
1
- import { jsx as r, jsxs as n, Fragment as k } from "react/jsx-runtime";
2
- import { useAwayzContext as Pe, useFeatureFlags as Ee, RewardsService as Y, EAmountsDisplayFeature as P, CashValue as j, EToolTipPosition as w, ClientPointsValue as Te, EInvalidAmountDisplayOption as Oe, awayzClient as te, EFlightBookingOptionsDisplayFeature as G, CurrencyService as De } from "@odynn/awayz-core";
3
- import { useQuery as be } from "@tanstack/react-query";
4
- import { p as J, c as Ae, B as X } from "../../BookingOption-BTupJyHW.js";
5
- import { g as Z } from "../../dateUtils-Cb9VQiIL.js";
1
+ import { jsx as r, jsxs as n, Fragment as L } from "react/jsx-runtime";
2
+ import { useAwayzContext as Fe, useFeatureFlags as Pe, RewardsService as Y, EAmountsDisplayFeature as u, CashValue as Q, EToolTipPosition as j, ClientPointsValue as Ee, EInvalidAmountDisplayOption as Te, awayzClient as ne, EFlightBookingOptionsDisplayFeature as G, CurrencyService as Ae } from "@odynn/awayz-core";
3
+ import { useQuery as De } from "@tanstack/react-query";
4
+ import { p as w, c as Oe, B as J } from "../../BookingOption-V-FzaupW.js";
5
+ import { g as X } from "../../dateUtils-Cb9VQiIL.js";
6
6
  import "../../arrayExtensions-Ce8YopTP.js";
7
- import { E as H } from "../../useFlightSearch-Dxoeykpk.js";
8
- import { a as W, F as B } from "../../FlightItinerary-BYXRMQUD.js";
9
- import { useRef as Ce, useState as E, useMemo as d, useEffect as L } from "react";
10
- import { h as y } from "../../moment-BGjjqtLQ.js";
11
- import { useTranslation as Se } from "react-i18next";
12
- import { F as ee, a as _e, b as Ie, c as Re, d as $ } from "../../index-D8ljJLcr.js";
13
- import { EPaymentType as f } from "../../enums/EPaymentType.js";
14
- import '../../assets/_styles.css';import '../../assets/_styles5.css';/* empty css */
15
- /* empty css */
16
- import { DEFAULT_AIRLINE_PROGRAM as ie, getFlightNumber as xe, getLogoPath as ke, getAirlineProgram as Le } from "../../utils/flightUtils.js";
17
- import { isSameDayFlight as $e } from "../../utils/flightDateUtils.js";
18
- import re from "../Dialog/Dialog.js";
19
- import ne from "../HorizontalScroller/HorizontalScroller.js";
20
- async function se(e, m, c) {
21
- if (!e || m === c) return e;
22
- const a = await te.ensureQueryData({
23
- queryKey: [H.CONVERT_CURRENCY, m, c],
7
+ import { E as H } from "../../enums-tLvxh02p.js";
8
+ import { E as T, F as Z } from "../../FlightItinerary-C4KPpVcF.js";
9
+ import { useRef as be, useState as A, useMemo as v, useEffect as k } from "react";
10
+ import { h as g } from "../../moment-BGjjqtLQ.js";
11
+ import { useTranslation as Ce } from "react-i18next";
12
+ import { b as W, c as _e, d as Se, e as Ie, f as x } from "../../index-9LVJi5JO.js";
13
+ import { EPaymentType as d } from "../../enums/EPaymentType.js";
14
+ import { DEFAULT_AIRLINE_PROGRAM as B, getFlightNumber as Re, getLogoPath as Le, getAirlineProgram as ke } from "../../utils/flightUtils.js";
15
+ import ee from "../Dialog/Dialog.js";
16
+ import ie from "../HorizontalScroller/HorizontalScroller.js";
17
+ import '../../assets/_styles.css';/* empty css */
18
+ const xe = (...e) => e.join(" ");
19
+ async function re(e, h, l) {
20
+ if (!e || h === l) return e;
21
+ const t = await ne.ensureQueryData({
22
+ queryKey: [H.CONVERT_CURRENCY, h, l],
24
23
  staleTime: 1e3 * 60 * 60,
25
24
  // 1 hour
26
- queryFn: () => De.convertCurrency({
27
- baseCurrency: m,
28
- targetCurrency: c
25
+ queryFn: () => Ae.convertCurrency({
26
+ baseCurrency: h,
27
+ targetCurrency: l
29
28
  })
30
29
  });
31
- return e * a;
30
+ return e * t;
32
31
  }
33
- const ri = ({
32
+ const Be = ({
34
33
  details: e,
35
- onClick: m,
36
- showBestValue: c = !1,
37
- onShowBestValueCalculation: a,
38
- customStyling: ae = !1,
39
- customCashComponent: ce,
40
- customPointsComponent: oe,
41
- onBookWithCash: T,
34
+ onClick: h,
35
+ showBestValue: l = !1,
36
+ onShowBestValueCalculation: t,
37
+ customStyling: se = !1,
38
+ customCashComponent: ae,
39
+ customPointsComponent: te,
40
+ onBookWithCash: D,
42
41
  onBookWithPoints: O
43
42
  }) => {
44
- const { t: D } = Se(), b = Ce(null), [U, le] = E(!1), [N, me] = E(
43
+ const { t: N } = Ce(), b = be(null), [U, ce] = A(!1), [F, le] = A(
45
44
  "none"
46
45
  /* NONE */
47
- ), [pe, he] = E(!1), { config: A } = Pe(), C = e.origin, S = e.destination, v = e.flightDetails, l = e.paymentOptions || [], { featureFlags: h } = Ee(), _ = d(
48
- () => l.filter((i) => i.points === -1),
49
- [l]
50
- ), I = d(
51
- () => l.filter((i) => i.points > -1),
52
- [l]
53
- ), ge = l.filter((i) => i.points === -1).length === 1, fe = l.filter((i) => i.points > -1).length === 1, [ue, M] = E(ie), p = d(() => {
54
- var i = l.filter((s) => s.points > -1).sort((s, t) => s.points - t.points);
46
+ ), [oe, me] = A(!1), { config: C } = Fe(), pe = e.origin, he = e.destination, P = e.flightDetails, m = e.paymentOptions || [], { featureFlags: p } = Pe(), _ = v(
47
+ () => m.filter((i) => i.points === -1),
48
+ [m]
49
+ ), S = v(
50
+ () => m.filter((i) => i.points > -1),
51
+ [m]
52
+ ), $ = m.filter((i) => i.points === -1).length === 1, ge = m.filter((i) => i.points > -1).length === 1, [fe, M] = A(B), c = v(() => {
53
+ var i = m.filter((s) => s.points > -1).sort((s, a) => s.points - a.points);
55
54
  return i.find(
56
55
  (s) => s.program === e.airlineProgram
57
56
  ) || i[0];
58
- }, [l, e.airlineProgram]), de = async () => {
59
- if (!p) {
60
- M(ie);
57
+ }, [m, e.airlineProgram]), ue = async () => {
58
+ if (!c) {
59
+ M(B);
61
60
  return;
62
61
  }
63
- const i = await Le(p.program);
62
+ const i = await ke(c.program);
64
63
  M(i);
65
64
  };
66
- L(() => {
67
- de();
68
- }, [p]);
69
- const { flightNumbers: ye, airlines: u } = d(() => {
65
+ k(() => {
66
+ ue();
67
+ }, [c]);
68
+ const { flightNumbers: de, airlines: y } = v(() => {
70
69
  const i = [], s = [];
71
- return e.flightDetails.slices.forEach((t) => {
72
- t.segments.forEach((o) => {
73
- const g = xe(o);
74
- i.includes(g) || i.push(g);
75
- const F = o.operatingCarrier;
76
- s.some((x) => x.airline === F.name) || s.push({
77
- logo: ke(F.iataCode),
78
- airline: F.name
70
+ return e.flightDetails.slices.forEach((a) => {
71
+ a.segments.forEach((o) => {
72
+ const f = Re(o);
73
+ i.includes(f) || i.push(f);
74
+ const E = o.operatingCarrier;
75
+ s.some((R) => R.airline === E.name) || s.push({
76
+ logo: Le(E.iataCode),
77
+ airline: E.name
79
78
  });
80
79
  });
81
80
  }), { flightNumbers: i, airlines: s };
82
81
  }, [e.flightDetails.slices]), Ne = () => {
83
- h.flightBookingOptionsDisplayFeature === G.SHEET || e.partial ? e.cash > 0 ? m(e, f.CASH) : m(e, f.POINTS) : K();
84
- }, R = e == null ? void 0 : e.airlineProgram, { data: q } = be({
85
- queryKey: [H.VALUE_CENTS, R, "test"],
86
- queryFn: () => Y.getCentPerPoint(R),
82
+ p.flightBookingOptionsDisplayFeature === G.SHEET || e.partial ? e.cash > 0 ? h(e, d.CASH) : h(e, d.POINTS) : K();
83
+ }, I = e == null ? void 0 : e.airlineProgram, { data: V } = De({
84
+ queryKey: [H.VALUE_CENTS, I, "test"],
85
+ queryFn: () => Y.getCentPerPoint(I),
87
86
  staleTime: 1 / 0,
88
- enabled: !!R && c
89
- }), V = d(() => {
87
+ enabled: !!I && l
88
+ }), q = v(() => {
90
89
  var i, s;
91
90
  return (s = (i = e.paymentOptions) == null ? void 0 : i.find(
92
- (t) => {
91
+ (a) => {
93
92
  var o;
94
- return t.program === e.airlineProgram && ((o = t.cashFee) == null ? void 0 : o.amount) !== 0;
93
+ return a.program === e.airlineProgram && ((o = a.cashFee) == null ? void 0 : o.amount) !== 0;
95
94
  }
96
95
  )) == null ? void 0 : s.cashFee;
97
- }, [e.paymentOptions, e.airlineProgram]), ve = async () => {
98
- if (!e || !q || !e.points || !e.cash)
96
+ }, [e.paymentOptions, e.airlineProgram]), ye = async () => {
97
+ if (!e || !V || !e.points || !e.cash)
99
98
  return;
100
99
  const i = e.currency;
101
100
  let s = {
@@ -103,65 +102,62 @@ const ri = ({
103
102
  currency: i
104
103
  };
105
104
  try {
106
- s = await te.ensureQueryData({
105
+ s = await ne.ensureQueryData({
107
106
  queryKey: [H.VALUE_CENTS, e.airlineProgram],
108
107
  staleTime: 1e3 * 60 * 60,
109
108
  // 1 hour
110
109
  queryFn: () => Y.getCentPerPoint(e.airlineProgram)
111
110
  });
112
- } catch (Fe) {
111
+ } catch (ve) {
113
112
  console.warn(
114
113
  "Failed to fetch value cents for airline program:",
115
114
  e.airlineProgram,
116
- Fe
115
+ ve
117
116
  );
118
117
  }
119
- const t = V ?? {
118
+ const a = q ?? {
120
119
  amount: 0,
121
120
  currency: i
122
- }, [o, g] = await Promise.all([
123
- se(
124
- t.amount,
125
- t.currency,
121
+ }, [o, f] = await Promise.all([
122
+ re(
123
+ a.amount,
124
+ a.currency,
126
125
  i
127
126
  ),
128
- se(
127
+ re(
129
128
  s.valueCents,
130
129
  s.currency,
131
130
  i
132
131
  )
133
- ]), x = g * e.points / 100 + o < e.cash;
134
- me(
135
- x ? "points" : "cash"
132
+ ]), R = f * e.points / 100 + o < e.cash;
133
+ le(
134
+ R ? "points" : "cash"
136
135
  /* CASH */
137
136
  );
138
137
  };
139
- L(() => {
140
- ve();
141
- }, [e, q, V]), L(() => {
142
- const i = y(e.expiresAt), s = y();
143
- if (!(i.year() === y(0).year()) && i.isAfter(s)) {
144
- const o = i.diff(s), g = setTimeout(() => {
145
- he(!0);
138
+ k(() => {
139
+ ye();
140
+ }, [e, V, q]), k(() => {
141
+ const i = g(e.expiresAt), s = g();
142
+ if (!(i.year() === g(0).year()) && i.isAfter(s)) {
143
+ const o = i.diff(s), f = setTimeout(() => {
144
+ me(!0);
146
145
  }, o);
147
146
  return () => {
148
- clearTimeout(g);
147
+ clearTimeout(f);
149
148
  };
150
149
  }
151
150
  }, [e.expiresAt]);
152
- const z = (i, s, t) => {
153
- i.stopPropagation(), h.flightBookingOptionsDisplayFeature === G.SHEET || t.partial ? m(t, s) : K();
151
+ const z = (i, s, a) => {
152
+ i.stopPropagation(), p.flightBookingOptionsDisplayFeature === G.SHEET || a.partial ? h(a, s) : K();
154
153
  }, K = () => {
155
154
  const i = !U;
156
- le(i), i && b.current && b.current.scrollIntoView({ behavior: "smooth" });
157
- }, Q = !$e(
158
- e.departureTime,
159
- e.arrivalTime
160
- );
155
+ ce(i), i && b.current && b.current.scrollIntoView({ behavior: "smooth" });
156
+ };
161
157
  return /* @__PURE__ */ r(
162
158
  "div",
163
159
  {
164
- className: `${ae ? "" : "awayz-"}flight-result`,
160
+ className: `${se ? "" : "awayz-"}flight-result`,
165
161
  onClick: Ne,
166
162
  children: /* @__PURE__ */ n("div", { className: "content", children: [
167
163
  /* @__PURE__ */ n("div", { className: "flight-info", children: [
@@ -170,28 +166,28 @@ const ri = ({
170
166
  /* @__PURE__ */ r(
171
167
  "img",
172
168
  {
173
- src: u[0].logo,
174
- alt: u[0].airline,
175
- onError: (i) => i.currentTarget.src = (A == null ? void 0 : A.logoFallbackImageUrl) ?? ""
169
+ src: y[0].logo,
170
+ alt: y[0].airline,
171
+ onError: (i) => i.currentTarget.src = (C == null ? void 0 : C.logoFallbackImageUrl) ?? ""
176
172
  }
177
173
  ),
178
174
  /* @__PURE__ */ n("div", { children: [
179
175
  /* @__PURE__ */ n("p", { children: [
180
- u[0].airline,
181
- u.length > 1 && /* @__PURE__ */ n("sup", { className: "multiple-airlines", children: [
176
+ y[0].airline,
177
+ y.length > 1 && /* @__PURE__ */ n("sup", { className: "multiple-airlines", children: [
182
178
  "+",
183
- u.length - 1
179
+ y.length - 1
184
180
  ] })
185
181
  ] }),
186
- /* @__PURE__ */ r("p", { children: ye[0] })
182
+ /* @__PURE__ */ r("p", { children: de[0] })
187
183
  ] })
188
184
  ] }),
189
185
  /* @__PURE__ */ n("div", { className: "flight-times", children: [
190
186
  /* @__PURE__ */ n("div", { className: "flight-duration", children: [
191
- /* @__PURE__ */ r(ee, {}),
192
- /* @__PURE__ */ r("p", { children: Z(v.slices[0].duration) })
187
+ /* @__PURE__ */ r(W, {}),
188
+ /* @__PURE__ */ r("p", { children: X(P.slices[0].duration) })
193
189
  ] }),
194
- /* @__PURE__ */ r("p", { children: e.numberOfStops > 0 ? `${e.numberOfStops} ${J(
190
+ /* @__PURE__ */ r("p", { children: e.numberOfStops > 0 ? `${e.numberOfStops} ${w(
195
191
  e.numberOfStops,
196
192
  "Stop"
197
193
  )}` : "Direct" })
@@ -199,106 +195,100 @@ const ri = ({
199
195
  ] }),
200
196
  /* @__PURE__ */ n("div", { className: "flight-info-content", children: [
201
197
  /* @__PURE__ */ n("div", { className: "flight-info-times", children: [
198
+ /* @__PURE__ */ r("p", { className: "flight-info-date", children: g(e.departureTime).format(
199
+ N(T.DISPLAY_MEDIUM)
200
+ ) }),
202
201
  /* @__PURE__ */ n("p", { className: "flight-info-time", children: [
203
- y(e.departureTime).format(
204
- D(W.TIME_ONLY)
202
+ g(e.departureTime).format(
203
+ N(T.TIME_ONLY)
205
204
  ),
206
205
  " "
207
206
  ] }),
208
207
  /* @__PURE__ */ n("div", { className: "flight-location", children: [
209
208
  /* @__PURE__ */ r("div", { className: "flight-location-icon", children: /* @__PURE__ */ r(_e, {}) }),
210
- /* @__PURE__ */ r("p", { children: C.airportCode })
209
+ /* @__PURE__ */ r("p", { children: pe.airportCode })
211
210
  ] })
212
211
  ] }),
213
212
  /* @__PURE__ */ n("div", { className: "flight-icon", children: [
214
- /* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(Ie, {}) }),
213
+ /* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(Se, {}) }),
215
214
  /* @__PURE__ */ n("div", { className: "flight-times", children: [
216
215
  /* @__PURE__ */ n("div", { className: "flight-duration", children: [
217
- /* @__PURE__ */ r(ee, {}),
218
- /* @__PURE__ */ r("p", { children: Z(v.slices[0].duration) })
216
+ /* @__PURE__ */ r(W, {}),
217
+ /* @__PURE__ */ r("p", { children: X(P.slices[0].duration) })
219
218
  ] }),
220
- /* @__PURE__ */ r("p", { children: e.numberOfStops > 0 ? `${e.numberOfStops} ${J(
219
+ /* @__PURE__ */ r("p", { children: e.numberOfStops > 0 ? `${e.numberOfStops} ${w(
221
220
  e.numberOfStops,
222
221
  "Stop"
223
222
  )}` : "Direct" })
224
223
  ] }),
225
224
  /* @__PURE__ */ r(
226
- re,
225
+ ee,
227
226
  {
228
227
  title: "Flight Details",
229
- trigger: /* @__PURE__ */ r("p", { className: "view-flight-details", children: "View Flight Details" }),
230
- children: /* @__PURE__ */ r(
231
- B,
232
- {
233
- itinerary: v.slices[0].segments,
234
- origin: C,
235
- destination: S,
236
- isMultiDayFlight: Q
237
- }
238
- )
228
+ trigger: /* @__PURE__ */ r("p", { className: "view-flight-details", children: "Flight Details" }),
229
+ children: /* @__PURE__ */ r(Z, { itinerary: P.slices[0].segments })
239
230
  }
240
231
  )
241
232
  ] }),
242
233
  /* @__PURE__ */ n("div", { className: "flight-info-times", children: [
234
+ /* @__PURE__ */ r("p", { className: "flight-info-date", children: g(e.arrivalTime).format(
235
+ N(T.DISPLAY_MEDIUM)
236
+ ) }),
243
237
  /* @__PURE__ */ n("p", { className: "flight-info-time", children: [
244
- y(e.arrivalTime).format(
245
- D(W.TIME_ONLY)
238
+ g(e.arrivalTime).format(
239
+ N(T.TIME_ONLY)
246
240
  ),
247
241
  " "
248
242
  ] }),
249
243
  /* @__PURE__ */ n("div", { className: "flight-location", children: [
250
- /* @__PURE__ */ r("p", { children: S.airportCode }),
251
- /* @__PURE__ */ r("div", { className: "flight-location-icon", children: /* @__PURE__ */ r(Re, {}) })
244
+ /* @__PURE__ */ r("p", { children: he.airportCode }),
245
+ /* @__PURE__ */ r("div", { className: "flight-location-icon", children: /* @__PURE__ */ r(Ie, {}) })
252
246
  ] })
253
247
  ] })
254
248
  ] })
255
249
  ] }),
256
250
  /* @__PURE__ */ n("div", { className: "flight-footer", children: [
257
251
  /* @__PURE__ */ r(
258
- re,
252
+ ee,
259
253
  {
260
254
  title: "Flight Details",
261
255
  trigger: /* @__PURE__ */ r("p", { className: "view-flight-details", children: "View Flight Details" }),
262
- children: /* @__PURE__ */ r(
263
- B,
264
- {
265
- itinerary: v.slices[0].segments,
266
- origin: C,
267
- destination: S,
268
- isMultiDayFlight: Q
269
- }
270
- )
256
+ children: /* @__PURE__ */ r(Z, { itinerary: P.slices[0].segments })
271
257
  }
272
258
  ),
273
- /* @__PURE__ */ r("div", { className: "booking-options", children: pe ? /* @__PURE__ */ n("div", { className: "offer-expiry", children: [
274
- /* @__PURE__ */ r("span", { children: /* @__PURE__ */ r($, {}) }),
259
+ /* @__PURE__ */ r("div", { className: "booking-options", children: oe ? /* @__PURE__ */ n("div", { className: "offer-expiry", children: [
260
+ /* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(x, {}) }),
275
261
  /* @__PURE__ */ r("p", { className: "expired-tip", children: "Offer Expired" })
276
- ] }) : /* @__PURE__ */ n(k, { children: [
277
- ce || e.cash > 0 && /* @__PURE__ */ n(
262
+ ] }) : /* @__PURE__ */ n(L, { children: [
263
+ ae || e.cash > 0 && /* @__PURE__ */ n(
278
264
  "div",
279
265
  {
280
- className: `amount-value ${N === "cash" && c ? "show-best-value-flag" : ""}`,
266
+ className: xe(
267
+ "amount-value",
268
+ F === "cash" && l ? "show-best-value-flag" : "",
269
+ p.amountsDisplayFeature !== u.CASH_AND_TRAVEL_PARTNER_POINTS ? "lg" : ""
270
+ ),
281
271
  onClick: (i) => {
282
- z(i, f.CASH, e);
272
+ z(i, d.CASH, e);
283
273
  },
284
274
  children: [
285
- h.amountsDisplayFeature === P.CASH_AND_TRAVEL_PARTNER_POINTS && /* @__PURE__ */ r("b", { children: "Cash" }),
275
+ p.amountsDisplayFeature === u.CASH_AND_TRAVEL_PARTNER_POINTS ? /* @__PURE__ */ r("b", { children: "Cash" }) : /* @__PURE__ */ r("b", { children: $ ? "Book For" : "From" }),
286
276
  /* @__PURE__ */ n("div", { children: [
287
- /* @__PURE__ */ r("label", { children: ge ? "Book For" : "From" }),
277
+ p.amountsDisplayFeature === u.CASH_AND_TRAVEL_PARTNER_POINTS && /* @__PURE__ */ r("label", { children: $ ? "Book For" : "From" }),
288
278
  /* @__PURE__ */ n("span", { className: "flight-cash-amount-value", children: [
289
279
  /* @__PURE__ */ r(
290
- j,
280
+ Q,
291
281
  {
292
282
  amount: e.cash,
293
283
  currency: e.currency,
294
- position: w.LEFT
284
+ position: j.LEFT
295
285
  }
296
286
  ),
297
- h.amountsDisplayFeature === P.CASH_AND_CLIENT_POINTS && /* @__PURE__ */ n(k, { children: [
287
+ p.amountsDisplayFeature === u.CASH_AND_CLIENT_POINTS && /* @__PURE__ */ n(L, { children: [
298
288
  "/",
299
289
  " ",
300
290
  /* @__PURE__ */ r(
301
- Te,
291
+ Ee,
302
292
  {
303
293
  currency: e.currency,
304
294
  cashAmount: e.cash
@@ -307,62 +297,62 @@ const ri = ({
307
297
  ] })
308
298
  ] })
309
299
  ] }),
310
- N === "cash" && h.amountsDisplayFeature === P.CASH_AND_TRAVEL_PARTNER_POINTS && c && /* @__PURE__ */ n(
300
+ F === "cash" && p.amountsDisplayFeature === u.CASH_AND_TRAVEL_PARTNER_POINTS && l && /* @__PURE__ */ n(
311
301
  "div",
312
302
  {
313
303
  className: "best-value-flag tip",
314
304
  onClick: (i) => {
315
- i.stopPropagation(), a == null || a(e);
305
+ i.stopPropagation(), t == null || t(e);
316
306
  },
317
307
  children: [
318
- a && /* @__PURE__ */ r($, {}),
308
+ t && /* @__PURE__ */ r(x, {}),
319
309
  /* @__PURE__ */ r("p", { children: "Best Value" }),
320
- a && /* @__PURE__ */ r("span", { children: "Click to learn more" })
310
+ t && /* @__PURE__ */ r("span", { children: "Click to learn more" })
321
311
  ]
322
312
  }
323
313
  )
324
314
  ]
325
315
  }
326
316
  ),
327
- oe || e.points > 0 && h.amountsDisplayFeature === P.CASH_AND_TRAVEL_PARTNER_POINTS && /* @__PURE__ */ n(
317
+ te || e.points > 0 && p.amountsDisplayFeature === u.CASH_AND_TRAVEL_PARTNER_POINTS && /* @__PURE__ */ n(
328
318
  "div",
329
319
  {
330
- className: `amount-value ${N === "points" && c ? "show-best-value-flag" : ""}`,
320
+ className: `amount-value ${F === "points" && l ? "show-best-value-flag" : ""}`,
331
321
  onClick: (i) => {
332
- z(i, f.POINTS, e);
322
+ z(i, d.POINTS, e);
333
323
  },
334
324
  children: [
335
- N === "points" && c && /* @__PURE__ */ n(
325
+ F === "points" && l && /* @__PURE__ */ n(
336
326
  "div",
337
327
  {
338
328
  className: "best-value-flag tip",
339
329
  onClick: (i) => {
340
- i.stopPropagation(), a == null || a(e);
330
+ i.stopPropagation(), t == null || t(e);
341
331
  },
342
332
  children: [
343
- a && /* @__PURE__ */ r($, {}),
333
+ t && /* @__PURE__ */ r(x, {}),
344
334
  /* @__PURE__ */ r("p", { children: "Best Value" }),
345
- a && /* @__PURE__ */ r("span", { children: "Click to learn more" })
335
+ t && /* @__PURE__ */ r("span", { children: "Click to learn more" })
346
336
  ]
347
337
  }
348
338
  ),
349
- /* @__PURE__ */ r("div", { className: "amount-airline-logo", children: /* @__PURE__ */ r("img", { src: ue.programLogo }) }),
339
+ /* @__PURE__ */ r("div", { className: "amount-airline-logo", children: /* @__PURE__ */ r("img", { src: fe.programLogo }) }),
350
340
  /* @__PURE__ */ n("div", { children: [
351
- /* @__PURE__ */ r("label", { children: fe ? "Book For" : "From" }),
341
+ /* @__PURE__ */ r("label", { children: ge ? "Book For" : "From" }),
352
342
  /* @__PURE__ */ n("p", { children: [
353
- `${Ae(
354
- p.points
355
- )} ${D("miles")}`,
356
- !!p.cashFee && /* @__PURE__ */ n(k, { children: [
343
+ `${Oe(
344
+ c == null ? void 0 : c.points
345
+ )} ${N("miles")}`,
346
+ !!(c != null && c.cashFee) && /* @__PURE__ */ n(L, { children: [
357
347
  " + ",
358
348
  /* @__PURE__ */ r(
359
- j,
349
+ Q,
360
350
  {
361
- amount: p.cashFee.amount,
362
- currency: p.cashFee.currency,
351
+ amount: c.cashFee.amount,
352
+ currency: c.cashFee.currency,
363
353
  customDisplay: "No fee",
364
- zeroDisplayOption: Oe.CUSTOM,
365
- position: w.LEFT
354
+ zeroDisplayOption: Te.CUSTOM,
355
+ position: j.LEFT
366
356
  }
367
357
  )
368
358
  ] })
@@ -375,11 +365,11 @@ const ri = ({
375
365
  ] }),
376
366
  /* @__PURE__ */ r("div", { className: `flight-details ${U ? "is-open" : ""}`, children: /* @__PURE__ */ r("div", { ref: b, className: "inner", children: /* @__PURE__ */ n("div", { className: "flight-booking-options", children: [
377
367
  _.length > 0 && /* @__PURE__ */ n("div", { className: "booking-options-section", children: [
378
- I.length > 0 && /* @__PURE__ */ r("p", { className: "booking-options-title", children: "Cash Options" }),
379
- /* @__PURE__ */ r(ne, { children: _.map((i, s) => /* @__PURE__ */ r(
380
- X,
368
+ S.length > 0 && /* @__PURE__ */ r("p", { className: "booking-options-title", children: "Cash Options" }),
369
+ /* @__PURE__ */ r(ie, { children: _.map((i, s) => /* @__PURE__ */ r(
370
+ J,
381
371
  {
382
- type: f.CASH,
372
+ type: d.CASH,
383
373
  title: i.fareBrandName,
384
374
  cashValue: {
385
375
  amount: i.cash,
@@ -388,7 +378,7 @@ const ri = ({
388
378
  milesValue: void 0,
389
379
  cashFee: i.cashFee,
390
380
  setSelected: () => {
391
- T == null || T(i, e);
381
+ D == null || D(i, e);
392
382
  },
393
383
  conditions: i.conditions,
394
384
  slices: e.flightDetails.slices,
@@ -397,12 +387,12 @@ const ri = ({
397
387
  `cash-${s}`
398
388
  )) })
399
389
  ] }),
400
- I.length > 0 && /* @__PURE__ */ n("div", { className: "booking-options-section", children: [
390
+ S.length > 0 && /* @__PURE__ */ n("div", { className: "booking-options-section", children: [
401
391
  _.length > 0 && /* @__PURE__ */ r("p", { className: "booking-options-title", children: "Miles Options" }),
402
- /* @__PURE__ */ r(ne, { children: I.map((i, s) => /* @__PURE__ */ r(
403
- X,
392
+ /* @__PURE__ */ r(ie, { children: S.map((i, s) => /* @__PURE__ */ r(
393
+ J,
404
394
  {
405
- type: f.POINTS,
395
+ type: d.POINTS,
406
396
  title: i.fareBrandName,
407
397
  cashValue: void 0,
408
398
  milesValue: i.points,
@@ -424,5 +414,5 @@ const ri = ({
424
414
  );
425
415
  };
426
416
  export {
427
- ri as FlightResult
417
+ Be as FlightResult
428
418
  };
@@ -1,8 +1,8 @@
1
1
  import { jsxs as L, jsx as o } from "react/jsx-runtime";
2
2
  import { useRef as C, useState as n, useEffect as A } from "react";
3
- import { e as E, f as R } from "../../index-D8ljJLcr.js";
3
+ import { F as E, a as R } from "../../index-9LVJi5JO.js";
4
4
  import '../../assets/_styles2.css';/* empty css */
5
- const N = ({
5
+ const F = ({
6
6
  children: i,
7
7
  className: d = ""
8
8
  }) => {
@@ -71,5 +71,5 @@ const N = ({
71
71
  );
72
72
  };
73
73
  export {
74
- N as default
74
+ F as default
75
75
  };