@loczer/storefront-sdk 0.161.0 → 0.163.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 (39) 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 +37 -5
  10. package/dist/index.js +308 -303
  11. package/dist/lib/checkoutSubmit.d.ts +2 -2
  12. package/dist/lib/checkoutSubmit.js +1 -1
  13. package/dist/lib/pricing.js +3 -3
  14. package/dist/lib/products.d.ts +23 -2
  15. package/dist/lib/products.d.ts.map +1 -1
  16. package/dist/lib/products.js +69 -36
  17. package/dist/pages/BookingPage.js +1 -1
  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.js +7 -7
  24. package/dist/pages/PaymentLinkPage.js +3 -3
  25. package/dist/pages/PaymentLinkSuccessPage.js +1 -1
  26. package/dist/pages/ProductPage.js +3 -3
  27. package/dist/pages/checkout/components/CheckoutCouponCard.d.ts +2 -1
  28. package/dist/pages/checkout/components/CheckoutCouponCard.d.ts.map +1 -1
  29. package/dist/pages/checkout/components/CheckoutCouponCard.js +37 -36
  30. package/dist/pages/checkout/components/CheckoutDetailsCard.js +2 -2
  31. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +21 -21
  32. package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +6 -2
  33. package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
  34. package/dist/pages/checkout/components/CheckoutSummaryColumn.js +26 -23
  35. package/dist/pages/checkout/types.d.ts +1 -1
  36. package/dist/pages/checkout/types.js +3 -3
  37. package/dist/storefront.css +1 -1
  38. package/dist/ui/card.js +26 -26
  39. package/package.json +1 -1
@@ -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),
@@ -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
  }
@@ -7,6 +7,13 @@ export type AccessoryProduct = StorefrontPublicAccessoryProduct & {
7
7
  kind: "accessory";
8
8
  };
9
9
  export type StorefrontProduct = BikeProduct | AccessoryProduct;
