@tesouro/embedded-components-react 0.2.336 → 0.2.337

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 (96) hide show
  1. package/dist/index.css +22 -0
  2. package/dist/index.js +1 -1
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +6 -2
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +2 -2
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +1 -0
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +185 -180
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +98 -97
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +6 -107
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +19 -8
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +57 -38
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +3 -8
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +107 -88
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +8 -159
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +43 -5
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +4 -4
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +93 -108
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +180 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +4 -24
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +8 -0
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +115 -0
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +1 -0
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +25 -0
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +2 -2
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +34 -26
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +2 -16
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +18 -2
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +1 -41
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +38 -269
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +272 -1
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +2 -9
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +7 -47
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +49 -2
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +2 -22
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +20 -284
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +286 -2
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +2 -16
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +13 -117
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +120 -2
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +2 -10
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +8 -94
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +96 -2
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +1 -12
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +11 -56
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +57 -1
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +1 -53
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +51 -136
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +141 -1
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +2 -7
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +5 -42
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +44 -2
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +2 -4
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +2 -61
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +63 -2
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +2 -4
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +2 -14
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +16 -2
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +1 -73
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +72 -250
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +251 -12
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +9 -252
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +1 -10
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +6 -4
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +43 -87
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +2 -0
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +14 -2
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +278 -5
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +8 -28
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +8 -2
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +91 -5
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +1 -1
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +15 -9
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +101 -94
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +3 -14
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +28 -8
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +2 -170
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +7 -2
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +32 -12
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +2 -89
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +12 -2
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +106 -0
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +2 -0
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +18 -0
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +10 -0
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +170 -0
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +2 -0
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +14 -0
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +89 -0
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +2 -0
  92. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  93. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
  94. package/dist/packages/shared-ui-shadcn/dist/index.js +1378 -1371
  95. package/package.json +1 -1
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +0 -34
package/dist/index.css CHANGED
@@ -15,12 +15,15 @@
15
15
  --ttw-color-red-950: oklch(25.8% 0.092 26.042);
16
16
  --ttw-color-orange-50: oklch(98% 0.016 73.684);
17
17
  --ttw-color-orange-100: oklch(95.4% 0.038 75.164);
18
+ --ttw-color-orange-200: oklch(90.1% 0.076 70.697);
19
+ --ttw-color-orange-300: oklch(83.7% 0.128 66.29);
18
20
  --ttw-color-orange-400: oklch(75% 0.183 55.934);
19
21
  --ttw-color-orange-700: oklch(55.3% 0.195 38.402);
20
22
  --ttw-color-orange-950: oklch(26.6% 0.079 36.259);
21
23
  --ttw-color-amber-50: oklch(98.7% 0.022 95.277);
22
24
  --ttw-color-amber-100: oklch(96.2% 0.059 95.617);
23
25
  --ttw-color-amber-200: oklch(92.4% 0.12 95.746);
26
+ --ttw-color-amber-300: oklch(87.9% 0.169 91.605);
24
27
  --ttw-color-amber-600: oklch(66.6% 0.179 58.318);
25
28
  --ttw-color-amber-700: oklch(55.5% 0.163 48.998);
26
29
  --ttw-color-amber-800: oklch(47.3% 0.137 46.201);
@@ -2165,6 +2168,9 @@
2165
2168
  .ttw\:border-amber-200 {
2166
2169
  border-color: var(--ttw-color-amber-200);
2167
2170
  }
2171
+ .ttw\:border-amber-300 {
2172
+ border-color: var(--ttw-color-amber-300);
2173
+ }
2168
2174
  .ttw\:border-background {
2169
2175
  border-color: var(--ttw-background);
2170
2176
  }
@@ -2231,6 +2237,9 @@
2231
2237
  .ttw\:border-orange-100 {
2232
2238
  border-color: var(--ttw-color-orange-100);
2233
2239
  }
2240
+ .ttw\:border-orange-300 {
2241
+ border-color: var(--ttw-color-orange-300);
2242
+ }
2234
2243
  .ttw\:border-orange-400 {
2235
2244
  border-color: var(--ttw-color-orange-400);
2236
2245
  }
@@ -2516,6 +2525,9 @@
2516
2525
  .ttw\:bg-orange-100 {
2517
2526
  background-color: var(--ttw-color-orange-100);
2518
2527
  }
