@athbnb/ui 0.0.2 → 0.0.3

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,631 @@
1
+ import { Button as e } from "./Button.js";
2
+ import { DatePicker as t } from "./DatePicker.js";
3
+ import { Loader as n } from "./Loader.js";
4
+ import { c as r } from "react/compiler-runtime";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import { useCallback as o, useEffect as s, useMemo as c, useRef as ee, useState as l } from "react";
7
+ //#region src/ui/SearchBar.tsx
8
+ function u(e) {
9
+ let t = r(3), { className: n } = e, a;
10
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ i("path", { d: "M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" }), t[0] = a) : a = t[0];
11
+ let o;
12
+ return t[1] === n ? o = t[2] : (o = /* @__PURE__ */ i("svg", {
13
+ className: n,
14
+ viewBox: "0 0 24 24",
15
+ "aria-hidden": !0,
16
+ fill: "currentColor",
17
+ children: a
18
+ }), t[1] = n, t[2] = o), o;
19
+ }
20
+ function d(e) {
21
+ let t = r(3), { className: n } = e, a;
22
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ i("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 0 1 0-5 2.5 2.5 0 0 1 0 5z" }), t[0] = a) : a = t[0];
23
+ let o;
24
+ return t[1] === n ? o = t[2] : (o = /* @__PURE__ */ i("svg", {
25
+ className: n,
26
+ viewBox: "0 0 24 24",
27
+ "aria-hidden": !0,
28
+ fill: "currentColor",
29
+ children: a
30
+ }), t[1] = n, t[2] = o), o;
31
+ }
32
+ function f(e) {
33
+ let t = r(3), { className: n } = e, a;
34
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ i("path", { d: "M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z" }), t[0] = a) : a = t[0];
35
+ let o;
36
+ return t[1] === n ? o = t[2] : (o = /* @__PURE__ */ i("svg", {
37
+ className: n,
38
+ viewBox: "0 0 24 24",
39
+ "aria-hidden": !0,
40
+ fill: "currentColor",
41
+ children: a
42
+ }), t[1] = n, t[2] = o), o;
43
+ }
44
+ function p(e) {
45
+ let t = r(3), { className: n } = e, a;
46
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ i("path", { d: "M18 6L6 18M6 6l12 12" }), t[0] = a) : a = t[0];
47
+ let o;
48
+ return t[1] === n ? o = t[2] : (o = /* @__PURE__ */ i("svg", {
49
+ xmlns: "http://www.w3.org/2000/svg",
50
+ viewBox: "0 0 24 24",
51
+ fill: "none",
52
+ stroke: "currentColor",
53
+ strokeWidth: 2,
54
+ className: n,
55
+ "aria-hidden": !0,
56
+ children: a
57
+ }), t[1] = n, t[2] = o), o;
58
+ }
59
+ function m() {
60
+ return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
61
+ }
62
+ function te(e, t) {
63
+ let n = /* @__PURE__ */ new Date(e + "T12:00:00");
64
+ return n.setDate(n.getDate() + t), n.toISOString().slice(0, 10);
65
+ }
66
+ function ne({ destination: e, placeId: t, onDestinationChange: r, onPlaceIdChange: f, fetchSuggestions: m, fetchDebounceMs: te = 750, autoCompleteLoading: ne, autoCompleteResults: re, variant: ie = "default", placeholder: h = "Search destination", whereLabel: g = "Where", noResultsText: _ = "No results", className: v = "" }) {
67
+ let y = ee(null), [b, x] = l(!1), [S, C] = l(-1), [w, T] = l(!1), [E, D] = l([]), O = !!m, k = c(() => O ? w : ne ?? !1, [
68
+ O,
69
+ w,
70
+ ne
71
+ ]), A = c(() => O ? E : re ?? [], [
72
+ O,
73
+ E,
74
+ re
75
+ ]);
76
+ s(() => {
77
+ if (!O || !m) return;
78
+ if (!e.trim() || t) {
79
+ D([]);
80
+ return;
81
+ }
82
+ let n = !1;
83
+ T(!0);
84
+ let r = window.setTimeout(async () => {
85
+ try {
86
+ let t = await m(e.trim());
87
+ n || D(t ?? []);
88
+ } catch {
89
+ n || D([]);
90
+ } finally {
91
+ n || T(!1);
92
+ }
93
+ }, te);
94
+ return () => {
95
+ n = !0, window.clearTimeout(r);
96
+ };
97
+ }, [
98
+ e,
99
+ t,
100
+ m,
101
+ te,
102
+ O
103
+ ]);
104
+ let j = o((e) => {
105
+ r(e.description), f(e.place_id), x(!1), C(-1);
106
+ }, [r, f]), M = o((e) => {
107
+ y.current && !y.current.contains(e.target) && (x(!1), C(-1));
108
+ }, []), N = o((e) => {
109
+ e.key === "Escape" ? (x(!1), C(-1)) : b && A.length > 0 && (e.key === "ArrowDown" ? (e.preventDefault(), C((e) => e < A.length - 1 ? e + 1 : 0)) : e.key === "ArrowUp" ? (e.preventDefault(), C((e) => e > 0 ? e - 1 : A.length - 1)) : e.key === "Enter" && S !== -1 && (e.preventDefault(), j(A[S])));
110
+ }, [
111
+ b,
112
+ A,
113
+ S,
114
+ j
115
+ ]);
116
+ s(() => (document.addEventListener("mousedown", M), document.addEventListener("keydown", N), () => {
117
+ document.removeEventListener("mousedown", M), document.removeEventListener("keydown", N);
118
+ }), [M, N]), s(() => {
119
+ C(-1);
120
+ }, [b, A]);
121
+ let ae = b && e.trim() && !t && e.trim().length > 0 ? /* @__PURE__ */ i("div", {
122
+ className: "absolute top-full left-0 z-[100] mt-2 max-h-60 w-full divide-y divide-primary/50 overflow-y-auto rounded bg-white shadow-[0px_1px_12px_0px_rgba(0,_0,_0,_0.15)] md:min-w-[300px]",
123
+ children: k ? /* @__PURE__ */ i("div", {
124
+ className: "flex w-full items-center justify-center p-3",
125
+ children: /* @__PURE__ */ i(n, {})
126
+ }) : A.length > 0 ? A.map((e, t) => /* @__PURE__ */ i("button", {
127
+ type: "button",
128
+ className: `m-1 w-[calc(100%-8px)] cursor-pointer rounded p-2 text-left text-sm ${t === S ? "bg-primary/75 text-white" : "hover:bg-primary/75 hover:text-white"}`,
129
+ onClick: () => j(e),
130
+ children: e.description
131
+ }, e.place_id || t)) : /* @__PURE__ */ i("div", {
132
+ className: "p-3 text-sm text-gray-500",
133
+ children: _
134
+ })
135
+ }) : null;
136
+ return ie === "horizontal" ? /* @__PURE__ */ a("div", {
137
+ className: `relative w-full sm:w-full md:w-1/5 ${v}`.trim(),
138
+ ref: y,
139
+ children: [/* @__PURE__ */ i("div", {
140
+ className: "flex h-full w-full flex-col justify-center pb-3 sm:border-r sm:border-dashed sm:border-primary/50 sm:pr-3 md:pb-0",
141
+ children: /* @__PURE__ */ i("div", {
142
+ className: "flex w-full flex-col items-center gap-2 p-2",
143
+ children: /* @__PURE__ */ a("div", {
144
+ className: "flex w-full items-start gap-2",
145
+ children: [/* @__PURE__ */ i(d, { className: "mt-0.5 h-4 w-4 shrink-0 fill-primary" }), /* @__PURE__ */ a("div", {
146
+ className: "min-w-0 flex-1",
147
+ children: [/* @__PURE__ */ i("label", {
148
+ className: "block text-base font-bold text-primary",
149
+ children: g
150
+ }), /* @__PURE__ */ a("div", {
151
+ className: "relative mt-2 flex w-full",
152
+ children: [/* @__PURE__ */ i("input", {
153
+ type: "text",
154
+ placeholder: h,
155
+ className: "w-full border-none bg-transparent text-sm font-bold text-secondary outline-none placeholder:text-secondary/50",
156
+ value: e,
157
+ onChange: (e) => {
158
+ r(e.target.value), f(""), x(!!e.target.value.trim()), C(-1);
159
+ },
160
+ onFocus: () => {
161
+ e?.trim() && x(!0);
162
+ }
163
+ }), e ? /* @__PURE__ */ i("button", {
164
+ type: "button",
165
+ className: "absolute top-0 right-0 -mt-1 text-gray-400 transition-colors hover:text-gray-500",
166
+ onClick: () => {
167
+ r(""), f(""), C(-1);
168
+ },
169
+ "aria-label": "Clear",
170
+ children: /* @__PURE__ */ i(p, { className: "h-5 w-5" })
171
+ }) : null]
172
+ })]
173
+ })]
174
+ })
175
+ })
176
+ }), ae]
177
+ }) : /* @__PURE__ */ a("div", {
178
+ className: `relative ${v}`.trim(),
179
+ ref: y,
180
+ children: [
181
+ /* @__PURE__ */ i(u, { className: "absolute top-3 left-2 h-4 w-4 fill-primary" }),
182
+ /* @__PURE__ */ i("input", {
183
+ type: "text",
184
+ placeholder: h,
185
+ className: "w-full rounded-[5px] border border-primary/50 bg-white py-2 pr-4 pl-8 text-base font-bold text-secondary placeholder:text-primary focus-visible:outline-0",
186
+ value: e,
187
+ onChange: (e) => {
188
+ r(e.target.value), f(""), x(!!e.target.value.trim()), C(-1);
189
+ },
190
+ onFocus: () => {
191
+ e.trim() && x(!0);
192
+ }
193
+ }),
194
+ ae
195
+ ]
196
+ });
197
+ }
198
+ function re(e) {
199
+ let t = r(45), { value: n, onChange: o, label: s, minAdults: c, maxAdults: ee, maxChildren: l, className: u, adultsLabel: d, childrenLabel: f } = e, p = s === void 0 ? "Guests" : s, m = c === void 0 ? 1 : c, te = ee === void 0 ? 16 : ee, ne = l === void 0 ? 16 : l, re = u === void 0 ? "" : u, ie = d === void 0 ? "Adults" : d, h = f === void 0 ? "Children" : f, g;
200
+ t[0] !== te || t[1] !== ne || t[2] !== m || t[3] !== o || t[4] !== n ? (g = (e, t) => {
201
+ let r = {
202
+ ...n,
203
+ [e]: n[e] + t
204
+ };
205
+ e === "adults" ? r.adults = Math.min(te, Math.max(m, r.adults)) : r.children = Math.min(ne, Math.max(0, r.children)), o(r);
206
+ }, t[0] = te, t[1] = ne, t[2] = m, t[3] = o, t[4] = n, t[5] = g) : g = t[5];
207
+ let _ = g, v = `flex flex-col gap-3 rounded-[5px] border border-primary/50 bg-white p-3 ${re}`, y;
208
+ t[6] === v ? y = t[7] : (y = v.trim(), t[6] = v, t[7] = y);
209
+ let b;
210
+ t[8] === p ? b = t[9] : (b = p ? /* @__PURE__ */ i("span", {
211
+ className: "text-base font-bold text-primary",
212
+ children: p
213
+ }) : null, t[8] = p, t[9] = b);
214
+ let x;
215
+ t[10] === ie ? x = t[11] : (x = /* @__PURE__ */ i("span", {
216
+ className: "text-sm font-semibold text-secondary",
217
+ children: ie
218
+ }), t[10] = ie, t[11] = x);
219
+ let S;
220
+ t[12] === _ ? S = t[13] : (S = /* @__PURE__ */ i("button", {
221
+ type: "button",
222
+ className: "flex h-8 w-8 items-center justify-center rounded border border-primary/50 text-primary",
223
+ onClick: () => _("adults", -1),
224
+ "aria-label": "Decrease adults",
225
+ children: "−"
226
+ }), t[12] = _, t[13] = S);
227
+ let C;
228
+ t[14] === n.adults ? C = t[15] : (C = /* @__PURE__ */ i("span", {
229
+ className: "min-w-[2ch] text-center font-bold text-secondary",
230
+ children: n.adults
231
+ }), t[14] = n.adults, t[15] = C);
232
+ let w;
233
+ t[16] === _ ? w = t[17] : (w = /* @__PURE__ */ i("button", {
234
+ type: "button",
235
+ className: "flex h-8 w-8 items-center justify-center rounded border border-primary/50 text-primary",
236
+ onClick: () => _("adults", 1),
237
+ "aria-label": "Increase adults",
238
+ children: "+"
239
+ }), t[16] = _, t[17] = w);
240
+ let T;
241
+ t[18] !== S || t[19] !== C || t[20] !== w ? (T = /* @__PURE__ */ a("div", {
242
+ className: "flex items-center gap-2",
243
+ children: [
244
+ S,
245
+ C,
246
+ w
247
+ ]
248
+ }), t[18] = S, t[19] = C, t[20] = w, t[21] = T) : T = t[21];
249
+ let E;
250
+ t[22] !== x || t[23] !== T ? (E = /* @__PURE__ */ a("div", {
251
+ className: "flex items-center justify-between gap-2",
252
+ children: [x, T]
253
+ }), t[22] = x, t[23] = T, t[24] = E) : E = t[24];
254
+ let D;
255
+ t[25] === h ? D = t[26] : (D = /* @__PURE__ */ i("span", {
256
+ className: "text-sm font-semibold text-secondary",
257
+ children: h
258
+ }), t[25] = h, t[26] = D);
259
+ let O;
260
+ t[27] === _ ? O = t[28] : (O = /* @__PURE__ */ i("button", {
261
+ type: "button",
262
+ className: "flex h-8 w-8 items-center justify-center rounded border border-primary/50 text-primary",
263
+ onClick: () => _("children", -1),
264
+ "aria-label": "Decrease children",
265
+ children: "−"
266
+ }), t[27] = _, t[28] = O);
267
+ let k;
268
+ t[29] === n.children ? k = t[30] : (k = /* @__PURE__ */ i("span", {
269
+ className: "min-w-[2ch] text-center font-bold text-secondary",
270
+ children: n.children
271
+ }), t[29] = n.children, t[30] = k);
272
+ let A;
273
+ t[31] === _ ? A = t[32] : (A = /* @__PURE__ */ i("button", {
274
+ type: "button",
275
+ className: "flex h-8 w-8 items-center justify-center rounded border border-primary/50 text-primary",
276
+ onClick: () => _("children", 1),
277
+ "aria-label": "Increase children",
278
+ children: "+"
279
+ }), t[31] = _, t[32] = A);
280
+ let j;
281
+ t[33] !== O || t[34] !== k || t[35] !== A ? (j = /* @__PURE__ */ a("div", {
282
+ className: "flex items-center gap-2",
283
+ children: [
284
+ O,
285
+ k,
286
+ A
287
+ ]
288
+ }), t[33] = O, t[34] = k, t[35] = A, t[36] = j) : j = t[36];
289
+ let M;
290
+ t[37] !== D || t[38] !== j ? (M = /* @__PURE__ */ a("div", {
291
+ className: "flex items-center justify-between gap-2",
292
+ children: [D, j]
293
+ }), t[37] = D, t[38] = j, t[39] = M) : M = t[39];
294
+ let N;
295
+ return t[40] !== y || t[41] !== b || t[42] !== E || t[43] !== M ? (N = /* @__PURE__ */ a("div", {
296
+ className: y,
297
+ children: [
298
+ b,
299
+ E,
300
+ M
301
+ ]
302
+ }), t[40] = y, t[41] = b, t[42] = E, t[43] = M, t[44] = N) : N = t[44], N;
303
+ }
304
+ var ie = {
305
+ destinationPlaceholder: "Search destination",
306
+ whereLabel: "Where",
307
+ checkIn: "Check-in",
308
+ checkOut: "Check-out",
309
+ selectDate: "Select date",
310
+ guests: "Guests",
311
+ search: "Search",
312
+ noResults: "No results"
313
+ };
314
+ function h(e) {
315
+ let n = r(83), { destination: o, placeId: s, onDestinationChange: c, onPlaceIdChange: l, checkIn: u, onCheckInChange: d, checkOut: p, onCheckOutChange: h, guests: g, onGuestsChange: _, onSearch: v, fetchSuggestions: y, fetchDebounceMs: b, autoCompleteLoading: x, autoCompleteResults: S, labels: C, requireCheckoutWhenCheckIn: w, onValidationError: T, className: E } = e, D = w === void 0 ? !0 : w, O = E === void 0 ? "" : E, k;
316
+ n[0] === C ? k = n[1] : (k = {
317
+ ...ie,
318
+ ...C
319
+ }, n[0] = C, n[1] = k);
320
+ let A = k, j = ee(null), M = ee(null), N;
321
+ n[2] === Symbol.for("react.memo_cache_sentinel") ? (N = m(), n[2] = N) : N = n[2];
322
+ let ae = N, P;
323
+ n[3] === u ? P = n[4] : (P = u ? te(u, 1) : ae, n[3] = u, n[4] = P);
324
+ let oe = P, F;
325
+ n[5] !== u || n[6] !== p || n[7] !== v || n[8] !== T || n[9] !== D ? (F = () => {
326
+ if (D && u && !p) {
327
+ T?.("Please select check-out date.");
328
+ return;
329
+ }
330
+ v();
331
+ }, n[5] = u, n[6] = p, n[7] = v, n[8] = T, n[9] = D, n[10] = F) : F = n[10];
332
+ let se = F, ce = `mx-auto mb-4 w-full lg:max-w-[80%] xl:max-w-[70%] ${O}`, I;
333
+ n[11] === ce ? I = n[12] : (I = ce.trim(), n[11] = ce, n[12] = I);
334
+ let L;
335
+ n[13] !== x || n[14] !== S || n[15] !== o || n[16] !== b || n[17] !== y || n[18] !== A.destinationPlaceholder || n[19] !== A.noResults || n[20] !== c || n[21] !== l || n[22] !== s ? (L = /* @__PURE__ */ i(ne, {
336
+ destination: o,
337
+ placeId: s,
338
+ onDestinationChange: c,
339
+ onPlaceIdChange: l,
340
+ fetchSuggestions: y,
341
+ fetchDebounceMs: b,
342
+ autoCompleteLoading: x,
343
+ autoCompleteResults: S,
344
+ variant: "default",
345
+ placeholder: A.destinationPlaceholder,
346
+ noResultsText: A.noResults
347
+ }), n[13] = x, n[14] = S, n[15] = o, n[16] = b, n[17] = y, n[18] = A.destinationPlaceholder, n[19] = A.noResults, n[20] = c, n[21] = l, n[22] = s, n[23] = L) : L = n[23];
348
+ let le;
349
+ n[24] === Symbol.for("react.memo_cache_sentinel") ? (le = () => j.current?.open(), n[24] = le) : le = n[24];
350
+ let ue;
351
+ n[25] === Symbol.for("react.memo_cache_sentinel") ? (ue = /* @__PURE__ */ i(f, { className: "h-5 w-5 fill-primary" }), n[25] = ue) : ue = n[25];
352
+ let R;
353
+ n[26] === A.checkIn ? R = n[27] : (R = /* @__PURE__ */ i("button", {
354
+ type: "button",
355
+ className: "cursor-pointer",
356
+ onClick: le,
357
+ "aria-label": A.checkIn,
358
+ children: ue
359
+ }), n[26] = A.checkIn, n[27] = R);
360
+ let z;
361
+ n[28] === Symbol.for("react.memo_cache_sentinel") ? (z = () => j.current?.open(), n[28] = z) : z = n[28];
362
+ let B;
363
+ n[29] === A.checkIn ? B = n[30] : (B = /* @__PURE__ */ i("button", {
364
+ type: "button",
365
+ className: "block cursor-pointer text-left text-base font-bold text-primary",
366
+ onClick: z,
367
+ children: A.checkIn
368
+ }), n[29] = A.checkIn, n[30] = B);
369
+ let V;
370
+ n[31] !== u || n[32] !== A.selectDate || n[33] !== d ? (V = /* @__PURE__ */ i(t, {
371
+ ref: j,
372
+ value: u,
373
+ onChange: d,
374
+ placeholder: A.selectDate,
375
+ valueFormat: "iso",
376
+ min: ae,
377
+ className: "w-full min-w-0",
378
+ inputClassName: "text-sm font-bold"
379
+ }), n[31] = u, n[32] = A.selectDate, n[33] = d, n[34] = V) : V = n[34];
380
+ let H;
381
+ n[35] !== B || n[36] !== V ? (H = /* @__PURE__ */ a("div", {
382
+ className: "flex w-full min-w-0 flex-col",
383
+ children: [B, V]
384
+ }), n[35] = B, n[36] = V, n[37] = H) : H = n[37];
385
+ let U;
386
+ n[38] !== R || n[39] !== H ? (U = /* @__PURE__ */ i("div", {
387
+ className: "flex w-full flex-col items-center justify-center rounded-[5px] border border-primary/50 bg-white",
388
+ children: /* @__PURE__ */ a("div", {
389
+ className: "flex w-full flex-row items-center gap-2 p-2",
390
+ children: [R, H]
391
+ })
392
+ }), n[38] = R, n[39] = H, n[40] = U) : U = n[40];
393
+ let de = `flex w-full flex-col items-center justify-center rounded-[5px] border border-primary/50 bg-white ${u ? "" : "cursor-not-allowed opacity-50"}`, W = !u, G;
394
+ n[41] === Symbol.for("react.memo_cache_sentinel") ? (G = () => M.current?.open(), n[41] = G) : G = n[41];
395
+ let K;
396
+ n[42] === Symbol.for("react.memo_cache_sentinel") ? (K = /* @__PURE__ */ i(f, { className: "h-5 w-5 fill-primary" }), n[42] = K) : K = n[42];
397
+ let q;
398
+ n[43] !== A.checkOut || n[44] !== W ? (q = /* @__PURE__ */ i("button", {
399
+ type: "button",
400
+ className: "cursor-pointer disabled:pointer-events-none",
401
+ disabled: W,
402
+ onClick: G,
403
+ "aria-label": A.checkOut,
404
+ children: K
405
+ }), n[43] = A.checkOut, n[44] = W, n[45] = q) : q = n[45];
406
+ let J = !u, Y;
407
+ n[46] === Symbol.for("react.memo_cache_sentinel") ? (Y = () => M.current?.open(), n[46] = Y) : Y = n[46];
408
+ let X;
409
+ n[47] !== A.checkOut || n[48] !== J ? (X = /* @__PURE__ */ i("button", {
410
+ type: "button",
411
+ className: "block cursor-pointer text-left text-base font-bold text-primary disabled:cursor-not-allowed",
412
+ disabled: J,
413
+ onClick: Y,
414
+ children: A.checkOut
415
+ }), n[47] = A.checkOut, n[48] = J, n[49] = X) : X = n[49];
416
+ let Z = !u, Q;
417
+ n[50] !== p || n[51] !== A.selectDate || n[52] !== oe || n[53] !== h || n[54] !== Z ? (Q = /* @__PURE__ */ i(t, {
418
+ ref: M,
419
+ value: p,
420
+ onChange: h,
421
+ placeholder: A.selectDate,
422
+ valueFormat: "iso",
423
+ min: oe,
424
+ disabled: Z,
425
+ className: "w-full min-w-0",
426
+ inputClassName: "text-sm font-bold"
427
+ }), n[50] = p, n[51] = A.selectDate, n[52] = oe, n[53] = h, n[54] = Z, n[55] = Q) : Q = n[55];
428
+ let $;
429
+ n[56] !== X || n[57] !== Q ? ($ = /* @__PURE__ */ a("div", {
430
+ className: "flex w-full min-w-0 flex-col",
431
+ children: [X, Q]
432
+ }), n[56] = X, n[57] = Q, n[58] = $) : $ = n[58];
433
+ let fe;
434
+ n[59] !== q || n[60] !== $ ? (fe = /* @__PURE__ */ a("div", {
435
+ className: "flex w-full flex-row items-center gap-2 p-2",
436
+ children: [q, $]
437
+ }), n[59] = q, n[60] = $, n[61] = fe) : fe = n[61];
438
+ let pe;
439
+ n[62] !== de || n[63] !== fe ? (pe = /* @__PURE__ */ i("div", {
440
+ className: de,
441
+ children: fe
442
+ }), n[62] = de, n[63] = fe, n[64] = pe) : pe = n[64];
443
+ let me;
444
+ n[65] !== U || n[66] !== pe ? (me = /* @__PURE__ */ a("div", {
445
+ className: "grid grid-cols-2 gap-2",
446
+ children: [U, pe]
447
+ }), n[65] = U, n[66] = pe, n[67] = me) : me = n[67];
448
+ let he;
449
+ n[68] !== g || n[69] !== A.guests || n[70] !== _ ? (he = /* @__PURE__ */ i(re, {
450
+ label: A.guests,
451
+ value: g,
452
+ onChange: _
453
+ }), n[68] = g, n[69] = A.guests, n[70] = _, n[71] = he) : he = n[71];
454
+ let ge;
455
+ n[72] !== se || n[73] !== A.search ? (ge = /* @__PURE__ */ i("button", {
456
+ type: "button",
457
+ className: "flex w-full cursor-pointer items-center justify-center rounded-[5px] bg-primary px-5 py-2.5 text-[14px] font-bold text-white transition-colors md:text-[16px]",
458
+ onClick: se,
459
+ children: A.search
460
+ }), n[72] = se, n[73] = A.search, n[74] = ge) : ge = n[74];
461
+ let _e;
462
+ n[75] !== me || n[76] !== he || n[77] !== ge || n[78] !== L ? (_e = /* @__PURE__ */ a("div", {
463
+ className: "space-y-2 rounded-[10px] p-[10px] shadow-primary",
464
+ children: [
465
+ L,
466
+ me,
467
+ he,
468
+ ge
469
+ ]
470
+ }), n[75] = me, n[76] = he, n[77] = ge, n[78] = L, n[79] = _e) : _e = n[79];
471
+ let ve;
472
+ return n[80] !== _e || n[81] !== I ? (ve = /* @__PURE__ */ i("div", {
473
+ className: I,
474
+ children: _e
475
+ }), n[80] = _e, n[81] = I, n[82] = ve) : ve = n[82], ve;
476
+ }
477
+ function g(n) {
478
+ let o = r(73), { destination: s, placeId: c, onDestinationChange: ee, onPlaceIdChange: l, checkIn: u, onCheckInChange: d, checkOut: p, onCheckOutChange: h, guests: g, onGuestsChange: _, onSearch: v, fetchSuggestions: y, fetchDebounceMs: b, autoCompleteLoading: x, autoCompleteResults: S, labels: C, guestsPlaceholder: w, requireCheckoutWhenCheckIn: T, onValidationError: E, className: D } = n, O = w === void 0 ? "Add guests" : w, k = T === void 0 ? !0 : T, A = D === void 0 ? "" : D, j;
479
+ o[0] === C ? j = o[1] : (j = {
480
+ ...ie,
481
+ ...C
482
+ }, o[0] = C, o[1] = j);
483
+ let M = j, N;
484
+ o[2] === Symbol.for("react.memo_cache_sentinel") ? (N = m(), o[2] = N) : N = o[2];
485
+ let ae = N, P;
486
+ o[3] === u ? P = o[4] : (P = u ? te(u, 1) : ae, o[3] = u, o[4] = P);
487
+ let oe = P, F;
488
+ o[5] !== u || o[6] !== p || o[7] !== v || o[8] !== E || o[9] !== k ? (F = () => {
489
+ if (k && u && !p) {
490
+ E?.("Please select check-out date.");
491
+ return;
492
+ }
493
+ v();
494
+ }, o[5] = u, o[6] = p, o[7] = v, o[8] = E, o[9] = k, o[10] = F) : F = o[10];
495
+ let se = F, ce = `flex w-full flex-col ${A}`, I;
496
+ o[11] === ce ? I = o[12] : (I = ce.trim(), o[11] = ce, o[12] = I);
497
+ let L;
498
+ o[13] !== x || o[14] !== S || o[15] !== s || o[16] !== b || o[17] !== y || o[18] !== M.destinationPlaceholder || o[19] !== M.noResults || o[20] !== M.whereLabel || o[21] !== ee || o[22] !== l || o[23] !== c ? (L = /* @__PURE__ */ i(ne, {
499
+ destination: s,
500
+ placeId: c,
501
+ onDestinationChange: ee,
502
+ onPlaceIdChange: l,
503
+ fetchSuggestions: y,
504
+ fetchDebounceMs: b,
505
+ autoCompleteLoading: x,
506
+ autoCompleteResults: S,
507
+ variant: "horizontal",
508
+ placeholder: M.destinationPlaceholder,
509
+ whereLabel: M.whereLabel,
510
+ noResultsText: M.noResults
511
+ }), o[13] = x, o[14] = S, o[15] = s, o[16] = b, o[17] = y, o[18] = M.destinationPlaceholder, o[19] = M.noResults, o[20] = M.whereLabel, o[21] = ee, o[22] = l, o[23] = c, o[24] = L) : L = o[24];
512
+ let le;
513
+ o[25] === Symbol.for("react.memo_cache_sentinel") ? (le = /* @__PURE__ */ i("div", { className: "w-full border-t border-dashed border-primary/20 sm:hidden" }), o[25] = le) : le = o[25];
514
+ let ue;
515
+ o[26] === Symbol.for("react.memo_cache_sentinel") ? (ue = /* @__PURE__ */ i(f, { className: "h-5 w-5 shrink-0 fill-primary" }), o[26] = ue) : ue = o[26];
516
+ let R;
517
+ o[27] === M.checkIn ? R = o[28] : (R = /* @__PURE__ */ i("span", {
518
+ className: "text-base font-bold text-primary",
519
+ children: M.checkIn
520
+ }), o[27] = M.checkIn, o[28] = R);
521
+ let z;
522
+ o[29] !== u || o[30] !== M.selectDate || o[31] !== d ? (z = /* @__PURE__ */ i(t, {
523
+ value: u,
524
+ onChange: d,
525
+ placeholder: M.selectDate,
526
+ valueFormat: "iso",
527
+ min: ae,
528
+ className: "w-full min-w-0",
529
+ inputClassName: "!h-auto !p-0 !text-sm font-bold"
530
+ }), o[29] = u, o[30] = M.selectDate, o[31] = d, o[32] = z) : z = o[32];
531
+ let B;
532
+ o[33] !== R || o[34] !== z ? (B = /* @__PURE__ */ i("div", {
533
+ className: "relative flex w-1/2 flex-col sm:w-full sm:border-r sm:border-dashed sm:border-primary/50 md:w-1/5 sm:px-3 sm:pb-0",
534
+ children: /* @__PURE__ */ a("div", {
535
+ className: "flex w-full items-center gap-2 p-2",
536
+ children: [ue, /* @__PURE__ */ a("div", {
537
+ className: "flex min-w-0 flex-col items-start",
538
+ children: [R, z]
539
+ })]
540
+ })
541
+ }), o[33] = R, o[34] = z, o[35] = B) : B = o[35];
542
+ let V;
543
+ o[36] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ i("div", { className: "mx-1 h-8 border-r border-dashed border-primary/50 sm:hidden" }), o[36] = V) : V = o[36];
544
+ let H;
545
+ o[37] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ i(f, { className: "h-5 w-5 shrink-0 fill-primary" }), o[37] = H) : H = o[37];
546
+ let U;
547
+ o[38] === M.checkOut ? U = o[39] : (U = /* @__PURE__ */ i("span", {
548
+ className: "text-base font-bold text-primary",
549
+ children: M.checkOut
550
+ }), o[38] = M.checkOut, o[39] = U);
551
+ let de = !u, W;
552
+ o[40] !== p || o[41] !== M.selectDate || o[42] !== oe || o[43] !== h || o[44] !== de ? (W = /* @__PURE__ */ i(t, {
553
+ value: p,
554
+ onChange: h,
555
+ placeholder: M.selectDate,
556
+ valueFormat: "iso",
557
+ min: oe,
558
+ disabled: de,
559
+ className: "w-full min-w-0",
560
+ inputClassName: "!h-auto !p-0 !text-sm font-bold"
561
+ }), o[40] = p, o[41] = M.selectDate, o[42] = oe, o[43] = h, o[44] = de, o[45] = W) : W = o[45];
562
+ let G;
563
+ o[46] !== U || o[47] !== W ? (G = /* @__PURE__ */ i("div", {
564
+ className: "relative flex w-1/2 flex-col sm:w-full sm:border-r sm:border-dashed sm:border-primary/50 md:w-1/5 sm:px-3 sm:pb-0",
565
+ children: /* @__PURE__ */ a("div", {
566
+ className: "flex w-full items-center gap-2 p-2",
567
+ children: [H, /* @__PURE__ */ a("div", {
568
+ className: "flex min-w-0 flex-col items-start",
569
+ children: [U, W]
570
+ })]
571
+ })
572
+ }), o[46] = U, o[47] = W, o[48] = G) : G = o[48];
573
+ let K;
574
+ o[49] !== B || o[50] !== G ? (K = /* @__PURE__ */ a("div", {
575
+ className: "flex w-full flex-row items-center py-2 sm:contents sm:py-0",
576
+ children: [
577
+ B,
578
+ V,
579
+ G
580
+ ]
581
+ }), o[49] = B, o[50] = G, o[51] = K) : K = o[51];
582
+ let q;
583
+ o[52] === Symbol.for("react.memo_cache_sentinel") ? (q = /* @__PURE__ */ i("div", { className: "w-full border-t border-dashed border-primary/20 sm:hidden" }), o[52] = q) : q = o[52];
584
+ let J;
585
+ o[53] !== g || o[54] !== M.guests || o[55] !== _ ? (J = /* @__PURE__ */ i(re, {
586
+ label: M.guests,
587
+ value: g,
588
+ onChange: _,
589
+ className: "border-0 p-2 shadow-none"
590
+ }), o[53] = g, o[54] = M.guests, o[55] = _, o[56] = J) : J = o[56];
591
+ let Y;
592
+ o[57] === O ? Y = o[58] : (Y = /* @__PURE__ */ i("span", {
593
+ className: "px-3 pb-1 text-xs text-secondary/70 sm:hidden",
594
+ children: O
595
+ }), o[57] = O, o[58] = Y);
596
+ let X;
597
+ o[59] !== J || o[60] !== Y ? (X = /* @__PURE__ */ a("div", {
598
+ className: "flex w-full flex-col pb-3 sm:w-full sm:px-3 md:w-1/5 sm:pb-0",
599
+ children: [J, Y]
600
+ }), o[59] = J, o[60] = Y, o[61] = X) : X = o[61];
601
+ let Z;
602
+ o[62] !== se || o[63] !== M.search ? (Z = /* @__PURE__ */ i("div", {
603
+ className: "flex w-full items-center justify-center sm:min-w-[120px] sm:max-w-[200px] sm:shrink-0 sm:pl-2",
604
+ children: /* @__PURE__ */ i(e, {
605
+ type: "button",
606
+ title: M.search,
607
+ width: "full",
608
+ className: "w-full rounded-medium sm:rounded-primary md:rounded-medium lg:rounded-primary",
609
+ onClick: se
610
+ })
611
+ }), o[62] = se, o[63] = M.search, o[64] = Z) : Z = o[64];
612
+ let Q;
613
+ o[65] !== L || o[66] !== K || o[67] !== X || o[68] !== Z ? (Q = /* @__PURE__ */ a("div", {
614
+ className: "flex w-full flex-col items-stretch justify-between rounded-xl bg-white p-3 text-start shadow-primary sm:flex-row sm:gap-2 sm:p-4",
615
+ children: [
616
+ L,
617
+ le,
618
+ K,
619
+ q,
620
+ X,
621
+ Z
622
+ ]
623
+ }), o[65] = L, o[66] = K, o[67] = X, o[68] = Z, o[69] = Q) : Q = o[69];
624
+ let $;
625
+ return o[70] !== Q || o[71] !== I ? ($ = /* @__PURE__ */ i("div", {
626
+ className: I,
627
+ children: Q
628
+ }), o[70] = Q, o[71] = I, o[72] = $) : $ = o[72], $;
629
+ }
630
+ //#endregion
631
+ export { g as HorizontalSearchBar, h as SearchBar, ne as SearchBarDestinationField, re as SearchGuestsField };