@loczer/storefront-sdk 0.198.0 → 0.199.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 (45) hide show
  1. package/dist/StorefrontContext.d.ts +483 -0
  2. package/dist/StorefrontContext.d.ts.map +1 -0
  3. package/dist/StorefrontContext.js +39 -0
  4. package/dist/StorefrontProvider.d.ts +6 -486
  5. package/dist/StorefrontProvider.d.ts.map +1 -1
  6. package/dist/StorefrontProvider.js +34 -67
  7. package/dist/components/AboutSection/index.js +5 -5
  8. package/dist/components/BikeProductCard/index.d.ts.map +1 -1
  9. package/dist/components/BikeProductCard/index.js +27 -27
  10. package/dist/components/BookingBikeVariantDialog/index.js +14 -8
  11. package/dist/components/ContactSection/index.js +107 -107
  12. package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
  13. package/dist/components/ContractSaleDocument/Invoice.js +117 -111
  14. package/dist/components/Header/index.js +4 -4
  15. package/dist/components/Layout/index.d.ts.map +1 -1
  16. package/dist/components/Layout/index.js +47 -40
  17. package/dist/components/ProductPriceBadge/index.d.ts +2 -1
  18. package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
  19. package/dist/components/ProductPriceBadge/index.js +72 -70
  20. package/dist/components/TestimonialsSection/index.js +1 -1
  21. package/dist/i18n/en.d.ts +1 -0
  22. package/dist/i18n/en.d.ts.map +1 -1
  23. package/dist/i18n/en.js +1 -0
  24. package/dist/i18n/fr.d.ts +1 -0
  25. package/dist/i18n/fr.d.ts.map +1 -1
  26. package/dist/i18n/fr.js +1 -0
  27. package/dist/index.d.ts +15 -2
  28. package/dist/index.js +59 -58
  29. package/dist/lib/cartSummary.js +7 -7
  30. package/dist/lib/products.d.ts +6 -0
  31. package/dist/lib/products.d.ts.map +1 -1
  32. package/dist/lib/products.js +36 -32
  33. package/dist/lib/toast.d.ts +9 -0
  34. package/dist/lib/toast.d.ts.map +1 -0
  35. package/dist/lib/toast.js +13 -0
  36. package/dist/pages/BookingPage.d.ts.map +1 -1
  37. package/dist/pages/BookingPage.js +143 -138
  38. package/dist/pages/CheckoutPage.js +217 -217
  39. package/dist/pages/CheckoutPaymentPage.js +124 -124
  40. package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
  41. package/dist/pages/ContractSaleDocumentPage.js +83 -83
  42. package/dist/pages/HomePage.js +6 -3
  43. package/dist/pages/ProductPage.d.ts.map +1 -1
  44. package/dist/pages/ProductPage.js +177 -165
  45. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BikeProductCard/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AASrD,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,WAAW,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,uBAAuB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,SAAS,EACT,WAAW,EACX,uBAAuB,EACvB,cAA8B,EAC9B,QAAQ,EACR,cAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,OAAmB,EACnB,MAAM,GACP,EAAE,oBAAoB,2CAgFtB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BikeProductCard/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AASrD,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,WAAW,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,uBAAuB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,SAAS,EACT,WAAW,EACX,uBAAuB,EACvB,cAA8B,EAC9B,QAAQ,EACR,cAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,OAAmB,EACnB,MAAM,GACP,EAAE,oBAAoB,2CAoFtB"}
@@ -1,5 +1,5 @@
1
- import { getAvailabilityVariant as e } from "../../lib/utils.js";
2
- import { getLocalizedValue as t } from "../../localization.js";
1
+ import { getLocalizedValue as e } from "../../localization.js";
2
+ import { getAvailabilityVariant as t } from "../../lib/utils.js";
3
3
  import { Badge as n } from "../../ui/badge.js";
4
4
  import { Button as r } from "../../ui/button.js";
5
5
  import { ProductPriceBadge as i } from "../ProductPriceBadge/index.js";
@@ -8,23 +8,23 @@ import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
8
  import { Link as l } from "@rpcbase/router";
9
9
  import { useTranslation as u } from "react-i18next";
10
10
  import { cn as d } from "@rpcbase/ui";
11
- import { ArrowRight as f, Bike as p } from "lucide-react";
11
+ import { ArrowRight as f, Bike as p, Plus as m } from "lucide-react";
12
12
  //#region src/components/BikeProductCard/index.tsx
