@loczer/storefront-sdk 0.182.0 → 0.183.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 (77) hide show
  1. package/dist/StorefrontProvider.d.ts +18 -15
  2. package/dist/StorefrontProvider.d.ts.map +1 -1
  3. package/dist/StorefrontProvider.js +24 -34
  4. package/dist/chunks/booking-engine/dist/models/{Product.shared-CJ6vPb6n.js → Product.shared-CTuk4fiR.js} +2 -2
  5. package/dist/chunks/booking-engine/dist/schemas/{base-asset-PqhtKnZA.js → base-asset-B_Dm8_Vk.js} +1 -1
  6. package/dist/chunks/booking-engine/dist/schemas/{base-booking-BM3jZzqu.js → base-booking-DW8AEPKo.js} +1 -1
  7. package/dist/chunks/booking-engine/dist/schemas/{base-product-BJd4ttMP.js → base-product-1H8l2aUv.js} +1 -1
  8. package/dist/chunks/booking-engine/dist/{schemas-BNlwu75Z.js → schemas-34QQv0EH.js} +4 -4
  9. package/dist/chunks/ui/dist/Map/{MapContent--PwVTg2W.js → MapContent-QPkuTBvK.js} +2 -2
  10. package/dist/chunks/ui/dist/Map/{constants-DqrK8UkE.js → constants-BNmiJXfg.js} +1 -1
  11. package/dist/chunks/ui/dist/{Map-B45AxZ-D.js → Map-BXmRf5Ep.js} +3 -3
  12. package/dist/chunks/ui/dist/static/strings-1T2w7LqX.js +4 -0
  13. package/dist/components/AboutSection/index.d.ts +1 -6
  14. package/dist/components/AboutSection/index.d.ts.map +1 -1
  15. package/dist/components/AboutSection/index.js +43 -39
  16. package/dist/components/ContactSection/index.d.ts +1 -3
  17. package/dist/components/ContactSection/index.d.ts.map +1 -1
  18. package/dist/components/ContactSection/index.js +222 -164
  19. package/dist/components/Footer/index.d.ts +3 -4
  20. package/dist/components/Footer/index.d.ts.map +1 -1
  21. package/dist/components/Footer/index.js +98 -69
  22. package/dist/components/FulfillmentSection/index.d.ts.map +1 -1
  23. package/dist/components/FulfillmentSection/index.js +17 -16
  24. package/dist/components/Header/index.d.ts +1 -3
  25. package/dist/components/Header/index.d.ts.map +1 -1
  26. package/dist/components/Header/index.js +77 -72
  27. package/dist/components/Layout/index.d.ts +3 -1
  28. package/dist/components/Layout/index.d.ts.map +1 -1
  29. package/dist/components/Layout/index.js +45 -47
  30. package/dist/components/Map/index.js +1 -1
  31. package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
  32. package/dist/components/ProductPriceBadge/index.js +68 -60
  33. package/dist/i18n/I18nProvider.js +1 -1
  34. package/dist/i18n/fr.js +1 -1
  35. package/dist/index.d.ts +151 -150
  36. package/dist/index.js +62 -62
  37. package/dist/lib/cart.d.ts +4 -1
  38. package/dist/lib/cart.d.ts.map +1 -1
  39. package/dist/lib/cart.js +64 -40
  40. package/dist/lib/cartSummary.d.ts.map +1 -1
  41. package/dist/lib/cartSummary.js +4 -3
  42. package/dist/lib/checkoutSubmit.js +2 -2
  43. package/dist/lib/productVariants.d.ts.map +1 -1
  44. package/dist/lib/productVariants.js +20 -9
  45. package/dist/lib/storefrontAddress.d.ts +5 -0
  46. package/dist/lib/storefrontAddress.d.ts.map +1 -0
  47. package/dist/lib/storefrontAddress.js +24 -0
  48. package/dist/lib/storefrontAvailability.d.ts +6 -6
  49. package/dist/lib/storefrontContact.d.ts +10 -0
  50. package/dist/lib/storefrontContact.d.ts.map +1 -0
  51. package/dist/lib/storefrontContact.js +24 -0
  52. package/dist/lib/storefrontMissingValues.d.ts +5 -0
  53. package/dist/lib/storefrontMissingValues.d.ts.map +1 -0
  54. package/dist/lib/storefrontMissingValues.js +4 -0
  55. package/dist/lib/storefrontProducts.d.ts +23 -21
  56. package/dist/lib/storefrontProducts.d.ts.map +1 -1
  57. package/dist/lib/storefrontProducts.js +7 -5
  58. package/dist/lib/whatsapp.d.ts +8 -6
  59. package/dist/lib/whatsapp.d.ts.map +1 -1
  60. package/dist/lib/whatsapp.js +16 -43
  61. package/dist/pages/BookingPage.js +36 -36
  62. package/dist/pages/HomePage.d.ts.map +1 -1
  63. package/dist/pages/HomePage.js +126 -128
  64. package/dist/pages/ProductPage.js +160 -160
  65. package/dist/storefront.css +1 -1
  66. package/dist/storefrontSchemas.d.ts +14 -12
  67. package/dist/storefrontSchemas.d.ts.map +1 -1
  68. package/dist/storefrontSchemas.js +3 -2
  69. package/dist/ui/radio-group.d.ts +1 -1
  70. package/package.json +7 -6
  71. package/dist/chunks/ui/dist/static/strings-CPnO-KbA.js +0 -4
  72. package/dist/data/config.d.ts +0 -15
  73. package/dist/data/config.d.ts.map +0 -1
  74. package/dist/data/config.js +0 -24
  75. package/dist/static/strings.d.ts +0 -2
  76. package/dist/static/strings.d.ts.map +0 -1
  77. package/dist/static/strings.js +0 -4
