@tesouro/embedded-components-react 0.5.19 → 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 (122) 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/data-access/dist/index6.js +2 -1
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +9 -9
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +4 -91
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +78 -83
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +98 -3
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +3 -49
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +47 -136
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +136 -33
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +33 -187
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +188 -75
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +75 -21
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +22 -232
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +223 -210
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +202 -108
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +126 -13
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -47
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +47 -53
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +49 -202
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +202 -31
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +32 -234
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +240 -19
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +19 -434
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +436 -4
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -38
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +35 -231
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +235 -3
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -4
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +2 -44
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +46 -1
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -8
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -10
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +10 -110
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +112 -3
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -127
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -8
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -7
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -46
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +43 -18
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -28
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +27 -82
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +83 -47
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +47 -250
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +239 -104
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +110 -206
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +213 -3
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +4 -8
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +6 -113
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +115 -1
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +0 -24
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +25 -0
  53. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +2 -2
  54. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index.js +1 -1
  55. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index10.js +6 -6
  56. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index11.js +3 -0
  57. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index12.js +7 -7
  58. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index13.js +24 -0
  59. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index14.js +7 -7
  60. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index15.js +7 -7
  61. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index16.js +1 -1
  62. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index17.js +7 -7
  63. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index18.js +6 -6
  64. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index19.js +7 -7
  65. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index2.js +10 -0
  66. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index20.js +1 -1
  67. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index21.js +7 -7
  68. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index22.js +6 -6
  69. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index23.js +7 -7
  70. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index3.js +4 -4
  71. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index4.js +29 -0
  72. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index5.js +10 -0
  73. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/data-access/dist/index6.js +10 -0
  74. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index7.js +7 -7
  75. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index8.js +6 -6
  76. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/data-access/dist/index9.js +6 -6
  77. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index10.js +1 -1
  78. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index11.js +4 -4
  79. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index12.js +9 -9
  80. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index13.js +1 -1
  81. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index14.js +6 -6
  82. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index15.js +8 -8
  83. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index16.js +5 -5
  84. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index17.js +11 -11
  85. package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index2.js +10 -0
  86. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index3.js +1 -1
  87. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index4.js +2 -2
  88. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index5.js +1 -1
  89. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index6.js +1 -1
  90. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index7.js +3 -3
  91. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index8.js +1 -1
  92. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index9.js +1 -1
  93. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index10.js +5 -5
  94. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index11.js +1 -1
  95. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index12.js +4 -4
  96. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index13.js +1 -1
  97. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index14.js +2 -2
  98. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index15.js +4 -4
  99. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index16.js +5 -5
  100. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index17.js +4 -4
  101. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index18.js +2 -2
  102. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index2.js +1 -1
  103. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index3.js +2 -2
  104. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index4.js +2 -2
  105. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index5.js +3 -3
  106. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index6.js +1 -1
  107. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index7.js +2 -2
  108. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index8.js +4 -4
  109. package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index9.js +1 -1
  110. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +12 -1
  111. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  112. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  113. package/package.json +1 -1
  114. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index11.js +0 -3
  115. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index13.js +0 -24
  116. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index2.js +0 -10
  117. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index4.js +0 -29
  118. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index5.js +0 -10
  119. package/dist/libs/tesouro-embedded-components-react/team-widget/data-access/dist/index6.js +0 -10
  120. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index2.js +0 -9
  121. /package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/feature/dist/index.js +0 -0
  122. /package/dist/libs/tesouro-embedded-components-react/{team-widget → settings-widget/team}/ui/dist/index.js +0 -0