13
- function m({ bike: m, className: h, detailsPath: g, productDetailsLinkState: _, actionLabelKey: v = "product_cta", onAction: y, actionDisabled: b = !1, availabilityLabel: x, fallbackLanguage: S, variant: C = "default", testId: w }) {
14
- let { t: T, i18n: E } = u(), D = t(m.name, E.language, S), O = t(m.description, E.language, S), k = typeof m.images?.[0] == "string" ? m.images[0].trim() : "", A = a(m.primaryImageStyle), j = e(m.availabilityStatus), M = C === "booking", N = m.availabilityStatus === "OUT_OF_STOCK";
13
+ function h({ bike: h, className: g, detailsPath: _, productDetailsLinkState: v, actionLabelKey: y = "product_cta", onAction: b, actionDisabled: x = !1, availabilityLabel: S, fallbackLanguage: C, variant: w = "default", testId: T }) {
14
+ let { t: E, i18n: D } = u(), O = e(h.name, D.language, C), k = e(h.description, D.language, C), A = typeof h.images?.[0] == "string" ? h.images[0].trim() : "", j = a(h.primaryImageStyle), M = t(h.availabilityStatus), N = w === "booking", P = h.availabilityStatus === "OUT_OF_STOCK";
15
15
  return /* @__PURE__ */ c("div", {
16
- className: d("flex h-full flex-col gap-2 rounded-xl border border-slate-200 bg-white p-3 shadow-sm", h),
17
- "data-testid": w,
16
+ className: d("flex h-full flex-col gap-2 rounded-xl border border-slate-200 bg-white p-3 shadow-sm", g),
17
+ "data-testid": T,
18
18
  children: [/* @__PURE__ */ c("div", {
19
19
  className: "flex flex-1 items-stretch gap-4",
20
20
  children: [/* @__PURE__ */ s("div", {
21
21
  className: "w-24 shrink-0 sm:w-28",
22
22
  children: /* @__PURE__ */ c("div", {
23
- className: d("relative h-full min-h-20 overflow-hidden rounded-xl", A.className),
24
- style: A.style,
25
- children: [k ? /* @__PURE__ */ s("img", {
26
- src: k,
27
- alt: D,
23
+ className: d("relative h-full min-h-20 overflow-hidden rounded-xl", j.className),
24
+ style: j.style,
25
+ children: [A ? /* @__PURE__ */ s("img", {
26
+ src: A,
27
+ alt: O,
28
28
  className: "absolute inset-0 h-full w-full object-contain p-1",
29
29
  loading: "lazy"
30
30
  }) : /* @__PURE__ */ s("div", {
@@ -33,10 +33,10 @@ function m({ bike: m, className: h, detailsPath: g, productDetailsLinkState: _,
33
33
  className: "h-7 w-7",
34
34
  "aria-hidden": "true"
35
35
  })
36
- }), M && N ? /* @__PURE__ */ s(n, {
36
+ }), N && P ? /* @__PURE__ */ s(n, {
37
37
  variant: "destructive",
38
38
  className: "pointer-events-none absolute right-2 top-2 shadow-sm",
39
- children: /* @__PURE__ */ s("span", { children: T("availability_out_of_stock") })
39
+ children: /* @__PURE__ */ s("span", { children: E("availability_out_of_stock") })
40
40
  }) : null]
41
41
  })
42
42
  }), /* @__PURE__ */ c("div", {
@@ -44,41 +44,41 @@ function m({ bike: m, className: h, detailsPath: g, productDetailsLinkState: _,
44
44
  children: [
45
45
  /* @__PURE__ */ s("p", {
46
46
  className: "min-w-0 text-sm font-semibold text-slate-950",
47
- children: /* @__PURE__ */ s("span", { children: D })
47
+ children: /* @__PURE__ */ s("span", { children: O })
48
48
  }),
49
49
  /* @__PURE__ */ s(i, {
50
- prices: m.prices,
50
+ prices: h.prices,
51
51
  className: "self-start"
52
52
  }),
53
53
  /* @__PURE__ */ s("p", {
54
54
  className: "line-clamp-2 text-xs text-slate-600",
55
- children: /* @__PURE__ */ s("span", { children: O })
55
+ children: /* @__PURE__ */ s("span", { children: k })
56
56
  })
57
57
  ]
58
58
  })]
59
59
  }), /* @__PURE__ */ c("div", {
60
60
  className: "flex flex-wrap items-center gap-x-2 gap-y-1",
61
61
  children: [
62
- M ? null : /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(n, {
63
- variant: j.variant,
64
- children: /* @__PURE__ */ s("span", { children: x ?? T(j.labelKey) })
62
+ N ? null : /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(n, {
63
+ variant: M.variant,
64
+ children: /* @__PURE__ */ s("span", { children: S ?? E(M.labelKey) })
65
65
  }), /* @__PURE__ */ s("span", {
66
66
  className: "text-slate-400",
67
67
  children: "·"
68
68
  })] }),
69
69
  /* @__PURE__ */ s(l, {
70
- to: g,
71
- state: _,
70
+ to: _,
71
+ state: v,
72
72
  className: "text-xs font-medium text-slate-700 hover:text-slate-950",
73
- children: /* @__PURE__ */ s("span", { children: T("product_details_link") })
73
+ children: /* @__PURE__ */ s("span", { children: E("product_details_link") })
74
74
  }),
75
75
  /* @__PURE__ */ c(r, {
76
76
  type: "button",
77
77
  size: "sm",
78
78
  className: "ml-auto gap-2 text-xs",
79
- onClick: y,
80
- disabled: b,
81
- children: [/* @__PURE__ */ s("span", { children: T(v) }), /* @__PURE__ */ s(f, {
79
+ onClick: b,
80
+ disabled: x,
81
+ children: [/* @__PURE__ */ s("span", { children: E(y) }), s(N ? m : f, {
82
82
  className: "h-4 w-4",
83
83
  "aria-hidden": "true"
84
84
  })]
@@ -88,4 +88,4 @@ function m({ bike: m, className: h, detailsPath: g, productDetailsLinkState: _,
88
88
  });
89
89
  }
90
90
  //#endregion
91
- export { m as BikeProductCard };
91
+ export { h as BikeProductCard };
@@ -1,11 +1,11 @@
1
1
  import { getProductVariantAttributeValue as e, getStorefrontProductVariantDisplay as t } from "../../lib/productVariants.js";
2
- import { getAvailabilityVariant as n } from "../../lib/utils.js";
3
- import { getLocalizedValue as r } from "../../localization.js";
2
+ import { getLocalizedValue as n } from "../../localization.js";
3
+ import { getAvailabilityVariant as r } from "../../lib/utils.js";
4
4
  import { Badge as i } from "../../ui/badge.js";
5
5
  import { Button as a } from "../../ui/button.js";
6
6
  import { RESPONSIVE_DIALOG_MOBILE_MEDIA_QUERY as o, ResponsiveDialog as s, ResponsiveDialogContent as c, ResponsiveDialogDescription as l, ResponsiveDialogFooter as u, ResponsiveDialogHeader as d, ResponsiveDialogTitle as f } from "../../chunks/pkg/ui/dist/ResponsiveDialog-BVwhTZQo.js";
7
7
  import { Input as p } from "../../ui/input.js";
8
- import { useStorefrontWorkspaceLanguage as m } from "../../StorefrontProvider.js";
8
+ import { useStorefrontWorkspaceLanguage as m } from "../../StorefrontContext.js";
9
9
  import { ProductWarningNotice as h } from "../ProductWarningNotice/index.js";
10
10
  import { ProductPriceBadge as g } from "../ProductPriceBadge/index.js";
11
11
  import { resolveProductImageContainerStyle as _ } from "../../lib/productImageStyles.js";
@@ -30,7 +30,7 @@ function A({ open: p, product: A, onOpenChange: M, getVariantAvailabilityLabel:
30
30
  ...n,
31
31
  [e]: t
32
32
  }));
33
- }, W = r(A.name, R.language, B), G = r(A.description, R.language, B), K = r(A.warning, R.language, B), q = typeof A.images?.[0] == "string" ? A.images[0].trim() : "", J = _(A.primaryImageStyle), Y = n(A.availabilityStatus), X = A.features?.slice(0, 4) ?? [], Z = A.productVariants ?? [], Q = Z.some((t) => !!e(t, "size")) ? L("product_size_label") : L("product_variant_label");
33
+ }, W = n(A.name, R.language, B), G = n(A.description, R.language, B), K = n(A.warning, R.language, B), q = typeof A.images?.[0] == "string" ? A.images[0].trim() : "", J = _(A.primaryImageStyle), Y = r(A.availabilityStatus), X = A.features?.slice(0, 4) ?? [], Z = A.productVariants ?? [], Q = Z.some((t) => !!e(t, "size")) ? L("product_size_label") : L("product_variant_label");
34
34
  return /* @__PURE__ */ b(s, {
35
35
  open: p,
36
36
  onOpenChange: M,
@@ -84,7 +84,10 @@ function A({ open: p, product: A, onOpenChange: M, getVariantAvailabilityLabel:
84
84
  children: [/* @__PURE__ */ b(i, {
85
85
  variant: Y.variant,
86
86
  children: /* @__PURE__ */ b("span", { children: L(Y.labelKey) })
87
- }), /* @__PURE__ */ b(g, { prices: A.prices })]
87
+ }), /* @__PURE__ */ b(g, {
88
+ prices: A.prices,
89
+ openOnHover: A.kind !== "accessory"
90
+ })]
88
91
  }),
89
92
  !z && X.length > 0 ? /* @__PURE__ */ x("div", {
90
93
  className: "grid gap-2",
@@ -98,7 +101,7 @@ function A({ open: p, product: A, onOpenChange: M, getVariantAvailabilityLabel:
98
101
  children: [/* @__PURE__ */ b(E, {
99
102
  className: "mt-0.5 h-4 w-4 text-success",
100
103
  "aria-hidden": "true"
101
- }), /* @__PURE__ */ b("span", { children: r(e, R.language, B) })]
104
+ }), /* @__PURE__ */ b("span", { children: n(e, R.language, B) })]
102
105
  }, `${A.id}-${t}`))
103
106
  })]
104
107
  }) : null,
@@ -112,7 +115,10 @@ function A({ open: p, product: A, onOpenChange: M, getVariantAvailabilityLabel:
112
115
  children: [/* @__PURE__ */ b(i, {
113
116
  variant: Y.variant,
114
117
  children: /* @__PURE__ */ b("span", { children: L(Y.labelKey) })
115
- }), /* @__PURE__ */ b(g, { prices: A.prices })]
118
+ }), /* @__PURE__ */ b(g, {
119
+ prices: A.prices,
120
+ openOnHover: A.kind !== "accessory"
121
+ })]
116
122
  }) : null,
117
123
  z && X.length > 0 ? /* @__PURE__ */ x("details", {
118
124
  className: "group rounded-2xl border border-slate-200 bg-slate-50",
@@ -131,7 +137,7 @@ function A({ open: p, product: A, onOpenChange: M, getVariantAvailabilityLabel:
131
137
  children: [/* @__PURE__ */ b(E, {
132
138
  className: "mt-0.5 h-4 w-4 text-success",
133
139
  "aria-hidden": "true"
134
- }), /* @__PURE__ */ b("span", { children: r(e, R.language, B) })]
140
+ }), /* @__PURE__ */ b("span", { children: n(e, R.language, B) })]
135
141
  }, `${A.id}-mobile-${t}`))
