@loczer/storefront-sdk 0.187.0 → 0.189.0

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.
Files changed (66) hide show
  1. package/dist/chunks/booking-engine/dist/models/{Product.shared-CTuk4fiR.js → Product.shared-IYOeC3N7.js} +12 -10
  2. package/dist/chunks/booking-engine/dist/schemas/{base-asset-B_Dm8_Vk.js → base-asset-zsUj5_3O.js} +1 -1
  3. package/dist/chunks/booking-engine/dist/schemas/{base-booking-DW8AEPKo.js → base-booking-TzCge_mR.js} +2 -2
  4. package/dist/chunks/booking-engine/dist/schemas/{base-product-1H8l2aUv.js → base-product-DvFFzAcg.js} +1 -1
  5. package/dist/chunks/booking-engine/dist/schemas/{booking-engine-configuration-D02MRF9U.js → booking-engine-configuration-LnrhShqm.js} +4 -1
  6. package/dist/chunks/booking-engine/dist/schemas/{cart-inputs-j1yWfJxO.js → cart-inputs-B0HpcFe5.js} +1 -1
  7. package/dist/chunks/booking-engine/dist/schemas/{public-booking-engine-configuration-BnJ_H-p1.js → public-booking-engine-configuration-CEM9mexX.js} +1 -1
  8. package/dist/chunks/booking-engine/dist/schemas-BNUzqsci.js +13 -0
  9. package/dist/chunks/ui/dist/Map/{MapContent-QPkuTBvK.js → MapContent-PK-ptOx6.js} +126 -94
  10. package/dist/chunks/ui/dist/Map/mapboxError-oRn0l3EE.js +25 -0
  11. package/dist/chunks/ui/dist/{Map-BXmRf5Ep.js → Map-BwXj49kV.js} +1 -1
  12. package/dist/components/BookingBikeVariantDialog/index.d.ts +2 -1
  13. package/dist/components/BookingBikeVariantDialog/index.d.ts.map +1 -1
  14. package/dist/components/BookingBikeVariantDialog/index.js +39 -38
  15. package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.d.ts.map +1 -1
  16. package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +32 -30
  17. package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.d.ts.map +1 -1
  18. package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.js +127 -122
  19. package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.d.ts.map +1 -1
  20. package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +32 -30
  21. package/dist/components/BookingPeriodSelector/components/BookingTimeSlotsStatus.d.ts +7 -0
  22. package/dist/components/BookingPeriodSelector/components/BookingTimeSlotsStatus.d.ts.map +1 -0
  23. package/dist/components/BookingPeriodSelector/components/BookingTimeSlotsStatus.js +29 -0
  24. package/dist/components/BookingPeriodSelector/index.d.ts +2 -1
  25. package/dist/components/BookingPeriodSelector/index.d.ts.map +1 -1
  26. package/dist/components/BookingPeriodSelector/index.js +15 -14
  27. package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts +11 -0
  28. package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
  29. package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +280 -216
  30. package/dist/components/ContactSection/index.d.ts.map +1 -1
  31. package/dist/components/ContactSection/index.js +120 -116
  32. package/dist/components/Header/index.d.ts.map +1 -1
  33. package/dist/components/Header/index.js +35 -35
  34. package/dist/components/Map/index.js +1 -1
  35. package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts.map +1 -1
  36. package/dist/components/StorefrontCancellationPolicyNotice/index.js +51 -48
  37. package/dist/components/StorefrontInsuranceNotice/index.d.ts +9 -0
  38. package/dist/components/StorefrontInsuranceNotice/index.d.ts.map +1 -0
  39. package/dist/components/StorefrontInsuranceNotice/index.js +191 -0
  40. package/dist/i18n/en.d.ts +24 -0
  41. package/dist/i18n/en.d.ts.map +1 -1
  42. package/dist/i18n/en.js +26 -2
  43. package/dist/i18n/fr.d.ts +24 -0
  44. package/dist/i18n/fr.d.ts.map +1 -1
  45. package/dist/i18n/fr.js +26 -2
  46. package/dist/index.d.ts +91 -0
  47. package/dist/index.js +69 -68
  48. package/dist/lib/booking.js +2 -2
  49. package/dist/lib/checkoutSubmit.js +3 -3
  50. package/dist/lib/fetchStorefrontTimeSlots.d.ts.map +1 -1
  51. package/dist/lib/fetchStorefrontTimeSlots.js +2 -1
  52. package/dist/lib/storefrontProducts.d.ts +16 -0
  53. package/dist/lib/storefrontProducts.d.ts.map +1 -1
  54. package/dist/lib/storefrontProducts.js +27 -22
  55. package/dist/pages/BookingPage.d.ts.map +1 -1
  56. package/dist/pages/BookingPage.js +109 -95
  57. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  58. package/dist/pages/CheckoutPage.js +229 -231
  59. package/dist/pages/HomePage.d.ts.map +1 -1
  60. package/dist/pages/HomePage.js +339 -314
  61. package/dist/pages/ProductPage.d.ts.map +1 -1
  62. package/dist/pages/ProductPage.js +60 -52
  63. package/dist/storefront.css +1 -1
  64. package/dist/storefrontSchemas.js +2 -2
  65. package/package.json +1 -1
  66. package/dist/chunks/booking-engine/dist/schemas-DftrSnTE.js +0 -13