10
+ export declare const CATALOG_PRODUCT_BASE_RATE_UNSET = -1;
11
+ export type CatalogProductSortPriceUnit = StorefrontPublicProductPrice["unit"];
12
+ export type CatalogProductSortField = "kind" | "assetRelScore" | "baseHourlyRateMinor" | "baseHalfDayRateMinor" | "baseDailyRateMinor" | "baseWeeklyRateMinor" | "baseMonthlyRateMinor" | "externalId";
13
+ export type CatalogProductPaginationSort = Array<{
14
+ field: CatalogProductSortField;
15
+ order: "asc" | "desc";
16
+ }>;
10
17
  type SortableStorefrontProduct = {
11
18
  id: string;
12
19
  prices?: StorefrontPublicProductPrice[];
@@ -15,6 +22,16 @@ type SortableStorefrontProduct = {
15
22
  type SortableStorefrontBikeProduct = SortableStorefrontProduct & {
16
23
  kind?: StorefrontPublicBikeProduct["kind"];
17
24
  };
25
+ type SortableCatalogProduct = {
26
+ id?: string;
27
+ externalId?: string;
28
+ kind?: string;
29
+ prices?: StorefrontPublicProductPrice[];
30
+ assetRelScore?: number;
31
+ };
32
+ export type CatalogProductSortOptions = {
33
+ priceUnit?: CatalogProductSortPriceUnit;
34
+ };
18
35
  export type StorefrontProductsCollections = {
19
36
  bikes: BikeProduct[];
20
37
  accessories: AccessoryProduct[];
@@ -24,9 +41,13 @@ export declare const buildStorefrontProductSlug: ({ id, productShortCode, name,
24
41
  productShortCode?: string | null;
25
42
  name?: LocalizedString;
26
43
  }) => string;
44
+ export declare function getCatalogProductSortFieldForPriceUnit(unit: CatalogProductSortPriceUnit): CatalogProductSortField;
45
+ export declare function getCatalogProductPaginationSort(priceUnit: CatalogProductSortPriceUnit): CatalogProductPaginationSort;
46
+ export declare function getCatalogProductBaseRateMinor(prices: StorefrontPublicProductPrice[] | undefined, priceUnit?: CatalogProductSortPriceUnit): number;
27
47
  export declare function getStorefrontBaseDailyRateMinor(prices: StorefrontPublicProductPrice[] | undefined): number;
28
- export declare function compareStorefrontBikeProducts<T extends SortableStorefrontBikeProduct>(left: T, right: T): number;
29
- export declare function compareStorefrontAccessoryProducts<T extends SortableStorefrontProduct>(left: T, right: T): number;
48
+ export declare function compareCatalogProducts<T extends SortableCatalogProduct>(left: T, right: T, options?: CatalogProductSortOptions): number;
49
+ export declare function compareStorefrontBikeProducts<T extends SortableStorefrontBikeProduct>(left: T, right: T, options?: CatalogProductSortOptions): number;
50
+ export declare function compareStorefrontAccessoryProducts<T extends SortableStorefrontProduct>(left: T, right: T, options?: CatalogProductSortOptions): number;
30
51
  export declare const toStorefrontBikeProducts: (bikes: StorefrontPublicBikeProduct[]) => BikeProduct[];
31
52
  export declare const toStorefrontAccessoryProducts: (accessories: StorefrontPublicAccessoryProduct[]) => AccessoryProduct[];
32
53
  export declare const findStorefrontProduct: (id: string, products: StorefrontProductsCollections) => StorefrontProduct | null;
@@ -1 +1 @@
1
- {"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/lib/products.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EAChC,2BAA2B,EAC3B,4BAA4B,EAC7B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGtD,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,2BAA2B,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAA;AACjG,MAAM,MAAM,gBAAgB,GAAG,gCAAgC,GAAG;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAA;AACvF,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAA;AAI9D,KAAK,yBAAyB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,4BAA4B,EAAE,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,KAAK,6BAA6B,GAAG,yBAAyB,GAAG;IAC/D,IAAI,CAAC,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAA;CAC3C,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB,WAAW,EAAE,gBAAgB,EAAE,CAAA;CAChC,CAAA;AAsBD,eAAO,MAAM,0BAA0B,GAAI,iCAIxC;IACD,EAAE,EAAE,MAAM,CAAA;IACV,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,IAAI,CAAC,EAAE,eAAe,CAAA;CACvB,KAAG,MAMH,CAAA;AAED,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,4BAA4B,EAAE,GAAG,SAAS,GAAG,MAAM,CAG1G;AAED,wBAAgB,6BAA6B,CAAC,CAA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AI,GAAG,mBAAmB,CAAC,KAAG,MAC7D,CAAA;AAEjD,eAAO,MAAM,iCAAiC,GAC5C,SAAS,IAAI,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,KACvD,MAAM,GAAG,SAGX,CAAA"}
@@ -1,58 +1,91 @@
1
- const u = /[\u0300-\u036f]/g, d = /[^a-z0-9]+/g, l = /^-+|-+$/g, i = (e) => e.normalize("NFKD").replace(u, "").toLowerCase().replace(d, "-").replace(l, ""), f = (e) => {
1
+ const P = -1, k = {
2
+ hour: "baseHourlyRateMinor",
3
+ half_day: "baseHalfDayRateMinor",
4
+ day: "baseDailyRateMinor",
5
+ week: "baseWeeklyRateMinor",
6
+ month: "baseMonthlyRateMinor"
7
+ }, S = /[\u0300-\u036f]/g, b = /[^a-z0-9]+/g, R = /^-+|-+$/g, s = (e) => e.normalize("NFKD").replace(S, "").toLowerCase().replace(b, "-").replace(R, ""), y = (e) => {
2
8
  const t = e?.en?.value.trim();
3
9
  return t || (Object.values(e ?? {}).find((r) => r.value.trim().length > 0)?.value.trim() ?? "");
4
- }, S = ({
10
+ }, m = ({
5
11
  id: e,
6
12
  productShortCode: t,
7
13
  name: r
8
14
  }) => {
9
- const o = i(typeof t == "string" ? t.trim() : ""), n = i(f(r)), c = i(e);
10
- return `product-${[o, n].filter((a) => a.length > 0).join("-") || c || "item"}`;
11
- };
12
- function s(e) {
13
- const t = e?.find((r) => r.unit === "day" && r.quantity === 1);
14
- return t ? t.value : -1;
15
+ const o = s(typeof t == "string" ? t.trim() : ""), n = s(y(r)), c = s(e);
16
+ return `product-${[o, n].filter((i) => i.length > 0).join("-") || c || "item"}`;
17
+ }, u = (e) => e === "e-bike" ? 0 : e === "bike" ? 1 : e === "accessory" ? 2 : 3, l = (e) => e.externalId?.trim() || e.id?.trim() || "";
18
+ function g(e) {
19
+ return k[e];
20
+ }
21
+ function _(e) {
22
+ return [
23
+ { field: "kind", order: "desc" },
24
+ { field: "assetRelScore", order: "desc" },
25
+ { field: g(e), order: "desc" },
26
+ { field: "externalId", order: "asc" }
27
+ ];
28
+ }
29
+ function d(e, t = "day") {
30
+ const r = e?.find((o) => o.unit === t && o.quantity === 1);
31
+ return r ? r.value : -1;
32
+ }
33
+ function p(e) {
34
+ return d(e, "day");
35
+ }
36
+ function f(e, t, r = {}) {
37
+ const o = u(e.kind), n = u(t.kind);
38
+ if (o !== n)
39
+ return o - n;
40
+ const c = (t.assetRelScore ?? 0) - (e.assetRelScore ?? 0);
41
+ if (c !== 0) return c;
42
+ const a = r.priceUnit ?? "day", i = d(t.prices, a) - d(e.prices, a);
43
+ return i !== 0 ? i : l(e).localeCompare(l(t));
15
44
  }
16
- function b(e, t) {
17
- const r = e.kind === "e-bike" ? "e-bike" : "bike", o = t.kind === "e-bike" ? "e-bike" : "bike";
18
- if (r !== o)
19
- return r === "e-bike" ? -1 : 1;
20
- const n = (t.assetRelScore ?? 0) - (e.assetRelScore ?? 0);
21
- if (n !== 0) return n;
22
- const c = s(t.prices) - s(e.prices);
23
- return c !== 0 ? c : e.id.localeCompare(t.id);
45
+ function A(e, t, r = {}) {
46
+ return f(
47
+ { ...e, kind: e.kind === "e-bike" ? "e-bike" : "bike" },
48
+ { ...t, kind: t.kind === "e-bike" ? "e-bike" : "bike" },
49
+ r
50
+ );
24
51
  }
25
- function m(e, t) {
26
- const r = (t.assetRelScore ?? 0) - (e.assetRelScore ?? 0);
27
- if (r !== 0) return r;
28
- const o = s(t.prices) - s(e.prices);
29
- return o !== 0 ? o : e.id.localeCompare(t.id);
52
+ function C(e, t, r = {}) {
53
+ return f(
54
+ { ...e, kind: "accessory" },
55
+ { ...t, kind: "accessory" },
56
+ r
57
+ );
30
58
  }
31
- const p = (e) => e.map((t) => ({
59
+ const E = (e) => e.map((t) => ({
32
60
  ...t,
33
61
  kind: t.kind === "e-bike" ? "e-bike" : "bike"
34
- })), R = (e) => e.map((t) => ({
62
+ })), T = (e) => e.map((t) => ({
35
63
  ...t,
36
64
  kind: "accessory"
37
- })), E = (e, t) => {
65
+ })), I = (e, t) => {
38
66
  const r = t.bikes.find((n) => n.id === e);
39
67
  return r || (t.accessories.find((n) => n.id === e) ?? null);
40
- }, y = (e, t) => {
68
+ }, M = (e, t) => {
41
69
  const r = t.bikes.find((n) => n.slug === e);
42
70
  return r || (t.accessories.find((n) => n.slug === e) ?? null);
43
- }, A = (e) => e.checkoutProductId?.trim() || e.id, P = (e) => {
71
+ }, B = (e) => e.checkoutProductId?.trim() || e.id, D = (e) => {
44
72
  const t = e.representedVariantId?.trim();
45
73
  return t || void 0;
46
74
  };
47
75
  export {
48
- S as buildStorefrontProductSlug,
49
- m as compareStorefrontAccessoryProducts,
50
- b as compareStorefrontBikeProducts,
51
- E as findStorefrontProduct,
52
- y as findStorefrontProductBySlug,
53
- s as getStorefrontBaseDailyRateMinor,
54
- A as getStorefrontCheckoutProductId,
55
- P as getStorefrontRepresentedVariantId,
56
- R as toStorefrontAccessoryProducts,
57
- p as toStorefrontBikeProducts
76
+ P as CATALOG_PRODUCT_BASE_RATE_UNSET,
77
+ m as buildStorefrontProductSlug,
78
+ f as compareCatalogProducts,
79
+ C as compareStorefrontAccessoryProducts,
80
+ A as compareStorefrontBikeProducts,
81
+ I as findStorefrontProduct,
82
+ M as findStorefrontProductBySlug,
83
+ d as getCatalogProductBaseRateMinor,
84
+ _ as getCatalogProductPaginationSort,
85
+ g as getCatalogProductSortFieldForPriceUnit,
86
+ p as getStorefrontBaseDailyRateMinor,
87
+ B as getStorefrontCheckoutProductId,
88
+ D as getStorefrontRepresentedVariantId,
89
+ T as toStorefrontAccessoryProducts,
90
+ E as toStorefrontBikeProducts
58
91
  };
@@ -431,7 +431,7 @@ function ua() {
431
431
  pe,
432
432
  {
433
433
  className: "border-slate-200 bg-white shadow-sm",
434
- children: /* @__PURE__ */ c("div", { className: "flex flex-col gap-3 p-4", children: [
434
+ children: /* @__PURE__ */ c("div", { className: "flex flex-col gap-2 p-3", children: [
435
435
  /* @__PURE__ */ i(
436
436
  "div",
437
437
  {
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPage.tsx"],"names":[],"mappings":"AAuGA,MAAM,CAAC,OAAO,UAAU,YAAY,4CA6lBnC"}
1
+ {"version":3,"file":"CheckoutPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPage.tsx"],"names":[],"mappings":"AAsGA,MAAM,CAAC,OAAO,UAAU,YAAY,4CA2lBnC"}
@@ -1,4 +1,4 @@
1
- import { jsx as n, jsxs as y } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as y } from "react/jsx-runtime";
2
2
  import { useState as c, useMemo as u, useEffect as E } from "react";
3
3
  import { toast as Z } from "@rpcbase/client";
4
4
  import { useForm as Ye, zodResolver as et } from "@rpcbase/form";
@@ -17,12 +17,11 @@ import { useStorefront as kt, useStorefrontProducts as Ct } from "../StorefrontP
17
17
  import { BookingFlowSteps as vt } from "../components/BookingFlowSteps/index.js";
18
18
  import { Button as xe } from "../ui/button.js";
19
19
  import { CheckoutDetailsCard as St } from "./checkout/components/CheckoutDetailsCard.js";
20
- import { CheckoutCouponCard as Mt } from "./checkout/components/CheckoutCouponCard.js";
21
- import { CheckoutPaymentSummaryCard as xt } from "./checkout/components/CheckoutPaymentSummaryCard.js";
22
- import { CheckoutSummaryColumn as Pt } from "./checkout/components/CheckoutSummaryColumn.js";
23
- import { FulfillmentSection as Tt } from "../components/FulfillmentSection/index.js";
24
- import { checkoutFormSchema as At } from "./checkout/types.js";
25
- const Pe = 0.2, Dt = (o) => o <= 0 ? 1 : Math.max(1, Math.ceil(o / 1440)), _ = (o, r, p) => {
20
+ import { CheckoutPaymentSummaryCard as Mt } from "./checkout/components/CheckoutPaymentSummaryCard.js";
21
+ import { CheckoutSummaryColumn as xt } from "./checkout/components/CheckoutSummaryColumn.js";
22
+ import { FulfillmentSection as Pt } from "../components/FulfillmentSection/index.js";
23
+ import { checkoutFormSchema as Tt } from "./checkout/types.js";
24
+ const Pe = 0.2, At = (o) => o <= 0 ? 1 : Math.max(1, Math.ceil(o / 1440)), _ = (o, r, p) => {
26
25
  try {
27
26
  return new Intl.NumberFormat(p, {
28
27
  style: "currency",
@@ -41,7 +40,7 @@ const Pe = 0.2, Dt = (o) => o <= 0 ? 1 : Math.max(1, Math.ceil(o / 1440)), _ = (
41
40
  } catch {
42
41
  return `${Math.round(o * 100)}%`;
43
42
  }
44
- }, wt = (o, r, p) => {
43
+ }, Dt = (o, r, p) => {
45
44
  const S = {
46
45
  dateStyle: "medium",
47
46
  timeStyle: "short"
@@ -53,14 +52,14 @@ const Pe = 0.2, Dt = (o) => o <= 0 ? 1 : Math.max(1, Math.ceil(o / 1440)), _ = (
53
52
  }
54
53
  return new Intl.DateTimeFormat(r, S).format(o);
55
54
  };
56
- function to() {
55
+ function Yt() {
57
56
  const { t: o, i18n: r } = at(), { storefrontConfiguration: p } = kt(), S = p.workspace?.workspaceLanguage, { bikes: G, accessories: J } = Ct(), { storeSlug: s } = tt(), [M, Ae] = ot(), De = nt(), { items: X, itemCount: we, setQuantity: Ie, removeItem: Le, clear: Re } = bt(), [U, Y] = c(!1), [l, T] = c(null), [ee, $] = c(!1), [te, A] = c(null), oe = M.get("coupon") ?? M.get("code") ?? "", [ne, B] = c(oe), [ae, re] = c(oe.trim()), [f, x] = c(null), [se, D] = c(null), [ie, O] = c(!1), [Ne, b] = c(null), [le, k] = c(null), [V, ce] = c(!1), ue = u(
58
57
  () => ht(M, s),
59
58
  [M, s]
60
59
  ), w = p.settings.fulfillmentModes.includes("delivery"), de = p.settings.deliveryDisabledReason.trim(), Ee = w || de.length > 0, Fe = p.shop.address?.trim() ?? "", t = u(() => {
61
60
  const e = ft(ue);
62
61
  return e.fulfillment === "delivery" && !w ? { ...e, fulfillment: "pickup" } : e;
63
- }, [ue, w]), Ue = u(() => gt(t), [t]), me = u(() => yt(t), [t]), pe = u(() => Dt(me), [me]), d = u(
62
+ }, [ue, w]), Ue = u(() => gt(t), [t]), me = u(() => yt(t), [t]), pe = u(() => At(me), [me]), d = u(
64
63
  () => _t({
65
64
  items: X,
66
65
  language: r.language,
@@ -97,9 +96,9 @@ function to() {
97
96
  },
98
97
  products: q
99
98
  }
100
- ), a = mt.parse(i);
99
+ ), n = mt.parse(i);
101
100
  if (e) return;
102
- I(a.success ? a.availability ?? [] : []);
101
+ I(n.success ? n.availability ?? [] : []);
103
102
  } catch (i) {
104
103
  if (e) return;
105
104
  console.error("Failed to load checkout cart availability", i), I([]);
@@ -126,11 +125,11 @@ function to() {
126
125
  () => ({
127
126
  ...d,
128
127
  lines: d.lines.map((e) => {
129
- const i = fe.get(ve(e.checkoutProductId, e.productVariantId)), a = i ? pt(i) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
128
+ const i = fe.get(ve(e.checkoutProductId, e.productVariantId)), n = i ? pt(i) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
130
129
  return {
131
130
  ...e,
132
- insufficientCapacity: !K && a !== void 0,
133
- availabilityIssue: K ? void 0 : a
131
+ insufficientCapacity: !K && n !== void 0,
132
+ availabilityIssue: K ? void 0 : n
134
133
  };
135
134
  })
136
135
  }),
@@ -144,15 +143,15 @@ function to() {
144
143
  })),
145
144
  [d.lines]
146
145
  ), $e = d.estimatedTotalMinor ?? d.totalPerDayMinor, v = se?.totalMinor ?? $e, P = f?.discountAmountMinor ?? 0, R = Se(new URLSearchParams(), t).toString(), j = `/${s ?? ""}/booking${R ? `?${R}` : ""}`, Be = `/${s ?? ""}/checkout${R ? `?${R}` : ""}`, ge = Ye({
147
- resolver: et(At),
146
+ resolver: et(Tt),
148
147
  defaultValues: { full_name: "", email: "", phone: "", notes: "" }
149
148
  });
150
149
  E(() => {
151
150
  Me(s, t);
152
151
  }, [t, s]);
153
152
  const H = (e) => {
154
- const i = { ...t, ...e }, a = Se(M, i);
155
- Ae(a, { replace: !0 }), Me(s, a);
153
+ const i = { ...t, ...e }, n = Se(M, i);
154
+ Ae(n, { replace: !0 }), Me(s, n);
156
155
  };
157
156
  E(() => {
158
157
  if (!s || C.length === 0) {
@@ -160,7 +159,7 @@ function to() {
160
159
  return;
161
160
  }
162
161
  const e = ae.trim(), i = e.length === 0 && !V;
163
- let a = !1;
162
+ let n = !1;
164
163
  return O(!0), k(null), b(null), (async () => {
165
164
  try {
166
165
  const W = await F(
@@ -178,7 +177,7 @@ function to() {
178
177
  includeAutoApply: i
179
178
  }
180
179
  ), m = lt.parse(W);
181
- if (a) return;
180
+ if (n) return;
182
181
  if (D(
183
182
  typeof m.subtotalMinor == "number" && typeof m.totalMinor == "number" ? {
184
183
  subtotalMinor: m.subtotalMinor,
@@ -191,13 +190,13 @@ function to() {
191
190
  }
192
191
  x(m.coupon ?? null), m.coupon && (m.coupon.autoApplied && e.length === 0 ? (B(m.coupon.code), b(o("checkout_coupon_auto_applied", { code: m.coupon.code }))) : b(o("checkout_coupon_manual_applied")));
193
192
  } catch (W) {
194
- if (a) return;
193
+ if (n) return;
195
194
  console.error("Failed to verify checkout coupon", W), x(null), D(null), k(o("checkout_coupon_error"));
196
195
  } finally {
197
- a || O(!1);
196
+ n || O(!1);
198
197
  }
199
198
  })(), () => {
200
- a = !0;
199
+ n = !0;
201
200
  };
202
201
  }, [
203
202
  V,
@@ -229,13 +228,13 @@ function to() {
229
228
  },
230
229
  estimatedTotalMinor: v
231
230
  }
232
- ), a = st.parse(i);
231
+ ), n = st.parse(i);
233
232
  if (e) return;
234
- if (!a.success || !a.decision) {
235
- T(null), A(a.message || o("checkout_payment_error"));
233
+ if (!n.success || !n.decision) {
234
+ T(null), A(n.message || o("checkout_payment_error"));
236
235
  return;
237
236
  }
238
- T(a.decision);
237
+ T(n.decision);
239
238
  } catch (i) {
240
239
  if (e) return;
241
240
  console.error("Failed to load checkout payment decision", i), T(null), A(o("checkout_payment_error"));
@@ -262,7 +261,7 @@ function to() {
262
261
  }, [r.language, l]), Q = u(() => {
263
262
  if (!l?.depositRefundableUntilIso) return null;
264
263
  const e = new Date(l.depositRefundableUntilIso);
265
- return Number.isNaN(e.getTime()) ? null : wt(e, r.language, _e);
264
+ return Number.isNaN(e.getTime()) ? null : Dt(e, r.language, _e);
266
265
  }, [r.language, l?.depositRefundableUntilIso, _e]), Ze = u(() => l ? l.paymentMode === "deposit" && h > 0 && N ? Q ? o("checkout_payment_due_now_helper_deposit_refundable_until", {
267
266
  percent: N,
268
267
  date: Q
@@ -301,12 +300,12 @@ function to() {
301
300
  },
302
301
  items: C
303
302
  }
304
- ), a = ut.parse(i);
305
- if (!a.success || !a.checkout) {
306
- Z.error(a.message || o("checkout_payment_error"));
303
+ ), n = ut.parse(i);
304
+ if (!n.success || !n.checkout) {
305
+ Z.error(n.message || o("checkout_payment_error"));
307
306
  return;
308
307
  }
309
- a.checkout.requiresPayment || Z.success(o("checkout_success_toast")), await De(a.checkout.nextPath), Re();
308
+ n.checkout.requiresPayment || Z.success(o("checkout_success_toast")), await De(n.checkout.nextPath), Re();
310
309
  } catch (i) {
311
310
  console.error("Failed to submit storefront checkout", i), Z.error(o("checkout_payment_error"));
312
311
  } finally {
@@ -314,25 +313,25 @@ function to() {
314
313
  }
315
314
  }
316
315
  }), Je = o(We ? "checkout_continue_to_payment" : "checkout_submit"), be = t.fulfillment === "delivery" && t.start_address.trim().length === 0, Xe = !U && !ee && !te && !ie && !le && !!l && !be && C.length > 0;
317
- return d.lines.length === 0 ? /* @__PURE__ */ n("div", { className: "mx-auto max-w-3xl px-4 py-10 sm:px-6", children: /* @__PURE__ */ y("div", { className: "rounded-2xl border border-slate-200 bg-white p-6 shadow-sm", children: [
318
- /* @__PURE__ */ n("h1", { className: "text-xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ n("span", { children: o("cart_empty_title") }) }),
319
- /* @__PURE__ */ n("p", { className: "mt-2 text-sm text-slate-600", children: /* @__PURE__ */ n("span", { children: o("cart_empty_description") }) }),
320
- /* @__PURE__ */ n("div", { className: "mt-6", children: /* @__PURE__ */ n(ke, { to: j, children: /* @__PURE__ */ y(xe, { className: "gap-2", children: [
321
- /* @__PURE__ */ n(Ce, { className: "h-4 w-4", "aria-hidden": "true" }),
322
- /* @__PURE__ */ n("span", { children: o("back_to_booking") })
316
+ return d.lines.length === 0 ? /* @__PURE__ */ a("div", { className: "mx-auto max-w-3xl px-4 py-10 sm:px-6", children: /* @__PURE__ */ y("div", { className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm", children: [
317
+ /* @__PURE__ */ a("h1", { className: "text-xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ a("span", { children: o("cart_empty_title") }) }),
318
+ /* @__PURE__ */ a("p", { className: "mt-2 text-sm text-slate-600", children: /* @__PURE__ */ a("span", { children: o("cart_empty_description") }) }),
319
+ /* @__PURE__ */ a("div", { className: "mt-6", children: /* @__PURE__ */ a(ke, { to: j, children: /* @__PURE__ */ y(xe, { className: "gap-2", children: [
320
+ /* @__PURE__ */ a(Ce, { className: "h-4 w-4", "aria-hidden": "true" }),
321
+ /* @__PURE__ */ a("span", { children: o("back_to_booking") })
323
322
  ] }) }) })
324
- ] }) }) : /* @__PURE__ */ n("div", { className: "mx-auto max-w-7xl px-4 py-8 sm:px-6", children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-6", children: [
325
- /* @__PURE__ */ n(vt, { currentStep: "checkout", bookingPath: j, checkoutPath: Be }),
323
+ ] }) }) : /* @__PURE__ */ a("div", { className: "mx-auto max-w-7xl px-4 py-8 sm:px-6", children: /* @__PURE__ */ y("div", { className: "flex flex-col gap-6", children: [
324
+ /* @__PURE__ */ a(vt, { currentStep: "checkout", bookingPath: j, checkoutPath: Be }),
326
325
  /* @__PURE__ */ y(ke, { to: j, className: "inline-flex items-center gap-2 text-sm font-medium text-slate-700 hover:text-slate-950", children: [
327
- /* @__PURE__ */ n(Ce, { className: "h-4 w-4", "aria-hidden": "true" }),
328
- /* @__PURE__ */ n("span", { children: o("back_to_booking") })
326
+ /* @__PURE__ */ a(Ce, { className: "h-4 w-4", "aria-hidden": "true" }),
327
+ /* @__PURE__ */ a("span", { children: o("back_to_booking") })
329
328
  ] }),
330
329
  /* @__PURE__ */ y("div", { className: "grid gap-6 lg:grid-cols-12", children: [
331
330
  /* @__PURE__ */ y("div", { className: "lg:col-span-7", children: [
332
- /* @__PURE__ */ n("h1", { className: "text-xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ n("span", { children: o("checkout_title") }) }),
331
+ /* @__PURE__ */ a("h1", { className: "text-xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ a("span", { children: o("checkout_title") }) }),
333
332
  /* @__PURE__ */ y("div", { className: "mt-5 grid gap-4", children: [
334
- Ee ? /* @__PURE__ */ n("div", { className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm", children: /* @__PURE__ */ n(
335
- Tt,
333
+ Ee ? /* @__PURE__ */ a("div", { className: "rounded-xl border border-slate-200 bg-white p-3 shadow-sm", children: /* @__PURE__ */ a(
334
+ Pt,
336
335
  {
337
336
  value: t.fulfillment,
338
337
  onValueChange: (e) => H({ fulfillment: e }),
@@ -347,30 +346,9 @@ function to() {
347
346
  testIdPrefix: "storefront-checkout-fulfillment"
348
347
  }
349
348
  ) }) : null,
350
- /* @__PURE__ */ n(St, { form: ge }),
351
- /* @__PURE__ */ n(
349
+ /* @__PURE__ */ a(St, { form: ge }),
350
+ /* @__PURE__ */ a(
352
351
  Mt,
353
- {
354
- code: ne,
355
- appliedCode: f?.code,
356
- discountLabel: f && P > 0 ? _(P, g, r.language) : null,
357
- message: Ne,
358
- error: le,
359
- loading: ie,
360
- disabled: U,
361
- onCodeChange: (e) => {
362
- B(e), k(null), b(null);
363
- },
364
- onApply: () => {
365
- ce(!1), re(ne.trim());
366
- },
367
- onRemove: () => {
368
- B(""), re(""), x(null), D(null), k(null), b(null), ce(!0);
369
- }
370
- }
371
- ),
372
- /* @__PURE__ */ n(
373
- xt,
374
352
  {
375
353
  estimatedTotalLabel: Oe,
376
354
  couponCode: f?.code,
@@ -392,7 +370,7 @@ function to() {
392
370
  }
393
371
  }
394
372
  ),
395
- /* @__PURE__ */ n(
373
+ /* @__PURE__ */ a(
396
374
  xe,
397
375
  {
398
376
  type: "button",
@@ -402,14 +380,14 @@ function to() {
402
380
  },
403
381
  disabled: !Xe,
404
382
  className: "mt-4 w-fit",
405
- children: /* @__PURE__ */ n("span", { children: Je })
383
+ children: /* @__PURE__ */ a("span", { children: Je })
406
384
  }
407
385
  ),
408
- be ? /* @__PURE__ */ n("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ n("span", { children: o("checkout_delivery_address_required") }) }) : null
386
+ be ? /* @__PURE__ */ a("p", { className: "text-sm text-slate-600", children: /* @__PURE__ */ a("span", { children: o("checkout_delivery_address_required") }) }) : null
409
387
  ] })
410
388
  ] }),
411
- /* @__PURE__ */ n(
412
- Pt,
389
+ /* @__PURE__ */ a(
390
+ xt,
413
391
  {
414
392
  lines: L.lines,
415
393
  itemCount: we,
@@ -422,12 +400,30 @@ function to() {
422
400
  couponCode: f?.code,
423
401
  durationLabel: Ue.label,
424
402
  onQuantityChange: Ie,
425
- onRemove: Le
403
+ onRemove: Le,
404
+ coupon: {
405
+ code: ne,
406
+ appliedCode: f?.code,
407
+ discountLabel: f && P > 0 ? _(P, g, r.language) : null,
408
+ message: Ne,
409
+ error: le,
410
+ loading: ie,
411
+ disabled: U,
412
+ onCodeChange: (e) => {
413
+ B(e), k(null), b(null);
414
+ },
415
+ onApply: () => {
416
+ ce(!1), re(ne.trim());
417
+ },
418
+ onRemove: () => {
419
+ B(""), re(""), x(null), D(null), k(null), b(null), ce(!0);
420
+ }
421
+ }
426
422
  }
427
423
  )
428
424
  ] })
429
425
  ] }) });
430
426
  }
431
427
  export {
432
- to as default
428
+ Yt as default
433
429
  };
@@ -131,7 +131,7 @@ function Be() {
131
131
  };
132
132
  }, [r?.clientSecret]);
133
133
  if (!m)
134
- return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-red-200 bg-white p-8 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
134
+ return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-red-200 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
135
135
  /* @__PURE__ */ n("div", { className: "flex items-start gap-3", children: [
136
136
  /* @__PURE__ */ e(K, { className: "mt-0.5 h-5 w-5 text-red-600", "aria-hidden": "true" }),
137
137
  /* @__PURE__ */ e("p", { className: "text-sm text-slate-700", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_missing_session") }) })
@@ -139,9 +139,9 @@ function Be() {
139
139
  /* @__PURE__ */ e(b, { to: v, children: /* @__PURE__ */ e(f, { variant: "outline", children: /* @__PURE__ */ e("span", { children: t("checkout_payment_return_back_to_checkout") }) }) })
140
140
  ] }) }) });
141
141
  if (h && !r)
142
- return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-8 shadow-sm", children: /* @__PURE__ */ e(q, {}) }) });
142
+ return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ e(q, {}) }) });
143
143
  if (A || !r)
144
- return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-red-200 bg-white p-8 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
144
+ return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ e(y, { className: "border-red-200 bg-white p-5 sm:p-6 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
145
145
  /* @__PURE__ */ n("div", { className: "flex items-start gap-3", children: [
146
146
  /* @__PURE__ */ e(K, { className: "mt-0.5 h-5 w-5 text-red-600", "aria-hidden": "true" }),
147
147
  /* @__PURE__ */ e("p", { className: "text-sm text-slate-700", children: /* @__PURE__ */ e("span", { children: A ?? t("checkout_payment_return_status_error") }) })
@@ -150,7 +150,7 @@ function Be() {
150
150
  ] }) }) });
151
151
  const F = typeof r.amountMinor == "number" && r.currency ? xe(r.amountMinor, r.currency, i.language) : null, w = o === "authorized" || o === "succeeded", L = o === "failed" || o === "cancelled", H = w ? se : L ? ne : ae, X = w ? "text-emerald-600" : L ? "text-red-600" : "text-amber-600";
152
152
  return /* @__PURE__ */ e("div", { className: "mx-auto max-w-5xl px-4 py-10 sm:px-6", children: /* @__PURE__ */ n("div", { className: "grid gap-6 lg:grid-cols-[1fr_1fr]", children: [
153
- /* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-6 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-5", children: [
153
+ /* @__PURE__ */ e(y, { className: "border-slate-200 bg-white p-5 shadow-sm", children: /* @__PURE__ */ n("div", { className: "space-y-5", children: [
154
154
  /* @__PURE__ */ n("div", { className: "inline-flex items-center gap-2 rounded-full border border-emerald-200 bg-emerald-50 px-3 py-1 text-xs font-medium text-emerald-700", children: [
155
155
  /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
156
156
  /* @__PURE__ */ e("span", { children: t("secure_payment_link.secured_badge") })
@@ -174,7 +174,7 @@ function Be() {
174
174
  /* @__PURE__ */ e("span", { children: t("checkout_payment_return_loading") })
175
175
  ] }) : null
176
176
  ] }) }),
177
- /* @__PURE__ */ n(y, { className: "border-slate-200 bg-white p-6 shadow-sm", children: [
177
+ /* @__PURE__ */ n(y, { className: "border-slate-200 bg-white p-5 shadow-sm", children: [
178
178
  w || L ? /* @__PURE__ */ n("div", { className: "space-y-6 text-center", children: [
179
179
  /* @__PURE__ */ e("div", { className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-slate-100", children: /* @__PURE__ */ e(H, { className: `h-6 w-6 ${X}`, "aria-hidden": "true" }) }),
180
180
  /* @__PURE__ */ n("div", { className: "space-y-2", children: [
@@ -5,15 +5,15 @@ import { useTranslation as x } from "react-i18next";
5
5
  import { resolveBookingSearchParamsFromSessionStorage as p } from "../lib/booking.js";
6
6
  import { Button as o } from "../ui/button.js";
7
7
  function b() {
8
- const { t } = x(), { storeSlug: r } = m(), [l] = h(), s = p(l, r).toString(), i = `/${r ?? ""}/booking${s ? `?${s}` : ""}`, n = `/${r ?? ""}${s ? `?${s}` : ""}`;
9
- return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ c("div", { className: "rounded-2xl border border-slate-200 bg-white p-8 shadow-sm", children: [
8
+ const { t: s } = x(), { storeSlug: r } = m(), [l] = h(), t = p(l, r).toString(), i = `/${r ?? ""}/booking${t ? `?${t}` : ""}`, n = `/${r ?? ""}${t ? `?${t}` : ""}`;
9
+ return /* @__PURE__ */ e("div", { className: "mx-auto max-w-3xl px-4 py-14 sm:px-6", children: /* @__PURE__ */ c("div", { className: "rounded-xl border border-slate-200 bg-white p-5 shadow-sm sm:p-6", children: [
10
10
  /* @__PURE__ */ e("div", { className: "mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-emerald-500/10 text-emerald-600", children: /* @__PURE__ */ e(d, { className: "h-6 w-6", "aria-hidden": "true" }) }),
11
- /* @__PURE__ */ e("h1", { className: "mt-6 text-center text-2xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ e("span", { children: t("checkout_success_title") }) }),
12
- /* @__PURE__ */ e("p", { className: "mt-2 text-center text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: t("checkout_success_description") }) }),
11
+ /* @__PURE__ */ e("h1", { className: "mt-6 text-center text-2xl font-semibold tracking-tight text-slate-950", children: /* @__PURE__ */ e("span", { children: s("checkout_success_title") }) }),
12
+ /* @__PURE__ */ e("p", { className: "mt-2 text-center text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: s("checkout_success_description") }) }),
13
13
  /* @__PURE__ */ c("div", { className: "mt-8 flex flex-col gap-3 sm:flex-row sm:justify-center", children: [
14
- /* @__PURE__ */ e(a, { to: i, children: /* @__PURE__ */ e(o, { variant: "outline", className: "w-full sm:w-auto", children: /* @__PURE__ */ e("span", { children: t("checkout_success_back_to_products") }) }) }),
14
+ /* @__PURE__ */ e(a, { to: i, children: /* @__PURE__ */ e(o, { variant: "outline", className: "w-full sm:w-auto", children: /* @__PURE__ */ e("span", { children: s("checkout_success_back_to_products") }) }) }),
15
15
  /* @__PURE__ */ e(a, { to: n, children: /* @__PURE__ */ c(o, { className: "w-full gap-2 sm:w-auto", children: [
16
- /* @__PURE__ */ e("span", { children: t("checkout_success_back_home") }),
16
+ /* @__PURE__ */ e("span", { children: s("checkout_success_back_home") }),
17
17
  /* @__PURE__ */ e(u, { className: "h-4 w-4", "aria-hidden": "true" })
18
18
  ] }) })
19
19
  ] })