136
142
  })
137
143
  })]
@@ -4,16 +4,16 @@ import { resolveStorefrontWhatsAppContact as i } from "../../lib/whatsapp.js";
4
4
  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
- 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 ee } 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 { toast as T } from "@rpcbase/client";
7
+ import { toast as d } from "../../lib/toast.js";
8
+ import { Input as f } from "../../ui/input.js";
9
+ import { useStorefront as p } from "../../StorefrontContext.js";
10
+ import { Form as m, FormControl as h, FormField as g, FormItem as _, FormLabel as v, FormMessage as y } from "../../ui/form.js";
11
+ import { Textarea as ee } from "../../ui/textarea.js";
12
+ import { createMarkerElement as b } from "../Map/createMarkerElement.js";
13
+ import { Map as x } from "../Map/index.js";
14
+ import { z as S } from "zod";
15
+ import { useMemo as C } from "react";
16
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
17
17
  import { useTranslation as E } from "react-i18next";
18
18
  import { PhoneNumberInput as D, cn as O } from "@rpcbase/ui";
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 } = E(), { 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 } = E(), { storefrontConfiguration: B, mapboxToken: V } = p(), { 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(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"))
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"))
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 = S(() => {
40
+ }), X = C(() => {
41
41
  let e = H.gpsCoordinates;
42
42
  return e ? [e[1], e[0]] : null;
43
- }, [H.gpsCoordinates]), Z = X ?? l, Q = S(() => ee(), []), $ = S(() => X ? {
43
+ }, [H.gpsCoordinates]), Z = X ?? l, Q = C(() => b(), []), $ = C(() => X ? {
44
44
  coords: X,
45
45
  element: Q || void 0,
46
46
  offset: [0, -25.5],
@@ -50,7 +50,7 @@ function L({ storeSlug: L }) {
50
50
  G,
51
51
  X,
52
52
  Q
53
- ]), te = S(() => $ ? [$] : [], [$]), ne = Y.handleSubmit(async (n) => {
53
+ ]), te = C(() => $ ? [$] : [], [$]), ne = Y.handleSubmit(async (n) => {
54
54
  try {
55
55
  let r = await fetch(e, {
56
56
  method: "POST",
@@ -61,180 +61,180 @@ function L({ storeSlug: L }) {
61
61
  })
62
62
  }), i = await r.json().then((e) => t.safeParse(e)).catch(() => ({ success: !1 }));
63
63
  if (r.ok && "success" in i && i.success && i.data.success) {
64
- T.success(R("contact_form_success_toast")), Y.reset();
64
+ d.success(R("contact_form_success_toast")), Y.reset();
65
65
  return;
66
66
  }
67
67
  let a = "success" in i && i.success && i.data.error ? i.data.error : R("contact_form_error_toast");
68
- T.error(a);
68
+ d.error(a);
69
69
  } catch (e) {
70
- console.warn("Storefront contact form request failed", e), T.error(R("contact_form_error_toast"));
70
+ console.warn("Storefront contact form request failed", e), d.error(R("contact_form_error_toast"));
71
71
  }
72
72
  });
73
- return /* @__PURE__ */ C("section", {
73
+ return /* @__PURE__ */ w("section", {
74
74
  id: "contact",
75
75
  className: "border-t bg-slate-50 py-12 scroll-mt-16 sm:scroll-mt-20 sm:py-16",
76
76
  "data-testid": "storefront-contact-form",
77
- children: /* @__PURE__ */ w("div", {
77
+ children: /* @__PURE__ */ T("div", {
78
78
  className: "mx-auto max-w-7xl px-4 sm:px-6",
79
- children: [/* @__PURE__ */ w("div", {
79
+ children: [/* @__PURE__ */ T("div", {
80
80
  className: "mx-auto max-w-2xl text-center",
81
- children: [/* @__PURE__ */ C("h2", {
81
+ children: [/* @__PURE__ */ w("h2", {
82
82
  className: "text-3xl font-semibold tracking-tight text-slate-950",
83
83
  children: R("contact_section_title")
84
- }), /* @__PURE__ */ C("p", {
84
+ }), /* @__PURE__ */ w("p", {
85
85
  className: "mt-3 text-sm text-slate-600 sm:text-base",
86
86
  children: R("contact_section_subtitle")
87
87
  })]
88
- }), /* @__PURE__ */ w("div", {
88
+ }), /* @__PURE__ */ T("div", {
89
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",
90
- children: [/* @__PURE__ */ w("div", {
90
+ children: [/* @__PURE__ */ T("div", {
91
91
  className: "flex flex-col gap-6 lg:border-r lg:border-slate-200 lg:pr-6",
92
92
  children: [
93
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("h3", {
93
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h3", {
94
94
  className: "text-lg font-semibold text-slate-950",
95
95
  children: R("contact_section_info_title")
96
- }), /* @__PURE__ */ C("p", {
96
+ }), /* @__PURE__ */ w("p", {
97
97
  className: "mt-2 text-sm text-slate-600",
98
98
  children: R(J ? "contact_section_info_description" : "contact_section_info_description_without_whatsapp")
99
99
  })] }),
100
- /* @__PURE__ */ w("div", {
100
+ /* @__PURE__ */ T("div", {
101
101
  className: "grid gap-5",
102
102
  children: [
103
- q ? /* @__PURE__ */ w("a", {
103
+ q ? /* @__PURE__ */ T("a", {
104
104
  className: I,
105
105
  href: q.href,
106
106
  target: "_blank",
107
107
  rel: "noreferrer",
108
- children: [/* @__PURE__ */ C("span", {
108
+ children: [/* @__PURE__ */ w("span", {
109
109
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors",
110
- children: /* @__PURE__ */ C("img", {
110
+ children: /* @__PURE__ */ w("img", {
111
111
  src: a,
112
112
  className: "h-6 w-6",
113
113
  alt: "",
114
114
  "aria-hidden": "true"
115
115
  })
116
- }), /* @__PURE__ */ w("span", {
116
+ }), /* @__PURE__ */ T("span", {
117
117
  className: "flex min-w-0 flex-col gap-1",
118
- children: [/* @__PURE__ */ C("span", {
118
+ children: [/* @__PURE__ */ w("span", {
119
119
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
120
120
  children: R("contact_section_whatsapp_label")
121
- }), /* @__PURE__ */ C("span", {
121
+ }), /* @__PURE__ */ w("span", {
122
122
  className: F,
123
123
  children: q.phoneDisplay
124
124
  })]
125
125
  })]
126
126
  }) : null,
127
- U ? /* @__PURE__ */ w("a", {
127
+ U ? /* @__PURE__ */ T("a", {
128
128
  className: I,
129
129
  href: U.href,
130
- children: [/* @__PURE__ */ C("span", {
130
+ children: [/* @__PURE__ */ w("span", {
131
131
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors",
132
- children: /* @__PURE__ */ C(j, {
132
+ children: /* @__PURE__ */ w(j, {
133
133
  className: "h-5 w-5",
134
134
  "aria-hidden": "true"
135
135
  })
136
- }), /* @__PURE__ */ w("span", {
136
+ }), /* @__PURE__ */ T("span", {
137
137
  className: "flex min-w-0 flex-col gap-1",
138
- children: [/* @__PURE__ */ C("span", {
138
+ children: [/* @__PURE__ */ w("span", {
139
139
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
140
140
  children: R("contact_section_phone_label")
141
- }), /* @__PURE__ */ C("span", {
141
+ }), /* @__PURE__ */ w("span", {
142
142
  className: F,
143
143
  children: U.phoneDisplay
144
144
  })]
145
145
  })]
146
- }) : /* @__PURE__ */ w("div", {
146
+ }) : /* @__PURE__ */ T("div", {
147
147
  className: "flex items-start gap-3 text-destructive",
148
- children: [/* @__PURE__ */ C("span", {
148
+ children: [/* @__PURE__ */ w("span", {
149
149
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current",
150
- children: /* @__PURE__ */ C(j, {
150
+ children: /* @__PURE__ */ w(j, {
151
151
  className: "h-5 w-5",
152
152
  "aria-hidden": "true"
153
153
  })
154
- }), /* @__PURE__ */ w("span", {
154
+ }), /* @__PURE__ */ T("span", {
155
155
  className: "flex min-w-0 flex-col gap-1",
156
- children: [/* @__PURE__ */ C("span", {
156
+ children: [/* @__PURE__ */ w("span", {
157
157
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
158
158
  children: R("contact_section_phone_label")
159
- }), /* @__PURE__ */ C("span", {
159
+ }), /* @__PURE__ */ w("span", {
160
160
  className: "text-sm font-normal",
161
161
  children: c
162
162
  })]
163
163
  })]
164
164
  }),
165
- W ? /* @__PURE__ */ w("a", {
165
+ W ? /* @__PURE__ */ T("a", {
166
166
  className: I,
167
167
  href: `mailto:${W}`,
168
- children: [/* @__PURE__ */ C("span", {
168
+ children: [/* @__PURE__ */ w("span", {
169
169
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors",
170
- children: /* @__PURE__ */ C(k, {
170
+ children: /* @__PURE__ */ w(k, {
171
171
  className: "h-5 w-5",
172
172
  "aria-hidden": "true"
173
173
  })
174
- }), /* @__PURE__ */ w("span", {
174
+ }), /* @__PURE__ */ T("span", {
175
175
  className: "flex min-w-0 flex-col gap-1",
176
- children: [/* @__PURE__ */ C("span", {
176
+ children: [/* @__PURE__ */ w("span", {
177
177
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
178
178
  children: R("contact_section_email_label")
179
- }), /* @__PURE__ */ C("span", {
179
+ }), /* @__PURE__ */ w("span", {
180
180
  className: F,
181
181
  children: W
182
182
  })]
183
183
  })]
184
- }) : /* @__PURE__ */ w("div", {
184
+ }) : /* @__PURE__ */ T("div", {
185
185
  className: "flex items-start gap-3 text-destructive",
186
- children: [/* @__PURE__ */ C("span", {
186
+ children: [/* @__PURE__ */ w("span", {
187
187
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current",
188
- children: /* @__PURE__ */ C(k, {
188
+ children: /* @__PURE__ */ w(k, {
189
189
  className: "h-5 w-5",
190
190
  "aria-hidden": "true"
191
191
  })
192
- }), /* @__PURE__ */ w("span", {
192
+ }), /* @__PURE__ */ T("span", {
193
193
  className: "flex min-w-0 flex-col gap-1",
194
- children: [/* @__PURE__ */ C("span", {
194
+ children: [/* @__PURE__ */ w("span", {
195
195
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
196
196
  children: R("contact_section_email_label")
197
- }), /* @__PURE__ */ C("span", {
197
+ }), /* @__PURE__ */ w("span", {
198
198
  className: "text-sm font-normal",
199
199
  children: s
200
200
  })]
201
201
  })]
202
202
  }),
203
- K && G ? /* @__PURE__ */ w("a", {
203
+ K && G ? /* @__PURE__ */ T("a", {
204
204
  className: I,
205
205
  href: K,
206
206
  target: "_blank",
207
207
  rel: "noreferrer",
208
- children: [/* @__PURE__ */ C("span", {
208
+ children: [/* @__PURE__ */ w("span", {
209
209
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors",
210
- children: /* @__PURE__ */ C(A, {
210
+ children: /* @__PURE__ */ w(A, {
211
211
  className: "h-5 w-5",
212
212
  "aria-hidden": "true"
213
213
  })
214
- }), /* @__PURE__ */ w("span", {
214
+ }), /* @__PURE__ */ T("span", {
215
215
  className: "flex min-w-0 flex-col gap-1",
216
- children: [/* @__PURE__ */ C("span", {
216
+ children: [/* @__PURE__ */ w("span", {
217
217
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
218
218
  children: R("contact_section_address_label")
219
- }), /* @__PURE__ */ C("span", {
219
+ }), /* @__PURE__ */ w("span", {
220
220
  className: F,
221
221
  children: G
222
222
  })]
223
223
  })]
224
- }) : /* @__PURE__ */ w("div", {
224
+ }) : /* @__PURE__ */ T("div", {
225
225
  className: "flex items-start gap-3 text-destructive",
226
- children: [/* @__PURE__ */ C("span", {
226
+ children: [/* @__PURE__ */ w("span", {
227
227
  className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current",
228
- children: /* @__PURE__ */ C(A, {
228
+ children: /* @__PURE__ */ w(A, {
229
229
  className: "h-5 w-5",
230
230
  "aria-hidden": "true"
231
231
  })
232
- }), /* @__PURE__ */ w("span", {
232
+ }), /* @__PURE__ */ T("span", {
233
233
  className: "flex min-w-0 flex-col gap-1",
234
- children: [/* @__PURE__ */ C("span", {
234
+ children: [/* @__PURE__ */ w("span", {
235
235
  className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500",
236
236
  children: R("contact_section_address_label")
237
- }), /* @__PURE__ */ C("span", {
237
+ }), /* @__PURE__ */ w("span", {
238
238
  className: "text-sm font-normal",
239
239
  children: o
240
240
  })]
@@ -242,10 +242,10 @@ function L({ storeSlug: L }) {
242
242
  })
243
243
  ]
244
244
  }),
245
- /* @__PURE__ */ C("div", {
245
+ /* @__PURE__ */ w("div", {
246
246
  className: "relative",
247
247
  "data-testid": "storefront-contact-map",
248
- children: /* @__PURE__ */ C(b, {
248
+ children: /* @__PURE__ */ w(x, {
249
249
  mapboxToken: V,
250
250
  initialCenter: Z,
251
251
  initialZoom: X ? 10 : 1,
@@ -255,56 +255,56 @@ function L({ storeSlug: L }) {
255
255
  })
256
256
  })
257
257
  ]
258
- }), /* @__PURE__ */ w("div", { children: [
259
- /* @__PURE__ */ C("h3", {
258
+ }), /* @__PURE__ */ T("div", { children: [
259
+ /* @__PURE__ */ w("h3", {
260
260
  className: "text-lg font-semibold text-slate-950",
261
261
  children: R("contact_section_form_title")
262
262
  }),
263
- /* @__PURE__ */ C("p", {
263
+ /* @__PURE__ */ w("p", {
264
264
  className: "mt-2 text-sm text-slate-600",
265
265
  children: R("contact_section_form_description")
266
266
  }),
267
- /* @__PURE__ */ C("div", {
267
+ /* @__PURE__ */ w("div", {
268
268
  className: "mt-6",
269
- children: /* @__PURE__ */ C(p, {
269
+ children: /* @__PURE__ */ w(m, {
270
270
  ...Y,
271
- children: /* @__PURE__ */ w("form", {
271
+ children: /* @__PURE__ */ T("form", {
272
272
  onSubmit: ne,
273
273
  className: "grid gap-4",
274
274
  children: [
275
- /* @__PURE__ */ C(h, {
275
+ /* @__PURE__ */ w(g, {
276
276
  control: Y.control,
277
277
  name: "name",
278
- render: ({ field: e }) => /* @__PURE__ */ w(g, { children: [
279
- /* @__PURE__ */ C(_, { children: R("contact_form_name_label") }),
280
- /* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(d, {
278
+ render: ({ field: e }) => /* @__PURE__ */ T(_, { children: [
279
+ /* @__PURE__ */ w(v, { children: R("contact_form_name_label") }),
280
+ /* @__PURE__ */ w(h, { children: /* @__PURE__ */ w(f, {
281
281
  ...e,
282
282
  placeholder: R("contact_form_name_placeholder"),
283
283
  className: "h-11"
284
284
  }) }),
285
- /* @__PURE__ */ C(v, {})
285
+ /* @__PURE__ */ w(y, {})
286
286
  ] })
287
287
  }),
288
- /* @__PURE__ */ C(h, {
288
+ /* @__PURE__ */ w(g, {
289
289
  control: Y.control,
290
290
  name: "emailAddress",
291
- render: ({ field: e }) => /* @__PURE__ */ w(g, { children: [
292
- /* @__PURE__ */ C(_, { children: R("contact_form_email_label") }),
293
- /* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(d, {
291
+ render: ({ field: e }) => /* @__PURE__ */ T(_, { children: [
292
+ /* @__PURE__ */ w(v, { children: R("contact_form_email_label") }),
293
+ /* @__PURE__ */ w(h, { children: /* @__PURE__ */ w(f, {
294
294
  ...e,
295
295
  type: "email",
296
296
  placeholder: R("contact_form_email_placeholder"),
297
297
  className: "h-11"
298
298
  }) }),
299
- /* @__PURE__ */ C(v, {})
299
+ /* @__PURE__ */ w(y, {})
300
300
  ] })
301
301
  }),
302
- /* @__PURE__ */ C(h, {
302
+ /* @__PURE__ */ w(g, {
303
303
  control: Y.control,
304
304
  name: "phoneNumber",
305
- render: ({ field: e, fieldState: t }) => /* @__PURE__ */ w(g, { children: [
306
- /* @__PURE__ */ C(_, { children: R("contact_form_phone_label") }),
307
- /* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(D, {
305
+ render: ({ field: e, fieldState: t }) => /* @__PURE__ */ T(_, { children: [
306
+ /* @__PURE__ */ w(v, { children: R("contact_form_phone_label") }),
307
+ /* @__PURE__ */ w(h, { children: /* @__PURE__ */ w(D, {
308
308
  name: e.name,
309
309
  value: e.value ?? "",
310
310
  onBlur: e.onBlur,
@@ -317,34 +317,34 @@ function L({ storeSlug: L }) {
317
317
  placeholder: R("contact_form_phone_placeholder"),
318
318
  className: "relative",
319
319
  inputClassName: O("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"),
320
- renderValidationMessage: ({ message: e }) => t.error?.message ? null : /* @__PURE__ */ C(v, {
320
+ renderValidationMessage: ({ message: e }) => t.error?.message ? null : /* @__PURE__ */ w(y, {
321
321
  style: { top: "100%" },
322
- children: /* @__PURE__ */ C("span", { children: e })
322
+ children: /* @__PURE__ */ w("span", { children: e })
323
323
  })
324
324
  }) }),
325
- t.error?.message ? /* @__PURE__ */ C(v, {}) : null
325
+ t.error?.message ? /* @__PURE__ */ w(y, {}) : null
326
326
  ] })
327
327
  }),
328
- /* @__PURE__ */ C(h, {
328
+ /* @__PURE__ */ w(g, {
329
329
  control: Y.control,
330
330
  name: "message",
331
- render: ({ field: e }) => /* @__PURE__ */ w(g, { children: [
332
- /* @__PURE__ */ C(_, { children: R("contact_form_message_label") }),
333
- /* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(y, {
331
+ render: ({ field: e }) => /* @__PURE__ */ T(_, { children: [
332
+ /* @__PURE__ */ w(v, { children: R("contact_form_message_label") }),
333
+ /* @__PURE__ */ w(h, { children: /* @__PURE__ */ w(ee, {
334
334
  ...e,
335
335
  rows: 5,
336
336
  placeholder: R("contact_form_message_placeholder"),
337
337
  className: "min-h-[132px]"
338
338
  }) }),
339
- /* @__PURE__ */ C(v, {})
339
+ /* @__PURE__ */ w(y, {})
340
340
  ] })
341
341
  }),
342
- /* @__PURE__ */ w("div", {
342
+ /* @__PURE__ */ T("div", {
343
343
  className: "mt-2 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
344
- children: [/* @__PURE__ */ C("p", {
344
+ children: [/* @__PURE__ */ w("p", {
345
345
  className: "text-xs text-slate-500",
346
346
  children: R("contact_form_privacy_hint")
347
- }), /* @__PURE__ */ C(u, {
347
+ }), /* @__PURE__ */ w(u, {
348
348
  type: "submit",
349
349
  disabled: Y.formState.isSubmitting,
350
350
  children: Y.formState.isSubmitting ? R("contact_form_submitting_button") : R("contact_form_submit_button")