@odynn/awayz-hotels 0.2.13 → 0.2.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,48 +1,49 @@
1
- import { useState as L, useMemo as Q } from "react";
1
+ import { useState as Q, useMemo as W } from "react";
2
2
  import { h as i } from "../../moment-BGjjqtLQ.js";
3
3
  import "../../arrayExtensions-CFEBYUok.js";
4
- import U from "../../stores/useHotelsStore.js";
5
- import { fetchTransferPartners as W, fetchPointsCheck as _, fetchAvailableRooms as j, fallbackBestCheckout as z, fetchBestCheckout as J, combineUpdatedHotelData as O } from "./useHotelDetails.api.js";
6
- import { calculatePointsAsCash as V } from "../../utilities/pointsAsCashUtils.js";
4
+ import _ from "../../stores/useHotelsStore.js";
5
+ import { fetchTransferPartners as j, fetchPointsCheck as J, fetchAvailableRooms as V, fallbackBestCheckout as X, fetchBestCheckout as Y, combineUpdatedHotelData as q } from "./useHotelDetails.api.js";
6
+ import { calculatePointsAsCash as Z } from "../../utilities/pointsAsCashUtils.js";
7
7
  import { useQuery as a } from "@tanstack/react-query";
8
- const X = (t, c) => Math.abs(
8
+ import { useAwayzContext as $ } from "@odynn/awayz-core";
9
+ const ee = (t, c) => Math.abs(
9
10
  i(t.startOf("day")).diff(i(c.endOf("day")), "days")
10
- ), ce = (t) => {
11
- var k, f, d, p, m, y, b, C, g, v, F;
11
+ ), ue = (t) => {
12
+ var k, d, p, m, y, C, b, g, v, F, O, R;
12
13
  if (!t)
13
14
  throw new Error(
14
15
  "Hotel is required in order to initiate the hotel details flow"
15
16
  );
16
- const { updateHotel: c, searchParams: o } = U(), [e, q] = L({
17
+ const { user: c } = $(), H = ((k = c == null ? void 0 : c.userRegion) == null ? void 0 : k.currency) || "USD", { updateHotel: n, searchParams: o } = _(), [e, A] = Q({
17
18
  checkinDate: o == null ? void 0 : o.checkinDate,
18
19
  checkoutDate: o == null ? void 0 : o.checkoutDate
19
- }), s = Q(() => X(e.checkinDate, e.checkoutDate), [e]), H = (x, E) => {
20
- q({
21
- checkinDate: i(x),
22
- checkoutDate: i(E)
20
+ }), s = W(() => ee(e.checkinDate, e.checkoutDate), [e]), B = (E, L) => {
21
+ A({
22
+ checkinDate: i(E),
23
+ checkoutDate: i(L)
23
24
  });
24
- }, { data: R, isFetching: A } = a({
25
+ }, { data: I, isFetching: G } = a({
25
26
  queryKey: ["transferPartners", t.hotelGroup],
26
- queryFn: () => W(t.hotelGroup),
27
+ queryFn: () => j(t.hotelGroup),
27
28
  enabled: !!t.hotelGroup,
28
29
  placeholderData: []
29
30
  }), {
30
- data: B,
31
- isFetching: n,
32
- isFetched: I
31
+ data: S,
32
+ isFetching: r,
33
+ isFetched: w
33
34
  } = a({
34
35
  queryKey: [
35
36
  "hotelPointsCheck",
36
37
  t.hotelId,
37
38
  t.hotelGroup,
38
- (k = e == null ? void 0 : e.checkinDate) == null ? void 0 : k.valueOf(),
39
- (f = e == null ? void 0 : e.checkoutDate) == null ? void 0 : f.valueOf()
39
+ (d = e == null ? void 0 : e.checkinDate) == null ? void 0 : d.valueOf(),
40
+ (p = e == null ? void 0 : e.checkoutDate) == null ? void 0 : p.valueOf()
40
41
  ],
41
- queryFn: () => _({
42
+ queryFn: () => J({
42
43
  hotel: t,
43
44
  checkinDate: e.checkinDate,
44
45
  checkoutDate: e.checkoutDate,
45
- updateHotel: c
46
+ updateHotel: n
46
47
  }),
47
48
  enabled: !!e.checkinDate && !!e.checkoutDate && !!t.liveScrapingCheckNeeded,
48
49
  // We don't throw an error on fail so we can gracefully handle fallback
@@ -51,100 +52,101 @@ const X = (t, c) => Math.abs(
51
52
  pointsHotelDetails: t,
52
53
  pointsRooms: t.rooms ?? []
53
54
  }
54
- }), { pointsRooms: G, pointsHotelDetails: r } = B || {
55
+ }), { pointsRooms: K, pointsHotelDetails: u } = S || {
55
56
  pointsHotelDetails: t,
56
57
  pointsRooms: []
57
58
  }, {
58
- data: K,
59
- isFetching: u,
60
- isFetched: S
59
+ data: N,
60
+ isFetching: h,
61
+ isFetched: x
61
62
  } = a({
62
63
  queryKey: [
63
64
  "fetchAvailableRooms",
64
- (d = t.cashBookingOffers) == null ? void 0 : d.accommodationId,
65
- (p = e == null ? void 0 : e.checkinDate) == null ? void 0 : p.valueOf(),
66
- (m = e == null ? void 0 : e.checkoutDate) == null ? void 0 : m.valueOf(),
65
+ (m = t.cashBookingOffers) == null ? void 0 : m.accommodationId,
66
+ (y = e == null ? void 0 : e.checkinDate) == null ? void 0 : y.valueOf(),
67
+ (C = e == null ? void 0 : e.checkoutDate) == null ? void 0 : C.valueOf(),
67
68
  o == null ? void 0 : o.guests,
68
69
  o == null ? void 0 : o.rooms
69
70
  ],
70
- queryFn: () => j({
71
+ queryFn: () => V({
71
72
  hotel: t,
72
73
  checkinDate: e.checkinDate,
73
74
  checkoutDate: e.checkoutDate,
74
75
  guests: o.guests,
75
76
  rooms: o.rooms,
76
- updateHotel: c,
77
+ updateHotel: n,
77
78
  numberOfNights: s
78
79
  }),
79
- enabled: !!e.checkinDate && !!e.checkoutDate && !!((y = t.cashBookingOffers) != null && y.accommodationId),
80
+ enabled: !!e.checkinDate && !!e.checkoutDate && !!((b = t.cashBookingOffers) != null && b.accommodationId),
80
81
  retry: !1,
81
82
  placeholderData: {
82
83
  cashHotelDetails: t,
83
84
  cashRooms: []
84
85
  }
85
- }), { cashRooms: w, cashHotelDetails: h } = K || {
86
+ }), { cashRooms: M, cashHotelDetails: l } = N || {
86
87
  cashHotelDetails: t,
87
88
  cashRooms: []
88
89
  }, {
89
- data: N,
90
- isFetching: M,
91
- isFetched: P
90
+ data: P,
91
+ isFetching: T,
92
+ isFetched: U
92
93
  } = a({
93
94
  queryKey: [
94
95
  "bestCheckout",
95
96
  t.hotelId,
96
97
  t.hotelGroup,
97
- (b = e == null ? void 0 : e.checkinDate) == null ? void 0 : b.valueOf(),
98
- (C = e == null ? void 0 : e.checkoutDate) == null ? void 0 : C.valueOf()
98
+ (g = e == null ? void 0 : e.checkinDate) == null ? void 0 : g.valueOf(),
99
+ (v = e == null ? void 0 : e.checkoutDate) == null ? void 0 : v.valueOf()
99
100
  ],
100
- queryFn: () => J(
101
- O(t, r, h),
102
- s
101
+ queryFn: () => Y(
102
+ q(t, u, l),
103
+ s,
104
+ H
103
105
  ),
104
- enabled: !t.hotelId.startsWith("duff_") && !n && (t.liveScrapingCheckNeeded ? I : !0) && !u && ((g = t.cashBookingOffers) != null && g.accommodationId ? S : !0) && s > 0,
106
+ enabled: !t.hotelId.startsWith("duff_") && !r && (t.liveScrapingCheckNeeded ? w : !0) && !h && ((F = t.cashBookingOffers) != null && F.accommodationId ? x : !0) && s > 0,
105
107
  retry: !1,
106
108
  placeholderData: {
107
- bestCheckout: z(t, s),
109
+ bestCheckout: X(t, s),
108
110
  isAvailable: !1
109
111
  }
110
- }), { bestCheckout: l, isAvailable: D } = N || {
112
+ }), { bestCheckout: D, isAvailable: f } = P || {
111
113
  isAvailable: !1
112
- }, { data: T } = a({
114
+ }, { data: z } = a({
113
115
  queryKey: [
114
116
  "pointsAsCash",
115
117
  t.hotelId,
116
118
  t.hotelGroup,
117
- (v = e == null ? void 0 : e.checkinDate) == null ? void 0 : v.valueOf(),
118
- (F = e == null ? void 0 : e.checkoutDate) == null ? void 0 : F.valueOf()
119
+ (O = e == null ? void 0 : e.checkinDate) == null ? void 0 : O.valueOf(),
120
+ (R = e == null ? void 0 : e.checkoutDate) == null ? void 0 : R.valueOf()
119
121
  ],
120
- queryFn: () => V(l.totalCashCost),
121
- enabled: P && D,
122
+ queryFn: () => Z(D.totalCashCost),
123
+ enabled: U && f,
122
124
  retry: !1
123
125
  });
124
126
  return {
125
- transferPartners: R,
126
- loadingTransferPartners: A,
127
+ transferPartners: I,
128
+ loadingTransferPartners: G,
127
129
  // Points Check
128
- pointsRooms: G,
129
- loadingLivePointsCheck: n,
130
+ pointsRooms: K,
131
+ loadingLivePointsCheck: r,
130
132
  // Cash Rooms
131
- cashRooms: w,
132
- loadingCashRooms: u,
133
+ cashRooms: M,
134
+ loadingCashRooms: h,
133
135
  // Best Checkout
134
- bestCheckout: l,
135
- loadingBestCheckout: M,
136
+ bestCheckout: D,
137
+ loadingBestCheckout: T,
136
138
  // Combined availability
137
- isAvailable: D,
139
+ isAvailable: f,
138
140
  // Points as Cash
139
- pointsAsCash: T,
140
- hotelDetails: O(
141
+ pointsAsCash: z,
142
+ hotelDetails: q(
141
143
  t,
142
- r,
143
- h
144
+ u,
145
+ l
144
146
  ),
145
- updateDates: H
147
+ updateDates: B
146
148
  };
147
149
  };
148
150
  export {
149
- ce as useHotelDetails
151
+ ue as useHotelDetails
150
152
  };
@@ -8,11 +8,11 @@ var d = {
8
8
  }, v = i.createContext && /* @__PURE__ */ i.createContext(d), g = ["attr", "size", "title"];
9
9
  function b(t, e) {
10
10
  if (t == null) return {};
11
- var r = O(t, e), c, n;
11
+ var r = O(t, e), c, a;
12
12
  if (Object.getOwnPropertySymbols) {
13
13
  var l = Object.getOwnPropertySymbols(t);
14
- for (n = 0; n < l.length; n++)
15
- c = l[n], !(e.indexOf(c) >= 0) && Object.prototype.propertyIsEnumerable.call(t, c) && (r[c] = t[c]);
14
+ for (a = 0; a < l.length; a++)
15
+ c = l[a], !(e.indexOf(c) >= 0) && Object.prototype.propertyIsEnumerable.call(t, c) && (r[c] = t[c]);
16
16
  }
17
17
  return r;
18
18
  }
@@ -40,8 +40,8 @@ function f(t, e) {
40
40
  var r = Object.keys(t);
41
41
  if (Object.getOwnPropertySymbols) {
42
42
  var c = Object.getOwnPropertySymbols(t);
43
- e && (c = c.filter(function(n) {
44
- return Object.getOwnPropertyDescriptor(t, n).enumerable;
43
+ e && (c = c.filter(function(a) {
44
+ return Object.getOwnPropertyDescriptor(t, a).enumerable;
45
45
  })), r.push.apply(r, c);
46
46
  }
47
47
  return r;
@@ -79,7 +79,7 @@ function m(t) {
79
79
  key: r
80
80
  }, e.attr), m(e.child)));
81
81
  }
82
- function a(t) {
82
+ function n(t) {
83
83
  return (e) => /* @__PURE__ */ i.createElement(j, u({
84
84
  attr: h({}, t.attr)
85
85
  }, e), m(t.child));
@@ -88,9 +88,9 @@ function j(t) {
88
88
  var e = (r) => {
89
89
  var {
90
90
  attr: c,
91
- size: n,
91
+ size: a,
92
92
  title: l
93
- } = t, p = b(t, g), s = n || r.size || "1em", o;
93
+ } = t, p = b(t, g), s = a || r.size || "1em", o;
94
94
  return r.className && (o = r.className), t.className && (o = (o ? o + " " : "") + t.className), /* @__PURE__ */ i.createElement("svg", u({
95
95
  stroke: "currentColor",
96
96
  fill: "currentColor",
@@ -108,36 +108,40 @@ function j(t) {
108
108
  return v !== void 0 ? /* @__PURE__ */ i.createElement(v.Consumer, null, (r) => e(r)) : e(d);
109
109
  }
110
110
  function x(t) {
111
- return a({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z" }, child: [] }] })(t);
111
+ return n({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z" }, child: [] }] })(t);
112
112
  }
113
113
  function L(t) {
114
- return a({ attr: { viewBox: "0 0 640 512" }, child: [{ tag: "path", attr: { d: "M176 256c44.11 0 80-35.89 80-80s-35.89-80-80-80-80 35.89-80 80 35.89 80 80 80zm352-128H304c-8.84 0-16 7.16-16 16v144H64V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v352c0 8.84 7.16 16 16 16h32c8.84 0 16-7.16 16-16v-48h512v48c0 8.84 7.16 16 16 16h32c8.84 0 16-7.16 16-16V240c0-61.86-50.14-112-112-112z" }, child: [] }] })(t);
114
+ return n({ attr: { viewBox: "0 0 640 512" }, child: [{ tag: "path", attr: { d: "M176 256c44.11 0 80-35.89 80-80s-35.89-80-80-80-80 35.89-80 80 35.89 80 80 80zm352-128H304c-8.84 0-16 7.16-16 16v144H64V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v352c0 8.84 7.16 16 16 16h32c8.84 0 16-7.16 16-16v-48h512v48c0 8.84 7.16 16 16 16h32c8.84 0 16-7.16 16-16V240c0-61.86-50.14-112-112-112z" }, child: [] }] })(t);
115
115
  }
116
116
  function C(t) {
117
- return a({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" }, child: [] }] })(t);
117
+ return n({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" }, child: [] }] })(t);
118
118
  }
119
119
  function M(t) {
120
- return a({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm121.2 231.8l-143 141.8c-4.7 4.7-12.3 4.6-17-.1l-82.6-83.3c-4.7-4.7-4.6-12.3.1-17L99.1 285c4.7-4.7 12.3-4.6 17 .1l46 46.4 106-105.2c4.7-4.7 12.3-4.6 17 .1l28.2 28.4c4.7 4.8 4.6 12.3-.1 17z" }, child: [] }] })(t);
120
+ return n({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z" }, child: [] }] })(t);
121
+ }
122
+ function B(t) {
123
+ return n({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm121.2 231.8l-143 141.8c-4.7 4.7-12.3 4.6-17-.1l-82.6-83.3c-4.7-4.7-4.6-12.3.1-17L99.1 285c4.7-4.7 12.3-4.6 17 .1l46 46.4 106-105.2c4.7-4.7 12.3-4.6 17 .1l28.2 28.4c4.7 4.8 4.6 12.3-.1 17z" }, child: [] }] })(t);
121
124
  }
122
125
  function E(t) {
123
- return a({ attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z" }, child: [] }] })(t);
126
+ return n({ attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z" }, child: [] }] })(t);
124
127
  }
125
- function B(t) {
126
- return a({ attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M560 64c8.84 0 16-7.16 16-16V16c0-8.84-7.16-16-16-16H16C7.16 0 0 7.16 0 16v32c0 8.84 7.16 16 16 16h15.98v384H16c-8.84 0-16 7.16-16 16v32c0 8.84 7.16 16 16 16h240v-80c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v80h240c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16h-16V64h16zm-304 44.8c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4zm0 96c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4zm-128-96c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4zM179.2 256h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4c0 6.4-6.4 12.8-12.8 12.8zM192 384c0-53.02 42.98-96 96-96s96 42.98 96 96H192zm256-140.8c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4zm0-96c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4z" }, child: [] }] })(t);
128
+ function F(t) {
129
+ return n({ attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M560 64c8.84 0 16-7.16 16-16V16c0-8.84-7.16-16-16-16H16C7.16 0 0 7.16 0 16v32c0 8.84 7.16 16 16 16h15.98v384H16c-8.84 0-16 7.16-16 16v32c0 8.84 7.16 16 16 16h240v-80c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16v80h240c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16h-16V64h16zm-304 44.8c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4zm0 96c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4zm-128-96c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4zM179.2 256h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4c0 6.4-6.4 12.8-12.8 12.8zM192 384c0-53.02 42.98-96 96-96s96 42.98 96 96H192zm256-140.8c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4zm0-96c0 6.4-6.4 12.8-12.8 12.8h-38.4c-6.4 0-12.8-6.4-12.8-12.8v-38.4c0-6.4 6.4-12.8 12.8-12.8h38.4c6.4 0 12.8 6.4 12.8 12.8v38.4z" }, child: [] }] })(t);
127
130
  }
128
131
  function H(t) {
129
- return a({ attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z" }, child: [] }] })(t);
132
+ return n({ attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z" }, child: [] }] })(t);
130
133
  }
131
- function F(t) {
132
- return a({ attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M528.1 171.5L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z" }, child: [] }] })(t);
134
+ function S(t) {
135
+ return n({ attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M528.1 171.5L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z" }, child: [] }] })(t);
133
136
  }
134
137
  export {
135
- E as F,
136
- H as a,
137
- F as b,
138
- B as c,
139
- M as d,
140
- C as e,
141
- L as f,
142
- x as g
138
+ M as F,
139
+ E as a,
140
+ H as b,
141
+ S as c,
142
+ C as d,
143
+ F as e,
144
+ B as f,
145
+ L as g,
146
+ x as h
143
147
  };
@@ -0,0 +1,8 @@
1
+ interface ICheckboxProps {
2
+ label: string;
3
+ onChange?: (checked: boolean) => void;
4
+ checked?: boolean;
5
+ style?: React.CSSProperties;
6
+ }
7
+ declare const Checkbox: ({ label, onChange, checked, style }: ICheckboxProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default Checkbox;
@@ -0,0 +1,21 @@
1
+ import { IHotelDetails } from '../HotelResult/HotelResult.types';
2
+ export interface ILegendProps {
3
+ /**
4
+ * The details of the hotels retrieved from the `useHotelSearch` hook.
5
+ */
6
+ hotelResults: IHotelDetails[];
7
+ /**
8
+ * Callback function to handle changes in the selected hotel chains.
9
+ * @param checkedHotels - The updated list of selected hotel chains.
10
+ */
11
+ onChange: (checkedHotels: string[]) => void;
12
+ /**
13
+ * The selected hotel chains.
14
+ */
15
+ value: string[];
16
+ /**
17
+ * @optional Callback function to handle the "More Filters" action.
18
+ */
19
+ onOtherFilters?: () => void;
20
+ }
21
+ export declare const Legend: ({ hotelResults, onChange, value, onOtherFilters }: ILegendProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Legend } from './Legend';
3
+ declare const meta: Meta<typeof Legend>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Legend>;
6
+ export declare const Default: Story;
7
+ export declare const SingleHotelGroup: Story;
@@ -1,2 +1,3 @@
1
1
  export { HotelResult } from './HotelResult/HotelResult';
2
2
  export { HotelResults } from './HotelResults/HotelResults';
3
+ export { Legend } from './Legend/Legend';
@@ -10,7 +10,7 @@ export declare const HotelChains: {
10
10
  isHotelChain: (hotelGroup: string) => boolean;
11
11
  toList: () => string[];
12
12
  toInformation: (chain: string) => "Accor Hotel Group consists of 43 hotel brands : Raffles, Orient Express, Faena, Banyan Tree Hotels and Resorts, Delano, Sofitel Legend, Fairmont, SLS, SO/, Sofitel, The House of Originals, Rixos, onefinestay, Mantis, MGallery, Art Series, Mondrian, Pullman, Swissôtel, Angsana, 25 Hours, Hyde, Mövenpick, Grand Mercure, Peppers, The Sebel, Mantra, Novotel, Mercure, Adagio, Mama Shelter, Tribe, Breakfree, ibis, ibis Styles, ibis Budget, Jo&Joe, hotelF1, greet, Adagio access" | "Choice Hotel Group consists of 10 hotel brands : Ascend Hotel Collection, Cambria Hotels, ComfortSleep Inn, Quality Inn, Clarion, Main Stay Suites, Wood Spring Suites, Suburban Extended Stay Hotel, Econo LodgeRodeway Inn, Vacation Rentals by Choice Hotels" | "Marriott consists of 32 hotel brands : Edition, Ritz Carlton, JW Marriott,The Luxury Collection, Bvlgari, St Regis, W Hotels, Marriott Vaction Club, Marriott Hotels & Resorts, Sheraton, Autograph Collection Hotels, Delta Hotels, Gaylord Hotels, Le Meridien, Renaissance Hotels, Design Hotels, Westin Hotels, Tribute Portfolio, Courtyard, Fairfield, Four Points, Moxy, Protea Hotels, Aloft, AC Hotels, SpringHill Suites, Element, Towneplace Suites, Marriott Exectutive Apartments, Home & Villas, Residence Inn" | "Hilton hotel group consists of 18 hotel brandsConrad Hotels & Resorts, Canopy by Hilton,Curio – A Collection by Hilton,Hilton Hotels & Resorts,DoubleTree by Hilton,Embassy Suites Hotels,Hilton Garden Inn,Hampton by Hilton,Homewood Suites by Hilton,Home2 Suites by Hilton,Hilton Grand Vacations, LXR Hotels and Resorts by Hilton,Waldorf Astoria Hotels & Resorts, Signia by Hilton,Tru by Hilton, Tapestry Collection by Hilton, Tempo by Hilton and Motto by Hilton" | "IHG Hotel Group consists of 16 hotel brands : Six Senses Hotels Resports Spas,Regent Hotels & Resorts, InterContinental Hotels & Resorts, Kimpton Hotels & Resorts, Vignette Collection, Hotel Indigo, Hualuxe Hotels & Resorts, Crowne Plaza Hotels & Resorts, Even Hotels, Voco Hotels, Holiday Inn, Holiday Inn Express, Avid Hotels, Atwell Suites, Staybrudge Suites, Holiday Inn Club Vacations, Candlewood Suites" | "Hyatt Hotel Group consists of 19 hotel brands : Park Hyatt, Miraval, Grand Hyatt, Hyatt Regency, Hyatt, Hyatt Ziva, Hyatt Zilara, Hyatt Place, Hyatt House, Hyatt Residence Club, UrCove by Hyatt, Andaz, Alila Hotels and Resorts, Thompson Hotels, Hyatt Centric, Caption by Hyatt, The Unbound Collection by Hyatt, Destination by Hyatt, JdV by Hyatt" | "Wyndham Hotel Group consists of 21 hotel brands : Wyndham, Wyndham Grand, Dolce Hotels and Resorts, TRYP by Wyndham, Esplendor Boutique Hotels, Dazzler Hotels, Trademark Collection by Wyndham, La Quinta, Wingate by Wyndham, Wyndham Garden, AmericInn, Ramada Worldwide, Baymont, Microtel, Days Inn, Super 8, Howard Johnson, Travelodge, Hawthorn Suites, Knights Inn, Wyndham Vacation Clubs" | "Unspecified.";
13
- toColour: (chain?: string) => "#724cc4" | "#000000" | "#fdd835" | "#008000" | "#D7733B" | "#0042ed" | "#3fc6d2" | "#212121";
13
+ toColour: (chain?: string) => "#724cc4" | "#000000" | "#fdd835" | "#008000" | "#D7733B" | "#0042ed" | "#3fc6d2" | "#1B8096";
14
14
  toProgram: (hotelName: string) => "Marriott Rewards" | "Hilton Honors" | "IHG Rewards Club" | "Hyatt Rewards" | "Accor Live Limitless" | "Choice Privileges" | "Wyndham Rewards" | "Not Implemented";
15
15
  toLogo: (chain: string) => "/partner-logos/marriott.svg" | "/partner-logos/hilton.svg" | "/partner-logos/ihg.svg" | "/partner-logos/hyatt.svg" | "/partner-logos/accor.svg" | "/partner-logos/choice.svg" | "/partner-logos/wyndham.svg" | "/partner-logos/odynn.svg";
16
16
  isMajorChain: (chain: string) => boolean;
@@ -49,7 +49,7 @@ interface IFetchBestCheckoutResponse {
49
49
  bestCheckout: IBestCheckout | undefined;
50
50
  isAvailable: boolean;
51
51
  }
52
- export declare const fetchBestCheckout: (hotel: IHotelDetails, numberOfNights: number) => Promise<IFetchBestCheckoutResponse>;
52
+ export declare const fetchBestCheckout: (hotel: IHotelDetails, numberOfNights: number, userCurrency: string) => Promise<IFetchBestCheckoutResponse>;
53
53
  export declare const fallbackBestCheckout: (selectedHotelData: IHotelDetails, numberOfNights: number) => IBestCheckout;
54
54
  export declare const combineUpdatedHotelData: (base: IHotelDetails, liveScraperData: IHotelDetails, cashRoomsData: IHotelDetails) => IHotelDetails;
55
55
  export {};
@@ -1,5 +1,5 @@
1
1
  import { IHotelPointsCheckArgs, ISearchByHotelIdRequest, ISearchHotelsParams, ISearchLocation } from './HotelService.types';
2
- import { IHotelDetails } from '../../components/HotelResult/HotelResult.types';
2
+ import { IHotelDetails, ILiveHotelCheck } from '../../components/HotelResult/HotelResult.types';
3
3
  import { TServiceResponse } from '@type-op/shared';
4
4
  import { IBestCheckout } from '../../hooks/useHotelDetails/useHotelDetails.types';
5
5
  declare class _HotelService {
@@ -9,7 +9,7 @@ declare class _HotelService {
9
9
  getTransferPartners: (program: string) => Promise<any>;
10
10
  hotelPointsCheck: (args: IHotelPointsCheckArgs) => Promise<{
11
11
  success: any;
12
- data: any;
12
+ data: ILiveHotelCheck | null;
13
13
  message?: undefined;
14
14
  } | {
15
15
  success: boolean;