@loczer/storefront-sdk 0.191.0 → 0.193.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 (65) hide show
  1. package/dist/StorefrontProvider.d.ts +9 -0
  2. package/dist/StorefrontProvider.d.ts.map +1 -1
  3. package/dist/chunks/pkg/booking-engine/dist/models/{Product.shared-IYOeC3N7.js → Product.shared-cjcvMCMa.js} +4 -2
  4. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-asset-zsUj5_3O.js → base-asset-CsOe0vXi.js} +1 -1
  5. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-TzCge_mR.js → base-booking-Sjsqh31e.js} +28 -23
  6. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-product-DvFFzAcg.js → base-product-C_ATjuc6.js} +1 -1
  7. package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-B0HpcFe5.js → cart-inputs-D1_Wmkca.js} +11 -0
  8. package/dist/chunks/pkg/booking-engine/dist/schemas/insurance-B01h642r.js +67 -0
  9. package/dist/chunks/pkg/booking-engine/dist/schemas-D_yUBLa0.js +14 -0
  10. package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.d.ts +10 -0
  11. package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.d.ts.map +1 -0
  12. package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.js +104 -0
  13. package/dist/components/ContractSaleDocument/Invoice.d.ts +2 -2
  14. package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
  15. package/dist/components/ContractSaleDocument/Invoice.js +157 -110
  16. package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
  17. package/dist/components/ContractSaleDocument/InvoiceDetails.js +132 -155
  18. package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts +0 -2
  19. package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts.map +1 -1
  20. package/dist/components/ContractSaleDocument/TermsAndConditionsContent.js +32 -37
  21. package/dist/i18n/en.d.ts +15 -0
  22. package/dist/i18n/en.d.ts.map +1 -1
  23. package/dist/i18n/en.js +15 -0
  24. package/dist/i18n/fr.d.ts +15 -0
  25. package/dist/i18n/fr.d.ts.map +1 -1
  26. package/dist/i18n/fr.js +15 -0
  27. package/dist/index.d.ts +314 -12
  28. package/dist/index.js +66 -65
  29. package/dist/lib/booking.js +2 -2
  30. package/dist/lib/checkoutSubmit.d.ts +8 -2
  31. package/dist/lib/checkoutSubmit.d.ts.map +1 -1
  32. package/dist/lib/checkoutSubmit.js +13 -4
  33. package/dist/lib/checkoutVerifyCoupon.d.ts +3 -0
  34. package/dist/lib/checkoutVerifyCoupon.d.ts.map +1 -1
  35. package/dist/lib/checkoutVerifyCoupon.js +4 -1
  36. package/dist/lib/contractSaleDocument.d.ts +48 -3
  37. package/dist/lib/contractSaleDocument.d.ts.map +1 -1
  38. package/dist/lib/contractSaleDocument.js +36 -18
  39. package/dist/lib/contractSaleDocumentApi.d.ts +60 -6
  40. package/dist/lib/contractSaleDocumentApi.d.ts.map +1 -1
  41. package/dist/lib/contractSaleDocumentApi.js +41 -37
  42. package/dist/lib/storefrontProducts.d.ts +3 -0
  43. package/dist/lib/storefrontProducts.d.ts.map +1 -1
  44. package/dist/lib/storefrontProducts.js +2 -1
  45. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  46. package/dist/pages/CheckoutPage.js +264 -237
  47. package/dist/pages/ContractSaleDocumentPage.d.ts +23 -9
  48. package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
  49. package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
  50. package/dist/pages/checkout/components/CheckoutDetailsCard.js +17 -3
  51. package/dist/pages/checkout/components/CheckoutInsuranceCard.d.ts +12 -0
  52. package/dist/pages/checkout/components/CheckoutInsuranceCard.d.ts.map +1 -0
  53. package/dist/pages/checkout/components/CheckoutInsuranceCard.js +53 -0
  54. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts +2 -1
  55. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts.map +1 -1
  56. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +47 -30
  57. package/dist/pages/checkout/types.d.ts +2 -1
  58. package/dist/pages/checkout/types.d.ts.map +1 -1
  59. package/dist/pages/checkout/types.js +2 -1
  60. package/dist/storefront.css +1 -1
  61. package/dist/storefrontSchemas.d.ts +6 -0
  62. package/dist/storefrontSchemas.d.ts.map +1 -1
  63. package/dist/storefrontSchemas.js +5 -2
  64. package/package.json +1 -1
  65. package/dist/chunks/pkg/booking-engine/dist/schemas-BNUzqsci.js +0 -13