2528
+ .ttw\:bg-orange-200 {
2529
+ background-color: var(--ttw-color-orange-200);
2530
+ }
2519
2531
  .ttw\:bg-orange-700 {
2520
2532
  background-color: var(--ttw-color-orange-700);
2521
2533
  }
@@ -5525,6 +5537,9 @@
5525
5537
  .ttw\:sm\:max-w-180 {
5526
5538
  max-width: calc(var(--ttw-spacing) * 180);
5527
5539
  }
5540
+ .ttw\:sm\:max-w-208\.75 {
5541
+ max-width: calc(var(--ttw-spacing) * 208.75);
5542
+ }
5528
5543
  .ttw\:sm\:max-w-\[423px\] {
5529
5544
  max-width: 423px;
5530
5545
  }
@@ -5569,6 +5584,9 @@
5569
5584
  border-left-style: var(--tw-border-style);
5570
5585
  border-left-width: 1px;
5571
5586
  }
5587
+ .ttw\:sm\:text-center {
5588
+ text-align: center;
5589
+ }
5572
5590
  .ttw\:sm\:text-left {
5573
5591
  text-align: left;
5574
5592
  }
@@ -6112,6 +6130,10 @@
6112
6130
  width: calc(var(--ttw-spacing) * 4);
6113
6131
  height: calc(var(--ttw-spacing) * 4);
6114
6132
  }
6133
+ .ttw\:\[\&\>svg\]\:size-6 > svg {
6134
+ width: calc(var(--ttw-spacing) * 6);
6135
+ height: calc(var(--ttw-spacing) * 6);
6136
+ }
6115
6137
  .ttw\:\[\&\>svg\]\:shrink-0 > svg {
6116
6138
  flex-shrink: 0;
6117
6139
  }
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import "./lib/AcceptDisclosuresWidget.js";
16
16
  import { BankAccountsWidget as C } from "./libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js";
17
17
  import "./lib/BankAccountsWidget.js";
18
18
  import { CounterpartsWidget as w } from "./libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js";
19
- import { BillPayWidget as T } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js";
19
+ import { BillPayWidget as T } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js";
20
20
  import "./lib/BillPayWidget.js";
21
21
  import { CardDetailsWidget as E } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js";
22
22
  import { CardFormatValue as D } from "./libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index3.js";
@@ -1,3 +1,3 @@
1
- import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js";
1
+ import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js";
2
2
  import "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js";
3
3
  export { e as BillPayWidget };
@@ -15,10 +15,14 @@ import "./index48.js";
15
15
  import "./index49.js";
16
16
  import "./index50.js";
17
17
  import "./index51.js";
18
+ import "./index52.js";
18
19
  import "./index53.js";
19
20
  import "./index54.js";
20
21
  import "./index55.js";
21
- import "./index56.js";
22
22
  import "./index57.js";
23
- import { BillPayWidget as e } from "./index61.js";
23
+ import "./index58.js";
24
+ import "./index59.js";
25
+ import "./index60.js";
26
+ import "./index61.js";
27
+ import { BillPayWidget as e } from "./index65.js";
24
28
  export { e as BillPayWidget };
@@ -5,8 +5,8 @@
5
5
  import { resolveAmountDueMinorUnits as e } from "./index2.js";
6
6
  import { resolveVendor as t } from "./index3.js";
7
7
  import { payBillFlowTestIds as n } from "./index4.js";
8
- import { ReviewTransactionDialog as r } from "../../ui/dist/index67.js";
9
- import { SchedulePaymentDialog as i } from "../../ui/dist/index71.js";
8
+ import { ReviewTransactionDialog as r } from "../../ui/dist/index76.js";
9
+ import { SchedulePaymentDialog as i } from "../../ui/dist/index80.js";
10
10
  import "../../ui/dist/index.js";
11
11
  import { usePayBillFlow as a } from "./index9.js";
12
12
  import { useImperativeHandle as o } from "react";
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { SourceDocumentPanel as e } from "../../ui/dist/index74.js";
5
+ import { SourceDocumentPanel as e } from "../../ui/dist/index83.js";
6
6
  import "../../ui/dist/index.js";
7
7
  import { useAttachPayableFileMutation as t, useDeletePayableFileMutation as n } from "../../data-access/dist/index10.js";
