@afosto/checkout-ui 0.0.12 → 0.0.14

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 (76) hide show
  1. package/dist/CheckoutAddressFields/CheckoutAddressFields.d.ts +2 -0
  2. package/dist/CheckoutAddressFields/CheckoutAddressFields.d.ts.map +1 -1
  3. package/dist/CheckoutAddressFields/CheckoutAddressFields.js +155 -130
  4. package/dist/CheckoutAddressSection/CheckoutAddressSection.d.ts +6 -2
  5. package/dist/CheckoutAddressSection/CheckoutAddressSection.d.ts.map +1 -1
  6. package/dist/CheckoutAddressSection/CheckoutAddressSection.js +82 -71
  7. package/dist/CheckoutAgreementOptionCondition/CheckoutAgreementOptionCondition.d.ts.map +1 -1
  8. package/dist/CheckoutAgreementOptionCondition/CheckoutAgreementOptionCondition.js +32 -29
  9. package/dist/CheckoutAgreementsTimeline/CheckoutAgreementsTimeline.d.ts.map +1 -1
  10. package/dist/CheckoutAgreementsTimeline/CheckoutAgreementsTimeline.js +21 -21
  11. package/dist/CheckoutDownPaymentAgreementsSummary/CheckoutDownPaymentAgreementsSummary.d.ts.map +1 -1
  12. package/dist/CheckoutDownPaymentAgreementsSummary/CheckoutDownPaymentAgreementsSummary.js +38 -35
  13. package/dist/CheckoutInformationStep/CheckoutInformationStep.d.ts +0 -2
  14. package/dist/CheckoutInformationStep/CheckoutInformationStep.d.ts.map +1 -1
  15. package/dist/CheckoutInformationStep/CheckoutInformationStep.js +30 -37
  16. package/dist/CheckoutPaymentStep/CheckoutPaymentStep.d.ts.map +1 -1
  17. package/dist/CheckoutPaymentStep/CheckoutPaymentStep.js +15 -15
  18. package/dist/CheckoutReviewPaymentSection/CheckoutReviewPaymentSection.d.ts.map +1 -1
  19. package/dist/CheckoutReviewPaymentSection/CheckoutReviewPaymentSection.js +19 -19
  20. package/dist/CheckoutSummary/CheckoutSummary.d.ts.map +1 -1
  21. package/dist/CheckoutSummary/CheckoutSummary.js +23 -23
  22. package/dist/CheckoutSummary/components/CheckoutSummaryAgreements/CheckoutSummaryAgreements.d.ts.map +1 -1
  23. package/dist/CheckoutSummary/components/CheckoutSummaryAgreements/CheckoutSummaryAgreements.js +35 -28
  24. package/dist/constants/addressDefaultValues.d.ts +1 -0
  25. package/dist/constants/addressDefaultValues.d.ts.map +1 -1
  26. package/dist/constants/addressDefaultValues.js +1 -0
  27. package/dist/constants/addressFields.d.ts.map +1 -1
  28. package/dist/constants/addressFields.js +6 -5
  29. package/dist/constants/addressValidationSchema.d.ts +10 -2
  30. package/dist/constants/addressValidationSchema.d.ts.map +1 -1
  31. package/dist/constants/addressValidationSchema.js +58 -46
  32. package/dist/constants/index.js +8 -8
  33. package/dist/fragments/CoreCartProjectionFields.d.ts +8 -1
  34. package/dist/fragments/CoreCartProjectionFields.d.ts.map +1 -1
  35. package/dist/fragments/CoreCartProjectionFields.js +8 -1
  36. package/dist/fragments/CoreOrderProjectionFields.d.ts +8 -1
  37. package/dist/fragments/CoreOrderProjectionFields.d.ts.map +1 -1
  38. package/dist/fragments/CoreOrderProjectionFields.js +8 -1
  39. package/dist/hooks/useCheckoutAddressOptions.d.ts +3 -1
  40. package/dist/hooks/useCheckoutAddressOptions.d.ts.map +1 -1
  41. package/dist/hooks/useCheckoutAddressOptions.js +64 -57
  42. package/dist/hooks/useCheckoutCart.d.ts.map +1 -1
  43. package/dist/hooks/useCheckoutForm.d.ts.map +1 -1
  44. package/dist/hooks/useCheckoutForm.js +45 -41
  45. package/dist/hooks/useCheckoutOrder.d.ts.map +1 -1
  46. package/dist/index.d.ts +0 -2
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +426 -428
  49. package/dist/operations/cartOperations.d.ts.map +1 -1
  50. package/dist/operations/cartOperations.js +120 -108
  51. package/dist/operations/orderOperations.d.ts.map +1 -1
  52. package/dist/operations/orderOperations.js +123 -111
  53. package/dist/queries/getCartInitialPaymentStepQuery.d.ts +4 -0
  54. package/dist/queries/getCartInitialPaymentStepQuery.d.ts.map +1 -1
  55. package/dist/queries/getCartInitialPaymentStepQuery.js +10 -2
  56. package/dist/queries/getOrderInitialPaymentStepQuery.d.ts +4 -0
  57. package/dist/queries/getOrderInitialPaymentStepQuery.d.ts.map +1 -1
  58. package/dist/queries/getOrderInitialPaymentStepQuery.js +11 -3
  59. package/dist/steps/informationStep.d.ts +0 -1
  60. package/dist/steps/informationStep.d.ts.map +1 -1
  61. package/dist/steps/informationStep.js +234 -238
  62. package/dist/types.d.ts +13 -3
  63. package/dist/types.d.ts.map +1 -1
  64. package/dist/utils/createAddressValidationSchema.d.ts +4 -1
  65. package/dist/utils/createAddressValidationSchema.d.ts.map +1 -1
  66. package/dist/utils/createAddressValidationSchema.js +8 -8
  67. package/dist/utils/formatCurrency.d.ts +2 -0
  68. package/dist/utils/formatCurrency.d.ts.map +1 -0
  69. package/dist/utils/formatCurrency.js +14 -0
  70. package/package.json +1 -1
  71. package/dist/CheckoutSalutationSection/CheckoutSalutationSection.d.ts +0 -13
  72. package/dist/CheckoutSalutationSection/CheckoutSalutationSection.d.ts.map +0 -1
  73. package/dist/CheckoutSalutationSection/CheckoutSalutationSection.js +0 -26
  74. package/dist/CheckoutSalutationSection/index.d.ts +0 -3
  75. package/dist/CheckoutSalutationSection/index.d.ts.map +0 -1
  76. package/dist/CheckoutSalutationSection/index.js +0 -4
