@loczer/storefront-sdk 0.163.0 → 0.165.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 (89) hide show
  1. package/dist/StorefrontProvider.d.ts +29 -3
  2. package/dist/StorefrontProvider.d.ts.map +1 -1
  3. package/dist/StorefrontProvider.js +68 -58
  4. package/dist/chunks/booking-engine/dist/schemas/{base-booking-D9k8ehGi.js → base-booking-BMAjsw9r.js} +29 -26
  5. package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-DTJD2G9w.js +123 -0
  6. package/dist/chunks/booking-engine/dist/schemas/{cart-inputs-ByBK0IVJ.js → cart-inputs-BI_9nAXG.js} +1 -1
  7. package/dist/chunks/booking-engine/dist/schemas/{public-booking-engine-configuration-DKoak4s5.js → public-booking-engine-configuration-CrwffLO4.js} +1 -1
  8. package/dist/chunks/ui/dist/{MorphingModalWizard-D7hc-dDP.js → MorphingModalWizard-BuRND-yE.js} +3 -3
  9. package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id-CNQuVmXa.js +6 -0
  10. package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node-DL2q-YuA.js +9 -0
  11. package/dist/chunks/ui/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash-C-3PLS5x.js +6 -0
  12. package/dist/components/AboutSection/index.js +1 -1
  13. package/dist/components/BikeProductCard/index.d.ts +2 -1
  14. package/dist/components/BikeProductCard/index.d.ts.map +1 -1
  15. package/dist/components/BikeProductCard/index.js +59 -41
  16. package/dist/components/BookingBikeVariantDialog/index.js +1 -1
  17. package/dist/components/BookingFlowSteps/index.js +8 -8
  18. package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
  19. package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
  20. package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.js +28 -28
  21. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
  22. package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
  23. package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
  24. package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +197 -203
  25. package/dist/components/ContactSection/index.js +4 -4
  26. package/dist/components/Header/index.js +1 -1
  27. package/dist/components/PoweredByLoczerBadge/index.js +1 -1
  28. package/dist/components/ProductPriceBadge/index.js +1 -1
  29. package/dist/components/ProductWarningNotice/index.js +10 -10
  30. package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts +11 -0
  31. package/dist/components/StorefrontCancellationPolicyNotice/index.d.ts.map +1 -0
  32. package/dist/components/StorefrontCancellationPolicyNotice/index.js +93 -0
  33. package/dist/components/payment/MollieCardFieldsForm.js +1 -1
  34. package/dist/components/payment/StripeCardFieldsForm.js +13 -13
  35. package/dist/i18n/en.d.ts +12 -0
  36. package/dist/i18n/en.d.ts.map +1 -1
  37. package/dist/i18n/en.js +12 -0
  38. package/dist/i18n/fr.d.ts +12 -0
  39. package/dist/i18n/fr.d.ts.map +1 -1
  40. package/dist/i18n/fr.js +12 -0
  41. package/dist/index.d.ts +116 -7
  42. package/dist/index.js +312 -305
  43. package/dist/lib/cart.js +1 -1
  44. package/dist/lib/cartSummary.d.ts.map +1 -1
  45. package/dist/lib/cartSummary.js +28 -28
  46. package/dist/lib/checkoutPaymentDecision.d.ts +8 -0
  47. package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
  48. package/dist/lib/checkoutPaymentDecision.js +14 -6
  49. package/dist/lib/checkoutPaymentSession.d.ts +1 -0
  50. package/dist/lib/checkoutPaymentSession.d.ts.map +1 -1
  51. package/dist/lib/checkoutPaymentSession.js +12 -11
  52. package/dist/lib/checkoutSubmit.js +4 -4
  53. package/dist/lib/productVariants.d.ts.map +1 -1
  54. package/dist/lib/productVariants.js +34 -15
  55. package/dist/lib/products.d.ts +4 -0
  56. package/dist/lib/products.d.ts.map +1 -1
  57. package/dist/lib/products.js +74 -39
  58. package/dist/lib/securePaymentLink.d.ts +1 -0
  59. package/dist/lib/securePaymentLink.d.ts.map +1 -1
  60. package/dist/lib/securePaymentLink.js +1 -0
  61. package/dist/lib/storefrontAvailability.d.ts +9 -0
  62. package/dist/lib/storefrontAvailability.d.ts.map +1 -1
  63. package/dist/lib/storefrontAvailability.js +28 -18
  64. package/dist/pages/BookingPage.d.ts.map +1 -1
  65. package/dist/pages/BookingPage.js +290 -289
  66. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  67. package/dist/pages/CheckoutPage.js +224 -216
  68. package/dist/pages/CheckoutPaymentPage.d.ts.map +1 -1
  69. package/dist/pages/CheckoutPaymentPage.js +92 -92
  70. package/dist/pages/ContractSaleDocumentPage.js +3 -3
  71. package/dist/pages/HomePage.d.ts.map +1 -1
  72. package/dist/pages/HomePage.js +167 -161
  73. package/dist/pages/PaymentLinkPage.d.ts.map +1 -1
  74. package/dist/pages/PaymentLinkPage.js +62 -62
  75. package/dist/pages/PaymentLinkSuccessPage.js +7 -7
  76. package/dist/pages/ProductPage.d.ts.map +1 -1
  77. package/dist/pages/ProductPage.js +161 -161
  78. package/dist/pages/checkout/components/CheckoutCouponCard.js +6 -6
  79. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +15 -15
  80. package/dist/storefront.css +1 -1
  81. package/dist/storefrontSchemas.d.ts +14 -2
  82. package/dist/storefrontSchemas.d.ts.map +1 -1
  83. package/dist/storefrontSchemas.js +4 -4
  84. package/dist/ui/day-picker.js +5 -5
  85. package/package.json +2 -2
  86. package/dist/chunks/booking-engine/dist/schemas/booking-engine-configuration-BKlzwJJX.js +0 -105
  87. package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/animation/optimized-appear/data-id-DunDwGdX.js +0 -6
  88. package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/projection/node/create-projection-node-BDwaGtmx.js +0 -9
  89. package/dist/chunks/ui/dist/node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash-h54_qXon.js +0 -4
