@loczer/storefront-sdk 0.160.0 → 0.162.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 (40) hide show
  1. package/dist/chunks/booking-engine/dist/utils/{pricing-DcnUXaeI.js → pricing-CYLeWtmu.js} +6 -6
  2. package/dist/components/BikeProductCard/index.js +1 -1
  3. package/dist/components/ContactSection/index.js +2 -2
  4. package/dist/components/StorefrontCartPanel/index.d.ts +3 -1
  5. package/dist/components/StorefrontCartPanel/index.d.ts.map +1 -1
  6. package/dist/components/StorefrontCartPanel/index.js +25 -23
  7. package/dist/i18n/en.js +1 -1
  8. package/dist/i18n/fr.js +1 -1
  9. package/dist/index.d.ts +4 -3
  10. package/dist/lib/checkoutSubmit.d.ts +2 -2
  11. package/dist/lib/checkoutSubmit.js +1 -1
  12. package/dist/lib/fetchStorefrontTimeSlots.d.ts +4 -0
  13. package/dist/lib/fetchStorefrontTimeSlots.d.ts.map +1 -0
  14. package/dist/lib/fetchStorefrontTimeSlots.js +22 -0
  15. package/dist/lib/pricing.js +3 -3
  16. package/dist/pages/BookingPage.d.ts.map +1 -1
  17. package/dist/pages/BookingPage.js +98 -101
  18. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  19. package/dist/pages/CheckoutPage.js +71 -75
  20. package/dist/pages/CheckoutPaymentPage.js +5 -5
  21. package/dist/pages/CheckoutSuccessPage.js +6 -6
  22. package/dist/pages/ContractSaleDocumentPage.js +1 -1
  23. package/dist/pages/HomePage.d.ts.map +1 -1
  24. package/dist/pages/HomePage.js +134 -137
  25. package/dist/pages/PaymentLinkPage.js +3 -3
  26. package/dist/pages/PaymentLinkSuccessPage.js +1 -1
  27. package/dist/pages/ProductPage.js +3 -3
  28. package/dist/pages/checkout/components/CheckoutCouponCard.d.ts +2 -1
  29. package/dist/pages/checkout/components/CheckoutCouponCard.d.ts.map +1 -1
  30. package/dist/pages/checkout/components/CheckoutCouponCard.js +37 -36
  31. package/dist/pages/checkout/components/CheckoutDetailsCard.js +2 -2
  32. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +21 -21
  33. package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +6 -2
  34. package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
  35. package/dist/pages/checkout/components/CheckoutSummaryColumn.js +26 -23
  36. package/dist/pages/checkout/types.d.ts +1 -1
  37. package/dist/pages/checkout/types.js +3 -3
  38. package/dist/storefront.css +1 -1
  39. package/dist/ui/card.js +26 -26
  40. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
1
  function d(n, r) {
2
2
  return n.quantity - r.quantity;
3
3
  }
