@tesouro/embedded-components-react 0.5.18 → 0.5.20

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 (146) hide show
  1. package/README.md +22 -21
  2. package/dist/index.css +18 -0
  3. package/dist/index.d.ts +29 -6
  4. package/dist/index.js +1 -1
  5. package/dist/lib/BillPayWidget.js +1 -1
  6. package/dist/lib/CardDetailsWidget.d.ts +20 -2
  7. package/dist/lib/CreditCardsWidget.d.ts +29 -6
  8. package/dist/lib/DebitCardsWidget.d.ts +29 -6
  9. package/dist/lib/WidgetSuite.d.ts +29 -6
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +2 -1
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +9 -9
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +4 -91
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +78 -83
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +98 -3
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +3 -49
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +47 -136
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +136 -33
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +33 -187
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +188 -75
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +75 -21
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +22 -232
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +223 -210
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +202 -108
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +126 -13
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -47
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +47 -53
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +49 -202
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +202 -31
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +32 -234
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +240 -19
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +19 -434
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +436 -4
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -38
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +35 -231
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +235 -3
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -4
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +2 -44
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +46 -1
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -8
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -10
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +10 -110
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +112 -3
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -127
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -8
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -7
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -46
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +43 -18
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -28
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +27 -82
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +83 -47
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +47 -250
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +239 -104
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +110 -206
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +213 -3
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +4 -8
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +6 -113
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +115 -1
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +0 -24
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +25 -0
  60. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js +152 -149
  61. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index3.js +8 -11
  62. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index4.js +1 -1
  63. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +2 -0
  64. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index7.js +4 -4
  65. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index9.js +81 -79
  66. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +39 -38
  67. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/AddressLine.js +23 -0
  68. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +142 -118
  69. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +24 -14
  70. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +4 -1
  71. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +1 -0
  72. package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/PerTransactionMaximumControl.js +17 -16
  73. package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/SpendLimitControl.js +25 -24
  74. package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/CardControls/limitDecimalPlaces.js +7 -0
  75. package/dist/libs/tesouro-embedded-components-react/create-card-widget/ui/dist/lib/CreateCardWidget/SetupView.js +1 -1
  76. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +2 -2
  77. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index.js +1 -1
  78. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index10.js +6 -6
  79. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index11.js +3 -0
  80. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index12.js +7 -7
  81. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index13.js +24 -0
  82. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index14.js +7 -7
  83. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index15.js +7 -7
  84. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index16.js +1 -1
  85. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index17.js +7 -7
  86. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index18.js +6 -6
  87. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index19.js +7 -7
  88. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index2.js +10 -0
  89. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index20.js +1 -1
  90. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index21.js +7 -7
  91. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index22.js +6 -6
  92. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index23.js +7 -7
  93. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index3.js +4 -4
  94. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index4.js +29 -0
  95. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index5.js +10 -0
  96. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index6.js +10 -0
  97. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index7.js +7 -7
  98. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index8.js +6 -6
  99. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index9.js +6 -6
  100. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index10.js +1 -1
  101. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index11.js +4 -4
  102. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index12.js +9 -9
  103. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index13.js +1 -1
  104. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index14.js +6 -6
  105. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index15.js +8 -8
  106. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index16.js +5 -5
  107. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index17.js +11 -11
  108. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index2.js +10 -0
  109. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index3.js +1 -1
  110. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index4.js +2 -2
  111. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index5.js +1 -1
  112. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index6.js +1 -1
  113. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index7.js +3 -3
  114. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index8.js +1 -1
  115. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index9.js +1 -1
  116. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index10.js +5 -5
  117. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index11.js +1 -1
  118. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index12.js +4 -4
  119. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index13.js +1 -1
  120. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index14.js +2 -2
  121. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index15.js +4 -4
  122. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index16.js +5 -5
  123. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index17.js +4 -4
  124. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index18.js +2 -2
  125. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index2.js +1 -1
  126. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index3.js +2 -2
  127. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index4.js +2 -2
  128. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index5.js +3 -3
  129. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index6.js +1 -1
  130. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index7.js +2 -2
  131. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index8.js +4 -4
  132. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index9.js +1 -1
  133. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +12 -1
  134. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  135. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/card/cardPresentation.js +1 -1
  136. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  137. package/package.json +1 -1
  138. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index11.js +0 -3
  139. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index13.js +0 -24
  140. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index2.js +0 -10
  141. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index4.js +0 -29
  142. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index5.js +0 -10
  143. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index6.js +0 -10
  144. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index2.js +0 -9
  145. /package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index.js +0 -0
  146. /package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index.js +0 -0
