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