@@ -5,15 +5,15 @@ import a from "../../chunks/assets/whatsapp-m5e0vjnZ.js";
5
5
  import { MISSING_SHOP_ADDRESS as o, MISSING_SHOP_EMAIL as s, MISSING_SHOP_PHONE_NUMBER as c, UNCONFIGURED_SHOP_MAP_CENTER as l } from "../../lib/storefrontMissingValues.js";
6
6
  import { Button as u } from "../../ui/button.js";
7
7
  import { Input as d } from "../../ui/input.js";
8
- import { useStorefront as f } from "../../StorefrontProvider.js";
9
- import { Form as p, FormControl as m, FormField as h, FormItem as g, FormLabel as _, FormMessage as v } from "../../ui/form.js";
10
- import { Textarea as y } from "../../ui/textarea.js";
11
- import { createMarkerElement as b } from "../Map/createMarkerElement.js";
12
- import { Map as x } from "../Map/index.js";
13
- import { z as S } from "zod";
14
- import { useMemo as C } from "react";
15
- import { jsx as w, jsxs as T } from "react/jsx-runtime";
16
- import { PhoneNumberInput as ee, cn as E } from "@rpcbase/ui";
8
+ import { useStorefront as ee } from "../../StorefrontProvider.js";
9
+ import { Form as f, FormControl as p, FormField as m, FormItem as h, FormLabel as g, FormMessage as _ } from "../../ui/form.js";
10
+ import { Textarea as v } from "../../ui/textarea.js";
11
+ import { createMarkerElement as y } from "../Map/createMarkerElement.js";
12
+ import { Map as b } from "../Map/index.js";
13
+ import { z as x } from "zod";
14
+ import { useMemo as S } from "react";
15
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
16
+ import { PhoneNumberInput as T, cn as E } from "@rpcbase/ui";
17
17
  import { toast as D } from "@rpcbase/client";
18
18
  import { useTranslation as O } from "react-i18next";
19
19
  import { Mail as k, MapPin as A, Phone as j } from "lucide-react";
@@ -21,15 +21,15 @@ import { useForm as M, zodResolver as N } from "@rpcbase/form";
21
21
  //#region src/components/ContactSection/index.tsx
22
22
  var P = (e) => e.startsWith("fr") ? "FR" : "US", F = "text-sm font-normal text-current decoration-current underline-offset-4 group-hover:underline", I = "group flex items-start gap-3 text-slate-600 transition-colors hover:text-slate-800";
