@odynn/awayz-flights 0.10.1 → 0.10.2
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.
|
@@ -8,10 +8,10 @@ import '../../assets/MiniFlightItinerary.css';const I = ({
|
|
|
8
8
|
flightDetails: A
|
|
9
9
|
}) => {
|
|
10
10
|
const a = A.flightDetails.slices[0].segments, T = y(() => {
|
|
11
|
-
var t, l,
|
|
11
|
+
var t, l, d, n, m, h, g, u;
|
|
12
12
|
const i = [];
|
|
13
|
-
for (let
|
|
14
|
-
const r = a[
|
|
13
|
+
for (let c = 0; c < a.length; c++) {
|
|
14
|
+
const r = a[c], s = a[c + 1], L = v({
|
|
15
15
|
departureAt: r.departingAt,
|
|
16
16
|
departureTimeZone: r.origin.timeZone,
|
|
17
17
|
arrivalAt: r.arrivingAt,
|
|
@@ -23,45 +23,45 @@ import '../../assets/MiniFlightItinerary.css';const I = ({
|
|
|
23
23
|
airport: (l = r.origin) == null ? void 0 : l.name
|
|
24
24
|
},
|
|
25
25
|
arrival: {
|
|
26
|
-
code: (
|
|
27
|
-
airport: (
|
|
26
|
+
code: (d = r.destination) == null ? void 0 : d.iataCode,
|
|
27
|
+
airport: (n = r.destination) == null ? void 0 : n.name
|
|
28
28
|
},
|
|
29
29
|
time: L
|
|
30
|
-
}), !
|
|
30
|
+
}), !s)
|
|
31
31
|
break;
|
|
32
32
|
const Z = v({
|
|
33
33
|
departureAt: r.arrivingAt,
|
|
34
34
|
departureTimeZone: r.destination.timeZone,
|
|
35
|
-
arrivalAt:
|
|
36
|
-
arrivalTimeZone:
|
|
35
|
+
arrivalAt: s.departingAt,
|
|
36
|
+
arrivalTimeZone: s.origin.timeZone
|
|
37
37
|
});
|
|
38
38
|
i.push({
|
|
39
39
|
departure: {
|
|
40
|
-
code: (
|
|
40
|
+
code: (m = r.destination) == null ? void 0 : m.iataCode,
|
|
41
41
|
airport: (h = r.destination) == null ? void 0 : h.name
|
|
42
42
|
},
|
|
43
43
|
arrival: {
|
|
44
|
-
code: (g =
|
|
45
|
-
airport: (u =
|
|
44
|
+
code: (g = s.origin) == null ? void 0 : g.iataCode,
|
|
45
|
+
airport: (u = s.origin) == null ? void 0 : u.name
|
|
46
46
|
},
|
|
47
47
|
time: Z,
|
|
48
48
|
isLayover: !0
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
return i;
|
|
52
|
-
}, [a]),
|
|
53
|
-
var t, l;
|
|
52
|
+
}, [a]), p = y(() => {
|
|
53
|
+
var t, l, d;
|
|
54
54
|
const i = [];
|
|
55
55
|
for (let n = 0; n < a.length; n++) {
|
|
56
|
-
const
|
|
57
|
-
i.push(((t =
|
|
56
|
+
const m = a[n];
|
|
57
|
+
i.push(((t = m.origin) == null ? void 0 : t.iataCode) ?? "");
|
|
58
58
|
}
|
|
59
|
-
return i.push(((l = a.getLast().destination) == null ? void 0 :
|
|
59
|
+
return i.push(((d = (l = a.getLast()) == null ? void 0 : l.destination) == null ? void 0 : d.iataCode) ?? ""), i;
|
|
60
60
|
}, [a]);
|
|
61
61
|
return /* @__PURE__ */ o(b, { children: [
|
|
62
|
-
/* @__PURE__ */ e("div", { className: "mobile-mini-flight-itinerary", children:
|
|
62
|
+
/* @__PURE__ */ e("div", { className: "mobile-mini-flight-itinerary", children: p.map((i, t) => /* @__PURE__ */ o("div", { children: [
|
|
63
63
|
/* @__PURE__ */ e("p", { children: i }),
|
|
64
|
-
t <
|
|
64
|
+
t < p.length - 1 && /* @__PURE__ */ e(D, {})
|
|
65
65
|
] }, t)) }),
|
|
66
66
|
/* @__PURE__ */ e("div", { className: "mini-flight-itinerary", children: T.map(
|
|
67
67
|
(i, t) => i.isLayover ? /* @__PURE__ */ o("div", { className: "layover tip", children: [
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { defaultAwayzConfig as
|
|
2
|
-
import { d as
|
|
1
|
+
import { defaultAwayzConfig as Y, awayzClient as Q } from "@odynn/awayz-core";
|
|
2
|
+
import { d as H } from "../dateUtils-Cb9VQiIL.js";
|
|
3
3
|
import "../arrayExtensions-Ce8YopTP.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { h as
|
|
6
|
-
import { EFlightEndpoint as
|
|
7
|
-
import { mapBaggageType as
|
|
8
|
-
import { WalletService as
|
|
9
|
-
import { ERewardProgramCategories as
|
|
10
|
-
const
|
|
11
|
-
var
|
|
12
|
-
const i =
|
|
5
|
+
import { h as y } from "../moment-BGjjqtLQ.js";
|
|
6
|
+
import { EFlightEndpoint as W } from "../constants/endpoints.js";
|
|
7
|
+
import { mapBaggageType as J } from "../hooks/useFlightSearch/useFlightSearch.types.js";
|
|
8
|
+
import { WalletService as V } from "../services/wallet/WalletService.js";
|
|
9
|
+
import { ERewardProgramCategories as X } from "../services/wallet/WalletService.types.js";
|
|
10
|
+
const f = "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/", ue = (t) => t == null ? void 0 : t.map((e) => {
|
|
11
|
+
var d, o, c, s, a, u, l, n, r, m, p, g, b, F, A, w, L, D, I, P, T, h, k, O, R, _, v, E, M, $, z, G, Z, S, U, N;
|
|
12
|
+
const i = se(e);
|
|
13
13
|
return {
|
|
14
14
|
id: e.id,
|
|
15
15
|
points: (e == null ? void 0 : e.points) >= 0 ? e.points : -1,
|
|
16
16
|
partial: e == null ? void 0 : e.partial,
|
|
17
17
|
origin: {
|
|
18
|
-
city: ((
|
|
19
|
-
country: ((s = e.slices[0].segments[0].origin) == null ? void 0 : s.iataCountryCode) || ((
|
|
20
|
-
airportCode: ((
|
|
18
|
+
city: ((d = e.slices[0].segments[0].origin) == null ? void 0 : d.cityName) || ((c = (o = e.slices[0].segments[0].origin) == null ? void 0 : o.city) == null ? void 0 : c.name) || "",
|
|
19
|
+
country: ((s = e.slices[0].segments[0].origin) == null ? void 0 : s.iataCountryCode) || ((u = (a = e.slices[0].segments[0].origin) == null ? void 0 : a.city) == null ? void 0 : u.iataCountryCode) || "",
|
|
20
|
+
airportCode: ((l = e.slices[0].segments[0].origin) == null ? void 0 : l.iataCode) || ((r = (n = e.slices[0].segments[0].origin) == null ? void 0 : n.city) == null ? void 0 : r.iataCode) || "",
|
|
21
21
|
coordinates: {
|
|
22
|
-
latitude: (
|
|
23
|
-
longitude: (b = (
|
|
22
|
+
latitude: ((p = (m = e.slices[0].segments[0].origin) == null ? void 0 : m.city) == null ? void 0 : p.latitude) || 0,
|
|
23
|
+
longitude: ((b = (g = e.slices[0].segments[0].origin) == null ? void 0 : g.city) == null ? void 0 : b.longitude) || 0
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
destination: {
|
|
27
|
-
city: ((A = (F = e.slices[0].segments.getLast()) == null ? void 0 : F.destination) == null ? void 0 : A.cityName) || ((D = (L = (w = e.slices[0].segments.getLast()) == null ? void 0 : w.destination) == null ? void 0 : L.city) == null ? void 0 : D.name),
|
|
28
|
-
country: ((P = (I = e.slices[0].segments.getLast()) == null ? void 0 : I.destination) == null ? void 0 : P.iataCountryCode) || ((k = (h = (T = e.slices[0].segments.getLast()) == null ? void 0 : T.destination) == null ? void 0 : h.city) == null ? void 0 : k.iataCountryCode),
|
|
29
|
-
airportCode: ((R = (O = e.slices[0].segments.getLast()) == null ? void 0 : O.destination) == null ? void 0 : R.iataCode) || ((E = (v = (_ = e.slices[0].segments.getLast()) == null ? void 0 : _.destination) == null ? void 0 : v.city) == null ? void 0 : E.iataCode),
|
|
27
|
+
city: ((A = (F = e.slices[0].segments.getLast()) == null ? void 0 : F.destination) == null ? void 0 : A.cityName) || ((D = (L = (w = e.slices[0].segments.getLast()) == null ? void 0 : w.destination) == null ? void 0 : L.city) == null ? void 0 : D.name) || "",
|
|
28
|
+
country: ((P = (I = e.slices[0].segments.getLast()) == null ? void 0 : I.destination) == null ? void 0 : P.iataCountryCode) || ((k = (h = (T = e.slices[0].segments.getLast()) == null ? void 0 : T.destination) == null ? void 0 : h.city) == null ? void 0 : k.iataCountryCode) || "",
|
|
29
|
+
airportCode: ((R = (O = e.slices[0].segments.getLast()) == null ? void 0 : O.destination) == null ? void 0 : R.iataCode) || ((E = (v = (_ = e.slices[0].segments.getLast()) == null ? void 0 : _.destination) == null ? void 0 : v.city) == null ? void 0 : E.iataCode) || "",
|
|
30
30
|
coordinates: {
|
|
31
|
-
latitude: (z = ($ = (M = e.slices[0].segments.getLast()) == null ? void 0 : M.destination) == null ? void 0 : $.city) == null ? void 0 : z.latitude,
|
|
32
|
-
longitude: (S = (Z = (G = e.slices[0].segments.getLast()) == null ? void 0 : G.destination) == null ? void 0 : Z.city) == null ? void 0 : S.longitude
|
|
31
|
+
latitude: ((z = ($ = (M = e.slices[0].segments.getLast()) == null ? void 0 : M.destination) == null ? void 0 : $.city) == null ? void 0 : z.latitude) || 0,
|
|
32
|
+
longitude: ((S = (Z = (G = e.slices[0].segments.getLast()) == null ? void 0 : G.destination) == null ? void 0 : Z.city) == null ? void 0 : S.longitude) || 0
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
// `airline` is an existing unqualified field; semantics are display-primary carrier.
|
|
@@ -38,10 +38,10 @@ const V = "https://assets.duffel.com/img/airlines/for-light-background/full-colo
|
|
|
38
38
|
displayAirlineIataCode: (i == null ? void 0 : i.iataCode) ?? "",
|
|
39
39
|
cash: e.totalAmount ? parseFloat(e.totalAmount) : 0,
|
|
40
40
|
currency: e.baseCurrency,
|
|
41
|
-
flightNumber:
|
|
41
|
+
flightNumber: K(e.slices[0].segments[0]),
|
|
42
42
|
awayzGroupId: e.slices[0].comparisonKey || e.awayzRouteId || e.awayzGroupId || e.id,
|
|
43
|
-
departureTime:
|
|
44
|
-
arrivalTime:
|
|
43
|
+
departureTime: y(e.slices[0].segments[0].departingAt).toDate(),
|
|
44
|
+
arrivalTime: y(
|
|
45
45
|
e.slices[0].segments[e.slices[0].segments.length - 1].arrivingAt
|
|
46
46
|
).toDate(),
|
|
47
47
|
numberOfStops: e.slices[0].segments.length - 1,
|
|
@@ -49,11 +49,11 @@ const V = "https://assets.duffel.com/img/airlines/for-light-background/full-colo
|
|
|
49
49
|
duration: e.slices[0].duration,
|
|
50
50
|
airlineProgram: e.airlineProgram,
|
|
51
51
|
paymentOptions: [],
|
|
52
|
-
durationMinutes:
|
|
53
|
-
departureTime:
|
|
54
|
-
arrivalTime:
|
|
52
|
+
durationMinutes: H({
|
|
53
|
+
departureTime: y(e.slices[0].segments[0].departingAt),
|
|
54
|
+
arrivalTime: y((U = e.slices[0].segments.getLast()) == null ? void 0 : U.arrivingAt),
|
|
55
55
|
originTimeZone: e.slices[0].segments[0].origin.timeZone,
|
|
56
|
-
destinationTimeZone: e.slices[0].segments.getLast().destination.timeZone,
|
|
56
|
+
destinationTimeZone: (N = e.slices[0].segments.getLast()) == null ? void 0 : N.destination.timeZone,
|
|
57
57
|
duration: e.slices[0].duration
|
|
58
58
|
}),
|
|
59
59
|
cashFee: e.cashFee,
|
|
@@ -61,74 +61,75 @@ const V = "https://assets.duffel.com/img/airlines/for-light-background/full-colo
|
|
|
61
61
|
expiresAt: e.expiresAt,
|
|
62
62
|
transferPartners: e.partners
|
|
63
63
|
};
|
|
64
|
-
}),
|
|
64
|
+
}), K = (t) => {
|
|
65
65
|
const e = t.marketingCarrier ?? t.operatingCarrier, i = t.marketingCarrierFlightNumber ?? t.operatingCarrierFlightNumber;
|
|
66
|
-
return e.iataCode + " " +
|
|
67
|
-
},
|
|
66
|
+
return e.iataCode + " " + ae(i);
|
|
67
|
+
}, ee = (t) => {
|
|
68
68
|
var i;
|
|
69
69
|
const e = (i = t == null ? void 0 : t.segments) == null ? void 0 : i[0];
|
|
70
70
|
return (e == null ? void 0 : e.marketingCarrier) ?? (e == null ? void 0 : e.operatingCarrier);
|
|
71
|
-
},
|
|
71
|
+
}, se = (t) => {
|
|
72
72
|
var e;
|
|
73
|
-
return
|
|
74
|
-
},
|
|
73
|
+
return ee((e = t == null ? void 0 : t.slices) == null ? void 0 : e[0]);
|
|
74
|
+
}, ge = (t) => !t.operatingCarrier || !t.marketingCarrier ? "" : t.operatingCarrier.iataCode !== t.marketingCarrier.iataCode ? t.operatingCarrier.name : "", ye = ({
|
|
75
75
|
originCode: t,
|
|
76
76
|
destinationCode: e,
|
|
77
77
|
dates: i,
|
|
78
|
-
cabinClass:
|
|
78
|
+
cabinClass: d,
|
|
79
79
|
passengerCount: o,
|
|
80
80
|
paymentType: c
|
|
81
81
|
}) => {
|
|
82
|
-
let s = `${
|
|
83
|
-
return s += `origin=${t}`, s += `&destination=${e}`, s += `&departure_dates=[${i.map((a) => `"${a}"`).join(",")}]`, s += `&cabin_class=${
|
|
84
|
-
},
|
|
82
|
+
let s = `${W.CASH_POINTS_FLIGHT_SEARCH}?`;
|
|
83
|
+
return s += `origin=${t}`, s += `&destination=${e}`, s += `&departure_dates=[${i.map((a) => `"${a}"`).join(",")}]`, s += `&cabin_class=${d}`, s += `&adults=${o}`, s += `&cash_or_points=[${c}]`, s;
|
|
84
|
+
}, te = (t) => t.flightDetails.slices[0].segments.map((i) => K(i)).join("_") + "_" + y(t.departureTime).format("YYYYMMDD"), Ce = (t) => t ? t.replace(/[_-]/g, " ").split(" ").map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" ") : "", be = (t) => {
|
|
85
85
|
const e = {};
|
|
86
86
|
t.forEach((s) => {
|
|
87
|
-
|
|
87
|
+
var u, l;
|
|
88
|
+
const a = te(s);
|
|
88
89
|
if (e[a]) {
|
|
89
|
-
const
|
|
90
|
-
e[a].flight.paymentOptions.push(
|
|
91
|
-
const { lowestCash:
|
|
92
|
-
e[a].flight.points = p, e[a].flight.cashFee =
|
|
90
|
+
const n = j(s);
|
|
91
|
+
e[a].flight.paymentOptions.push(n);
|
|
92
|
+
const { lowestCash: r, currency: m, lowestPoints: p, cashFee: g } = q(e[a].flight.paymentOptions);
|
|
93
|
+
e[a].flight.points = p, e[a].flight.cashFee = g, e[a].flight.cash = r, m && (e[a].flight.currency = m);
|
|
93
94
|
} else {
|
|
94
|
-
const { origin:
|
|
95
|
+
const { origin: n, destination: r } = s, m = [j(s)], p = q(m);
|
|
95
96
|
e[a] = {
|
|
96
97
|
programs: [],
|
|
97
98
|
flight: {
|
|
98
99
|
id: s.awayzGroupId,
|
|
99
100
|
partial: s.partial,
|
|
100
101
|
origin: {
|
|
101
|
-
city: l.city,
|
|
102
|
-
country: l.country,
|
|
103
|
-
airportCode: l.airportCode,
|
|
104
|
-
coordinates: l.coordinates
|
|
105
|
-
},
|
|
106
|
-
destination: {
|
|
107
102
|
city: n.city,
|
|
108
103
|
country: n.country,
|
|
109
104
|
airportCode: n.airportCode,
|
|
110
105
|
coordinates: n.coordinates
|
|
111
106
|
},
|
|
107
|
+
destination: {
|
|
108
|
+
city: r.city,
|
|
109
|
+
country: r.country,
|
|
110
|
+
airportCode: r.airportCode,
|
|
111
|
+
coordinates: r.coordinates
|
|
112
|
+
},
|
|
112
113
|
airline: s.airline,
|
|
113
114
|
airlineLogo: s.airlineLogo,
|
|
114
115
|
displayAirlineIataCode: s.displayAirlineIataCode,
|
|
115
116
|
flightNumber: s.flightNumber,
|
|
116
|
-
paymentOptions:
|
|
117
|
+
paymentOptions: m,
|
|
117
118
|
numberOfStops: s.numberOfStops,
|
|
118
119
|
departureTime: s.departureTime,
|
|
119
120
|
arrivalTime: s.arrivalTime,
|
|
120
121
|
awayzGroupId: a,
|
|
121
122
|
duration: s.duration,
|
|
122
123
|
airlineProgram: s.airlineProgram,
|
|
123
|
-
durationMinutes:
|
|
124
|
-
departureTime:
|
|
124
|
+
durationMinutes: H({
|
|
125
|
+
departureTime: y(
|
|
125
126
|
s.flightDetails.slices[0].segments[0].departingAt
|
|
126
127
|
),
|
|
127
|
-
arrivalTime:
|
|
128
|
-
s.flightDetails.slices[0].segments.getLast().arrivingAt
|
|
128
|
+
arrivalTime: y(
|
|
129
|
+
(u = s.flightDetails.slices[0].segments.getLast()) == null ? void 0 : u.arrivingAt
|
|
129
130
|
),
|
|
130
131
|
originTimeZone: s.flightDetails.slices[0].segments[0].origin.timeZone,
|
|
131
|
-
destinationTimeZone: s.flightDetails.slices[0].segments.getLast().destination.timeZone,
|
|
132
|
+
destinationTimeZone: (l = s.flightDetails.slices[0].segments.getLast()) == null ? void 0 : l.destination.timeZone,
|
|
132
133
|
duration: s.flightDetails.slices[0].duration
|
|
133
134
|
}),
|
|
134
135
|
cash: p.lowestCash,
|
|
@@ -146,80 +147,80 @@ const V = "https://assets.duffel.com/img/airlines/for-light-background/full-colo
|
|
|
146
147
|
});
|
|
147
148
|
const i = [];
|
|
148
149
|
Object.values(e).forEach((s) => {
|
|
149
|
-
const a = s.flight.paymentOptions.filter((
|
|
150
|
-
(
|
|
150
|
+
const a = s.flight.paymentOptions.filter((n) => n.cash > 0).reduce(
|
|
151
|
+
(n, r) => r.cash < n.cash ? r : n,
|
|
151
152
|
{ cash: 1 / 0, carrier: { name: "", iataCode: "" } }
|
|
152
|
-
),
|
|
153
|
+
), u = {
|
|
153
154
|
iataCode: s.flight.displayAirlineIataCode,
|
|
154
155
|
name: s.flight.airline
|
|
155
|
-
},
|
|
156
|
-
s.programs.length > 0 ? s.programs.forEach((
|
|
157
|
-
const
|
|
158
|
-
(
|
|
159
|
-
),
|
|
156
|
+
}, l = a.cash !== 1 / 0 ? a.carrier : u;
|
|
157
|
+
s.programs.length > 0 ? s.programs.forEach((n) => {
|
|
158
|
+
const r = s.flight.paymentOptions.filter(
|
|
159
|
+
(p) => p.program === n && p.points > 0
|
|
160
|
+
), m = r.length > 0 ? Math.min(...r.map((p) => p.points)) : -1;
|
|
160
161
|
i.push({
|
|
161
162
|
...s.flight,
|
|
162
|
-
airline:
|
|
163
|
-
airlineLogo: C(
|
|
164
|
-
displayAirlineIataCode:
|
|
165
|
-
airlineProgram:
|
|
163
|
+
airline: l.name,
|
|
164
|
+
airlineLogo: C(l.iataCode),
|
|
165
|
+
displayAirlineIataCode: l.iataCode,
|
|
166
|
+
airlineProgram: n,
|
|
166
167
|
cash: a.cash !== 1 / 0 ? a.cash : -1,
|
|
167
|
-
points:
|
|
168
|
+
points: m
|
|
168
169
|
});
|
|
169
170
|
}) : i.push({
|
|
170
171
|
...s.flight,
|
|
171
|
-
airline:
|
|
172
|
-
airlineLogo: C(
|
|
173
|
-
displayAirlineIataCode:
|
|
172
|
+
airline: l.name,
|
|
173
|
+
airlineLogo: C(l.iataCode),
|
|
174
|
+
displayAirlineIataCode: l.iataCode,
|
|
174
175
|
cash: a.cash !== 1 / 0 ? a.cash : -1
|
|
175
176
|
});
|
|
176
177
|
});
|
|
177
|
-
const { cashlessResults:
|
|
178
|
+
const { cashlessResults: d, otherResults: o } = i.reduce(
|
|
178
179
|
(s, a) => (a.cash <= 0 && a.points > 0 ? s.cashlessResults.push(a) : a.cash > 0 && s.otherResults.push(a), s),
|
|
179
180
|
{ cashlessResults: [], otherResults: [] }
|
|
180
181
|
), c = [...o];
|
|
181
|
-
return
|
|
182
|
+
return d.forEach((s) => {
|
|
182
183
|
(!c.find(
|
|
183
|
-
(
|
|
184
|
+
(u) => u.awayzGroupId === s.awayzGroupId
|
|
184
185
|
) || o.length === 0) && c.push(s);
|
|
185
186
|
}), c;
|
|
186
|
-
},
|
|
187
|
-
categoryLogo:
|
|
188
|
-
programLogo:
|
|
187
|
+
}, ae = (t) => t ? t.replace(/^0+/, "") : "", Fe = (t) => `https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/${t}.svg`, C = (t) => `${f}${t}.svg`, B = Y.logoFallbackImageUrl, x = {
|
|
188
|
+
categoryLogo: B,
|
|
189
|
+
programLogo: B,
|
|
189
190
|
awayzActive: [],
|
|
190
191
|
mainProgram: "Unknown",
|
|
191
192
|
displayProgram: "Unknown",
|
|
192
193
|
id: "Unknown",
|
|
193
194
|
totalAccumulatedPoints: 0,
|
|
194
|
-
category:
|
|
195
|
+
category: X.Airline,
|
|
195
196
|
colour: "#fff",
|
|
196
197
|
// Using App Foreground Colour
|
|
197
198
|
url: "https://www.odynn.com"
|
|
198
|
-
},
|
|
199
|
-
const { airlines: e } = await
|
|
199
|
+
}, Ae = async (t) => {
|
|
200
|
+
const { airlines: e } = await Q.ensureQueryData({
|
|
200
201
|
queryKey: ["walletAwards"],
|
|
201
|
-
queryFn:
|
|
202
|
+
queryFn: V.getAwards,
|
|
202
203
|
staleTime: 864e5
|
|
203
204
|
// 24 hours
|
|
204
205
|
});
|
|
205
206
|
let i = e.find(
|
|
206
|
-
(
|
|
207
|
+
(d) => {
|
|
207
208
|
var o, c, s, a;
|
|
208
|
-
return ((c = (o =
|
|
209
|
+
return ((c = (o = d.mainProgram) == null ? void 0 : o.toLowerCase()) == null ? void 0 : c.includes(t == null ? void 0 : t.toLowerCase())) || ((a = (s = d.displayProgram) == null ? void 0 : s.toLowerCase()) == null ? void 0 : a.includes(t == null ? void 0 : t.toLowerCase()));
|
|
209
210
|
}
|
|
210
|
-
) ??
|
|
211
|
+
) ?? x;
|
|
211
212
|
return i || (i = {
|
|
212
|
-
...
|
|
213
|
+
...x,
|
|
213
214
|
mainProgram: t,
|
|
214
215
|
displayProgram: t,
|
|
215
216
|
id: t
|
|
216
217
|
}), i;
|
|
217
|
-
},
|
|
218
|
-
var o, c, s, a, l, n, r,
|
|
219
|
-
const e = ((s = (c = (o = t.flightDetails.slices.getFirst()) == null ? void 0 : o.segments.getFirst()) == null ? void 0 : c.passengers.getFirst()) == null ? void 0 : s.baggages) ?? [], i = ((
|
|
220
|
-
(
|
|
221
|
-
type:
|
|
222
|
-
quantity:
|
|
218
|
+
}, j = (t) => {
|
|
219
|
+
var o, c, s, a, u, l, n, r, m, p;
|
|
220
|
+
const e = ((s = (c = (o = t.flightDetails.slices.getFirst()) == null ? void 0 : o.segments.getFirst()) == null ? void 0 : c.passengers.getFirst()) == null ? void 0 : s.baggages) ?? [], i = ((l = (u = (a = t.flightDetails.slices.getFirst()) == null ? void 0 : a.segments.getFirst()) == null ? void 0 : u.passengers.getFirst()) == null ? void 0 : l.cabinClassMarketingName) ?? ((m = (r = (n = t.flightDetails.slices.getFirst()) == null ? void 0 : n.segments.getFirst()) == null ? void 0 : r.passengers.getFirst()) == null ? void 0 : m.cabinClass), d = e.map(
|
|
221
|
+
(g) => ({
|
|
222
|
+
type: J(g.type),
|
|
223
|
+
quantity: g.quantity
|
|
223
224
|
})
|
|
224
225
|
);
|
|
225
226
|
return {
|
|
@@ -228,18 +229,18 @@ const V = "https://assets.duffel.com/img/airlines/for-light-background/full-colo
|
|
|
228
229
|
points: t.points,
|
|
229
230
|
program: t.airlineProgram,
|
|
230
231
|
baseCurrency: t.flightDetails.baseCurrency,
|
|
231
|
-
fareBrandName: (
|
|
232
|
+
fareBrandName: ((p = t.flightDetails.slices.getFirst()) == null ? void 0 : p.fareBrandName) ?? "",
|
|
232
233
|
cabinClass: i,
|
|
233
234
|
cashFee: t.cashFee,
|
|
234
235
|
conditions: t.flightDetails.conditions,
|
|
235
|
-
baggages:
|
|
236
|
+
baggages: d,
|
|
236
237
|
// `carrier` is an existing unqualified field; semantics are marketing carrier.
|
|
237
238
|
carrier: {
|
|
238
239
|
iataCode: t.displayAirlineIataCode,
|
|
239
240
|
name: t.airline
|
|
240
241
|
}
|
|
241
242
|
};
|
|
242
|
-
},
|
|
243
|
+
}, q = (t) => {
|
|
243
244
|
const e = t.filter((s) => s.cash > 0);
|
|
244
245
|
let i = { cash: 1 / 0, baseCurrency: "" };
|
|
245
246
|
for (const s of e)
|
|
@@ -264,17 +265,17 @@ const V = "https://assets.duffel.com/img/airlines/for-light-background/full-colo
|
|
|
264
265
|
};
|
|
265
266
|
};
|
|
266
267
|
export {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
268
|
+
x as DEFAULT_AIRLINE_PROGRAM,
|
|
269
|
+
ye as buildFlightSearchQuery,
|
|
270
|
+
Ce as formatCabinClass,
|
|
271
|
+
Ae as getAirlineProgram,
|
|
272
|
+
K as getFlightNumber,
|
|
272
273
|
C as getFullLogoPath,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
274
|
+
Fe as getLogoPath,
|
|
275
|
+
ge as getOperatedBy,
|
|
276
|
+
se as getPrimaryDisplayCarrierForFlightOffer,
|
|
277
|
+
ee as getPrimaryDisplayCarrierForSlice,
|
|
278
|
+
be as groupFlightResults,
|
|
279
|
+
ue as mapDataToFlightDetails,
|
|
280
|
+
ae as removeLeadingZeros
|
|
280
281
|
};
|