@@ -1,100 +1,95 @@
1
1
  import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
2
  import { derivePayableStatus as t } from "./index7.js";
3
- import { resolveVendor as n } from "./index8.js";
4
- import { resolveAmountDueMinorUnits as r } from "./index21.js";
5
- import { maskAccountNumber as i } from "./index23.js";
6
- import { formatBillMoney as a } from "./index2.js";
7
- import { resolveLineItemAmountMinorUnits as o } from "./index40.js";
8
- import { getPaidAtLabel as s } from "./index41.js";
3
+ import { resolveVendor as n, resolveVendorName as r } from "./index8.js";
4
+ import { formatBillMoney as i } from "./index2.js";
5
+ import { resolveLineItemAmountMinorUnits as a } from "./index40.js";
6
+ import { resolveLineItemQuantity as o } from "./index41.js";
9
7
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js
10
- function c({ payable: c, lineItems: l, glCodeOptions: u, glCodeRosterAvailable: d = !0, history: f, paymentHistory: p, approvalPolicy: m, labels: h, hasScheduledPayment: g, rejection: _, payableAchInstructions: v, payableAchInstructionsReadable: y = !1 }) {
11
- let b = c.currency, x = t({
12
- apiStatus: c.status,
13
- dueDate: c.due_date,
14
- scheduledPaymentDate: c.scheduled_payment_date,
15
- hasScheduledPayment: g
16
- }), S = n(c), C = y ? v : void 0, w = C?.account_number, T = !!(C?.account_holder_name && C.routing_number && C.account_number), E = e(c.issued_at) || h.notProvided, D = e(c.due_date) || h.notProvided, O = new Map(u.map((e) => [e.value, e.label])), k = [
8
+ function s({ payable: s, lineItems: l, ledgerAccounts: u, labels: d, hasScheduledPayment: f, now: p, rejection: m, achInstructions: h, achInstructionsReadable: g = !1 }) {
9
+ let _ = s.currency, v = (e) => i(e, _), y = t({
10
+ apiStatus: s.status,
11
+ dueDate: s.due_date,
12
+ scheduledPaymentDate: s.scheduled_payment_date,
13
+ hasScheduledPayment: f,
14
+ now: p
15
+ }), b = n(s), x = r(s), S = e(s.issued_at) || d.notProvided, C = e(s.due_date) || d.notProvided, w = [{
16
+ label: d.vendorRow,
17
+ value: x || d.notProvided,
18
+ secondaryValue: b?.email ?? void 0
19
+ }], T = g ? h?.account_number : void 0;
20
+ T && w.push({
21
+ label: d.bankAccountRow,
22
+ value: d.bankAccountValue(T.slice(-4))
23
+ });
24
+ let E = [
25
+ {
26
+ label: d.invoiceNumberRow,
27
+ value: s.document_id || d.notProvided
28
+ },
17
29
  {
18
- label: h.subtotalRow,
19
- minorUnits: c.subtotal
30
+ label: d.issueDateRow,
31
+ value: S
20
32
  },
21
33
  {
22
- label: h.discountRow,
23
- minorUnits: c.discount
34
+ label: d.dueDateRow,
35
+ value: C
24
36
  },
25
37
  {
26
- label: h.taxRow,
27
- minorUnits: c.tax_amount
38
+ label: d.poNumberRow,
39
+ value: d.notProvided
28
40
  }
29
- ].map((e) => ({
30
- label: e.label,
31
- value: a(e.minorUnits, b)
32
- })).filter((e) => !!e.value), A = a(c.total_amount, b);
41
+ ], D = new Map(u.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), O = l.map((e) => {
42
+ let t = v(e.unit_price), n = String(o(e));
43
+ return {
44
+ id: e.id,
45
+ description: e.name ?? e.description ?? "",
46
+ glCodeLabel: (e.ledger_account_id ? D.get(e.ledger_account_id) : void 0) || d.glCodeMissing,
47
+ quantityLabel: t ? d.quantityValue(n, t) : d.quantityOnlyValue(n),
48
+ amountLabel: v(a(e)) ?? ""
49
+ };
50
+ }), k = [
51
+ {
52
+ label: d.subtotalRow,
53
+ value: s.subtotal
54
+ },
55
+ {
56
+ label: d.discountsRow,
57
+ value: s.discount
58
+ },
59
+ {
60
+ label: d.taxRow,
61
+ value: s.tax_amount
62
+ }
63
+ ].map(({ label: e, value: t }) => ({
64
+ label: e,
65
+ value: v(t)
66
+ })).filter((e) => !!e.value), A = v(s.total_amount);
33
67
  A && k.push({
34
- label: h.totalRow,
68
+ label: d.totalRow,
35
69
  value: A,
36
70
  emphasis: !0
37
71
  });
38
- let j = s(c);
72
+ let j = c(s);
39
73
  return {
40
- amountDue: a(r(c), b) ?? "",
41
- amountPaid: j ? a(c.amount_paid, b) : void 0,
42
- paidOnLabel: j ? h.paidOnLabel(j) : void 0,
43
- invoiceDateLabel: E,
44
- dueDateLabel: D,
45
- dueDateTone: x.isOverdue ? "danger" : "default",
46
- status: x.status,
47
- statusTone: x.tone,
48
- payTo: {
49
- name: S?.name || h.notProvided,
50
- email: S?.email ?? "",
51
- methodLabel: T ? h.paymentInstructionsValue(w?.slice(-4) ?? "") : h.paymentInstructionsNotSet,
52
- fields: T ? [
53
- {
54
- label: h.accountHolderFieldLabel,
55
- value: C?.account_holder_name ?? ""
56
- },
57
- {
58
- label: h.routingNumberFieldLabel,
59
- value: C?.routing_number ?? ""
60
- },
61
- {
62
- label: h.accountNumberFieldLabel,
63
- value: w ?? "",
64
- maskedValue: i(w ?? void 0)
65
- }
66
- ] : []
67
- },
68
- invoiceFields: [
69
- {
70
- label: h.invoiceDateRow,
71
- value: E
72
- },
73
- {
74
- label: h.dueDateRow,
75
- value: D
76
- },
77
- {
78
- label: h.invoiceNumberRow,
79
- value: c.document_id || h.notProvided
80
- }
81
- ],
82
- lineItems: l.map((e) => {
83
- let t = a(e.unit_price, b);
84
- return {
85
- id: e.id,
86
- description: e.name ?? e.description ?? "",
87
- glCodeLabel: e.ledger_account_id ? O.get(e.ledger_account_id) ?? (d ? h.glCodeMissing : h.glCodeUnavailable) : h.glCodeMissing,
88
- qtyPriceLabel: e.quantity != null && t ? h.qtyPriceValue(String(e.quantity), t) : "",
89
- amount: a(o(e), b) ?? ""
90
- };
91
- }),
92
- amountRows: k,
93
- approvalPolicy: m,
94
- paymentHistory: p,
95
- history: f,
96
- rejection: _
74
+ title: x,
75
+ subtitle: d.subtitle,
76
+ status: y.status,
77
+ statusTone: y.tone,
78
+ amountDueLabel: v(s.amount_due) ?? v(s.total_amount) ?? "",
79
+ amountPaidLabel: j ? v(s.amount_paid) : void 0,
80
+ paidOnLabel: j ? d.paidOnLabel(j) : void 0,
81
+ invoiceDateLabel: S,
82
+ dueDateLabel: C,
83
+ dueDateTone: y.isOverdue ? "danger" : "default",
84
+ payToItems: w,
85
+ invoiceItems: E,
86
+ lineItems: O,
87
+ totals: k,
88
+ rejection: m
97
89
  };
98
90
  }
91
+ function c(t) {
92
+ return t.status === "paid" && t.paid_at ? e(t.paid_at.slice(0, 10)) : void 0;
93
+ }
99
94
  //#endregion
100
- export { c as buildBillDetailView };
95
+ export { c as getPaidAtLabel, s as mapPayableToBillDetails };
@@ -1,6 +1,101 @@
1
+ import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
+ import { derivePayableStatus as t } from "./index7.js";
3
+ import { resolveVendor as n } from "./index8.js";
4
+ import { resolveAmountDueMinorUnits as r } from "./index21.js";
5
+ import { maskAccountNumber as i } from "./index23.js";
6
+ import { formatBillMoney as a } from "./index2.js";
7
+ import { resolveLineItemAmountMinorUnits as o } from "./index40.js";
8
+ import { resolveLineItemQuantity as s } from "./index41.js";
9
+ import { getPaidAtLabel as c } from "./index42.js";
1
10
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js
2
- function e({ isUnsavedPromptOpen: e, isLocked: t, isDirty: n }) {
3
- return e ? "dismiss-prompt" : !t && n ? "prompt" : "close";
11
+ function l({ payable: l, lineItems: u, glCodeOptions: d, glCodeRosterAvailable: f = !0, history: p, paymentHistory: m, approvalPolicy: h, labels: g, hasScheduledPayment: _, rejection: v, payableAchInstructions: y, payableAchInstructionsReadable: b = !1 }) {
12
+ let x = l.currency, S = t({
13
+ apiStatus: l.status,
14
+ dueDate: l.due_date,
15
+ scheduledPaymentDate: l.scheduled_payment_date,
16
+ hasScheduledPayment: _
17
+ }), C = n(l), w = b ? y : void 0, T = w?.account_number, E = !!(w?.account_holder_name && w.routing_number && w.account_number), D = e(l.issued_at) || g.notProvided, O = e(l.due_date) || g.notProvided, k = new Map(d.map((e) => [e.value, e.label])), A = [
18
+ {
19
+ label: g.subtotalRow,
20
+ minorUnits: l.subtotal
21
+ },
22
+ {
23
+ label: g.discountRow,
24
+ minorUnits: l.discount
25
+ },
26
+ {
27
+ label: g.taxRow,
28
+ minorUnits: l.tax_amount
29
+ }
30
+ ].map((e) => ({
31
+ label: e.label,
32
+ value: a(e.minorUnits, x)
33
+ })).filter((e) => !!e.value), j = a(l.total_amount, x);
34
+ j && A.push({
35
+ label: g.totalRow,
36
+ value: j,
37
+ emphasis: !0
38
+ });
39
+ let M = c(l);
40
+ return {
41
+ amountDue: a(r(l), x) ?? "",
42
+ amountPaid: M ? a(l.amount_paid, x) : void 0,
43
+ paidOnLabel: M ? g.paidOnLabel(M) : void 0,
44
+ invoiceDateLabel: D,
45
+ dueDateLabel: O,
46
+ dueDateTone: S.isOverdue ? "danger" : "default",
47
+ status: S.status,
48
+ statusTone: S.tone,
49
+ payTo: {
50
+ name: C?.name || g.notProvided,
51
+ email: C?.email ?? "",
52
+ methodLabel: E ? g.paymentInstructionsValue(T?.slice(-4) ?? "") : g.paymentInstructionsNotSet,
53
+ fields: E ? [
54
+ {
55
+ label: g.accountHolderFieldLabel,
56
+ value: w?.account_holder_name ?? ""
57
+ },
58
+ {
59
+ label: g.routingNumberFieldLabel,
60
+ value: w?.routing_number ?? ""
61
+ },
62
+ {
63
+ label: g.accountNumberFieldLabel,
64
+ value: T ?? "",
65
+ maskedValue: i(T ?? void 0)
66
+ }
67
+ ] : []
68
+ },
69
+ invoiceFields: [
70
+ {
71
+ label: g.invoiceDateRow,
72
+ value: D
73
+ },
74
+ {
75
+ label: g.dueDateRow,
76
+ value: O
77
+ },
78
+ {
79
+ label: g.invoiceNumberRow,
80
+ value: l.document_id || g.notProvided
81
+ }
82
+ ],
83
+ lineItems: u.map((e) => {
84
+ let t = a(e.unit_price, x), n = String(s(e));
85
+ return {
86
+ id: e.id,
87
+ description: e.name ?? e.description ?? "",
88
+ glCodeLabel: e.ledger_account_id ? k.get(e.ledger_account_id) ?? (f ? g.glCodeMissing : g.glCodeUnavailable) : g.glCodeMissing,
89
+ qtyPriceLabel: t ? g.qtyPriceValue(n, t) : g.qtyOnlyValue(n),
90
+ amount: a(o(e), x) ?? ""
91
+ };
92
+ }),
93
+ amountRows: A,
94
+ approvalPolicy: h,
95
+ paymentHistory: m,
96
+ history: p,
97
+ rejection: v
98
+ };
4
99
  }
5
100
  //#endregion
6
- export { e as resolveEditorDismissal };
101
+ export { l as buildBillDetailView };
@@ -1,52 +1,6 @@
1
- import { derivePayableStatus as e } from "./index7.js";
2
- import { BILL_STATUS_BADGE_LABELS_EN as t } from "../../ui/dist/index17.js";
3
- import "../../ui/dist/index.js";
4
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js
5
- var n = /* @__PURE__ */ new Set([
6
- "credit_note_linked",
7
- "credit_note_unlinked",
8
- "line_item_added",
9
- "line_item_updated",
10
- "line_item_removed",
11
- "deleted"
12
- ]);
13
- function r(n, r, i) {
14
- switch (n) {
15
- case "payable_created": return r?.source_of_payable_data === "ocr" ? i.billUploaded : i.billAdded;
16
- case "payable_updated": return i.billUpdated;
17
- case "file_attached": return i.attachmentAdded;
18
- case "submitted_for_approval": return i.submittedForApproval;
19
- case "approval_requested": return i.approvalRequested;
20
- case "approval_action": {
21
- let e = r?.action, t = r?.reject_reason;
22
- return e === "approve" ? i.approved : e === "reject" ? typeof t == "string" && t ? i.rejectedWithReason(t) : i.rejected : void 0;
23
- }
24
- case "auto_approved": return i.autoApproved;
25
- case "reopened": return i.reopened;
26
- case "marked_as_paid": return i.markedAsPaid;
27
- case "marked_as_partially_paid": return i.markedAsPartiallyPaid;
28
- case "payment_reverted": return i.paymentReverted;
29
- case "status_changed": {
30
- let n = r?.new_status;
31
- if (typeof n != "string") return;
32
- let a = e({ apiStatus: n }).status;
33
- return i.statusChanged(t[a] ?? t.unknown);
34
- }
35
- default: return;
36
- }
37
- }
38
- function i(e, t, i) {
39
- let a = new Map(t.map((e) => [e.id, e.name]));
40
- return e.filter((e) => !n.has(e.event_type)).map((e) => {
41
- let t = r(e.event_type, e.event_data, i);
42
- if (!t) return;
43
- let n = e.entity_user_id ? a.get(e.entity_user_id) : void 0;
44
- return {
45
- id: e.id,
46
- dateLabel: i.dateLabel(e.timestamp),
47
- description: n ? i.byActor(t, n) : t
48
- };
49
- }).filter((e) => !!e);
2
+ function e({ isUnsavedPromptOpen: e, isLocked: t, isDirty: n }) {
3
+ return e ? "dismiss-prompt" : !t && n ? "prompt" : "close";
50
4
  }
51
5
  //#endregion
52
- export { i as buildBillHistory };
6
+ export { e as resolveEditorDismissal };
@@ -1,141 +1,52 @@
1
+ import { derivePayableStatus as e } from "./index7.js";
2
+ import { BILL_STATUS_BADGE_LABELS_EN as t } from "../../ui/dist/index17.js";
3
+ import "../../ui/dist/index.js";
1
4
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js
2
- var e = {
3
- edit: "Edit bill",
4
- payBill: "Pay bill",
5
- markAsPaid: "Mark as paid",
6
- reject: "Reject",
7
- approve: "Approve",
8
- cancel: "Cancel bill",
9
- cancelScheduledPayment: "Cancel scheduled payment",
10
- reopen: "Reopen bill",
11
- forceApprove: "Approve",
12
- forceReject: "Reject",
13
- policyOverridesHeading: "Policy overrides",
14
- decisionDialog: {
15
- reject: {
16
- title: "Reject this bill?",
17
- description: "The bill goes back as rejected and nobody else is asked to approve it.",
18
- confirmButton: "Reject bill",
19
- reason: {
20
- label: "Reason",
21
- placeholder: "Tell the submitter what needs to change",
22
- optionalHint: "Optional"
23
- }
24
- },
25
- cancel: {
26
- title: "Cancel this bill?",
27
- description: "Cancelling is permanent. The bill can't be reopened, edited, or paid afterwards.",
28
- confirmButton: "Cancel bill"
29
- },
30
- cancelScheduledPayment: {
31
- title: "Cancel this scheduled payment?",
32
- description: "The payment will not be sent. The bill stays ready to pay, so you can schedule it again for another date.",
33
- confirmButton: "Cancel payment"
34
- },
35
- forceApprove: {
36
- title: "Override approval policy?",
37
- description: "The below people haven't approved this bill yet. Approving now will bypass their required review. This will be recorded in the audit history and can't be undone.",
38
- confirmButton: "Override and approve",
39
- noApprovalPolicy: {
40
- title: "Approve this bill?",
41
- description: "This bill has no approval policy applied. Approving now will be recorded in the audit history and can't be undone.",
42
- confirmButton: "Approve bill"
43
- }
44
- },
45
- forceReject: {
46
- title: "Override approval policy?",
47
- description: "The below people haven't approved this bill yet. Rejecting now will bypass their required review. This will be recorded in the audit history and can't be undone.",
48
- confirmButton: "Override and reject",
49
- noApprovalPolicy: {
50
- title: "Reject this bill?",
51
- description: "This bill has no approval policy applied. Rejecting now will be recorded in the audit history and can't be undone.",
52
- confirmButton: "Reject bill"
53
- }
54
- },
55
- cancelButton: "Cancel"
56
- },
57
- actionError: "Couldn't update this bill. Try again.",
58
- actionSuccess: {
59
- approve: "Bill approved.",
60
- reject: "Bill rejected.",
61
- markAsPaid: "Bill marked as paid.",
62
- cancel: "Bill canceled.",
63
- cancelScheduledPayment: "Scheduled payment canceled.",
64
- reopen: "Bill reopened.",
65
- forceApprove: "Bill approved, overriding the approval policy.",
66
- forceReject: "Bill rejected, overriding the approval policy.",
67
- forceApproveNoApprovalPolicy: "Bill approved.",
68
- forceRejectNoApprovalPolicy: "Bill rejected."
69
- }
70
- }, t = (e) => `Payment scheduled for ${e}`, n = [
71
- "reject",
72
- "cancel",
73
- "cancelScheduledPayment",
74
- "forceApprove",
75
- "forceReject"
76
- ];
77
- function r(e, t) {
78
- let n = e.reason ? {
79
- ...e.reason,
80
- ...t?.reason
81
- } : void 0, r = e.noApprovalPolicy ? {
82
- ...e.noApprovalPolicy,
83
- ...t?.noApprovalPolicy
84
- } : void 0, i = {
85
- ...e,
86
- ...t,
87
- reason: n,
88
- noApprovalPolicy: r
89
- };
90
- return n || delete i.reason, r || delete i.noApprovalPolicy, i;
91
- }
92
- function i(e, t) {
93
- let i = {
94
- ...e,
95
- ...t
96
- };
97
- for (let a of n) i[a] = r(e[a], t?.[a]);
98
- return i;
99
- }
100
- function a(t) {
101
- let n = e;
102
- return {
103
- ...n,
104
- ...t,
105
- decisionDialog: i(n.decisionDialog, t?.decisionDialog),
106
- actionSuccess: {
107
- ...n.actionSuccess,
108
- ...t?.actionSuccess
5
+ var n = /* @__PURE__ */ new Set([
6
+ "credit_note_linked",
7
+ "credit_note_unlinked",
8
+ "line_item_added",
9
+ "line_item_updated",
10
+ "line_item_removed",
11
+ "deleted"
12
+ ]);
13
+ function r(n, r, i) {
14
+ switch (n) {
15
+ case "payable_created": return r?.source_of_payable_data === "ocr" ? i.billUploaded : i.billAdded;
16
+ case "payable_updated": return i.billUpdated;
17
+ case "file_attached": return i.attachmentAdded;
18
+ case "submitted_for_approval": return i.submittedForApproval;
19
+ case "approval_requested": return i.approvalRequested;
20
+ case "approval_action": {
21
+ let e = r?.action, t = r?.reject_reason;
22
+ return e === "approve" ? i.approved : e === "reject" ? typeof t == "string" && t ? i.rejectedWithReason(t) : i.rejected : void 0;
109
23
  }
110
- };
111
- }
112
- var o = {
113
- paymentHistorySentLabel: "Payment sent",
114
- paymentHistoryScheduledLabel: "Payment scheduled",
115
- paymentHistoryCanceledLabel: "Payment canceled",
116
- paymentHistoryOtherLabel: "Payment",
117
- paymentHistoryMethodSuffix: (e, t) => `${e} via ${t}`,
118
- paymentHistoryOverpaidLabel: (e) => `+${e} overpaid`,
119
- paymentHistoryMarkedPaidExternalLabel: "Marked as paid manually",
120
- paymentHistoryMarkedPaidLabel: "Marked as paid",
121
- paymentHistoryPartiallyPaidExternalLabel: "Partial payment marked manually",
122
- paymentHistoryPartiallyPaidLabel: "Partial payment",
123
- paymentHistoryRevertedLabel: "Payment reverted",
124
- paymentHistoryMethodLabels: {
125
- ach: "ACH",
126
- us_ach: "ACH",
127
- wire: "Wire",
128
- check: "Check",
129
- paper_check: "Check",
130
- bank_account: "Bank transfer",
131
- card: "Card"
24
+ case "auto_approved": return i.autoApproved;
25
+ case "reopened": return i.reopened;
26
+ case "marked_as_paid": return i.markedAsPaid;
27
+ case "marked_as_partially_paid": return i.markedAsPartiallyPaid;
28
+ case "payment_reverted": return i.paymentReverted;
29
+ case "status_changed": {
30
+ let n = r?.new_status;
31
+ if (typeof n != "string") return;
32
+ let a = e({ apiStatus: n }).status;
33
+ return i.statusChanged(t[a] ?? t.unknown);
34
+ }
35
+ default: return;
132
36
  }
133
- };
134
- function s(e) {
135
- return {
136
- ...o.paymentHistoryMethodLabels,
137
- ...e
138
- };
37
+ }
38
+ function i(e, t, i) {
39
+ let a = new Map(t.map((e) => [e.id, e.name]));
40
+ return e.filter((e) => !n.has(e.event_type)).map((e) => {
41
+ let t = r(e.event_type, e.event_data, i);
42
+ if (!t) return;
43
+ let n = e.entity_user_id ? a.get(e.entity_user_id) : void 0;
44
+ return {
45
+ id: e.id,
46
+ dateLabel: i.dateLabel(e.timestamp),
47
+ description: n ? i.byActor(t, n) : t
48
+ };
49
+ }).filter((e) => !!e);
139
50
  }
140
51
  //#endregion
141
- export { e as BILL_DETAIL_ACTIONS_LABELS_EN, o as PAYMENT_HISTORY_LABELS_EN, t as SCHEDULED_SUMMARY_LABEL_EN, a as mergeBillDetailActionsLabels, i as mergeDecisionDialogCopy, s as mergePaymentHistoryMethodLabels };
52
+ export { i as buildBillHistory };