@tesouro/embedded-components-react 0.4.20 → 0.4.22

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 (179) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/lib/BillPayWidget.js +1 -1
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +12 -12
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +64 -37
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +38 -110
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +104 -73
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +87 -7
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +7 -21
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +17 -22
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +23 -63
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +66 -2
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +2 -77
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +74 -3
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +4 -5
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +5 -4
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +3 -32
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +30 -39
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +37 -166
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +164 -39
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +48 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +1 -50
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +47 -4
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +1 -1
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +7 -7
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +8 -24
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +18 -125
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +135 -16
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +24 -4
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +4 -41
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +39 -87
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +79 -84
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +5 -25
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +95 -48
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +47 -119
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +119 -33
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +33 -177
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +186 -75
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +75 -21
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +22 -232
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +223 -204
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +202 -103
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +121 -13
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +25 -24
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +12 -47
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +47 -31
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +27 -198
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +198 -30
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +30 -234
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +240 -19
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +19 -383
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +416 -4
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +4 -35
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +35 -189
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +21 -57
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +214 -3
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +3 -4
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +2 -44
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +46 -1
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +1 -8
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +6 -10
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +10 -110
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +112 -3
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +3 -127
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +124 -8
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +58 -5
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +8 -7
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +8 -46
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +43 -18
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +20 -28
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +27 -82
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +83 -47
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +47 -250
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +239 -101
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +107 -202
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +209 -3
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +5 -4
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +4 -8
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +6 -113
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +115 -1
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +0 -24
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +25 -0
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +5 -70
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +44 -40
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +170 -2
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +2 -10
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +12 -50
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index103.js +108 -2
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index104.js +2 -0
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index105.js +10 -0
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index106.js +52 -0
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index107.js +2 -0
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +21 -12
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +10 -9
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +11 -16
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +18 -2
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +2 -4
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +2 -28
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +30 -2
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +2 -32
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +32 -1
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +1 -29
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +26 -19
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +20 -152
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +154 -2
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +1 -64
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +61 -253
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +258 -1
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +2 -9
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +7 -47
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +49 -2
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +2 -18
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +15 -47
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +50 -2
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +2 -23
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +21 -338
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +340 -2
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +2 -12
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +9 -97
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +96 -2
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +1 -12
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +11 -57
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +58 -1
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +1 -54
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +52 -10
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +10 -179
  126. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +181 -1
  127. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +2 -4
  128. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +2 -39
  129. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +41 -2
  130. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +2 -7
  131. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +5 -90
  132. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +92 -2
  133. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +2 -4
  134. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +2 -14
  135. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +16 -2
  136. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +1 -88
  137. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +86 -298
  138. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +299 -9
  139. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +13 -1
  140. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -8
  141. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +6 -37
  142. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +39 -2
  143. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +2 -39
  144. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +2 -10
  145. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +30 -195
  146. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +0 -1
  147. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +36 -14
  148. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +10 -345
  149. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +199 -8
  150. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +3 -9
  151. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +15 -91
  152. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +347 -0
  153. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +10 -2
  154. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +7 -123
  155. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +91 -26
  156. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +1 -1
  157. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +123 -5
  158. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +26 -28
  159. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +94 -2
  160. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +2 -7
  161. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +5 -32
  162. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +30 -2
  163. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +2 -12
  164. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +5 -104
  165. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +34 -2
  166. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +2 -17
  167. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +10 -123
  168. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +105 -1
  169. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +2 -18
  170. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +13 -6
  171. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +74 -119
  172. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +1 -1
  173. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +15 -11
  174. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +8 -106
  175. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  176. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/formatRejectionDate.js +11 -0
  177. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  178. package/package.json +1 -1
  179. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +0 -94
@@ -2,123 +2,222 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import "../../../shared/ui/dist/index.js";
7
- import { useUpdatePayableMutation as t } from "../../data-access/dist/index13.js";
8
- import { useCounterpartBankAccountsQuery as n, useCreateCounterpartBankAccountMutation as r } from "../../../shared/counterpart-management/data-access/dist/index5.js";
9
- import { useUpdatePayableCounterpartBankAccountMutation as i } from "../../data-access/dist/index14.js";
5
+ import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
6
+ import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
7
+ import "../../../shared/data-access/dist/index.js";
8
+ import { useWidgetConfig as n } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
9
+ import "../../../shared/feature/dist/index.js";
10
+ import { useCounterpartsQuery as r } from "../../../shared/counterpart-management/data-access/dist/index3.js";
11
+ import { useCreateCounterpartBankAccountMutation as ee, useUpdateCounterpartBankAccountMutation as te } from "../../../shared/counterpart-management/data-access/dist/index5.js";
12
+ import { usePayableSuggestionsQuery as i } from "../../data-access/dist/index17.js";
10
13
  import "../../data-access/dist/index.js";