@@ -6,6 +6,8 @@ type StorefrontContextValue = {
6
6
  storefrontConfiguration: StorefrontConfiguration;
7
7
  bikes: BikeProduct[];
8
8
  accessories: AccessoryProduct[];
9
+ bookingBikes: BikeProduct[];
10
+ bookingAccessories: AccessoryProduct[];
9
11
  mapboxToken?: string;
10
12
  language: StorefrontI18nLanguage;
11
13
  };
@@ -72,8 +74,14 @@ export declare const loader: ({ ctx, params }: import('@rpcbase/client').LoaderA
72
74
  percentage: number;
73
75
  optimizeDepositAmount: boolean;
74
76
  };
77
+ cancellationPolicy: {
78
+ tiers: {
79
+ upToHours: number;
80
+ refundPercentage: number;
81
+ }[];
82
+ };
75
83
  securityDeposit: {
76
- mode: "optional" | "required" | "disabled";
84
+ mode: "optional" | "disabled" | "required";
77
85
  };
78
86
  shop: {
79
87
  timeZone: string;
@@ -229,6 +237,8 @@ export declare const loader: ({ ctx, params }: import('@rpcbase/client').LoaderA
229
237
  };
230
238
  bikes: BikeProduct[];
231
239
  accessories: AccessoryProduct[];
240
+ bookingBikes: BikeProduct[];
241
+ bookingAccessories: AccessoryProduct[];
232
242
  language: StorefrontI18nLanguage;
233
243
  }>;
234
244
  export default function StorefrontProvider(): import("react/jsx-runtime").JSX.Element;
@@ -296,8 +306,14 @@ export declare function useStorefrontConfig(): {
296
306
  percentage: number;
297
307
  optimizeDepositAmount: boolean;
298
308
  };
309
+ cancellationPolicy: {
310
+ tiers: {
311
+ upToHours: number;
312
+ refundPercentage: number;
313
+ }[];
314
+ };
299
315
  securityDeposit: {
300
- mode: "optional" | "required" | "disabled";
316
+ mode: "optional" | "disabled" | "required";
301
317
  };