@@ -1,281 +1,281 @@
1
1
  import { getBookingParamsFromSearch as e, resolveBookingSearchParamsFromSessionStorage as t, writeBookingSearchParamsToSessionStorage as n } from "../lib/booking.js";
2
- import { useStorefrontCart as r } from "../lib/cart.js";
3
- import { getProductVariantAttributeValue as i, getStorefrontProductVariantDisplay as ee } from "../lib/productVariants.js";
2
+ import { getProductVariantAttributeValue as r, getStorefrontProductVariantDisplay as i } from "../lib/productVariants.js";
4
3
  import { findStorefrontProductBySlug as a, getStorefrontCheckoutProductId as o } from "../lib/products.js";
5
- import { getAvailabilityVariant as s } from "../lib/utils.js";
6
- import { getLocalizedValue as c } from "../localization.js";
7
- import { ROUTE as te, buildStorefrontAvailabilityKey as l, getStorefrontAvailabilityIssue as u, getStorefrontAvailabilityStatus as d, getValidStorefrontAvailabilitySchedule as ne, isStorefrontAvailabilityInsufficient as f, responseSchema as re } from "../lib/storefrontAvailability.js";
8
- import { Badge as ie } from "../ui/badge.js";
9
- import { Button as p } from "../ui/button.js";
10
- import { Input as ae } from "../ui/input.js";
11
- import { useStorefront as oe, useStorefrontProducts as se } from "../StorefrontProvider.js";
12
- import { Card as ce } from "../ui/card.js";
13
- import { ProductWarningNotice as le } from "../components/ProductWarningNotice/index.js";
14
- import { ProductPriceBadge as ue } from "../components/ProductPriceBadge/index.js";
15
- import { resolveProductImageContainerStyle as de } from "../lib/productImageStyles.js";
16
- import { apiPost as fe } from "../lib/apiCall.js";
17
- import { RadioGroup as pe, RadioGroupItem as me } from "../ui/radio-group.js";
18
- import { useEffect as m, useMemo as h, useState as g } from "react";
19
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
20
- import { cn as y } from "@rpcbase/ui";
21
- import { Link as he, useLocation as ge, useNavigate as _e, useParams as ve, useSearchParams as ye } from "@rpcbase/router";
22
- import { useTranslation as be } from "react-i18next";
23
- import { ArrowLeft as b, ArrowRight as x, Bike as xe, CheckCircle2 as Se } from "lucide-react";
4
+ import { useStorefrontCart as s } from "../lib/cart.js";
5
+ import { getAvailabilityVariant as c } from "../lib/utils.js";
6
+ import { getLocalizedValue as l } from "../localization.js";
7
+ import { ROUTE as ee, buildStorefrontAvailabilityKey as u, getStorefrontAvailabilityIssue as d, getStorefrontAvailabilityStatus as f, getValidStorefrontAvailabilitySchedule as te, isStorefrontAvailabilityInsufficient as p, responseSchema as ne } from "../lib/storefrontAvailability.js";
8
+ import { Badge as re } from "../ui/badge.js";
9
+ import { Button as m } from "../ui/button.js";
10
+ import { Input as ie } from "../ui/input.js";
11
+ import { useStorefront as ae, useStorefrontProducts as oe } from "../StorefrontProvider.js";
12
+ import { Card as se } from "../ui/card.js";
13
+ import { ProductWarningNotice as ce } from "../components/ProductWarningNotice/index.js";
14
+ import { ProductPriceBadge as le } from "../components/ProductPriceBadge/index.js";
15
+ import { resolveProductImageContainerStyle as ue } from "../lib/productImageStyles.js";
16
+ import { apiPost as de } from "../lib/apiCall.js";
17
+ import { RadioGroup as fe, RadioGroupItem as pe } from "../ui/radio-group.js";
18
+ import { useEffect as h, useMemo as g, useState as _ } from "react";
19
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
20
+ import { cn as b } from "@rpcbase/ui";
21
+ import { Link as me, useLocation as he, useNavigate as ge, useParams as _e, useSearchParams as ve } from "@rpcbase/router";
22
+ import { useTranslation as ye } from "react-i18next";
23
+ import { ArrowLeft as x, ArrowRight as S, Bike as be, CheckCircle2 as xe } from "lucide-react";
24
24
  //#region src/pages/ProductPage.tsx
