@odynn/awayz-flights 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.
@@ -0,0 +1,103 @@
1
+ import { jsx as a, jsxs as i, Fragment as N } from "react/jsx-runtime";
2
+ import { useAwayzContext as A } from "@odynn/awayz-core";
3
+ import { g as E, b as k } from "./dateUtils-Cb9VQiIL.js";
4
+ import { l as I } from "./arrayExtensions-Ce8YopTP.js";
5
+ import { E as y } from "./keys-BcBfU51M.js";
6
+ import "react";
7
+ import { h as l } from "./moment-BGjjqtLQ.js";
8
+ import { useTranslation as T } from "react-i18next";
9
+ import { a as D } from "./index-Kopwbl-x.js";
10
+ import './assets/FlightItinerary.css';const F = (o) => {
11
+ var t;
12
+ if (!o) return "";
13
+ try {
14
+ return (t = I.byIso(o)) == null ? void 0 : t.country;
15
+ } catch (e) {
16
+ return console.error(e), "";
17
+ }
18
+ }, B = ({
19
+ itinerary: o,
20
+ hideCabinClass: t
21
+ }) => {
22
+ const { t: e } = T(), { config: n } = A();
23
+ return /* @__PURE__ */ a("div", { className: "flight-itinerary", children: o.map((r, f) => {
24
+ var d, s, p, m, h, g, C;
25
+ const c = o[f + 1], u = r.operatingCarrier.logoSymbolUrl ?? r.operatingCarrier.logo ?? ((d = r.marketingCarrier) == null ? void 0 : d.logoSymbolUrl) ?? ((s = r.marketingCarrier) == null ? void 0 : s.logo), b = ((m = (p = r.passengers[0]) == null ? void 0 : p.cabin) == null ? void 0 : m.marketingName.toLowerCase()) ?? ((h = r.passengers[0]) == null ? void 0 : h.cabinClass);
26
+ return /* @__PURE__ */ i(N, { children: [
27
+ /* @__PURE__ */ i("div", { className: "flight-itinerary-segment", children: [
28
+ /* @__PURE__ */ i("div", { children: [
29
+ /* @__PURE__ */ i("div", { className: "segment-details", children: [
30
+ /* @__PURE__ */ a(
31
+ "img",
32
+ {
33
+ src: u,
34
+ alt: r.operatingCarrier.name,
35
+ onError: (v) => v.currentTarget.src = (n == null ? void 0 : n.logoFallbackImageUrl) ?? ""
36
+ }
37
+ ),
38
+ /* @__PURE__ */ i("div", { children: [
39
+ /* @__PURE__ */ i("p", { children: [
40
+ l(r.departingAt).format(
41
+ e(y.DATE_TIME_MEDIUM)
42
+ ),
43
+ " ",
44
+ "-",
45
+ " ",
46
+ l(r.arrivingAt).format(
47
+ e(y.DATE_TIME_MEDIUM)
48
+ )
49
+ ] }),
50
+ /* @__PURE__ */ i("div", { className: "flight-locations", children: [
51
+ /* @__PURE__ */ a("p", { children: r.origin.iataCode }),
52
+ /* @__PURE__ */ a(D, {}),
53
+ /* @__PURE__ */ a("p", { children: r.destination.iataCode })
54
+ ] })
55
+ ] })
56
+ ] }),
57
+ /* @__PURE__ */ i("div", { className: "segment-times", children: [
58
+ /* @__PURE__ */ a("p", { children: E(r.duration) }),
59
+ !t && /* @__PURE__ */ a("p", { className: "cabin-class", children: b })
60
+ ] })
61
+ ] }),
62
+ /* @__PURE__ */ i("div", { className: "operated-by", children: [
63
+ /* @__PURE__ */ i("p", { children: [
64
+ "Operated by ",
65
+ r.operatingCarrier.name
66
+ ] }),
67
+ /* @__PURE__ */ i("p", { children: [
68
+ "Aircraft ",
69
+ (g = r.aircraft) == null ? void 0 : g.name,
70
+ " •",
71
+ " ",
72
+ r.operatingCarrier.iataCode,
73
+ " ",
74
+ r.operatingCarrierFlightNumber ?? r.marketingCarrierFlightNumber
75
+ ] })
76
+ ] })
77
+ ] }, r.id),
78
+ c && /* @__PURE__ */ i("div", { className: "flight-itinerary-layover", children: [
79
+ /* @__PURE__ */ i("p", { children: [
80
+ "Layover in",
81
+ " ",
82
+ ((C = r.destination.city) == null ? void 0 : C.name) ?? r.destination.cityName,
83
+ ", ",
84
+ F(r.destination.iataCountryCode),
85
+ " ",
86
+ "(",
87
+ r.destination.iataCode,
88
+ ")"
89
+ ] }),
90
+ /* @__PURE__ */ a("p", { children: k(
91
+ l(c.departingAt).diff(
92
+ r.arrivingAt,
93
+ "minutes"
94
+ )
95
+ ) })
96
+ ] })
97
+ ] });
98
+ }) });
99
+ };
100
+ export {
101
+ B as F,
102
+ F as g
103
+ };
@@ -1,12 +1,13 @@
1
1
  import "react/jsx-runtime";
2
2
  import "@odynn/awayz-core";
3
3
  import "../../dateUtils-Cb9VQiIL.js";
4
- import { F as g } from "../../FlightItinerary-WKjh-sAR.js";
4
+ import { F as h } from "../../FlightItinerary-BMRY5V0b.js";
5
+ import "../../keys-BcBfU51M.js";
5
6
  import "../../arrayExtensions-Ce8YopTP.js";
6
7
  import "react";
7
8
  import "../../moment-BGjjqtLQ.js";
8
9
  import "react-i18next";
9
10
  import "../../index-Kopwbl-x.js";
10
11
  export {
11
- g as FlightItinerary
12
+ h as FlightItinerary
12
13
  };
@@ -6,7 +6,7 @@ import "@tanstack/react-query";
6
6
  import "@odynn/awayz-core";
7
7
  import "../../moment-BGjjqtLQ.js";
8
8
  import "../../arrayExtensions-Ce8YopTP.js";
9
- import { F as c } from "../../FlightItinerary-WKjh-sAR.js";
9
+ import { F as c } from "../../FlightItinerary-BMRY5V0b.js";
10
10
  import '../../assets/_styles.css';import '../../assets/FlightItineraryDropdown.css';/* empty css */
11
11
  import { MiniFlightItinerary as l } from "../MiniFlightItinerary/MiniFlightItinerary.js";
12
12
  import "../../utils/flightUtils.js";
@@ -1,4 +1,4 @@
1
- import { F as e } from "../FlightItinerary-WKjh-sAR.js";
1
+ import { F as e } from "../FlightItinerary-BMRY5V0b.js";
2
2
  import { FlightItineraryDropdown as n } from "./FlightItineraryDropdown/FlightItineraryDropdown.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react";