@@ -1,436 +1,21 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
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 { useAllLedgerAccountsQuery as ee } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
8
- import { useAllOrganizationUsersQuery as te } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
9
- import "../../../shared/data-access/dist/index.js";
10
- import { formatCalendarDate as ne } from "../../../shared/util/dist/lib/formatCalendarDate.js";
11
- import { useWidgetConfig as re } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
12
- import "../../../shared/feature/dist/index.js";
13
- import { usePayableApprovalRequestsQuery as ie } from "../../data-access/dist/index8.js";
14
- import { usePayableHistoryQuery as ae } from "../../data-access/dist/index9.js";
15
- import { useAllPayableLineItemsQuery as oe } from "../../data-access/dist/index10.js";
16
- import { usePayableQuery as se } from "../../data-access/dist/index17.js";
17
- import "../../data-access/dist/index.js";
18
- import { hasUnpaidBalance as ce } from "./index7.js";
19
- import { resolveVendor as le } from "./index8.js";
20
- import { BillCreateScreen as ue } from "../../ui/dist/index50.js";
21
- import { BillDecisionDialog as n } from "../../ui/dist/index56.js";
22
- import { BillDuplicateNotice as de } from "../../ui/dist/index69.js";
23
- import { BillRejectedBanner as fe } from "../../ui/dist/index72.js";
24
- import { ExtractionNotice as pe } from "../../ui/dist/index90.js";
25
- import { MarkAsPaidDialog as me } from "../../ui/dist/index99.js";
26
- import { UnsavedBillDialog as he } from "../../ui/dist/index109.js";
27
- import "../../ui/dist/index.js";
28
- import { usePayableDuplicateReview as ge } from "./index13.js";
29
- import "./index14.js";
30
- import { isEditablePayableStatus as _e } from "./index19.js";
31
- import { canOverrideApprovalPolicy as ve, canReadCounterpartBankAccounts as ye } from "./index20.js";
32
- import { resolveAmountDueMinorUnits as be } from "./index21.js";
33
- import { usePayableAchInstructions as xe } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
34
- import "../../../shared/counterpart-management/feature/dist/index.js";
35
- import { PayBillFlow as Se } from "./index27.js";
36
- import "./index28.js";
37
- import { useMarkAsPaidFlow as Ce } from "./index17.js";
38
- import "./index18.js";
39
- import { BILL_CREATE_MESSAGE_LABELS_EN as we, mergeBillCreateScreenCopy as Te } from "./index47.js";
40
- import { useBillCreateController as Ee } from "./index56.js";
41
- import { useBillForm as De } from "./index58.js";
42
- import { buildPaymentHistory as Oe } from "./index3.js";
43
- import { currentApprovalRound as ke } from "./index4.js";
44
- import { usePayableApprovalRoundStart as Ae } from "./index32.js";
45
- import { useApprovalPolicyCardView as je } from "./index33.js";
46
- import { resolveBillRejectionNotice as Me } from "./index34.js";
47
- import { useCurrentApprovalRequestId as Ne } from "./index35.js";
48
- import { usePayableDetailActions as Pe } from "./index36.js";
49
- import { useScheduledPayment as Fe } from "./index37.js";
50
- import { useDraftDelete as Ie } from "./index38.js";
51
- import { buildBillDetailView as Le } from "./index42.js";
52
- import { resolveEditorDismissal as Re } from "./index43.js";
53
- import { buildBillHistory as ze } from "./index44.js";
54
- import { SourceDocumentContainer as Be } from "./index48.js";
55
- import { useVendorSectionProps as Ve } from "./index51.js";
56
- import { usePaymentInstructionsForm as He } from "./index52.js";
57
- import { billCreateTestIds as r } from "./index59.js";
58
- import { useCallback as i, useEffect as Ue, useMemo as a, useRef as We, useState as o } from "react";
59
- import { Fragment as Ge, jsx as s, jsxs as Ke } from "react/jsx-runtime";
60
- import { Trash2Icon as qe } from "lucide-react";
61
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js
62
- function c({ open: c, onOpenChange: l, payableId: Je, readOnly: u = !1, copy: Ye, onCollapse: Xe, onEdit: Ze, poweredByBankName: Qe }) {
63
- let d = a(() => Te(Ye), [Ye]), [f, $e] = o(), [p, et] = o(!1), [tt, nt] = o(!1), [m, h] = o(!1), [rt, it] = o(), g = Je ?? rt, _ = se(g, { pollWhileOcrProcessing: !0 }), v = oe(g), { initResponse: y } = re(), at = !!y, b = e(y?.scopes, [t.AccountingConfigReadOrg]), x = ee({ enabled: b }), S = _.data, C = !g || !!S, w = !u && C && !!g && S?.status !== "draft", ot = !u && !!S && !_e(S?.status), T = u || ot, E = De({
64
- payable: S,
65
- lineItems: v.lineItems
66
- }), D = S?.counterpart_id;
67
- Ue(() => {
68
- p || D && ($e(D), et(!0));
69
- }, [p, D]);
70
- let st = i((e) => {
71
- et(!0), $e(e);
72
- }, []), O = Ve({
73
- payableId: u ? void 0 : g,
74
- counterpartId: u ? void 0 : f,
75
- payableCounterpartId: D,
76
- isVendorKnown: !u && C,
77
- onCounterpartChange: st,
78
- requiredError: E.errors?.vendor,
79
- payableCounterpartBankAccountId: S?.counterpart_bank_account_id ?? void 0,
80
- extractedVendor: S?.counterpart_raw_data ?? void 0
81
- }), ct = !!(g && p) && !f, lt = _.refetch, ut = i(async () => {
82
- let { data: e } = await lt();
83
- return e?.status ?? void 0;
84
- }, [lt]), dt = a(() => w ? { draftSaved: we.submittedSaved } : void 0, [w]), k = Ee({
85
- payableId: Je,
86
- form: E,
87
- labels: dt,
88
- counterpartId: f,
89
- clearCounterpart: ct,
90
- prepareVendorForSave: O.savePaymentInstructions,
91
- onPayableCreated: it,
92
- onSaved: it,
93
- onDraftSaved: () => l(!1),
94
- onFinalized: () => l(!1),
95
- readSavedStatus: w ? ut : void 0
96
- }), A = !!(k.isSavingDraft || k.isFinalizing), j = u ? g : void 0, M = Ne({
97
- payableId: j,
98
- status: S?.status
99
- }), ft = We(null), N = Fe({
100
- payableId: g,
101
- scheduledPaymentDate: S?.scheduled_payment_date,
102
- enabled: u || w
103
- }), pt = le(S), P = ye(y?.scopes), F = xe({
104
- counterpartId: u ? D : void 0,
105
- currency: S?.currency,
106
- currentBankAccountId: u ? S?.counterpart_bank_account_id ?? void 0 : void 0,
107
- enabled: P && u
108
- }), I = He({
109
- payableId: j,
110
- counterpartId: u ? D : void 0,
111
- currentBankAccountId: S?.counterpart_bank_account_id ?? void 0,
112
- canReadCounterpartBankAccounts: P,
113
- saveErrorMessage: d.detail.paymentInstructionsSaveError,
114
- linkErrorMessage: d.detail.paymentInstructionsLinkError
115
- }), mt = e(y?.scopes, [t.PayableWriteOrg]), L = e(y?.scopes, [t.CounterpartWriteOrg]) && mt, ht = L && ce(S?.status) && !N.hasScheduledPayment && !N.isResolving, R = Ce({
116
- payableId: j,
117
- amountDueMinorUnits: be(S) ?? 0,
118
- amountToPayMinorUnits: S?.amount_to_pay ?? void 0,
119
- currencyCode: S?.currency ?? void 0,
120
- dueDate: S?.due_date,
121
- hasScheduledPayment: N.hasScheduledPayment,
122
- labels: d.markAsPaid
123
- }), z = je({
124
- payableId: j,
125
- approvalPolicyId: S?.approval_policy_id,
126
- enabled: u,
127
- copy: d.approvalPolicyCopy
128
- }), gt = ve({
129
- status: S?.status,
130
- scopes: y?.scopes,
131
- arePendingApproversUnknown: z.isLoading,
132
- hasApprovalPolicy: !!S?.approval_policy_id,
133
- hasWaitingRequest: M.hasWaitingRequest
134
- }), _t = u || w ? g : void 0, vt = u ? Ze : void 0, { actions: B, decisionDialog: yt, isActionPending: bt } = Pe({
135
- payableId: _t,
136
- status: S?.status,
137
- currentApprovalRequestId: M.id,
138
- arePendingApproversUnknown: z.isLoading,
139
- hasScheduledPayment: N.hasScheduledPayment,
140
- scheduledPaymentIntentId: N.scheduledPaymentIntentId,
141
- isScheduledPaymentUnknown: N.isResolving,
142
- isPayabilityUnknown: F.isLoading,
143
- hasApprovalPolicy: !!S?.approval_policy_id,
144
- hasWaitingRequest: M.hasWaitingRequest,
145
- pendingApprovers: z.pendingApprovers,
146
- labels: d.actions,
147
- isMarkAsPaidPending: R.isPending,
148
- onMarkAsPaidSelect: R.open,
149
- onPayBillSelect: () => ft.current?.open(),
150
- onEditSelect: vt,
151
- onActionSucceeded: (e) => {
152
- if (e === "reopen") {
153
- vt?.();
154
- return;
155
- }
156
- w && l(!1);
157
- }
158
- }), V = Ie({
159
- payableId: g,
160
- status: S?.status,
161
- enabled: !u,
162
- labels: d.deleteDraft,
163
- onDeleted: () => l(!1)
164
- }), H = A || bt, U = _.isLoading || v.isResolving || x.isResolving || F.isLoading, W = _.isError || v.isError || x.isError, xt = a(() => [...V.menuItems, ...w || u && !U && !W ? B.menu.map((e) => ({
165
- id: e.id,
166
- label: e.label,
167
- onSelect: e.onSelect,
168
- disabled: e.disabled,
169
- icon: e.icon,
170
- sectionHeading: e.sectionHeading
171
- })) : []], [
172
- B.menu,
173
- V.menuItems,
174
- w,
175
- u,
176
- U,
177
- W
178
- ]), G = a(() => (x.data?.data ?? []).map((e) => ({
179
- value: e.id,
180
- label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
181
- })), [x.data]), K;
182
- at && (b ? x.isError ? K = d.lineItemsGlCodeUnavailable.loadError : !x.isResolving && G.length === 0 && (K = d.lineItemsGlCodeUnavailable.empty) : K = d.lineItemsGlCodeUnavailable.noAccess);
183
- let St = !at || !!K || x.isResolving, Ct = b && !x.isResolving && !x.isError, q = ae(j), wt = S?.status === "rejected" || !u && w, Tt = e(y?.scopes, [t.ApprovalRequestReadOrg]), Et = wt && Tt, Dt = e(y?.scopes, [t.UserReadOrg]), J = te({ enabled: (u || wt) && Dt }), Ot = a(() => ze(q.data?.data ?? [], J.data?.data ?? [], d.history), [
184
- q.data,
185
- J.data,
186
- d.history
187
- ]), kt = Ae({
188
- payableId: g,
189
- enabled: Et
190
- }), At = ie(g, { enabled: Et }), jt = a(() => ke(At.data?.data, kt.roundStartedAt), [At.data, kt.roundStartedAt]), Y = a(() => Me({
191
- payableStatus: S?.status,
192
- approvalRequests: jt,
193
- users: J.data?.data ?? [],
194
- payableUpdatedAt: S?.updated_at,
195
- labels: d.detail
196
- }), [
197
- S?.status,
198
- S?.updated_at,
199
- jt,
200
- J.data,
201
- d.detail
202
- ]), Mt = a(() => Oe({
203
- records: N.paymentRecords,
204
- events: q.data?.data ?? [],
205
- currencyCode: S?.currency,
206
- labels: d.detail
207
- }), [
208
- N.paymentRecords,
209
- q.data,
210
- S?.currency,
211
- d.detail
212
- ]), Nt = a(() => u && S ? Le({
213
- payable: S,
214
- lineItems: v.lineItems,
215
- glCodeOptions: G,
216
- glCodeRosterAvailable: Ct,
217
- history: Ot,
218
- paymentHistory: Mt,
219
- approvalPolicy: z.view,
220
- labels: d.detail,
221
- hasScheduledPayment: N.hasScheduledPayment,
222
- rejection: Y,
223
- payableAchInstructions: F.achInstructions,
224
- payableAchInstructionsReadable: P && !F.isError
225
- }) : void 0, [
226
- N.hasScheduledPayment,
227
- z.view,
228
- P,
229
- d.detail,
230
- G,
231
- Ct,
232
- Ot,
233
- v.lineItems,
234
- S,
235
- F.achInstructions,
236
- F.isError,
237
- Mt,
238
- u,
239
- Y
240
- ]), Pt = S?.source_of_payable_data === "ocr", X = pt?.name, Ft = u ? X ? d.viewTitle(X) : d.readOnlyTitle : X && (Pt || w) ? d.extractedTitle(X) : d.newTitle, It = u && S?.created_at ? d.addedOn(ne(S.created_at.slice(0, 10))) : void 0, Z = i(() => {
241
- let e = E.isDirty || O.hasUnsavedVendorChanges || !!k.stagedFile || k.isFileDeletionPending;
242
- switch (Re({
243
- isUnsavedPromptOpen: m,
244
- isLocked: T,
245
- isDirty: e
246
- })) {
247
- case "dismiss-prompt":
248
- h(!1);
249
- return;
250
- case "prompt":
251
- h(!0);
252
- return;
253
- default: l(!1);
254
- }
255
- }, [
256
- k.isFileDeletionPending,
257
- k.stagedFile,
258
- E.isDirty,
259
- T,
260
- m,
261
- l,
262
- O.hasUnsavedVendorChanges
263
- ]), Lt = i(() => {
264
- h(!1), l(!1);
265
- }, [l]), Q = v.isResolving || O.mode === "creating", Rt = i(async () => {
266
- if (Q) return;
267
- let e = await k.saveDraft();
268
- h(!1), e && l(!1);
269
- }, [
270
- k,
271
- Q,
272
- l
273
- ]), $ = ge({
274
- payable: S,
275
- onRemoved: () => l(!1),
276
- canManage: mt
277
- }), zt = i((e) => {
278
- if (!(H || $.isBusy)) return e ? l(!0) : Z();
279
- }, [
280
- $.isBusy,
281
- H,
282
- Z,
283
- l
284
- ]), Bt = $.isPossibleDuplicate, Vt = !u && Pt && !tt, Ht = !u && !!Y, Ut = Ht || Bt || Vt ? /* @__PURE__ */ Ke(Ge, { children: [
285
- Ht && Y ? /* @__PURE__ */ s(fe, {
286
- ...Y,
287
- labels: d.rejectedBanner
288
- }) : null,
289
- Bt ? /* @__PURE__ */ s(de, {
290
- onNotADuplicate: $.onNotADuplicate,
291
- onRemoveBill: $.onRemoveBill,
292
- isActionDisabled: $.isBusy,
293
- labels: $.removeBillLabel ? { removeBillButton: $.removeBillLabel } : void 0,
294
- testId: r.duplicateNotice
295
- }) : null,
296
- Vt ? /* @__PURE__ */ s(pe, { onDismiss: () => nt(!0) }) : null
297
- ] }) : void 0;
298
- return /* @__PURE__ */ Ke(Ge, { children: [
299
- /* @__PURE__ */ s(ue, {
300
- open: c,
301
- onOpenChange: zt,
302
- title: Ft,
303
- subtitle: It,
304
- notice: Ut,
305
- vendor: {
306
- ...O,
307
- testId: r.vendorSection
308
- },
309
- values: E.values,
310
- errors: E.errors,
311
- onChange: E.onChange,
312
- lineItems: {
313
- items: E.lineItemRows,
314
- glCodeOptions: G,
315
- glCodeDisabled: St,
316
- glCodeUnavailableMessage: K,
317
- discount: E.discount,
318
- onDiscountChange: E.onDiscountChange,
319
- tax: E.tax,
320
- onTaxChange: E.onTaxChange,
321
- total: E.total,
322
- onTotalChange: E.onTotalChange,
323
- onAddLineItem: E.onAddLineItem,
324
- errors: E.lineItemErrors,
325
- totalsErrors: E.totalsErrors,
326
- testId: r.lineItems
327
- },
328
- documentPanel: /* @__PURE__ */ s(Be, {
329
- payableId: g,
330
- readOnly: T,
331
- isDocumentPending: !!g && !S?.file && (_.isLoading || S?.ocr_status === "processing"),
332
- file: S?.file ? {
333
- id: S.file.id,
334
- name: S.file.name,
335
- url: S.file.url,
336
- mimetype: S.file.mimetype
337
- } : void 0,
338
- staging: {
339
- stagedFile: k.stagedFile,
340
- onFileStaged: k.stageFile,
341
- onClearStagedFile: k.clearStagedFile,
342
- isSaving: A
343
- },
344
- deletion: {
345
- isPending: k.isFileDeletionPending,
346
- onRequest: k.requestFileDeletion,
347
- onDetachNow: k.detachFileNow,
348
- isDeleting: k.isDeletingFile,
349
- hasFailed: k.hasFileDeletionFailed
350
- }
351
- }),
352
- menuItems: xt,
353
- readOnly: T,
354
- detail: u ? {
355
- view: Nt,
356
- actions: B,
357
- scheduledSummary: N.hasScheduledPayment && N.scheduledDateLabel ? d.scheduledSummary(N.scheduledDateLabel) : void 0,
358
- showApprovalOverrideNotice: gt && !!S?.approval_policy_id,
359
- onEditPaymentInstructions: D && ht ? I.open : void 0,
360
- paymentInstructionsForm: D && (ht || L && S?.status === "rejected") ? {
361
- isOpen: I.isOpen,
362
- values: I.values,
363
- errors: I.errors,
364
- isSaving: I.isSaving,
365
- onOpen: I.open,
366
- onCancel: I.close,
367
- onChange: I.onChange,
368
- onSave: I.save
369
- } : void 0,
370
- hideMissingPaymentInstructions: S?.status === "paid" || S?.status === "canceled",
371
- isLoading: U,
372
- isError: W,
373
- paymentHistoryError: N.isError || q.isError,
374
- paymentHistoryLoading: N.isResolving || q.isLoading
375
- } : void 0,
376
- isLineItemsLoading: v.isResolving,
377
- isSaving: H,
378
- isSavingDraft: k.isSavingDraft,
379
- isSubmitting: k.isFinalizing,
380
- onCancel: Z,
381
- onCollapse: u ? Xe : void 0,
382
- onSaveDraft: k.saveDraft,
383
- onFinalize: k.finalize,
384
- scrollToErrorToken: k.scrollToErrorToken,
385
- showSubmit: !T && C,
386
- testId: r.dialog
387
- }),
388
- /* @__PURE__ */ s(he, {
389
- open: m,
390
- onSaveDraft: Rt,
391
- onDiscard: Lt,
392
- onCancel: () => h(!1),
393
- isSaving: k.isSavingDraft,
394
- isSaveDraftDisabled: Q,
395
- labels: d.unsavedChanges,
396
- testId: r.unsavedDialog,
397
- saveDraftTestId: r.unsavedSaveDraft,
398
- discardTestId: r.unsavedDiscard,
399
- closeTestId: r.unsavedClose
400
- }),
401
- /* @__PURE__ */ s(n, {
402
- ...yt,
403
- labels: { cancelButton: d.actions.decisionDialog.cancelButton },
404
- testId: r.decisionDialog,
405
- confirmTestId: r.decisionConfirm,
406
- reasonTestId: r.decisionReason
407
- }),
408
- /* @__PURE__ */ s(n, {
409
- ...V.dialog,
410
- labels: { cancelButton: d.actions.decisionDialog.cancelButton },
411
- testId: r.deleteDraftDialog,
412
- confirmTestId: r.deleteDraftConfirm
413
- }),
414
- /* @__PURE__ */ s(n, {
415
- open: $.removeConfirmation.open,
416
- copy: $.removeConfirmation.copy,
417
- onConfirm: $.removeConfirmation.onConfirm,
418
- onCancel: $.removeConfirmation.onCancel,
419
- isPending: $.removeConfirmation.isPending,
420
- confirmIcon: /* @__PURE__ */ s(qe, {}),
421
- labels: { cancelButton: $.removeConfirmation.cancelButtonLabel },
422
- testId: r.duplicateRemoveDialog,
423
- confirmTestId: r.duplicateRemoveConfirm
424
- }),
425
- /* @__PURE__ */ s(me, { ...R.dialogProps }),
426
- u && S ? /* @__PURE__ */ s(Se, {
427
- ref: ft,
428
- payable: S,
429
- onMissingAchInstructions: L ? I.open : void 0,
430
- poweredByBankName: Qe,
431
- labels: d.payBill
432
- }) : null
433
- ] });
434
- }
2
+ var e = {
3
+ dialog: "bill-pay-bill-create-dialog",
4
+ vendorSection: "bill-pay-bill-create-vendor",
5
+ lineItems: "bill-pay-bill-create-line-items",
6
+ documentPanel: "bill-pay-bill-create-document",
7
+ duplicateNotice: "bill-pay-bill-create-duplicate-notice",
8
+ duplicateRemoveDialog: "bill-pay-bill-create-duplicate-remove-dialog",
9
+ duplicateRemoveConfirm: "bill-pay-bill-create-duplicate-remove-confirm",
10
+ decisionDialog: "bill-pay-bill-decision-dialog",
11
+ decisionConfirm: "bill-pay-bill-decision-confirm",
12
+ decisionReason: "bill-pay-bill-decision-reason",
13
+ deleteDraftDialog: "bill-pay-bill-delete-draft-dialog",
14
+ deleteDraftConfirm: "bill-pay-bill-delete-draft-confirm",
15
+ unsavedDialog: "bill-pay-bill-unsaved-dialog",
16
+ unsavedSaveDraft: "bill-pay-bill-unsaved-save-draft",
17
+ unsavedDiscard: "bill-pay-bill-unsaved-discard",
18
+ unsavedClose: "bill-pay-bill-unsaved-close"
19
+ };
435
20
  //#endregion
436
- export { c as BillCreateDialog, c as default };
21
+ export { e as billCreateTestIds };