25
- var S = (e, t = () => !0) => {
25
+ var C = (e, t = () => !0) => {
26
26
  if (!e) return null;
27
27
  if (e.representedVariantId?.trim()) return e.representedVariantId.trim();
28
28
  let n = e.productVariants ?? [];
29
29
  return n.find((e) => t(e.id))?.id ?? n[0]?.id ?? null;
30
- }, Ce = (e, t) => {
30
+ }, Se = (e, t) => {
31
31
  if (!e) return [];
32
32
  let n = o(e), r = /* @__PURE__ */ new Map();
33
- r.set(l(n), {
33
+ r.set(u(n), {
34
34
  productId: n,
35
35
  quantity: t
36
36
  });
37
- for (let i of e.productVariants ?? []) r.set(l(n, i.id), {
37
+ for (let i of e.productVariants ?? []) r.set(u(n, i.id), {
38
38
  productId: n,
39
39
  productVariantId: i.id,
40
40
  quantity: t
41
41
  });
42
42
  let i = e.representedVariantId?.trim();
43
- return i && r.set(l(n, i), {
43
+ return i && r.set(u(n, i), {
44
44
  productId: n,
45
45
  productVariantId: i,
46
46
  quantity: t
47
47
  }), Array.from(r.values());
48
- }, we = (e, t) => {
48
+ }, Ce = (e, t) => {
49
49
  let n = o(e), r = e.representedVariantId?.trim();
50
50
  if (r) {
51
- let e = t.get(l(n, r));
51
+ let e = t.get(u(n, r));
52
52
  if (e) return e;
53
53
  }
54
- return t.get(l(n));
55
- }, Te = (e, t, n) => n.get(l(o(e), t)), C = (e, t, n) => {
56
- let r = u(t);
54
+ return t.get(u(n));
55
+ }, we = (e, t, n) => n.get(u(o(e), t)), w = (e, t, n) => {
56
+ let r = d(t);
57
57
  return r === "quantity_unavailable" ? e("availability_quantity_unavailable") : r === "unavailable" || n === "OUT_OF_STOCK" ? e("availability_out_of_stock") : t?.remaining === void 0 ? t?.fewRemaining || n === "LOW_STOCK" ? e("availability_low_stock") : e("availability_in_stock") : e("availability_remaining_count", { count: t.remaining });
58
- }, Ee = (e) => "availabilityStatus" in e ? e.availabilityStatus ?? "AVAILABLE" : "AVAILABLE";
59
- function w() {
60
- let { t: u, i18n: w } = be(), { storeSlug: T, productSlug: E } = ve(), [D] = ye(), De = ge(), Oe = _e(), { addItem: ke, itemCount: O } = r(), { storefrontConfiguration: Ae } = oe(), k = Ae.workspace?.workspaceLanguage, { bikes: A, accessories: j } = se(), M = h(() => E ? a(E, {
61
- bikes: A,
62
- accessories: j
58
+ }, Te = (e) => "availabilityStatus" in e ? e.availabilityStatus ?? "AVAILABLE" : "AVAILABLE";
59
+ function T() {
60
+ let { t: d, i18n: T } = ye(), { storeSlug: E, productSlug: D } = _e(), [O] = ve(), Ee = he(), De = ge(), { addItem: Oe, itemCount: k } = s(), { storefrontConfiguration: ke } = ae(), A = ke.workspace?.workspaceLanguage, { bikes: j, accessories: M } = oe(), N = g(() => D ? a(D, {
61
+ bikes: j,
62
+ accessories: M
63
63
  }) : null, [
64
+ M,
64
65
  j,
65
- A,
66
- E
67
- ]), N = h(() => t(D, T), [D, T]), P = h(() => e(N), [N]), F = N.toString(), I = `/${T ?? ""}/checkout${F ? `?${F}` : ""}`, L = `/${T ?? ""}`, je = L, R = De.state, Me = typeof R?.backTo == "string" && R.backTo.startsWith(L) ? R.backTo : je, [z, B] = g(1), [V, H] = g(() => S(M)), U = Number.isFinite(z) ? Math.max(1, Math.min(99, Math.floor(z))) : 1, W = h(() => Ce(M, U), [U, M]), [G, K] = g([]), [Ne, q] = g(!1);
68
- m(() => {
69
- if (B(1), !M) {
70
- H(null);
66
+ D
67
+ ]), P = g(() => t(O, E), [O, E]), F = g(() => e(P), [P]), I = P.toString(), L = `/${E ?? ""}/checkout${I ? `?${I}` : ""}`, R = `/${E ?? ""}`, Ae = R, z = Ee.state, je = typeof z?.backTo == "string" && z.backTo.startsWith(R) ? z.backTo : Ae, [B, V] = _(1), [H, U] = _(() => C(N)), W = Number.isFinite(B) ? Math.max(1, Math.min(99, Math.floor(B))) : 1, G = g(() => Se(N, W), [W, N]), [K, q] = _([]), [Me, J] = _(!1);
68
+ h(() => {
69
+ if (V(1), !N) {
70
+ U(null);
71
71
  return;
72
72
  }
73
- H(S(M));
74
- }, [E, M]), m(() => {
75
- n(T, N);
76
- }, [N, T]), m(() => {
77
- if (!T || W.length === 0) {
78
- K([]), q(!1);
73
+ U(C(N));
74
+ }, [D, N]), h(() => {
75
+ n(E, P);
76
+ }, [P, E]), h(() => {
77
+ if (!E || G.length === 0) {
78
+ q([]), J(!1);
79
79
  return;
80
80
  }
81
- let e = ne(P);
81
+ let e = te(F);
82
82
  if (!e) {
83
- q(!1);
83
+ J(!1);
84
84
  return;
85
85
  }
86
86
  let t = !1;
87
- return q(!0), K([]), (async () => {
87
+ return J(!0), q([]), (async () => {
88
88
  try {
89
- let n = await fe(te, {
90
- storeSlug: T,
89
+ let n = await de(ee, {
90
+ storeSlug: E,
91
91
  schedule: e,
92
- products: W
93
- }), r = re.parse(n);
92
+ products: G
93
+ }), r = ne.parse(n);
94
94
  if (t) return;
95
- K(r.success ? r.availability ?? [] : []);
95
+ q(r.success ? r.availability ?? [] : []);
96
96
  } catch (e) {
97
97
  if (t) return;
98
- console.error("Failed to load storefront product availability", e), K([]);
98
+ console.error("Failed to load storefront product availability", e), q([]);
99
99
  } finally {
100
- t || q(!1);
100
+ t || J(!1);
101
101
  }
102
102
  })(), () => {
103
103
  t = !0;
104
104
  };
105
105
  }, [
106
- W,
107
- P.end_date,
108
- P.end_time,
109
- P.start_date,
110
- P.start_time,
111
- T
106
+ G,
107
+ F.end_date,
108
+ F.end_time,
109
+ F.start_date,
110
+ F.start_time,
111
+ E
112
112
  ]);
113
- let J = h(() => new Map(G.map((e) => [l(e.productId, e.productVariantId), e])), [G]), Y = () => {
114
- Oe(Me);
113
+ let Y = g(() => new Map(K.map((e) => [u(e.productId, e.productVariantId), e])), [K]), Ne = () => {
114
+ De(je);
115
115
  };
116
- if (!M) return /* @__PURE__ */ _("div", {
116
+ if (!N) return /* @__PURE__ */ v("div", {
117
117
  className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
118
- children: /* @__PURE__ */ v("div", {
118
+ children: /* @__PURE__ */ y("div", {
119
119
  className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm",
120
120
  children: [
121
- /* @__PURE__ */ _("h1", {
121
+ /* @__PURE__ */ v("h1", {
122
122
  className: "text-xl font-semibold tracking-tight text-slate-950",
123
- children: /* @__PURE__ */ _("span", { children: u("product_not_found_title") })
123
+ children: /* @__PURE__ */ v("span", { children: d("product_not_found_title") })
124
124
  }),
125
- /* @__PURE__ */ _("p", {
125
+ /* @__PURE__ */ v("p", {
126
126
  className: "mt-2 text-sm text-slate-600",
127
- children: /* @__PURE__ */ _("span", { children: u("product_not_found_description") })
127
+ children: /* @__PURE__ */ v("span", { children: d("product_not_found_description") })
128
128
  }),
129
- /* @__PURE__ */ _("div", {
129
+ /* @__PURE__ */ v("div", {
130
130
  className: "mt-6",
131
- children: /* @__PURE__ */ v(p, {
131
+ children: /* @__PURE__ */ y(m, {
132
132
  type: "button",
133
133
  className: "gap-2",
134
- onClick: Y,
135
- children: [/* @__PURE__ */ _(b, {
134
+ onClick: Ne,
135
+ children: [/* @__PURE__ */ v(x, {
136
136
  className: "h-4 w-4",
137
137
  "aria-hidden": "true"
138
- }), /* @__PURE__ */ _("span", { children: u("go_back") })]
138
+ }), /* @__PURE__ */ v("span", { children: d("go_back") })]
139
139
  })
140
140
  })
141
141
  ]
142
142
  })
143
143
  });
144
- let Pe = c(M.name, w.language, k), Fe = c(M.description, w.language, k), Ie = c(M.warning, w.language, k), Le = typeof M.images?.[0] == "string" ? M.images[0].trim() : "", X = de(M.primaryImageStyle), Z = we(M, J), Re = Ee(M), ze = Z ? d(Z) : Re, Be = s(ze), Ve = Ne ? u("availability_checking") : C(u, Z, ze), Q = Z ? f(Z) : Re === "OUT_OF_STOCK", $ = M.productVariants ?? [], He = $.some((e) => !!i(e, "size")) ? u("product_size_label") : u("product_variant_label"), Ue = !!V;
145
- return /* @__PURE__ */ _("div", {
144
+ let Pe = l(N.name, T.language, A), Fe = l(N.description, T.language, A), Ie = l(N.warning, T.language, A), Le = typeof N.images?.[0] == "string" ? N.images[0].trim() : "", X = ue(N.primaryImageStyle), Z = Ce(N, Y), Re = Te(N), ze = Z ? f(Z) : Re, Be = c(ze), Ve = Me ? d("availability_checking") : w(d, Z, ze), Q = Z ? p(Z) : Re === "OUT_OF_STOCK", $ = N.productVariants ?? [], He = $.some((e) => !!r(e, "size")) ? d("product_size_label") : d("product_variant_label"), Ue = !!H;
145
+ return /* @__PURE__ */ v("div", {
146
146
  className: "mx-auto max-w-7xl px-4 py-8 sm:px-6",
147
- children: /* @__PURE__ */ v("div", {
147
+ children: /* @__PURE__ */ y("div", {
148
148
  className: "flex flex-col gap-6",
149
- children: [/* @__PURE__ */ v("div", {
149
+ children: [/* @__PURE__ */ y("div", {
150
150
  className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
151
- children: [/* @__PURE__ */ v(p, {
151
+ children: [/* @__PURE__ */ y(m, {
152
152
  type: "button",
153
153
  variant: "ghost",
154
154
  className: "h-auto justify-start gap-2 self-start px-0 text-sm font-medium text-slate-700 hover:bg-transparent hover:text-slate-950",
155
- onClick: Y,
156
- children: [/* @__PURE__ */ _(b, {
155
+ onClick: Ne,
156
+ children: [/* @__PURE__ */ v(x, {
157
157
  className: "h-4 w-4",
158
158
  "aria-hidden": "true"
159
- }), /* @__PURE__ */ _("span", { children: u("go_back") })]
160
- }), /* @__PURE__ */ _(he, {
161
- to: I,
162
- className: y(O > 0 ? "inline-flex" : "hidden"),
163
- children: /* @__PURE__ */ v(p, {
159
+ }), /* @__PURE__ */ v("span", { children: d("go_back") })]
160
+ }), /* @__PURE__ */ v(me, {
161
+ to: L,
162
+ className: b(k > 0 ? "inline-flex" : "hidden"),
163
+ children: /* @__PURE__ */ y(m, {
164
164
  size: "sm",
165
165
  className: "gap-2",
166
- children: [/* @__PURE__ */ _("span", { children: u("checkout_button") }), /* @__PURE__ */ _(x, {
166
+ children: [/* @__PURE__ */ v("span", { children: d("checkout_button") }), /* @__PURE__ */ v(S, {
167
167
  className: "h-4 w-4",
168
168
  "aria-hidden": "true"
169
169
  })]
170
170
  })
171
171
  })]
172
- }), /* @__PURE__ */ v("div", {
172
+ }), /* @__PURE__ */ y("div", {
173
173
  className: "grid gap-6 lg:grid-cols-12",
174
- children: [/* @__PURE__ */ v("div", {
174
+ children: [/* @__PURE__ */ y("div", {
175
175
  className: "lg:col-span-7",
176
- children: [/* @__PURE__ */ _("div", {
177
- className: y("relative aspect-[1618/1000] overflow-hidden rounded-2xl", X.className),
176
+ children: [/* @__PURE__ */ v("div", {
177
+ className: b("relative aspect-[1618/1000] overflow-hidden rounded-2xl", X.className),
178
178
  style: X.style,
179
- children: Le ? /* @__PURE__ */ _("img", {
179
+ children: Le ? /* @__PURE__ */ v("img", {
180
180
  src: Le,
181
181
  alt: Pe,
182
182
  className: "absolute inset-0 h-full w-full object-contain p-2",
183
183
  loading: "lazy"
184
- }) : /* @__PURE__ */ _("div", {
184
+ }) : /* @__PURE__ */ v("div", {
185
185
  className: "absolute inset-0 flex items-center justify-center text-slate-400",
186
- children: /* @__PURE__ */ _(xe, {
186
+ children: /* @__PURE__ */ v(be, {
187
187
  className: "h-12 w-12",
188
188
  "aria-hidden": "true"
189
189
  })
190
190
  })
191
- }), /* @__PURE__ */ v("div", {
191
+ }), /* @__PURE__ */ y("div", {
192
192
  className: "mt-5 flex flex-col gap-3",
193
193
  children: [
194
- /* @__PURE__ */ v("div", {
194
+ /* @__PURE__ */ y("div", {
195
195
  className: "flex flex-wrap items-center gap-2",
196
- children: [/* @__PURE__ */ _(ie, {
196
+ children: [/* @__PURE__ */ v(re, {
197
197
  variant: Be.variant,
198
- children: /* @__PURE__ */ _("span", { children: Ve })
199
- }), /* @__PURE__ */ _(ue, { prices: M.prices })]
198
+ children: /* @__PURE__ */ v("span", { children: Ve })
199
+ }), /* @__PURE__ */ v(le, { prices: N.prices })]
200
200
  }),
201
- /* @__PURE__ */ _("h1", {
201
+ /* @__PURE__ */ v("h1", {
202
202
  className: "text-2xl font-semibold tracking-tight text-slate-950",
203
- children: /* @__PURE__ */ _("span", { children: Pe })
203
+ children: /* @__PURE__ */ v("span", { children: Pe })
204
204
  }),
205
- /* @__PURE__ */ _("p", {
205
+ /* @__PURE__ */ v("p", {
206
206
  className: "text-sm text-slate-600",
207
- children: /* @__PURE__ */ _("span", { children: Fe })
207
+ children: /* @__PURE__ */ v("span", { children: Fe })
208
208
  }),
209
- M.features?.length ? /* @__PURE__ */ v("div", {
209
+ N.features?.length ? /* @__PURE__ */ y("div", {
210
210
  className: "mt-2 space-y-2",
211
- children: [/* @__PURE__ */ _("p", {
211
+ children: [/* @__PURE__ */ v("p", {
212
212
  className: "text-sm font-semibold text-slate-950",
213
- children: /* @__PURE__ */ _("span", { children: u("product_features_title") })
214
- }), /* @__PURE__ */ _("ul", {
213
+ children: /* @__PURE__ */ v("span", { children: d("product_features_title") })
214
+ }), /* @__PURE__ */ v("ul", {
215
215
  className: "grid gap-1 text-sm text-slate-700",
216
- children: M.features.map((e, t) => /* @__PURE__ */ v("li", {
216
+ children: N.features.map((e, t) => /* @__PURE__ */ y("li", {
217
217
  className: "inline-flex items-start gap-2",
218
- children: [/* @__PURE__ */ _(Se, {
218
+ children: [/* @__PURE__ */ v(xe, {
219
219
  className: "mt-0.5 h-4 w-4 text-success",
220
220
  "aria-hidden": "true"
221
- }), /* @__PURE__ */ _("span", { children: c(e, w.language, k) })]
222
- }, `${M.id}-${t}`))
221
+ }), /* @__PURE__ */ v("span", { children: l(e, T.language, A) })]
222
+ }, `${N.id}-${t}`))
223
223
  })]
224
224
  }) : null,
225
- /* @__PURE__ */ _(le, { warning: Ie })
225
+ /* @__PURE__ */ v(ce, { warning: Ie })
226
226
  ]
227
227
  })]
228
- }), /* @__PURE__ */ _("div", {
228
+ }), /* @__PURE__ */ v("div", {
229
229
  className: "lg:col-span-5",
230
- children: /* @__PURE__ */ v(ce, {
230
+ children: /* @__PURE__ */ y(se, {
231
231
  className: "border-slate-200 bg-white shadow-sm",
232
- children: [/* @__PURE__ */ v("div", {
232
+ children: [/* @__PURE__ */ y("div", {
233
233
  className: "border-b border-slate-200 px-4 py-4",
234
- children: [/* @__PURE__ */ _("p", {
234
+ children: [/* @__PURE__ */ v("p", {
235
235
  className: "text-sm font-semibold text-slate-950",
236
- children: /* @__PURE__ */ _("span", { children: u("add_to_cart_title") })
237
- }), /* @__PURE__ */ _("p", {
236
+ children: /* @__PURE__ */ v("span", { children: d("add_to_cart_title") })
237
+ }), /* @__PURE__ */ v("p", {
238
238
  className: "mt-1 text-xs text-slate-600",
239
- children: /* @__PURE__ */ _("span", { children: u("add_to_cart_description") })
239
+ children: /* @__PURE__ */ v("span", { children: d("add_to_cart_description") })
240
240
  })]
241
- }), /* @__PURE__ */ v("div", {
241
+ }), /* @__PURE__ */ y("div", {
242
242
  className: "grid gap-4 px-4 py-4",
243
243
  children: [
244
- $.length > 1 ? /* @__PURE__ */ v("div", {
244
+ $.length > 1 ? /* @__PURE__ */ y("div", {
245
245
  className: "grid gap-2",
246
- children: [/* @__PURE__ */ _("p", {
246
+ children: [/* @__PURE__ */ v("p", {
247
247
  className: "text-xs font-medium text-slate-700",
248
- children: /* @__PURE__ */ _("span", { children: He })
249
- }), /* @__PURE__ */ _(pe, {
250
- value: V ?? "",
251
- onValueChange: H,
248
+ children: /* @__PURE__ */ v("span", { children: He })
249
+ }), /* @__PURE__ */ v(fe, {
250
+ value: H ?? "",
251
+ onValueChange: U,
252
252
  className: "grid gap-2",
253
253
  children: $.map((e) => {
254
- let t = `variant-${M.id}-${e.id}`.toLowerCase(), n = `storefront-product-variant-option-${M.id}-${e.id}`.toLowerCase(), { label: r, description: i } = ee(e), a = Te(M, e.id, J), o = a ? f(a) : Q, s = a ? C(u, a, d(a)) : Q ? u("availability_out_of_stock") : null;
255
- return /* @__PURE__ */ v("label", {
254
+ let t = `variant-${N.id}-${e.id}`.toLowerCase(), n = `storefront-product-variant-option-${N.id}-${e.id}`.toLowerCase(), { label: r, description: a } = i(e), o = we(N, e.id, Y), s = o ? p(o) : Q, c = o ? w(d, o, f(o)) : Q ? d("availability_out_of_stock") : null;
255
+ return /* @__PURE__ */ y("label", {
256
256
  htmlFor: t,
257
257
  "data-testid": n,
258
- className: y("flex items-start gap-3 rounded-xl border p-3 transition", V === e.id ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white"),
259
- children: [/* @__PURE__ */ _(me, {
258
+ className: b("flex items-start gap-3 rounded-xl border p-3 transition", H === e.id ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white"),
259
+ children: [/* @__PURE__ */ v(pe, {
260
260
  id: t,
261
261
  value: e.id,
262
262
  className: "mt-1"
263
- }), /* @__PURE__ */ v("span", {
263
+ }), /* @__PURE__ */ y("span", {
264
264
  className: "flex flex-1 flex-col gap-0.5",
265
265
  children: [
266
- /* @__PURE__ */ _("span", {
266
+ /* @__PURE__ */ v("span", {
267
267
  className: "text-sm font-medium text-slate-950",
268
268
  children: r
269
269
  }),
270
- i ? /* @__PURE__ */ _("span", {
270
+ a ? /* @__PURE__ */ v("span", {
271
271
  className: "text-xs text-slate-600",
272
- children: i
272
+ children: a
273
273
  }) : null,
274
- s ? /* @__PURE__ */ _("span", {
274
+ c ? /* @__PURE__ */ v("span", {
275
275
  className: "pt-1",
276
- children: /* @__PURE__ */ _(ie, {
277
- variant: o ? "destructive" : "outline",
278
- children: /* @__PURE__ */ _("span", { children: s })
276
+ children: /* @__PURE__ */ v(re, {
277
+ variant: s ? "destructive" : "outline",
278
+ children: /* @__PURE__ */ v("span", { children: c })
279
279
  })
280
280
  }) : null
281
281
  ]
@@ -284,42 +284,42 @@ function w() {
284
284
  })
285
285
  })]
286
286
  }) : null,
287
- /* @__PURE__ */ v("div", {
287
+ /* @__PURE__ */ y("div", {
288
288
  className: "grid gap-2",
289
- children: [/* @__PURE__ */ _("p", {
289
+ children: [/* @__PURE__ */ v("p", {
290
290
  className: "text-xs font-medium text-slate-700",
291
- children: /* @__PURE__ */ _("span", { children: u("quantity_label") })
292
- }), /* @__PURE__ */ _(ae, {
291
+ children: /* @__PURE__ */ v("span", { children: d("quantity_label") })
292
+ }), /* @__PURE__ */ v(ie, {
293
293
  type: "number",
294
294
  min: 1,
295
295
  max: 99,
296
- value: z,
297
- onChange: (e) => B(Number(e.target.value))
296
+ value: B,
297
+ onChange: (e) => V(Number(e.target.value))
298
298
  })]
299
299
  }),
300
- /* @__PURE__ */ v(p, {
300
+ /* @__PURE__ */ y(m, {
301
301
  className: "h-11 rounded-xl text-sm font-semibold gap-2",
302
302
  onClick: () => {
303
- V && ke({
304
- kind: M.kind,
305
- productId: o(M),
306
- ...V ? { productVariantId: V } : {},
307
- quantity: U
303
+ H && Oe({
304
+ kind: N.kind,
305
+ productId: o(N),
306
+ ...H ? { productVariantId: H } : {},
307
+ quantity: W
308
308
  });
309
309
  },
310
310
  disabled: !Ue,
311
- children: [/* @__PURE__ */ _("span", { children: u("add_to_cart") }), /* @__PURE__ */ _(x, {
311
+ children: [/* @__PURE__ */ v("span", { children: d("add_to_cart") }), /* @__PURE__ */ v(S, {
312
312
  className: "h-4 w-4",
313
313
  "aria-hidden": "true"
314
314
  })]
315
315
  }),
316
- /* @__PURE__ */ _(he, {
317
- to: I,
318
- className: y(O > 0 ? "block" : "hidden"),
319
- children: /* @__PURE__ */ v(p, {
316
+ /* @__PURE__ */ v(me, {
317
+ to: L,
318
+ className: b(k > 0 ? "block" : "hidden"),
319
+ children: /* @__PURE__ */ y(m, {
320
320
  variant: "outline",
321
321
  className: "h-11 w-full rounded-xl gap-2",
322
- children: [/* @__PURE__ */ _("span", { children: u("go_to_checkout") }), /* @__PURE__ */ _(x, {
322
+ children: [/* @__PURE__ */ v("span", { children: d("go_to_checkout") }), /* @__PURE__ */ v(S, {
323
323
  className: "h-4 w-4",
324
324
  "aria-hidden": "true"
325
325
  })]
@@ -334,4 +334,4 @@ function w() {
334
334
  });
335
335
  }
336
336
  //#endregion
337
- export { w as default };
337
+ export { T as default };