11
- import { counterpartFormBankAccountToCreatePayload as a, counterpartFormBankAccountToUpdatePayload as o, getAchInstructions as s, isAchCompatibleBankAccount as c, resolveCounterpartBankAccountWrite as l, validateAchFormValues as u } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
14
+ import { maskAccountNumber as a } from "./index22.js";
15
+ import { counterpartFormBankAccountToCreatePayload as ne, counterpartFormBankAccountToUpdatePayload as re, getAchInstructions as ie, getCounterpartEmail as o, getCounterpartName as s, getPayableAchInstructions as c, hasAchFormValues as l, resolveCounterpartBankAccountWrite as ae, validateAchFormValues as oe } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
16
+ import { useCounterpartDetails as se } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
12
17
  import "../../../shared/counterpart-management/feature/dist/index.js";
13
- import { useCallback as d, useEffect as f, useRef as p, useState as m } from "react";
18
+ import { VENDOR_SECTION_PROPS_LABELS_EN as ce } from "./index44.js";
19
+ import { buildVendorPrefill as le } from "./index46.js";
20
+ import { VendorInlineForm as ue } from "./index47.js";
21
+ import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
22
+ import { jsx as de } from "react/jsx-runtime";
14
23
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js
15
- var h = {
24
+ var fe = 10, h = 300, g = {
16
25
  accountHolderName: "",
17
26
  routingNumber: "",
18
27
  accountNumber: ""
19
28
  };
20
- function g(e, t) {
21
- return e?.find((e) => e.id === t && c(e)) ?? s(e);
22
- }
23
- function _({ payableId: c, counterpartId: _, currentBankAccountId: v, canReadCounterpartBankAccounts: y = !0, saveErrorMessage: b, linkErrorMessage: x }) {
24
- let [S, C] = m(!1), [w, T] = m(h), [E, D] = m(), O = n(_, { enabled: y }), k = O.data?.data, A = r(), j = i(), M = t(), N = p(void 0), P = p(!1);
25
- f(() => {
26
- N.current = void 0;
27
- }, [_, c]);
28
- let F = d(() => {
29
- if (S) return;
30
- let e = O.isFetching ? void 0 : g(k, v);
31
- T(e ? {
32
- accountHolderName: e.account_holder_name ?? "",
33
- routingNumber: e.routing_number ?? "",
34
- accountNumber: e.account_number ?? ""
35
- } : h), N.current = e?.id ?? N.current, P.current = !O.isFetching, D(void 0), C(!0);
36
- }, [
37
- k,
38
- O.isFetching,
39
- v,
40
- S
41
- ]);
42
- f(() => {
43
- if (!S || P.current || O.isFetching) return;
44
- P.current = !0;
45
- let e = g(k, v);
46
- e && (T((t) => t.accountHolderName === "" && t.routingNumber === "" && t.accountNumber === "" ? {
47
- accountHolderName: e.account_holder_name ?? "",
48
- routingNumber: e.routing_number ?? "",
49
- accountNumber: e.account_number ?? ""
50
- } : t), N.current = e.id);
29
+ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCounterpartBankAccountId: b, isVendorKnown: x = !0, onCounterpartChange: S, requiredError: pe, extractedVendor: C, labels: me }) {
30
+ let w = {
31
+ ...ce,
32
+ ...me
33
+ }, { initResponse: T } = n(), he = e(T?.scopes, [t.CounterpartReadOrg]), [E, D] = m(""), [ge, _e] = m(""), [O, k] = m(), [ve, A] = m(!1), [j, M] = m(g), N = p(j);
34
+ N.current = j;
35
+ let [P, F] = m(!1), I = l(j) || P, [ye, L] = m(), [R, z] = m(), B = p(v), [V, be] = m(!1), H = u(() => {
36
+ A(!1), M(g), L(void 0), z(void 0);
37
+ }, []), U = u((e) => {
38
+ be(!0), S(e);
39
+ }, [S]), W = i(_, { enabled: !!_ && !v && !y }).data?.suggested_counterpart?.id;
40
+ d(() => {
41
+ !V && !v && !y && W && U(W);
51
42
  }, [
52
- S,
53
- O.isFetching,
54
- k,
55
43
  v,
56
- y
57
- ]);
58
- let I = d(() => {
59
- C(!1);
60
- }, []), L = d((e) => {
61
- T((t) => ({
62
- ...t,
63
- ...e
64
- }));
65
- }, []), R = d(async () => {
66
- if (!c || !_) return !1;
67
- let t = u(w);
68
- if (Object.keys(t).length > 0) return D(t), !1;
69
- if (D(void 0), !y || O.isFetching || O.isError) return e.error(b), !1;
70
- let n = N.current;
71
- try {
72
- let e = l(k, n ?? s(k)?.id);
73
- e.kind === "update" ? (await j.mutateAsync({
74
- path: {
75
- counterpart_id: _,
76
- bank_account_id: e.bankAccountId
44
+ y,
45
+ V,
46
+ W,
47
+ U
48
+ ]), d(() => {
49
+ B.current !== v && (B.current = v, H());
50
+ }, [v, H]), d(() => {
51
+ let e = setTimeout(() => {
52
+ _e(E.trim());
53
+ }, h);
54
+ return () => clearTimeout(e);
55
+ }, [E]);
56
+ let G = r({
57
+ sort: "counterpart_name",
58
+ order: "asc",
59
+ limit: fe,
60
+ counterpart_name__icontains: ge || void 0,
61
+ is_vendor: !0,
62
+ enabled: !O && !v && x && he
63
+ }), K = se({ selectedId: v }), q = ee(), J = te(), Y = f(() => {
64
+ let e = K.counterpart;
65
+ if (!e) return;
66
+ if (K.isBankAccountsLoading) return {
67
+ name: s(e),
68
+ email: o(e),
69
+ methodLabel: w.paymentMethodLoading,
70
+ fields: []
71
+ };
72
+ if (K.isBankAccountsError) return {
73
+ name: s(e),
74
+ email: o(e),
75
+ methodLabel: w.paymentMethodUnavailable,
76
+ fields: []
77
+ };
78
+ let t = c(K.bankAccounts);
79
+ return {
80
+ name: s(e),
81
+ email: o(e),
82
+ methodLabel: t ? w.achMethod : w.noMethod,
83
+ fields: t ? [
84
+ {
85
+ label: w.accountHolder,
86
+ value: t.account_holder_name ?? ""
87
+ },
88
+ {
89
+ label: w.routingNumber,
90
+ value: t.routing_number ?? ""
77
91
  },
78
- body: o(w, { includeAchDefaults: e.includeAchDefaults }),
79
- payableId: c,
80
- makeDefault: e.includeAchDefaults || !k?.find((t) => t.id === e.bankAccountId)?.is_default_for_currency
81
- }), n = e.bankAccountId) : n = (await A.mutateAsync({
82
- path: { counterpart_id: _ },
83
- body: a(w, { isDefaultForCurrency: e.isDefaultForCurrency })
84
- }))?.id, N.current = n;
85
- } catch {
86
- return e.error(b), !1;
87
- }
88
- if (n !== v) try {
89
- await M.mutateAsync({
90
- path: { payable_id: c },
91
- body: { counterpart_bank_account_id: n }
92
- });
93
- } catch {
94
- return e.error(x), !1;
95
- }
96
- return C(!1), !0;
92
+ {
93
+ label: w.accountNumber,
94
+ value: t.account_number ?? "",
95
+ maskedValue: t.account_number ? a(t.account_number) : ""
96
+ }
97
+ ] : []
98
+ };
97
99
  }, [
98
- k,
99
- O.isError,
100
- O.isFetching,
101
- y,
102
- _,
103
- A,
100
+ K.bankAccounts,
101
+ K.counterpart,
102
+ K.isBankAccountsError,
103
+ K.isBankAccountsLoading,
104
+ w
105
+ ]), X = f(() => ie(K.bankAccounts), [K.bankAccounts]), Z = f(() => c(K.bankAccounts)?.id, [K.bankAccounts]), Q = u(async () => {
106
+ let e = N.current;
107
+ if (!v) return { ok: !0 };
108
+ if (!l(e)) return b && v === y ? {
109
+ ok: !0,
110
+ counterpartBankAccountId: b
111
+ } : K.isBankAccountsLoading || K.isBankAccountsFetching || K.isBankAccountsError ? { ok: !1 } : {
112
+ ok: !0,
113
+ counterpartBankAccountId: Z
114
+ };
115
+ if (K.isBankAccountsLoading || K.isBankAccountsFetching || K.isBankAccountsError) return { ok: !1 };
116
+ let t = oe(e);
117
+ if (Object.keys(t).length > 0) return L(t), A(!0), { ok: !1 };
118
+ L(void 0);
119
+ let n = ae(K.bankAccounts, R ?? X?.id);
120
+ if (n.kind === "update") return await J.mutateAsync({
121
+ path: {
122
+ counterpart_id: v,
123
+ bank_account_id: n.bankAccountId
124
+ },
125
+ body: re(e, { includeAchDefaults: n.includeAchDefaults })
126
+ }), z(n.bankAccountId), {
127
+ ok: !0,
128
+ counterpartBankAccountId: n.bankAccountId
129
+ };
130
+ let r = await q.mutateAsync({
131
+ path: { counterpart_id: v },
132
+ body: ne(e, { isDefaultForCurrency: n.isDefaultForCurrency })
133
+ });
134
+ return z(r?.id), {
135
+ ok: !0,
136
+ counterpartBankAccountId: r?.id
137
+ };
138
+ }, [
139
+ X,
104
140
  v,
105
- x,
106
- c,
141
+ q,
142
+ K.bankAccounts,
143
+ K.isBankAccountsError,
144
+ K.isBankAccountsFetching,
145
+ K.isBankAccountsLoading,
146
+ R,
147
+ Z,
107
148
  b,
108
- j,
109
- M,
110
- w
111
- ]);
149
+ y,
150
+ J
151
+ ]), xe = f(() => (G.data?.data ?? []).map((e) => ({
152
+ name: s(e),
153
+ email: o(e),
154
+ onSelect: () => U(e.id)
155
+ })), [G.data, U]), Se = f(() => le(C), [C]), $ = u(() => {
156
+ k(void 0), F(!1);
157
+ }, []), Ce = u((e) => {
158
+ k(void 0), F(!1), U(e);
159
+ }, [U]);
160
+ if (O) return {
161
+ mode: "creating",
162
+ newVendorForm: /* @__PURE__ */ de(ue, {
163
+ mode: O,
164
+ counterpart: O === "edit" ? K.counterpart : void 0,
165
+ primaryAddress: O === "edit" ? K.primaryAddress : void 0,
166
+ bankAccounts: O === "edit" ? K.bankAccounts : void 0,
167
+ isBankAccountsLoading: O === "edit" ? K.isBankAccountsLoading : void 0,
168
+ isBankAccountsError: O === "edit" ? K.isBankAccountsError : void 0,
169
+ initialName: O === "create" ? E : void 0,
170
+ initialValues: O === "create" ? Se : void 0,
171
+ onSaved: Ce,
172
+ onCancel: $,
173
+ onDirtyChange: F
174
+ }),
175
+ onClear: $,
176
+ hasUnsavedVendorChanges: I
177
+ };
178
+ if (Y) {
179
+ let e = K.isBankAccountsLoading || K.isBankAccountsFetching || K.isBankAccountsError;
180
+ return {
181
+ mode: "resolved",
182
+ summary: Y,
183
+ onEdit: e ? void 0 : () => k("edit"),
184
+ onClear: () => U(void 0),
185
+ paymentInstructions: e ? void 0 : {
186
+ isOpen: ve,
187
+ values: j,
188
+ errors: ye,
189
+ onOpen: () => {
190
+ A(!0), X && (M({
191
+ accountHolderName: X.account_holder_name ?? "",
192
+ routingNumber: X.routing_number ?? "",
193
+ accountNumber: X.account_number ?? ""
194
+ }), z(X.id));
195
+ },
196
+ onChange: (e) => {
197
+ M((t) => ({
198
+ ...t,
199
+ ...e
200
+ })), L(void 0);
201
+ }
202
+ },
203
+ savePaymentInstructions: Q,
204
+ hasUnsavedVendorChanges: I
205
+ };
206
+ }
207
+ let we = !x || !T || !!v && K.isLoading;
112
208
  return {
113
- isOpen: S,
114
- values: w,
115
- errors: E,
116
- isSaving: A.isPending || j.isPending || M.isPending,
117
- open: F,
118
- close: I,
119
- onChange: L,
120
- save: R
209
+ mode: "selecting",
210
+ error: G.isError ? w.searchFailed : K.isError ? w.vendorDetailsFailed : pe,
211
+ search: {
212
+ query: E,
213
+ onQueryChange: D,
214
+ isLoading: we || G.isFetching,
215
+ onAddVendor: () => k("create"),
216
+ results: xe
217
+ },
218
+ savePaymentInstructions: Q,
219
+ hasUnsavedVendorChanges: I
121
220
  };
122
221
  }
123
222
  //#endregion
124
- export { _ as usePaymentInstructionsForm };
223
+ export { _ as useVendorSectionProps };
@@ -1,16 +1,124 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import "../../../shared/ui/dist/index.js";
7
+ import { useUpdatePayableMutation as t } from "../../data-access/dist/index13.js";
8
+ import { useCounterpartBankAccountsQuery as n, useCreateCounterpartBankAccountMutation as r } from "../../../shared/counterpart-management/data-access/dist/index5.js";
9
+ import { useUpdatePayableCounterpartBankAccountMutation as i } from "../../data-access/dist/index14.js";
10
+ import "../../data-access/dist/index.js";
11
+ import { counterpartFormBankAccountToCreatePayload as a, counterpartFormBankAccountToUpdatePayload as o, getAchInstructions as s, isAchCompatibleBankAccount as c, resolveCounterpartBankAccountWrite as l, validateAchFormValues as u } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
12
+ import "../../../shared/counterpart-management/feature/dist/index.js";
13
+ import { useCallback as d, useEffect as f, useRef as p, useState as m } from "react";
1
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js
2
- function e(e) {
3
- return new Promise((t, n) => {
4
- let r = new FileReader();
5
- r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to read file")), r.onload = () => {
6
- let e = r.result;
7
- if (typeof e != "string") {
8
- n(/* @__PURE__ */ Error("Failed to read file as a data URL"));
9
- return;
10
- }
11
- t(e.slice(e.indexOf(",") + 1));
12
- }, r.readAsDataURL(e);
13
- });
15
+ var h = {
16
+ accountHolderName: "",
17
+ routingNumber: "",
18
+ accountNumber: ""
19
+ };
20
+ function g(e, t) {
21
+ return e?.find((e) => e.id === t && c(e)) ?? s(e);
22
+ }
23
+ function _({ payableId: c, counterpartId: _, currentBankAccountId: v, canReadCounterpartBankAccounts: y = !0, saveErrorMessage: b, linkErrorMessage: x }) {
24
+ let [S, C] = m(!1), [w, T] = m(h), [E, D] = m(), O = n(_, { enabled: y }), k = O.data?.data, A = r(), j = i(), M = t(), N = p(void 0), P = p(!1);
25
+ f(() => {
26
+ N.current = void 0;
27
+ }, [_, c]);
28
+ let F = d(() => {
29
+ if (S) return;
30
+ let e = O.isFetching ? void 0 : g(k, v);
31
+ T(e ? {
32
+ accountHolderName: e.account_holder_name ?? "",
33
+ routingNumber: e.routing_number ?? "",
34
+ accountNumber: e.account_number ?? ""
35
+ } : h), N.current = e?.id ?? N.current, P.current = !O.isFetching, D(void 0), C(!0);
36
+ }, [
37
+ k,
38
+ O.isFetching,
39
+ v,
40
+ S
41
+ ]);
42
+ f(() => {
43
+ if (!S || P.current || O.isFetching) return;
44
+ P.current = !0;
45
+ let e = g(k, v);
46
+ e && (T((t) => t.accountHolderName === "" && t.routingNumber === "" && t.accountNumber === "" ? {
47
+ accountHolderName: e.account_holder_name ?? "",
48
+ routingNumber: e.routing_number ?? "",
49
+ accountNumber: e.account_number ?? ""
50
+ } : t), N.current = e.id);
51
+ }, [
52
+ S,
53
+ O.isFetching,
54
+ k,
55
+ v,
56
+ y
57
+ ]);
58
+ let I = d(() => {
59
+ C(!1);
60
+ }, []), L = d((e) => {
61
+ T((t) => ({
62
+ ...t,
63
+ ...e
64
+ }));
65
+ }, []), R = d(async () => {
66
+ if (!c || !_) return !1;
67
+ let t = u(w);
68
+ if (Object.keys(t).length > 0) return D(t), !1;
69
+ if (D(void 0), !y || O.isFetching || O.isError) return e.error(b), !1;
70
+ let n = N.current;
71
+ try {
72
+ let e = l(k, n ?? s(k)?.id);
73
+ e.kind === "update" ? (await j.mutateAsync({
74
+ path: {
75
+ counterpart_id: _,
76
+ bank_account_id: e.bankAccountId
77
+ },
78
+ body: o(w, { includeAchDefaults: e.includeAchDefaults }),
79
+ payableId: c,
80
+ makeDefault: e.includeAchDefaults || !k?.find((t) => t.id === e.bankAccountId)?.is_default_for_currency
81
+ }), n = e.bankAccountId) : n = (await A.mutateAsync({
82
+ path: { counterpart_id: _ },
83
+ body: a(w, { isDefaultForCurrency: e.isDefaultForCurrency })
84
+ }))?.id, N.current = n;
85
+ } catch {
86
+ return e.error(b), !1;
87
+ }
88
+ if (n !== v) try {
89
+ await M.mutateAsync({
90
+ path: { payable_id: c },
91
+ body: { counterpart_bank_account_id: n }
92
+ });
93
+ } catch {
94
+ return e.error(x), !1;
95
+ }
96
+ return C(!1), !0;
97
+ }, [
98
+ k,
99
+ O.isError,
100
+ O.isFetching,
101
+ y,
102
+ _,
103
+ A,
104
+ v,
105
+ x,
106
+ c,
107
+ b,
108
+ j,
109
+ M,
110
+ w
111
+ ]);
112
+ return {
113
+ isOpen: S,
114
+ values: w,
115
+ errors: E,
116
+ isSaving: A.isPending || j.isPending || M.isPending,
117
+ open: F,
118
+ close: I,
119
+ onChange: L,
120
+ save: R
121
+ };
14
122
  }
15
123
  //#endregion
16
- export { e as encodeFileToBase64 };
124
+ export { _ as usePaymentInstructionsForm };
@@ -1,26 +1,27 @@
1
- import { suspectedPayableDuplicates as e } from "../../data-access/dist/index7.js";
2
- import "../../data-access/dist/index.js";
3
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js
4
- function t(t) {
5
- let n = new Map(t.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map(), i = (e) => {
6
- let t = r.get(e);
7
- if (t === void 0 || t === e) return e;
8
- let n = i(t);
9
- return r.set(e, n), n;
10
- }, a = (e, t) => {
11
- let n = i(e), a = i(t);
12
- n !== a && r.set(n, a);
13
- };
14
- t.forEach((t) => {
15
- r.set(t.id, r.get(t.id) ?? t.id), e(t).forEach((e) => {
16
- n.has(e.matched_payable_id) && a(t.id, e.matched_payable_id);
17
- });
18
- });
19
- let o = /* @__PURE__ */ new Map();
20
- return t.forEach((e) => {
21
- let t = i(e.id);
22
- o.set(t, [...o.get(t) ?? [], e]);
23
- }), [...o.values()].map((e) => ({ members: [...e].sort((e, t) => (e.created_at ?? "").localeCompare(t.created_at ?? "")) }));
24
- }
2
+ var e = {
3
+ selectRow: ({ vendorLabel: e, invoiceNumberLabel: t, addedOnLabel: n }) => `Select bill — ${e}, invoice ${t}, added ${n}`,
4
+ openRow: ({ vendorLabel: e, invoiceNumberLabel: t, addedOnLabel: n }) => `View bill — ${e}, invoice ${t}, added ${n}`,
5
+ reviewGroup: ({ vendorLabel: e, count: t }) => `${e} — ${t} possible duplicate bills`,
6
+ selectGroup: ({ vendorLabel: e }) => `Select every bill from ${e}`,
7
+ deleteBillButton: "Remove this bill",
8
+ deleteConfirmTitle: "Remove duplicate bill?",
9
+ deleteConfirmDescription: "You can't undo this action.",
10
+ deleteConfirmButton: "Remove duplicate bill",
11
+ deleteConfirmBackButton: "Cancel",
12
+ cancelBillButton: "Cancel this bill",
13
+ confirmBillButton: "Confirm duplicate",
14
+ cancelConfirmTitle: "Cancel duplicate bill?",
15
+ cancelConfirmDescription: "You can't undo this action.",
16
+ cancelConfirmButton: "Cancel this bill",
17
+ cancelConfirmBackButton: "Back",
18
+ deletedToast: "Duplicate removed",
19
+ cancelledToast: "Duplicate cancelled",
20
+ confirmedToast: "Duplicate confirmed",
21
+ dismissedToast: "Marked as “not a duplicate”.",
22
+ removedToast: "Duplicate removed",
23
+ verdictFailedToast: "Couldn't update this duplicate. Try again.",
24
+ allResolvedToast: "All possible duplicates resolved"
25
+ };
25
26
  //#endregion
26
- export { t as groupSuspectedDuplicates };
27
+ export { e as DUPLICATE_BILLS_LABELS_EN };
@@ -1,51 +1,16 @@
1
- import { parseDecimalAmountToMinorUnits as e } from "../../../shared/util/dist/lib/parseDecimalAmountToMinorUnits.js";
2
- import "../../data-access/dist/index.js";
3
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js
4
- var t = "USD";
5
- function n(n) {
6
- return e(n, t);
7
- }
8
- function r(e) {
9
- let t = e.trim();
10
- if (!t) return null;
11
- let n = Number(t);
12
- return Number.isFinite(n) && n > 0 ? n : null;
13
- }
14
- function i(e) {
15
- return !!(e.description.trim() || e.glCode.trim() || n(e.price) !== null || n(e.amount) !== null);
16
- }
17
- function a(e) {
18
- return n(e) ?? 0;
19
- }
20
- function o(e) {
21
- let t = Number.parseFloat(e);
22
- return Number.isFinite(t) ? t : 0;
23
- }
24
- function s(e) {
25
- return (e / 100).toFixed(2);
26
- }
27
- function c({ values: e, counterpartId: r, clearCounterpart: i, counterpartBankAccountId: a, editedTotals: o, document: s }) {
28
- let c = { currency: t };
29
- return r ? c.counterpart_id = r : i && (c.counterpart_id = null), r ? c.counterpart_bank_account_id = a ?? null : i && (c.counterpart_bank_account_id = null), e.invoiceNumber && (c.document_id = e.invoiceNumber), e.invoiceDate && (c.issued_at = e.invoiceDate), e.dueDate && (c.due_date = e.dueDate), s && (c.base64_encoded_file = s.base64EncodedFile, c.file_name = s.fileName), o && (c.discount = n(o.discount) ?? 0, c.tax_amount = n(o.tax) ?? 0, o.total !== void 0 && (c.total_amount = n(o.total) ?? 0)), c;
30
- }
31
- function l(e) {
32
- return e.filter(i).map((e) => {
33
- let t = n(e.amount), i = r(e.quantity) ?? 1, a = n(e.price) ?? (t === null ? 0 : Math.round(t / i)), o = Math.round(i * a);
34
- return {
35
- name: e.description,
36
- quantity: i,
37
- unit_price: a,
38
- tax: 0,
39
- ...t !== null && t !== o ? { subtotal: t } : {},
40
- ...e.glCode ? { ledger_account_id: e.glCode } : {}
41
- };
2
+ function e(e) {
3
+ return new Promise((t, n) => {
4
+ let r = new FileReader();
5
+ r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("Failed to read file")), r.onload = () => {
6
+ let e = r.result;
7
+ if (typeof e != "string") {
8
+ n(/* @__PURE__ */ Error("Failed to read file as a data URL"));
9
+ return;
10
+ }
11
+ t(e.slice(e.indexOf(",") + 1));
12
+ }, r.readAsDataURL(e);
42
13
  });
43
14
  }
44
- function u(e, t) {
45
- return s(Math.round(o(e) * a(t)));
46
- }
47
- function d(e, t, n) {
48
- return s(e.reduce((e, t) => e + a(t.amount), 0) + a(t) - a(n));
49
- }
50
15
  //#endregion
51
- export { d as calculateTotal, u as displayLineAmount, i as isPersistableLineItem, c as mapBillFormToPayload, l as mapLineItemsToPayload, n as parseMoneyToMinorUnits, r as parseQuantity };
16
+ export { e as encodeFileToBase64 };