302
318
  shop: {
303
319
  timeZone: string;
@@ -512,8 +528,14 @@ export declare function useStorefrontConfig(): {
512
528
  percentage: number;
513
529
  optimizeDepositAmount: boolean;
514
530
  };
531
+ cancellationPolicy: {
532
+ tiers: {
533
+ upToHours: number;
534
+ refundPercentage: number;
535
+ }[];
536
+ };
515
537
  securityDeposit: {
516
- mode: "optional" | "required" | "disabled";
538
+ mode: "optional" | "disabled" | "required";
517
539
  };
518
540
  shop: {
519
541
  timeZone: string;
@@ -673,5 +695,9 @@ export declare function useStorefrontProducts(): {
673
695
  bikes: BikeProduct[];
674
696
  accessories: AccessoryProduct[];
675
697
  };
698
+ export declare function useStorefrontBookingProducts(): {
699
+ bikes: BikeProduct[];
700
+ accessories: AccessoryProduct[];
701
+ };
676
702
  export {};
677
703
  //# sourceMappingURL=StorefrontProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StorefrontProvider.d.ts","sourceRoot":"","sources":["../src/StorefrontProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAiC,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAEjG,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAA;AAGvB,KAAK,sBAAsB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,uBAAuB,EAAE,uBAAuB,CAAA;IAChD,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB,WAAW,EAAE,gBAAgB,EAAE,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,sBAAsB,CAAA;CACjC,CAAA;AAKD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DA,CAAA;AAGnB,MAAM,CAAC,OAAO,UAAU,kBAAkB,4CAkBzC;AAED,wB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oaderData as v } from "@rpcbase/router";
4
- import { apiClient as w } from "@rpcbase/client";
5
- import { Layout as C } from "./components/Layout/index.js";
6
- import { I18nProvider as L, resolveStorefrontI18nRequestLanguage as P, detectStorefrontI18nLanguage as _ } from "./i18n/I18nProvider.js";
7
- import { storefrontConfigurationSchema as R } from "./storefrontSchemas.js";
8
- import { ROUTE as b, responseSchema as B } from "./lib/storefrontProducts.js";
9
- import { toStorefrontBikeProducts as y, toStorefrontAccessoryProducts as E } from "./lib/products.js";
10
- const I = {}, i = k(void 0), X = (async ({ ctx: o, params: e }) => {
1
+ import { jsx as g } from "react/jsx-runtime";
2
+ import { createContext as b, useContext as v } from "react";
3
+ import { useLoaderData as L } from "@rpcbase/router";
4
+ import { apiClient as P } from "@rpcbase/client";
5
+ import { Layout as _ } from "./components/Layout/index.js";
6
+ import { I18nProvider as R, resolveStorefrontI18nRequestLanguage as B, detectStorefrontI18nLanguage as E } from "./i18n/I18nProvider.js";
7
+ import { storefrontConfigurationSchema as I } from "./storefrontSchemas.js";
8
+ import { ROUTE as O, responseSchema as y } from "./lib/storefrontProducts.js";
9
+ import { toStorefrontBikeProducts as T, toStorefrontAccessoryProducts as A, toStorefrontBookingProductsCollections as x } from "./lib/products.js";
10
+ const U = {}, d = b(void 0), W = (async ({ ctx: o, params: e }) => {
11
11
  const t = typeof e.storeSlug == "string" ? e.storeSlug.trim().toLowerCase() : "";
12
12
  if (!t) throw new Response("Store not found", { status: 404, statusText: "Store not found" });
13
13
  try {
14
- const r = await w.get("/api/public/storefront/config", { storeSlug: t }, o), f = typeof r == "object" && r !== null ? r : {};
15
- if (f.success !== !0)
14
+ const n = P.get(O, { storeSlug: t }, o).then((r) => ({ ok: !0, productsResponse: r })).catch((r) => ({ ok: !1, productsError: r })), c = await P.get("/api/public/storefront/config", { storeSlug: t }, o), l = typeof c == "object" && c !== null ? c : {};
15
+ if (l.success !== !0)
16
16
  throw new Response("Store not found", { status: 404, statusText: "Store not found" });
17
- const n = R.safeParse(f.storefrontConfiguration);
18
- if (!n.success)
19
- throw console.error("Invalid storefront config received", n.error.flatten()), new Response("Storefront config invalid", { status: 500 });
20
- let g = [], d = [];
21
- try {
22
- const a = await w.get(b, { storeSlug: t }, o), s = B.safeParse(a);
23
- if (!s.success)
24
- console.error("Invalid storefront products received", s.error.flatten());
25
- else if (!s.data.success)
26
- console.error("Storefront products unavailable", s.data.message ?? "Unknown error");
17
+ const s = I.safeParse(l.storefrontConfiguration);
18
+ if (!s.success)
19
+ throw console.error("Invalid storefront config received", s.error.flatten()), new Response("Storefront config invalid", { status: 500 });
20
+ let i = [], u = [], p = [], k = [];
21
+ const f = await n;
22
+ if (!f.ok)
23
+ console.error("Error fetching storefront products:", f.productsError);
24
+ else {
25
+ const r = y.safeParse(f.productsResponse);
26
+ if (!r.success)
27
+ console.error("Invalid storefront products received", r.error.flatten());
28
+ else if (!r.data.success)
29
+ console.error("Storefront products unavailable", r.data.message ?? "Unknown error");
27
30
  else {
28
- const m = s.data.products;
29
- g = y(m?.bikes ?? []), d = E(m?.accessories ?? []);
31
+ const w = r.data.products;
32
+ i = T(w?.bikes ?? []), u = A(w?.accessories ?? []);
33
+ const h = x({ bikes: i, accessories: u });
34
+ p = h.bikes, k = h.accessories;
30
35
  }
31
- } catch (a) {
32
- console.error("Error fetching storefront products:", a);
33
36
  }
34
- const l = n.data.workspace?.languages ?? null, p = n.data.workspace?.workspaceLanguage ?? null, h = o?.req ? P({
37
+ const m = s.data.workspace?.languages ?? null, S = s.data.workspace?.workspaceLanguage ?? null, C = o?.req ? B({
35
38
  cookieHeader: o.req.headers?.cookie,
36
39
  acceptLanguageHeader: o.req.headers?.["accept-language"],
37
- configuredLanguages: l,
38
- configuredFallbackLanguage: p
39
- }) : _(l, p);
40
+ configuredLanguages: m,
41
+ configuredFallbackLanguage: S
42
+ }) : E(m, S);
40
43
  return {
41
44
  storeSlug: t,
42
- storefrontConfiguration: n.data,
43
- bikes: g,
44
- accessories: d,
45
- language: h
45
+ storefrontConfiguration: s.data,
46
+ bikes: i,
47
+ accessories: u,
48
+ bookingBikes: p,
49
+ bookingAccessories: k,
50
+ language: C
46
51
  };
47
- } catch (r) {
48
- throw r instanceof Response ? r : (console.error("Error fetching storefront config:", r), new Response("Storefront config unavailable", { status: 500 }));
52
+ } catch (n) {
53
+ throw n instanceof Response ? n : (console.error("Error fetching storefront config:", n), new Response("Storefront config unavailable", { status: 500 }));
49
54
  }
50
55
  });
51
- function j() {
52
- const o = v(), e = I, t = typeof e?.RB_PUBLIC_MAPBOX_TOKEN == "string" && e.RB_PUBLIC_MAPBOX_TOKEN.trim().length > 0 ? e.RB_PUBLIC_MAPBOX_TOKEN : void 0;
53
- return /* @__PURE__ */ c(i.Provider, { value: { ...o, mapboxToken: t }, children: /* @__PURE__ */ c(
54
- L,
56
+ function z() {
57
+ const o = L(), e = U, t = typeof e?.RB_PUBLIC_MAPBOX_TOKEN == "string" && e.RB_PUBLIC_MAPBOX_TOKEN.trim().length > 0 ? e.RB_PUBLIC_MAPBOX_TOKEN : void 0;
58
+ return /* @__PURE__ */ g(d.Provider, { value: { ...o, mapboxToken: t }, children: /* @__PURE__ */ g(
59
+ R,
55
60
  {
56
61
  initialLanguage: o.language,
57
62
  configuredLanguages: o.storefrontConfiguration.workspace?.languages,
58
63
  configuredFallbackLanguage: o.storefrontConfiguration.workspace?.workspaceLanguage,
59
- children: /* @__PURE__ */ c(C, { storefrontConfiguration: o.storefrontConfiguration })
64
+ children: /* @__PURE__ */ g(_, { storefrontConfiguration: o.storefrontConfiguration })
60
65
  }
61
66
  ) });
62
67
  }
63
- function u() {
64
- const o = S(i);
68
+ function a() {
69
+ const o = v(d);
65
70
  if (o === void 0)
66
71
  throw new Error("must be used within the provider");
67
72
  return o;
68
73
  }
69
- function F() {
70
- return S(i);
74
+ function G() {
75
+ return v(d);
71
76
  }
72
- function H() {
73
- const { storefrontConfiguration: o } = u();
77
+ function J() {
78
+ const { storefrontConfiguration: o } = a();
74
79
  return {
75
80
  config: o,
76
81
  storefrontConfiguration: o
77
82
  };
78
83
  }
79
- function D() {
80
- const { storefrontConfiguration: o } = u();
84
+ function Q() {
85
+ const { storefrontConfiguration: o } = a();
81
86
  return o.workspace?.workspaceLanguage ?? "en";
82
87
  }
83
- function W() {
84
- const { bikes: o, accessories: e } = u();
88
+ function V() {
89
+ const { bikes: o, accessories: e } = a();
90
+ return { bikes: o, accessories: e };
91
+ }
92
+ function Y() {
93
+ const { bookingBikes: o, bookingAccessories: e } = a();
85
94
  return { bikes: o, accessories: e };
86
95
  }
87
96
  export {
88
- j as default,
89
- X as loader,
90
- F as useOptionalStorefront,
91
- u as useStorefront,
92
- H as useStorefrontConfig,
93
- W as useStorefrontProducts,
94
- D as useStorefrontWorkspaceLanguage
97
+ z as default,
98
+ W as loader,
99
+ G as useOptionalStorefront,
100
+ a as useStorefront,
101
+ Y as useStorefrontBookingProducts,
102
+ J as useStorefrontConfig,
103
+ V as useStorefrontProducts,
104
+ Q as useStorefrontWorkspaceLanguage
95
105
  };
@@ -1,9 +1,10 @@
1
1
  import { z as o } from "zod";
2
- import { identifierSchema as e, isoDateTimeSchema as n, ulidStringSchema as a, objectIdStringSchema as p } from "../models/types-DLcvzW5b.js";
3
- import { productKindSchema as m, productVariantCodeSchema as s } from "../models/Product.shared-BiDGmurZ.js";
2
+ import { identifierSchema as n, isoDateTimeSchema as e, ulidStringSchema as p, objectIdStringSchema as m } from "../models/types-DLcvzW5b.js";
3
+ import { productKindSchema as c, productVariantCodeSchema as s } from "../models/Product.shared-BiDGmurZ.js";
4
4
  import { moneyMinorSchema as r } from "./money-Dy4b9loa.js";
5
- import { richTextSchema as c } from "./rich-text-CqXhNDN3.js";
6
- const d = o.enum([
5
+ import { richTextSchema as d } from "./rich-text-CqXhNDN3.js";
6
+ import { cancellationPolicySchema as a } from "./booking-engine-configuration-DTJD2G9w.js";
7
+ const l = o.enum([
7
8
  "pending_approval",
8
9
  "pending_payment",
9
10
  "confirmed",
@@ -11,17 +12,17 @@ const d = o.enum([
11
12
  "completed",
12
13
  "canceled",
13
14
  "expired"
14
- ]), l = o.object({
15
- _id: e,
16
- productId: e,
17
- kind: m,
15
+ ]), u = o.object({
16
+ _id: n,
17
+ productId: n,
18
+ kind: c,
18
19
  qty: o.number().int().positive(),
19
- productVariantId: e.optional(),
20
+ productVariantId: n.optional(),
20
21
  productShortCode: o.string().trim().min(1).max(3).optional(),
21
22
  productName: o.string().trim().min(1).optional(),
22
23
  productVariantName: o.string().trim().min(1).optional(),
23
24
  productVariantCode: s.optional()
24
- }), u = o.object({
25
+ }), g = o.object({
25
26
  name: o.preprocess(
26
27
  (t) => {
27
28
  if (typeof t != "string") return;
@@ -46,30 +47,32 @@ const d = o.enum([
46
47
  },
47
48
  o.string().min(1).optional()
48
49
  ),
49
- message: c.optional()
50
- }), y = o.object({
51
- _id: p,
52
- externalId: a,
53
- state: d,
54
- shopId: e,
55
- customer: u,
50
+ message: d.optional()
51
+ }), A = o.object({
52
+ _id: m,
53
+ externalId: p,
54
+ state: l,
55
+ shopId: n,
56
+ customer: g,
56
57
  deliveryOption: o.enum(["delivery", "pickup"]),
57
- start: n,
58
- end: n,
58
+ start: e,
59
+ end: e,
59
60
  startAddress: o.string().optional(),
60
61
  endAddress: o.string().optional(),
61
- items: o.array(l),
62
+ items: o.array(u),
62
63
  couponCode: o.string().min(1).optional(),
63
64
  couponDiscountRate: o.number().min(0).max(1).optional(),
64
65
  couponDiscountAmountUnits: r.optional(),
65
66
  couponAutoApplied: o.boolean().optional(),
66
- couponPriceRuleId: e.optional(),
67
+ couponPriceRuleId: n.optional(),
67
68
  totalPriceUnits: r.optional(),
68
- createdAt: n,
69
- updatedAt: n
69
+ cancellationPolicySnapshot: a.optional(),
70
+ cancellationPolicyOverride: a.optional(),
71
+ createdAt: e,
72
+ updatedAt: e
70
73
  });
71
74
  export {
72
- l as baseBookingItemSchema,
73
- y as baseBookingSchema,
74
- d as baseBookingStateSchema
75
+ u as baseBookingItemSchema,
76
+ A as baseBookingSchema,
77
+ l as baseBookingStateSchema
75
78
  };
@@ -0,0 +1,123 @@
1
+ import { z as e } from "zod";
2
+ import { localizedStringSchema as m } from "../models/LocalizedString--6q77SPQ.js";
3
+ import { priceUnitSchema as n } from "../models/Price-BlFRDHXV.js";
4
+ import { currencyCodeSchema as l } from "./money-Dy4b9loa.js";
5
+ import { shopConfigurationSchema as c } from "./shop-opening-hours-DqNWstqT.js";
6
+ import { isoDateSchema as x, shopExtraTimeSlotRuleSchema as z, shopOpeningDaySchema as N, shopOpeningHoursOverrideSchema as Y, shopOpeningHoursPeriodSchema as $, shopOpeningSlotSchema as Z, timeOfDaySchema as B } from "./shop-opening-hours-DqNWstqT.js";
7
+ const u = [
8
+ "soldOutOnly",
9
+ "soldOutAndFewRemaining",
10
+ "fewRemaining",
11
+ "fewRemainingCounts",
12
+ "remainingCounts"
13
+ ], p = e.enum(u, {
14
+ message: "Availability display mode must be one of 'soldOutOnly', 'soldOutAndFewRemaining', 'fewRemaining', 'fewRemainingCounts', or 'remainingCounts'"
15
+ }), d = /* @__PURE__ */ new Set([
16
+ "soldOutAndFewRemaining",
17
+ "fewRemaining",
18
+ "fewRemainingCounts"
19
+ ]), h = (a) => d.has(a), g = {
20
+ message: "A defaultFewRemainingThreshold is required for display modes that highlight 'few remaining' states"
21
+ }, b = e.object({
22
+ defaultMode: p,
23
+ defaultFewRemainingThreshold: e.number().int().min(1).optional()
24
+ }).refine(
25
+ (a) => !h(a.defaultMode) || a.defaultFewRemainingThreshold !== void 0,
26
+ g
27
+ ), f = e.object({
28
+ enabled: e.boolean(),
29
+ defaultTtlMinutes: e.number().int().min(1)
30
+ }), y = e.object({
31
+ unit: n,
32
+ label: m.optional(),
33
+ durationHours: e.number().positive()
34
+ }), S = e.object({
35
+ enabled: e.boolean(),
36
+ boundaryHour: e.number().int().min(0).max(23)
37
+ }), D = e.object({
38
+ baseUnit: n,
39
+ rentalUnits: e.array(y).min(1),
40
+ halfDay: S.optional()
41
+ }).refine(
42
+ (a) => a.rentalUnits.some((o) => o.unit === a.baseUnit),
43
+ { message: "Rental units must include the configured base unit" }
44
+ ), t = e.number().min(0, { message: "Percentage must be greater than or equal to 0" }).max(1, { message: "Percentage must be less than or equal to 1" }), s = e.object({
45
+ enabled: e.boolean(),
46
+ percentage: t,
47
+ optimizeDepositAmount: e.boolean().default(!1)
48
+ }), C = e.object({
49
+ upToHours: e.number().int().positive(),
50
+ refundPercentage: t
51
+ }), O = e.object({
52
+ tiers: e.array(C).default([])
53
+ }).superRefine((a, o) => {
54
+ for (let i = 1; i < a.tiers.length; i += 1)
55
+ a.tiers[i].upToHours <= a.tiers[i - 1].upToHours && o.addIssue({
56
+ code: e.ZodIssueCode.custom,
57
+ message: "Cancellation policy tiers must be ordered by increasing duration",
58
+ path: ["tiers", i, "upToHours"]
59
+ });
60
+ }), w = {
61
+ tiers: []
62
+ }, R = ["disabled", "optional", "required"], r = e.object({
63
+ mode: e.enum(R, {
64
+ message: "Security deposit mode must be one of 'disabled', 'optional', or 'required'"
65
+ })
66
+ }), E = e.object({
67
+ bookingDeposit: s,
68
+ securityDeposit: r
69
+ }), q = {
70
+ bookingDeposit: {
71
+ enabled: !1,
72
+ percentage: 0.3,
73
+ optimizeDepositAmount: !1
74
+ },
75
+ securityDeposit: {
76
+ mode: "optional"
77
+ }
78
+ }, T = ["auto_approve_when_possible", "manual_approval_required"], _ = e.enum(T, {
79
+ message: "Checkout mode must be one of 'auto_approve_when_possible' or 'manual_approval_required'"
80
+ }), j = e.object({
81
+ strategy: e.string().optional()
82
+ }).catchall(e.unknown()), P = e.object({
83
+ mode: _,
84
+ dynamicOptions: j.optional()
85
+ }), k = l, I = e.object({
86
+ availabilityDisplay: b,
87
+ holdSettings: f,
88
+ pricing: D,
89
+ bookingDeposit: s,
90
+ cancellationPolicy: O.default(w),
91
+ securityDeposit: r,
92
+ checkout: P,
93
+ shop: c,
94
+ currency: k
95
+ });
96
+ export {
97
+ w as DEFAULT_CANCELLATION_POLICY,
98
+ q as DEFAULT_PAYMENT_POLICIES,
99
+ b as availabilityDisplayConfigurationSchema,
100
+ p as availabilityDisplayModeSchema,
101
+ s as bookingDepositPolicySchema,
102
+ I as bookingEngineConfigurationSchema,
103
+ O as cancellationPolicySchema,
104
+ C as cancellationPolicyTierSchema,
105
+ P as checkoutConfigurationSchema,
106
+ j as checkoutDynamicOptionsSchema,
107
+ _ as checkoutModeSchema,
108
+ k as currencySchema,
109
+ f as holdSettingsSchema,
110
+ x as isoDateSchema,
111
+ E as paymentPoliciesSchema,
112
+ D as pricingConfigurationSchema,
113
+ S as pricingHalfDaySchema,
114
+ y as pricingUnitOptionSchema,
115
+ r as securityDepositPolicySchema,
116
+ c as shopConfigurationSchema,
117
+ z as shopExtraTimeSlotRuleSchema,
118
+ N as shopOpeningDaySchema,
119
+ Y as shopOpeningHoursOverrideSchema,
120
+ $ as shopOpeningHoursPeriodSchema,
121
+ Z as shopOpeningSlotSchema,
122
+ B as timeOfDaySchema
123
+ };
@@ -1,7 +1,7 @@
1
1
  import { z as e } from "zod";
2
2
  import { identifierSchema as i } from "../models/types-DLcvzW5b.js";
3
3
  import { moneyMinorSchema as a } from "./money-Dy4b9loa.js";
4
- import { fulfillmentModeSchema as s } from "./public-booking-engine-configuration-DKoak4s5.js";
4
+ import { fulfillmentModeSchema as s } from "./public-booking-engine-configuration-CrwffLO4.js";
5
5
  import { richTextSchema as m } from "./rich-text-CqXhNDN3.js";
6
6
  import { timeOfDaySchema as r, isoDateSchema as n } from "./shop-opening-hours-DqNWstqT.js";
7
7
  const p = e.object({
@@ -1,5 +1,5 @@
1
1
  import { z as o } from "zod";
2
- import { checkoutConfigurationSchema as i, bookingEngineConfigurationSchema as a } from "./booking-engine-configuration-BKlzwJJX.js";
2
+ import { checkoutConfigurationSchema as i, bookingEngineConfigurationSchema as a } from "./booking-engine-configuration-DTJD2G9w.js";
3
3
  import { timeOfDaySchema as e } from "./shop-opening-hours-DqNWstqT.js";
4
4
  const n = o.enum(["pickup", "delivery"]), t = o.object({
5
5
  fulfillmentModes: o.array(n).min(1).optional(),
@@ -7,7 +7,6 @@ import "./node_modules/@base-ui/react/esm/scroll-area/viewport/ScrollAreaViewpor
7
7
  import "./node_modules/@base-ui/react/esm/scroll-area/corner/ScrollAreaCorner-z0cNScNF.js";
8
8
  import "./node_modules/@base-ui/react/esm/scroll-area/scrollbar/ScrollAreaScrollbar-DGyLPhKe.js";
9
9
  import "./node_modules/@base-ui/react/esm/scroll-area/thumb/ScrollAreaThumb-08Mmzry4.js";
10
- import "./node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion-Cc0tLlFf.js";
11
10
  import "./node_modules/motion-dom/dist/es/value/types/color/rgba-BIy7YqPw.js";
12
11
  import "./node_modules/motion-dom/dist/es/value/types/numbers/index-CWjqASeJ.js";
13
12
  import "./node_modules/motion-dom/dist/es/value/types/numbers/units-DNXf-Ngr.js";
@@ -15,13 +14,14 @@ import "./node_modules/motion-dom/dist/es/value/types/complex/filter-AXB6Rjjs.js
15
14
  import "./node_modules/motion-dom/dist/es/value/types/complex/mask-AXB6Rjjs.js";
16
15
  import "./node_modules/motion-dom/dist/es/value/types/int-CwcJvGhp.js";
17
16
  import "./node_modules/motion-utils/dist/es/errors-CBdvTtJZ.js";
17
+ import "./node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion-Cc0tLlFf.js";
18
18
  import "./node_modules/framer-motion/dist/es/context/LayoutGroupContext-BWutRI4l.js";
19
19
  import "./node_modules/framer-motion/dist/es/context/LazyContext-yIDUGdfR.js";
20
20
  import "./node_modules/framer-motion/dist/es/context/MotionConfigContext-C3EPauom.js";
21
21
  import "./node_modules/framer-motion/dist/es/render/dom/utils/filter-props-DZcjZ2yt.js";
22
- import "./node_modules/framer-motion/dist/es/animation/optimized-appear/data-id-DunDwGdX.js";
23
22
  import "./node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext-BWutRI4l.js";
24
- import "./node_modules/framer-motion/dist/es/projection/node/create-projection-node-BDwaGtmx.js";
23
+ import "./node_modules/motion-dom/dist/es/animation/optimized-appear/data-id-CNQuVmXa.js";
24
+ import "./node_modules/motion-dom/dist/es/projection/node/create-projection-node-DL2q-YuA.js";
25
25
  import "./node_modules/lucide-react/dist/esm/icons/arrow-left-asE1l_Qw.js";
26
26
  import "./node_modules/lucide-react/dist/esm/icons/x-Cdi8GS7U.js";
27
27
  const t = o(null), k = () => r(t);
@@ -0,0 +1,6 @@
1
+ import { camelToDash as a } from "../../render/dom/utils/camel-to-dash-C-3PLS5x.js";
2
+ const r = "framerAppearId";
3
+ "" + a(r);
4
+ export {
5
+ r as optimizedAppearDataId
6
+ };
@@ -0,0 +1,9 @@
1
+ import { noop as r } from "../../../../../motion-utils/dist/es/noop-BGdtcOlD.js";
2
+ import "../../value/types/color/rgba-BIy7YqPw.js";
3
+ import "../../value/types/numbers/index-CWjqASeJ.js";
4
+ import "../../value/types/numbers/units-DNXf-Ngr.js";
5
+ import "../../../../../motion-utils/dist/es/errors-CBdvTtJZ.js";
6
+ import "../../animation/keyframes/utils/unit-conversion-Cc0tLlFf.js";
7
+ import "../../animation/optimized-appear/data-id-CNQuVmXa.js";
8
+ const o = (t) => typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(t);
9
+ o("applewebkit/") && !o("chrome/") || r;
@@ -0,0 +1,6 @@
1
+ function a(e) {
2
+ return e.replace(/([A-Z])/g, (r) => `-${r.toLowerCase()}`);
3
+ }
4
+ export {
5
+ a as camelToDash
6
+ };
@@ -42,7 +42,7 @@ function P({ preset: c }) {
42
42
  return m(), window.addEventListener("resize", m), () => window.removeEventListener("resize", m);
43
43
  }, [s]), /* @__PURE__ */ e("section", { id: "about", className: "border-t border-slate-200 bg-white scroll-mt-16 sm:scroll-mt-20", children: /* @__PURE__ */ n("div", { className: "lg:grid lg:grid-cols-2 lg:items-stretch", children: [
44
44
  /* @__PURE__ */ e("div", { className: "px-4 py-10 sm:px-6 lg:px-0 lg:py-14", children: /* @__PURE__ */ n("div", { className: "mx-auto max-w-7xl lg:mx-0 lg:ml-auto lg:max-w-[40rem] lg:pl-6 lg:pr-8 xl:pr-12", children: [
45
- /* @__PURE__ */ e("p", { className: "text-xs font-medium uppercase tracking-[0.08em] text-slate-500", children: /* @__PURE__ */ e("span", { children: o("about_section_title") }) }),
45
+ /* @__PURE__ */ e("p", { className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500", children: /* @__PURE__ */ e("span", { children: o("about_section_title") }) }),
46
46
  /* @__PURE__ */ e("h2", { className: "mt-2 text-2xl font-semibold tracking-tight text-slate-950 sm:text-3xl", children: /* @__PURE__ */ e("span", { children: o("about_section_heading") }) }),
47
47
  s ? /* @__PURE__ */ n(C, { children: [
48
48
  /* @__PURE__ */ n("div", { className: "relative mt-4", children: [
@@ -10,8 +10,9 @@ type BikeProductCardProps = {
10
10
  actionDisabled?: boolean;
11
11
  availabilityLabel?: string;
12
12
  fallbackLanguage?: string;
13
+ variant?: "default" | "booking";
13
14
  testId?: string;
14
15
  };
15
- export declare function BikeProductCard({ bike, detailsPath, productDetailsLinkState, actionLabelKey, onAction, actionDisabled, availabilityLabel, fallbackLanguage, testId, }: BikeProductCardProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function BikeProductCard({ bike, detailsPath, productDetailsLinkState, actionLabelKey, onAction, actionDisabled, availabilityLabel, fallbackLanguage, variant, testId, }: BikeProductCardProps): import("react/jsx-runtime").JSX.Element;
16
17
  export {};
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BikeProductCard/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AASrD,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,WAAW,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,uBAAuB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C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