@@ -235,6 +235,9 @@ export declare const loader: ({ ctx, params }: import('@rpcbase/client').LoaderA
235
235
  enabled: boolean;
236
236
  showRecentReviewsOnStorefront: boolean;
237
237
  } | undefined;
238
+ insurance?: {
239
+ enabled: boolean;
240
+ } | undefined;
238
241
  } | undefined;
239
242
  };
240
243
  bikes: BikeProduct[];
@@ -469,6 +472,9 @@ export declare function useStorefrontConfig(): {
469
472
  enabled: boolean;
470
473
  showRecentReviewsOnStorefront: boolean;
471
474
  } | undefined;
475
+ insurance?: {
476
+ enabled: boolean;
477
+ } | undefined;
472
478
  } | undefined;
473
479
  };
474
480
  storefrontConfiguration: {
@@ -693,6 +699,9 @@ export declare function useStorefrontConfig(): {
693
699
  enabled: boolean;
694
700
  showRecentReviewsOnStorefront: boolean;
695
701
  } | undefined;
702
+ insurance?: {
703
+ enabled: boolean;
704
+ } | undefined;
696
705
  } | undefined;
697
706
  };
698
707
  };
@@ -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;AAOjG,OAAO,EAIL,KAAK,gBAAgB,EACrB,KA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BAQ5B;AAED,wBAAgB,qBAAqB,uCAEpC;AAED,wBAAgB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMlC;AAED,wBAAgB,8BAA8B,IAAI,sBAAsB,CAGvE;AAED,wBAAgB,qBAAqB;;;EAGpC;AAED,wBAAgB,4BAA4B;;;EAG3C"}
@@ -35,7 +35,8 @@ var m = o.object({
35
35
  }), _ = o.object({
36
36
  enabled: o.boolean().default(!1),
37
37
  pricePerDayMinor: i.default(0),
38
- deductibleAmountMinor: i.default(0)
38
+ deductibleAmountMinor: i.default(0),
39
+ insuredValueMinor: i.default(0)
39
40
  }), v = o.object({
40
41
  _id: e,
41
42
  kind: s,
@@ -48,7 +49,8 @@ var m = o.object({
48
49
  insurance: _.default({
49
50
  enabled: !1,
50
51
  pricePerDayMinor: 0,
51
- deductibleAmountMinor: 0
52
+ deductibleAmountMinor: 0,
53
+ insuredValueMinor: 0
52
54
  }),
53
55
  bufferStartMinutes: o.number().int().min(0).optional(),
54
56
  bufferEndMinutes: o.number().int().min(0).optional(),
@@ -1,5 +1,5 @@
1
1
  import { booleanNumberRecordSchema as e, identifierSchema as t, isoDateTimeSchema as n } from "../models/types-rIp4ReXN.js";
2
- import { productVariantIdentifierSchema as r } from "../models/Product.shared-IYOeC3N7.js";
2
+ import { productVariantIdentifierSchema as r } from "../models/Product.shared-cjcvMCMa.js";
3
3
  import { z as i } from "zod";
4
4
  //#region ../booking-engine/dist/schemas/base-asset.js
5
5
  var a = i.enum([
@@ -1,11 +1,12 @@
1
1
  import { identifierSchema as e, isoDateTimeSchema as t, objectIdStringSchema as n, ulidStringSchema as r } from "../models/types-rIp4ReXN.js";
2
2
  import { moneyMinorSchema as i } from "./money-CVoCY4of.js";
3
- import { productKindSchema as a } from "../models/Product.shared-IYOeC3N7.js";
3
+ import { productKindSchema as a } from "../models/Product.shared-cjcvMCMa.js";
4
4
  import { richTextSchema as o } from "./rich-text-DTRh7U3z.js";
5
5
  import { cancellationPolicySchema as s } from "./booking-engine-configuration-LnrhShqm.js";
6
- import { z as c } from "zod";
6
+ import { bookingInsuranceSnapshotSchema as c } from "./insurance-B01h642r.js";
7
+ import { z as l } from "zod";
7
8
  //#region ../booking-engine/dist/schemas/base-booking.js
8
- var l = c.enum([
9
+ var u = l.enum([
9
10
  "pending_approval",
10
11
  "pending_payment",
11
12
  "confirmed",
@@ -13,46 +14,50 @@ var l = c.enum([
13
14
  "completed",
14
15
  "canceled",
15
16
  "expired"
16
- ]), u = c.object({
17
+ ]), d = l.object({
17
18
  _id: e,
18
19
  productId: e,
19
20
  kind: a,
20
- qty: c.number().int().positive(),
21
+ qty: l.number().int().positive(),
21
22
  productVariantId: e.optional()
22
- }), d = c.object({
23
- name: c.preprocess((e) => {
23
+ }), f = l.object({
24
+ firstName: l.string().trim().min(1).optional(),
25
+ lastName: l.string().trim().min(1).optional(),
26
+ name: l.preprocess((e) => {
24
27
  if (typeof e != "string") return;
25
28
  let t = e.trim();
26
29
  return t.length > 0 ? t : void 0;
27
- }, c.string().min(1).optional()),
28
- email: c.preprocess((e) => {
30
+ }, l.string().min(1).optional()),
31
+ email: l.preprocess((e) => {
29
32
  if (typeof e != "string") return;
30
33
  let t = e.trim();
31
34
  return t.length > 0 ? t : void 0;
32
- }, c.string().email().optional()),
33
- phone: c.preprocess((e) => {
35
+ }, l.string().email().optional()),
36
+ phone: l.preprocess((e) => {
34
37
  if (typeof e != "string") return;
35
38
  let t = e.trim();
36
39
  return t.length > 0 ? t : void 0;
37
- }, c.string().min(1).optional()),
40
+ }, l.string().min(1).optional()),
38
41
  message: o.optional()
39
- }), f = c.object({
42
+ }), p = l.object({
40
43
  _id: n,
41
44
  externalId: r,
42
- state: l,
45
+ state: u,
43
46
  shopId: e,
44
- customer: d,
45
- deliveryOption: c.enum(["delivery", "pickup"]),
47
+ customer: f,
48
+ deliveryOption: l.enum(["delivery", "pickup"]),
46
49
  start: t,
47
50
  end: t,
48
- startAddress: c.string().optional(),
49
- endAddress: c.string().optional(),
50
- items: c.array(u),
51
- couponCode: c.string().min(1).optional(),
52
- couponDiscountRate: c.number().min(0).max(1).optional(),
51
+ startAddress: l.string().optional(),
52
+ endAddress: l.string().optional(),
53
+ items: l.array(d),
54
+ couponCode: l.string().min(1).optional(),
55
+ couponDiscountRate: l.number().min(0).max(1).optional(),
53
56
  couponDiscountAmountUnits: i.optional(),
54
- couponAutoApplied: c.boolean().optional(),
57
+ couponAutoApplied: l.boolean().optional(),
55
58
  couponPriceRuleId: e.optional(),
59
+ lateReturnSurchargeUnits: i.optional(),
60
+ insurance: c.optional(),
56
61
  totalPriceUnits: i.optional(),
57
62
  cancellationPolicySnapshot: s.optional(),
58
63
  cancellationPolicyOverride: s.optional(),
@@ -60,4 +65,4 @@ var l = c.enum([
60
65
  updatedAt: t
61
66
  });
62
67
  //#endregion
63
- export { u as baseBookingItemSchema, f as baseBookingSchema, l as baseBookingStateSchema };
68
+ export { d as baseBookingItemSchema, p as baseBookingSchema, u as baseBookingStateSchema };
@@ -1,3 +1,3 @@
1
1
  import "../models/LocalizedString-D_TRgAdr.js";
2
2
  import "../models/Price-DCAgqkKh.js";
3
- import "../models/Product.shared-IYOeC3N7.js";
3
+ import "../models/Product.shared-cjcvMCMa.js";
@@ -11,6 +11,16 @@ var s = o.object({
11
11
  startTime: i,
12
12
  endTime: i
13
13
  }), c = o.object({
14
+ firstName: o.preprocess((e) => {
15
+ if (typeof e != "string") return;
16
+ let t = e.trim();
17
+ return t.length > 0 ? t : void 0;
18
+ }, o.string().min(1).optional()),
19
+ lastName: o.preprocess((e) => {
20
+ if (typeof e != "string") return;
21
+ let t = e.trim();
22
+ return t.length > 0 ? t : void 0;
23
+ }, o.string().min(1).optional()),
14
24
  name: o.preprocess((e) => {
15
25
  if (typeof e != "string") return;
16
26
  let t = e.trim();
@@ -53,6 +63,7 @@ var m = o.object({
53
63
  couponDiscountAmountUnits: t.optional(),
54
64
  couponAutoApplied: o.boolean().optional(),
55
65
  couponPriceRuleId: e.optional(),
66
+ insuranceAccepted: o.boolean().default(!1),
56
67
  deliveryOption: u.optional(),
57
68
  startAddress: o.string().trim().max(500).optional(),
58
69
  endAddress: o.string().trim().max(500).optional()
@@ -0,0 +1,67 @@
1
+ import { identifierSchema as e, isoDateTimeSchema as t } from "../models/types-rIp4ReXN.js";
2
+ import { moneyMinorSchema as n } from "./money-CVoCY4of.js";
3
+ import { productKindSchema as r } from "../models/Product.shared-cjcvMCMa.js";
4
+ import { z as i } from "zod";
5
+ //#region ../booking-engine/dist/schemas/insurance.js
6
+ var a = i.enum(["sharelock", "morio"]), o = i.enum(["storefront", "staff"]), s = i.object({
7
+ bookingItemId: e,
8
+ productId: e,
9
+ productVariantId: e.optional(),
10
+ kind: r,
11
+ qty: i.number().int().positive(),
12
+ pricePerDayMinor: n,
13
+ deductibleAmountMinor: n,
14
+ insuredValueMinor: n,
15
+ totalMinor: n
16
+ }), c = i.object({
17
+ accepted: i.literal(!0),
18
+ acceptedAt: t,
19
+ consentSource: o,
20
+ provider: a,
21
+ billableDays: i.number().int().positive(),
22
+ subtotalMinor: n,
23
+ items: i.array(s).min(1)
24
+ }), l = 1440 * 60 * 1e3;
25
+ function u(e, t) {
26
+ let n = new Intl.DateTimeFormat("en-CA", {
27
+ timeZone: t,
28
+ year: "numeric",
29
+ month: "2-digit",
30
+ day: "2-digit"
31
+ }), r = new Map(n.formatToParts(e).map((e) => [e.type, e.value]));
32
+ return Date.UTC(Number(r.get("year")), Number(r.get("month")) - 1, Number(r.get("day")));
33
+ }
34
+ function d(e, t, n = "UTC") {
35
+ if (!Number.isFinite(e.getTime()) || !Number.isFinite(t.getTime())) throw Error("Insurance dates must be valid.");
36
+ if (t.getTime() <= e.getTime()) throw Error("Insurance end datetime must be after the start datetime.");
37
+ return Math.max(1, Math.round((u(t, n) - u(e, n)) / l) + 1);
38
+ }
39
+ function f(e) {
40
+ let t = Math.max(1, Math.round(e.billableDays)), n = e.items.flatMap((e) => {
41
+ if (e.kind !== "bike" && e.kind !== "e-bike" || e.insurance?.enabled !== !0) return [];
42
+ let n = Math.max(1, Math.round(e.qty)), r = Math.max(0, Math.round(e.insurance.pricePerDayMinor ?? 0)), i = Math.max(0, Math.round(e.insurance.deductibleAmountMinor ?? 0)), a = Math.max(0, Math.round(e.insurance.insuredValueMinor ?? 0));
43
+ return [{
44
+ bookingItemId: e.bookingItemId,
45
+ productId: e.productId,
46
+ productVariantId: e.productVariantId,
47
+ kind: e.kind,
48
+ qty: n,
49
+ pricePerDayMinor: r,
50
+ deductibleAmountMinor: i,
51
+ insuredValueMinor: a,
52
+ totalMinor: r * t * n
53
+ }];
54
+ });
55
+ if (n.length === 0) throw Error("Insurance is not available for the selected products.");
56
+ return c.parse({
57
+ accepted: !0,
58
+ acceptedAt: e.acceptedAt,
59
+ consentSource: e.consentSource,
60
+ provider: e.provider,
61
+ billableDays: t,
62
+ subtotalMinor: n.reduce((e, t) => e + t.totalMinor, 0),
63
+ items: n
64
+ });
65
+ }
66
+ //#endregion
67
+ export { o as bookingInsuranceConsentSourceSchema, s as bookingInsuranceItemSnapshotSchema, c as bookingInsuranceSnapshotSchema, f as buildBookingInsuranceSnapshot, d as calculateInsuranceCalendarDays, a as insuranceProviderSchema };
@@ -0,0 +1,14 @@
1
+ import { createLocalizedStringEntry as e, getLocalizedStringValue as t, localizedStringArraySchema as n, localizedStringEntrySchema as r, localizedStringSchema as i } from "./models/LocalizedString-D_TRgAdr.js";
2
+ import { currencyCodeSchema as a, currencyMinorUnitDigits as o, majorToMinor as s, minorToMajor as c, moneyMinorSchema as l, signedMoneyMinorSchema as u } from "./schemas/money-CVoCY4of.js";
3
+ import { priceSchema as d, priceUnitSchema as f } from "./models/Price-DCAgqkKh.js";
4
+ import { PRODUCT_VARIANT_CODE_IDENTIFIER_KIND as p, PRODUCT_VARIANT_CODE_MAX_LENGTH as m, accessoryProductSchema as h, bikeProductSchema as g, eBikeProductSchema as _, isProductVariantCodeIdentifierKind as v, productInsuranceSchema as y, productKindSchema as b, productSchema as x, productStorefrontDisplayModeSchema as S, productVariantAttributeSchema as C, productVariantCodeSchema as w, productVariantIdentifierSchema as T, productVariantSchema as E } from "./models/Product.shared-cjcvMCMa.js";
5
+ import { richTextJsonDocSchema as D, richTextSchema as O, richTextVersionSchema as k } from "./schemas/rich-text-DTRh7U3z.js";
6
+ import { isoDateSchema as A, shopConfigurationSchema as j, shopExtraTimeSlotRuleSchema as M, shopOpeningDayIndexSchema as N, shopOpeningDaySchema as P, shopOpeningHoursOverrideSchema as F, shopOpeningHoursPeriodSchema as I, shopOpeningSlotSchema as L, timeOfDaySchema as R } from "./schemas/shop-opening-hours-BlLD1gfz.js";
7
+ import { DEFAULT_CANCELLATION_POLICY as z, DEFAULT_PAYMENT_POLICIES as B, cancellationPolicySchema as V, cancellationPolicyTierSchema as H, paymentPoliciesSchema as U } from "./schemas/booking-engine-configuration-LnrhShqm.js";
8
+ import { fulfillmentModeSchema as W, publicBookingEngineConfigurationSchema as G, publicCheckoutConfigurationSchema as K, publicCheckoutDynamicOptionsSchema as q } from "./schemas/public-booking-engine-configuration-CEM9mexX.js";
9
+ import { DEFAULT_BOOKING_DELIVERY_OPTION as J, bookingCustomerInputSchema as Y, bookingDeliveryOptionSchema as X, bookingScheduleInputSchema as Z, cartItemInputSchema as Q, createBookingInputBaseSchema as $, createBookingInputSchema as ee, resolveBookingDeliveryOption as te, validateBookingDeliveryAddress as ne } from "./schemas/cart-inputs-D1_Wmkca.js";
10
+ import { bookingInsuranceConsentSourceSchema as re, bookingInsuranceItemSnapshotSchema as ie, bookingInsuranceSnapshotSchema as ae, buildBookingInsuranceSnapshot as oe, calculateInsuranceCalendarDays as se, insuranceProviderSchema as ce } from "./schemas/insurance-B01h642r.js";
11
+ import "./schemas/base-product-C_ATjuc6.js";
12
+ import { baseAssetSchema as le, baseAssetStatusSchema as ue } from "./schemas/base-asset-CsOe0vXi.js";
13
+ import { baseBookingItemSchema as de, baseBookingSchema as fe, baseBookingStateSchema as pe } from "./schemas/base-booking-Sjsqh31e.js";
14
+ export { J as DEFAULT_BOOKING_DELIVERY_OPTION, z as DEFAULT_CANCELLATION_POLICY, B as DEFAULT_PAYMENT_POLICIES, p as PRODUCT_VARIANT_CODE_IDENTIFIER_KIND, m as PRODUCT_VARIANT_CODE_MAX_LENGTH, h as accessoryProductSchema, le as baseAssetSchema, ue as baseAssetStatusSchema, de as baseBookingItemSchema, fe as baseBookingSchema, pe as baseBookingStateSchema, g as bikeProductSchema, Y as bookingCustomerInputSchema, X as bookingDeliveryOptionSchema, re as bookingInsuranceConsentSourceSchema, ie as bookingInsuranceItemSnapshotSchema, ae as bookingInsuranceSnapshotSchema, Z as bookingScheduleInputSchema, oe as buildBookingInsuranceSnapshot, se as calculateInsuranceCalendarDays, V as cancellationPolicySchema, H as cancellationPolicyTierSchema, Q as cartItemInputSchema, $ as createBookingInputBaseSchema, ee as createBookingInputSchema, e as createLocalizedStringEntry, a as currencyCodeSchema, o as currencyMinorUnitDigits, _ as eBikeProductSchema, W as fulfillmentModeSchema, t as getLocalizedStringValue, ce as insuranceProviderSchema, v as isProductVariantCodeIdentifierKind, A as isoDateSchema, n as localizedStringArraySchema, r as localizedStringEntrySchema, i as localizedStringSchema, s as majorToMinor, c as minorToMajor, l as moneyMinorSchema, U as paymentPoliciesSchema, d as priceSchema, f as priceUnitSchema, y as productInsuranceSchema, b as productKindSchema, x as productSchema, S as productStorefrontDisplayModeSchema, C as productVariantAttributeSchema, w as productVariantCodeSchema, T as productVariantIdentifierSchema, E as productVariantSchema, G as publicBookingEngineConfigurationSchema, K as publicCheckoutConfigurationSchema, q as publicCheckoutDynamicOptionsSchema, te as resolveBookingDeliveryOption, D as richTextJsonDocSchema, O as richTextSchema, k as richTextVersionSchema, j as shopConfigurationSchema, M as shopExtraTimeSlotRuleSchema, N as shopOpeningDayIndexSchema, P as shopOpeningDaySchema, F as shopOpeningHoursOverrideSchema, I as shopOpeningHoursPeriodSchema, L as shopOpeningSlotSchema, u as signedMoneyMinorSchema, R as timeOfDaySchema, ne as validateBookingDeliveryAddress };
@@ -0,0 +1,10 @@
1
+ import { ContractSaleDocument, ContractSaleDocumentLanguage } from '../../lib/contractSaleDocument';
2
+ type DocumentAcceptanceSectionProps = {
3
+ saleDocument: ContractSaleDocument;
4
+ documentLanguage: ContractSaleDocumentLanguage;
5
+ formatDate: (date: Date | string | number) => string;
6
+ className?: string;
7
+ };
8
+ export declare function DocumentAcceptanceSection({ saleDocument, documentLanguage, formatDate, className, }: DocumentAcceptanceSectionProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
10
+ //# sourceMappingURL=DocumentAcceptanceSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentAcceptanceSection.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/DocumentAcceptanceSection.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AAIvC,KAAK,8BAA8B,GAAG;IACpC,YAAY,EAAE,oBAAoB,CAAA;IAClC,gBAAgB,EAAE,4BAA4B,CAAA;IAC9C,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,KAAK,MAAM,CAAA;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,yBAAyB,CAAC,EACxC,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,SAAS,GACV,EAAE,8BAA8B,kDAuGhC"}
@@ -0,0 +1,104 @@
1
+ import { formatContractSaleDocumentLabel as e } from "./language.js";
2
+ import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ import { cn as i } from "@rpcbase/ui";
4
+ import { useTranslation as a } from "react-i18next";
5
+ //#region src/components/ContractSaleDocument/DocumentAcceptanceSection.tsx
6
+ function o({ saleDocument: o, documentLanguage: s, formatDate: c, className: l }) {
7
+ let { t: u } = a(), d = (t, n = {}) => e(u, s, t, n), f = o.acceptance?.mode === "signature" ? o.acceptance : null, p = o.acceptance?.mode === "acceptance" ? o.acceptance : null, m = o.acceptanceLevel === "signature" || f !== null;
8
+ return o.acceptanceLevel === "none" && !o.acceptance ? null : /* @__PURE__ */ n("section", {
9
+ className: i("mt-auto border-t border-border pt-8", l),
10
+ "data-testid": "contract-sale-document-acceptance-section",
11
+ children: m ? /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("p", {
12
+ className: "mb-12 text-center text-sm text-muted-foreground",
13
+ children: /* @__PURE__ */ n("span", { children: d("docs_contract_sale_signature_acknowledgement") })
14
+ }), f ? /* @__PURE__ */ r("div", {
15
+ className: "flex flex-col justify-between md:flex-row",
16
+ children: [/* @__PURE__ */ r("div", {
17
+ className: "mb-8 w-full md:mb-0 md:w-2/5",
18
+ children: [
19
+ /* @__PURE__ */ n("p", {
20
+ className: "font-semibold text-foreground",
21
+ children: /* @__PURE__ */ n("span", { children: d("docs_contract_sale_signature_issuer_label") })
22
+ }),
23
+ /* @__PURE__ */ n("p", {
24
+ className: "mb-2 mt-2 text-sm text-muted-foreground",
25
+ children: /* @__PURE__ */ r("span", { children: [d("docs_contract_sale_signature_date_label"), ": ___________________"] })
26
+ }),
27
+ /* @__PURE__ */ n("div", { className: "h-24 rounded-lg bg-muted/40" })
28
+ ]
29
+ }), /* @__PURE__ */ r("div", {
30
+ className: "w-full text-left md:w-2/5",
31
+ children: [
32
+ /* @__PURE__ */ n("p", {
33
+ className: "font-semibold text-foreground",
34
+ children: /* @__PURE__ */ n("span", { children: d("docs_contract_sale_signature_customer_label") })
35
+ }),
36
+ /* @__PURE__ */ n("p", {
37
+ className: "mb-2 mt-2 text-sm text-muted-foreground",
38
+ children: /* @__PURE__ */ r("span", { children: [
39
+ d("docs_contract_sale_signature_date_label"),
40
+ ": ",
41
+ c(f.date)
42
+ ] })
43
+ }),
44
+ /* @__PURE__ */ n("div", {
45
+ className: "flex h-24 items-center justify-center rounded-lg bg-muted/40 p-2",
46
+ children: /* @__PURE__ */ n("img", {
47
+ src: f.signature,
48
+ alt: d("docs_contract_sale_signature_image_alt"),
49
+ className: "max-h-full max-w-full"
50
+ })
51
+ }),
52
+ /* @__PURE__ */ n("p", {
53
+ className: "mt-2 text-sm text-foreground",
54
+ children: /* @__PURE__ */ n("span", { children: f.name })
55
+ }),
56
+ /* @__PURE__ */ n("p", {
57
+ className: "text-sm text-muted-foreground",
58
+ children: /* @__PURE__ */ n("span", { children: f.phone })
59
+ })
60
+ ]
61
+ })]
62
+ }) : /* @__PURE__ */ r("div", {
63
+ className: "flex flex-col justify-between md:flex-row",
64
+ children: [/* @__PURE__ */ r("div", {
65
+ className: "mb-8 w-full md:mb-0 md:w-2/5",
66
+ children: [
67
+ /* @__PURE__ */ n("p", {
68
+ className: "font-semibold text-foreground",
69
+ children: /* @__PURE__ */ n("span", { children: d("docs_contract_sale_signature_issuer_label") })
70
+ }),
71
+ /* @__PURE__ */ n("p", {
72
+ className: "mb-2 mt-2 text-sm text-muted-foreground",
73
+ children: /* @__PURE__ */ r("span", { children: [d("docs_contract_sale_signature_date_label"), ": ___________________"] })
74
+ }),
75
+ /* @__PURE__ */ n("div", { className: "h-24 rounded-lg bg-muted/40" })
76
+ ]
77
+ }), /* @__PURE__ */ r("div", {
78
+ className: "w-full md:w-2/5",
79
+ children: [
80
+ /* @__PURE__ */ n("p", {
81
+ className: "font-semibold text-foreground",
82
+ children: /* @__PURE__ */ n("span", { children: d("docs_contract_sale_signature_customer_label") })
83
+ }),
84
+ /* @__PURE__ */ n("p", {
85
+ className: "mb-2 mt-2 text-sm text-muted-foreground",
86
+ children: /* @__PURE__ */ r("span", { children: [d("docs_contract_sale_signature_date_label"), ": ___________________"] })
87
+ }),
88
+ /* @__PURE__ */ n("div", { className: "h-24 rounded-lg bg-muted/40" })
89
+ ]
90
+ })]
91
+ })] }) : /* @__PURE__ */ r("div", {
92
+ className: "rounded-lg border border-border bg-muted/30 p-4",
93
+ children: [/* @__PURE__ */ n("p", {
94
+ className: "text-sm font-medium text-foreground",
95
+ children: /* @__PURE__ */ n("span", { children: d(p ? "docs_contract_sale_acceptance_section_accepted_title" : "docs_contract_sale_acceptance_section_required_title") })
96
+ }), /* @__PURE__ */ n("p", {
97
+ className: "mt-1 text-sm text-muted-foreground",
98
+ children: /* @__PURE__ */ n("span", { children: p ? d("docs_contract_sale_acceptance_section_accepted_date", { date: c(p.date) }) : d("docs_contract_sale_acceptance_section_required_description") })
99
+ })]
100
+ })
101
+ });
102
+ }
103
+ //#endregion
104
+ export { o as DocumentAcceptanceSection };
@@ -1,13 +1,13 @@
1
1
  import { ContractSaleDocument as ContractSaleDocumentData, ContractSaleDocumentAcceptanceRecord } from '../../lib/contractSaleDocument';
2
2
  type ContractSaleDocumentProps = {
3
3
  data: ContractSaleDocumentData;
4
- showTermsPage?: boolean;
4
+ showAppendices?: boolean;
5
5
  withEnglishTranslation?: boolean;
6
6
  heightMode?: "parent" | "viewport";
7
7
  renderMode?: "interactive" | "pdf";
8
8
  publicDocumentUrl?: string;
9
9
  onAccept?: (acceptance: ContractSaleDocumentAcceptanceRecord) => Promise<ContractSaleDocumentData | void> | ContractSaleDocumentData | void;
10
10
  };
11
- export declare function ContractSaleDocument({ data: initialData, showTermsPage, withEnglishTranslation, heightMode, renderMode, publicDocumentUrl, onAccept, }: ContractSaleDocumentProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function ContractSaleDocument({ data: initialData, showAppendices, withEnglishTranslation, heightMode, renderMode, publicDocumentUrl, onAccept, }: ContractSaleDocumentProps): import("react/jsx-runtime").JSX.Element;
12
12
  export type { ContractSaleDocumentProps };
13
13
  //# sourceMappingURL=Invoice.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Invoice.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/Invoice.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,oBAAoB,IAAI,wBAAwB,EAChD,oCAAoC,EAIrC,MAAM,gCAAgC,CAAA;AAWvC,OAAO,eAAe,CAAA;AAGtB,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,wBAAwB,CAAA;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAClC,UAAU,CAAC,EAAE,aAAa,GAAG,KAAK,CAAA;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,CACT,UAAU,EAAE,oCAAoC,KAC7C,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,GAAG,wBAAwB,GAAG,IAAI,CAAA;CAChF,CAAA;AAwJD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EAAE,WAAW,EACjB,aAAoB,EACpB,sBAA6B,EAC7B,UAAuB,EACvB,UAA0B,EAC1B,iBAAiB,EACjB,QAAQ,GACT,EAAE,yBAAyB,2CAqe3B;AAED,YAAY,EAAE,yBAAyB,EAAE,CAAA"}
1
+ {"version":3,"file":"Invoice.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/Invoice.tsx"],"names":[],"mappings":"AAM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