8
8
  import "../../data-access/dist/index.js";
@@ -4,6 +4,7 @@ var e = {
4
4
  vendorSection: "bill-pay-bill-create-vendor",
5
5
  lineItems: "bill-pay-bill-create-line-items",
6
6
  documentPanel: "bill-pay-bill-create-document",
7
+ duplicateNotice: "bill-pay-bill-create-duplicate-notice",
7
8
  decisionDialog: "bill-pay-bill-decision-dialog",
8
9
  decisionConfirm: "bill-pay-bill-decision-confirm",
9
10
  decisionReason: "bill-pay-bill-decision-reason"
@@ -10,212 +10,217 @@ import "../../../shared/data-access/dist/index.js";
10
10
  import { formatCalendarDate as ne } from "../../../shared/util/dist/lib/formatCalendarDate.js";
11
11
  import { useWidgetConfig as re } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
12
12
  import "../../../shared/feature/dist/index.js";
13
- import { resolveVendor as ie } from "./index3.js";
14
- import { BillCreateScreen as ae } from "../../ui/dist/index40.js";
15
- import { BillDecisionDialog as oe } from "../../ui/dist/index46.js";
16
- import { ExtractionNotice as se } from "../../ui/dist/index61.js";
13
+ import { resolveVendor as n } from "./index3.js";
14
+ import { BillCreateScreen as ie } from "../../ui/dist/index41.js";
15
+ import { BillDecisionDialog as r } from "../../ui/dist/index47.js";
16
+ import { BillDuplicateNotice as ae } from "../../ui/dist/index57.js";
17
+ import { ExtractionNotice as oe } from "../../ui/dist/index70.js";
17
18
  import "../../ui/dist/index.js";
18
- import { usePayableHistoryQuery as ce } from "../../data-access/dist/index6.js";
19
- import { useAllPayableLineItemsQuery as le } from "../../data-access/dist/index7.js";
20
- import { usePayableQuery as ue } from "../../data-access/dist/index13.js";
19
+ import { usePayableHistoryQuery as se } from "../../data-access/dist/index6.js";
20
+ import { useAllPayableLineItemsQuery as ce } from "../../data-access/dist/index7.js";
21
+ import { usePayableQuery as le } from "../../data-access/dist/index13.js";
21
22
  import "../../data-access/dist/index.js";
22
- import { PayBillFlow as de } from "./index10.js";
23
+ import { PayBillFlow as ue } from "./index10.js";
23
24
  import "./index11.js";
24
- import { mergeBillCreateScreenCopy as fe } from "./index26.js";
25
- import { useBillCreateController as pe } from "./index34.js";
26
- import { useBillForm as n } from "./index36.js";
27
- import { useApprovalPolicyCardView as r } from "./index15.js";
25
+ import { mergeBillCreateScreenCopy as de } from "./index26.js";
26
+ import { useBillCreateController as fe } from "./index34.js";
27
+ import { useBillForm as pe } from "./index36.js";
28
+ import { useApprovalPolicyCardView as me } from "./index15.js";
28
29
  import { useCurrentApprovalRequestId as i } from "./index16.js";
29
- import { usePayableDetailActions as a } from "./index18.js";
30
- import { useScheduledPayment as o } from "./index19.js";
31
- import { buildBillDetailView as s } from "./index22.js";
32
- import { buildBillHistory as me } from "./index23.js";
33
- import { SourceDocumentContainer as he } from "./index27.js";
34
- import { useVendorSectionProps as ge } from "./index29.js";
35
- import { usePaymentInstructionsForm as _e } from "./index30.js";
36
- import { billCreateTestIds as c } from "./index37.js";
37
- import { useCallback as l, useEffect as ve, useMemo as u, useRef as ye, useState as d } from "react";
38
- import { Fragment as be, jsx as f, jsxs as xe } from "react/jsx-runtime";
30
+ import { usePayableDetailActions as he } from "./index18.js";
31
+ import { useScheduledPayment as ge } from "./index19.js";
32
+ import { buildBillDetailView as _e } from "./index22.js";
33
+ import { buildBillHistory as ve } from "./index23.js";
34
+ import { SourceDocumentContainer as ye } from "./index27.js";
35
+ import { useVendorSectionProps as be } from "./index29.js";
36
+ import { usePaymentInstructionsForm as xe } from "./index30.js";
37
+ import { billCreateTestIds as a } from "./index37.js";
38
+ import { useCallback as o, useEffect as Se, useMemo as s, useRef as Ce, useState as c } from "react";
39
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
39
40
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js
40
- function Se(e) {
41
+ function we(e) {
41
42
  return !!(e?.bank_account?.account_holder_name && e.bank_account.routing_number && e.bank_account.account_number);
42
43
  }
43
- function p({ open: p, onOpenChange: m, payableId: h, readOnly: g = !1, copy: _, poweredByBankName: Ce }) {
44
- let v = u(() => fe(_), [_]), [y, b] = d(), [x, S] = d(!1), [C, w] = d(!1), [T, E] = d(), D = h ?? T, O = ue(D, { pollWhileOcrProcessing: !0 }), k = le(D), A = ee(), j = O.data, M = n({
45
- payable: j,
46
- lineItems: k.lineItems
47
- }), N = j?.counterpart_id;
48
- ve(() => {
49
- x || N && (b(N), S(!0));
50
- }, [x, N]);
51
- let we = l((e) => {
52
- S(!0), b(e);
53
- }, []), P = ge({
54
- payableId: g ? void 0 : D,
55
- counterpartId: g ? void 0 : y,
56
- payableCounterpartId: N,
57
- onCounterpartChange: we,
58
- requiredError: M.errors?.vendor
59
- }), F = pe({
60
- payableId: h,
61
- form: M,
62
- counterpartId: y,
63
- clearCounterpart: !!(D && x) && !y,
64
- prepareVendorForSave: P.savePaymentInstructions,
65
- onPayableCreated: E,
66
- onSaved: E,
67
- onDraftSaved: () => m(!1),
68
- onFinalized: () => m(!1)
69
- }), I = !!(F.isSavingDraft || F.isFinalizing), L = g ? D : void 0, R = i({
70
- payableId: L,
71
- status: j?.status
72
- }), z = ye(null), B = o({
73
- payableId: D,
74
- scheduledPaymentDate: j?.scheduled_payment_date,
75
- enabled: g
76
- }), V = ie(j), H = _e({
77
- payableId: L,
78
- counterpartId: g ? N : void 0,
79
- saveErrorMessage: v.detail.paymentInstructionsSaveError
80
- }), { initResponse: U } = re(), W = e(U?.scopes, [t.CounterpartWriteOrg]) && e(U?.scopes, [t.PayableWriteOrg]), { actions: Te, decisionDialog: Ee } = a({
81
- payableId: L,
82
- status: j?.status,
83
- currentApprovalRequestId: R.id,
84
- isPolicyApprover: R.isPolicyApprover,
85
- hasWaitingRequest: R.hasWaitingRequest,
86
- hasScheduledPayment: B.hasScheduledPayment,
87
- isScheduledPaymentUnknown: B.isResolving,
88
- labels: v.actions,
89
- onPayBillSelect: () => Se(V) || !W ? z.current?.open() : H.open()
90
- }), G = u(() => (A.data?.data ?? []).map((e) => ({
44
+ function f({ open: f, onOpenChange: p, payableId: m, readOnly: h = !1, copy: g, poweredByBankName: Te, isPossibleDuplicate: Ee }) {
45
+ let _ = s(() => de(g), [g]), [v, y] = c(), [b, x] = c(!1), [De, Oe] = c(!1), [S, C] = c(!1), [w, T] = c(), E = m ?? w, D = le(E, { pollWhileOcrProcessing: !0 }), O = ce(E), k = ee(), A = D.data, j = pe({
46
+ payable: A,
47
+ lineItems: O.lineItems
48
+ }), M = A?.counterpart_id;
49
+ Se(() => {
50
+ b || M && (y(M), x(!0));
51
+ }, [b, M]);
52
+ let ke = o((e) => {
53
+ x(!0), y(e);
54
+ }, []), N = be({
55
+ payableId: h ? void 0 : E,
56
+ counterpartId: h ? void 0 : v,
57
+ payableCounterpartId: M,
58
+ onCounterpartChange: ke,
59
+ requiredError: j.errors?.vendor
60
+ }), P = fe({
61
+ payableId: m,
62
+ form: j,
63
+ counterpartId: v,
64
+ clearCounterpart: !!(E && b) && !v,
65
+ prepareVendorForSave: N.savePaymentInstructions,
66
+ onPayableCreated: T,
67
+ onSaved: T,
68
+ onDraftSaved: () => p(!1),
69
+ onFinalized: () => p(!1)
70
+ }), F = !!(P.isSavingDraft || P.isFinalizing), I = h ? E : void 0, L = i({
71
+ payableId: I,
72
+ status: A?.status
73
+ }), R = Ce(null), z = ge({
74
+ payableId: E,
75
+ scheduledPaymentDate: A?.scheduled_payment_date,
76
+ enabled: h
77
+ }), B = n(A), V = xe({
78
+ payableId: I,
79
+ counterpartId: h ? M : void 0,
80
+ saveErrorMessage: _.detail.paymentInstructionsSaveError
81
+ }), { initResponse: H } = re(), U = e(H?.scopes, [t.CounterpartWriteOrg]) && e(H?.scopes, [t.PayableWriteOrg]), { actions: Ae, decisionDialog: je } = he({
82
+ payableId: I,
83
+ status: A?.status,
84
+ currentApprovalRequestId: L.id,
85
+ isPolicyApprover: L.isPolicyApprover,
86
+ hasWaitingRequest: L.hasWaitingRequest,
87
+ hasScheduledPayment: z.hasScheduledPayment,
88
+ isScheduledPaymentUnknown: z.isResolving,
89
+ labels: _.actions,
90
+ onPayBillSelect: () => we(B) || !U ? R.current?.open() : V.open()
91
+ }), W = s(() => (k.data?.data ?? []).map((e) => ({
91
92
  value: e.id,
92
93
  label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
93
- })), [A.data]), K = ce(L), q = e(U?.scopes, [t.UserReadOrg]), J = te({ enabled: g && q }), Y = u(() => me(K.data?.data ?? [], J.data?.data ?? [], v.history), [
94
+ })), [k.data]), G = se(I), Me = e(H?.scopes, [t.UserReadOrg]), K = te({ enabled: h && Me }), q = s(() => ve(G.data?.data ?? [], K.data?.data ?? [], _.history), [
95
+ G.data,
94
96
  K.data,
95
- J.data,
96
- v.history
97
- ]), X = r({
98
- payableId: L,
99
- approvalPolicyId: j?.approval_policy_id,
100
- enabled: g,
101
- copy: v.approvalPolicyCopy
102
- }), De = u(() => g && j ? s({
103
- payable: j,
104
- lineItems: k.lineItems,
105
- glCodeOptions: G,
106
- history: Y,
107
- approvalPolicy: X.view,
108
- labels: v.detail
97
+ _.history
98
+ ]), J = me({
99
+ payableId: I,
100
+ approvalPolicyId: A?.approval_policy_id,
101
+ enabled: h,
102
+ copy: _.approvalPolicyCopy
103
+ }), Ne = s(() => h && A ? _e({
104
+ payable: A,
105
+ lineItems: O.lineItems,
106
+ glCodeOptions: W,
107
+ history: q,
108
+ approvalPolicy: J.view,
109
+ labels: _.detail
109
110
  }) : void 0, [
110
- X.view,
111
- v.detail,
112
- G,
113
- Y,
114
- k.lineItems,
115
- j,
116
- g
117
- ]), Z = j?.source_of_payable_data === "ocr", Q = V?.name, Oe = g ? Q ? v.viewTitle(Q) : v.readOnlyTitle : Z && Q ? v.extractedTitle(Q) : v.newTitle, ke = g && j?.created_at ? v.addedOn(ne(j.created_at.slice(0, 10))) : void 0, $ = l(() => {
118
- let e = M.isDirty || P.hasUnsavedVendorChanges || !!F.stagedFile;
119
- !g && e && !window.confirm(v.discardConfirm) || m(!1);
111
+ J.view,
112
+ _.detail,
113
+ W,
114
+ q,
115
+ O.lineItems,
116
+ A,
117
+ h
118
+ ]), Y = A?.source_of_payable_data === "ocr", X = B?.name, Pe = h ? X ? _.viewTitle(X) : _.readOnlyTitle : Y && X ? _.extractedTitle(X) : _.newTitle, Fe = h && A?.created_at ? _.addedOn(ne(A.created_at.slice(0, 10))) : void 0, Z = o(() => {
119
+ let e = j.isDirty || N.hasUnsavedVendorChanges || !!P.stagedFile;
120
+ !h && e && !window.confirm(_.discardConfirm) || p(!1);
120
121
  }, [
121
- F.stagedFile,
122
- v.discardConfirm,
123
- M.isDirty,
124
- m,
125
- g,
126
- P.hasUnsavedVendorChanges
127
- ]), Ae = l((e) => {
128
- if (!I) return e ? m(!0) : $();
122
+ P.stagedFile,
123
+ _.discardConfirm,
124
+ j.isDirty,
125
+ p,
126
+ h,
127
+ N.hasUnsavedVendorChanges
128
+ ]), Ie = o((e) => {
129
+ if (!F) return e ? p(!0) : Z();
129
130
  }, [
130
- $,
131
- I,
132
- m
133
- ]);
134
- return /* @__PURE__ */ xe(be, { children: [
135
- /* @__PURE__ */ f(ae, {
136
- open: p,
137
- onOpenChange: Ae,
138
- title: Oe,
139
- subtitle: ke,
140
- notice: !g && Z && !C ? /* @__PURE__ */ f(se, { onDismiss: () => w(!0) }) : void 0,
131
+ Z,
132
+ F,
133
+ p
134
+ ]), Q = !!Ee && !S, $ = !h && Y && !De, Le = Q || $ ? /* @__PURE__ */ d(l, { children: [Q ? /* @__PURE__ */ u(ae, {
135
+ onNotADuplicate: h ? void 0 : () => C(!0),
136
+ onRemoveBill: h ? void 0 : () => C(!0),
137
+ testId: a.duplicateNotice
138
+ }) : null, $ ? /* @__PURE__ */ u(oe, { onDismiss: () => Oe(!0) }) : null] }) : void 0;
139
+ return /* @__PURE__ */ d(l, { children: [
140
+ /* @__PURE__ */ u(ie, {
141
+ open: f,
142
+ onOpenChange: Ie,
143
+ title: Pe,
144
+ subtitle: Fe,
145
+ notice: Le,
141
146
  vendor: {
142
- ...P,
143
- testId: c.vendorSection
147
+ ...N,
148
+ testId: a.vendorSection
144
149
  },
145
- values: M.values,
146
- errors: M.errors,
147
- onChange: M.onChange,
150
+ values: j.values,
151
+ errors: j.errors,
152
+ onChange: j.onChange,
148
153
  lineItems: {
149
- items: M.lineItemRows,
150
- glCodeOptions: G,
151
- discount: M.discount,
152
- onDiscountChange: M.onDiscountChange,
153
- tax: M.tax,
154
- onTaxChange: M.onTaxChange,
155
- total: M.total,
156
- onTotalChange: M.onTotalChange,
157
- onAddLineItem: M.onAddLineItem,
158
- errors: M.lineItemErrors,
159
- testId: c.lineItems
154
+ items: j.lineItemRows,
155
+ glCodeOptions: W,
156
+ discount: j.discount,
157
+ onDiscountChange: j.onDiscountChange,
158
+ tax: j.tax,
159
+ onTaxChange: j.onTaxChange,
160
+ total: j.total,
161
+ onTotalChange: j.onTotalChange,
162
+ onAddLineItem: j.onAddLineItem,
163
+ errors: j.lineItemErrors,
164
+ testId: a.lineItems
160
165
  },
161
- documentPanel: /* @__PURE__ */ f(he, {
162
- payableId: D,
163
- readOnly: g,
164
- isDocumentPending: !!D && !j?.file && (O.isLoading || j?.ocr_status === "processing"),
165
- file: j?.file ? {
166
- id: j.file.id,
167
- name: j.file.name,
168
- url: j.file.url,
169
- mimetype: j.file.mimetype
166
+ documentPanel: /* @__PURE__ */ u(ye, {
167
+ payableId: E,
168
+ readOnly: h,
169
+ isDocumentPending: !!E && !A?.file && (D.isLoading || A?.ocr_status === "processing"),
170
+ file: A?.file ? {
171
+ id: A.file.id,
172
+ name: A.file.name,
173
+ url: A.file.url,
174
+ mimetype: A.file.mimetype
170
175
  } : void 0,
171
176
  staging: {
172
- stagedFile: F.stagedFile,
173
- onFileStaged: F.stageFile,
174
- onClearStagedFile: F.clearStagedFile,
175
- isSaving: I
177
+ stagedFile: P.stagedFile,
178
+ onFileStaged: P.stageFile,
179
+ onClearStagedFile: P.clearStagedFile,
180
+ isSaving: F
176
181
  }
177
182
  }),
178
- readOnly: g,
179
- detail: g ? {
180
- view: De,
181
- actions: Te,
182
- scheduledSummary: B.hasScheduledPayment && B.scheduledDateLabel ? v.scheduledSummary(B.scheduledDateLabel) : void 0,
183
- paymentInstructionsForm: N && W ? {
184
- isOpen: H.isOpen,
185
- values: H.values,
186
- errors: H.errors,
187
- isSaving: H.isSaving,
188
- onOpen: H.open,
189
- onCancel: H.close,
190
- onChange: H.onChange,
191
- onSave: H.save
183
+ readOnly: h,
184
+ detail: h ? {
185
+ view: Ne,
186
+ actions: Ae,
187
+ scheduledSummary: z.hasScheduledPayment && z.scheduledDateLabel ? _.scheduledSummary(z.scheduledDateLabel) : void 0,
188
+ paymentInstructionsForm: M && U ? {
189
+ isOpen: V.isOpen,
190
+ values: V.values,
191
+ errors: V.errors,
192
+ isSaving: V.isSaving,
193
+ onOpen: V.open,
194
+ onCancel: V.close,
195
+ onChange: V.onChange,
196
+ onSave: V.save
192
197
  } : void 0,
193
- isLoading: O.isLoading || k.isResolving || A.isResolving,
194
- isError: O.isError || k.isError || A.isError
198
+ isLoading: D.isLoading || O.isResolving || k.isResolving,
199
+ isError: D.isError || O.isError || k.isError
195
200
  } : void 0,
196
- isLineItemsLoading: k.isResolving,
197
- isSaving: I,
198
- isSavingDraft: F.isSavingDraft,
199
- isFinalizing: F.isFinalizing,
200
- onCancel: $,
201
- onSaveDraft: F.saveDraft,
202
- onFinalize: F.finalize,
203
- testId: c.dialog
201
+ isLineItemsLoading: O.isResolving,
202
+ isSaving: F,
203
+ isSavingDraft: P.isSavingDraft,
204
+ isFinalizing: P.isFinalizing,
205
+ onCancel: Z,
206
+ onSaveDraft: P.saveDraft,
207
+ onFinalize: P.finalize,
208
+ testId: a.dialog
204
209
  }),
205
- /* @__PURE__ */ f(oe, {
206
- ...Ee,
207
- labels: { cancelButton: v.actions.decisionDialog.cancelButton },
208
- testId: c.decisionDialog,
209
- confirmTestId: c.decisionConfirm,
210
- reasonTestId: c.decisionReason
210
+ /* @__PURE__ */ u(r, {
211
+ ...je,
212
+ labels: { cancelButton: _.actions.decisionDialog.cancelButton },
213
+ testId: a.decisionDialog,
214
+ confirmTestId: a.decisionConfirm,
215
+ reasonTestId: a.decisionReason
211
216
  }),
212
- g && j ? /* @__PURE__ */ f(de, {
213
- ref: z,
214
- payable: j,
215
- poweredByBankName: Ce,
216
- labels: v.payBill
217
+ h && A ? /* @__PURE__ */ u(ue, {
218
+ ref: R,
219
+ payable: A,
220
+ poweredByBankName: Te,
221
+ labels: _.payBill
217
222
  }) : null
218
223
  ] });
219
224
  }
220
225
  //#endregion
221
- export { p as BillCreateDialog, p as default };
226
+ export { f as BillCreateDialog, f as default };
@@ -1,4 +1,4 @@
1
- import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index51.js";
1
+ import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index52.js";
2
2
  import "../../ui/dist/index.js";
3
3
  import { APPROVAL_POLICY_RULE_COPY_EN as t } from "./index12.js";
4
4
  import { BILL_DETAIL_ACTIONS_LABELS_EN as n, SCHEDULED_SUMMARY_LABEL_EN as r } from "./index24.js";