4
- function g(n) {
5
- return Number.isInteger(n) && n > 0;
4
+ function q(n) {
5
+ return Number.isFinite(n) && n > 0;
6
6
  }
7
- function q(n, r, a = "day") {
8
- if (!g(r))
9
- throw new Error(`Requested quantity must be a positive integer (received ${r}).`);
7
+ function v(n, r, a = "day") {
8
+ if (!q(r))
9
+ throw new Error(`Requested quantity must be a positive number (received ${r}).`);
10
10
  if (!n || n.length === 0)
11
11
  throw new Error("Cannot calculate price without pricing tiers.");
12
12
  const c = n.filter((t) => t.unit === a).sort(d);
@@ -32,5 +32,5 @@ function q(n, r, a = "day") {
32
32
  return Math.round(e);
33
33
  }
34
34
  export {
35
- q as calculatePriceForQuantity
35
+ v as calculatePriceForQuantity
36
36
  };
@@ -24,7 +24,7 @@ function F({
24
24
  return /* @__PURE__ */ a(
25
25
  "div",
26
26
  {
27
- className: "flex h-full flex-col gap-2 rounded-2xl border border-slate-200 bg-white p-4 shadow-sm",
27
+ className: "flex h-full flex-col gap-2 rounded-xl border border-slate-200 bg-white p-3 shadow-sm",
28
28
  "data-testid": g,
29
29
  children: [
30
30
  /* @__PURE__ */ a("div", { className: "flex flex-1 items-stretch gap-4", children: [
@@ -62,8 +62,8 @@ function we({ preset: s, storeSlug: j }) {
62
62
  /* @__PURE__ */ e("h2", { className: "text-3xl font-semibold tracking-tight text-slate-950", children: t("contact_section_title") }),
63
63
  /* @__PURE__ */ e("p", { className: "mt-3 text-sm text-slate-600 sm:text-base", children: t("contact_section_subtitle") })
64
64
  ] }),
65
- /* @__PURE__ */ r("div", { className: "mt-10 grid gap-8 rounded-2xl border border-slate-200 bg-white p-6 shadow-sm lg:grid-cols-2 lg:gap-10 lg:p-10", children: [
66
- /* @__PURE__ */ r("div", { className: "flex flex-col gap-8 lg:border-r lg:border-slate-200 lg:pr-10", children: [
65
+ /* @__PURE__ */ r("div", { 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", children: [
66
+ /* @__PURE__ */ r("div", { className: "flex flex-col gap-6 lg:border-r lg:border-slate-200 lg:pr-6", children: [
67
67
  /* @__PURE__ */ r("div", { children: [
68
68
  /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-slate-950", children: t("contact_section_info_title") }),
69
69
  /* @__PURE__ */ e("p", { className: "mt-2 text-sm text-slate-600", children: t(T ? "contact_section_info_description" : "contact_section_info_description_without_whatsapp") })
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { StorefrontCartSummaryLine } from '../../lib/cartSummary';
2
3
  type StorefrontCartPanelProps = {
3
4
  lines: StorefrontCartSummaryLine[];
@@ -16,11 +17,12 @@ type StorefrontCartPanelProps = {
16
17
  showCheckoutAction?: boolean;
17
18
  showClearAction?: boolean;
18
19
  editable?: boolean;
20
+ summaryAddon?: ReactNode;
19
21
  stickyTopClassName?: string;
20
22
  onQuantityChange?: (key: string, quantity: number) => void;
21
23
  onRemove?: (key: string) => void;
22
24
  onClear?: () => void;
23
25
  };
24
- export declare function StorefrontCartPanel({ lines, itemCount, totalPerDayMinor, estimatedDays, estimatedTotalMinor, discountedEstimatedTotalMinor, discountAmountMinor, lateReturnSurchargeMinor, couponCode, durationLabel, title, description, checkoutPath, showCheckoutAction, showClearAction, editable, stickyTopClassName, onQuantityChange, onRemove, onClear, }: StorefrontCartPanelProps): import("react/jsx-runtime").JSX.Element;
26
+ export declare function StorefrontCartPanel({ lines, itemCount, totalPerDayMinor, estimatedDays, estimatedTotalMinor, discountedEstimatedTotalMinor, discountAmountMinor, lateReturnSurchargeMinor, couponCode, durationLabel, title, description, checkoutPath, showCheckoutAction, showClearAction, editable, summaryAddon, stickyTopClassName, onQuantityChange, onRemove, onClear, }: StorefrontCartPanelProps): import("react/jsx-runtime").JSX.Element;
25
27
  export {};
26
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StorefrontCartPanel/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAQtE,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,yBAAyB,EAAE,CAAA;IAClC,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,6BAA6B,CAAC,EAAE,MAAM,CAAA;IACtC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1D,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,UAAU,EACV,aAAa,EACb,KAAK,EACL,WAAW,EACX,YAAY,EACZ,kBAA0B,EAC1B,eAAuB,EACvB,QAAe,EACf,kBAA6B,EAC7B,gBAAgB,EAChB,QAAQ,EACR,OAAO,GACR,EAAE,wBAAwB,2CAwL1B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StorefrontCartPanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAQtE,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,yBAAyB,EAAE,CAAA;IAClC,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,6BAA6B,CAAC,EAAE,MAAM,CAAA;IACtC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1D,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,UAAU,EACV,aAAa,EACb,KAAK,EACL,WAAW,EACX,YAAY,EACZ,kBAA0B,EAC1B,eAAuB,EACvB,QAAe,EACf,YAAY,EACZ,kBAA6B,EAC7B,gBAAgB,EAChB,QAAQ,EACR,OAAO,GACR,EAAE,wBAAwB,2CA0L1B"}
@@ -1,15 +1,15 @@
1
- import { jsxs as l, jsx as e, Fragment as B } from "react/jsx-runtime";
2
- import { Link as F } from "@rpcbase/router";
1
+ import { jsxs as l, jsx as e, Fragment as F } from "react/jsx-runtime";
2
+ import { Link as W } from "@rpcbase/router";
3
3
  import { cn as d } from "@rpcbase/ui";
4
- import { Trash2 as W, ArrowRight as D } from "lucide-react";
5
- import { useTranslation as T } from "react-i18next";
4
+ import { Trash2 as D, ArrowRight as T } from "lucide-react";
5
+ import { useTranslation as E } from "react-i18next";
6
6
  import { formatPriceMinor as r } from "../../lib/utils.js";
7
7
  import { Badge as m } from "../../ui/badge.js";
8
8
  import { Button as o } from "../../ui/button.js";
9
- import { Card as E } from "../../ui/card.js";
10
- import { Input as G } from "../../ui/input.js";
11
- import { ProductWarningNotice as H } from "../ProductWarningNotice/index.js";
12
- function M({
9
+ import { Card as G } from "../../ui/card.js";
10
+ import { Input as H } from "../../ui/input.js";
11
+ import { ProductWarningNotice as J } from "../ProductWarningNotice/index.js";
12
+ function ee({
13
13
  lines: n,
14
14
  itemCount: _,
15
15
  totalPerDayMinor: v,
@@ -26,13 +26,14 @@ function M({
26
26
  showCheckoutAction: q = !1,
27
27
  showClearAction: C = !1,
28
28
  editable: V = !0,
29
- stickyTopClassName: L = "top-24",
29
+ summaryAddon: L,
30
+ stickyTopClassName: P = "top-24",
30
31
  onQuantityChange: b,
31
32
  onRemove: N,
32
33
  onClear: g
33
34
  }) {
34
- const { t, i18n: s } = T();
35
- return /* @__PURE__ */ l(E, { className: d("sticky border-slate-200 bg-white shadow-sm", L), children: [
35
+ const { t, i18n: s } = E();
36
+ return /* @__PURE__ */ l(G, { className: d("sticky border-slate-200 bg-white shadow-sm", P), children: [
36
37
  /* @__PURE__ */ l("div", { className: "border-b border-slate-200 px-4 py-4", children: [
37
38
  /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-3", children: [
38
39
  /* @__PURE__ */ e("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: j ?? t("cart_title") }) }),
@@ -42,7 +43,7 @@ function M({
42
43
  ] }),
43
44
  /* @__PURE__ */ l("div", { className: "grid gap-3 p-4", children: [
44
45
  n.length === 0 ? /* @__PURE__ */ e("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: t("cart_empty") }) }) : /* @__PURE__ */ e("div", { className: "grid gap-3", children: n.map((a) => {
45
- const P = r(a.unitPriceMinor, s.language), $ = a.insufficientCapacity === !0, z = a.availabilityIssue === "quantity_unavailable" ? t("availability_quantity_unavailable") : t("availability_out_of_stock");
46
+ const $ = r(a.unitPriceMinor, s.language), z = a.insufficientCapacity === !0, I = a.availabilityIssue === "quantity_unavailable" ? t("availability_quantity_unavailable") : t("availability_out_of_stock");
46
47
  return /* @__PURE__ */ l(
47
48
  "div",
48
49
  {
@@ -52,20 +53,20 @@ function M({
52
53
  /* @__PURE__ */ e("p", { className: "truncate text-sm font-medium text-slate-950", children: /* @__PURE__ */ e("span", { children: a.productName }) }),
53
54
  a.productVariantLabel ? /* @__PURE__ */ e("p", { className: "text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: `${t(a.productVariantIsSize ? "product_size_label" : "product_variant_label")}: ${a.productVariantLabel}` }) }) : null,
54
55
  a.productVariantDescription ? /* @__PURE__ */ e("p", { className: "text-xs text-slate-500", children: /* @__PURE__ */ e("span", { children: a.productVariantDescription }) }) : null,
55
- /* @__PURE__ */ e(H, { warning: a.productWarning }),
56
- /* @__PURE__ */ e("p", { className: "text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: t("cart_line_meta", { quantity: a.quantity, price: P }) }) }),
57
- $ ? /* @__PURE__ */ e("div", { className: "flex flex-col items-start gap-1 pt-1", children: /* @__PURE__ */ e(m, { variant: "destructive", children: /* @__PURE__ */ e("span", { children: z }) }) }) : null
56
+ /* @__PURE__ */ e(J, { warning: a.productWarning }),
57
+ /* @__PURE__ */ e("p", { className: "text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: t("cart_line_meta", { quantity: a.quantity, price: $ }) }) }),
58
+ z ? /* @__PURE__ */ e("div", { className: "flex flex-col items-start gap-1 pt-1", children: /* @__PURE__ */ e(m, { variant: "destructive", children: /* @__PURE__ */ e("span", { children: I }) }) }) : null
58
59
  ] }),
59
60
  V ? /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
60
61
  b ? /* @__PURE__ */ e(
61
- G,
62
+ H,
62
63
  {
63
64
  type: "number",
64
65
  min: 1,
65
66
  max: 99,
66
67
  value: a.quantity,
67
- onChange: (I) => {
68
- const y = Number(I.target.value);
68
+ onChange: (B) => {
69
+ const y = Number(B.target.value);
69
70
  b(a.key, Number.isFinite(y) ? y : 0);
70
71
  },
71
72
  className: "h-9 w-16",
@@ -81,7 +82,7 @@ function M({
81
82
  className: "h-8 w-8 text-slate-500 hover:bg-slate-50 hover:text-slate-700",
82
83
  onClick: () => N(a.key),
83
84
  "aria-label": t("remove_from_cart"),
84
- children: /* @__PURE__ */ e(W, { className: "h-4 w-4", "aria-hidden": "true" })
85
+ children: /* @__PURE__ */ e(D, { className: "h-4 w-4", "aria-hidden": "true" })
85
86
  }
86
87
  ) : null
87
88
  ] }) : null
@@ -90,11 +91,12 @@ function M({
90
91
  a.key
91
92
  );
92
93
  }) }),
94
+ L,
93
95
  /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-3 border-t border-slate-200 pt-3 text-sm", children: [
94
96
  /* @__PURE__ */ e("p", { className: "text-slate-700", children: /* @__PURE__ */ e("span", { children: t("cart_total_per_day") }) }),
95
97
  /* @__PURE__ */ e("p", { className: "font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: r(v, s.language) }) })
96
98
  ] }),
97
- typeof p == "number" && typeof h == "number" ? /* @__PURE__ */ l(B, { children: [
99
+ typeof p == "number" && typeof h == "number" ? /* @__PURE__ */ l(F, { children: [
98
100
  /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-3 text-sm", children: [
99
101
  /* @__PURE__ */ e("p", { className: "text-slate-700", children: /* @__PURE__ */ e("span", { children: t("checkout_estimated_days", { count: p }) }) }),
100
102
  u ? /* @__PURE__ */ e(m, { variant: "outline", className: "border-slate-200 bg-white text-slate-700", children: /* @__PURE__ */ e("span", { children: u }) }) : null
@@ -113,9 +115,9 @@ function M({
113
115
  ] })
114
116
  ] }) : null,
115
117
  /* @__PURE__ */ l("div", { className: "grid gap-2", children: [
116
- q && f ? /* @__PURE__ */ e(F, { to: f, className: d(n.length > 0 ? "block" : "hidden"), children: /* @__PURE__ */ l(o, { className: "w-full gap-2", children: [
118
+ q && f ? /* @__PURE__ */ e(W, { to: f, className: d(n.length > 0 ? "block" : "hidden"), children: /* @__PURE__ */ l(o, { className: "w-full gap-2", children: [
117
119
  /* @__PURE__ */ e("span", { children: t("checkout_button") }),
118
- /* @__PURE__ */ e(D, { className: "h-4 w-4", "aria-hidden": "true" })
120
+ /* @__PURE__ */ e(T, { className: "h-4 w-4", "aria-hidden": "true" })
119
121
  ] }) }) : null,
120
122
  C && g ? /* @__PURE__ */ e(
121
123
  o,
@@ -132,5 +134,5 @@ function M({
132
134
  ] });
133
135
  }
134
136
  export {
135
- M as StorefrontCartPanel
137
+ ee as StorefrontCartPanel
136
138
  };
package/dist/i18n/en.js CHANGED
@@ -127,7 +127,7 @@ const e = {
127
127
  checkout_full_name_placeholder: "Jane Doe",
128
128
  checkout_email_label: "Email",
129
129
  checkout_email_placeholder: "jane@example.com",
130
- checkout_phone_label: "Phone (optional)",
130
+ checkout_phone_label: "Phone",
131
131
  checkout_phone_placeholder: "+1 555 555 5555",
132
132
  checkout_notes_label: "Notes or message (optional)",
133
133
  checkout_notes_placeholder: "Any details about your booking…",
package/dist/i18n/fr.js CHANGED
@@ -127,7 +127,7 @@ const e = {
127
127
  checkout_full_name_placeholder: "Jean Dupont",
128
128
  checkout_email_label: "Email",
129
129
  checkout_email_placeholder: "jean@example.com",
130
- checkout_phone_label: "Téléphone (optionnel)",
130
+ checkout_phone_label: "Téléphone",
131
131
  checkout_phone_placeholder: "+33 6 00 00 00 00",
132
132
  checkout_notes_label: "Notes ou message (optionnel)",
133
133
  checkout_notes_placeholder: "Précisions pour votre réservation…",
package/dist/index.d.ts CHANGED
@@ -2801,7 +2801,7 @@ export declare type StorefrontCartItem = {
2801
2801
  quantity: number;
2802
2802
  };
2803
2803
 
2804
- export declare function StorefrontCartPanel({ lines, itemCount, totalPerDayMinor, estimatedDays, estimatedTotalMinor, discountedEstimatedTotalMinor, discountAmountMinor, lateReturnSurchargeMinor, couponCode, durationLabel, title, description, checkoutPath, showCheckoutAction, showClearAction, editable, stickyTopClassName, onQuantityChange, onRemove, onClear, }: StorefrontCartPanelProps): JSX.Element;
2804
+ export declare function StorefrontCartPanel({ lines, itemCount, totalPerDayMinor, estimatedDays, estimatedTotalMinor, discountedEstimatedTotalMinor, discountAmountMinor, lateReturnSurchargeMinor, couponCode, durationLabel, title, description, checkoutPath, showCheckoutAction, showClearAction, editable, summaryAddon, stickyTopClassName, onQuantityChange, onRemove, onClear, }: StorefrontCartPanelProps): JSX.Element;
2805
2805
 
2806
2806
  declare type StorefrontCartPanelProps = {
2807
2807
  lines: StorefrontCartSummaryLine[];
@@ -2820,6 +2820,7 @@ declare type StorefrontCartPanelProps = {
2820
2820
  showCheckoutAction?: boolean;
2821
2821
  showClearAction?: boolean;
2822
2822
  editable?: boolean;
2823
+ summaryAddon?: ReactNode;
2823
2824
  stickyTopClassName?: string;
2824
2825
  onQuantityChange?: (key: string, quantity: number) => void;
2825
2826
  onRemove?: (key: string) => void;
@@ -2893,7 +2894,7 @@ export declare const storefrontCheckoutSubmitRequestBaseSchema: z.ZodObject<{
2893
2894
  customer: z.ZodObject<{
2894
2895
  fullName: z.ZodString;
2895
2896
  email: z.ZodString;
2896
- phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
2897
+ phone: z.ZodString;
2897
2898
  notes: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
2898
2899
  }, z.core.$strip>;
2899
2900
  items: z.ZodArray<z.ZodObject<{
@@ -2926,7 +2927,7 @@ export declare const storefrontCheckoutSubmitRequestSchema: z.ZodObject<{
2926
2927
  customer: z.ZodObject<{
2927
2928
  fullName: z.ZodString;
2928
2929
  email: z.ZodString;
2929
- phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
2930
+ phone: z.ZodString;
2930
2931
  notes: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
2931
2932
  }, z.core.$strip>;
2932
2933
  items: z.ZodArray<z.ZodObject<{
@@ -26,7 +26,7 @@ export declare const requestBaseSchema: z.ZodObject<{
26
26
  customer: z.ZodObject<{
27
27
  fullName: z.ZodString;
28
28
  email: z.ZodString;
29
- phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
29
+ phone: z.ZodString;
30
30
  notes: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
31
31
  }, z.core.$strip>;
32
32
  items: z.ZodArray<z.ZodObject<{
@@ -60,7 +60,7 @@ export declare const requestSchema: z.ZodObject<{
60
60
  customer: z.ZodObject<{
61
61
  fullName: z.ZodString;
62
62
  email: z.ZodString;
63
- phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
63
+ phone: z.ZodString;
64
64
  notes: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
65
65
  }, z.core.$strip>;
66
66
  items: z.ZodArray<z.ZodObject<{
@@ -27,7 +27,7 @@ const x = "/api/public/storefront/checkout/submit", n = t.object({
27
27
  customer: t.object({
28
28
  fullName: t.string().trim().min(2),
29
29
  email: t.string().trim().email(),
30
- phone: t.string().trim().min(6).optional().or(t.literal("")),
30
+ phone: t.string().trim().min(6),
31
31
  notes: t.string().trim().max(2e3).optional().or(t.literal(""))
32
32
  }),
33
33
  items: t.array(n).min(1),
@@ -0,0 +1,4 @@
1
+ import { JourneyType, TimeSlot } from './booking-period-time-slots';
2
+ export type StorefrontTimeSlotsFetcher = (date: string, journey: JourneyType) => Promise<TimeSlot[] | null>;
3
+ export declare const createStorefrontTimeSlotsFetcher: (storeSlug?: string) => StorefrontTimeSlotsFetcher | undefined;
4
+ //# sourceMappingURL=fetchStorefrontTimeSlots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchStorefrontTimeSlots.d.ts","sourceRoot":"","sources":["../../src/lib/fetchStorefrontTimeSlots.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAO7E,MAAM,MAAM,0BAA0B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAA;AAI3G,eAAO,MAAM,gCAAgC,GAAI,YAAY,MAAM,KAAG,0BAA0B,GAAG,SAsBlG,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { apiGet as l } from "./apiCall.js";
2
+ import { ROUTE as u, responseSchema as m } from "./storefrontTimeSlots.js";
3
+ const s = /* @__PURE__ */ new Map(), f = (c) => {
4
+ const e = c?.trim().toLowerCase();
5
+ if (!e)
6
+ return;
7
+ const t = s.get(e);
8
+ if (t)
9
+ return t;
10
+ const r = async (n, a) => {
11
+ const i = await l(u, {
12
+ storeSlug: e,
13
+ date: n,
14
+ journey: a
15
+ }), o = m.parse(i);
16
+ return o.success ? o.timeSlots ?? null : null;
17
+ };
18
+ return s.set(e, r), r;
19
+ };
20
+ export {
21
+ f as createStorefrontTimeSlotsFetcher
22
+ };
@@ -1,4 +1,4 @@
1
- import { calculatePriceForQuantity as g } from "../chunks/booking-engine/dist/utils/pricing-DcnUXaeI.js";
1
+ import { calculatePriceForQuantity as D } from "../chunks/booking-engine/dist/utils/pricing-CYLeWtmu.js";
2
2
  import { formatPriceMinor as d } from "./utils.js";
3
3
  const f = "EUR", b = 8, p = (t) => [...t].sort((r, i) => r.quantity - i.quantity), P = (t) => t.find((r) => r.currency?.trim())?.currency?.trim() || f, F = (t) => Math.abs(t) % 100 !== 0 ? {} : {
4
4
  minimumFractionDigits: 0,
@@ -17,7 +17,7 @@ function Q(t, r) {
17
17
  const i = m(t);
18
18
  if (i.length === 0) return null;
19
19
  try {
20
- return g(i, r, "day");
20
+ return D(i, r, "day");
21
21
  } catch {
22
22
  return null;
23
23
  }
@@ -38,7 +38,7 @@ function E(t, r) {
38
38
  function I(t, r, i) {
39
39
  const n = m(t), a = P(n);
40
40
  return n.map((c, e) => {
41
- const o = e > 0 ? n[e - 1] : void 0, s = o?.quantity ?? 0, D = o?.value ?? 0, l = c.quantity - s, y = c.value - D;
41
+ const o = e > 0 ? n[e - 1] : void 0, s = o?.quantity ?? 0, g = o?.value ?? 0, l = c.quantity - s, y = c.value - g;
42
42
  return l <= 0 || y < 0 ? u(c.value, r, { currency: a }) : `${u(y, r, { currency: a })} / ${_(l, r, i)}`;
43
43
  });
44
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BookingPage.d.ts","sourceRoot":"","sources":["../../src/pages/BookingPage.tsx"],"names":[],"mappings":"AAwQA,MAAM,CAAC,OAAO,UAAU,WAAW,4CA+lBlC"}
1
+ {"version":3,"file":"BookingPage.d.ts","sourceRoot":"","sources":["../../src/pages/BookingPage.tsx"],"names":[],"mappings":"AAwQA,MAAM,CAAC,OAAO,UAAU,WAAW,4CA2lBlC"}