@@ -1,63 +1,56 @@
1
- import { jsxs as C, Fragment as k, jsx as t } from "react/jsx-runtime";
2
- import { useFormContext as x, Collapse as i } from "@afosto/components";
3
- import { CheckoutContactInformationSection as A } from "../CheckoutContactInformationSection/CheckoutContactInformationSection.js";
4
- import { CheckoutTypeSection as y } from "../CheckoutTypeSection/CheckoutTypeSection.js";
5
- import { useCheckout as B } from "../CheckoutStateProvider/CheckoutStateProvider.js";
6
- import { CheckoutBusinessInformationSection as I } from "../CheckoutBusinessInformationSection/CheckoutBusinessInformationSection.js";
7
- import { CheckoutShippingAddressSection as b } from "../CheckoutShippingAddressSection/CheckoutShippingAddressSection.js";
8
- import { CheckoutBillingAddressSection as w } from "../CheckoutBillingAddressSection/CheckoutBillingAddressSection.js";
9
- import { CheckoutExpressCheckoutSection as E } from "../CheckoutExpressCheckoutSection/CheckoutExpressCheckoutSection.js";
10
- import { CheckoutSalutationSection as F } from "../CheckoutSalutationSection/CheckoutSalutationSection.js";
11
- const G = (e) => {
12
- const { translations: o = {} } = e || {}, { expressPaymentMethods: r, isSignedIn: a, settings: c } = B(), { isB2bExcluded: m, isB2cExcluded: p, salutation: l } = c || {}, { watch: d } = x(), [h, u, n] = d([
1
+ import { jsxs as u, Fragment as g, jsx as o } from "react/jsx-runtime";
2
+ import { useFormContext as f, Collapse as i } from "@afosto/components";
3
+ import { CheckoutContactInformationSection as C } from "../CheckoutContactInformationSection/CheckoutContactInformationSection.js";
4
+ import { CheckoutTypeSection as k } from "../CheckoutTypeSection/CheckoutTypeSection.js";
5
+ import { useCheckout as x } from "../CheckoutStateProvider/CheckoutStateProvider.js";
6
+ import { CheckoutBusinessInformationSection as A } from "../CheckoutBusinessInformationSection/CheckoutBusinessInformationSection.js";
7
+ import { CheckoutShippingAddressSection as y } from "../CheckoutShippingAddressSection/CheckoutShippingAddressSection.js";
8
+ import { CheckoutBillingAddressSection as B } from "../CheckoutBillingAddressSection/CheckoutBillingAddressSection.js";
9
+ import { CheckoutExpressCheckoutSection as I } from "../CheckoutExpressCheckoutSection/CheckoutExpressCheckoutSection.js";
10
+ const P = (e) => {
11
+ const { translations: t = {} } = e || {}, { expressPaymentMethods: r, isSignedIn: a, settings: c } = x(), { isB2bExcluded: p, isB2cExcluded: m } = c || {}, { watch: d } = f(), [h, l, n] = d([
13
12
  "organisation",
14
13
  "type",
15
14
  "sameBillingAsShippingAddress"
16
- ]), s = u === "business", S = h?.type?.toLowerCase() === "shared", g = !!l, f = !S && !m && !p;
17
- return /* @__PURE__ */ C(k, { children: [
18
- !a && r.length > 0 && /* @__PURE__ */ t(
19
- E,
15
+ ]), s = l === "business", S = !(h?.type?.toLowerCase() === "shared") && !p && !m;
16
+ return /* @__PURE__ */ u(g, { children: [
17
+ !a && r.length > 0 && /* @__PURE__ */ o(
18
+ I,
20
19
  {
21
- translations: o.expressCheckoutSection,
20
+ translations: t.expressCheckoutSection,
22
21
  sx: {
23
22
  mb: 3
24
23
  }
25
24
  }
26
25
  ),
27
- /* @__PURE__ */ t(
28
- A,
26
+ /* @__PURE__ */ o(
27
+ C,
29
28
  {
30
- translations: o.contactInformationSection
29
+ translations: t.contactInformationSection
31
30
  }
32
31
  ),
33
- f && /* @__PURE__ */ t(y, { translations: o.typeSection }),
34
- /* @__PURE__ */ t(i, { in: s, children: /* @__PURE__ */ t(
35
- I,
32
+ S && /* @__PURE__ */ o(k, { translations: t.typeSection }),
33
+ /* @__PURE__ */ o(i, { in: s, children: /* @__PURE__ */ o(
34
+ A,
36
35
  {
37
- translations: o.businessInformationSection
36
+ translations: t.businessInformationSection
38
37
  }
39
38
  ) }),
40
- g && /* @__PURE__ */ t(
41
- F,
42
- {
43
- translations: o.salutationSection
44
- }
45
- ),
46
- /* @__PURE__ */ t(
47
- b,
39
+ /* @__PURE__ */ o(
40
+ y,
48
41
  {
49
42
  showOrganisationField: !n && s,
50
- translations: o.shippingAddressSection
43
+ translations: t.shippingAddressSection
51
44
  }
52
45
  ),
53
- /* @__PURE__ */ t(i, { in: !n, children: /* @__PURE__ */ t(
54
- w,
46
+ /* @__PURE__ */ o(i, { in: !n, children: /* @__PURE__ */ o(
47
+ B,
55
48
  {
56
- translations: o.billingAddressSection
49
+ translations: t.billingAddressSection
57
50
  }
58
51
  ) })
59
52
  ] });
60
53
  };
61
54
  export {
62
- G as CheckoutInformationStep
55
+ P as CheckoutInformationStep
63
56
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutPaymentStep.d.ts","sourceRoot":"","sources":["../../src/CheckoutPaymentStep/CheckoutPaymentStep.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,8DAA8D,CAAC;AAOtE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE;QACb,oBAAoB,CAAC,EAAE,iCAAiC,CAAC,cAAc,CAAC,CAAC;KAC1E,CAAC;CACH;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,wBAAwB,qDA+DlE,CAAC"}
1
+ {"version":3,"file":"CheckoutPaymentStep.d.ts","sourceRoot":"","sources":["../../src/CheckoutPaymentStep/CheckoutPaymentStep.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,8DAA8D,CAAC;AAOtE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE;QACb,oBAAoB,CAAC,EAAE,iCAAiC,CAAC,cAAc,CAAC,CAAC;KAC1E,CAAC;CACH;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,wBAAwB,qDAiElE,CAAC"}
@@ -1,48 +1,48 @@
1
- import { jsx as t } from "react/jsx-runtime";
1
+ import { jsx as e } from "react/jsx-runtime";
2
2
  import { CheckoutPaymentMethodSection as k } from "../CheckoutPaymentMethodSection/CheckoutPaymentMethodSection.js";
3
3
  import { useCheckout as w } from "../CheckoutStateProvider/CheckoutStateProvider.js";
4
4
  import { useCheckoutPaymentStep as A } from "../hooks/useCheckoutPaymentStep.js";
5
5
  import { camelize as a } from "@afosto/utils";
6
6
  import { CheckoutDownPaymentAgreementsSummary as M } from "../CheckoutDownPaymentAgreementsSummary/CheckoutDownPaymentAgreementsSummary.js";
7
7
  import { CheckoutAgreementOptionsSection as T } from "../CheckoutAgreementOptionsSection/CheckoutAgreementOptionsSection.js";
8
- const j = (s) => {
8
+ const j = (r) => {
9
9
  const {
10
10
  currency: m,
11
11
  locale: i,
12
12
  translations: c = {}
13
- } = s || {}, {
13
+ } = r || {}, {
14
14
  setSubStep: p,
15
- subStep: l,
16
- summary: u,
15
+ subStep: u,
16
+ summary: l,
17
17
  translations: h
18
- } = w(), { agreementOptions: n, isInitializing: y, paymentMethods: g } = A(), { agreements: d, agreementTemplate: o } = u || {}, f = a(o?.type?.toLowerCase() || "") === "default", r = (d || []).filter(
19
- (e) => a(e.type?.toLowerCase() || "") === "downPayment" && e.originalPercentage > 0 && e.originalPercentage < 100
20
- ), S = r.length > 0, C = {
18
+ } = w(), { agreementOptions: o, isInitializing: y, paymentMethods: d } = A(), { agreements: f, agreementTemplate: n } = l || {}, S = a(n?.type?.toLowerCase() || "") === "default", s = (f || []).filter(
19
+ (t) => a(t.type?.toLowerCase() || "") === "downPayment" && (!t.isPercentage || t.isPercentage && t.amount > 0 && t.amount < 100)
20
+ ), g = s.length > 0, C = {
21
21
  ...h,
22
22
  ...c || {}
23
23
  }, P = () => {
24
24
  p("");
25
25
  };
26
- return l === "paymentMethods" ? /* @__PURE__ */ t(
26
+ return u === "paymentMethods" ? /* @__PURE__ */ e(
27
27
  k,
28
28
  {
29
- onBack: n.length > 1 ? P : void 0,
29
+ onBack: o.length > 1 ? P : void 0,
30
30
  translations: C.paymentMethodSection,
31
- children: o && !f && S && /* @__PURE__ */ t(
31
+ children: n && !S && g && /* @__PURE__ */ e(
32
32
  M,
33
33
  {
34
- downPaymentAgreements: r
34
+ downPaymentAgreements: s
35
35
  }
36
36
  )
37
37
  }
38
- ) : /* @__PURE__ */ t(
38
+ ) : /* @__PURE__ */ e(
39
39
  T,
40
40
  {
41
- agreementOptions: n,
41
+ agreementOptions: o,
42
42
  currency: m,
43
43
  locale: i,
44
44
  isLoading: y,
45
- paymentMethods: g
45
+ paymentMethods: d
46
46
  }
47
47
  );
48
48
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutReviewPaymentSection.d.ts","sourceRoot":"","sources":["../../src/CheckoutReviewPaymentSection/CheckoutReviewPaymentSection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAK/E,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,8DAA8D,CAAC;AAMtE,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,+BAA+B,CAAC;AAGvC,QAAA,MAAM,mBAAmB;;;;CAIxB,CAAC;AAEF,MAAM,WAAW,iCACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,CAAC,GACpD,iCAAiC,CAAC,cAAc,CAAC,GACjD,+BAA+B,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,4BAA4B,GACvC,OAAO,iCAAiC,qDA0GzC,CAAC"}
1
+ {"version":3,"file":"CheckoutReviewPaymentSection.d.ts","sourceRoot":"","sources":["../../src/CheckoutReviewPaymentSection/CheckoutReviewPaymentSection.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAK/E,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,8DAA8D,CAAC;AAMtE,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,+BAA+B,CAAC;AAGvC,QAAA,MAAM,mBAAmB;;;;CAIxB,CAAC;AAEF,MAAM,WAAW,iCACf,SAAQ,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,CAAC,GACpD,iCAAiC,CAAC,cAAc,CAAC,GACjD,+BAA+B,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,4BAA4B,GACvC,OAAO,iCAAiC,qDA4GzC,CAAC"}
@@ -1,8 +1,8 @@
1
- import { jsxs as u, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as C, jsx as n } from "react/jsx-runtime";
2
2
  import { useCheckout as I } from "../CheckoutStateProvider/CheckoutStateProvider.js";
3
3
  import { CheckoutSection as N } from "../CheckoutSection/CheckoutSection.js";
4
4
  import { CheckoutSectionHeader as L } from "../CheckoutSectionHeader/CheckoutSectionHeader.js";
5
- import { camelize as r } from "@afosto/utils";
5
+ import { camelize as a } from "@afosto/utils";
6
6
  import { CheckoutAgreementSummaryCard as D } from "../CheckoutAgreementSummaryCard/CheckoutAgreementSummaryCard.js";
7
7
  import { CheckoutMethodSummaryCardSkeleton as H } from "../CheckoutMethodSummaryCardSkeleton/CheckoutMethodSummaryCardSkeleton.js";
8
8
  import { CheckoutMethodSummaryCard as G } from "../CheckoutMethodSummaryCard/CheckoutMethodSummaryCard.js";
@@ -10,18 +10,18 @@ import { CHECKOUT_AGREEMENT_TYPE_ICON_MAPPING as R } from "../constants/agreemen
10
10
  import { CHECKOUT_PAYMENT_METHOD_ICON_MAPPING as $ } from "../constants/paymentMethodIconMapping.js";
11
11
  import { Box as b } from "@afosto/components";
12
12
  import { CheckoutAgreementsTimeline as j } from "../CheckoutAgreementsTimeline/CheckoutAgreementsTimeline.js";
13
- import { getReviewStepTarget as g } from "../utils/getReviewStepTarget.js";
13
+ import { getReviewStepTarget as f } from "../utils/getReviewStepTarget.js";
14
14
  const K = {
15
15
  title: "Payment",
16
16
  paymentMethod: "Payment method",
17
17
  paymentOption: "Payment option"
18
- }, et = (f) => {
18
+ }, et = (P) => {
19
19
  const {
20
- isLoading: n = !1,
21
- reviewData: P,
20
+ isLoading: r = !1,
21
+ reviewData: g,
22
22
  translations: T = {},
23
23
  ...M
24
- } = f || {}, {
24
+ } = P || {}, {
25
25
  goToTargetStep: m,
26
26
  locale: i,
27
27
  steps: s,
@@ -30,25 +30,25 @@ const K = {
30
30
  ...K,
31
31
  ...S?.reviewPaymentSection || {},
32
32
  ...T || {}
33
- }, p = g("paymentOption", s), c = g("paymentMethod", s), {
33
+ }, p = f("paymentOption", s), c = f("paymentMethod", s), {
34
34
  agreements: d = [],
35
35
  agreementTemplate: e,
36
36
  amountCovered: w = 0,
37
37
  currency: l,
38
38
  issuer: h,
39
39
  paymentMethod: y
40
- } = P || {}, C = r(e?.type?.toLowerCase() || ""), k = R[r(
40
+ } = g || {}, u = a(e?.type?.toLowerCase() || ""), k = R[a(
41
41
  e?.type?.toLowerCase() || ""
42
- )], { name: A, pricing: E } = y || {}, O = $[r(
42
+ )], { name: A, pricing: E } = y || {}, O = $[a(
43
43
  y?.code?.toLowerCase() || ""
44
44
  )], v = d.some(
45
- (a) => r(a.type?.toLowerCase() || "") === "downPayment" && a.originalPercentage > 0 && a.originalPercentage < 100
46
- ), _ = e && C !== "default", x = !e || !["cod", "postPaid"].includes(C);
47
- return /* @__PURE__ */ u(N, { ...M, children: [
48
- /* @__PURE__ */ o(L, { title: t.title }),
49
- /* @__PURE__ */ u(b, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
50
- n && /* @__PURE__ */ o(H, {}),
51
- !n && v && /* @__PURE__ */ o(
45
+ (o) => a(o.type?.toLowerCase() || "") === "downPayment" && (!o.isPercentage || o.isPercentage && o.amount > 0 && o.amount < 100)
46
+ ), _ = e && u !== "default", x = !e || !["cod", "postPaid"].includes(u);
47
+ return /* @__PURE__ */ C(N, { ...M, children: [
48
+ /* @__PURE__ */ n(L, { title: t.title }),
49
+ /* @__PURE__ */ C(b, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
50
+ r && /* @__PURE__ */ n(H, {}),
51
+ !r && v && /* @__PURE__ */ n(
52
52
  j,
53
53
  {
54
54
  agreements: d,
@@ -58,7 +58,7 @@ const K = {
58
58
  translations: t
59
59
  }
60
60
  ),
61
- !n && _ && /* @__PURE__ */ o(
61
+ !r && _ && /* @__PURE__ */ n(
62
62
  D,
63
63
  {
64
64
  AgreementIcon: k,
@@ -68,7 +68,7 @@ const K = {
68
68
  translations: t
69
69
  }
70
70
  ),
71
- !n && x && /* @__PURE__ */ o(
71
+ !r && x && /* @__PURE__ */ n(
72
72
  G,
73
73
  {
74
74
  currency: l,
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutSummary.d.ts","sourceRoot":"","sources":["../../src/CheckoutSummary/CheckoutSummary.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE5E,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,8DAA8D,CAAC;AAEtE,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,oEAAoE,CAAC;AAI5E,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,oEAAoE,CAAC;AAC5E,OAAO,EAEL,KAAK,kCAAkC,EACxC,MAAM,0EAA0E,CAAC;AAClF,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,kEAAkE,CAAC;AAG1E,QAAA,MAAM,mBAAmB;;CAExB,CAAC;AAEF,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC;IACjE,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE;QACN,WAAW,CAAC,EAAE,WAAW,CAAC,+BAA+B,CAAC,CAAC;QAC3D,IAAI,CAAC,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC;KACvC,CAAC;IACF,SAAS,CAAC,EAAE;QACV,WAAW,CAAC,EAAE,SAAS,CACrB,cAAc,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAC1E,CAAC;QACF,IAAI,CAAC,EAAE,SAAS,CACd,cAAc,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAC1E,CAAC;KACH,CAAC;IACF,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC,YAAY,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,CAAC,GACpD,4BAA4B,CAAC,cAAc,CAAC,GAC5C,gCAAgC,CAAC,cAAc,CAAC,GAChD,+BAA+B,CAAC,cAAc,CAAC,GAC/C,kCAAkC,CAAC,cAAc,CAAC,GAClD,8BAA8B,CAAC,cAAc,CAAC,GAC9C,+BAA+B,CAAC,cAAc,CAAC,CAAC;CACnD;AAMD,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,qDA8I1D,CAAC"}
1
+ {"version":3,"file":"CheckoutSummary.d.ts","sourceRoot":"","sources":["../../src/CheckoutSummary/CheckoutSummary.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE5E,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,8DAA8D,CAAC;AAEtE,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,oEAAoE,CAAC;AAI5E,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,oEAAoE,CAAC;AAC5E,OAAO,EAEL,KAAK,kCAAkC,EACxC,MAAM,0EAA0E,CAAC;AAClF,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,kEAAkE,CAAC;AAG1E,QAAA,MAAM,mBAAmB;;CAExB,CAAC;AAEF,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC;IACjE,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE;QACN,WAAW,CAAC,EAAE,WAAW,CAAC,+BAA+B,CAAC,CAAC;QAC3D,IAAI,CAAC,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC;KACvC,CAAC;IACF,SAAS,CAAC,EAAE;QACV,WAAW,CAAC,EAAE,SAAS,CACrB,cAAc,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAC1E,CAAC;QACF,IAAI,CAAC,EAAE,SAAS,CACd,cAAc,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAC1E,CAAC;KACH,CAAC;IACF,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC,YAAY,CAAC,EAAE,WAAW,CAAC,OAAO,mBAAmB,CAAC,GACpD,4BAA4B,CAAC,cAAc,CAAC,GAC5C,gCAAgC,CAAC,cAAc,CAAC,GAChD,+BAA+B,CAAC,cAAc,CAAC,GAC/C,kCAAkC,CAAC,cAAc,CAAC,GAClD,8BAA8B,CAAC,cAAc,CAAC,GAC9C,+BAA+B,CAAC,cAAc,CAAC,CAAC;CACnD;AAMD,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,qDAgJ1D,CAAC"}
@@ -1,4 +1,4 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
2
  import { Box as M } from "@afosto/components";
3
3
  import { useCheckout as D } from "../CheckoutStateProvider/CheckoutStateProvider.js";
4
4
  import { resolveSlotProps as y } from "../utils/resolveSlotProps.js";
@@ -22,9 +22,9 @@ const N = {
22
22
  const {
23
23
  disableCouponModifications: m,
24
24
  hideDefaultAgreementOption: f = !0,
25
- hideTitle: g = !1,
26
- locale: o,
27
- slots: S = {},
25
+ hideTitle: S = !1,
26
+ locale: e,
27
+ slots: g = {},
28
28
  slotProps: c = {},
29
29
  summary: C,
30
30
  titleTypographyProps: k = {},
@@ -37,78 +37,78 @@ const N = {
37
37
  } = D(), a = K(
38
38
  m
39
39
  ) ? m : F?.disableCouponModifications, t = C || T, u = (t?.agreements || [] || []).filter(
40
- (n) => n.type?.toLowerCase() === "down_payment" && n.originalPercentage > 0 && n.originalPercentage < 100
40
+ (n) => n.type?.toLowerCase() === "down_payment" && (!n.isPercentage || n.isPercentage && n.amount > 0 && n.amount < 100)
41
41
  ), l = u.length > 0, V = (t?.adjustments || []).length > 0, j = (t?.coupons || []).length > 0, x = (t?.items || []).length > 0, r = {
42
42
  ...N,
43
43
  ...b?.summary || {},
44
44
  ...P || {}
45
45
  }, d = {
46
46
  ...Q,
47
- ...S
47
+ ...g
48
48
  }, p = d.item, w = y({}, c.item, {}), A = d.couponField, I = y(
49
49
  {},
50
50
  c.couponField,
51
51
  {}
52
52
  );
53
53
  return /* @__PURE__ */ i(M, { ...v, children: [
54
- !g && /* @__PURE__ */ e(
54
+ !S && /* @__PURE__ */ o(
55
55
  G,
56
56
  {
57
57
  titleTypographyProps: k,
58
58
  translations: { title: r.title }
59
59
  }
60
60
  ),
61
- x && /* @__PURE__ */ e(s, { disablePadding: !0, sx: { overflow: "auto" }, children: /* @__PURE__ */ e(
61
+ x && /* @__PURE__ */ o(s, { disablePadding: !0, sx: { overflow: "auto" }, children: /* @__PURE__ */ o(
62
62
  B,
63
63
  {
64
64
  currency: t?.currency,
65
- locale: o,
65
+ locale: e,
66
66
  items: t?.items,
67
67
  slots: p ? { item: p } : {},
68
68
  slotProps: { item: { ...w, currency: t?.currency } }
69
69
  }
70
70
  ) }),
71
- !a && /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(A, { ...I, translations: r }) }),
71
+ !a && /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(A, { ...I, translations: r }) }),
72
72
  /* @__PURE__ */ i(s, { children: [
73
- /* @__PURE__ */ e(
73
+ /* @__PURE__ */ o(
74
74
  E,
75
75
  {
76
76
  currency: t?.currency,
77
77
  isVatShifted: t?.isVatShifted,
78
- locale: o,
78
+ locale: e,
79
79
  value: t?.subtotal,
80
80
  translations: r
81
81
  }
82
82
  ),
83
- /* @__PURE__ */ e(
83
+ /* @__PURE__ */ o(
84
84
  L,
85
85
  {
86
86
  currency: t?.currency,
87
87
  fees: t?.fees?.shipping,
88
- locale: o,
88
+ locale: e,
89
89
  translations: r
90
90
  }
91
91
  ),
92
- /* @__PURE__ */ e(
92
+ /* @__PURE__ */ o(
93
93
  O,
94
94
  {
95
95
  currency: t?.currency,
96
96
  fees: t?.fees?.payment,
97
- locale: o,
97
+ locale: e,
98
98
  translations: r
99
99
  }
100
100
  )
101
101
  ] }),
102
102
  (V || j) && /* @__PURE__ */ i(s, { children: [
103
- /* @__PURE__ */ e(
103
+ /* @__PURE__ */ o(
104
104
  _,
105
105
  {
106
106
  adjustments: t?.adjustments,
107
107
  currency: t?.currency,
108
- locale: o
108
+ locale: e
109
109
  }
110
110
  ),
111
- /* @__PURE__ */ e(
111
+ /* @__PURE__ */ o(
112
112
  q,
113
113
  {
114
114
  coupons: t?.coupons,
@@ -116,26 +116,26 @@ const N = {
116
116
  }
117
117
  )
118
118
  ] }),
119
- /* @__PURE__ */ e(s, { divider: l, children: /* @__PURE__ */ e(
119
+ /* @__PURE__ */ o(s, { divider: l, children: /* @__PURE__ */ o(
120
120
  H,
121
121
  {
122
122
  currency: t?.currency,
123
123
  isIncludingVat: t?.isIncludingVat,
124
124
  isVatShifted: t?.isVatShifted,
125
- locale: o,
125
+ locale: e,
126
126
  total: t?.total,
127
127
  totalExcludingVat: t?.totalExcludingVat,
128
128
  translations: r,
129
129
  vat: t?.vat
130
130
  }
131
131
  ) }),
132
- l && /* @__PURE__ */ e(s, { divider: !1, children: /* @__PURE__ */ e(
132
+ l && /* @__PURE__ */ o(s, { divider: !1, children: /* @__PURE__ */ o(
133
133
  J,
134
134
  {
135
135
  agreementTemplate: t?.agreementTemplate,
136
136
  agreements: u,
137
137
  currency: t?.currency,
138
- locale: o,
138
+ locale: e,
139
139
  hideDefaultAgreementOption: f,
140
140
  translations: r
141
141
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutSummaryAgreements.d.ts","sourceRoot":"","sources":["../../../../src/CheckoutSummary/components/CheckoutSummaryAgreements/CheckoutSummaryAgreements.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EACV,wBAAwB,EACxB,8BAA8B,EAC/B,MAAM,gBAAgB,CAAC;AAGxB,QAAA,MAAM,mBAAmB;;CAExB,CAAC;AAEF,MAAM,WAAW,8BACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,UAAU,CAAC;IACnD,iBAAiB,CAAC,EAAE,8BAA8B,GAAG,IAAI,CAAC;IAC1D,UAAU,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,yBAAyB,GACpC,OAAO,8BAA8B,4DAmDtC,CAAC"}
1
+ {"version":3,"file":"CheckoutSummaryAgreements.d.ts","sourceRoot":"","sources":["../../../../src/CheckoutSummary/components/CheckoutSummaryAgreements/CheckoutSummaryAgreements.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EACV,wBAAwB,EACxB,8BAA8B,EAC/B,MAAM,gBAAgB,CAAC;AAIxB,QAAA,MAAM,mBAAmB;;CAExB,CAAC;AAEF,MAAM,WAAW,8BACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,UAAU,CAAC;IACnD,iBAAiB,CAAC,EAAE,8BAA8B,GAAG,IAAI,CAAC;IAC1D,UAAU,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,mBAAmB,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,yBAAyB,GACpC,OAAO,8BAA8B,4DA6DtC,CAAC"}
@@ -1,38 +1,45 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { CheckoutSummaryGroup as h } from "../CheckoutSummaryGroup/CheckoutSummaryGroup.js";
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { CheckoutSummaryGroup as C } from "../CheckoutSummaryGroup/CheckoutSummaryGroup.js";
3
3
  import { CheckoutSummaryRow as T } from "../CheckoutSummaryRow/CheckoutSummaryRow.js";
4
- import { useCheckout as k } from "../../../CheckoutStateProvider/CheckoutStateProvider.js";
5
- const v = {
4
+ import { useCheckout as v } from "../../../CheckoutStateProvider/CheckoutStateProvider.js";
5
+ import { formatCurrency as A } from "../../../utils/formatCurrency.js";
6
+ const P = {
6
7
  payImmediately: "Pay immediately"
7
- }, w = (a) => {
8
+ }, b = (m) => {
8
9
  const {
9
- agreementTemplate: o,
10
- agreements: m,
11
- currency: n,
12
- disablePadding: s = !0,
13
- divider: i = !1,
14
- hideDefaultAgreementOption: l = !0,
15
- locale: u,
16
- translations: c = {},
10
+ agreementTemplate: n,
11
+ agreements: s,
12
+ currency: t,
13
+ disablePadding: u = !0,
14
+ divider: c = !1,
15
+ hideDefaultAgreementOption: i = !0,
16
+ locale: r,
17
+ translations: l = {},
17
18
  ...p
18
- } = a, { summary: t, translations: d } = k(), y = {
19
- ...v,
20
- ...d?.summary || {},
21
- ...c || {}
22
- }, g = o ?? t?.agreementTemplate, f = m || t?.agreements || [];
23
- return l && g?.type?.toLowerCase() === "default" ? null : /* @__PURE__ */ r(
24
- h,
19
+ } = m, {
20
+ settings: d,
21
+ summary: o,
22
+ translations: y
23
+ } = v(), { currency: f } = d || {}, h = {
24
+ ...P,
25
+ ...y?.summary || {},
26
+ ...l || {}
27
+ }, g = n ?? o?.agreementTemplate, k = s || o?.agreements || [];
28
+ return i && g?.type?.toLowerCase() === "default" ? null : /* @__PURE__ */ a(
29
+ C,
25
30
  {
26
31
  ...p,
27
- disablePadding: s,
28
- divider: i,
29
- children: f.map((e) => /* @__PURE__ */ r(
32
+ disablePadding: u,
33
+ divider: c,
34
+ children: k.map((e) => /* @__PURE__ */ a(
30
35
  T,
31
36
  {
32
- currency: n,
33
- locale: u,
34
- description: `${y.payImmediately} (${e.originalPercentage}%)`,
35
- value: e.amount
37
+ currency: t,
38
+ locale: r,
39
+ description: `${h.payImmediately} (${e.isPercentage ? `${e.amount}%` : A(e.amount / 100, r, {
40
+ currency: t || f
41
+ })})`,
42
+ value: e.outcome?.amount || 0
36
43
  },
37
44
  e.type
38
45
  ))
@@ -40,5 +47,5 @@ const v = {
40
47
  );
41
48
  };
42
49
  export {
43
- w as CheckoutSummaryAgreements
50
+ b as CheckoutSummaryAgreements
44
51
  };
@@ -17,6 +17,7 @@ export declare const addressDefaultValues: {
17
17
  thoroughfare: string;
18
18
  locality: string;
19
19
  dependentLocality: string;
20
+ salutation: string;
20
21
  sortingCode: string;
21
22
  administrativeArea: null;
22
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"addressDefaultValues.d.ts","sourceRoot":"","sources":["../../src/constants/addressDefaultValues.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;CAqBhC,CAAC"}
1
+ {"version":3,"file":"addressDefaultValues.d.ts","sourceRoot":"","sources":["../../src/constants/addressDefaultValues.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;CAsBhC,CAAC"}
@@ -17,6 +17,7 @@ const e = {
17
17
  thoroughfare: "",
18
18
  locality: "",
19
19
  dependentLocality: "",
20
+ salutation: "",
20
21
  sortingCode: "",
21
22
  administrativeArea: null
22
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"addressFields.d.ts","sourceRoot":"","sources":["../../src/constants/addressFields.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,UAU1C,CAAC;AAEF,eAAO,MAAM,+BAA+B,UAQ3C,CAAC;AAEF,eAAO,MAAM,0BAA0B;;CAEtC,CAAC;AAEF,eAAO,MAAM,6BAA6B,YAOzC,CAAC;AAEF,eAAO,MAAM,iCAAiC,YAK7C,CAAC;AAEF,eAAO,MAAM,+BAA+B,YAM3C,CAAC;AAEF,eAAO,MAAM,2BAA2B,YAMvC,CAAC;AAEF,eAAO,MAAM,2BAA2B,UAAiB,CAAC;AAE1D,eAAO,MAAM,4BAA4B,UAKxC,CAAC;AAEF,eAAO,MAAM,sBAAsB,oJACgH,CAAC"}
1
+ {"version":3,"file":"addressFields.d.ts","sourceRoot":"","sources":["../../src/constants/addressFields.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,UAU1C,CAAC;AAEF,eAAO,MAAM,+BAA+B,UAQ3C,CAAC;AAEF,eAAO,MAAM,0BAA0B;;CAEtC,CAAC;AAEF,eAAO,MAAM,6BAA6B,YAOzC,CAAC;AAEF,eAAO,MAAM,iCAAiC,YAK7C,CAAC;AAEF,eAAO,MAAM,+BAA+B,YAM3C,CAAC;AAEF,eAAO,MAAM,2BAA2B,YAMvC,CAAC;AAEF,eAAO,MAAM,2BAA2B,UAAiB,CAAC;AAE1D,eAAO,MAAM,4BAA4B,UAMxC,CAAC;AAEF,eAAO,MAAM,sBAAsB,oJACgH,CAAC"}
@@ -18,14 +18,14 @@ const e = [
18
18
  "locality"
19
19
  ], i = {
20
20
  city: "locality"
21
- }, _ = [
21
+ }, n = [
22
22
  ["organisation"],
23
23
  ["given_name", "additional_name", "family_name"],
24
24
  ["thoroughfare", "premise_number", "premise_number_suffix"],
25
25
  ["address_line_2"],
26
26
  ["postal_code", "locality"],
27
27
  ["administrative_area"]
28
- ], n = [
28
+ ], _ = [
29
29
  ["organisation"],
30
30
  ["given_name", "additional_name", "family_name"],
31
31
  ["address_line_2"],
@@ -46,7 +46,8 @@ const e = [
46
46
  "givenName",
47
47
  "familyName",
48
48
  "organisation",
49
- "country"
49
+ "country",
50
+ "salutation"
50
51
  ], t = `{organisation}
51
52
  {given_name} {family_name}
52
53
  {thoroughfare} {premise_number} {premise_number_suffix}
@@ -55,9 +56,9 @@ const e = [
55
56
  export {
56
57
  e as ADDRESS_DEFAULT_ALLOWED_FIELDS,
57
58
  a as ADDRESS_DEFAULT_REQUIRED_FIELDS,
58
- _ as ADDRESS_FIELDS_DEFAULT_FORMAT,
59
+ n as ADDRESS_FIELDS_DEFAULT_FORMAT,
59
60
  m as ADDRESS_FIELDS_FORMAT_MACAO,
60
- n as ADDRESS_FIELDS_FORMAT_NETHERLANDS,
61
+ _ as ADDRESS_FIELDS_FORMAT_NETHERLANDS,
61
62
  o as ADDRESS_FIELDS_FORMAT_SINGAPORE,
62
63
  r as ADDRESS_FIELDS_REGEX_FORMAT,
63
64
  i as ADDRESS_FIELD_TYPE_MAPPING,
@@ -1,5 +1,8 @@
1
1
  import * as yup from 'yup';
2
- export declare const baseAddressSchema: {
2
+ export declare const getBaseAddressSchema: (options?: {
3
+ isSalutationRequired?: boolean;
4
+ salutation?: boolean;
5
+ }) => {
3
6
  givenName: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
4
7
  additionalName: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
5
8
  familyName: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
@@ -13,8 +16,12 @@ export declare const baseAddressSchema: {
13
16
  administrativeArea: yup.ObjectSchema<{} | null, yup.AnyObject, {}, "">;
14
17
  thoroughfare: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
15
18
  locality: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
19
+ salutation?: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, ""> | undefined;
16
20
  };
17
- export declare const addressValidationSchema: {
21
+ export declare const getAddressValidationSchema: (options?: {
22
+ isSalutationRequired?: boolean;
23
+ salutation?: boolean;
24
+ }) => {
18
25
  givenName: yup.StringSchema<string, yup.AnyObject, undefined, "">;
19
26
  additionalName: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
20
27
  familyName: yup.StringSchema<string, yup.AnyObject, undefined, "">;
@@ -28,5 +35,6 @@ export declare const addressValidationSchema: {
28
35
  administrativeArea: yup.ObjectSchema<{} | null, yup.AnyObject, {}, "">;
29
36
  thoroughfare: yup.StringSchema<string, yup.AnyObject, undefined, "">;
30
37
  locality: yup.StringSchema<string, yup.AnyObject, undefined, "">;
38
+ salutation?: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, ""> | undefined;
31
39
  };
32
40
  //# sourceMappingURL=addressValidationSchema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addressValidationSchema.d.ts","sourceRoot":"","sources":["../../src/constants/addressValidationSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAM3B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;CA0D7B,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;CAcnC,CAAC"}
1
+ {"version":3,"file":"addressValidationSchema.d.ts","sourceRoot":"","sources":["../../src/constants/addressValidationSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAM3B,eAAO,MAAM,oBAAoB,GAAI,UAAU;IAC7C,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;;;;;;;;;;;;;;;CAqEA,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,UAAU;IACnD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;;;;;;;;;;;;;;;CAyBA,CAAC"}