23
23
  function L({ storeSlug: L }) {
24
- let { t: R, i18n: z } = O(), { storefrontConfiguration: B, mapboxToken: V } = f(), { shop: H } = B, U = r(H), W = H.emailAddress?.trim() ?? "", G = H.address?.trim() ?? "", K = n(H), q = i({
24
+ let { t: R, i18n: z } = O(), { storefrontConfiguration: B, mapboxToken: V } = ee(), { shop: H } = B, U = r(H), W = H.emailAddress?.trim() ?? "", G = H.address?.trim() ?? "", K = n(H), q = i({
25
25
  storefrontConfiguration: B,
26
26
  language: z.language
27
27
  }), J = q?.href, Y = M({
28
- resolver: N(C(() => S.object({
29
- name: S.string().trim().min(1, R("contact_form_validation_name_required")),
30
- emailAddress: S.string().trim().email(R("contact_form_validation_email_invalid")),
31
- phoneNumber: S.string().trim().min(6, R("contact_form_validation_phone_invalid")),
32
- message: S.string().trim().min(1, R("contact_form_validation_message_required")).max(8192, R("contact_form_validation_message_too_long"))
28
+ resolver: N(S(() => x.object({
29
+ name: x.string().trim().min(1, R("contact_form_validation_name_required")),
30
+ emailAddress: x.string().trim().email(R("contact_form_validation_email_invalid")),
31
+ phoneNumber: x.string().trim().min(6, R("contact_form_validation_phone_invalid")),
32
+ message: x.string().trim().min(1, R("contact_form_validation_message_required")).max(8192, R("contact_form_validation_message_too_long"))
33
33
  }), [R, z.language])),
34
34
  defaultValues: {
35
35
  name: "",
@@ -37,10 +37,10 @@ function L({ storeSlug: L }) {
37
37
  phoneNumber: "",
38
38
  message: ""
39
39
  }
40
- }), X = C(() => {
40
+ }), X = S(() => {
41
41
  let e = H.gpsCoordinates;
42
42
  return e ? [e[1], e[0]] : null;
43
- }, [H.gpsCoordinates]), Z = X ?? l, Q = C(() => b(), []), $ = C(() => X ? {
43
+ }, [H.gpsCoordinates]), Z = X ?? l, Q = S(() => y(), []), $ = S(() => X ? {
44
44
  coords: X,
45
45
  element: Q || void 0,
46
46
  offset: [0, -25.5],
@@ -50,187 +50,191 @@ function L({ storeSlug: L }) {
50
50
  G,
51
51
  X,
52
52
  Q
53
- ]), te = C(() => $ ? [$] : [], [$]), ne = Y.handleSubmit(async (n) => {
54
- let r = await fetch(e, {
55
- method: "POST",
56
- headers: { "Content-Type": "application/json" },
57
- body: JSON.stringify({
58
- storeSlug: L,
59
- ...n
60
- })
61
- }), i = await r.json().then((e) => t.safeParse(e)).catch(() => ({ success: !1 }));
62
- if (r.ok && "success" in i && i.success && i.data.success) {
63
- D.success(R("contact_form_success_toast")), Y.reset();
64
- return;
53
+ ]), te = S(() => $ ? [$] : [], [$]), ne = Y.handleSubmit(async (n) => {
54
+ try {
55
+ let r = await fetch(e, {
56
+ method: "POST",
57
+ headers: { "Content-Type": "application/json" },
58
+ body: JSON.stringify({
59
+ storeSlug: L,
60
+ ...n
61
+ })
62
+ }), i = await r.json().then((e) => t.safeParse(e)).catch(() => ({ success: !1 }));
63
+ if (r.ok && "success" in i && i.success && i.data.success) {
64
+ D.success(R("contact_form_success_toast")), Y.reset();
65
+ return;
66
+ }
67
+ let a = "success" in i && i.success && i.data.error ? i.data.error : R("contact_form_error_toast");
68
+ D.error(a);
69
+ } catch (e) {
70
+ console.warn("Storefront contact form request failed", e), D.error(R("contact_form_error_toast"));
65
71
  }
66
- let a = "success" in i && i.success && i.data.error ? i.data.error : R("contact_form_error_toast");
67
- D.error(a);
68
72
  });
69
- return /* @__PURE__ */ w("section", {
73
+ return /* @__PURE__ */ C("section", {
70
74
  id: "contact",
71
75
  className: "border-t bg-slate-50 py-12 scroll-mt-16 sm:scroll-mt-20 sm:py-16",
72
76
  "data-testid": "storefront-contact-form",
73
- children: /* @__PURE__ */ T("div", {
77
+ children: /* @__PURE__ */ w("div", {
74
78
  className: "mx-auto max-w-7xl px-4 sm:px-6",
75
- children: [/* @__PURE__ */ T("div", {
79
+ children: [/* @__PURE__ */ w("div", {
76
80
  className: "mx-auto max-w-2xl text-center",
77
- children: [/* @__PURE__ */ w("h2", {
81
+ children: [/* @__PURE__ */ C("h2", {
78
82
  className: "text-3xl font-semibold tracking-tight text-slate-950",
79
83
  children: R("contact_section_title")
80
- }), /* @__PURE__ */ w("p", {
84
+ }), /* @__PURE__ */ C("p", {
81
85
  className: "mt-3 text-sm text-slate-600 sm:text-base",
82
86
  children: R("contact_section_subtitle")
83
87
  })]
84
- }), /* @__PURE__ */ T("div", {
88
+ }), /* @__PURE__ */ w("div", {
85
89
  className: "mt-8 grid gap-6 rounded-xl border border-slate-200 bg-white p-4 shadow-sm lg:grid-cols-2 lg:p-6",
86
- children: [/* @__PURE__ */ T("div", {
90
+ children: [/* @__PURE__ */ w("div", {
87
91
  className: "flex flex-col gap-6 lg:border-r lg:border-slate-200 lg:pr-6",
88
92
  children: [
89
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h3", {
93
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("h3", {
90
94
  className: "text-lg font-semibold text-slate-950",
91
95
  children: R("contact_section_info_title")
92
- }), /* @__PURE__ */ w("p", {
96
+ }), /* @__PURE__ */ C("p", {
93
97
  className: "mt-2 text-sm text-slate-600",
94
98
  children: R(J ? "contact_section_info_description" : "contact_section_info_description_without_whatsapp")
95
99
  })] }),
96
- /* @__PURE__ */ T("div", {
100
+ /* @__PURE__ */ w("div", {
97
101
  className: "grid gap-5",
98
102
  children: [
99
- q ? /* @__PURE__ */ T("a", {
103
+ q ? /* @__PURE__ */ w("a", {
100
104
  className: I,
101
105
  href: q.href,
102
106
  target: "_blank",
103
107
  rel: "noreferrer",
104
- children: [/* @__PURE__ */ w("span", {
108
+ children: [/* @__PURE__ */ C("span", {
105
109
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors",
106
- children: /* @__PURE__ */ w("img", {
110
+ children: /* @__PURE__ */ C("img", {
107
111
  src: a,
108
112
  className: "h-6 w-6",
109
113
  alt: "",
110
114
  "aria-hidden": "true"
111
115
  })
112
- }), /* @__PURE__ */ T("span", {
116
+ }), /* @__PURE__ */ w("span", {
113
117
  className: "flex min-w-0 flex-col gap-1",
114
- children: [/* @__PURE__ */ w("span", {
118
+ children: [/* @__PURE__ */ C("span", {
115
119
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
116
120
  children: R("contact_section_whatsapp_label")
117
- }), /* @__PURE__ */ w("span", {
121
+ }), /* @__PURE__ */ C("span", {
118
122
  className: F,
119
123
  children: q.phoneDisplay
120
124
  })]
121
125
  })]
122
126
  }) : null,
123
- U ? /* @__PURE__ */ T("a", {
127
+ U ? /* @__PURE__ */ w("a", {
124
128
  className: I,
125
129
  href: U.href,
126
- children: [/* @__PURE__ */ w("span", {
130
+ children: [/* @__PURE__ */ C("span", {
127
131
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors",
128
- children: /* @__PURE__ */ w(j, {
132
+ children: /* @__PURE__ */ C(j, {
129
133
  className: "h-5 w-5",
130
134
  "aria-hidden": "true"
131
135
  })
132
- }), /* @__PURE__ */ T("span", {
136
+ }), /* @__PURE__ */ w("span", {
133
137
  className: "flex min-w-0 flex-col gap-1",
134
- children: [/* @__PURE__ */ w("span", {
138
+ children: [/* @__PURE__ */ C("span", {
135
139
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
136
140
  children: R("contact_section_phone_label")
137
- }), /* @__PURE__ */ w("span", {
141
+ }), /* @__PURE__ */ C("span", {
138
142
  className: F,
139
143
  children: U.phoneDisplay
140
144
  })]
141
145
  })]
142
- }) : /* @__PURE__ */ T("div", {
146
+ }) : /* @__PURE__ */ w("div", {
143
147
  className: "flex items-start gap-3 text-destructive",
144
- children: [/* @__PURE__ */ w("span", {
148
+ children: [/* @__PURE__ */ C("span", {
145
149
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current",
146
- children: /* @__PURE__ */ w(j, {
150
+ children: /* @__PURE__ */ C(j, {
147
151
  className: "h-5 w-5",
148
152
  "aria-hidden": "true"
149
153
  })
150
- }), /* @__PURE__ */ T("span", {
154
+ }), /* @__PURE__ */ w("span", {
151
155
  className: "flex min-w-0 flex-col gap-1",
152
- children: [/* @__PURE__ */ w("span", {
156
+ children: [/* @__PURE__ */ C("span", {
153
157
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
154
158
  children: R("contact_section_phone_label")
155
- }), /* @__PURE__ */ w("span", {
159
+ }), /* @__PURE__ */ C("span", {
156
160
  className: "text-sm font-normal",
157
161
  children: c
158
162
  })]
159
163
  })]
160
164
  }),
161
- W ? /* @__PURE__ */ T("a", {
165
+ W ? /* @__PURE__ */ w("a", {
162
166
  className: I,
163
167
  href: `mailto:${W}`,
164
- children: [/* @__PURE__ */ w("span", {
168
+ children: [/* @__PURE__ */ C("span", {
165
169
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors",
166
- children: /* @__PURE__ */ w(k, {
170
+ children: /* @__PURE__ */ C(k, {
167
171
  className: "h-5 w-5",
168
172
  "aria-hidden": "true"
169
173
  })
170
- }), /* @__PURE__ */ T("span", {
174
+ }), /* @__PURE__ */ w("span", {
171
175
  className: "flex min-w-0 flex-col gap-1",
172
- children: [/* @__PURE__ */ w("span", {
176
+ children: [/* @__PURE__ */ C("span", {
173
177
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
174
178
  children: R("contact_section_email_label")
175
- }), /* @__PURE__ */ w("span", {
179
+ }), /* @__PURE__ */ C("span", {
176
180
  className: F,
177
181
  children: W
178
182
  })]
179
183
  })]
180
- }) : /* @__PURE__ */ T("div", {
184
+ }) : /* @__PURE__ */ w("div", {
181
185
  className: "flex items-start gap-3 text-destructive",
182
- children: [/* @__PURE__ */ w("span", {
186
+ children: [/* @__PURE__ */ C("span", {
183
187
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current",
184
- children: /* @__PURE__ */ w(k, {
188
+ children: /* @__PURE__ */ C(k, {
185
189
  className: "h-5 w-5",
186
190
  "aria-hidden": "true"
187
191
  })
188
- }), /* @__PURE__ */ T("span", {
192
+ }), /* @__PURE__ */ w("span", {
189
193
  className: "flex min-w-0 flex-col gap-1",
190
- children: [/* @__PURE__ */ w("span", {
194
+ children: [/* @__PURE__ */ C("span", {
191
195
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
192
196
  children: R("contact_section_email_label")
193
- }), /* @__PURE__ */ w("span", {
197
+ }), /* @__PURE__ */ C("span", {
194
198
  className: "text-sm font-normal",
195
199
  children: s
196
200
  })]
197
201
  })]
198
202
  }),
199
- K && G ? /* @__PURE__ */ T("a", {
203
+ K && G ? /* @__PURE__ */ w("a", {
200
204
  className: I,
201
205
  href: K,
202
206
  target: "_blank",
203
207
  rel: "noreferrer",
204
- children: [/* @__PURE__ */ w("span", {
208
+ children: [/* @__PURE__ */ C("span", {
205
209
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors",
206
- children: /* @__PURE__ */ w(A, {
210
+ children: /* @__PURE__ */ C(A, {
207
211
  className: "h-5 w-5",
208
212
  "aria-hidden": "true"
209
213
  })
210
- }), /* @__PURE__ */ T("span", {
214
+ }), /* @__PURE__ */ w("span", {
211
215
  className: "flex min-w-0 flex-col gap-1",
212
- children: [/* @__PURE__ */ w("span", {
216
+ children: [/* @__PURE__ */ C("span", {
213
217
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
214
218
  children: R("contact_section_address_label")
215
- }), /* @__PURE__ */ w("span", {
219
+ }), /* @__PURE__ */ C("span", {
216
220
  className: F,
217
221
  children: G
218
222
  })]
219
223
  })]
220
- }) : /* @__PURE__ */ T("div", {
224
+ }) : /* @__PURE__ */ w("div", {
221
225
  className: "flex items-start gap-3 text-destructive",
222
- children: [/* @__PURE__ */ w("span", {
226
+ children: [/* @__PURE__ */ C("span", {
223
227
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current",
224
- children: /* @__PURE__ */ w(A, {
228
+ children: /* @__PURE__ */ C(A, {
225
229
  className: "h-5 w-5",
226
230
  "aria-hidden": "true"
227
231
  })
228
- }), /* @__PURE__ */ T("span", {
232
+ }), /* @__PURE__ */ w("span", {
229
233
  className: "flex min-w-0 flex-col gap-1",
230
- children: [/* @__PURE__ */ w("span", {
234
+ children: [/* @__PURE__ */ C("span", {
231
235
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
232
236
  children: R("contact_section_address_label")
233
- }), /* @__PURE__ */ w("span", {
237
+ }), /* @__PURE__ */ C("span", {
234
238
  className: "text-sm font-normal",
235
239
  children: o
236
240
  })]
@@ -238,10 +242,10 @@ function L({ storeSlug: L }) {
238
242
  })
239
243
  ]
240
244
  }),
241
- /* @__PURE__ */ w("div", {
245
+ /* @__PURE__ */ C("div", {
242
246
  className: "relative",
243
247
  "data-testid": "storefront-contact-map",
244
- children: /* @__PURE__ */ w(x, {
248
+ children: /* @__PURE__ */ C(b, {
245
249
  mapboxToken: V,
246
250
  initialCenter: Z,
247
251
  initialZoom: X ? 10 : 1,
@@ -251,56 +255,56 @@ function L({ storeSlug: L }) {
251
255
  })
252
256
  })
253
257
  ]
254
- }), /* @__PURE__ */ T("div", { children: [
255
- /* @__PURE__ */ w("h3", {
258
+ }), /* @__PURE__ */ w("div", { children: [
259
+ /* @__PURE__ */ C("h3", {
256
260
  className: "text-lg font-semibold text-slate-950",
257
261
  children: R("contact_section_form_title")
258
262
  }),
259
- /* @__PURE__ */ w("p", {
263
+ /* @__PURE__ */ C("p", {
260
264
  className: "mt-2 text-sm text-slate-600",
261
265
  children: R("contact_section_form_description")
262
266
  }),
263
- /* @__PURE__ */ w("div", {
267
+ /* @__PURE__ */ C("div", {
264
268
  className: "mt-6",
265
- children: /* @__PURE__ */ w(p, {
269
+ children: /* @__PURE__ */ C(f, {
266
270
  ...Y,
267
- children: /* @__PURE__ */ T("form", {
271
+ children: /* @__PURE__ */ w("form", {
268
272
  onSubmit: ne,
269
273
  className: "grid gap-4",
270
274
  children: [
271
- /* @__PURE__ */ w(h, {
275
+ /* @__PURE__ */ C(m, {
272
276
  control: Y.control,
273
277
  name: "name",
274
- render: ({ field: e }) => /* @__PURE__ */ T(g, { children: [
275
- /* @__PURE__ */ w(_, { children: R("contact_form_name_label") }),
276
- /* @__PURE__ */ w(m, { children: /* @__PURE__ */ w(d, {
278
+ render: ({ field: e }) => /* @__PURE__ */ w(h, { children: [
279
+ /* @__PURE__ */ C(g, { children: R("contact_form_name_label") }),
280
+ /* @__PURE__ */ C(p, { children: /* @__PURE__ */ C(d, {
277
281
  ...e,
278
282
  placeholder: R("contact_form_name_placeholder"),
279
283
  className: "h-11"
280
284
  }) }),
281
- /* @__PURE__ */ w(v, {})
285
+ /* @__PURE__ */ C(_, {})
282
286
  ] })
283
287
  }),
284
- /* @__PURE__ */ w(h, {
288
+ /* @__PURE__ */ C(m, {
285
289
  control: Y.control,
286
290
  name: "emailAddress",
287
- render: ({ field: e }) => /* @__PURE__ */ T(g, { children: [
288
- /* @__PURE__ */ w(_, { children: R("contact_form_email_label") }),
289
- /* @__PURE__ */ w(m, { children: /* @__PURE__ */ w(d, {
291
+ render: ({ field: e }) => /* @__PURE__ */ w(h, { children: [
292
+ /* @__PURE__ */ C(g, { children: R("contact_form_email_label") }),
293
+ /* @__PURE__ */ C(p, { children: /* @__PURE__ */ C(d, {
290
294
  ...e,
291
295
  type: "email",
292
296
  placeholder: R("contact_form_email_placeholder"),
293
297
  className: "h-11"
294
298
  }) }),
295
- /* @__PURE__ */ w(v, {})
299
+ /* @__PURE__ */ C(_, {})
296
300
  ] })
297
301
  }),
298
- /* @__PURE__ */ w(h, {
302
+ /* @__PURE__ */ C(m, {
299
303
  control: Y.control,
300
304
  name: "phoneNumber",
301
- render: ({ field: e, fieldState: t }) => /* @__PURE__ */ T(g, { children: [
302
- /* @__PURE__ */ w(_, { children: R("contact_form_phone_label") }),
303
- /* @__PURE__ */ w(m, { children: /* @__PURE__ */ w(ee, {
305
+ render: ({ field: e, fieldState: t }) => /* @__PURE__ */ w(h, { children: [
306
+ /* @__PURE__ */ C(g, { children: R("contact_form_phone_label") }),
307
+ /* @__PURE__ */ C(p, { children: /* @__PURE__ */ C(T, {
304
308
  name: e.name,
305
309
  value: e.value ?? "",
306
310
  onBlur: e.onBlur,
@@ -313,34 +317,34 @@ function L({ storeSlug: L }) {
313
317
  placeholder: R("contact_form_phone_placeholder"),
314
318
  className: "relative",
315
319
  inputClassName: E("flex h-11 w-full rounded-md border border-input bg-background py-2 text-base ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", t.error && "border-destructive focus-visible:ring-destructive"),
316
- renderValidationMessage: ({ message: e }) => t.error?.message ? null : /* @__PURE__ */ w(v, {
320
+ renderValidationMessage: ({ message: e }) => t.error?.message ? null : /* @__PURE__ */ C(_, {
317
321
  style: { top: "100%" },
318
- children: /* @__PURE__ */ w("span", { children: e })
322
+ children: /* @__PURE__ */ C("span", { children: e })
319
323
  })
320
324
  }) }),
321
- t.error?.message ? /* @__PURE__ */ w(v, {}) : null
325
+ t.error?.message ? /* @__PURE__ */ C(_, {}) : null
322
326
  ] })
323
327
  }),
324
- /* @__PURE__ */ w(h, {
328
+ /* @__PURE__ */ C(m, {
325
329
  control: Y.control,
326
330
  name: "message",
327
- render: ({ field: e }) => /* @__PURE__ */ T(g, { children: [
328
- /* @__PURE__ */ w(_, { children: R("contact_form_message_label") }),
329
- /* @__PURE__ */ w(m, { children: /* @__PURE__ */ w(y, {
331
+ render: ({ field: e }) => /* @__PURE__ */ w(h, { children: [
332
+ /* @__PURE__ */ C(g, { children: R("contact_form_message_label") }),
333
+ /* @__PURE__ */ C(p, { children: /* @__PURE__ */ C(v, {
330
334
  ...e,
331
335
  rows: 5,
332
336
  placeholder: R("contact_form_message_placeholder"),
333
337
  className: "min-h-[132px]"
334
338
  }) }),
335
- /* @__PURE__ */ w(v, {})
339
+ /* @__PURE__ */ C(_, {})
336
340
  ] })
337
341
  }),
338
- /* @__PURE__ */ T("div", {
342
+ /* @__PURE__ */ w("div", {
339
343
  className: "mt-2 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
340
- children: [/* @__PURE__ */ w("p", {
344
+ children: [/* @__PURE__ */ C("p", {
341
345
  className: "text-xs text-slate-500",
342
346
  children: R("contact_form_privacy_hint")
343
- }), /* @__PURE__ */ w(u, {
347
+ }), /* @__PURE__ */ C(u, {
344
348
  type: "submit",
345
349
  disabled: Y.formState.isSubmitting,
346
350
  children: Y.formState.isSubmitting ? R("contact_form_submitting_button") : R("contact_form_submit_button")
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAKtE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAQD,wBAAgB,MAAM,CAAC,EAAE,uBAAuB,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,WAAW,2CAyKlG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAKtE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAQD,wBAAgB,MAAM,CAAC,EAAE,uBAAuB,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,WAAW,2CA6KlG"}
@@ -10,29 +10,29 @@ import { Button as c } from "../../ui/button.js";
10
10
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
11
11
  import { cn as d, useScrollHideOnDown as f } from "@rpcbase/ui";
12
12
  import { useMediaQuery as p, useThrottledMeasure as m } from "@rpcbase/client";
13
- import { Link as h, useLocation as g, useParams as _ } from "@rpcbase/router";
14
- import { useTranslation as v } from "react-i18next";
15
- import { ArrowRight as y, ShoppingCart as b } from "lucide-react";
13
+ import { Link as h, useLocation as g, useParams as ee } from "@rpcbase/router";
14
+ import { useTranslation as _ } from "react-i18next";
15
+ import { ArrowRight as v, ShoppingCart as y } from "lucide-react";
16
16
  //#region src/components/Header/index.tsx
17
- var x = 36, S = (e, t) => {
17
+ var b = 36, x = (e, t) => {
18
18
  let n = e?.trim() ?? "";
19
19
  return n ? r(n, t ?? "") : "";
20
20
  };
21
- function C({ storefrontConfiguration: r, whatsappHref: C, whatsappPhoneDisplay: w }) {
22
- let { t: T, i18n: E } = v(), { storeSlug: D } = _(), O = g(), { itemCount: k } = t(), A = p("(max-width: 640px)"), [j, M] = m(), N = M?.height ?? x, P = f({
23
- enabled: A,
24
- thresholdPx: N
25
- }), F = A && P ? `translateY(-${N}px)` : "translateY(0)", I = () => {
26
- let e = E.language.startsWith("fr") ? "en" : "fr";
27
- E.changeLanguage(e);
28
- }, L = `/${D ?? ""}`, R = e(new URLSearchParams(O.search), D).toString(), z = R ? `?${R}` : "", B = `${L}/booking${z}`, V = `${L}/checkout${z}`, H = r?.shop.name?.trim() ?? "", U = r?.shop.emailAddress?.trim() ?? "", W = r?.workspace?.workspaceLanguage, G = n(r?.content?.tagline, E.language, W).trim(), K = o(r?.shop), q = G || K || "[Missing shop address]", J = !G && !K, Y = n(r?.content?.topBannerMessage, E.language, W).trim() || T("top_bar_message"), X = S(r?.content?.logoWideImageId, D), Z = S(r?.shop.logoImageId ?? r?.content?.logoSquareImageId, D), Q = X.length > 0, $ = Z.length > 0;
21
+ function S({ storefrontConfiguration: r, whatsappHref: S, whatsappPhoneDisplay: C }) {
22
+ let { t: w, i18n: T } = _(), { storeSlug: E } = ee(), D = g(), { itemCount: O } = t(), k = p("(max-width: 640px)"), [A, te] = m(), j = te?.height ?? b, M = f({
23
+ enabled: k,
24
+ thresholdPx: j
25
+ }), N = k && M ? `translateY(-${j}px)` : "translateY(0)", P = () => {
26
+ let e = T.language.startsWith("fr") ? "en" : "fr";
27
+ T.changeLanguage(e);
28
+ }, F = `/${E ?? ""}`, I = e(new URLSearchParams(D.search), E), L = I.toString(), R = !!(I.get("start_time")?.trim() && I.get("end_time")?.trim()), z = L ? `?${L}` : "", B = `${F}/booking${z}`, V = `${F}/checkout${z}`, H = r?.shop.name?.trim() ?? "", U = r?.shop.emailAddress?.trim() ?? "", W = r?.workspace?.workspaceLanguage, G = n(r?.content?.tagline, T.language, W).trim(), K = o(r?.shop), q = G || K || "[Missing shop address]", J = !G && !K, Y = n(r?.content?.topBannerMessage, T.language, W).trim() || w("top_bar_message"), X = x(r?.content?.logoWideImageId, E), Z = x(r?.shop.logoImageId ?? r?.content?.logoSquareImageId, E), Q = X.length > 0, $ = Z.length > 0;
29
29
  return /* @__PURE__ */ u("div", {
30
30
  className: "sticky top-0 z-30",
31
31
  children: [/* @__PURE__ */ l("div", {
32
32
  className: "transition-transform duration-300",
33
- style: { transform: F },
33
+ style: { transform: N },
34
34
  children: /* @__PURE__ */ l("div", {
35
- ref: j,
35
+ ref: A,
36
36
  className: "bg-slate-950 text-white",
37
37
  children: /* @__PURE__ */ u("div", {
38
38
  className: "mx-auto flex max-w-7xl items-center justify-between gap-3 px-4 py-2 text-xs sm:px-6",
@@ -49,30 +49,30 @@ function C({ storefrontConfiguration: r, whatsappHref: C, whatsappPhoneDisplay:
49
49
  }) : /* @__PURE__ */ l("span", {
50
50
  className: "inline-flex items-center rounded-md px-2 py-1 text-destructive",
51
51
  children: a
52
- }), C ? /* @__PURE__ */ u("a", {
52
+ }), S ? /* @__PURE__ */ u("a", {
53
53
  className: "inline-flex items-center gap-2 rounded-md px-2 py-1 text-white/90 hover:bg-white/10 hover:text-white",
54
- href: C,
54
+ href: S,
55
55
  target: "_blank",
56
56
  rel: "noreferrer",
57
- "aria-label": `WhatsApp${w ? ` ${w}` : ""}`,
57
+ "aria-label": `WhatsApp${C ? ` ${C}` : ""}`,
58
58
  children: [/* @__PURE__ */ l("img", {
59
59
  src: i,
60
60
  className: "h-5 w-5 shrink-0",
61
61
  alt: "",
62
62
  "aria-hidden": "true"
63
- }), w ? /* @__PURE__ */ l("span", { children: w }) : null]
63
+ }), C ? /* @__PURE__ */ l("span", { children: C }) : null]
64
64
  }) : null]
65
65
  })]
66
66
  })
67
67
  })
68
68
  }), /* @__PURE__ */ l("header", {
69
69
  className: "sticky top-0 z-30 border-b bg-white/90 backdrop-blur transition-transform duration-300",
70
- style: { transform: F },
70
+ style: { transform: N },
71
71
  children: /* @__PURE__ */ u("div", {
72
72
  className: "mx-auto flex max-w-7xl items-center justify-between gap-4 px-4 py-3 sm:px-6",
73
73
  children: [
74
74
  /* @__PURE__ */ u(h, {
75
- to: L,
75
+ to: F,
76
76
  className: "flex min-w-0 items-center gap-3",
77
77
  children: [$ ? /* @__PURE__ */ l("span", {
78
78
  className: "inline-flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-slate-200 bg-white",
@@ -109,23 +109,23 @@ function C({ storefrontConfiguration: r, whatsappHref: C, whatsappPhoneDisplay:
109
109
  children: [
110
110
  /* @__PURE__ */ l(h, {
111
111
  className: "hover:text-slate-950",
112
- to: `${L}${z}#categories`,
113
- children: /* @__PURE__ */ l("span", { children: T("nav_categories") })
112
+ to: `${F}${z}#categories`,
113
+ children: /* @__PURE__ */ l("span", { children: w("nav_categories") })
114
114
  }),
115
115
  /* @__PURE__ */ l(h, {
116
116
  className: "hover:text-slate-950",
117
- to: `${L}${z}#featured`,
118
- children: /* @__PURE__ */ l("span", { children: T("nav_featured") })
117
+ to: `${F}${z}#featured`,
118
+ children: /* @__PURE__ */ l("span", { children: w("nav_featured") })
119
119
  }),
120
120
  /* @__PURE__ */ l(h, {
121
121
  className: "hover:text-slate-950",
122
122
  to: B,
123
- children: /* @__PURE__ */ l("span", { children: T("nav_products") })
123
+ children: /* @__PURE__ */ l("span", { children: w("nav_products") })
124
124
  }),
125
125
  /* @__PURE__ */ l(h, {
126
126
  className: "hover:text-slate-950",
127
- to: `${L}${z}#contact`,
128
- children: /* @__PURE__ */ l("span", { children: T("nav_contact") })
127
+ to: `${F}${z}#contact`,
128
+ children: /* @__PURE__ */ l("span", { children: w("nav_contact") })
129
129
  })
130
130
  ]
131
131
  }),
@@ -136,25 +136,25 @@ function C({ storefrontConfiguration: r, whatsappHref: C, whatsappPhoneDisplay:
136
136
  variant: "outline",
137
137
  size: "sm",
138
138
  className: "hidden sm:inline-flex",
139
- onClick: I,
140
- children: /* @__PURE__ */ l("span", { children: T("language_toggle") })
139
+ onClick: P,
140
+ children: /* @__PURE__ */ l("span", { children: w("language_toggle") })
141
141
  }),
142
142
  /* @__PURE__ */ l(c, {
143
143
  asChild: !0,
144
144
  variant: "outline",
145
145
  size: "sm",
146
- className: d("relative gap-2", k > 0 ? "inline-flex" : "hidden"),
146
+ className: d("relative gap-2", O > 0 && R ? "inline-flex" : "hidden"),
147
147
  children: /* @__PURE__ */ u(h, {
148
148
  to: V,
149
149
  children: [
150
- /* @__PURE__ */ l(b, {
150
+ /* @__PURE__ */ l(y, {
151
151
  className: "h-4 w-4",
152
152
  "aria-hidden": "true"
153
153
  }),
154
- /* @__PURE__ */ l("span", { children: T("cart_button") }),
154
+ /* @__PURE__ */ l("span", { children: w("cart_button") }),
155
155
  /* @__PURE__ */ l(s, {
156
156
  className: "absolute -right-2 -top-2 h-5 min-w-5 rounded-full px-1.5 text-xs",
157
- children: /* @__PURE__ */ l("span", { children: k })
157
+ children: /* @__PURE__ */ l("span", { children: O })
158
158
  })
159
159
  ]
160
160
  })
@@ -165,7 +165,7 @@ function C({ storefrontConfiguration: r, whatsappHref: C, whatsappPhoneDisplay:
165
165
  className: "gap-2",
166
166
  children: /* @__PURE__ */ u(h, {
167
167
  to: B,
168
- children: [/* @__PURE__ */ l("span", { children: T("cta_book_now") }), /* @__PURE__ */ l(y, {
168
+ children: [/* @__PURE__ */ l("span", { children: w("cta_book_now") }), /* @__PURE__ */ l(v, {
169
169
  className: "h-4 w-4",
170
170
  "aria-hidden": "true"
171
171
  })]
@@ -179,4 +179,4 @@ function C({ storefrontConfiguration: r, whatsappHref: C, whatsappPhoneDisplay:
179
179
  });
180
180
  }
181
181
  //#endregion
182
- export { C as Header };
182
+ export { S as Header };
@@ -1,4 +1,4 @@
1
- import { Map as e } from "../../chunks/ui/dist/Map-BXmRf5Ep.js";
1
+ import { Map as e } from "../../chunks/ui/dist/Map-BwXj49kV.js";
2
2
  import { createMarkerElement as t } from "./createMarkerElement.js";
3
3
  //#region src/components/Map/index.tsx
4
4
  var n = e;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StorefrontCancellationPolicyNotice/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAMtE,KAAK,kBAAkB,GAAG,uBAAuB,CAAC,eAAe,CAAC,CAAC,oBAAoB,CAAC,CAAA;AACxF,KAAK,sBAAsB,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;AAEjE,KAAK,uCAAuC,GAAG;IAC7C,MAAM,EAAE,kBAAkB,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAOD,eAAO,MAAM,6CAA6C,GACxD,QAAQ,kBAAkB,KACzB,sBAAsB,GAAG,IAG3B,CAAA;AAaD,wBAAgB,kCAAkC,CAAC,EACjD,MAAM,EACN,SAAS,GACV,EAAE,uCAAuC,kDAmGzC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StorefrontCancellationPolicyNotice/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAOtE,KAAK,kBAAkB,GAAG,uBAAuB,CAAC,eAAe,CAAC,CAAC,oBAAoB,CAAC,CAAA;AACxF,KAAK,sBAAsB,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;AAEjE,KAAK,uCAAuC,GAAG;IAC7C,MAAM,EAAE,kBAAkB,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAOD,eAAO,MAAM,6CAA6C,GACxD,QAAQ,kBAAkB,KACzB,sBAAsB,GAAG,IAG3B,CAAA;AAaD,wBAAgB,kCAAkC,CAAC,EACjD,MAAM,EACN,SAAS,GACV,EAAE,uCAAuC,kDA8GzC"}