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